/* ==========================================================================
   Brava · Matchday design system
   The single shared stylesheet for every surface (static site, intake,
   worker-rendered profile, app and auth pages). Served from Pages at
   /assets/brava.css; the Worker proxies /assets/* to Pages.

   Spec: design/matchday/SPEC.md. Fonts: /assets/fonts/fonts.css.

   Rules of thumb:
   - Light (Bone) is the default ground. Wrap dark regions in .ground-night;
     role tokens (--bg, --fg, --fg-2, --rule, --focus) flip inside it, so
     every b-* component works on both grounds.
   - Nothing here resets bare elements. Pages opt in with .b-body and
     b-* classes, so legacy CSS keeps working until its page migrates.
   - Volt never appears on a light ground except .b-chip-verified.
   ========================================================================== */

:root {
  /* Palette */
  --bone: #F6F4F0;
  --stone: #EBE7E0;
  --white: #FFFFFF;
  --ink: #161513;
  --ink-pressed: #2A2825;
  --graphite: #5C5852;
  --hairline: #DCD7CE;
  --field: #807A72;
  --night: #0D0D0F;
  --surface: #1A1A1E;
  --mist: #A6A29B;
  --night-hairline: rgba(246, 244, 240, 0.14);
  --volt: #C8FF00;
  --volt-pressed: #B4E600;
  --amber: #FFB43C;
  --signal: #B42318;

  /* Role tokens (light ground) */
  --bg: var(--bone);
  --bg-band: var(--stone);
  --fg: var(--ink);
  --fg-2: var(--graphite);
  --rule: var(--hairline);
  --focus: var(--ink);

  /* Type */
  --font-sans: 'Hanken Grotesk', 'Helvetica Neue', Arial, system-ui, sans-serif;
  --font-cond: 'Barlow Condensed', 'Arial Narrow', sans-serif;

  /* Space (8px scale) */
  --s-1: 4px;
  --s-2: 8px;
  --s-3: 12px;
  --s-4: 16px;
  --s-5: 24px;
  --s-6: 32px;
  --s-7: 48px;
  --s-8: 56px;
  --s-9: 80px;
  --s-10: 112px;
  --gutter: 16px;
  --max: 1200px;

  /* Shape and motion */
  --pill: 999px;
  --ease: cubic-bezier(0.2, 0.7, 0.2, 1);

  /* Photo scrims: the only gradients in the system */
  --scrim-up: linear-gradient(to top, rgba(13, 13, 15, 0.70) 0%, rgba(13, 13, 15, 0.55) 40%, rgba(13, 13, 15, 0) 70%);
  --scrim-up-strong: linear-gradient(to top, rgba(13, 13, 15, 0.72) 0%, rgba(13, 13, 15, 0.60) 35%, rgba(13, 13, 15, 0) 65%);
  --scrim-corner: linear-gradient(to top right, rgba(13, 13, 15, 0.74) 0%, rgba(13, 13, 15, 0.62) 40%, rgba(13, 13, 15, 0) 70%);
  --scrim-top: linear-gradient(to bottom, rgba(13, 13, 15, 0.55) 0px, rgba(13, 13, 15, 0) 80px);
}

@media (min-width: 768px) {
  :root { --gutter: 24px; }
}
@media (min-width: 1024px) {
  :root { --gutter: 32px; }
}

/* Grounds ---------------------------------------------------------------- */
.ground-night {
  --bg: var(--night);
  --bg-band: var(--surface);
  --fg: var(--bone);
  --fg-2: var(--mist);
  --rule: var(--night-hairline);
  --focus: var(--bone);
  background: var(--bg);
  color: var(--fg);
}
.ground-stone { --bg: var(--stone); --bg-band: var(--bone); background: var(--bg); color: var(--fg); }
.ground-bone { --bg: var(--bone); background: var(--bg); color: var(--fg); }

/* Base (opt-in) ---------------------------------------------------------- */
.b-body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}
.b-body *, .b-body *::before, .b-body *::after { box-sizing: border-box; }
.b-body img { max-width: 100%; }

