/* ==========================================================================
   OFFSITE · Leave the script
   Fonts: Instrument Serif + Instrument Sans (SIL OFL 1.1), self-hosted.
   The story page is a 3D journey (/assets/experience/main.js). Its DOM is the
   accessible narrative and, whenever WebGL is not running, a complete
   editorial version of the same story. html.xp-on switches between the two.
   ========================================================================== */

@font-face {
  font-family: "Instrument Serif";
  src: url("/assets/fonts/instrument-serif.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Instrument Serif";
  src: url("/assets/fonts/instrument-serif-italic.woff2") format("woff2");
  font-weight: 400;
  font-style: italic;
  font-display: swap;
}
@font-face {
  font-family: "Instrument Sans";
  src: url("/assets/fonts/instrument-sans.woff2") format("woff2");
  font-weight: 400 700;
  font-stretch: 75% 100%;
  font-style: normal;
  font-display: swap;
}

:root {
  --ivory: #f2ede3;
  --ivory-2: #e7e0d1;
  --graphite: #1c1b19;
  --ink: #1c1b19;
  --ink-soft: #57524a;
  --rule: rgba(28, 27, 25, 0.13);
  --signal: #e8411c;
  --signal-deep: #b8300f;
  --night: #131519;
  --cobalt: #2a3db4;
  --ochre: #e0ae3e;
  --forest: #1c4a3a;
  --paper: #efe6d1;
  --blue-ink: #20398a;
  /* Journey colour arc (00_MASTER_SPEC). */
  --xp-black: #070708;
  --xp-graphite: #171719;
  --xp-grey: #747477;
  --xp-bone: #e8e8e3;
  --xp-signal: #ff3b18;
  --xp-break: #ff5a1f;
  --xp-hot: #ff163d;
  --xp-cream: #fff8e7;
  --serif: "Instrument Serif", "Iowan Old Style", "Palatino Linotype", Georgia, serif;
  --sans: "Instrument Sans", "Helvetica Neue", Arial, system-ui, sans-serif;
  --gutter: clamp(20px, 5vw, 88px);
  --ease: cubic-bezier(0.7, 0, 0.2, 1);
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  color-scheme: light;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; background: var(--ivory); }
body {
  margin: 0;
  background: var(--ivory);
  color: var(--ink);
  font: 400 17px/1.6 var(--sans);
  -webkit-font-smoothing: antialiased;
  overflow-x: clip;
  text-rendering: optimizeLegibility;
}
h1, h2, h3, p, figure { margin: 0; }
a { color: inherit; }
em { font-style: italic; }
button, input, textarea { font: inherit; color: inherit; }
::selection { background: var(--signal); color: var(--graphite); }
:focus-visible { outline: 2px solid var(--signal); outline-offset: 4px; }
[hidden] { display: none !important; }
.visually-hidden {
  position: absolute !important; width: 1px; height: 1px; margin: -1px; padding: 0;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

/* Paper grain on the apply page (the journey renders its own grain). */
.page-apply::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 40;
  pointer-events: none;
  opacity: 0.07;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 .55 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

.display { font-family: var(--serif); font-weight: 400; letter-spacing: -0.015em; line-height: 0.98; text-wrap: balance; }
.display em { font-style: italic; }

/* ---------- Skip + masthead ------------------------------------------------ */
.skip-intro {
  position: fixed; z-index: 60; top: 12px; left: 12px;
  padding: 12px 16px; background: var(--graphite); color: var(--ivory);
  font-size: 14px; font-weight: 600; text-decoration: none;
  transform: translateY(calc(-100% - 24px));
}
.skip-intro:focus { transform: none; }

.masthead {
  position: fixed; z-index: 30; inset: 0 0 auto;
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: max(16px, env(safe-area-inset-top)) max(var(--gutter), env(safe-area-inset-right)) 0 max(var(--gutter), env(safe-area-inset-left));
  pointer-events: none;
  --mast-ink: var(--graphite);
}
.masthead > * { pointer-events: auto; }
html[data-tone="dark"] .page-story .masthead { --mast-ink: var(--ivory); }
.masthead-actions { display: flex; align-items: center; gap: 10px; }
.sign-in-link { display: inline-flex; align-items: center; min-height: 44px; padding: 0 14px; color: var(--mast-ink, var(--graphite)); font: 600 13px/1 var(--sans); text-decoration: none; border-bottom: 1px solid transparent; transition: color .25s ease, border-color .25s ease; }
.sign-in-link:hover { border-color: currentColor; }
/* In the editorial story the shell scrolls away with the dark opening panel. */
html:not(.xp-on):not(.xp-pending) .page-story .masthead { position: absolute; }

.wordmark {
  display: inline-flex; align-items: baseline; min-height: 44px; padding-block: 12px;
  color: var(--mast-ink, var(--graphite)); text-decoration: none;
  font-family: var(--sans); font-weight: 650; font-stretch: 100%;
  font-size: 15px; letter-spacing: 0.2em; line-height: 1;
  transition: color 0.4s ease;
}
.wordmark-break {
  display: inline-block; width: 0.95em; height: 2px; margin: 0 0.22em 0 0.02em;
  background: var(--signal); transform: translateY(-0.3em) rotate(-22deg);
}
.wordmark-site { display: inline-block; transform: translateY(0.24em); }
.wordmark-small { font-size: 13px; min-height: 0; padding: 0; }

.join {
  position: relative;
  display: inline-flex; align-items: center; gap: 0.7em;
  min-height: 44px; padding: 0 18px;
  background: var(--graphite); color: var(--ivory);
  border: 1px solid color-mix(in srgb, var(--ivory) 30%, transparent);
  font: 600 14px/1 var(--sans); letter-spacing: 0.02em; text-decoration: none;
  transition: background-color 0.25s ease, color 0.25s ease;
}
.join:hover { background: var(--signal); color: var(--graphite); }
.join-arrow { font-size: 1.15em; transition: transform 0.3s var(--ease-out); }
.join:hover .join-arrow { transform: translateX(3px); }
.join-underline {
  position: absolute; left: 0; right: 0; bottom: -7px; height: 2px;
  background: var(--signal); transform: scaleX(0); transform-origin: left;
  transition: transform 0.45s var(--ease-out);
}
.join:hover .join-underline, .join:focus-visible .join-underline { transform: scaleX(1); }

/* ---------- The journey: editorial version (default) ----------------------
   This is what renders without JavaScript, without WebGL, or before the first
   3D frame: the same story as full-height typographic panels in the journey's
   colour arc, with the Offsite thread running down the page. */
html:has(body.page-story) { background: var(--xp-black); }
.page-story { background: var(--xp-black); color: var(--xp-bone); }
.page-story .masthead { --mast-ink: var(--xp-bone); }
html[data-tone="light"] .page-story .masthead { --mast-ink: var(--graphite); }

/* Playback stays reachable in both the cinematic and editorial stories. */
.auto-control {
  position: fixed; z-index: 35;
  right: max(var(--gutter), env(safe-area-inset-right));
  bottom: max(16px, env(safe-area-inset-bottom));
  display: grid; justify-items: end; gap: 6px;
}
.auto-control[hidden] { display: none; }
.auto-toggle {
  min-height: 44px; min-width: 114px; padding: 0 16px;
  border: 1px solid rgba(246, 242, 234, 0.4); border-radius: 2px;
  background: rgba(7, 7, 8, 0.9); color: var(--ivory);
  font: 600 11px/1 var(--sans); letter-spacing: 0.09em; text-transform: uppercase;
  cursor: pointer;
}
.auto-toggle:hover:not(:disabled) { border-color: var(--signal); }
.auto-toggle:focus-visible { outline: 2px solid var(--signal); outline-offset: 4px; }
.auto-toggle:disabled { cursor: default; opacity: 0.65; }
.auto-description {
  padding: 3px 6px; background: rgba(7, 7, 8, 0.9); color: var(--ivory);
  font: 400 10px/1.3 var(--sans); letter-spacing: 0.02em;
}

.journey { position: relative; z-index: 1; }
/* Keep the opening copy visible while the world loads. The first rendered
   frame takes over atomically, with its narrative and scroll anchors ready. */
.beat {
  position: relative; min-height: 100svh;
  display: grid; align-items: center;
  padding: 18vh var(--gutter);
  overflow: clip;
  background: var(--beat-bg, var(--xp-black));
  color: var(--beat-ink, var(--xp-bone));
}
.beat::before {
  content: ""; position: absolute; top: 0; bottom: 0; left: calc(var(--gutter) / 2);
  width: 2px; background: var(--xp-signal); box-shadow: 0 0 18px rgba(255, 59, 24, 0.6);
}
.beat-copy { position: relative; display: grid; gap: 28px; max-width: 1200px; }
.xp-statement {
  font: 400 clamp(2.8rem, 8vw, 8.4rem)/0.94 var(--serif);
  letter-spacing: -0.01em; text-transform: uppercase; text-wrap: balance;
}
.xp-quiet { font-size: clamp(2.4rem, 6.4vw, 6.4rem); }
.xp-monument { font-size: clamp(4rem, 15vw, 15rem); letter-spacing: -0.02em; }
.xp-note { font: italic 400 clamp(20px, 2vw, 28px)/1.3 var(--serif); opacity: 0.8; }
.scroll-cue {
  display: flex; flex-direction: column; align-items: center; gap: 14px;
  font: 600 12px/1 var(--sans); letter-spacing: 0.24em; text-transform: uppercase; color: var(--xp-bone);
}
/* Touch screens swipe; everything else scrolls. */
.cue-touch { display: none; }
@media (hover: none) and (pointer: coarse) {
  .cue-pointer { display: none; }
  .cue-touch { display: inline; }
}
.scroll-cue-track { position: relative; width: 1px; height: 44px; overflow: hidden; background: rgba(232, 232, 227, 0.25); }
.scroll-cue-dot {
  position: absolute; top: 0; left: -1px; width: 3px; height: 12px;
  background: var(--xp-signal); box-shadow: 0 0 10px rgba(255, 59, 24, 0.7);
}
@media (prefers-reduced-motion: no-preference) {
  .scroll-cue > * { animation: cue-in 0.9s 1s var(--ease) both; }
  .scroll-cue-dot { animation: cue-fall 1.8s 1.6s cubic-bezier(0.6, 0, 0.4, 1) infinite; }
}
@keyframes cue-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@keyframes cue-fall {
  0% { transform: translateY(-12px); opacity: 0; }
  20%, 80% { opacity: 1; }
  100% { transform: translateY(44px); opacity: 0; }
}
html.no-js .scroll-cue { display: none; }

.beat-signal { --beat-bg: radial-gradient(ellipse at 50% 78%, #2a0c06 0%, var(--xp-black) 58%); }
.beat-machine {
  --beat-bg:
    repeating-linear-gradient(90deg, transparent 0 calc(100% / 9 - 1px), rgba(232, 232, 227, 0.07) calc(100% / 9 - 1px) calc(100% / 9)),
    linear-gradient(var(--xp-graphite), #0b0b0d);
}
.beat-deviation { --beat-bg: radial-gradient(circle at 80% 50%, var(--xp-cream) 0, var(--xp-break) 10%, var(--xp-hot) 26%, #1a0605 64%); }
.beat-open { --beat-bg: linear-gradient(#ecd2c1, #c4a8a0 55%, #8c7f96); --beat-ink: var(--graphite); }
.beat-build {
  --beat-bg:
    repeating-linear-gradient(0deg, transparent 0 47px, rgba(0, 183, 255, 0.18) 47px 48px),
    repeating-linear-gradient(90deg, transparent 0 47px, rgba(0, 183, 255, 0.18) 47px 48px),
    linear-gradient(135deg, #0f2170, #1b3fd1 62%, #0a86c7);
}
.beat-create { --beat-bg: linear-gradient(120deg, #ff2e88, #ff6f5a 48%, #3a2bd1); }
.beat-discover { --beat-bg: radial-gradient(circle at 72% 42%, rgba(200, 255, 70, 0.3), transparent 22%), linear-gradient(#07061a, #24104f); }
.beat-connect { --beat-bg: linear-gradient(135deg, #f0a93b, #e8591c 42%, #5a2b8c 78%, #1fb6c9); }
.beat-first-move { --beat-bg: linear-gradient(#d6c6b3 0 64%, #3b3632 64% 100%); --beat-ink: var(--graphite); }
.beat-go-offsite { --beat-bg: var(--ivory); --beat-ink: var(--graphite); }

.final { display: grid; gap: 18px; max-width: 920px; margin-top: 6vh; }
.final-question { font: 400 clamp(2.2rem, 5vw, 4.8rem)/1.02 var(--serif); text-wrap: balance; }
.final-underline { display: block; width: min(100%, 760px); height: 3px; background: var(--xp-signal); transform-origin: left center; }
.final-help { font: italic 400 clamp(19px, 1.6vw, 24px)/1.3 var(--serif); opacity: 0.75; }
.final-action {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: center;
  justify-self: center; width: 100%; margin-top: 22px;
}
.join-large { min-height: 64px; padding: 0 30px; font-size: 18px; }
.journey-end { height: 1px; outline: none; }

/* ---------- The journey: 3D (html.xp-on) -------------------------------------
   Sections become lengths of the scroll timeline; their copy is a fixed overlay
   whose lines fade in and out with the camera (the script writes --o). */
:root { --journey: 1500svh; }
.beat-signal { --len: 0.055; }
/* Machine and Build are transits (no panel): the camera still flies through
   their worlds, just quickly, so the journey stays continuous but shorter. */
.beat-machine { --len: 0.05; }
.beat-deviation { --len: 0.1; }
.beat-open { --len: 0.1; }
.beat-build { --len: 0.04; }
.beat-create { --len: 0.11; }
.beat-discover { --len: 0.11; }
.beat-connect { --len: 0.09; }
.beat-first-move { --len: 0.09; }
.beat-go-offsite { --len: 0.075; }

.xp-canvas { position: fixed; inset: 0; z-index: 0; display: block; width: 100%; height: 100%; pointer-events: none; }
html:not(.xp-on) .xp-canvas { visibility: hidden; }
/* Keep the final timeline on reload; cover it until the first complete draw. */
html.xp-pending .page-story { background: var(--xp-black); }
html.xp-pending .page-story .masthead { --mast-ink: var(--ivory); }
html.xp-pending .journey { visibility: hidden; }
html.xp-pending .auto-control { visibility: hidden; }
.experience-loading {
  position: fixed; inset: 0; z-index: 20;
  background: var(--xp-black); color: var(--xp-bone);
  pointer-events: none; opacity: 0; visibility: hidden;
  transition: opacity 0.95s cubic-bezier(0.22, 1, 0.36, 1), visibility 0s 0.95s;
}
html.xp-pending .experience-loading { opacity: 1; visibility: visible; transition: none; }
.experience-loading-guide { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.experience-loading-path {
  fill: none; stroke: #ff641f; stroke-width: 2; stroke-linecap: round;
  vector-effect: non-scaling-stroke; stroke-dasharray: 1; stroke-dashoffset: 0;
  opacity: 0.85; filter: drop-shadow(0 0 6px rgba(255, 100, 31, 0.3));
}
html.js .experience-loading-path { animation: opening-guide 1.6s cubic-bezier(0.22, 1, 0.36, 1) both; }
@keyframes opening-guide { from { stroke-dashoffset: 1; } to { stroke-dashoffset: 0; } }
.experience-loading-point {
  position: absolute; left: 50%; top: 51.667%; width: 5px; height: 5px;
  border-radius: 50%; background: #ff641f;
  box-shadow: 0 0 12px rgba(255, 100, 31, 0.5), 0 0 48px rgba(255, 100, 31, 0.15);
  transform: translate(-50%, -50%);
}
html.js .experience-loading-point { animation: opening-breath 2.8s ease-in-out infinite alternate; }
@keyframes opening-breath {
  from { transform: translate(-50%, -50%) scale(0.85); }
  to { transform: translate(-50%, -50%) scale(1.1); }
}
.experience-loading-label {
  position: absolute; left: 50%; top: calc(51.667% + 26px); transform: translateX(-50%);
  font-size: 11px; letter-spacing: 0.12em; text-transform: uppercase; white-space: nowrap;
  opacity: 0.65;
}
@media (prefers-reduced-motion: reduce) {
  html.js .experience-loading-path, html.js .experience-loading-point { animation: none; }
  .experience-loading { transition: none; }
}

/* The thread's pointer trail on the final screen (trail.js): above the world,
   beneath the copy, never in the way of a click. */
.xp-trail { position: fixed; inset: 0; z-index: 1; display: block; width: 100%; height: 100%; pointer-events: none; opacity: 0; }
html:not(.xp-on) .xp-trail, html:not([data-xp-scene="go-offsite"]) .xp-trail { visibility: hidden; }

/* A transit has no copy, so the editorial story skips it entirely. */
html:not(.xp-on):not(.xp-pending) .beat-transit { display: none; }
html.xp-pending .beat,
html.xp-on .beat {
  display: block; min-height: 0; height: calc(var(--len) * var(--journey));
  padding: 0; overflow: visible; background: none; color: var(--xp-bone);
}
html.xp-pending .beat::before,
html.xp-on .beat::before { display: none; }
/* The destination needs room to arrive and rest, whatever the viewport. */
html.xp-pending .beat-go-offsite,
html.xp-on .beat-go-offsite { height: max(calc(var(--len) * var(--journey)), 150svh); }
html.xp-pending .beat-copy,
html.xp-on .beat-copy {
  position: fixed; inset: 0; z-index: 2;
  display: grid; grid-template: 1fr / 1fr; place-items: end start;
  max-width: none; padding: 96px var(--gutter) max(9vh, 64px); text-align: left;
  pointer-events: none;
}
html.xp-pending .beat-copy > *,
html.xp-on .beat-copy > * { grid-area: 1 / 1; }
html.xp-pending .xp-line,
html.xp-on .xp-line {
  opacity: var(--o, 0);
  transform: translateY(calc((1 - var(--o, 0)) * 18px));
  text-shadow: 0 2px 36px rgba(0, 0, 0, 0.35);
}
html.xp-pending .xp-line.is-live,
html.xp-on .xp-line.is-live { pointer-events: auto; }
html.xp-pending .xp-statement,
html.xp-on .xp-statement { max-width: 14ch; font-size: clamp(2.4rem, 6.2vw, 6.8rem); }
html.xp-pending .xp-quiet,
html.xp-on .xp-quiet { font-size: clamp(2.2rem, 5.2vw, 5.6rem); }
html.xp-pending .scroll-cue,
html.xp-on .scroll-cue { justify-self: center; }
html.xp-pending .beat-first-move .xp-statement,
html.xp-on .beat-first-move .xp-statement { margin-bottom: clamp(3.6rem, 8vh, 5.4rem); }
html.xp-pending .xp-monument,
html.xp-on .xp-monument { place-self: center; max-width: none; text-align: center; font-size: clamp(4rem, 13vw, 13rem); }
html.xp-pending .xp-spatial,
html.xp-on .xp-spatial {
  position: absolute !important; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap;
}
html.xp-pending .final,
html.xp-on .final { place-self: center; justify-items: center; text-align: center; margin-top: 0; }
html.xp-pending .final-underline,
html.xp-on .final-underline { transform: scaleX(var(--land, 0)); box-shadow: none; }
html.xp-on[data-tone="light"] .beat-go-offsite { color: var(--graphite); }
html.xp-on[data-tone="light"] .xp-line { text-shadow: none; }

/* ---------- /apply ------------------------------------------------------------- */
.page-apply {
  --apply-sticky-top: 82px;
  background: var(--ivory);
}
.page-apply .masthead {
  min-height: var(--apply-sticky-top);
  background: var(--ivory);
}
.back-link {
  display: inline-flex; align-items: center; gap: 8px; min-height: 44px;
  font-size: 14px; font-weight: 600; text-decoration: none; color: var(--graphite);
}
.back-link:hover { color: var(--signal-deep); }
.apply {
  display: grid; grid-template-columns: minmax(0, 4.5fr) minmax(0, 7.5fr); gap: clamp(36px, 6vw, 120px);
  min-height: 100svh; padding: clamp(120px, 16vh, 180px) var(--gutter) 96px;
}
.apply-intro { align-self: start; position: sticky; top: 120px; }
.apply-title { margin-top: 28px; font-size: clamp(3rem, 6vw, 6.4rem); line-height: 0.92; }
.apply-title em { color: var(--signal); }
.apply-lede { margin-top: 26px; max-width: 34ch; font-size: clamp(17px, 1.4vw, 20px); color: var(--ink-soft); }
.selection-note {
  margin-top: 34px; max-width: 44ch; padding: 20px 0 0 28px;
  border-top: 1px solid var(--rule); border-left: 3px solid var(--signal);
}
.selection-note-label {
  margin-bottom: 8px; font-size: 12px; font-weight: 700; letter-spacing: 0.16em;
  text-transform: uppercase; color: var(--signal-deep);
}
.selection-note p:last-child { font-size: 15px; color: var(--ink-soft); }
.privacy { margin-top: 40px; max-width: 42ch; border-top: 1px solid var(--rule); }
.privacy summary {
  list-style: none; cursor: pointer; display: flex; align-items: center; justify-content: space-between;
  min-height: 48px; font-size: 13px; font-weight: 650; letter-spacing: 0.18em; text-transform: uppercase;
}
.privacy summary::-webkit-details-marker { display: none; }
.privacy summary::after { content: "+"; font-size: 20px; font-weight: 400; letter-spacing: 0; }
.privacy[open] summary::after { content: "−"; }
.privacy p { padding-bottom: 18px; font-size: 15px; color: var(--ink-soft); }

.apply-panel { max-width: 760px; width: 100%; }
.partner-invite-note { max-width: 43ch; font-size: 13px; color: var(--ink-soft); margin-top: 23px; padding-top: 18px; border-top: 1px solid var(--rule); }
.application-first-note { max-width: 43ch; font-size: 13px; color: var(--ink-soft); margin-top: 15px; }
.application-auth-gate { padding: 30px; border: 1px solid var(--rule); background: color-mix(in srgb, var(--ivory) 85%, white); margin-bottom: 28px; }
.application-auth-gate h2 { font: 40px/1.05 var(--serif); margin-bottom: 14px; }
.application-auth-gate p { font-size: 14px; color: var(--ink-soft); margin-bottom: 17px; }
.application-auth-gate .auth-actions { display: flex; gap: 14px; flex-wrap: wrap; align-items: center; margin-top: 23px; }
.application-auth-gate form { display: grid; gap: 12px; }
.application-auth-gate label { font-size: 12px; font-weight: 600; margin-top: 8px; }
.application-auth-gate input { width: 100%; border: 1px solid var(--rule); background: var(--ivory); color: var(--graphite); padding: 14px; font: inherit; min-height: 46px; }
.application-auth-gate .submit { justify-self: start; margin-top: 12px; }
.application-auth-gate .auth-gate-error { color: #a33320; font-size: 13px; margin-top: 10px; }
.application-auth-gate .auth-gate-note { font-size: 12px; }
.application-form[hidden], .application-auth-gate[hidden] { display: none; }
.application-progress {
  position: sticky; top: var(--apply-sticky-top); z-index: 5; margin-bottom: 46px; padding: 18px 0 22px;
  background: var(--ivory);
}
.progress-copy { display: flex; justify-content: space-between; gap: 24px; }
.progress-copy p {
  font-size: 12px; font-weight: 700; letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--ink-soft);
}
.progress-track { height: 2px; margin-top: 13px; overflow: hidden; background: var(--rule); }
.progress-bar {
  display: block; width: 25%; height: 100%; background: var(--signal);
  transform-origin: left center; transition: width 0.45s var(--ease);
}
.progress-track[aria-valuenow="2"] .progress-bar { width: 50%; }
.progress-track[aria-valuenow="3"] .progress-bar { width: 75%; }
.progress-track[aria-valuenow="4"] .progress-bar { width: 100%; }
.progress-track[data-total-steps="5"][aria-valuenow="1"] .progress-bar { width: 20%; }
.progress-track[data-total-steps="5"][aria-valuenow="2"] .progress-bar { width: 40%; }
.progress-track[data-total-steps="5"][aria-valuenow="3"] .progress-bar { width: 60%; }
.progress-track[data-total-steps="5"][aria-valuenow="4"] .progress-bar { width: 80%; }
.progress-track[data-total-steps="5"][aria-valuenow="5"] .progress-bar { width: 100%; }
.progress-steps {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-top: 12px;
  list-style: none;
}
.progress-steps li {
  font-size: 11px; font-weight: 650; letter-spacing: 0.1em; text-transform: uppercase;
  color: #8a8478; transition: color 0.25s ease;
}
.progress-steps li.is-current, .progress-steps li.is-complete { color: var(--graphite); }
.has-account-step .progress-steps { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.application-inline-link { border: 0; background: transparent; color: var(--signal-deep); font: inherit; font-weight: 600; text-decoration: underline; text-underline-offset: 4px; cursor: pointer; padding: 0; text-align: left; }
.account-step-note { font-size: 14px; color: var(--ink-soft); line-height: 1.8; padding-top: 20px; border-top: 1px solid var(--rule); }
.application-step[data-application-step="account"] .step-title em { color: var(--signal); }
.application-form { display: grid; gap: 40px; }
.application-fields { display: block; margin: 0; padding: 0; border: 0; min-width: 0; }
.application-step { display: grid; gap: 42px; }
.application-step, .application-step .field { scroll-margin-top: calc(var(--apply-sticky-top) + 180px); }
.application-step[hidden] { display: none !important; }
.step-header { padding-bottom: 28px; border-bottom: 1px solid var(--rule); }
.step-eyebrow {
  font-size: 12px; font-weight: 700; letter-spacing: 0.16em; text-transform: uppercase;
  color: var(--signal-deep);
}
.step-title { margin-top: 10px; font-size: clamp(2.4rem, 4.5vw, 4.5rem); line-height: 0.98; }
.step-description { margin-top: 14px; max-width: 48ch; color: var(--ink-soft); }
.step-fields { display: grid; gap: 42px; }
.field { position: relative; display: grid; gap: 10px; }
.field label { display: flex; align-items: baseline; flex-wrap: wrap; gap: 6px 14px; font-size: clamp(18px, 1.5vw, 21px); font-weight: 560; line-height: 1.3; }
.field-number { font-size: 12px; font-weight: 650; letter-spacing: 0.1em; color: var(--signal-deep); font-variant-numeric: tabular-nums; }
.field-optional { font-size: 12px; font-weight: 600; letter-spacing: 0.14em; text-transform: uppercase; color: var(--ink-soft); }
.field-help { font: italic 400 19px/1.3 var(--serif); color: var(--ink-soft); }
.field input, .field textarea {
  width: 100%; min-height: 52px; padding: 12px 4px; border: 0; border-radius: 0;
  background: transparent; font-size: 18px; line-height: 1.5; outline: none;
  transition: background-color 0.2s ease;
}
.field textarea { min-height: 142px; resize: vertical; }
.field-checkbox label { align-items: flex-start; cursor: pointer; }
.field-checkbox input[type="checkbox"] {
  width: 22px; min-height: 22px; height: 22px; margin: 1px 2px 0 0; padding: 0;
  accent-color: var(--signal-deep); flex: 0 0 auto;
}
.field input::placeholder, .field textarea::placeholder { color: #8a8478; }
.field input:focus, .field textarea:focus { background: rgba(232, 65, 28, 0.06); }
.field-line { display: block; height: 2px; margin-top: -10px; background: rgba(28, 27, 25, 0.28); transform-origin: left; transition: background-color 0.2s ease, transform 0.2s ease; }
.field:focus-within .field-line { background: var(--signal); transform: scaleY(1.6); }
.field.is-invalid .field-line { background: #a4231b; }
.field-error { min-height: 0; font-size: 14px; font-weight: 600; color: #a4231b; }
.field-error:empty { display: none; }
/* The journey's thread lands in the first selective application step. */
.field:has(#field-current-focus) .field-line { background: var(--signal); view-transition-name: thread; }
@media (prefers-reduced-motion: no-preference) {
  .field:has(#field-current-focus) .field-line { animation: land 0.9s 0.2s var(--ease) both; }
}
@keyframes land { from { transform: scaleX(0); } to { transform: scaleX(1); } }
.trap { position: absolute; left: -10000px; top: auto; width: 1px; height: 1px; overflow: hidden; }

.form-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 16px; }
.submit {
  display: inline-flex; align-items: center; gap: 18px; min-height: 60px; padding: 0 28px;
  border: 0; background: var(--graphite); color: var(--ivory);
  font-size: 17px; font-weight: 600; cursor: pointer; transition: background-color 0.25s ease, color 0.25s ease;
}
.submit:hover:not(:disabled) { background: var(--signal); color: var(--graphite); }
.submit:disabled { opacity: 0.55; cursor: not-allowed; }
.submit[aria-busy="true"] { opacity: 1; cursor: progress; }
.form-secondary {
  display: inline-flex; align-items: center; gap: 10px; min-height: 60px; padding: 0 20px;
  border: 1px solid var(--rule); background: transparent; color: var(--graphite);
  font-size: 15px; font-weight: 650; cursor: pointer;
}
.form-secondary:hover:not(:disabled) { border-color: var(--graphite); }
.form-fineprint { flex-basis: 100%; font-size: 14px; color: var(--ink-soft); }

.form-status { font-size: 16px; line-height: 1.5; outline: none; }
.form-status:empty { display: none; }
.form-status { margin-bottom: 32px; padding: 16px 0; border-top: 2px solid var(--graphite); border-bottom: 1px solid var(--rule); }
.form-status.is-error { border-top-color: #a4231b; color: #7d1a14; }

.form-success { outline: none; padding-top: 12px; }
.success-line { width: min(100%, 420px); height: auto; overflow: visible; }
.success-line path { fill: none; stroke: var(--signal); stroke-width: 3; stroke-linecap: round; stroke-dasharray: 1; stroke-dashoffset: 0; }
@media (prefers-reduced-motion: no-preference) {
  .success-line path { animation: success-draw 1.1s var(--ease) both; }
}
@keyframes success-draw { from { stroke-dashoffset: 1; } to { stroke-dashoffset: 0; } }
.success-title { margin-top: 28px; font-size: clamp(2.6rem, 5vw, 5rem); }
.success-copy { margin: 14px 0 36px; font: italic 400 clamp(22px, 2vw, 30px)/1.3 var(--serif); color: var(--ink-soft); }
.success-username { margin: 0 0 15px; padding: 14px 17px; border-left: 3px solid var(--signal); background: color-mix(in srgb, var(--signal) 6%, var(--ivory)); font-size: 16px; font-weight: 600; overflow-wrap: anywhere; }
.success-review-note { color: var(--ink-soft); font-size: 14px; margin-bottom: 23px; max-width: 44ch; }
@media (max-width: 560px) { .has-account-step .progress-steps { gap: 7px; } .has-account-step .progress-steps li { font-size: 8px; letter-spacing: .03em; } .application-auth-gate { padding: 23px; } .application-auth-gate h2 { font-size: 33px; } .application-step[data-application-step="account"] .field-help { font-size: 17px; } }

/* ---------- Cross-document continuity: the final underline becomes a field ---- */
@view-transition { navigation: auto; }
::view-transition-group(thread) { animation-duration: 0.7s; animation-timing-function: var(--ease); }
::view-transition-old(root), ::view-transition-new(root) { animation-duration: 0.35s; }

/* ---------- Responsive ---------------------------------------------------------- */
@media (max-width: 900px) {
  .page-apply { --apply-sticky-top: 72px; }
  .apply { grid-template-columns: minmax(0, 1fr); }
  .apply-intro { position: static; }
}
@media (max-width: 640px) {
  .page-apply { --apply-sticky-top: 64px; }
  :root { --journey: 1250svh; }
  body { font-size: 16px; }
  .masthead { padding-top: max(10px, env(safe-area-inset-top)); }
  .masthead-actions { gap: 6px; }
  .wordmark { font-size: 13px; letter-spacing: 0.16em; }
  .join { padding: 0 14px; font-size: 13px; }
  .xp-statement { font-size: clamp(2.3rem, 11.5vw, 3.8rem); }
  .xp-quiet { font-size: clamp(2.1rem, 10vw, 3.4rem); }
  .xp-monument { font-size: clamp(3.4rem, 19vw, 5.4rem); }
  .final-question { font-size: clamp(1.9rem, 8.4vw, 2.8rem); }
  .join-large { min-height: 58px; font-size: 17px; }
  .apply { padding-top: 104px; gap: 48px; }
  .apply-title { font-size: clamp(2.8rem, 13vw, 4rem); }
  .selection-note { padding-left: 20px; }
  .application-progress { margin-bottom: 32px; padding-top: 14px; }
  .progress-steps { gap: 6px; }
  .progress-steps li { font-size: 9px; letter-spacing: 0.06em; }
  .application-form, .application-step, .step-fields { gap: 32px; }
  .step-title { font-size: clamp(2.4rem, 11vw, 3.4rem); }
  .form-secondary { width: 100%; justify-content: center; }
  .submit { width: 100%; justify-content: space-between; }
}

/* ---------- Reduced motion: cuts, not flights ----------------------------------
   The 3D journey still renders, but holds one settled frame per scene. */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  html.xp-on .xp-line { transform: none; }
  @view-transition { navigation: none; }
}
