/* Home page (index.html): the four stories.
   Deliberately dark in both themes. */
:root {
  --bg: #0b0b0d; --ink: #f2f0ea; --dim: #a9a8a2; --faint: #75746e; --rule: #24242a; --acc: #e07a55;
  --serif: "Instrument Serif", Georgia, serif;
  --sans: "IBM Plex Sans", system-ui, sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, Menlo, Consolas, monospace;
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
  --rail-w: 210px;
}
* { box-sizing: border-box; }
html { scroll-snap-type: y proximity; scroll-behavior: smooth; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 15px/1.6 var(--sans); -webkit-font-smoothing: antialiased; }
a { color: inherit; text-decoration: none; }

/* ---------- top bar ---------- */
.topbar { position: fixed; top: 0; left: 0; right: 0; z-index: 30; display: flex; gap: 18px; align-items: center; flex-wrap: wrap;
          padding: 12px 24px; font: 11px var(--mono); letter-spacing: .08em; text-transform: uppercase; color: var(--faint);
          background: linear-gradient(var(--bg) 40%, transparent); }
.topbar b { color: var(--ink); font-weight: 500; }
.topbar a { color: var(--acc); }
.topbar .sp { margin-left: auto; display: flex; gap: 18px; }

/* ---------- opening (home only) ---------- */
.open { min-height: 100svh; display: grid; place-items: center; text-align: center; padding: 90px 24px 60px; position: relative; overflow: hidden; scroll-snap-align: start; }
.open::before { content: ""; position: absolute; inset: -20%; filter: blur(20px); animation: drift 18s ease-in-out infinite alternate; background:
    radial-gradient(40% 35% at 30% 40%, rgba(91,124,250,.22), transparent 70%),
    radial-gradient(35% 30% at 70% 60%, rgba(224,122,85,.20), transparent 70%),
    radial-gradient(30% 30% at 50% 80%, rgba(63,182,127,.14), transparent 70%); }
@keyframes drift { to { transform: translate3d(3%, -4%, 0) rotate(8deg); } }
.open > div { position: relative; max-width: 1000px; }
.open h1 { font: 400 clamp(52px, 9vw, 128px)/0.92 var(--serif); letter-spacing: -.03em; margin: 0; }
.open h1 em { color: var(--acc); }
.open p { color: var(--dim); font-size: 18px; max-width: 56ch; margin: 28px auto 0; }
.open .chips { margin-top: 26px; display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; }
.open .chips span { font: 11px var(--mono); letter-spacing: .07em; text-transform: uppercase; padding: 5px 11px; border-radius: 999px; border: 1px solid color-mix(in srgb, var(--acc) 45%, transparent); color: var(--acc); }
.open .cue { margin-top: 40px; display: inline-flex; flex-direction: column; gap: 10px; align-items: center; font: 11px var(--mono); letter-spacing: .12em; text-transform: uppercase; color: var(--faint); }
.open .cue i { width: 1px; height: 38px; background: linear-gradient(var(--acc), transparent); animation: cue 2s infinite; transform-origin: top; }
@keyframes cue { 0% { transform: scaleY(0); } 60% { transform: scaleY(1); opacity: 1; } 100% { transform: scaleY(1); opacity: 0; } }

