/* The two scroll stories: "The thread" and "Kinetic type". Blue-on-bone, Inter Tight, one authored motion moment each. */

/* ===== shared ===== */
.story { position: relative; }
.sun { display: block; overflow: visible; height: auto; }

.w { display: inline; }
.vlink { display: inline-flex; align-items: center; gap: 6px; font: 500 15px/1.2 "Inter Tight", sans-serif; letter-spacing: -.01em; color: var(--ink); border-bottom: 1px solid currentColor; padding-bottom: 2px; text-decoration: none; transition: color .2s; }
.vlink:hover, .vlink:focus-visible { color: var(--blue); }
.vlink .arrow-slide { margin-left: 0; }

/* ===== the switcher bar ===== */

/* ===== 1 · The thread ===== */
.thread { position: relative; }
.t-intro { height: 150svh; }
.t-sticky { position: sticky; top: 0; height: 100svh; display: grid; grid-template-rows: 1fr auto 1fr; justify-items: center; align-items: center; padding: 90px var(--gutter); }
.t-sticky .t-lit { grid-row: 2; }
.t-sticky .t-cue { grid-row: 3; align-self: start; margin-top: clamp(28px, 5vh, 48px); }
.t-lit { max-width: 19em; text-align: center; font-size: clamp(32px, 5.4vw, 84px); font-weight: 500; line-height: 1.04; letter-spacing: -.035em; text-wrap: balance; }
.t-lit em, .t-say em { font-style: normal; color: var(--blue); }
.t-body { position: relative; padding: max(380px, 42svh) clamp(24px, 9vw, 160px) 0; }
.t-line { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; overflow: visible; z-index: 0; }
.t-ghost { fill: none; stroke: rgba(18,80,196,.16); stroke-width: 1.2; stroke-linecap: round; }
.t-path { fill: none; stroke: var(--blue); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.t-tip-dot { fill: var(--blue); }
.t-tip-ring { fill: rgba(18,80,196,.18); }

.t-m { position: relative; z-index: 2; min-height: clamp(460px, 84svh, 780px); display: flex; align-items: center; }
.t-m.left { justify-content: flex-start; }
.t-m.right { justify-content: flex-end; }
.t-copy { width: min(44%, 560px); }
.t-art { position: absolute; top: 50%; width: min(27vw, 360px); aspect-ratio: 1; transform: translateY(-50%); pointer-events: none; }
.t-m.left .t-art { left: 75%; margin-left: calc(min(27vw, 360px) / -2); }
.t-m.right .t-art { left: 25%; margin-left: calc(min(27vw, 360px) / -2); }
.t-title { font-size: clamp(28px, 3.7vw, 58px); font-weight: 500; line-height: 1.02; letter-spacing: -.035em; text-wrap: balance; }
.t-by { margin-top: 12px; font-size: clamp(16px, 1.4vw, 20px); color: var(--dim); letter-spacing: -.01em; }
.t-meta { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 20px; margin-top: 16px; font-size: 14px; color: var(--dim); }
.t-say { font-size: clamp(26px, 3.3vw, 50px); font-weight: 500; line-height: 1.07; letter-spacing: -.035em; text-wrap: balance; }
.t-media { margin-top: 24px; }
.t-viz svg { display: block; width: 100%; height: auto; overflow: visible; }

.t-src { margin-top: 26px; font: 400 12px/1.5 "JetBrains Mono", ui-monospace, monospace; letter-spacing: .02em; color: var(--dim); }

@keyframes eq { from { transform: scaleY(.25); } to { transform: scaleY(1); } }

.t-end { position: relative; z-index: 2; display: grid; justify-items: center; gap: 18px; text-align: center; padding: clamp(60px, 12vh, 120px) 0 clamp(120px, 18vh, 180px); }
.t-close { font-size: clamp(28px, 4.4vw, 64px); font-weight: 500; line-height: 1.05; letter-spacing: -.035em; max-width: 16em; text-wrap: balance; }
.t-close em { font-style: normal; color: var(--blue); font-variant-numeric: tabular-nums; }
.t-close-sub { color: var(--dim); font-size: clamp(16px, 1.5vw, 20px); }
.t-cta { margin-top: 6px; font-size: 17px; }

@media (max-width: 820px) {
  .t-body { padding-inline: 18px 18px; }
  .t-m { min-height: 0; padding: 44px 0 44px 36px; }
  .t-copy { width: 100%; }
  .t-m.voice { flex-direction: column; align-items: flex-start; }
  .t-art, .t-m.left .t-art, .t-m.right .t-art { position: static; transform: none; left: auto; margin: 0 0 18px auto; width: min(52vw, 220px); }
}

/* ===== 2 · Kinetic type ===== */

.wm { display: inline-block; overflow: hidden; vertical-align: top; padding-bottom: .14em; margin-bottom: -.14em; }
.wm .w { display: inline-block; will-change: transform; }

/* when the landing map is hidden, the story starts at the very top */

/* ===== The thread, second pass: opening, interactive maps, the sun at the end ===== */
.t-lit .t-a { display: block; margin-bottom: .35em; }

.t-lit .wm { padding-bottom: .14em; margin-bottom: -.14em; }
.t-cue { display: grid; justify-items: center; gap: 10px; font-size: 14px; color: var(--dim); }
@keyframes cue { 0% { transform: scaleY(0); opacity: 1; } 55% { transform: scaleY(1); opacity: 1; } 100% { transform: scaleY(1); opacity: .32; } }
.t-m.fact .t-copy { width: min(48%, 600px); }
.t-map { position: relative; }
.t-read { display: flex; flex-wrap: wrap; align-items: baseline; gap: 8px 10px; min-height: 4.6em; margin-top: 22px; font-size: 15px; line-height: 1.3; letter-spacing: -.01em; }
.t-read b { font-weight: 600; }
.t-read strong { font-weight: 500; color: var(--blue); font-variant-numeric: tabular-nums; }
.t-read span { color: var(--dim); }
.t-read small { flex-basis: 100%; font-size: 12px; color: var(--dim); }
.t-legend { display: flex; align-items: center; justify-content: center; gap: 8px; margin-top: 18px; font-size: 12px; color: var(--dim); }
.t-legend i { flex: 0 0 96px; height: 6px; border-radius: 3px; }
.t-legend .t-nodata { margin-left: 10px; display: inline-flex; align-items: center; gap: 6px; }
.t-legend .t-nodata b { width: 10px; height: 10px; border-radius: 2px; background: #d9d7d1; }
.t-sunwrap { display: grid; place-items: center; }
.t-map path { transition: opacity .2s; }
@media (max-width: 820px) { .t-m.fact .t-copy { width: 100%; }  }

.t-line, .t-copy { will-change: transform; }
.t-map path { transition: none; }

/* ===== load-in: the headline is in the page itself, so it plays at first paint, before any script or data arrives.
   Only transform and opacity animate, so the page building behind it never makes it stutter. ===== */
.t-lit { margin: 0; }
.t-intro[data-static] .t-lit .w { transform: translateY(105%); opacity: 0; animation: wordIn .8s cubic-bezier(.16, 1, .3, 1) forwards; animation-delay: calc(.1s + var(--i) * 60ms); }
.t-intro[data-static] .t-cue { opacity: 0; animation: cueIn .5s ease forwards; animation-delay: .4s; }
@keyframes wordIn { to { transform: none; opacity: 1; } }
@keyframes cueIn { to { opacity: 1; } }
body > header.top { animation: topIn .6s ease both; }
@keyframes topIn { from { opacity: 0; transform: translateY(-8px); } to { opacity: 1; transform: none; } }
.work, .foot { transition: opacity .7s ease, visibility 0s; }
@media (prefers-reduced-motion: reduce) {
  .t-intro[data-static] .t-lit .w, .t-intro[data-static] .t-cue { animation: none; transform: none; opacity: 1; }
  body > header.top { animation: none; }
}

/* the closing line always breaks the same way: stories and writers on the first line, followers on the second */
.t-close { max-width: none; text-wrap: nowrap; }
.t-close .t-l1, .t-close .t-l2 { display: block; white-space: nowrap; }

/* numbers that count up: fixed final width, equal-width digits, so nothing around them moves */
.t-say em[data-count], .t-close em[data-n] { display: inline-block; text-align: left; font-variant-numeric: tabular-nums; }
/* the map readout: the name and value change; the description under them stays put */
.t-read { align-items: baseline; }
.t-read span { flex-basis: 100%; }
.t-read strong { font-variant-numeric: tabular-nums; }

/* ===== the rail: the pill dots you liked, plus one label that grows out of the dot you hover and glides from dot to dot ===== */
.t-rail { position: fixed; right: 12px; top: 50%; transform: translateY(-50%); z-index: 30; display: grid; gap: 0; opacity: 0; pointer-events: none; transition: opacity .35s; --spring: cubic-bezier(.3, 1.2, .4, 1); }
.t-rail.show { opacity: 1; pointer-events: auto; }
.t-rail button { width: 22px; height: 20px; display: grid; place-items: center; padding: 0; border: 0; background: none; cursor: pointer; }
.t-rail i { display: block; width: 5px; height: 18px; border-radius: 3px; background: #b9b7b1; transform: scaleY(.28); transition: transform .35s var(--ease), background .25s; }
.t-rail button:hover i, .t-rail button:focus-visible i { background: var(--blue); transform: scaleY(.7); }
.t-rail .on i { transform: scaleY(1); background: var(--blue); }
.t-pop { position: absolute; right: 8px; top: 0; width: 6px; height: 6px; border-radius: 999px; background: rgba(251, 251, 249, .97); box-shadow: 0 0 0 1px rgba(18, 80, 196, .28), 0 10px 28px rgba(0, 0, 0, .1); overflow: hidden; opacity: 0; pointer-events: none; transform: translateY(calc(var(--y, 0px) - 3px)); transition: transform .5s var(--spring), width .45s var(--spring), height .45s var(--spring), right .45s var(--spring), opacity .18s ease; will-change: transform, width; }
.t-pop.open { right: 32px; width: var(--w, 200px); height: var(--h, 36px); border-radius: 18px; opacity: 1; transform: translateY(calc(var(--y, 0px) - var(--h, 36px) / 2)); }
.t-pop-in { display: flex; align-items: center; gap: 8px; width: max-content; max-width: 340px; height: 36px; padding: 0 15px; white-space: nowrap; font-size: 13px; letter-spacing: -.01em; color: #111; opacity: 0; transition: opacity .2s ease; }
.t-pop.open .t-pop-in { opacity: 1; transition: opacity .25s ease .1s; }
.t-pop-in b { font-weight: 500; color: var(--blue); }
.t-pop-in small { font-size: 12px; color: var(--dim); overflow: hidden; text-overflow: ellipsis; max-width: 230px; }
.t-pop-in.swap { animation: popSwap .3s var(--ease) both; }
@keyframes popSwap { from { opacity: 0; transform: translateY(7px); } to { opacity: 1; transform: none; } }
@media (max-width: 820px) { .t-rail { right: 4px; } .t-pop-in { max-width: 290px; } .t-pop-in small { max-width: 170px; } }
/* Mobile: keep the hiatus line clear of the rail dots on the right */
@media (max-width: 820px) { .t-close-sub { max-width: calc(100% - 64px); } }
@media (prefers-reduced-motion: reduce) { .t-pop, .t-pop-in, .t-rail i { transition: none; animation: none; } }

.t-pop.snap { transition: none; }

/* the label is two lines: what this dot is (in full), and what it shows */
.t-pop-in { flex-direction: column; align-items: flex-start; gap: 3px; height: auto; padding: 10px 16px 11px; white-space: normal; max-width: 330px; }
.t-pop-in b { color: #111; font-size: 13.5px; line-height: 1.25; }
.t-pop-in small { max-width: none; overflow: visible; text-overflow: clip; font-size: 12px; line-height: 1.3; }
@media (max-width: 820px) { .t-pop-in { max-width: 268px; } }

/* the scroll cue: at rest it pulses, as before. Once you scroll, the pulse fades into a solid line that stretches down and becomes the start of the thread. */
.t-cue { position: relative; display: block; text-align: center; padding-bottom: 46px; }
.t-cue i b { position: absolute; inset: 0; display: block; width: 2px; margin: 0 auto; border-radius: 1px; background: linear-gradient(var(--blue), rgba(18, 80, 196, .4)); transform-origin: top; transition: opacity .4s ease; animation: cue 1.8s ease-in-out .5s infinite backwards; }

.t-intro.scrolled .t-cue i b { animation: none; opacity: 0; } /* no pulse while you scroll; the solid line takes over */
@media (prefers-reduced-motion: reduce) { .t-cue i b { animation: none; } }

.t-sunwrap .sun { will-change: transform; }

/* the cue line: the pulse (b) is always visible; the solid line (::before) fades in under it once you scroll */
.t-cue i { position: absolute; left: calc(50% - 1px); top: 28px; width: 2px; height: 36px; overflow: hidden; }
.t-cue i::before { content: ""; position: absolute; inset: 0; border-radius: 1px; background: var(--blue); opacity: 0; transition: opacity .4s ease; -webkit-mask-image: linear-gradient(to bottom, #000 var(--keep, 0%), transparent 100%); mask-image: linear-gradient(to bottom, #000 var(--keep, 0%), transparent 100%); }
.t-intro.scrolled .t-cue i::before { opacity: 1; transition: none; }

/* "Read the publication": black, blue on hover (the underline and arrow follow the text colour) */
.vlink.t-cta { color: var(--ink); transition: color .25s ease; }
.vlink.t-cta:hover, .vlink.t-cta:focus-visible { color: var(--blue); }

/* map source line is a link */
.t-src a { color: inherit; text-decoration: none; border-bottom: 1px solid rgba(106, 105, 101, .35); transition: color .2s, border-color .2s; }
.t-src a:hover, .t-src a:focus-visible { color: var(--blue); border-color: currentColor; }
.t-src .arrow-slide { width: 1.1em; height: 1.1em; min-width: 0; min-height: 0; vertical-align: -0.2em; margin-left: .3em; }
/* the dot labels use the same glass as the header pills: no outline, translucent white, blurred behind */
.t-pop { background: rgba(255, 255, 255, 0.72); -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px); box-shadow: none; }

/* keyboard focus on a state: the highlight outline and the readout already show it, so drop the browser's boxy default */
.t-map path:focus, .t-map path:focus-visible { outline: none; }

/* map peel: the hovered state rolls up like a sticker; the rest of the map softens */
.t-map path.st { transition: opacity .18s ease-out; } /* brightening back to full colour is quick */
.t-map svg.peeling path.st { transition: opacity .55s ease; } /* dimming is a little slower */
.t-map svg.peeling path.st { opacity: .5; }
.t-map .peel-shadow { filter: drop-shadow(3px 12px 8px rgba(17,17,17,.32)); }

/* paper grain: a faint fixed noise layer that drifts a few pixels with scroll */
body::after { content: ""; position: fixed; inset: -64px; z-index: 50; pointer-events: none; opacity: .12; mix-blend-mode: multiply; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='220' height='220'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 .9 0'/%3E%3C/filter%3E%3Crect width='220' height='220' filter='url(%23n)'/%3E%3C/svg%3E"); transform: translate3d(0, var(--grain, 0px), 0); }
@media (prefers-reduced-motion: reduce) { body::after { transform: none; } }

/* the readout and source line sit centred under the map; on a phone the map itself is centred on the screen */
.t-read { justify-content: center; text-align: center; }
.t-src { text-align: center; }
@media (max-width: 820px) {
  .t-m.fact .t-media, .t-m.fact .t-src { width: calc(100vw - 80px); margin-left: -14px; max-width: none; }
  .t-m.fact .t-media { margin-top: 24px; }
}
