/* Values from tw-design tokens/tokens.json. Fonts self-hosted (Geist, OFL), no font host.
   Rhythm per tw-design: paper carries, night is the stage, sand gold only for the route. */
@font-face { font-family: "Geist"; src: url("/fonts/geist.woff2") format("woff2"); font-weight: 100 900; font-display: swap; }
@font-face { font-family: "Geist Mono"; src: url("/fonts/geist-mono.woff2") format("woff2"); font-weight: 100 900; font-display: swap; }

:root {
  --paper: #F2EFE7;
  --ink: #0A101D;
  --ink-2: #4A5468;
  --rule: rgba(10, 16, 29, 0.14);
  --card: rgba(255, 255, 255, 0.55);
  --deep: #1E5FB0;
  --on-deep: #F4F8FF;
  --pencil-soft: rgba(10, 16, 29, 0.38);
  --night: #0A101D;
  --night-text: #F4F8FF;
  --night-muted: #CCD3DF;
  --night-rule: rgba(191, 224, 255, 0.14);
  --blue: #5BA8FF;
  --accent: #D9B26F;
  --route-edge: #0A101D;
  --glow-warm: color-mix(in srgb, #D9B26F 16%, transparent);
  --glow-cool: rgba(91, 168, 255, 0.16);
  --sans: "Geist", "Helvetica Neue", Arial, sans-serif;
  --mono: "Geist Mono", ui-monospace, Menlo, monospace;
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-reveal: cubic-bezier(0.22, 1, 0.36, 1);
  --pad: clamp(16px, 4vw, 56px);
  --rail-x: 19px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --paper: #111A2B;
    --ink: #E8ECF3;
    --ink-2: #A3AEC0;
    --rule: rgba(191, 224, 255, 0.14);
    --card: rgba(255, 255, 255, 0.04);
    --deep: #5BA8FF;
    --on-deep: #0A101D;
    --pencil-soft: rgba(232, 236, 243, 0.3);
    --route-edge: #111A2B;
    --glow-warm: color-mix(in srgb, #D9B26F 7%, transparent);
  }
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  color: var(--ink);
  font: 17px/1.55 var(--sans);
  background:
    radial-gradient(60vw 50vh at 0% 30%, var(--glow-warm), transparent 70%),
    radial-gradient(60vw 60vh at 100% 100%, var(--glow-cool), transparent 70%),
    var(--paper);
}

/* Hero on night with contour lines */
.hero { position: relative; overflow: hidden; background: var(--night); color: var(--night-text); }
.contours { position: absolute; inset: 0; width: 100%; height: 100%;
  -webkit-mask-image: linear-gradient(100deg, transparent 15%, #000 60%); mask-image: linear-gradient(100deg, transparent 15%, #000 60%); }
.contour { fill: none; stroke: var(--blue); stroke-width: 1; opacity: 0.22; stroke-dasharray: 1; stroke-dashoffset: 0; }
.contour-index { stroke-width: 1.4; opacity: 0.42; }
.hero-inner { position: relative; max-width: 760px; margin: 0 auto; padding: clamp(48px, 9vw, 104px) var(--pad) clamp(40px, 6vw, 64px); }
.kicker { font: 500 11px/1.4 var(--mono); letter-spacing: 0.14em; text-transform: uppercase; color: var(--blue); margin: 0 0 14px; }
h1 { font-size: clamp(40px, 6vw, 76px); font-weight: 500; letter-spacing: -0.04em; line-height: 0.98; margin: 0; text-wrap: balance; }

.summary { margin-top: 32px; max-width: 460px; }
.now { display: inline-flex; align-items: center; gap: 10px; min-height: 44px; color: var(--night-text); text-decoration: none; font-size: 19px; font-weight: 500; letter-spacing: -0.01em; }
.now::after { content: "→"; color: var(--accent); transition: transform 0.4s var(--ease); }
.now:hover::after, .now:focus-visible::after { transform: translateX(6px); }
.now:focus-visible { outline: 2px solid var(--blue); outline-offset: 4px; border-radius: 4px; }
.updated { font: 12px/1.6 var(--mono); color: var(--night-muted); margin: 10px 0 0; }
.updated { margin-top: 24px; }

/* Route */
.page { flex: 1; width: 100%; max-width: 760px; margin: 0 auto; padding: clamp(40px, 6vw, 64px) var(--pad); }
.message { color: var(--ink-2); font-size: 19px; }
.route { list-style: none; margin: 0; padding: 0; }
.wp { position: relative; padding: 0 0 28px 52px; }
.rail { position: absolute; left: calc(var(--rail-x) - 1px); top: 30px; bottom: -30px; width: 2px; transform-origin: top;
  background: repeating-linear-gradient(to bottom, var(--pencil-soft) 0 6px, transparent 6px 12px); }
.wp-done .rail { left: calc(var(--rail-x) - 1.5px); width: 3px; background: var(--accent); box-shadow: 0 0 0 1.5px var(--route-edge); }
.wp-last .rail { display: none; }
.dot { position: absolute; left: calc(var(--rail-x) - 10px); top: 20px; width: 20px; height: 20px; border-radius: 50%; z-index: 1;
  background: var(--paper); border: 2px solid var(--pencil-soft); }
.wp-done .dot, .wp-now .dot { background: var(--accent); border: 2px solid var(--route-edge); }
.wp-done .dot::after { content: ""; position: absolute; left: 5px; top: 2px; width: 5px; height: 9px; border: solid var(--night); border-width: 0 2px 2px 0; transform: rotate(45deg); }
.wp-now .dot { box-shadow: 0 0 0 6px color-mix(in srgb, var(--accent) 28%, transparent); }

.wp-now .wp-body { background: var(--card); border: 1px solid var(--rule); border-radius: 14px; }
.wp-head { display: grid; grid-template-columns: 1fr auto 20px; column-gap: 16px; align-items: center; width: 100%;
  padding: 12px 16px; border: 0; border-radius: 13px; background: none; color: inherit; font: inherit; text-align: left; }
button.wp-head { cursor: pointer; transition: background-color 0.3s var(--ease); }
button.wp-head:hover { background: var(--card); }
.wp-now button.wp-head:hover { background: transparent; }
button.wp-head:focus-visible { outline: 2px solid var(--deep); outline-offset: 2px; }
div.wp-head { grid-template-columns: 1fr; }
.wp-status { grid-column: 1; font: 500 11px/1.6 var(--mono); letter-spacing: 0.14em; text-transform: uppercase; color: var(--ink-2); }
.wp-now .wp-status { color: var(--deep); }
.wp-title { grid-column: 1; font-size: 21px; font-weight: 500; letter-spacing: -0.02em; line-height: 1.25; text-wrap: balance; }
.wp-now .wp-title { font-size: clamp(24px, 3vw, 30px); letter-spacing: -0.03em; }
.wp-count { grid-column: 2; grid-row: 1 / 3; font: 13px/1 var(--mono); color: var(--ink-2); }
.chev { grid-column: 3; grid-row: 1 / 3; width: 9px; height: 9px; margin-left: 4px; border: solid var(--ink-2); border-width: 0 1.5px 1.5px 0;
  transform: translateY(-3px) rotate(45deg); transition: transform 0.4s var(--ease); }
[aria-expanded="true"] .chev { transform: translateY(2px) rotate(225deg); }

.wp-panel { display: grid; grid-template-rows: 0fr; transition: grid-template-rows 0.4s var(--ease); }
.wp-panel.is-open { grid-template-rows: 1fr; }
.wp-panel-inner { overflow: hidden; min-height: 0; }
.steps, .done-list { list-style: none; margin: 0; padding: 0 16px 10px; }
.step { display: grid; grid-template-columns: 18px 1fr auto; gap: 14px; align-items: baseline; padding: 11px 0; border-top: 1px solid var(--rule); }
.tick { position: relative; top: 3px; width: 16px; height: 16px; border-radius: 50%; border: 1.5px solid var(--pencil-soft); }
.step-done .tick { background: var(--deep); border-color: var(--deep); }
.step-done .tick::after { content: ""; position: absolute; left: 4.5px; top: 1.5px; width: 3.5px; height: 7px; border: solid var(--on-deep); border-width: 0 1.5px 1.5px 0; transform: rotate(45deg); }
.step-in_progress .tick { border-color: var(--deep); background: conic-gradient(var(--deep) 0 50%, transparent 0); }
.step-done .step-title { color: var(--ink-2); }
.step-status { font: 11px/1.6 var(--mono); letter-spacing: 0.04em; color: var(--ink-2); white-space: nowrap; }
.step-in_progress .step-status { color: var(--deep); }
.done-list li { padding: 9px 0; border-top: 1px solid var(--rule); color: var(--ink-2); }

.legend { display: flex; flex-wrap: wrap; gap: 8px 22px; list-style: none; margin: 24px 0 0; padding: 20px 0 0; border-top: 1px solid var(--rule);
  font: 11px/1.6 var(--mono); letter-spacing: 0.06em; color: var(--ink-2); }
.legend li { display: inline-flex; align-items: center; gap: 8px; }
.mark { width: 10px; height: 10px; border-radius: 50%; border: 1.5px solid var(--pencil-soft); }
.mark-done, .mark-now { background: var(--accent); border-color: var(--route-edge); }
.mark-now { box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 28%, transparent); }

.foot { background: var(--night); color: var(--night-muted); font: 12px/1.6 var(--mono); }
.foot span { display: block; max-width: 760px; margin: 0 auto; padding: 22px var(--pad); }

/* Motion: the end state is the normal state; animations only run from hidden to normal. */
@media (prefers-reduced-motion: no-preference) {
  .contour { animation: draw 2.2s var(--ease) calc(var(--i) * 60ms) backwards; }
  .is-ready .wp { animation: rise 0.85s var(--ease-reveal) calc(var(--i) * 90ms + 150ms) backwards; }
  .is-ready .rail { animation: drop 1.15s var(--ease) calc(var(--i) * 90ms + 550ms) backwards; }
  .is-ready .wp-now .dot { animation: ring 1.6s var(--ease) 1.1s 1 backwards; }
}
.is-settled *, .is-settled *::after { animation: none !important; }
@keyframes draw { from { stroke-dashoffset: 1; } }
@keyframes rise { from { opacity: 0; transform: translateY(17px); filter: blur(5px); } }
@keyframes drop { from { transform: scaleY(0); } }
@keyframes ring { from { box-shadow: 0 0 0 0 color-mix(in srgb, var(--accent) 60%, transparent); } }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; }
}

@media (max-width: 600px) {
  body { font-size: 16px; }
  .wp { padding-left: 44px; }
  :root { --rail-x: 15px; }
  .wp-head { padding: 10px 12px; column-gap: 10px; }
  .steps, .done-list { padding: 0 12px 8px; }
  .wp-title { font-size: 19px; }
}