.b-wrap { width: 100%; max-width: calc(var(--max) + 2 * var(--gutter)); margin: 0 auto; padding-left: var(--gutter); padding-right: var(--gutter); }
.b-band { padding-top: var(--s-8); padding-bottom: var(--s-8); }
@media (min-width: 768px) { .b-band { padding-top: var(--s-10); padding-bottom: var(--s-10); } }

.b-sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.b-skip { position: absolute; left: var(--s-4); top: -60px; z-index: 1000; padding: var(--s-3) var(--s-4); background: var(--ink); color: var(--white); border-radius: var(--pill); font: 600 15px/1 var(--font-sans); text-decoration: none; }
.b-skip:focus { top: var(--s-3); }

.b-body :focus-visible, .b-focus:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }

/* Type -------------------------------------------------------------------- */
.b-lockup {
  margin: 0;
  font-family: var(--font-cond);
  font-weight: 700;
  font-style: normal;
  text-transform: uppercase;
  letter-spacing: 0;
  line-height: 0.92;
  font-variant-numeric: tabular-nums lining-nums;
}
.b-lockup--hero { font-size: clamp(44px, 4vw + 30px, 88px); }
.b-lockup--section { font-size: clamp(36px, 2.7vw + 25px, 64px); line-height: 0.95; }
.b-lockup--app { font-size: 40px; }
.b-name { margin: 0; font-family: var(--font-cond); font-weight: 700; text-transform: uppercase; line-height: 0.9; font-size: clamp(48px, 4vw + 40px, 96px); }

.b-h1 { margin: 0; font-family: var(--font-sans); font-weight: 600; font-size: clamp(32px, 2.3vw + 23px, 56px); line-height: 1.08; letter-spacing: -0.02em; }
.b-h2 { margin: 0; font-family: var(--font-sans); font-weight: 600; font-size: clamp(26px, 1.35vw + 20.7px, 40px); line-height: 1.12; letter-spacing: -0.015em; }
.b-h3 { margin: 0; font-family: var(--font-sans); font-weight: 600; font-size: 20px; line-height: 1.25; }
@media (min-width: 1024px) { .b-h3 { font-size: 22px; } }
.b-lead { margin: 0; font-size: 17px; line-height: 1.5; max-width: 46ch; }
@media (min-width: 1024px) { .b-lead { font-size: 19px; } }
.b-text { margin: 0; font-size: 16px; line-height: 1.55; max-width: 62ch; }
@media (min-width: 1024px) { .b-text { font-size: 17px; } }
.b-muted { color: var(--fg-2); }
.b-meta { margin: 0; font-size: 14px; line-height: 1.45; color: var(--fg-2); }
.b-fine { margin: 0; font-size: 13px; line-height: 1.45; color: var(--fg-2); }
.b-label {
  margin: 0;
  font-family: var(--font-cond);
  font-weight: 600;
  font-size: 13px;
  letter-spacing: 0.08em;
  line-height: 1.2;
  text-transform: uppercase;
  color: var(--fg-2);
}
.b-num { font-family: var(--font-cond); font-weight: 700; font-variant-numeric: tabular-nums lining-nums; line-height: 0.9; }

.b-wordmark { font-family: var(--font-cond); font-weight: 800; font-style: italic; letter-spacing: 0.03em; text-transform: uppercase; color: var(--fg); text-decoration: none; line-height: 1; }
.b-wordmark img, .b-wordmark svg { display: block; height: 20px; width: auto; }

/* Links and buttons --------------------------------------------------------- */
.b-link {
  color: var(--fg);
  font-weight: 500;
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
}
.b-link:hover { text-decoration-thickness: 2px; }

