/* ==========================================================================
   Vivah · the one header and the one footer
   --------------------------------------------------------------------------
   🔑 ONE HEADER AND ONE FOOTER FOR THE WHOLE SITE — every public page AND the
   React application, before sign-in and after it. The markup is two Twig
   partials, templates/public/_site_header.html.twig and _site_footer.html.twig,
   and this file is their design. Signing in changes the MENU; it never changes
   the header.

   It is a file of its own because the application's page cannot load site.css.
   That file's base rules restyle `body`, `a`, `button`, `p` and every heading,
   and around the application they would repaint screens drawn with Tailwind. So
   everything here is scoped to the chrome's own class names — none of which the
   application uses — and the few element rules the chrome needs are written
   under `.site-header` and `.site-footer` rather than against the document.

   Every value is a var(--token) from tokens.css, which both pages load.
   ========================================================================== */

/* ---------------------------------------------------------------- 1. frame */

/*
 * 🔴 `hidden` MUST BEAT EVERY `display` RULE ON THE PAGE.
 *
 * The header hides one of its two menus and one of its two sets of actions with the HTML
 * attribute, and the mobile panel is `hidden` until the burger is pressed — but
 * `.nav-panel { display: grid }` and `.nav-auth { display: flex }` are both more specific
 * than the user-agent's `[hidden] { display: none }`. Without this, a desktop page renders
 * the mobile menu expanded under the header and offers Sign in and Dashboard at the same
 * time, which is exactly how it shipped the first time.
 */
[hidden] {
  display: none !important;
}

body.is-locked {
  overflow: hidden;
}

/*
 * 🔑 THE HEADER'S HEIGHT, AS ONE VALUE EVERY PAGE CAN READ. The bar is `--layout-header-h`
 * tall at the top of a page and shrinks once the page has moved; anything pinned under it —
 * the bio-data form's progress bar — reads `--site-header-h` and follows it down and back.
 * The shrink used to be a rule on `.is-scrolled > .wrap` that nothing outside the header
 * could see.
 */
:root {
  --site-header-h: var(--layout-header-h);
  /* The fixed header would otherwise cover the heading an in-page link jumps to. */
  scroll-padding-top: calc(var(--layout-header-h) + var(--space-4));
}

:root:has(.site-header.is-scrolled) {
  --site-header-h: 68px;
}

/*
 * The application's page: the header is out of flow, so the app's mount point makes room
 * for it — what `main { padding-top }` in site.css does for the public pages.
 */
.site-body {
  padding-top: var(--layout-header-h);
}

/*
 * 🔴 AROUND THE APPLICATION, THE FOOTER IS NEVER THE SCROLL ANCHOR. On a phone it is taller
 * than the screen, so a devotee flicked to the end of search sees only the footer, and
 * Chrome anchored to it: each page of results landed above and the footer stayed put, the
 * load-more sentinel never left range, and infinite scroll stopped at forty cards. Unanchored,
 * a new page appears under the devotee instead, as it did when the app drew its own short
 * footer. The sentinel is excluded as well — assets/features/search/useSearch.ts.
 */
.site-body ~ .site-footer {
  overflow-anchor: none;
}

.skip {
  position: absolute;
  left: var(--space-4);
  top: -100%;
  z-index: 200;
  padding: var(--space-3) var(--space-5);
  font-family: var(--font-body);
  font-size: var(--text-sm);
  background: var(--bg-raised);
  color: var(--brand-primary-800);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-3);
  transition: top var(--duration-base) var(--ease-standard);
}

.skip:focus {
  top: var(--space-4);
}

/*
 * 🔑 THE CHROME SETS ITS OWN TYPE. It used to inherit it from site.css's `body`, and the
 * application's `body` is set smaller and tighter — so without this the one header would
 * be drawn at two sizes, depending on which side of sign-in the page was.
 */
.site-header,
.site-footer,
.nav-panel {
  color: var(--text-primary);
  font-family: var(--font-body);
  font-size: var(--text-md);
  font-weight: var(--weight-light);
  font-variation-settings: var(--vary-body);
  line-height: var(--leading-relaxed);
  font-variant-numeric: lining-nums;
  -webkit-font-smoothing: antialiased;
}

/* The element rules the chrome relies on, which site.css gives the public pages globally
   and the application's page does not. `:where()` keeps them as weak as the originals.
   `.nav-panel` is listed with the header because the phone's drawer is its sibling, not its
   child — see "the phone's menu" below. */
:where(.site-header, .site-footer, .nav-panel) *,
:where(.site-header, .site-footer, .nav-panel) *::before,
:where(.site-header, .site-footer, .nav-panel) *::after {
  box-sizing: border-box;
}

