/* ==========================================================================
   Noisebox Anthems — voting page
   Palette + type pulled from noiseboxradio.com's live Elementor kit:
     primary #FF914D / secondary #BB2F5D / accent #4B0056 / peach #FFC5A1
   Fonts: Overpass (body), "archive" (H1 display, proprietary — see note
   below), Nothing You Could Do (section letters), RocknRoll One (buttons).
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Overpass:wght@400;500;600;700&family=Nothing+You+Could+Do&family=RocknRoll+One&display=swap');

/*
  NOTE on "archive": Noisebox's real H1 font is a proprietary display face
  called "archive", self-hosted at noiseboxradio.com via the Use Any Font
  plugin. We haven't bundled that binary here (unclear redistribution
  licence for a font uploaded to someone else's WP install) — Special Elite
  substitutes for now. Swap in the real archive.woff2 and this becomes a
  one-line change.
*/
@import url('https://fonts.googleapis.com/css2?family=Special+Elite&display=swap');

:root {
  --primary: #FF914D;
  --secondary: #BB2F5D;
  --accent: #4B0056;
  --peach: #FFC5A1;
  --ink: #161616;
  --paper: #FFFBF6;
  --paper-dim: #F6EDE4;
  --line: #E7D9CB;
  --ok: #2E7D5B;

  --font-display: 'archive', 'Special Elite', 'Georgia', serif;
  --font-hand: 'Nothing You Could Do', cursive;
  --font-accent: var(--font-body);
  --font-body: 'Overpass', -apple-system, BlinkMacSystemFont, sans-serif;

  --header-h: 108px;
  --header-h-shrink: 68px;
  --nav-h: 52px;
  --submit-h: 84px;

  --ease: cubic-bezier(.22, 1, .36, 1);
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

html {
  scroll-behavior: smooth;
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { animation-duration: 0.001ms !important; transition-duration: 0.001ms !important; }
}

body {
  margin: 0;
  font-family: var(--font-body);
  /* The full-bleed section-head stripe uses calc(50% - 50vw), and 50vw is
     measured including the vertical scrollbar's width on most desktop
     browsers (this page is always tall enough to have one) while the actual
     content box excludes it — that few-pixel mismatch was creating a
     horizontal scrollbar. Clipping it here is the standard fix; nothing else
     on the page relies on horizontal scroll. */
  overflow-x: hidden;
  /* Paper-tinted scrim on top dilutes the red splash texture down to a low-
     opacity wash rather than a full-strength background; background-size
     cover keeps it seam-free at any viewport size instead of visibly tiling. */
  background:
    linear-gradient(rgba(255, 251, 246, .85), rgba(255, 251, 246, .85)),
    url('assets/NA4_background.webp') center/cover no-repeat fixed,
    var(--paper);
  transition: background-image .4s var(--ease);
  color: var(--ink);
  line-height: 1.55;
  padding-bottom: calc(var(--submit-h) + 12px);
}

img { max-width: 100%; display: block; }

a { color: var(--secondary); }

/* ---------- Sticky header ---------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  height: var(--header-h);
  display: flex;
  align-items: center;
  background: #DB2F1F url('assets/NA4_background.webp') center/420px repeat;
  color: var(--paper);
  padding: 0 clamp(16px, 4vw, 40px);
  transition: height .28s var(--ease), box-shadow .28s var(--ease);
  box-shadow: 0 0 0 rgba(0,0,0,0);
  /* The header's own height change on scroll shifts the page layout below
     it; without this the browser's scroll-anchoring tries to compensate by
     nudging scrollY, which re-triggers the shrink/grow toggle and makes the
     header vibrate. */
  overflow-anchor: none;
  /* height is a layout property, not compositor-only, so this transition
     can't be made fully GPU-accelerated without decoupling the header's
     real box height from its visual size (a bigger restructure). This just
     pre-promotes the element to its own layer so the browser isn't caught
     doing that promotion mid-scroll on a fast flick. */
  will-change: height;
}

