/* Both typefaces are served from this site (latin subset, variable weight),
   so the page needs no third-party request before it can draw. */
@font-face {
  font-family: "Big Shoulders Display";
  src: url("fonts/big-shoulders-display.woff2") format("woff2");
  font-weight: 800 900;
  font-display: swap;
}
@font-face {
  font-family: "Montserrat";
  src: url("fonts/montserrat.woff2") format("woff2");
  font-weight: 500 800;
  font-display: swap;
}

:root {
  --bg: #f4eeff;
  --ink: #1d0b3d;
  --plum: #2e1065;
  --purple: #6d28d9;
  --violet: #8b45ff;
  --deep: #4c1d95;
  --muted: #6a5b86;
  --line: #dccfff;
  --error: #b4234d;
  --display: "Montserrat", "Arial Black", Arial, sans-serif;
  --condensed: "Big Shoulders Display", "Arial Narrow", Impact, sans-serif;
  --gutter: clamp(20px, 6vw, 32px);
}

*, *::before, *::after { box-sizing: border-box; }

html {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--display);
  font-size: 100%;
  -webkit-text-size-adjust: 100%;
  -webkit-font-smoothing: antialiased;
}

body { margin: 0; min-height: 100dvh; overflow-x: hidden; }

p, h1, h2, h3, h4, fieldset, legend { margin: 0; padding: 0; }
fieldset { border: 0; min-width: 0; }

[hidden] { display: none !important; }

:focus-visible { outline: 3px solid var(--violet); outline-offset: 3px; }

/* ---------- Background ---------- */
/* Flat lilac with a faint drafting grid, and two soft patches of light that
   drift slowly. Transform-only animation, so it runs off the main thread. */

.sky {
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  background-color: var(--bg);
  background-image:
    linear-gradient(rgb(76 29 149 / 0.055) 1px, transparent 1px),
    linear-gradient(90deg, rgb(76 29 149 / 0.055) 1px, transparent 1px);
  background-size: 28px 28px;
}
.sky i {
  position: absolute;
  display: block;
  will-change: transform;
  animation: sway 30s ease-in-out infinite alternate;
}
/* Drawn at a quarter size and scaled 4x: identical to look at, and the browser
   holds 16x less image in memory for them. */
.sky__a {
  width: 32.5vmax; height: 15.5vmax; left: -6.25vmax; top: -6.75vmax; --tilt: -24deg; --dx: 1.5vmax; --dy: 1.25vmax;
  background: radial-gradient(closest-side, rgb(255 255 255 / 0.9), rgb(255 255 255 / 0));
}
.sky__b {
  width: 27.5vmax; height: 11.5vmax; right: -18.75vmax; top: 39.25vmax; --tilt: -32deg; --dx: -2vmax; --dy: -1.5vmax;
  background: radial-gradient(closest-side, rgb(196 164 255 / 0.32), rgb(196 164 255 / 0));
  animation-duration: 38s;
}
@keyframes sway {
  from { transform: translate3d(0, 0, 0) rotate(var(--tilt)) scale(4); }
  to { transform: translate3d(calc(var(--dx) * 4), calc(var(--dy) * 4), 0) rotate(calc(var(--tilt) + 4deg)) scale(4); }
}

/* Faint outlined words rising slowly behind everything. */
.drift {
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
}
.drift span {
  position: absolute;
  top: 100%;
  font-family: var(--condensed);
  font-weight: 900;
  line-height: 1;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  white-space: nowrap;
  color: transparent;
  -webkit-text-stroke: 1px rgb(76 29 149 / 0.07);
  will-change: transform;
  animation: rise-by linear infinite;
}
@keyframes rise-by {
  from { transform: translate3d(0, 0, 0); }
  to { transform: translate3d(0, calc(-100vh - 100% - 40px), 0); }
}

.page { position: relative; z-index: 1; }

/* ---------- Opening scene ---------- */
/* Without the canvas effects this is an ordinary full-height header. With them
   (.has-dust) the stage is taller than the screen and the hero sticks to the
   top, so scrolling through the extra height plays the dissolve while the whole
   scene holds still. --p is how far through that scroll we are, 0 to 1. */

.hero {
  --p: 0;
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 100svh;
  padding: max(40px, env(safe-area-inset-top)) var(--gutter) 64px;
  overflow: hidden;
}