.b-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--s-2);
  min-height: 52px;
  padding: 0 28px;
  border: 0;
  border-radius: var(--pill);
  background: var(--ink);
  color: var(--white);
  font: 600 16px/1.2 var(--font-sans);
  text-decoration: none;
  text-transform: none;
  letter-spacing: 0;
  cursor: pointer;
  transition: background-color 150ms var(--ease), transform 150ms var(--ease);
  -webkit-tap-highlight-color: transparent;
}
.b-pill:hover { background: var(--ink-pressed); }
.b-pill:active { transform: translateY(1px); }
.b-pill:disabled, .b-pill[aria-disabled="true"] { background: var(--stone); color: var(--graphite); cursor: not-allowed; transform: none; }
.b-pill--white { background: var(--white); color: var(--ink); }
.b-pill--white:hover { background: var(--bone); }
.b-pill--volt { background: var(--volt); color: var(--night); }
.b-pill--volt:hover { background: var(--volt-pressed); }
.b-pill--night { background: var(--night); color: var(--volt); }
.b-pill--night:hover { background: var(--surface); }
.b-pill--outline { min-height: 44px; padding: 0 20px; background: transparent; color: var(--fg); border: 1.5px solid currentColor; font-size: 15px; }
.b-pill--outline:hover { background: transparent; box-shadow: inset 0 0 0 0.5px currentColor; }
.b-pill--sm { min-height: 44px; padding: 0 20px; font-size: 15px; }
.b-pill--block { display: flex; width: 100%; }
.b-pill svg { width: 18px; height: 18px; flex: 0 0 18px; }
.b-pill--block-mobile { display: flex; width: 100%; }
@media (min-width: 768px) { .b-pill--block-mobile { display: inline-flex; width: auto; min-width: 200px; } }

/* Chips, badges, markers ------------------------------------------------------ */
.b-chip-verified {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 24px;
  padding: 0 10px;
  border-radius: var(--pill);
  background: var(--volt);
  border: 1px solid var(--ink);
  color: var(--ink);
  font: 600 12px/1 var(--font-cond);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  white-space: nowrap;
}
.ground-night .b-chip-verified { border-color: transparent; }
.b-chip-verified svg { width: 12px; height: 12px; flex: 0 0 12px; }
.b-badge-sample {
  display: inline-flex;
  align-items: center;
  height: 24px;
  padding: 0 10px;
  border-radius: var(--pill);
  background: var(--stone);
  color: var(--ink);
  font: 600 12px/1 var(--font-cond);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  white-space: nowrap;
}
.b-entered { font-size: 13px; line-height: 1.4; color: var(--fg-2); }
.b-chip {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0 16px;
  border-radius: var(--pill);
  background: var(--bg-band);
  border: 1px solid var(--field);
  color: var(--fg);
  font: 500 15px/1.2 var(--font-sans);
  text-decoration: none;
}
.b-chip--soft { min-height: 36px; padding: 0 14px; border-color: transparent; font-size: 14px; }
.b-status {
  display: inline-flex;
  align-items: center;
  gap: var(--s-2);
  height: 28px;
  padding: 0 12px;
  border-radius: var(--pill);
  background: var(--surface);
  color: var(--bone);
  font: 500 13px/1 var(--font-sans);
  white-space: nowrap;
}
.b-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--volt); flex: 0 0 8px; }
.b-dot--amber { background: var(--amber); }

/* Offer bar, nav, footer ------------------------------------------------------- */
.b-offer {
  min-height: 32px;
  padding: 6px var(--gutter);
  background: var(--ink);
  color: var(--white);
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  font: 500 13px/1.3 var(--font-sans);
}
.b-nav {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--bone);
  border-bottom: 1px solid var(--hairline);
}
.b-nav__inner { display: flex; align-items: center; justify-content: space-between; gap: var(--s-5); min-height: 56px; }
@media (min-width: 1024px) { .b-nav__inner { min-height: 72px; } }
.b-nav__links { display: none; align-items: center; gap: var(--s-6); }
@media (min-width: 1024px) { .b-nav__links { display: flex; } }
.b-nav__link {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  color: var(--ink);
  font: 500 15px/1 var(--font-sans);
  text-decoration: none;
}
.b-nav__link[aria-current="page"] { box-shadow: inset 0 -2px 0 var(--ink); }
.b-nav__aside { display: flex; align-items: center; gap: var(--s-1); }
@media (min-width: 1024px) { .b-nav__aside { display: none; } }
.b-iconbtn {
  width: 44px;
  height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 0;
  background: transparent;
  color: var(--fg);
  cursor: pointer;
}
.b-iconbtn svg { width: 22px; height: 22px; }