.site-header.is-scrolled {
  height: var(--header-h-shrink);
  box-shadow: 0 6px 18px rgba(0,0,0,.18);
}

.site-header__inner {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  max-width: 1180px;
  height: 100%;
  margin: 0 auto;
}

.menu-toggle {
  position: relative;
  z-index: 1;
  flex: 0 0 auto;
  width: 40px;
  height: 40px;
  border: none;
  padding: 0;
  color: var(--paper);
  background: rgba(255, 251, 246, .14);
  border-radius: 10px;
  cursor: pointer;
  transition: background .2s var(--ease);
}
.menu-toggle:hover { background: rgba(255, 251, 246, .24); }

/* SVG strokes instead of divs sized in px so the icon stays crisp under
   fractional Windows display scaling (125%/150%) — thin 2px CSS bars land
   on non-integer physical pixels there and render blurry. */
.menu-toggle__icon {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  transition: opacity .2s var(--ease), transform .25s var(--ease);
}

.menu-toggle__icon--close { opacity: 0; transform: translate(-50%, -50%) rotate(-45deg); }

.menu-toggle.is-open .menu-toggle__icon--bars { opacity: 0; transform: translate(-50%, -50%) rotate(45deg); }
.menu-toggle.is-open .menu-toggle__icon--close { opacity: 1; transform: translate(-50%, -50%) rotate(0); }

/* Taken out of flow so it can be sized well beyond the header's own height
   and overlap its top/bottom edges without affecting header layout — true
   centering (left: 50%) is also more reliable than grid centering next to
   a variable-width meta block. */
.site-header__brand {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  display: flex;
  align-items: center;
  /* Wraps the oversized logo, so its box extends into the sticky nav below
     it too — pointer-events:none on the img alone isn't enough since this
     wrapper's own box still catches the hit-test at that point. */
  pointer-events: none;
  z-index: 1;
}

.site-header__logo {
  height: 170px;
  width: auto;
  flex: 0 0 auto;
  transition: height .28s var(--ease);
  will-change: height;
  /* The logo is taller than the header itself and overflows into the
     sticky A-Z nav below it — purely decorative, so let clicks on that
     overflow pass through to the nav pills underneath instead of being
     intercepted by the logo's (mostly transparent) bounding box. */
  pointer-events: none;
}

.site-header.is-scrolled .site-header__logo { height: 120px; }

.site-header__meta {
  text-align: right;
  font-size: 13px;
  opacity: .9;
  display: none;
  background: rgba(22, 22, 22, .55);
  padding: 9px 14px 7px;
  border-radius: 10px;
}

@media (min-width: 640px) {
  .site-header__meta { display: block; }
}

.site-header__meta strong { color: var(--primary); }

.meta-sep {
  display: inline-block;
  width: 4px;
  height: 4px;
  margin: 0 7px;
  border-radius: 50%;
  background: currentColor;
  opacity: .6;
  vertical-align: middle;
}

/* ---------- Section jump nav ---------- */

.section-nav {
  position: sticky;
  top: var(--header-h);
  z-index: 39;
  height: var(--nav-h);
  background: var(--paper);
  border-bottom: 1px solid var(--line);
  box-shadow: 0 2px 8px rgba(0,0,0,.1);
  scroll-padding-inline: 12px;
  transition: top .28s var(--ease);
  will-change: top;
  overflow-x: auto;
  scrollbar-width: none;
}
.section-nav::-webkit-scrollbar { display: none; }

.site-header.is-scrolled ~ .section-nav { top: var(--header-h-shrink); }

.section-nav__inner {
  display: flex;
  gap: 6px;
  align-items: center;
  height: 100%;
  padding: 0 clamp(16px, 4vw, 40px);
  max-width: 1180px;
  margin: 0 auto;
  width: max-content;
}