/* The scene stays hidden for a moment so it appears finished, not half-built.
   The .js class and a time limit are set in the page head, so it always shows. */
.js .hero { opacity: 0; }
.js.is-ready .hero { opacity: 1; transition: opacity 0.5s ease; }

.has-dust .stage { height: 160svh; }
.has-dust .hero { position: sticky; top: 0; height: 100svh; }

.fx {
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  display: none;
}
.has-dust .fx { display: block; }

.hero__inner {
  position: relative;
  width: 100%;
  max-width: 30rem;
  text-align: center;
}

/* Registration marks in the corners of the scene. */
.hero__corner, .hero__rule, .hero__cue, .claim__lead, .claim__rest { will-change: transform, opacity; }

.hero__corner {
  position: absolute;
  width: 22px;
  height: 22px;
  border: 0 solid rgb(76 29 149 / 0.55);
  opacity: clamp(0, calc(1 - var(--p) * 2), 1);
}
.hero__corner--tl { top: max(16px, env(safe-area-inset-top)); left: 16px; border-top-width: 2px; border-left-width: 2px; }
.hero__corner--tr { top: max(16px, env(safe-area-inset-top)); right: 16px; border-top-width: 2px; border-right-width: 2px; }
.hero__corner--bl { bottom: 16px; left: 16px; border-bottom-width: 2px; border-left-width: 2px; }
.hero__corner--br { bottom: 16px; right: 16px; border-bottom-width: 2px; border-right-width: 2px; }

.id { display: flex; flex-direction: column; align-items: center; gap: 12px; }

.id__mark, .claim__big {
  font-family: var(--condensed);
  font-weight: 900;
  background: linear-gradient(180deg, #b594ff 0%, #7030e6 52%, #3f1299 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.id__mark { font-size: min(54vw, 28svh, 15rem); line-height: 0.78; }

.id__business {
  font-size: clamp(0.8125rem, 3.6vw, 1rem);
  font-weight: 700;
  letter-spacing: 0.34em;
  text-indent: 0.34em;
  text-transform: uppercase;
  color: var(--deep);
}

/* Once app.js draws them on the canvas, the text versions keep their space in
   the layout and stay readable to screen readers, but are fully transparent. */
.has-dust .id { display: block; }
.has-dust .id__mark, .has-dust .id__business { position: absolute; opacity: 0; pointer-events: none; }
.has-dust .claim__big { opacity: 0; overflow: hidden; }

/* A machined rule with a centre mark, between the name and the claim. */
.hero__rule {
  position: relative;
  height: 1px;
  margin: clamp(24px, 5.5svh, 44px) auto clamp(22px, 5svh, 40px);
  width: 72%;
  background: var(--plum);
  opacity: clamp(0, calc(1 - var(--p) * 3), 1);
  transform: scaleX(calc(1 - var(--p) * 0.9));
}
.hero__rule i {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 9px;
  height: 9px;
  margin: -4.5px 0 0 -4.5px;
  background: var(--plum);
  transform: rotate(45deg);
  box-shadow: 0 0 0 4px var(--bg);
}

.claim { text-transform: uppercase; }
.claim span { display: block; }

.claim__lead {
  font-family: var(--condensed);
  font-size: clamp(1.75rem, 8vw, 2.5rem);
  font-weight: 800;
  line-height: 1;
  letter-spacing: 0.3em;
  text-indent: 0.3em;
  color: var(--ink);
  opacity: clamp(0, calc(1 - (var(--p) - 0.03) * 4), 1);
  transform: translate3d(0, calc(var(--p) * -46px), 0);
}

.claim__big {
  margin: clamp(10px, 2svh, 18px) 0 clamp(14px, 2.6svh, 22px);
  font-size: min(23vw, 8rem);
  line-height: 0.8;
  white-space: nowrap;
}

.claim__rest {
  font-size: clamp(0.8125rem, 3.7vw, 1.0625rem);
  font-weight: 700;
  line-height: 1.6;
  letter-spacing: 0.16em;
  color: var(--plum);
  text-wrap: balance;
  opacity: clamp(0, calc(1 - (var(--p) - 0.03) * 4), 1);
  transform: translate3d(0, calc(var(--p) * 38px), 0);
}

.stat {
  margin-top: 12px;
  font-size: 1rem;
  font-weight: 600;
  color: var(--purple);
}

/* "Scroll" with a line that keeps dropping away beneath it. */
.hero__cue {
  position: absolute;
  left: 0;
  right: 0;
  bottom: max(18px, env(safe-area-inset-bottom));
  padding-bottom: 26px;
  text-align: center;
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.34em;
  text-indent: 0.34em;
  text-transform: uppercase;
  color: var(--deep);
  opacity: clamp(0, calc(1 - var(--p) * 9), 1);
}
.hero__cue::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: 0;
  width: 1px;
  height: 20px;
  background: var(--purple);
  transform-origin: top;
  animation: drop 1.8s cubic-bezier(0.6, 0, 0.2, 1) infinite;
}
@keyframes drop {
  0% { transform: scaleY(0); opacity: 1; }
  60% { transform: scaleY(1); opacity: 1; }
  100% { transform: scaleY(1); opacity: 0; }
}

/* ---------- Eligibility check ---------- */
/* Flat and crisp on purpose: white cards with a hard outline, solid fills, no
   glows or gradients. The opening scene carries the spectacle; this part is a
   form and should read as one. */

.check {
  position: relative;
  z-index: 3;
  max-width: 31rem;
  margin: 0 auto;
  padding: 34px var(--gutter) 0;
  scroll-margin-top: 0;
}
/* With the pinned opening, the check starts rising while the scene is still
   breaking up, so there is never an empty screen between the two. */
.has-dust .check { margin-top: -48svh; }

.check::before {
  content: "";
  position: absolute;
  top: 0;
  left: var(--gutter);
  right: var(--gutter);
  height: 2px;
  background: var(--plum);
}
/* A spark that runs along that rule every few seconds. */
.check::after {
  content: "";
  position: absolute;
  top: -1px;
  left: var(--gutter);
  width: 48px;
  height: 4px;
  background: var(--violet);
  opacity: 0;
  animation: spark 6s cubic-bezier(0.5, 0, 0.3, 1) infinite;
}
@keyframes spark {
  0% { transform: translate3d(0, 0, 0); opacity: 0; }
  6% { opacity: 1; }
  30% { opacity: 1; }
  36%, 100% { transform: translate3d(calc(min(100vw, 31rem) - var(--gutter) * 2 - 48px), 0, 0); opacity: 0; }
}

.check__title {
  font-family: var(--condensed);
  font-size: clamp(2.5rem, 11.5vw, 3.25rem);
  font-weight: 800;
  line-height: 0.95;
  text-transform: uppercase;
  color: var(--ink);
}

.check__note {
  margin-top: 10px;
  font-size: 1rem;
  font-weight: 500;
  line-height: 1.4;
  color: var(--muted);
}

.check__bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 44px;
  margin-top: 18px;
}

