/* /versions/ — the UX program gallery (docs/ux-runs/README.md). A v2 page on the
   css/toys.css tokens (DESIGN.md): putty surface, one cobalt accent for the version that is
   live now, physical depth, springy keys, light and dark. Type is Geist + Geist Mono
   (--t-display swapped, like /links and the blog). The shared header floats fixed over
   the page; the body clears its height. */
body.versions {
  --t-display: "Geist", ui-sans-serif, system-ui, sans-serif;
  --v-gutter: max(16px, env(safe-area-inset-left), env(safe-area-inset-right));
  padding-top: var(--header-h);
  font-family: var(--t-display);
  font-variation-settings: normal;
}
html:has(body.versions) { scroll-padding-top: calc(var(--header-h) + 18px); }
body.versions .t-wrap,
body.versions .container-wide { width: min(100% - 2 * var(--v-gutter), 1240px); }

/* Masthead */
.v-main { padding-bottom: 40px; }
.v-mast { padding: 36px 0 28px; }
.v-kicker { margin: 0 0 14px; color: var(--t-ink-2); }
.v-mast h1 {
  margin: 0; max-width: 13ch;
  font-size: 2.5rem; line-height: .92; font-weight: 800; letter-spacing: -.02em; text-wrap: balance;
  animation: v-rise .7s var(--t-spring) both;
}
.v-lede { margin: 22px 0 0; max-width: 44ch; font-size: 1.125rem; line-height: 1.4; color: var(--t-ink-2); text-wrap: pretty; }
.v-lede strong { color: var(--t-ink); font-weight: 600; }
@media (min-width: 380px) { .v-mast h1 { font-size: 2.75rem; } }
@media (min-width: 600px) { .v-mast h1 { font-size: 4.5rem; } .v-lede { font-size: 1.3125rem; } }
@media (min-width: 1100px) { .v-mast { padding-top: 56px; } .v-mast h1 { font-size: 6rem; } }
/* With the time machine (run-09) the masthead sits on one row from 1100 px, so the stage is in
   the first screen: the title left, the lede right. */
@media (min-width: 1100px) {
  .v-mast:has(+ .tm) { display: grid; grid-template-columns: minmax(0, auto) minmax(0, 46ch); align-items: end; column-gap: 48px; padding: 40px 0 28px; }
  .v-mast:has(+ .tm) .v-kicker { grid-column: 1 / -1; }
  .v-mast:has(+ .tm) h1 { font-size: 4.75rem; }
  .v-mast:has(+ .tm) .v-lede { margin: 0 0 6px; font-size: 1.1875rem; }
}

/* The list */
.v-list-title { margin: 8px 0 6px; font: 500 .75rem/1.4 var(--t-mono); letter-spacing: .08em; text-transform: uppercase; color: var(--t-ink-2); }
.v-status { margin: 0 0 16px; min-height: 1.4em; font-size: .9375rem; line-height: 1.4; color: var(--t-ink-2); }
/* The list keeps its room only while the registry loads (data-loading, removed by versions.js
   once it has rendered or given up), so the footer then sits right under the cards. */