.section-pill {
  flex: 0 0 auto;
  font-family: var(--font-accent);
  font-weight: 600;
  font-size: 16px;
  border: none;
  background: transparent;
  color: var(--ink);
  opacity: .55;
  padding: 8px 12px 4px;
  border-radius: 999px;
  cursor: pointer;
  transition: background .2s var(--ease), color .2s var(--ease), opacity .2s var(--ease);
}

.section-pill:hover { opacity: .85; }

.section-pill.is-active {
  background: var(--primary);
  color: var(--ink);
  opacity: 1;
}

/* ---------- Intro / blurb ---------- */

.intro {
  max-width: 760px;
  margin: 0 auto;
  padding: clamp(12px, 2.5vw, 24px) clamp(16px, 4vw, 40px) 12px;
}

.intro__eyebrow {
  font-family: var(--font-hand);
  font-weight: 700;
  font-size: clamp(36px, 6vw, 52px);
  text-align: center;
  color: var(--secondary);
  margin: 0 0 12px;
}

.intro p {
  margin: 0 0 14px;
}

.intro__dates {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin: 18px 0;
}

.date-chip {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px 14px;
  font-size: 13.5px;
}

.date-chip strong { display: block; font-size: 12px; text-transform: uppercase; letter-spacing: .06em; color: var(--secondary); }

.intro__playlist {
  display: flex;
  width: max-content;
  margin: 0 auto;
  align-items: center;
  gap: 8px;
  font-family: var(--font-accent);
  font-weight: 600;
  font-size: 14px;
  line-height: 1;
  text-decoration: none;
  background: var(--ink);
  color: var(--paper);
  padding: 10px 16px;
  border-radius: 999px;
  transition: transform .2s var(--ease), background .2s var(--ease);
}
.intro__playlist:hover { background: var(--secondary); transform: translateY(-1px); }

.intro__playlist-icon {
  display: inline-flex;
  align-items: center;
  position: relative;
  top: 2px;
  line-height: 1;
}

.intro__playlist-label {
  position: relative;
  top: 2px;
}

/* ---------- Anthem sections ---------- */

.anthem-section {
  max-width: 1180px;
  margin: 0 auto;
  padding: 8px clamp(16px, 4vw, 40px) 8px;
  scroll-margin-top: calc(var(--header-h) + var(--nav-h) + 12px);
}

.anthem-section__head {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 28px 0 14px;
}

.anthem-section__letter {
  font-family: var(--font-hand);
  font-weight: 700;
  font-size: 40px;
  color: var(--secondary);
  line-height: 1;
}

.anthem-section__lead-badge {
  font-family: var(--font-hand);
  font-weight: 700;
  font-size: 40px;
  color: var(--secondary);
  padding-right: 12px;
  border-right: 2px solid #C9B7A3;
  line-height: 1;
}

/* Centered strip treatment at all widths, full-bleed to the actual viewport
   edges. margin: calc(50% - 50vw) is the standard "full-bleed inside a
   centered, max-width container" trick — it breaks out past the 1180px
   container, which a plain negative margin (matching .anthem-section's own
   padding) can't reach once that container stops filling the screen. */
.anthem-section__head {
  justify-content: center;
  text-align: center;
  background: rgba(255, 251, 246, .35);
  margin-left: calc(50% - 50vw);
  margin-right: calc(50% - 50vw);
  padding: 10px clamp(16px, 4vw, 40px);
}

/* The lead-badge pairing (e.g. "# | A") happens to sit centered with even
   padding, but a lone letter's ink sits higher in its line box than the
   badge+letter pair does, so it needs less bottom padding to look centered. */
.anthem-section__head--plain {
  padding-bottom: 0;
}

.anthem-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 16px;
}

/* Divider marking the boundary between a folded-in leading numeric section
   (e.g. "0-9") and the alpha section's own cards that follow it. */
