/* ------------------------------------------------------------------ nav */
.nav {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 30;
  height: var(--header-h);
  display: flex;
  align-items: center;
  padding-inline: var(--gutter);
  background: rgba(255, 255, 255, 0.82);
  border-bottom: 1px solid var(--line);
  -webkit-backdrop-filter: saturate(1.4) blur(14px);
  backdrop-filter: saturate(1.4) blur(14px);
}
.nav-inner {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 28px;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  font-family: var(--display);
  font-weight: 500;
  font-size: 19px;
  letter-spacing: -0.02em;
}
.brand-mark {
  display: block;
  flex-shrink: 0;
  width: 22px;
  height: 22px;
}
.nav-links {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 14.5px;
  color: var(--muted);
}
.nav-item {
  position: relative;
}
.nav-trigger,
.nav-top {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 36px;
  padding: 0 12px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: inherit;
  font: inherit;
  cursor: pointer;
  transition:
    background-color 0.15s ease,
    color 0.15s ease;
}
.nav-trigger:hover,
.nav-top:hover,
.nav-item.is-open .nav-trigger,
.nav-signin:hover {
  color: var(--fg);
}
.nav-item.is-open .nav-trigger,
.nav-trigger:hover,
.nav-top:hover {
  background: var(--tint);
}
.nav-item[data-active] .nav-trigger,
.nav-top[aria-current='page'] {
  color: var(--fg);
}
.nav-chevron {
  opacity: 0.6;
  transition: transform 0.2s ease;
}
.nav-item.is-open .nav-chevron {
  transform: rotate(180deg);
}
/* Dropdown panels: opened by hover (with a short grace period) or by the trigger button. */
.nav-panel {
  position: absolute;
  top: calc(100% + 10px);
  left: 50%;
  z-index: 40;
  display: none;
  padding: 10px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 18px;
  box-shadow:
    0 2px 4px rgba(24, 24, 26, 0.04),
    0 24px 60px -24px rgba(24, 24, 26, 0.32);
  transform: translateX(-50%);
}
.nav-panel::before {
  content: '';
  position: absolute;
  inset: -12px 0 auto;
  height: 12px;
}
.nav-item.is-open .nav-panel {
  display: block;
  animation: nav-in 0.16s ease-out;
}
@keyframes nav-in {
  from {
    opacity: 0;
    transform: translate(-50%, -4px);
  }
}
.nav-panel--tools {
  left: 0;
  width: min(880px, calc(100vw - 2 * var(--gutter)));
  transform: translateX(-12%);
}
.nav-item.is-open .nav-panel--tools {
  animation: none;
}
.nav-cols {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 4px;
}
.nav-col__title {
  margin: 8px 12px 6px;
  color: var(--faint);
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.nav-card,
.nav-case,
.nav-row {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  padding: 9px 12px;
  border-radius: 12px;
  color: var(--fg);
  transition: background-color 0.15s ease;
}
.nav-card:hover,
.nav-case:hover,
.nav-row:hover,
.nav-card[aria-current='page'],
.nav-case[aria-current='page'],
.nav-row[aria-current='page'] {
  background: var(--tint);
}
.nav-card .tool-icon {
  width: 18px;
  height: 18px;
  margin-top: 2px;
  color: var(--accent);
}
.nav-card__name {
  display: block;
  font-size: 14px;
  font-weight: 500;
  line-height: 1.3;
}
.nav-card__text {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: 12.5px;
  line-height: 1.4;
}
.nav-panel__foot {
  display: flex;
  gap: 18px;
  justify-content: flex-end;
  margin-top: 6px;
  padding: 10px 12px 4px;
  border-top: 1px solid var(--line);
}
.nav-foot-link {
  color: var(--fg);
  font-size: 13.5px;
  font-weight: 500;
}
.nav-foot-link:hover {
  color: var(--accent-ink);
}
.nav-panel--cases {
  display: none;
  width: 360px;
}
.nav-item.is-open .nav-panel--cases {
  display: grid;
}
.nav-case {
  align-items: center;
}
.nav-case img {
  flex: none;
  width: 64px;
  height: 44px;
  border-radius: 8px;
  object-fit: cover;
}
.nav-panel--pricing {
  width: 300px;
}
.nav-row {
  display: block;
}
.nav-actions {
  display: flex;
  align-items: center;
  gap: 18px;
  margin-left: auto;
}
.nav-signin {
  font-size: 14.5px;
  color: var(--muted);
}
/* Signed in (js/ui.js reads the account proxy's hint): the account menu takes Sign in's place. */
.signed-in-only {
  display: none;
}
.is-signed-in .signed-out-only {
  display: none;
}
.is-signed-in .nav-account,
.is-signed-in .mobile-group.signed-in-only {
  display: block;
}
.nav-account .nav-trigger {
  gap: 7px;
  font-size: 14.5px;
  color: var(--muted);
}
.nav-person {
  opacity: 0.85;
}
/* Sign out closes the account menu, set apart from the links above it. */
.nav-row--end {
  margin-top: 6px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
  border-radius: 0 0 12px 12px;
}
.nav-panel--account {
  left: auto;
  right: 0;
  width: 280px;
  transform: none;
}
.nav-item.is-open .nav-panel--account {
  animation-name: nav-in-down;
}
@keyframes nav-in-down {
  from {
    opacity: 0;
    transform: translateY(-4px);
  }
}
.is-signed-in .mobile-actions {
  display: none;
}

.mobile-menu {
  display: none;
}
html.menu-open {
  overflow: hidden;
}
.mobile-menu > summary {
  display: grid;
  place-content: center;
  gap: 5px;
  width: 40px;
  height: 40px;
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  list-style: none;
  cursor: pointer;
}
.mobile-menu summary::-webkit-details-marker {
  display: none;
}
.mobile-menu > summary::before,
.mobile-menu > summary::after {
  content: '';
  display: block;
  width: 16px;
  height: 1.5px;
  background: var(--fg);
  transition: transform 0.2s ease;
}
/* Open, the two bars cross into a close mark (bar centres are 6.5px apart). */
.mobile-menu[open] > summary::before {
  transform: translateY(3.25px) rotate(45deg);
}
.mobile-menu[open] > summary::after {
  transform: translateY(-3.25px) rotate(-45deg);
}
/* Positioned against the fixed header: its backdrop filter makes it the containing block, so a
   fixed sheet would size to the header instead of the window. The sheet starts on the header's 1px
   bottom border (top: 100% of its padding box), so it is 1px taller to reach the window's foot. */
.mobile-sheet {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  height: calc(100dvh - var(--header-h) + 1px);
  z-index: 35;
  display: grid;
  align-content: start;
  gap: 2px;
  padding: 12px var(--pad) 32px;
  overflow-y: auto;
  background: var(--bg);
  border-top: 1px solid var(--line);
}
.mobile-group > summary,
.mobile-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 52px;
  border-bottom: 1px solid var(--line);
  color: var(--fg);
  font-family: var(--display);
  font-size: 1.15rem;
  font-weight: 500;
  list-style: none;
  cursor: pointer;
}
.mobile-group > summary::after {
  content: '+';
  color: var(--faint);
  font-family: var(--font);
  font-weight: 400;
}
.mobile-group[open] > summary::after {
  content: '–';
}
.mobile-group > div {
  display: grid;
  padding: 6px 0 14px;
}
.mobile-group a {
  padding: 9px 0;
  color: var(--muted);
  font-size: 15.5px;
}
.mobile-group__title {
  margin: 12px 0 2px;
  color: var(--faint);
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.mobile-group a.mobile-all {
  color: var(--fg);
  font-weight: 500;
}
.mobile-actions {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
  margin-top: 20px;
}
.mobile-actions .btn {
  justify-content: center;
}

/* js/ui.js closes an open menu when the window grows past this width. */
@media (max-width: 1060px) {
  .nav-links,
  .nav-signin,
  .is-signed-in .nav-account {
    display: none;
  }
  .mobile-menu {
    display: block;
  }
  .nav-actions {
    gap: 10px;
  }
}

/* ------------------------------------------------------------------ footer */
.footer {
  margin-top: -1px;
  /* While the consent banner is shown, the last footer row can still scroll above it. */
  padding: 57px var(--gutter) calc(28px + var(--consent-space, 0px));
  font-size: 14px;
}
.footer::after {
  content: '';
  position: absolute;
  top: 0;
  left: var(--gutter);
  right: var(--gutter);
  border-top: 1px solid var(--night-line);
}
.footer .inner {
  color: var(--night-muted);
}
.footer-main {
  display: grid;
  grid-template-columns: minmax(0, 1.6fr) repeat(5, minmax(0, 1fr));
  gap: 32px;
  align-items: start;
}
.footer-brand .brand {
  color: var(--night-fg);
}
.footer-brand p {
  max-width: 18em;
  margin: 14px 0 0;
}
.footer-cta {
  margin-top: 18px;
}
.footer-heading {
  margin: 0 0 14px;
  font-family: var(--mono);
  font-size: 11.5px;
  font-weight: 400;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--night-faint);
}
.footer-nav {
  display: grid;
  justify-items: start;
  gap: 10px;
}
.footer-nav a {
  line-height: 1.4;
}
.footer a:hover,
.footer-nav a[aria-current='page'] {
  color: var(--night-fg);
}
.footer-consent {
  padding: 0;
  border: 0;
  background: none;
  color: inherit;
  text-align: start;
  line-height: 1.4;
  cursor: pointer;
}
.footer-consent:hover {
  color: var(--night-fg);
}
.footer-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-top: 56px;
  padding-top: 20px;
  border-top: 1px solid var(--night-line);
  font-size: 13px;
}
.footer-bottom p {
  margin: 0;
}

