:root {
  --bg: #fbfbf9;
  --ink: #121214;
  --dim: #66666c;
  --rule: #d9d9dc;
  --accent: #4f86f7;
  --night: #0e1022;
  --gutter: 48px;
  color-scheme: light;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 400 16px/1.5 Inter, system-ui, -apple-system, sans-serif;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
a { color: inherit; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 4px; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.skip { position: fixed; left: 16px; top: -60px; z-index: 50; background: var(--ink); color: #fff; padding: 8px 12px; text-decoration: none; font-size: 13px; border-radius: 8px; }
.skip:focus { top: 16px; }

/* Header: name left, outlined pills right */
.top { position: fixed; top: 0; left: 0; right: 0; z-index: 20; display: flex; justify-content: space-between; align-items: center; padding: 18px 28px; font-size: 14px; pointer-events: none; }
.top a { pointer-events: auto; }
.mark { font-weight: 600; text-decoration: none; }
.top nav { display: flex; gap: 8px; }
.pill { border: 2px solid var(--ink); border-radius: 999px; padding: 5px 14px; text-decoration: none; background: var(--bg); font-weight: 500; transition: background-color .2s, color .2s; }
.pill:hover { background: var(--ink); color: #fff; }

main { position: relative; z-index: 3; }

/* Stops: in flow, a card beside its still */
.stop { display: grid; grid-template-columns: minmax(0, 480px) minmax(0, 1fr); gap: 48px; align-items: center; padding: 14vh var(--gutter); }
.stop[data-night] { background: var(--night); }
.card { background: #fff; border: 2px solid var(--ink); border-radius: 18px; padding: 24px 26px; }
.still { display: block; width: 100%; max-width: 720px; height: auto; border-radius: 18px; }
.chip { display: inline-block; border: 2px solid var(--ink); border-radius: 999px; padding: 2px 10px; font-size: 12px; font-weight: 500; margin: 0 0 14px; }
.card h2, .card h3 { font-weight: 600; font-size: clamp(30px, 3.4vw, 40px); letter-spacing: -0.035em; line-height: 1.02; margin: 0 0 12px; overflow-wrap: anywhere; }
.desc, .desc-short { font-size: 15px; line-height: 1.55; margin: 0 0 14px; }
.desc code { font: 500 .92em ui-monospace, Menlo, monospace; }
.when { font-size: 13px; color: var(--dim); margin: 0 0 10px; }
.roles { list-style: none; padding: 0; margin: 0 0 14px; font-size: 15px; }
.roles li { margin: 0 0 2px; }
.roles .when { display: inline; margin-left: 8px; }
.tags { font-size: 13px; color: var(--dim); margin: 0; }
.meta { display: flex; flex-wrap: wrap; gap: 4px 24px; margin: 0 0 14px; font-size: 13px; }
.meta div { display: flex; gap: 8px; }
.meta dt { color: var(--dim); }
.meta dd { margin: 0; }
.links { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 20px; font-size: 14px; margin: 0; }
.links a, .row-links a { text-decoration: none; border-bottom: 1px solid var(--rule); padding-bottom: 1px; }
.links a:hover, .row-links a:hover { border-color: var(--ink); }

/* Hero */
.hero { min-height: 100vh; }
.hero .card { background: none; border: 0; padding: 0; }
.hero h1 { font-weight: 600; font-size: clamp(56px, 8vw, 112px); letter-spacing: -0.05em; line-height: .92; margin: 0 0 18px; }
.hero .lede { font-size: 20px; line-height: 1.35; margin: 0 0 8px; max-width: 17em; }
.hero .aside { color: var(--dim); font-size: 15px; margin: 0 0 18px; }
.hero-foot { display: block; }
.to-list-line { margin: 0; font-size: 14px; }
.to-list { font-weight: 500; text-decoration: none; border-bottom: 2px solid var(--ink); padding-bottom: 1px; }

/* About */
.statement { font-size: 22px; line-height: 1.3; letter-spacing: -0.02em; margin: 0 0 14px; }
.statement .dim { color: var(--dim); }
#about .card p:not(.statement):not(.chip) { font-size: 14px; color: var(--dim); margin: 0 0 10px; }

/* Contact */
.hello { margin: 0 0 2px; color: var(--dim); }
.email { overflow-wrap: anywhere; font-size: clamp(22px, 2.6vw, 34px); font-weight: 600; letter-spacing: -0.03em; line-height: 1.1; margin: 0 0 16px; }
.email a { text-decoration: none; }
.copy-email { font: inherit; color: inherit; background: none; border: 0; border-bottom: 1px solid var(--rule); padding: 0 0 1px; cursor: pointer; }
.copy-status { color: var(--dim); font-size: 13px; }
.contact .aside, #contact .aside { margin: 14px 0 0; font-size: 13px; color: var(--dim); }

/* The plain list after the world */
.list { position: relative; z-index: 4; min-height: 100vh; background: var(--bg); padding: 16vh var(--gutter) 10vh; max-width: calc(920px + 2 * var(--gutter)); margin: 0 auto; }
.list > h2 { font-weight: 600; font-size: clamp(36px, 5vw, 64px); letter-spacing: -0.045em; line-height: 1; margin: 0 0 40px; }
.group { margin: 0 0 48px; }
.group h3 { font-size: 13px; font-weight: 500; color: var(--dim); margin: 0 0 10px; }
.rows { list-style: none; margin: 0; padding: 0; border-top: 2px solid var(--ink); }
.row { display: grid; grid-template-columns: 48px minmax(0, 1fr) auto; gap: 4px 20px; align-items: baseline; padding: 16px 0; border-bottom: 1px solid var(--rule); }
.row .n { color: var(--dim); font-size: 14px; font-variant-numeric: tabular-nums; }
.row h4 { font-size: 20px; font-weight: 600; letter-spacing: -0.02em; margin: 0 0 2px; }
.first { margin: 0 0 2px; font-size: 15px; }
.row-when { margin: 0; font-size: 13px; color: var(--dim); }
.row-links { margin: 0; display: flex; flex-wrap: wrap; gap: 6px 16px; justify-content: flex-end; font-size: 13px; white-space: nowrap; }
.facts { display: grid; grid-template-columns: 120px 1fr; gap: 8px 16px; margin: 0; font-size: 15px; border-top: 2px solid var(--ink); padding-top: 16px; }
.facts div { display: contents; }
.facts dt { color: var(--dim); }
.facts dd { margin: 0; }
.list footer p { font-size: 13px; color: var(--dim); margin: 0; }

@media (max-width: 760px) {
  :root { --gutter: 16px; }
  .top { padding: 14px 16px; font-size: 12px; }
  .top nav { gap: 6px; }
  .pill { padding: 4px 10px; }
  .mark { display: none; }
  .top { justify-content: flex-end; }
  .stop { grid-template-columns: minmax(0, 1fr); gap: 20px; padding: 10vh var(--gutter); }
  .card { padding: 18px; }
  .hero { min-height: 0; padding-top: 18vh; }
  .hero h1 { font-size: 56px; }
  .row { grid-template-columns: 32px minmax(0, 1fr); }
  .row-links { grid-column: 2; justify-content: flex-start; white-space: normal; }
  .facts { grid-template-columns: 96px 1fr; }
}

/* ---- World mode: the canvas draws the rooms, stops become scroll spacers, cards float beside their room */
#world { display: none; }
.stars { display: none; }
.world #world { display: block; position: fixed; inset: 0; width: 100%; height: 100%; z-index: 1; pointer-events: none; }
.world .stars { display: block; position: fixed; inset: 0; z-index: 0; pointer-events: none; opacity: 0;
  background-image: radial-gradient(1.5px 1.5px at 12% 18%, #fff 50%, transparent 51%), radial-gradient(1px 1px at 33% 72%, #fff 50%, transparent 51%),
    radial-gradient(1.5px 1.5px at 58% 34%, #fff 50%, transparent 51%), radial-gradient(1px 1px at 81% 12%, #fff 50%, transparent 51%),
    radial-gradient(1px 1px at 72% 84%, #fff 50%, transparent 51%), radial-gradient(1.5px 1.5px at 22% 52%, #fff 50%, transparent 51%),
    radial-gradient(1px 1px at 91% 58%, #fff 50%, transparent 51%), radial-gradient(1px 1px at 46% 8%, #fff 50%, transparent 51%);
  background-size: 420px 420px; }
.world #world { background: transparent; }
.world .stop { display: block; height: 140vh; min-height: 0; padding: 0; background: none; }
.world .still { display: none; }
.world .stop .card { position: fixed; left: 0; top: 0; z-index: 5; width: min(430px, calc(100vw - 32px)); opacity: 0; pointer-events: none; will-change: transform, opacity; }
.world .stop .card.on { pointer-events: auto; }
.world .hero .card { width: min(560px, calc(100vw - 32px)); }
.world[data-sky="night"] .mark { color: #fff; }
@media (max-width: 760px) {
  .world .stop { height: 160vh; }
  .world .hero .card { background: #fff; border: 2px solid var(--ink); padding: 18px; }
  .world .hero h1 { font-size: 56px; margin-bottom: 10px; }
  .world .hero .lede { font-size: 17px; }
  .world .hero .aside { display: none; }
}
.world .email { font-size: 24px; }
@media (max-width: 760px) { .world .stop .card { overflow-y: auto; overscroll-behavior: auto; } }
/* Until the stage places it, the hero card sits where the stage will put it */
.world:not(.live) .hero .card { opacity: 1; top: auto; left: max(28px, 4.5vw); bottom: 14vh; }
@media (max-width: 760px) { .world:not(.live) .hero .card { left: 16px; right: 16px; width: auto; bottom: 56px; } }
/* Long cards scroll inside; a fade at the bottom says there is more */
.world .stop .card { overflow-y: auto; }
.world .stop .card.more::after { content: ''; position: sticky; bottom: -26px; display: block; height: 44px; margin: -44px -26px -26px; background: linear-gradient(rgba(255, 255, 255, 0), #fff 80%); pointer-events: none; }
@media (max-width: 760px) { .world .stop .card.more::after { bottom: -18px; margin: -44px -18px -18px; } }
/* The hero card is never a scroll box */
.world .hero .card { overflow: visible; }
/* About's loop is a long ride: give it more scroll so the marble doesn't whip around */
.world #about { height: 220vh; }
@media (max-width: 760px) { .world #about { height: 240vh; } }
/* Long one-word titles fit the card without breaking mid-word */
#supercaloriemonster .card h3 { font-size: clamp(26px, 2.4vw, 32px); }