.anthem-card--lead-last {
  position: relative;
}
@media (min-width: 560px) {
  .anthem-card--lead-last::after {
    content: "";
    position: absolute;
    top: 10%;
    bottom: 10%;
    /* Card has a 1px border, so the containing block (its padding edge) sits
       1px inside the visible edge — offset by 10px, not 8, to land the 2px
       line dead-center in the 16px grid gap. */
    right: -10px;
    width: 2px;
    background: #C9B7A3;
  }
}

/* ---------- Anthem card ---------- */

.anthem-card {
  position: relative;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  cursor: pointer;
  opacity: 0;
  transform: translateY(16px);
  transition: opacity .5s var(--ease), transform .5s var(--ease),
              border-color .2s var(--ease), box-shadow .2s var(--ease);
}

.anthem-card.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.anthem-card:hover {
  box-shadow: 0 10px 24px rgba(22,22,22,.08);
}

.anthem-card.is-selected {
  border-color: var(--primary);
  box-shadow: 0 0 0 2px var(--primary) inset;
}

.anthem-card__top {
  display: flex;
  gap: 12px;
}

.anthem-thumb {
  position: relative;
  flex: 0 0 96px;
  width: 96px;
  height: 96px;
  border-radius: 10px;
  overflow: hidden;
  background: var(--paper-dim);
}

.anthem-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.play-btn {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  background: rgba(22,22,22,.35);
  color: #fff;
  font-size: 20px;
  cursor: pointer;
  opacity: 0;
  transition: opacity .2s var(--ease), background .2s var(--ease);
}
.anthem-thumb:hover .play-btn, .play-btn:focus-visible { opacity: 1; }
.play-btn:hover { background: rgba(22,22,22,.55); }

.anthem-meta {
  flex: 1;
  min-width: 0;
}

.anthem-artist {
  font-weight: 700;
  font-size: 15.5px;
  margin: 0 0 2px;
  overflow-wrap: break-word;
}

.anthem-title {
  margin: 0;
  font-size: 14px;
  color: #4a3f36;
  overflow-wrap: break-word;
}

.anthem-card__actions {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  cursor: pointer;
}

.preview-toggle {
  font-family: var(--font-accent);
  font-weight: 600;
  font-size: 14px;
  line-height: 1;
  border: none;
  background: none;
  color: var(--secondary);
  padding: 4px 0;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

/* SVG instead of a rotated text glyph — a font character's ink isn't
   reliably centered in its own em-box (same issue the header hamburger
   icon had), so rotating it visibly pivots off the tip instead of the
   middle. An SVG's viewBox gives an exact, predictable center to rotate. */
.preview-toggle .chev {
  position: relative;
  top: -1px;
  left: 3px;
  transition: transform .25s var(--ease);
  display: inline-block;
}
.preview-toggle[aria-expanded="true"] .chev { transform: rotate(180deg); }

.preview-toggle__label {
  position: relative;
  top: 1px;
  left: 1px;
}

/* Custom checkbox */
.anthem-select {
  position: relative;
  display: inline-flex;
  width: 26px;
  height: 26px;
  flex: 0 0 auto;
  cursor: pointer;
}

.anthem-select input {
  position: absolute;
  opacity: 0;
  inset: 0;
  margin: 0;
  cursor: pointer;
}

.anthem-select .box {
  position: absolute;
  inset: 0;
  border: 2px solid var(--line);
  border-radius: 7px;
  background: #fff;
  transition: background .18s var(--ease), border-color .18s var(--ease), transform .12s var(--ease);
}

.anthem-select .box::after {
  content: "";
  position: absolute;
  /* Nudged 1px left of the 22px inner box's exact geometric center (7.5px) —
     the checkmark shape's own visual weight (an L of border, not a symmetric
     glyph) reads as off-center-right at the exact math value, on both
     desktop and mobile. */
  left: 6.5px;
  top: 2px;
  width: 7px;
  height: 12px;
  border: solid #fff;
  border-width: 0 3px 3px 0;
  transform: rotate(45deg) scale(0);
  transition: transform .18s var(--ease);
}

.anthem-select input:checked ~ .box {
  background: var(--primary);
  border-color: var(--primary);
}
.anthem-select input:checked ~ .box::after { transform: rotate(45deg) scale(1); }
.anthem-select input:focus-visible ~ .box { outline: 2px solid var(--secondary); outline-offset: 2px; }
.anthem-select input:active ~ .box { transform: scale(.92); }

/* Video reveal panel */
.video-wrap {
  overflow: hidden;
  max-height: 0;
  opacity: 0;
  /* Flex `gap` on .anthem-card still reserves space above this element even
     while it's collapsed to 0 height, which was making the card's bottom
     padding read as much taller than its top padding — cancel it here and
     restore it once open. */
  margin-top: -10px;
  transition: max-height .38s var(--ease), opacity .3s var(--ease), margin-top .38s var(--ease);
}
.video-wrap.is-open { opacity: 1; margin-top: 0; }

.video-ratio {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  background: #000;
  border-radius: 10px;
  overflow: hidden;
}

.video-ratio iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

/* ---------- Sticky submit bar ---------- */

.submit-bar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 50;
  height: var(--submit-h);
  background: var(--ink);
  color: var(--paper);
  display: flex;
  align-items: center;
  box-shadow: 0 -8px 24px rgba(0,0,0,.18);
}