.check__progress { font-size: 0.9375rem; font-weight: 600; color: var(--plum); }

.check__back {
  min-height: 44px;
  padding: 8px 0 8px 16px;
  border: 0;
  background: none;
  color: var(--purple);
  font: inherit;
  font-size: 0.9375rem;
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
}

.meter { height: 4px; background: #d9cbf7; }
.meter span {
  display: block;
  height: 100%;
  width: 0;
  background: var(--plum);
  transition: width 0.35s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.step { margin-top: 28px; }

.step legend, .result h3 {
  font-family: var(--condensed);
  font-size: clamp(1.875rem, 8.6vw, 2.5rem);
  font-weight: 800;
  line-height: 1;
  text-transform: uppercase;
  color: var(--plum);
  text-wrap: balance;
}

.step legend { margin-bottom: 20px; }

.choices { display: grid; gap: 10px; }

.choice {
  position: relative;
  display: block;
  color: inherit;
  text-decoration: none;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}
.choice input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }

.choice__face {
  display: flex;
  align-items: center;
  gap: 14px;
  min-height: 62px;
  padding: 14px 18px 14px 20px;
  border: 1.5px solid var(--plum);
  border-radius: 6px;
  background: #fff;
  font-size: 1.0625rem;
  font-weight: 700;
  color: var(--ink);
  transition: background-color 0.12s, color 0.12s;
}
.choice__face::after {
  content: "";
  flex: none;
  width: 9px;
  height: 9px;
  margin-left: auto;
  border-top: 2px solid currentColor;
  border-right: 2px solid currentColor;
  transform: rotate(45deg);
}
.choice__text { display: block; min-width: 0; }
.choice:active .choice__face { background: #e9dcff; }
.choice input:checked + .choice__face { background: var(--plum); color: #fff; }
.choice input:focus-visible + .choice__face { outline: 3px solid var(--violet); outline-offset: 3px; }

/* Each step's options rise into place one after another when it appears. */
.choices .choice { animation: lift 0.45s cubic-bezier(0.2, 0.8, 0.2, 1) both; }
.choices .choice:nth-child(2) { animation-delay: 0.05s; }
.choices .choice:nth-child(3) { animation-delay: 0.1s; }
.choices .choice:nth-child(4) { animation-delay: 0.15s; }
[data-choices="invite"] .choice { animation-delay: 0.24s; }
@keyframes lift {
  from { opacity: 0; transform: translateY(14px); }
  to { opacity: 1; transform: none; }
}

.or {
  display: flex;
  align-items: center;
  gap: 16px;
  margin: 28px 0 16px;
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--plum);
}
.or::before, .or::after { content: ""; flex: 1; height: 1px; background: var(--plum); opacity: 0.35; }

/* The invitation is the one filled card, so it reads as the different answer. */
.choice--invite .choice__face {
  min-height: 80px;
  padding: 16px 18px 16px 20px;
  background: var(--plum);
  color: #fff;
}
.choice--invite:active .choice__face { background: #43208a; }
.choice__hint {
  display: block;
  margin-top: 4px;
  font-size: 0.875rem;
  font-weight: 500;
  line-height: 1.4;
  color: #d9cbf7;
}

.field { display: block; margin-bottom: 14px; }
.field > span {
  display: block;
  margin-bottom: 6px;
  font-size: 0.9375rem;
  font-weight: 700;
  color: var(--plum);
}
.field em { font-style: normal; font-weight: 500; color: var(--muted); }
.field input {
  display: block;
  width: 100%;
  min-height: 54px;
  padding: 12px 14px;
  border: 1.5px solid var(--plum);
  border-radius: 6px;
  background: #fff;
  color: var(--ink);
  font: inherit;
  font-size: 1.0625rem;
  font-weight: 500;
}
.field input:focus { outline: 3px solid var(--violet); outline-offset: 2px; }
.field input[aria-invalid="true"] { border-color: var(--error); }

.error {
  margin-bottom: 14px;
  font-size: 0.9375rem;
  font-weight: 700;
  color: var(--error);
}

.fine {
  margin-top: 12px;
  font-size: 0.8125rem;
  font-weight: 500;
  line-height: 1.4;
  color: var(--muted);
}

/* ---------- Buttons ---------- */

.btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 60px;
  padding: 14px 24px;
  border: 0;
  border-radius: 6px;
  font-family: var(--condensed);
  font-size: 1.5rem;
  font-weight: 800;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  text-decoration: none;
  cursor: pointer;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

.btn--primary { color: #fff; background: var(--purple); }
.btn--primary:active { background: var(--deep); }

.btn--line { background: #fff; color: var(--plum); border: 1.5px solid var(--plum); }
.btn--line:active { background: #e9dcff; }

.btn[disabled] { opacity: 0.6; cursor: progress; }

/* ---------- Results ---------- */

.result { margin-top: 28px; }
.result:focus { outline: none; }
.result p { margin-top: 12px; font-size: 1rem; font-weight: 500; line-height: 1.5; color: var(--muted); }
.result .btn { margin-top: 22px; }
.result .result__next { color: var(--plum); font-weight: 700; }

.override {
  margin-top: 28px;
  padding-top: 22px;
  border-top: 1px solid rgb(46 16 101 / 0.35);
}
.override h4 {
  font-family: var(--condensed);
  font-size: 1.625rem;
  font-weight: 800;
  line-height: 1.05;
  text-transform: uppercase;
  color: var(--plum);
}
.override p { margin-top: 8px; }
.override .btn { margin-top: 16px; }

.foot {
  padding: 48px var(--gutter) calc(36px + env(safe-area-inset-bottom));
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--muted);
  max-width: 31rem;
  margin: 0 auto;
}

@media (prefers-reduced-motion: reduce) {
  .meter span, .choice__face { transition: none; }
  .choices .choice { animation: none; }
  .sky i, .drift span, .check::after, .hero__cue::after { animation: none; }
  .drift { display: none; }
}