:where(.site-header, .site-footer, .nav-panel) a {
  color: inherit;
  text-decoration: none;
}

:where(.site-header, .site-footer, .nav-panel) button {
  font: inherit;
  color: inherit;
  background: none;
  border: 0;
  padding: 0;
  cursor: pointer;
}

:where(.site-header, .site-footer, .nav-panel) img {
  display: block;
  max-width: 100%;
  height: auto;
}

:where(.site-header, .site-footer, .nav-panel) :where(h2, p, ul, form) {
  margin: 0;
}

:where(.site-header, .site-footer, .nav-panel) :focus-visible {
  outline: 2px solid var(--border-focus);
  outline-offset: 3px;
  border-radius: var(--radius-sm);
}

.wrap {
  width: 100%;
  max-width: var(--layout-content-max);
  margin-inline: auto;
  padding-inline: var(--layout-gutter);
}

.wrap--narrow {
  max-width: 880px;
}

/* ------------------------------------------------------------- 2. controls */

.btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  min-height: var(--layout-tap-target);
  padding: var(--space-3) var(--space-8);
  font-size: var(--text-2xs);
  font-weight: var(--weight-medium);
  letter-spacing: var(--tracking-wider);
  text-transform: uppercase;
  color: var(--text-inverse);
  background-image: var(--gradient-brand);
  border: 1px solid var(--brand-primary-800);
  /*
   * NEARLY SQUARE, NOT A PILL. The reference's buttons are rectangles — that is what lets
   * a 12px letterspaced label read as a stamped mark rather than as a tag, and it is the
   * difference Sujay pointed at between our header's rounded "REGISTER FREE" and the
   * reference's "RSVP". The colour stays ours: `gradient-brand` is R1's action fill, the
   * lightest rose that carries ivory type at 4.5:1, and only the geometry was ever wrong.
   */
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-brand), inset 0 1px 0 var(--sheen-brand),
    inset 0 -1px 0 var(--sheen-brand-shade);
  isolation: isolate;
  overflow: hidden;
  transition: transform var(--duration-base) var(--ease-standard),
    box-shadow var(--duration-base) var(--ease-standard);
}

.btn:hover {
  background-image: var(--gradient-brand-hover);
  transform: translateY(-1px);
}

.btn:active {
  transform: translateY(0);
  box-shadow: var(--shadow-inset-well);
}

/* The ink button — the second action in a pair, where two roses would compete. */
.btn--ink {
  color: var(--text-inverse);
  background-image: none;
  background-color: var(--brand-secondary-700);
  border-color: var(--brand-secondary-700);
  box-shadow: var(--shadow-2);
}

.btn--ink:hover {
  background-image: none;
  background-color: var(--text-secondary);
}

.btn--outline {
  color: var(--brand-primary-800);
  background-image: none;
  background-color: transparent;
  border-color: var(--border-strong);
  box-shadow: none;
}

.btn--outline:hover {
  color: var(--brand-primary-800);
  background-color: var(--brand-primary-100);
  border-color: var(--brand-primary-600);
}

/* The reference's small button is 12px by 26px on 0.26em — a stamped mark rather than a
   chip. Ours was 8px by 20px on 0.08em, which is most of why the header's register button
   looked smaller and softer than the RSVP it is meant to echo. */
.btn--sm {
  min-height: 0;
  padding: var(--space-3) var(--space-6);
  font-size: var(--text-2xs);
  letter-spacing: var(--tracking-wider);
}

.btn--wide {
  width: 100%;
}

/* A label that wraps inside a narrow column wraps centred, not ragged-left. */
.btn {
  text-align: center;
}

/*
 * In the header a button never wraps. "Register free" broke onto two lines at 390px and
 * the pill doubled in height, crowding the wordmark it sits beside. The tagline under the
 * wordmark gives way instead on the narrowest phones — it is the least necessary thing in
 * the bar, and the register button is the most.
 */
.site-header .btn {
  white-space: nowrap;
}

@media (max-width: 30rem) {
  .site-header .brand-tag {
    display: none;
  }
  .site-header .btn--sm {
    padding-inline: var(--space-4);
  }
}

.link-quiet {
  color: var(--text-secondary);
  transition: color var(--duration-base) var(--ease-standard);
}

.link-quiet:hover {
  color: var(--brand-primary-800);
}

/* --------------------------------------------------------------- 3. header */

/*
 * FIXED, NOT STICKY, and `main` carries a matching padding-top (`.site-body` on the
 * application's page).
 *
 * Sticky keeps the header in flow, so the banner started below it — and the header's own
 * pale scrim met the banner's blush wash in a hard horizontal seam directly under the
 * wordmark. Out of flow, the banner runs to the top of the viewport and the header is
 * genuinely transparent over it, which is the whole effect.
 *
 * 🔴 `z-index: 40`, UNDER THE APPLICATION'S LAYERS. It was 100, which is above every dialog,
 * sheet, popover and select list the app opens (50) and its toasts (60): a dialog's backdrop
 * would have dimmed the page and left the header bright and clickable on top of it. Nothing on
 * the public pages sits between 3 and 200, so 40 changes nothing there.
 */