.submit-bar__inner {
  max-width: 1180px;
  margin: 0 auto;
  width: 100%;
  padding: 0 clamp(16px, 4vw, 40px);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: clamp(8px, 2vw, 16px);
}

.submit-bar__name {
  flex: 1 1 160px;
  min-width: 0;
}

/* Honeypot — left in the DOM and tab-order-excluded rather than
   display:none, since some bots specifically skip fields hidden that way. */
.hp-field {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.name-input {
  width: 100%;
  box-sizing: border-box;
  font-family: var(--font-body);
  font-size: 14px;
  padding: 15px 16px 11px;
  border-radius: 14px;
  border: 1px solid rgba(255, 251, 246, .25);
  background: rgba(255, 251, 246, .08);
  color: var(--paper);
  text-overflow: ellipsis;
  transition: border-color .18s var(--ease), background .18s var(--ease);
}

.name-input::placeholder { color: rgba(255, 251, 246, .5); }

.name-input:focus-visible {
  outline: none;
  border-color: var(--primary);
  background: rgba(255, 251, 246, .14);
}

.name-input.is-error {
  border-color: var(--secondary);
  animation: name-shake .32s var(--ease);
}

@keyframes name-shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-4px); }
  75% { transform: translateX(4px); }
}

.submit-btn {
  font-family: var(--font-accent);
  font-weight: 700;
  font-size: 15px;
  letter-spacing: .02em;
  border: none;
  border-radius: 14px;
  padding: 14px 28px;
  background: var(--primary);
  color: var(--ink);
  cursor: pointer;
  transition: background .2s var(--ease), transform .15s var(--ease), opacity .2s var(--ease);
}

.submit-btn:hover:not(.is-disabled) { background: var(--secondary); color: #fff; transform: translateY(-1px); }
.submit-btn.is-disabled { opacity: .4; cursor: not-allowed; }

@media (max-width: 480px) {
  :root { --submit-h: 128px; }

  .submit-bar { height: auto; padding: 12px 0; }

  .submit-bar__inner {
    flex-direction: column;
    align-items: stretch;
    justify-content: flex-start;
    gap: 10px;
  }

  /* flex-basis: 160px on .submit-bar__name means preferred *width* in the
     normal row layout, but flips to preferred *height* once the flex
     container above goes column — reset it so the name field doesn't get
     forced 160px tall. */
  .submit-bar__name { flex: 0 0 auto; }

  .submit-btn { width: 100%; text-align: center; }
}

/* ---------- Site menu drawer ---------- */

.drawer-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(22, 22, 22, .5);
  z-index: 70;
  opacity: 0;
  transition: opacity .25s var(--ease);
}
.drawer-backdrop.is-shown { opacity: 1; }
.drawer-backdrop[hidden] { display: none; }