.v-runs { list-style: none; margin: 0; padding: 0; display: grid; gap: 16px; align-content: start; }
.v-runs[data-loading] { min-height: 560px; }
@media (min-width: 900px) {
  .v-runs { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .v-runs[data-loading] { min-height: 420px; }
  .v-run.is-live, .v-run:only-child { grid-column: 1 / -1; }
  /* An older version alone in the last row runs full width. */
  .v-run.is-live ~ .v-run:last-child:nth-child(even) { grid-column: 1 / -1; }
}

/* A version card: a neutral card; the one live now is the cobalt slab. */
.v-run {
  position: relative; display: flex; flex-direction: column; gap: 12px; min-width: 0;
  padding: 22px; border-radius: var(--t-r-l);
  background: var(--t-card); color: var(--t-ink);
  box-shadow: inset 0 0 0 2px var(--t-line);
  animation: v-rise .7s var(--t-spring) both;
}
.v-run:nth-child(2) { animation-delay: 80ms; }
.v-run:nth-child(3) { animation-delay: 160ms; }
@keyframes v-rise { from { transform: translateY(28px) scale(.97); } }
.v-run.is-live {
  padding: 26px 22px 30px;
  background: var(--t-cobalt); color: #fff;
  box-shadow: inset 0 -8px 0 rgba(0,0,0,.18), 0 20px 40px -24px rgba(0,0,0,.45);
}

.v-meta {
  display: flex; flex-wrap: wrap; align-items: center; gap: 6px 14px; margin: 0;
  font: 500 .8125rem/1.3 var(--t-mono); font-variant-numeric: tabular-nums; letter-spacing: .04em; color: var(--t-ink-2);
}
.v-num { color: var(--t-ink); font-weight: 600; }
.v-run.is-live .v-meta, .v-run.is-live .v-num { color: #fff; }
.v-live {
  display: inline-flex; align-items: center; gap: 8px; padding: 6px 10px 6px 9px; border-radius: 999px;
  background: #fff; color: #141414; font: 600 .75rem/1 var(--t-mono); letter-spacing: .08em; text-transform: uppercase;
}
.v-live::before {
  content: ""; flex: none; width: 8px; height: 8px; border-radius: 50%; background: var(--t-mint);
  animation: t-ping 1.5s var(--t-out) 3;
}

.v-title { margin: 0; max-width: 24ch; font-size: 1.75rem; line-height: 1.02; font-weight: 800; letter-spacing: -.015em; text-wrap: balance; overflow-wrap: anywhere; }
.v-run.is-live .v-title { font-size: 2.25rem; }
@media (min-width: 900px) { .v-run.is-live .v-title { font-size: 3rem; } }
.v-summary { margin: 0; max-width: 62ch; line-height: 1.45; color: var(--t-ink-2); overflow-wrap: anywhere; }
.v-run.is-live .v-summary { color: #fff; }
.v-pages { margin: 0; font: 500 .8125rem/1.4 var(--t-mono); color: var(--t-ink-2); overflow-wrap: anywhere; }
.v-pages-k { margin-right: 6px; letter-spacing: .08em; text-transform: uppercase; }
.v-run.is-live .v-pages { color: #fff; }

/* Keys: v2 keys on --t-r-btn, >= 48 px, flat face, inset outline and bottom lip. */
.v-keys { display: flex; flex-wrap: wrap; gap: 10px; margin-top: auto; padding-top: 6px; }
.v-key {
  display: inline-flex; align-items: center; justify-content: center; min-height: 48px; padding: 0 18px 3px;
  border-radius: var(--t-r-btn); background: var(--t-surface); color: var(--t-ink);
  font: 700 .9375rem/1.1 var(--t-display); text-decoration: none; text-align: center;
  box-shadow: inset 0 0 0 1.5px var(--t-line), inset 0 -4px 0 rgba(0,0,0,.08);
  transition: transform var(--t-slow) var(--t-spring), box-shadow var(--t-base) var(--t-out);
  -webkit-tap-highlight-color: transparent;
}
body.v2 a.v-key { color: var(--t-ink); }
body.v2 a.v-key-primary { background: var(--t-ink); color: var(--t-surface); box-shadow: inset 0 -4px 0 rgba(127,127,127,.35); }
body.v2 .is-live a.v-key { background: transparent; color: #fff; box-shadow: inset 0 0 0 1.5px rgba(255,255,255,.7), inset 0 -4px 0 rgba(0,0,0,.18); }
body.v2 .is-live a.v-key-primary { background: #fff; color: var(--t-cobalt-deep); box-shadow: inset 0 -4px 0 rgba(0,0,0,.14); }
@media (hover: hover) { .v-key:hover { transform: translateY(-3px); } }
.v-key:active { transform: translateY(2px) scale(.97); box-shadow: inset 0 0 0 1.5px var(--t-line), inset 0 -1px 0 rgba(0,0,0,.08); transition-duration: var(--t-fast); }
body.v2 .is-live a.v-key:focus-visible { outline-color: #fff; }

@media (prefers-reduced-motion: reduce) {
  .v-key, .v-key:hover, .v-key:active, .v-run, .v-mast h1 { transform: none !important; animation: none !important; }
}