.site-header {
  position: fixed;
  inset: 0 0 auto;
  z-index: 40;
  transition: background-color var(--duration-slow) var(--ease-standard),
    box-shadow var(--duration-slow) var(--ease-standard);
}

/*
 * Transparent over the banner, glass once the page has moved.
 *
 * The gradient scrim rather than nothing at all: the banner behind it is a pale
 * wash with an illustration in it, and dark nav text over the illustration's
 * lighter areas is the one place this design can lose contrast.
 */
.site-header::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: -1;
  background: linear-gradient(
    180deg,
    color-mix(in srgb, var(--bg-band-blush) 96%, transparent),
    color-mix(in srgb, var(--bg-band-blush) 0%, transparent)
  );
  transition: opacity var(--duration-slow) var(--ease-standard);
  pointer-events: none;
}

.site-header.is-scrolled::before {
  opacity: 0;
}

.site-header.is-scrolled {
  background: var(--glass-bg);
  box-shadow: 0 1px 0 var(--border-subtle);
}

@supports (backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px)) {
  .site-header.is-scrolled {
    -webkit-backdrop-filter: blur(var(--glass-blur)) saturate(160%);
    backdrop-filter: blur(var(--glass-blur)) saturate(160%);
  }
}

/*
 * 🔑 THREE TRACKS: BRAND LEFT, NAV CENTRED, ACTIONS RIGHT.
 *
 * ⚠️ THIS REVERSES AN EARLIER DECISION, DELIBERATELY. The rule here used to say "NOT
 * space-between, which floats the nav in the middle of the bar" — the nav sat tight
 * against the wordmark with the actions pushed away by `margin-left: auto`. Sujay's
 * review asked for the reference's arrangement, where the pages ARE in the middle.
 *
 * A grid rather than the reference's `space-between`, because space-between only centres
 * the nav when the two things either side happen to be the same width — and ours are
 * not: the wordmark carries a tagline and the actions are one button. `1fr auto 1fr`
 * centres the nav against the BAR, whatever is beside it, which is what the eye reads as
 * centred. Below 60rem `.nav-links` is `display: none`, the middle track collapses to
 * zero, and the brand and the burger fall to the two edges — which is right there too.
 */
.site-header > .wrap {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: var(--space-5);
  /* 92px at the top of a page, 68px once it has moved — see `--site-header-h` above. */
  height: var(--site-header-h);
  transition: height var(--duration-slow) var(--ease-standard);
}

/*
 * 🔴 EXPLICIT TRACKS, BECAUSE THE NAV DISAPPEARS. Below 60rem `.nav-links` is
 * `display: none`, and a hidden grid child takes no track — so auto-placement moved the
 * actions into the MIDDLE track, and the register button and the burger sat in the centre
 * of the bar on every phone. Pinned, the actions stay in the last track whatever is drawn.
 */
.site-header > .wrap > .brand {
  grid-column: 1;
}

.site-header > .wrap > .nav-links {
  grid-column: 2;
}

.site-header > .wrap > .nav-actions {
  grid-column: 3;
}

/* `min-height`: the lock-up is a link home, and on a phone the name alone is ~33px tall —
   under the 44px tap target e2e/responsive-sweep.spec.ts holds every control to. */
.brand {
  display: inline-flex;
  align-items: center;
  gap: var(--space-3);
  flex-shrink: 0;
  min-height: var(--layout-tap-target);
  color: var(--brand-secondary-700);
}

.brand-mark {
  flex-shrink: 0;
  color: var(--brand-primary-700);
}

.brand-text {
  display: flex;
  flex-direction: column;
  line-height: 1.05;
}

/*
 * The wordmark is the biggest thing in the bar, and that is the reference's own
 * proportion: its logo is set at 34px beside a 12px nav, so the name reads as the name
 * and the navigation reads as navigation. Ours was 25px against a 14px nav — under three
 * points of difference, which is why the two competed and neither won.
 *
 * Letter-spacing goes back to normal with it. Cormorant is a high-contrast old-style face
 * drawn tight; tracking it out at display size is what made the wordmark read as a label.
 */
/*
 * The reference sets its logo at 34px. `2.4vw` lands on exactly that at a 1440px window
 * and scales either side of it, between the two type-scale steps that bracket it — 31px
 * and 39px — so the wordmark is bigger than the 31px ceiling it used to hit while still
 * being bounded by the scale rather than by a number typed off a screenshot.
 */