.b-footer { border-top: 1px solid var(--rule); padding-top: var(--s-7); padding-bottom: var(--s-6); }
.b-footer__top { display: flex; flex-wrap: wrap; justify-content: space-between; gap: var(--s-5) var(--s-7); }
.b-footer__tag { margin: var(--s-2) 0 0; font: 700 20px/1 var(--font-cond); text-transform: uppercase; }
.b-footer__links { display: grid; grid-template-columns: repeat(2, minmax(0, max-content)); column-gap: var(--s-6); }
@media (min-width: 768px) { .b-footer__links { display: flex; flex-wrap: wrap; gap: 0 var(--s-6); } }
.b-footer__links a { min-height: 44px; display: inline-flex; align-items: center; color: var(--fg); font: 500 15px/1 var(--font-sans); text-decoration: none; }
.b-footer__legal { margin: var(--s-5) 0 0; padding-top: var(--s-4); border-top: 1px solid var(--rule); font-size: 13px; color: var(--fg-2); }

/* Sticky bottom bar --------------------------------------------------------- */
.b-sticky-bar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 60;
  min-height: calc(64px + env(safe-area-inset-bottom, 0px));
  padding: 0 var(--gutter) env(safe-area-inset-bottom, 0px);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--s-4);
  background: rgba(246, 244, 240, 0.96);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  border-top: 1px solid var(--hairline);
  color: var(--ink);
  opacity: 0;
  transform: translateY(100%);
  pointer-events: none;
  transition: opacity 150ms var(--ease), transform 150ms var(--ease);
}
.b-sticky-bar.is-visible { opacity: 1; transform: none; pointer-events: auto; }
.b-sticky-bar__price { display: flex; align-items: baseline; gap: 6px; }
.b-sticky-bar__price .b-num { font-size: 22px; }

/* Data: stat strip, stat rows, fact rows, list rows -------------------------- */
.b-stat-strip { border-top: 1px solid var(--fg); }
.b-stat-strip__cols { display: grid; grid-template-columns: repeat(var(--cols, 3), minmax(0, 1fr)); }
.b-stat { padding: 20px 0; display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.b-stat + .b-stat { padding-left: 14px; border-left: 1px solid var(--rule); }
.b-stat__value { font-family: var(--font-cond); font-weight: 700; font-variant-numeric: tabular-nums lining-nums; font-size: 44px; line-height: 0.9; }
@media (min-width: 1024px) { .b-stat__value { font-size: 64px; } }
.b-stat__label { font: 600 13px/1.2 var(--font-cond); letter-spacing: 0.08em; text-transform: uppercase; color: var(--fg-2); }
.b-stat-strip__meta { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s-2) 10px; padding-bottom: 20px; font-size: 14px; color: var(--fg-2); }

.b-rows { border-bottom: 1px solid var(--rule); }
.b-stat-row, .b-fact-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--s-4);
  min-height: 56px;
  padding: 10px 0;
  border-top: 1px solid var(--rule);
}
.b-fact-row { min-height: 52px; }
.b-stat-row__name { display: flex; flex-direction: column; gap: 3px; font-weight: 500; font-size: 16px; }
.b-stat-row__mark { display: inline-flex; align-items: center; gap: 5px; font-size: 13px; font-weight: 400; color: var(--fg); }
.b-stat-row__mark svg { width: 12px; height: 12px; }
.b-stat-row__value { font-family: var(--font-cond); font-weight: 700; font-variant-numeric: tabular-nums lining-nums; font-size: 28px; line-height: 1; text-align: right; }
@media (min-width: 1024px) { .b-stat-row__value { font-size: 32px; } }
.b-fact-row__label { font-size: 14px; color: var(--fg-2); }
.b-fact-row__value { font-weight: 500; font-size: 16px; text-align: right; }