.site-drawer {
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  z-index: 71;
  width: 280px;
  max-width: 85vw;
  background: var(--paper);
  box-shadow: 8px 0 30px rgba(0,0,0,0);
  transform: translateX(-100%);
  transition: transform .3s var(--ease), box-shadow .3s var(--ease);
  display: flex;
  flex-direction: column;
  overflow-y: auto;
}
.site-drawer.is-open { transform: translateX(0); box-shadow: 8px 0 30px rgba(0,0,0,.25); }

.site-drawer__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 18px 20px;
  background: var(--accent);
  color: var(--paper);
  flex: 0 0 auto;
}

.site-drawer__logo {
  height: 68px;
  width: auto;
  display: block;
}

.site-drawer__close {
  border: none;
  background: none;
  color: var(--paper);
  font-size: 22px;
  line-height: 1;
  padding: 4px 6px;
  cursor: pointer;
  border-radius: 6px;
  transition: background .15s var(--ease);
}
.site-drawer__close:hover { background: rgba(255, 251, 246, .16); }

.site-drawer__list {
  list-style: none;
  margin: 0;
  padding: 8px 0;
}
.site-drawer__list li + li { border-top: 1px solid var(--line); }

.site-drawer__list a {
  display: block;
  padding: 16px 20px 12px;
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 16px;
  text-transform: uppercase;
  letter-spacing: .03em;
  text-decoration: none;
  color: var(--ink);
  transition: background .15s var(--ease), color .15s var(--ease);
}
.site-drawer__list a:hover { background: var(--paper-dim); color: var(--secondary); }

/* ---------- Toast ---------- */

.toast {
  position: fixed;
  left: 50%;
  bottom: calc(var(--submit-h) + 16px);
  transform: translate(-50%, 12px);
  background: var(--ok);
  color: #fff;
  padding: 11px 18px 9px;
  border-radius: 14px;
  font-size: 14px;
  opacity: 0;
  pointer-events: none;
  transition: opacity .3s var(--ease), transform .3s var(--ease);
  z-index: 60;
}
.toast.is-shown {
  opacity: 1;
  transform: translate(-50%, 0);
}

.toast.toast--warn {
  background: var(--secondary);
}

/* ---------- Submit sequence (spinner + result screen) ---------- */

/* Thins the body's own paper-tinted scrim (see the body rule above) so more
   of the red splash texture shows through behind the spinner, instead of
   the usual pale wash — gives the spinner more contrast to sit against.
   Stays thinned through both result states too, not just submitting —
   otherwise it would fade back to the pale .85 wash the instant a result
   comes in, at the same time .state-scrim is separately (and more slowly)
   fading to its own full-red opacity, producing a visible "gets lighter,
   then gets darker" double-fade instead of one clean transition. Only
   reverts to pale once actually back at idle. */
body[data-state="submitting"],
body[data-state="result-success"],
body[data-state="result-error"] {
  background-image:
    linear-gradient(rgba(255, 251, 246, .5), rgba(255, 251, 246, .5)),
    url('assets/NA4_background.webp');
}

/* Fade out the interactive page content on submit, leaving the body's own
   background visible — the header, and its logo specifically, get animated
   out separately in JS (see beginSubmitSequence/showResult) rather than
   being covered by this rule, since the logo needs to still be readable at
   its exact position for the shared-element travel animation. */
body[data-state="submitting"] .section-nav,
body[data-state="submitting"] main,
body[data-state="submitting"] .submit-bar,
body[data-state="result-success"] .section-nav,
body[data-state="result-success"] main,
body[data-state="result-success"] .submit-bar,
body[data-state="result-error"] .section-nav,
body[data-state="result-error"] main,
body[data-state="result-error"] .submit-bar {
  opacity: 0;
  pointer-events: none;
  transition: opacity .4s var(--ease);
}