/* Six columns need the full content width (71rem plus gutters, from 1216px); narrower, the link
   lists wrap, so the brand takes its own row above the five groups. */
@media (max-width: 1215px) {
  .footer-main {
    grid-template-columns: repeat(5, minmax(0, 1fr));
  }
  .footer-brand {
    grid-column: 1 / -1;
  }
}
@media (max-width: 960px) {
  .footer-main {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .footer-brand {
    grid-column: 1 / -1;
  }
}
@media (max-width: 600px) {
  /* 40px tap targets at the same 42px pitch as before. */
  .footer-nav {
    gap: 2px;
  }
  .footer-nav a,
  .footer-consent {
    display: flex;
    align-items: center;
    min-height: 40px;
  }
  .footer-bottom {
    align-items: flex-start;
    flex-direction: column;
  }
}

/* ------------------------------------------------------------------ consent */
/* consent.js sets --consent-space to the banner's footprint, so focused controls scroll clear of it. */
html {
  scroll-padding-bottom: var(--consent-space, 0px);
}
.consent {
  position: fixed;
  inset: auto 16px 16px 16px;
  z-index: 60;
  max-width: 56rem;
  margin-inline: auto;
  padding: 16px 18px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow:
    var(--shadow-card),
    0 24px 48px -24px rgba(24, 24, 26, 0.3);
}
.consent-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px 24px;
}
.consent-copy {
  margin: 0;
  max-width: 40rem;
  font-size: 14px;
  color: var(--muted);
}
.consent-copy a {
  color: var(--fg);
  text-decoration: underline;
  text-underline-offset: 2px;
}
.consent-actions {
  display: flex;
  gap: 8px;
}
.consent-button {
  height: 38px;
  padding: 0 16px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: var(--surface);
  font-size: 14px;
  cursor: pointer;
}
.consent-button:hover {
  border-color: var(--fg);
}
.consent-accept {
  border-color: transparent;
  background: linear-gradient(#2a2a2e, var(--fg));
  color: var(--night-fg);
}
.consent-accept:hover {
  border-color: transparent;
  background: linear-gradient(#333338, #1e1e21);
}