.b-list-row {
  display: flex;
  align-items: center;
  gap: var(--s-4);
  min-height: 72px;
  padding: var(--s-4) 0;
  border-top: 1px solid var(--rule);
  color: var(--fg);
  text-decoration: none;
}
.b-list-row__body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.b-list-row__title { font-weight: 600; font-size: 17px; line-height: 1.3; }
.b-list-row__desc { font-size: 15px; line-height: 1.45; color: var(--fg-2); }
.b-list-row__chev { width: 16px; height: 16px; flex: 0 0 16px; color: var(--fg-2); }

/* Check list, accordion --------------------------------------------------- */
.b-checks { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: var(--s-3); }
.b-checks li { display: flex; gap: 10px; font-size: 16px; line-height: 1.45; }
.b-checks svg { width: 16px; height: 16px; flex: 0 0 16px; margin-top: 3px; }

.b-accordion { border-top: 1px solid var(--rule); }
.b-accordion:last-of-type { border-bottom: 1px solid var(--rule); }
.b-accordion > summary {
  list-style: none;
  cursor: pointer;
  min-height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--s-4);
  font-weight: 600;
  font-size: 17px;
}
.b-accordion > summary::-webkit-details-marker { display: none; }
.b-accordion > summary::after { content: '+'; font-weight: 400; font-size: 22px; line-height: 1; transition: transform 200ms var(--ease); }
.b-accordion[open] > summary::after { content: '\2212'; }
.b-accordion__panel { padding-bottom: 20px; font-size: 16px; line-height: 1.55; color: var(--fg-2); }

/* Forms --------------------------------------------------------------------- */
.b-field { display: flex; flex-direction: column; gap: var(--s-2); }
.b-field__label { font-weight: 600; font-size: 14px; color: var(--fg); }
.b-field__help { font-size: 14px; line-height: 1.45; color: var(--fg-2); }
.b-field__error { font-size: 14px; line-height: 1.45; color: var(--signal); }
.b-input, .b-select, .b-textarea {
  width: 100%;
  min-height: 52px;
  padding: 0 14px;
  background: var(--white);
  border: 1px solid var(--field);
  border-radius: 0;
  color: var(--ink);
  font: 400 16px/1.4 var(--font-sans);
  -webkit-appearance: none;
  appearance: none;
}
.b-textarea { padding: 14px; min-height: 120px; resize: vertical; }
.b-input:focus, .b-select:focus, .b-textarea:focus { outline: none; border: 2px solid var(--ink); padding-left: 13px; }
.b-input[aria-invalid="true"], .b-select[aria-invalid="true"], .b-textarea[aria-invalid="true"] { border: 2px solid var(--signal); padding-left: 13px; }

/* Photos ---------------------------------------------------------------------- */
/* Photo slot: the photo is a ground of its own. Text on it is limited to
   the lockup or a name (and, on desktop heroes, the lead + buttons). Every
   slot must also render without a photo: drop the <img> and the slot falls
   back to Night with the same text, so a missing or weak photo never breaks
   the page. */
.b-photo { position: relative; overflow: hidden; background: var(--night); color: var(--white); }
.b-photo > img, .b-photo > picture > img { display: block; width: 100%; height: 100%; object-fit: cover; }
.b-photo > picture { display: block; width: 100%; height: 100%; }
.b-photo::after { content: ''; position: absolute; inset: 0; background: var(--scrim-up); pointer-events: none; }
.b-photo--strong::after { background: var(--scrim-up-strong); }
.b-photo--corner::after { background: var(--scrim-corner); }
.b-photo--plain::after { content: none; }
.b-photo__over { position: absolute; z-index: 1; left: var(--gutter); right: var(--gutter); bottom: 20px; }
.b-photo__badge { position: absolute; z-index: 1; top: 12px; left: 12px; }