.brand-name {
  font-family: var(--font-display);
  font-size: clamp(var(--text-2xl), 2.4vw, var(--text-3xl));
  letter-spacing: var(--tracking-normal);
}

.brand-tag {
  font-size: 0.625rem;
  font-weight: var(--weight-regular);
  letter-spacing: var(--tracking-wider);
  text-transform: uppercase;
  color: var(--brand-accent-600);
}

/* The reference spaces its nav by a real gap (16–34px) rather than by padding inside
   each link, which is what lets the words sit as words instead of as adjacent buttons. */
.nav-links {
  display: none;
  align-items: center;
  gap: clamp(var(--space-4), 2vw, var(--space-8));
}

@media (min-width: 60rem) {
  .nav-links {
    display: flex;
  }
}

/*
 * 🔑 UPPERCASE AT 12px ON 0.2em — the reference's nav exactly, and `--tracking-wider`
 * IS 0.2em, so this is the token rather than a number copied off a screenshot.
 *
 * Sentence case at 14px was the single biggest reason the header did not read like the
 * reference: lower-case words in the body face at nearly reading size look like prose
 * that happens to be at the top of the page. Letterspaced small caps read as navigation
 * at a glance, which is the whole job of a nav bar.
 *
 * The ink is `brand.secondary-700` rather than `text.secondary` for the same reason the
 * reference's is `--ink`: a nav that is quieter than the paragraph under it inverts the
 * hierarchy. At 12.38:1 on the canvas it is the strongest pair in the palette.
 */
/*
 * 🔴 `font-weight` ALONE DOES NOTHING HERE, AND THAT IS WHY THE NAV LOOKED WRONG.
 *
 * Jost is a VARIABLE font, and `body` in tokens.css sets
 * `font-variation-settings: var(--vary-body)` — `'wght' 300`. That property inherits to
 * every element and BEATS `font-weight` on a variable face, so the nav rendered at 300
 * however it was weighted. The reference sets a plain `font-weight: 400` over a 300 body
 * and gets 400, because it never uses variation settings at all.
 *
 * Both are set below: the variation for the variable face, and `font-weight` so that a
 * fallback (Helvetica, Arial) is weighted too if Jost has not loaded.
 *
 * This is the whole of "the font colour is not matching" from Sujay's review. The colour
 * was already right — `brand.secondary-700` is #3A2E2A and the reference's `--ink` is
 * #3a2e2a, the same value — but a light 300 at 12px reads as grey next to a 400.
 */
.nav-links a {
  position: relative;
  display: inline-flex;
  align-items: center;
  min-height: var(--layout-tap-target);
  font-size: var(--text-2xs);
  font-weight: var(--weight-regular);
  font-variation-settings: var(--vary-body-regular);
  letter-spacing: var(--tracking-wider);
  text-transform: uppercase;
  color: var(--brand-secondary-700);
  transition: color var(--duration-base) var(--ease-standard);
}

/*
 * The rule under the word GROWS, and the direction carries the meaning: it wipes in from
 * the left when you point at it and sits there when the page is current. That is the
 * reference's own motion, and it replaces a filled pill — a pill in a header reads as a
 * button, and these are locations rather than actions.
 *
 * ⚠️ `transform` is safe here: this pseudo-element has no static transform of its own, so
 * there is nothing for a transition to replace. The rule that bit the banner is about a
 * static transform competing with an ANIMATION on the same property.
 */
.nav-links a::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  bottom: 10px;
  height: 1px;
  background: currentColor;
  transform: scaleX(0);
  transform-origin: right;
  transition: transform var(--duration-slow) var(--ease-out);
}

.nav-links a:hover::after,
.nav-links a[aria-current='page']::after {
  transform: scaleX(1);
  transform-origin: left;
}

/*
 * 🔑 TWO MENUS, ONE DRAWN: the public pages for a visitor, the application's five
 * destinations for a signed-in devotee. The server hides one; see the note at the top of
 * _site_header.html.twig for who swaps them after that. Each set lays its links out exactly
 * as the bar did when it held one menu, so a sign-in changes the words and not the rhythm.
 */
.nav-set {
  display: flex;
  align-items: center;
  gap: inherit;
}

/* `justify-self`, not `margin-left: auto`: the auto margin was what pushed the actions
   away from a nav sitting beside the wordmark. In the three-track grid the actions own
   the last track and simply sit at its end. */
.nav-actions {
  display: flex;
  align-items: center;
  justify-self: end;
  gap: var(--space-3);
}

