/* Caveat (Google Fonts, SIL Open Font License 1.1), self-hosted. Variable font: one file covers 500. */
@font-face {
  font-family: "Caveat"; font-style: normal; font-weight: 400 700; font-display: swap;
  src: url(/fonts/caveat-latin.woff2) format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Caveat"; font-style: normal; font-weight: 400 700; font-display: swap;
  src: url(/fonts/caveat-latin-ext.woff2) format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

:root {
  --text: #1d1d1f;
  --secondary: #6e6e73;
  --tertiary: #a1a1a6;
  --paper: rgba(243, 241, 231, 0.98);
  --ink: rgb(76, 99, 143);
  --evidence: rgb(91, 115, 160);
  --hand-ink: rgb(76, 99, 143);
  --sans: -apple-system, "SF Pro Display", "SF Pro Text", system-ui, sans-serif;
  --hand: "Caveat", "Bradley Hand", cursive;
  --wide: 1200px;   /* triptych windows 372 px wide at 1440, as apple.com's tall cards */
  --exhale: cubic-bezier(.16, 1, .3, 1);   /* MomentStyle.exhale */
  /* apple-design §4: critically damped spring (damping 1.0, response 0.4 s), sampled for CSS; settles in ~0.45 s. */
  --spring: linear(0, 0.060 5.6%, 0.186 11.1%, 0.329 16.7%, 0.466 22.2%, 0.584 27.8%, 0.682 33.3%, 0.760 38.9%, 0.821 44.4%, 0.868 50%, 0.903 55.6%, 0.929 61.1%, 0.949 66.7%, 0.963 72.2%, 0.973 77.8%, 0.981 83.3%, 0.986 88.9%, 0.990 94.4%, 1);
}
* { box-sizing: border-box; }
html, body { margin: 0; background: #fff; color: var(--text); font-family: var(--sans); -webkit-font-smoothing: antialiased; }

nav {
  position: sticky; top: 0; z-index: 10; height: 52px; padding: 0 max(22px, calc((100vw - var(--wide)) / 2));
  display: flex; align-items: center; justify-content: space-between;
  background: rgba(255, 255, 255, .8); backdrop-filter: saturate(180%) blur(20px);
}
nav .name { height: 17px; display: block; }
.pill {
  font-size: 12px; font-weight: 500; color: #fff; background: var(--text);
  padding: 5px 12px; border-radius: 980px; text-decoration: none;
}

section { max-width: var(--wide); margin: 0 auto; padding: 0 22px; }
h1, h2 { margin: 0; font-weight: 600; letter-spacing: -.025em; line-height: 1.07; }
h1, h2, .sub { text-wrap: balance; }   /* no single-word last lines */
h1 { font-size: 56px; }
h2 { font-size: 40px; }
.sub { margin: 16px 0 0; font-size: 21px; line-height: 1.38; color: var(--secondary); letter-spacing: -.01em; max-width: 26em; }

/* Hero: words left, one sky window right. */
.hero { display: grid; grid-template-columns: 1fr 420px; gap: 80px; align-items: center; padding-top: 96px; }

.window {
  position: relative; margin: 0; aspect-ratio: 4 / 5; border-radius: 28px; overflow: hidden; background: #e9ecf1;
}
.window canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
figcaption {
  margin-top: 14px; font-size: 11px; font-weight: 500; letter-spacing: .12em; text-transform: uppercase;
  color: var(--tertiary);
}

/* The run: three windows side by side, read left to right as the run's time. */
.run { padding-top: 200px; text-align: center; }
.run .sub { margin-left: auto; margin-right: auto; }
.triptych .window { aspect-ratio: 9 / 16; }
.triptych { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; margin-top: 64px; text-align: left; }
/* On short screens the whole triptych scales down, keeping 9:16, so all three windows fit one view
   (the view minus nav, caption and note ≈ 200 px). */
@media (min-width: 901px) {
  .triptych { max-width: calc((100svh - 200px) * 9 / 16 * 3 + 40px); margin-left: auto; margin-right: auto; }
}

.hand { font-family: var(--hand); color: var(--hand-ink); }
.note {
  margin-top: 12px; font-size: 23px; font-weight: 500; line-height: 1.1;
  transform: rotate(-2deg); transform-origin: left; opacity: 0; transition: opacity .45s var(--spring);
}
.note.on { opacity: 1; }

/* Finish data over the middle window: SF Pro Regular, tabular figures. */
.finish {
  position: absolute; inset: 0; pointer-events: none; color: rgb(247, 236, 226);
  font-variant-numeric: tabular-nums; text-shadow: 0 1px 6px rgba(0, 0, 0, .22);
  container-type: inline-size;
}
.finish .top { position: absolute; top: 9%; left: 0; right: 0; text-align: center; }
.finish .bottom { position: absolute; left: 6%; right: 6%; bottom: 6%; }
.finish .caps { font: 600 2.5cqw/1.4 var(--sans); letter-spacing: .18em; text-transform: uppercase; opacity: .75; }
.finish .small { font-size: 2.1cqw; opacity: .6; }
.finish .km { font: 400 16cqw/1 var(--sans); letter-spacing: -.02em; margin-top: 2.5cqw; }
.finish .unit { margin-top: 1.5cqw; }
.finish .built { font: 400 3.8cqw var(--sans); text-align: center; }
.finish .bottom > .small { text-align: center; margin-top: .8cqw; }
.finish .row {
  display: grid; grid-template-columns: repeat(3, 1fr); margin-top: 5cqw; padding-top: 4cqw;
  border-top: 1px solid rgba(247, 236, 226, .28);
}
.finish .num { display: block; font: 400 5.5cqw/1.1 var(--sans); }
.finish .row .caps { display: block; margin-top: 1cqw; }
.finish .top, .finish .built, .finish .bottom > .small, .finish .row {
  opacity: 0; transform: translateY(6px); transition: opacity .45s var(--spring), transform .45s var(--spring);
}
.finish.words .top, .finish.words .built, .finish.words .bottom > .small { opacity: 1; transform: none; }
.finish.numbers .row { opacity: 1; transform: none; }

/* Moment paper rises inside its window, to 240/852 of the frame (MomentStyle.top). */
.paper {
  position: absolute; left: 0; right: 0; top: 50%; bottom: 0;   /* half the window: the sky stays in view */
  background: var(--paper); border-radius: 18px 18px 0 0; padding: 22px 20px; color: var(--ink);
  transform: translateY(105%); transition: transform .8s var(--exhale);
}
.paper.up { transform: none; }
.paper .evidence { font-size: 10px; font-weight: 500; letter-spacing: .14em; color: var(--evidence); }
.moment { margin: 14px 0 0; font: 14px/1.6 "Courier Prime", "Courier New", monospace; white-space: pre-wrap; }

.end { text-align: center; padding-top: 200px; }
.end .sub { margin: 16px auto 0; }
form { max-width: 440px; margin: 32px auto 0; }
form .line { display: flex; gap: 10px; }
input {
  flex: 1; min-width: 0; height: 48px; padding: 0 18px; border-radius: 12px; border: 1px solid #d2d2d7;
  font: 17px var(--sans); color: var(--text); outline: none; background: #fff;
}
input:focus { border-color: var(--text); }
button {
  height: 48px; padding: 0 22px; border: 0; border-radius: 980px; background: var(--text); color: #fff;
  font: 500 17px var(--sans);
}
.status { width: 100%; margin: 4px 0 0; min-height: 1.4em; font-size: 15px; color: var(--secondary); }
.status.error { color: #b3261e; }
form.done .line, form.done .beta-check, form.done .choices { display: none; }
form.done .status { font-size: 17px; color: var(--text); }
button:disabled { opacity: .5; }
.beta-check {
  display: inline-flex; align-items: center; gap: 8px; margin-top: 16px; font-size: 14px; color: var(--secondary); cursor: pointer;
}
.beta-check input { width: 16px; height: 16px; margin: 0; accent-color: var(--text); }
.choices { display: flex; gap: 10px; margin-top: 14px; }
.choices label { flex: 1; display: flex; flex-direction: column; gap: 6px; text-align: left; font-size: 13px; color: var(--secondary); }
select {
  height: 44px; padding: 0 14px; border-radius: 12px; border: 1px solid #d2d2d7; background: #fff;
  font: 16px var(--sans); color: var(--text); appearance: none;
  background-image: linear-gradient(45deg, transparent 50%, var(--secondary) 50%), linear-gradient(135deg, var(--secondary) 50%, transparent 50%);
  background-position: calc(100% - 20px) 50%, calc(100% - 15px) 50%; background-size: 5px 5px; background-repeat: no-repeat;
}
select:focus { border-color: var(--text); outline: none; }
.trap { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
:focus-visible { outline: 2px solid #0071e3; outline-offset: 2px; }
input:focus-visible, select:focus-visible { outline: none; }

footer { max-width: var(--wide); margin: 160px auto 0; padding: 20px 22px 28px; border-top: 1px solid #e8e8ed; font-size: 12px; line-height: 1.5; color: var(--secondary); }
footer p { margin: 0; }
footer .fine { margin-top: 8px; color: var(--tertiary); }

@media (max-width: 900px) {
  .hero { grid-template-columns: 1fr; gap: 40px; padding-top: 56px; }
  .hero .frame { max-width: 420px; }
  h1 { font-size: 40px; }
  h2 { font-size: 30px; }
  .sub { font-size: 18px; }
  .run, .end { padding-top: 120px; }
  .triptych { grid-template-columns: 1fr; gap: 48px; max-width: 420px; margin: 48px auto 0; }
  form .line { flex-direction: column; }
  input { flex: none; }
}
@media (prefers-reduced-motion: reduce) {
  .paper, .note { transition: none; }
}

/* Press feedback on the press itself (apple-design §1). */
.pill, button { transition: transform .1s ease-out; }
.pill:active, button:active { transform: scale(.97); }
/* While the run plays, a click fast-forwards it. */
.triptych.playing { cursor: pointer; }


/* Without WebGL the windows show the same skies as plain gradients (set from the data in app.js). */