/* Rail ------------------------------------------------------------------------ */
.b-rail {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: 78vw;
  gap: var(--s-3);
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  padding: 0 var(--gutter);
  scroll-padding: 0 var(--gutter);
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.b-rail::-webkit-scrollbar { display: none; }
.b-rail > * { scroll-snap-align: start; }
@media (min-width: 768px) {
  .b-rail { grid-auto-flow: row; grid-auto-columns: auto; grid-template-columns: repeat(var(--rail-cols, 3), minmax(0, 1fr)); overflow: visible; padding: 0; gap: var(--s-5); }
}

/* Motion ---------------------------------------------------------------------- */
.b-reveal { opacity: 0; transform: translateY(8px); transition: opacity 320ms var(--ease), transform 320ms var(--ease); }
.b-reveal.is-in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  .b-reveal { opacity: 1; transform: none; transition: none; }
  .b-pill, .b-sticky-bar, .b-accordion > summary::after { transition: none; }
}

/* Line drawings ---------------------------------------------------------------- */
/* Ben's call (2026-10-08): the v1 hairline drawings stay, redrawn in Ink.
   Markup lives in design/matchday/SPEC.md §0.7. Lines take --fg; the one
   highlight mark per drawing takes --fg on light grounds and volt on Night. */
.b-drawing { display: block; width: 100%; height: auto; color: var(--fg); }
.b-drawing .d-line { fill: none; stroke: currentColor; stroke-width: 1.25; vector-effect: non-scaling-stroke; }
.b-drawing .d-dash { fill: none; stroke: currentColor; stroke-width: 1.25; stroke-dasharray: 3 3; vector-effect: non-scaling-stroke; }
.b-drawing .d-dot { fill: currentColor; }
.b-drawing .d-mark { fill: var(--fg); }
.b-drawing .d-mark-line { fill: none; stroke: var(--fg); stroke-width: 1.25; vector-effect: non-scaling-stroke; }
.ground-night .b-drawing .d-mark { fill: var(--volt); }
.ground-night .b-drawing .d-mark-line { stroke: var(--volt); }

/* Mobile menu sheet ----------------------------------------------------------- */
/* Shared by every page that pastes the canonical nav (SPEC §0.2) and loads
   /nav.js, which toggles body.nav-drawer--open and locks scroll. Full-height
   Bone sheet; the menu button floats above it as the close control. */
.nav-drawer { display: none; }
@media (max-width: 1023px) {
  .js-nav-enhanced .nav-drawer { display: block; }
}
.nav-drawer__scrim { position: fixed; inset: 0; z-index: 110; background: rgba(13, 13, 15, 0.4); opacity: 0; visibility: hidden; transition: opacity 200ms var(--ease), visibility 200ms; }
.nav-drawer__panel {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  z-index: 120;
  width: min(100%, 440px);
  display: flex;
  flex-direction: column;
  padding: 64px var(--gutter) calc(var(--s-5) + env(safe-area-inset-bottom, 0px));
  background: var(--bone);
  color: var(--ink);
  overflow-y: auto;
  transform: translateX(100%);
  visibility: hidden;
  transition: transform 240ms var(--ease), visibility 240ms;
}
.nav-drawer--open .nav-drawer__scrim { opacity: 1; visibility: visible; }
.nav-drawer--open .nav-drawer__panel { transform: none; visibility: visible; }
.nav-drawer__nav { display: flex; flex-direction: column; border-top: 1px solid var(--hairline); }
.nav-drawer__link { min-height: 56px; display: flex; align-items: center; border-bottom: 1px solid var(--hairline); color: var(--ink); font: 600 24px/1.2 var(--font-sans); text-decoration: none; }
.nav-drawer__link[aria-current="page"] { text-decoration: underline; text-underline-offset: 6px; text-decoration-thickness: 2px; }
.nav-drawer__cta { margin-top: auto; padding-top: var(--s-5); }
.nav-drawer__toggle .i-close { display: none; }
.nav-drawer--open .nav-drawer__toggle { position: fixed; top: 6px; right: 6px; z-index: 130; color: var(--ink); }
.nav-drawer--open .nav-drawer__toggle .i-close { display: inline; }
.nav-drawer--open .nav-drawer__toggle .i-menu { display: none; }
body.nav-drawer--open { overflow: hidden; }
@media (prefers-reduced-motion: reduce) {
  .nav-drawer__panel, .nav-drawer__scrim { transition: none; }
}