/*
 * 🔑 THE REGISTER BUTTON SURVIVES ON A PHONE; THE SIGN-IN LINK DOES NOT.
 *
 * Hiding the whole pair below the nav breakpoint put the page's primary action behind a
 * burger on exactly the devices most devotees will open this on. The quiet "Sign in" can
 * live in the menu — somebody who already has an account will look for it — but the
 * thing a first-time visitor is here to do has to be on screen.
 */
.nav-auth {
  display: flex;
  align-items: center;
  gap: var(--space-3);
}

/*
 * ONE BUTTON IN THE BAR, AT EVERY WIDTH — the reference's arrangement, which Sujay asked for
 * in as many words. This used to hide the quiet link on phones only. Sign-in is not lost:
 * the mobile menu carries it as a full-width button (`.nav-panel` uses `btn--outline`, not
 * `.link-quiet`, so this rule does not reach it), and the footer carries it too.
 */
.site-header .nav-auth .link-quiet {
  display: none;
}

/*
 * 🔑 THE ACCOUNT MENU — the signed-in right of the bar, in place of the register button.
 *
 * A <details>, so it opens with no script at all, and the trigger is drawn to sit where the
 * register button sat: the same height and the same letterspaced small caps. It carries who
 * is signed in, Settings and Sign out — the two controls the app once had no way to reach.
 */
.account-menu {
  position: relative;
}

.account-trigger {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  min-height: var(--layout-tap-target);
  padding: var(--space-1);
  font-size: var(--text-2xs);
  font-weight: var(--weight-regular);
  font-variation-settings: var(--vary-body-regular);
  letter-spacing: var(--tracking-wider);
  text-transform: uppercase;
  color: var(--brand-secondary-700);
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-full);
  cursor: pointer;
  list-style: none;
  user-select: none;
  transition: border-color var(--duration-base) var(--ease-standard),
    background-color var(--duration-base) var(--ease-standard);
}

/* The disclosure triangle, which is the browser's and not this design's. `list-style` removes
   it everywhere but Safari, which draws it with its own pseudo-element. */
.account-trigger::-webkit-details-marker {
  display: none;
}

.account-trigger:hover,
.account-menu[open] > .account-trigger {
  border-color: var(--brand-primary-600);
}

.account-avatar {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  flex-shrink: 0;
  color: var(--text-inverse);
  background-color: var(--brand-secondary-700);
  border-radius: var(--radius-full);
}

/* On a phone the trigger is the round avatar alone, beside the burger. The word stays in the
   accessibility tree — clipped, not removed — so the control is still called "Account". */
.account-trigger-label {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.account-chevron {
  display: none;
  color: var(--text-muted);
  transition: rotate var(--duration-base) var(--ease-standard);
}

.account-menu[open] .account-chevron {
  rotate: 180deg;
}

@media (min-width: 60rem) {
  .account-trigger {
    padding-right: var(--space-4);
  }
  .account-trigger-label {
    position: static;
    width: auto;
    height: auto;
    overflow: visible;
    clip-path: none;
  }
  .account-chevron {
    display: block;
  }
}

.account-panel {
  position: absolute;
  top: calc(100% + var(--space-2));
  right: 0;
  width: min(17rem, calc(100vw - 2 * var(--layout-gutter)));
  padding: var(--space-2);
  background: var(--bg-raised);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-3);
}

.account-who {
  display: grid;
  gap: var(--space-1);
  margin: 0 0 var(--space-2);
  padding: var(--space-2) var(--space-3) var(--space-3);
  font-size: var(--text-xs);
  line-height: var(--leading-snug);
  border-bottom: 1px solid var(--border-subtle);
}

.account-who-label {
  color: var(--text-muted);
}

.account-email {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--text-primary);
}

.account-item {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  width: 100%;
  min-height: var(--layout-tap-target);
  padding-inline: var(--space-3);
  font-size: var(--text-sm);
  text-align: left;
  color: var(--text-primary);
  border-radius: var(--radius-sm);
  transition: background-color var(--duration-base) var(--ease-standard),
    color var(--duration-base) var(--ease-standard);
}

.account-item svg {
  flex-shrink: 0;
  color: var(--text-muted);
}

.account-item:hover {
  color: var(--brand-primary-800);
  background: var(--bg-sunken);
}

.nav-burger {
  display: grid;
  place-items: center;
  width: var(--layout-tap-target);
  height: var(--layout-tap-target);
  color: var(--brand-secondary-700);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-full);
  background: var(--bg-surface);
}

@media (min-width: 60rem) {
  .nav-burger {
    display: none;
  }
}