/* The header stays visible through the spinner phase (it's not "main
   content", and the logo needs a visible spot to travel from) — it only
   fades once a result comes back, at the same moment the logo clone spawns
   and starts its travel animation. */
body[data-state="result-success"] .site-header,
body[data-state="result-error"] .site-header {
  opacity: 0;
  pointer-events: none;
  transition: opacity .4s var(--ease);
}

.state-scrim {
  position: fixed;
  inset: 0;
  /* Same red + yellow-flecked pattern as the header splash background, not
     a flat colour — the darken-on-result effect should read as "more of
     our red", in keeping with the header's own treatment. */
  background: #DB2F1F url('assets/NA4_background.webp') center/420px repeat;
  opacity: 0;
  pointer-events: none;
  transition: opacity 1.1s var(--ease);
  z-index: 80;
}
body[data-state="result-success"] .state-scrim,
body[data-state="result-error"] .state-scrim {
  opacity: 1;
}

.submit-spinner {
  position: fixed;
  top: 50%;
  left: 50%;
  width: 84px;
  height: 84px;
  margin: -42px 0 0 -42px;
  border: 7px solid rgba(255, 251, 246, .35);
  border-top-color: var(--paper);
  border-radius: 50%;
  opacity: 0;
  pointer-events: none;
  transition: opacity .3s var(--ease);
  animation: submit-spin 0.9s linear infinite;
  z-index: 90;
}
body[data-state="submitting"] .submit-spinner {
  opacity: 1;
}
@keyframes submit-spin {
  to { transform: rotate(360deg); }
}

/* The logo clone spawned at the header logo's exact rect, then animated to
   its resting spot via left/top/width/height transitions (a FLIP-style
   shared-element transition) — see animateLogoToResult() in script.js. */
.result-logo {
  position: fixed;
  z-index: 91;
  margin: 0;
  transform-origin: top left;
  /* A "back ease out" curve (slight overshoot past the resting spot, then
     settle) rather than the site's usual smooth deceleration — gives the
     travel a bit of swing/momentum instead of just gliding to a stop. */
  transition: transform 1.1s cubic-bezier(.34, 1.4, .64, 1);
}

.result-box {
  position: fixed;
  left: 50%;
  top: 46%;
  width: min(420px, calc(100vw - 48px));
  transform: translate(-50%, 0);
  background: var(--paper);
  border-radius: 20px;
  padding: 28px 26px 26px;
  text-align: center;
  box-shadow: 0 20px 60px rgba(0,0,0,.25);
  opacity: 0;
  pointer-events: none;
  transition: opacity .4s var(--ease), transform .4s var(--ease);
  z-index: 90;
}
.result-box.is-shown {
  opacity: 1;
  transform: translate(-50%, 8px);
  pointer-events: auto;
}

.result-box__title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 26px;
  margin: 0 0 10px;
  color: var(--accent);
}
.result-box--error .result-box__title {
  font-family: var(--font-display);
  font-weight: normal;
  font-size: 22px;
  color: var(--secondary);
}

.result-box__message {
  margin: 0 0 18px;
  color: var(--ink);
  line-height: 1.5;
}

.result-box__links {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
}
.result-box__links a,
.result-box__links button {
  font-family: var(--font-accent);
  font-weight: 600;
  font-size: 14px;
  text-decoration: none;
  background: var(--ink);
  color: var(--paper);
  border: none;
  padding: 10px 18px;
  border-radius: 999px;
  cursor: pointer;
  transition: background .2s var(--ease), transform .2s var(--ease);
}
.result-box__links a {
  position: relative;
  top: 4px;
  padding-top: 12px;
  padding-bottom: 8px;
}
.result-box__links a:hover,
.result-box__links button:hover {
  background: var(--secondary);
  transform: translateY(-1px);
}