/* Shared fixes from the first surface builds ------------------------------------- */
/* Zero-specificity resets for opted-in pages. :where() keeps these weaker than
   any b-* class, so .b-pill's color still wins over the link reset. */
:where(.b-body) :where(h1, h2, h3, h4, p, figure, ul, ol, dl, dd, blockquote) { margin: 0; }
:where(.b-body) :where(a) { color: inherit; }
:where(.b-body) :where(button, input, select, textarea) { font: inherit; color: inherit; }
:where(.b-body) :where(img, svg) { vertical-align: middle; }

/* The wordmark link is a 44px target. */
.b-wordmark { display: flex; align-items: center; width: fit-content; min-height: 44px; }

/* Menu sheet: the sticky nav is its own stacking context (z-index 50), so it
   must rise above the sheet for the floating close button to be reachable. */
body.nav-drawer--open .b-nav { z-index: 130; background: transparent; border-bottom-color: transparent; pointer-events: none; }
body.nav-drawer--open .b-nav .b-wordmark,
body.nav-drawer--open .b-nav__aside > .b-nav__link { visibility: hidden; }
body.nav-drawer--open .nav-drawer__toggle { pointer-events: auto; }

/* Desktop nav pill hides while a [data-hero-cta] is on screen (nav.js). */
[data-nav-cta] { max-width: 12em; overflow: hidden; white-space: nowrap; }
[data-nav-cta].is-hidden { opacity: 0; visibility: hidden; max-width: 0; padding-left: 0; padding-right: 0; margin-left: calc(-1 * var(--s-6)); }
[data-nav-cta].is-ready { transition: opacity 150ms var(--ease), visibility 150ms, max-width 200ms var(--ease), padding 200ms var(--ease), margin-left 200ms var(--ease), background-color 150ms var(--ease); }
@media (prefers-reduced-motion: reduce) { [data-nav-cta].is-ready { transition: none; } }

/* Sticky bar: off-screen means unfocusable; phones and tablets only. */
.b-sticky-bar:not(.is-visible) { visibility: hidden; transition: opacity 150ms var(--ease), transform 150ms var(--ease), visibility 0s linear 150ms; }
.has-sticky { padding-bottom: calc(64px + env(safe-area-inset-bottom, 0px)); }
@media (min-width: 1024px) {
  .has-sticky { padding-bottom: 0; }
  .b-sticky-bar { display: none; }
}

/* Accordion questions may keep their heading element. */
.b-accordion > summary :where(h2, h3, h4) { font: inherit; margin: 0; }

/* Badges and photos. */
.ground-stone .b-badge-sample { background: var(--white); }
.b-photo__badge { pointer-events: none; }
.b-photo:not(:has(img)) .b-photo__badge { display: none; }
.b-photo__over { --focus: var(--bone); }

/* Rails clip outside focus rings at the screen edge. */
.b-rail { padding-block: 4px; }
[data-rail]:focus-visible { outline-offset: -2px; }

/* Night-ground pills and states. */
.b-pill--bone { background: var(--bone); color: var(--night); }
.b-pill--bone:hover { background: var(--white); }
.b-pill--app { min-height: 48px; padding: 0 22px; }
.ground-night .b-pill:disabled, .ground-night .b-pill[aria-disabled="true"] { background: var(--surface); color: var(--mist); }
.ground-night .b-pill--outline:disabled { background: transparent; color: var(--mist); }
.b-dot--mist { background: var(--mist); }
/* Volt surfaces (next-move card, payment card, You're live) need a dark ring. */
.b-on-volt { --focus: var(--night); }