/* ---------- rail: names, not just numbers ---------- */
.rail { position: fixed; z-index: 25; }
.rail a { display: flex; align-items: baseline; gap: 10px; font: 11px/1.4 var(--mono); letter-spacing: .06em; color: var(--faint); transition: color .3s; white-space: nowrap; }
.rail a::before { content: ""; width: 12px; height: 1px; background: currentColor; transition: width .4s var(--ease), background .3s; flex: none; align-self: center; }
.rail a:hover { color: var(--dim); }
.rail a.on { color: var(--ink); }
.rail a.on::before { width: 26px; background: var(--tint, var(--acc)); }
.rail a i { font-style: normal; color: var(--faint); }
@media (min-width: 1200px) {
  .rail { left: 24px; top: 50%; transform: translateY(-50%); display: grid; gap: 13px; width: var(--rail-w); }
  /* Long chapter names wrap inside the rail rather than spilling into the copy. */
  .rail a span { white-space: normal; min-width: 0; }
}
@media (max-width: 1199px) {
  /* A floating bar of names along the bottom: same job, no overlap. */
  .rail { left: 50%; bottom: 14px; transform: translateX(-50%); display: flex; gap: 4px; max-width: calc(100vw - 24px); overflow-x: auto;
          padding: 6px; border-radius: 999px; background: rgba(20,20,24,.78); border: 1px solid var(--rule); backdrop-filter: blur(12px); scrollbar-width: none; }
  .rail a { padding: 6px 12px; border-radius: 999px; }
  .rail a::before, .rail a i { display: none; }
  .rail a.on { background: color-mix(in srgb, var(--tint, var(--acc)) 30%, transparent); }
}

/* ---------- chapters ---------- */
.chapter { min-height: 100svh; display: grid; align-items: center; position: relative; overflow: hidden; scroll-snap-align: start; padding: 72px 0 64px; }
.chapter .glow { position: absolute; inset: 0; pointer-events: none; opacity: 0; transition: opacity 1.2s var(--ease);
                 background: radial-gradient(55% 60% at var(--gx, 32%) 50%, color-mix(in srgb, var(--tint) 26%, transparent), transparent 70%); }
.chapter.play .glow { opacity: 1; }
.grid { position: relative; display: grid; gap: 44px; align-items: center; width: 100%; max-width: 1320px; margin: 0 auto; padding: 0 28px; }
@media (min-width: 1200px) { .grid { padding-left: calc(var(--rail-w) + 40px); } }
@media (min-width: 960px) {
  .grid { grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); }
  .chapter.flip .film-wrap { order: 2; }
  .chapter.flip { --gx: 68%; }
}

.film-wrap { display: grid; justify-items: center; align-content: center; }
.film { position: relative; border-radius: 16px; overflow: hidden; background: #000;
        aspect-ratio: var(--r); width: min(100%, calc(68vh * var(--r)));
        box-shadow: 0 0 0 1px rgba(255,255,255,.08), 0 40px 120px -36px color-mix(in srgb, var(--tint) 75%, transparent);
        opacity: 0; transform: translateY(18px) scale(.97); transition: opacity .9s var(--ease), transform .9s var(--ease); }
.chapter.play .film { opacity: 1; transform: none; }
.film video, .film img { display: block; width: 100%; height: 100%; object-fit: cover; }
.film.phone { border-radius: 26px; }
.film.pan img { object-position: 50% 0%; animation: pan 22s ease-in-out infinite alternate; }
@keyframes pan { to { object-position: 50% 100%; } }
.film-wrap .src { margin-top: 12px; font: 10.5px var(--mono); letter-spacing: .1em; text-transform: uppercase; color: var(--faint);
                  opacity: 0; transition: opacity .9s var(--ease) .3s; }
.chapter.play .film-wrap .src { opacity: 1; }
.film.locked::after { content: "🔒"; position: absolute; inset: 0; display: grid; place-items: center; font-size: 46px; background: rgba(8,8,10,.55); backdrop-filter: blur(6px); }
@media (max-width: 959px) { .film { width: min(100%, calc(46vh * var(--r))); } .grid { gap: 26px; } }
/* Below the side rail's breakpoint the names float in a bottom bar, so
   chapters leave room for it, and for the top bar above. */
@media (max-width: 1199px) { .chapter { padding: 104px 0 110px; } .end { padding-bottom: 130px; } .topbar { background: var(--bg); border-bottom: 1px solid var(--rule); } }