/*
 * 🔑 THE PHONE'S MENU IS A DRAWER FROM THE RIGHT, over a scrim, and not a panel dropped out of
 * the bar. Decided on review (2026-09-16): the panel pushed a sheet of links down from under
 * the header, which on a long public page read as part of the page rather than as a menu.
 *
 * 🔴 IT IS A SIBLING OF THE HEADER, NOT A CHILD. `.site-header.is-scrolled` carries a
 * backdrop-filter, and a filter makes an element the containing block for its `position:
 * fixed` descendants — inside the header, the drawer would be clipped to the bar's height the
 * moment the page had scrolled.
 *
 * `hidden` keeps both out of the page until site.js opens them; `.is-open` is the second step,
 * a frame later, so the slide has somewhere to start from. Above the header (40), below the
 * application's dialogs (50) — nothing opens those while the menu is open.
 */
.nav-scrim {
  position: fixed;
  inset: 0;
  z-index: 45;
  background: color-mix(in srgb, var(--text-primary) 38%, transparent);
  opacity: 0;
  transition: opacity var(--duration-base) var(--ease-standard);
}

.nav-scrim.is-open {
  opacity: 1;
}

.nav-panel {
  position: fixed;
  inset: 0 0 0 auto;
  z-index: 46;
  display: flex;
  flex-direction: column;
  width: min(22rem, 86vw);
  overflow-y: auto;
  overscroll-behavior: contain;
  background: var(--bg-canvas);
  box-shadow: var(--shadow-4);
  translate: 100% 0;
  transition: translate var(--duration-base) var(--ease-out);
}

.nav-panel.is-open {
  translate: 0 0;
}

@media (prefers-reduced-motion: reduce) {
  .nav-scrim,
  .nav-panel {
    transition: none;
  }
}

/* The drawer covers the burger, so it carries its own way out. */
.nav-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  min-height: var(--layout-header-h);
  padding-inline: var(--layout-gutter) var(--space-3);
  border-bottom: 1px solid var(--border-subtle);
}

.nav-close {
  display: grid;
  place-items: center;
  flex-shrink: 0;
  width: var(--layout-tap-target);
  height: var(--layout-tap-target);
  color: var(--brand-secondary-700);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-full);
  background: var(--bg-surface);
}

.nav-panel-body {
  display: grid;
  align-content: start;
  gap: var(--space-1);
  padding: var(--space-3) var(--layout-gutter) var(--space-6);
}

@media (min-width: 60rem) {
  .nav-scrim,
  .nav-panel {
    display: none;
  }
}

/*
 * 🔴 `:not(.btn)` — the menu's plain links only. This was `.nav-panel a`, specificity (0,1,1),
 * which outranks `.btn` (0,1,0): the phone menu's "Register free" button was repainted in
 * dark ink on its rose fill, at reading size, with the padding of a link. The same collision
 * the footer's `:not(.footer-cta, .footer-secondary)` records, in the other half of the chrome.
 */
.nav-panel-body a:not(.btn) {
  display: flex;
  align-items: center;
  min-height: var(--layout-tap-target);
  padding-inline: var(--space-2);
  font-size: var(--text-md);
  color: var(--text-primary);
  border-radius: var(--radius-md);
}

.nav-panel-body a:not(.btn):hover {
  background: var(--bg-sunken);
}

.nav-panel .nav-auth {
  display: grid;
  gap: var(--space-2);
  margin-top: var(--space-3);
  padding-top: var(--space-4);
  border-top: 1px solid var(--border-subtle);
}

.nav-panel .nav-set {
  display: grid;
  gap: var(--space-1);
}

/*
 * Settings and Sign out in the phone's menu are rows, not buttons: they are the account's
 * housekeeping, and a filled rose "Sign out" under the menu would be the loudest thing in it.
 * The sign-out is a <button> inside a form, so it is drawn to match the links beside it.
 */
.nav-panel .nav-auth[data-auth='in'] {
  gap: var(--space-1);
}

.nav-panel-item {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  width: 100%;
  min-height: var(--layout-tap-target);
  padding-inline: var(--space-2);
  font-size: var(--text-md);
  text-align: left;
  color: var(--text-primary);
  border-radius: var(--radius-md);
}

.nav-panel-item:hover {
  background: var(--bg-sunken);
}

/* --------------------------------------------------------------- 4. footer */

/*
 * 🔑 THE FOOTER IS LIGHT, AND IT IS THE REFERENCE THAT DECIDED IT.
 *
 * It was the deep ink panel, which put two dark bands back to back: the closing CTA band
 * (`section--ink`) ends the page, and the footer repeated it. On the reference the page
 * closes onto a soft blush with a floral garland over the seam, so the last thing a
 * visitor sees is the palette rather than a black slab.
 *
 * Every `*-on-brand` token inside this footer went with it. Those are the tokens drawn
 * for a dark ground — near-white ink, pale gold accents — and on blush they would be
 * invisible. That is the same class of failure `check-token-refs.mjs` was written for,
 * except the names all still resolve: they resolve to the wrong end of the ramp.
 */