/* ---------- copy + beats ---------- */
.copy { display: grid; gap: 18px; max-width: 560px; }
.kick { font: 11px var(--mono); letter-spacing: .12em; text-transform: uppercase; color: var(--tint); }
.copy h2 { font: 400 clamp(36px, 4.4vw, 60px)/0.98 var(--serif); margin: 0; letter-spacing: -.02em; }
.chapter.hero .copy h2 { font-size: clamp(52px, 6.4vw, 92px); }
.anim { opacity: 0; transform: translateY(14px); transition: opacity .7s var(--ease), transform .7s var(--ease); transition-delay: calc(120ms + var(--i, 0) * 140ms); }
.chapter.play .anim { opacity: 1; transform: none; }
.beat p { margin: 0; color: var(--dim); font-size: 16.5px; line-height: 1.65; }
.nums { display: flex; gap: 22px 30px; flex-wrap: wrap; }
.nums b { display: block; font: 400 44px/1 var(--serif); color: var(--ink); }
.nums span { display: block; margin-top: 6px; font: 11px/1.4 var(--mono); color: var(--faint); max-width: 18ch; }
.facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 12px 20px; padding: 14px 0; border-top: 1px solid var(--rule); border-bottom: 1px solid var(--rule); }
.facts span { display: block; font: 10.5px var(--mono); letter-spacing: .1em; text-transform: uppercase; color: var(--faint); }
.facts b { font-weight: 400; font-size: 14px; }
.list { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.list li { padding-left: 16px; position: relative; color: var(--dim); }
.list li::before { content: ""; position: absolute; left: 0; top: .7em; width: 6px; height: 6px; border-radius: 2px; background: var(--tint); }
.list b { color: var(--ink); font-weight: 500; }
.quote { margin: 0; padding-left: 16px; border-left: 2px solid var(--tint); }
.quote q { font: italic 400 24px/1.25 var(--serif); quotes: "\201C" "\201D"; }
.quote cite { display: block; margin-top: 8px; font: 10.5px var(--mono); font-style: normal; letter-spacing: .08em; text-transform: uppercase; color: var(--faint); }
.award { display: inline-flex; align-items: center; gap: 12px; padding: 9px 16px 9px 10px; border-radius: 999px; width: fit-content;
         background: color-mix(in srgb, var(--tint) 16%, transparent); border: 1px solid color-mix(in srgb, var(--tint) 45%, transparent); font-size: 14px; }
.award i { width: 26px; height: 26px; border-radius: 50%; background: var(--tint); display: grid; place-items: center; color: #000; font-style: normal; font-size: 13px; flex: none; }
.status { font: 12px var(--mono); color: var(--faint); }
.links { display: flex; gap: 22px; flex-wrap: wrap; align-items: center; }
.go { display: inline-flex; gap: 10px; align-items: center; font: 12px var(--mono); letter-spacing: .08em; text-transform: uppercase; color: var(--ink); border-bottom: 1px solid var(--tint); padding-bottom: 4px; }
.go:hover { color: var(--tint); }
.go.quiet { border-color: var(--rule); color: var(--dim); }

/* ---------- end ---------- */
.end { min-height: 70svh; display: grid; place-items: center; text-align: center; padding: 70px 24px 110px; border-top: 1px solid var(--rule); scroll-snap-align: start; }
.end h2 { font: 400 clamp(36px, 5vw, 64px)/1 var(--serif); margin: 0 0 14px; }
.end p { color: var(--dim); margin: 0 0 26px; }
.end .links { justify-content: center; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .open::before, .open .cue i, .film.pan img { animation: none; }
  .anim, .film { opacity: 1; transform: none; transition: none; }
}

/* ============================================================
   Type and button polish, shared by every story page.
   Display serif gets real leading so ascenders and descenders
   never touch; actions look like buttons, not underlined text.
   ============================================================ */
h1, h2, h3, .open h1, .copy h2 { letter-spacing: -.012em; }
h2, .copy h2 { line-height: 1.08; }
.s-cover h1, .open h1 { line-height: 1.02; }
.s-statement .big { line-height: 1.16; }
.stat b, .nums b { line-height: 1; }
.kicker, .kick { line-height: 1.5; }
h2 + .lede, h2 + p, .kicker + h2, .kick + h2 { margin-top: 18px !important; }

/* The cover sits below the fixed top bar, however tall the title runs. */
.s-cover { padding-top: 120px !important; }
.s-cover .wrap { padding-bottom: 10vh; }
.s-cover h1 { margin-top: 18px; }
.s-cover .lede { margin-top: 30px; }

/* Buttons */
.go { display: inline-flex; align-items: center; gap: 10px; padding: 13px 22px; border-radius: 999px; border: 1px solid transparent;
  background: var(--ink); color: #0b0b0d !important; font: 500 12.5px var(--mono); letter-spacing: .08em; text-transform: uppercase;
  text-decoration: none; transition: transform .25s var(--ease), background .25s, border-color .25s, color .25s; }
.go:hover { transform: translateY(-1px); background: #fff; }
.go.quiet { background: transparent; color: var(--ink) !important; border-color: rgba(255,255,255,.24); }
.go.quiet:hover { border-color: var(--ink); background: rgba(255,255,255,.06); }
.links { gap: 12px !important; }

/* Top bar actions as small pill buttons. */
.topbar .sp a { padding: 7px 14px; border-radius: 999px; border: 1px solid rgba(255,255,255,.18); color: var(--ink) !important;
  text-decoration: none; transition: border-color .25s, background .25s; }
.topbar .sp a:hover { border-color: var(--ink); background: rgba(255,255,255,.06); }
@media (max-width: 700px) { .topbar .sp a { padding: 6px 10px; } .topbar .sp { gap: 8px !important; } }

/* Home opening: award chips name their project and jump to it; the
   cue is a real arrow; the project rail waits until the stories start. */
.open .chips { gap: 10px !important; }
.open .chips a { display: inline-flex; align-items: center; gap: 10px; padding: 8px 14px 8px 12px; border-radius: 999px; text-decoration: none;
  border: 1px solid color-mix(in srgb, var(--acc) 40%, transparent); background: rgba(8,8,10,.4); color: var(--dim);
  font: 12px var(--sans); transition: border-color .25s, color .25s, background .25s; }
.open .chips a b { font: 500 11px var(--mono); letter-spacing: .08em; text-transform: uppercase; color: var(--acc); }
.open .chips a:hover { border-color: var(--acc); color: var(--ink); background: color-mix(in srgb, var(--acc) 12%, transparent); }
.open .cue { display: inline-flex !important; flex-direction: column; align-items: center; gap: 10px; text-decoration: none; color: var(--faint); }
.open .cue svg { color: var(--acc); animation: cue-bob 1.8s var(--ease) infinite; }
.open .cue:hover { color: var(--ink); }
@keyframes cue-bob { 0%, 100% { transform: translateY(0); opacity: .7; } 50% { transform: translateY(8px); opacity: 1; } }
.rail { opacity: 0; pointer-events: none; transition: opacity .5s var(--ease), transform .5s var(--ease); }
.rail.show { opacity: 1; pointer-events: auto; }
@media (prefers-reduced-motion: reduce) { .open .cue svg { animation: none; } }

/* Award tiles on the home opening: badge in the project's colour, the
   award in the display serif, the project underneath. */
.open .awards { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; margin-top: 34px; }
.award { display: flex; align-items: center; gap: 14px; padding: 14px 20px 14px 14px; border-radius: 18px; text-decoration: none; text-align: left;
  background: linear-gradient(180deg, rgba(255,255,255,.07), rgba(255,255,255,.02)); border: 1px solid rgba(255,255,255,.1);
  box-shadow: 0 18px 50px -28px color-mix(in srgb, var(--t) 70%, transparent);
  transition: transform .35s var(--ease), border-color .35s, box-shadow .35s; }
.award i { flex: none; width: 38px; height: 38px; border-radius: 12px; display: grid; place-items: center; font-style: normal; font-size: 16px; color: #0b0b0d;
  background: radial-gradient(120% 120% at 30% 20%, color-mix(in srgb, var(--t) 60%, #fff), var(--t)); box-shadow: 0 0 22px color-mix(in srgb, var(--t) 45%, transparent); }
.award span { display: grid; gap: 3px; }
.award b { font: 400 21px/1.1 var(--serif); color: var(--ink); letter-spacing: -.005em; }
.award em { font: 10.5px var(--mono); font-style: normal; letter-spacing: .08em; text-transform: uppercase; color: var(--faint); }
.award:hover { transform: translateY(-3px); border-color: color-mix(in srgb, var(--t) 60%, transparent); box-shadow: 0 24px 60px -24px color-mix(in srgb, var(--t) 80%, transparent); }
.award:hover em { color: var(--dim); }
@media (max-width: 700px) { .open .awards { flex-direction: column; align-items: stretch; } }

/* Awards, minimal: type only, hairlines between, colour only on hover. */
.open .awards { display: flex; flex-wrap: wrap; justify-content: center; gap: 0; margin-top: 40px; }
.award { display: grid; gap: 6px; padding: 2px 34px; text-align: center; text-decoration: none; background: none !important; border: 0 !important;
  border-radius: 0; box-shadow: none !important; transform: none !important; }
.award + .award { border-left: 1px solid rgba(255,255,255,.12) !important; }
.award em { font: 10.5px var(--mono); font-style: normal; letter-spacing: .14em; text-transform: uppercase; color: var(--faint); transition: color .3s; }
.award b { font: italic 400 24px/1.1 var(--serif); color: var(--ink); letter-spacing: 0; transition: color .3s; }
.award b::after { content: " →"; font-style: normal; font-size: 16px; opacity: 0; display: inline-block; transform: translateX(-4px); transition: opacity .3s, transform .3s; }
.award:hover b { color: var(--t); }
.award:hover b::after { opacity: 1; transform: none; }
.award:hover em { color: var(--dim); }
@media (max-width: 700px) {
  .open .awards { flex-direction: column; gap: 18px; }
  .award { padding: 0; } .award + .award { border-left: 0 !important; }
}
.award { justify-items: center; }
.award b { position: relative; }
.award b::after { position: absolute; left: 100%; top: 50%; margin: -9px 0 0 8px; }
@media (max-width: 700px) { .open .awards { align-items: center !important; } }

/* Awards: one quiet line of text. */
.open .awards { display: flex; flex-wrap: wrap; justify-content: center; align-items: baseline; gap: 6px 0; margin-top: 30px; }
.aw { font: 14px var(--sans); color: var(--faint); text-decoration: none; transition: color .25s; }
.aw b { font-weight: 400; color: var(--dim); transition: color .25s; }
.aw + .aw::before { content: "·"; margin: 0 14px; color: var(--faint); }
.aw:hover, .aw:hover b { color: var(--ink); }
@media (max-width: 700px) { .open .awards { flex-direction: column; align-items: center !important; gap: 6px; } .aw + .aw::before { content: none; } }

/* Chapter award line: quiet, no pill. (Separate class from the opening's
   .aw / .award so the two can't restyle each other.) */
.honor { display: flex; align-items: center; gap: 10px; font: 500 11.5px var(--mono); letter-spacing: .12em; text-transform: uppercase; color: var(--tint); }
.honor span { font-size: 12px; letter-spacing: 0; }



/* Closing row: every action the same outlined button. */
.end .links .go { background: transparent !important; color: var(--ink) !important; border-color: rgba(255,255,255,.24) !important; }
.end .links .go:hover { border-color: var(--ink) !important; background: rgba(255,255,255,.06) !important; }