.site-footer {
  position: relative;
  /* Clip rather than let a wide ornament open a horizontal scrollbar, which is what the
     360px overflow test checks for. */
  overflow-x: clip;
  background: var(--bg-band-blush);
  color: var(--text-muted);
  /*
   * The top padding is the bouquet's own height plus a gap, computed rather than guessed.
   * The last version kept a fixed ~96px while the vine hung ~120px into the footer, which
   * is what laid a rose across the wordmark in the review screenshot. `spray-gold` is
   * 1.4577 times as wide as it is tall.
   */
  /* Halved on review (was min(440px, 72vw)): the bouquet is a crown over the footer, not
     its subject, and at full size it took more height than the four columns under it. */
  --garland-w: min(220px, 36vw);
  padding-block: calc(var(--garland-w) / 1.4577 + var(--space-12)) var(--space-8);
}

.site-footer::before {
  content: '';
  position: absolute;
  inset: 0 0 auto;
  height: 1px;
  background: var(--gradient-gold-rule);
}

/*
 * The bouquet crowns the footer, centred and wholly INSIDE its top edge. The reference
 * hangs its garland over the seam; ours cannot, because on the home page the band above is
 * the ink closing band, and watercolour multiplied over ink vanishes.
 */
.footer-garland {
  position: absolute;
  left: 50%;
  top: var(--space-4);
  z-index: 0;
  width: var(--garland-w);
  max-width: none;
  translate: -50% 0;
  pointer-events: none;
  user-select: none;
  mix-blend-mode: multiply;
}

.site-footer .wrap {
  position: relative;
  z-index: 1;
}

.footer-grid {
  display: grid;
  gap: clamp(var(--space-8), 4vw, var(--space-16));
  grid-template-columns: 1fr;
}

@media (min-width: 40rem) {
  .footer-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

/*
 * 🔴 FOUR FIXED TRACKS — AND THE `auto-fit` THAT WAS HERE WAS INVALID CSS.
 *
 * It read `1.6fr repeat(auto-fit, minmax(9rem, 1fr))`. The grid spec allows an auto-repeat
 * only beside FIXED-size tracks, and `1.6fr` is flexible, so the browser discarded the
 * whole declaration without a word and the footer fell back to the two-column rule above.
 * That is the brand|Explore / Support|Legal / Get started stack the review screenshot
 * showed — a layout nobody wrote, produced by a rule that never applied.
 *
 * The template now always renders four blocks (the brand, the first CMS group, every other
 * group gathered, Get started), so four fixed tracks are valid and right: the reference's
 * own proportions, with the brand widest.
 */
@media (min-width: 64rem) {
  .footer-grid {
    grid-template-columns: 1.4fr 1fr 1fr 1.2fr;
  }
}

.site-footer .brand,
.site-footer .brand-name {
  color: var(--brand-secondary-700);
}

/* The reference's footer logo is its largest type, bigger than its header's. */
.site-footer .brand-name {
  font-size: var(--text-3xl);
}

.site-footer .brand-mark {
  color: var(--brand-primary-700);
}

.site-footer .brand-tag {
  color: var(--brand-accent-600);
}

/* `text.muted` is #786A60 and the reference's `--ink-soft` is #76675f — the same soft
   brown, at 4.63:1 on this band. */
.footer-blurb {
  max-width: 34ch;
  margin: var(--space-5) 0 0;
  font-size: var(--text-sm);
  color: var(--text-muted);
}

.footer-contact {
  list-style: none;
  margin: var(--space-6) 0 0;
  padding: 0;
  display: grid;
  gap: var(--space-3);
  font-size: var(--text-sm);
}

.footer-contact li {
  display: flex;
  align-items: flex-start;
  gap: var(--space-3);
  color: var(--text-secondary);
}

.footer-contact svg {
  flex-shrink: 0;
  margin-top: 0.3em;
  color: var(--brand-primary-600);
}

.footer-contact a:hover {
  color: var(--brand-primary-800);
  text-decoration: underline;
}

.social {
  list-style: none;
  display: flex;
  gap: var(--space-2);
  margin: var(--space-6) 0 0;
  padding: 0;
}

.social a {
  display: grid;
  place-items: center;
  width: var(--layout-tap-target);
  height: var(--layout-tap-target);
  color: var(--brand-secondary-700);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-full);
  transition: background-color var(--duration-base) var(--ease-standard),
    color var(--duration-base) var(--ease-standard);
}

.social a:hover {
  color: var(--text-inverse);
  background: var(--brand-primary-700);
  border-color: var(--brand-primary-700);
}

/* `.footer-nav` is gone: it was the wrapper that made this a two-column footer with
   four columns squeezed into the right half. The columns are direct grid children now —
   see the note in templates/public/base.html.twig. */

/*
 * The column titles are DISPLAY type at the reference's size — its 26px against our 25px
 * step — not tiny gold capitals. That is what gives its footer the look of a printed page
 * rather than of a site map.
 */
.footer-head {
  margin: 0 0 var(--space-4);
  font-family: var(--font-display);
  font-size: var(--text-xl);
  font-weight: var(--weight-regular);
  letter-spacing: var(--tracking-normal);
  color: var(--brand-secondary-700);
}

.footer-col ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: var(--space-1);
}

/* A label over a gathered group — the reference's WHEN / WHERE. Small type, so it takes the
   4.5:1 gold rather than the reference's own rose, which is about 3.5:1 at this size. */
.footer-label {
  margin: var(--space-4) 0 var(--space-1);
  font-size: var(--text-2xs);
  font-weight: var(--weight-regular);
  font-variation-settings: var(--vary-body-regular);
  letter-spacing: var(--tracking-wider);
  text-transform: uppercase;
  color: var(--brand-accent-600);
}

.footer-head + .footer-label {
  margin-top: 0;
}

/*
 * 🔴 `:not(.footer-cta, .footer-secondary)` IS THE FIX FOR A LABEL NOBODY COULD READ.
 *
 * This rule was plain `.footer-col a`, specificity (0,1,1), and it outranked `.btn` (0,1,0)
 * — so the old "Create your bio-data" button had its ivory label repainted in dark ink on
 * maroon. It was harmless while the footer was dark and this colour was light, which is
 * exactly why it survived until the footer changed. Styled links opt out by name now.
 */
.footer-col a:not(.footer-cta, .footer-secondary) {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  font-size: var(--text-sm);
  color: var(--text-muted);
  transition: color var(--duration-base) var(--ease-standard),
    padding-left var(--duration-slow) var(--ease-out);
}

/*
 * 🔑 34px UNDER A MOUSE, 44px UNDER A THUMB — the design system's own rule (`Button`'s
 * `pointer-coarse:min-h-11`), applied to the footer. The reference's tight rows are right for a
 * pointer; on a phone a column of 34px links is a column of mis-taps. The footer used to live
 * only on Twig pages, which no sweep measured; around the application it is held to the 44px
 * target like every other control.
 */
@media (pointer: coarse) {
  /* Both ways: "FAQ" is 29px wide, and a target is a box, not a line. */
  .footer-col a:not(.footer-cta, .footer-secondary),
  .footer-contact a {
    min-width: var(--layout-tap-target);
    min-height: var(--layout-tap-target);
  }
  .footer-contact a {
    display: inline-flex;
    align-items: center;
  }
}

/* The reference nudges a footer link to the right as it colours. It is a small thing and
   it is the difference between a list that responds and a list that is printed on. */
.footer-col a:not(.footer-cta, .footer-secondary):hover {
  padding-left: var(--space-1);
  color: var(--brand-primary-800);
}

.footer-join p {
  margin: 0 0 var(--space-4);
  font-size: var(--text-sm);
  color: var(--text-muted);
}

/*
 * The call to action as a line with an arrow at its end — the shape of the reference's
 * newsletter field. The arrow travels on hover, as the reference's does; `translate`, not
 * `transform`, per this stylesheet's rule about the two.
 */
.footer-cta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  min-height: var(--layout-tap-target);
  font-size: var(--text-sm);
  color: var(--brand-secondary-700);
  border-bottom: 1px solid var(--brand-primary-500);
  transition: color var(--duration-base) var(--ease-standard);
}

.footer-cta svg {
  flex-shrink: 0;
  color: var(--brand-primary-700);
  transition: translate var(--duration-slow) var(--ease-out);
}

.footer-cta:hover {
  color: var(--brand-primary-800);
}

.footer-cta:hover svg {
  translate: 4px 0;
}

.footer-secondary {
  display: inline-flex;
  align-items: center;
  min-height: var(--layout-tap-target);
  margin-top: var(--space-2);
  font-size: var(--text-sm);
  color: var(--brand-primary-800);
}

.footer-secondary:hover {
  text-decoration: underline;
}

.footer-bottom {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
  margin-top: clamp(var(--space-10), 5vw, var(--space-16));
  padding-top: var(--space-6);
  border-top: 1px solid var(--border-subtle);
  font-size: var(--text-xs);
  color: var(--text-muted);
}

.footer-bottom p {
  margin: 0;
}

.footer-to-top {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  min-height: var(--layout-tap-target);
  color: var(--brand-primary-800);
}

/* ---------------------------------------------------------------- 5. print */

@media print {
  .site-header,
  .site-footer,
  .skip {
    display: none !important;
  }
  .site-body {
    padding-top: 0;
  }
}
