/* DataDeck site. Brand rules: docs/brand.md */
@font-face { font-family: "Plex Mono"; src: url(fonts/ibm-plex-mono-400.woff2) format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Plex Mono"; src: url(fonts/ibm-plex-mono-500.woff2) format("woff2"); font-weight: 500; font-display: swap; }
@font-face { font-family: "Plex Mono"; src: url(fonts/ibm-plex-mono-600.woff2) format("woff2"); font-weight: 600; font-display: swap; }
@font-face { font-family: "Plex Sans"; src: url(fonts/ibm-plex-sans-400.woff2) format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Plex Sans"; src: url(fonts/ibm-plex-sans-500.woff2) format("woff2"); font-weight: 500; font-display: swap; }
@font-face { font-family: "Plex Sans"; src: url(fonts/ibm-plex-sans-600.woff2) format("woff2"); font-weight: 600; font-display: swap; }

:root {
  --paper: #ffffff;
  --ink: #111111;
  --mute: #6a6a6a;
  --faint: #9a9a9a;
  --rule: #dcdcdc;
  --wash: #f6f6f5;
  --live: #aa4169;
  --live-wash: #f7eef1;
  --sans: "Plex Sans", -apple-system, "Helvetica Neue", sans-serif;
  --mono: "Plex Mono", ui-monospace, Menlo, monospace;
  --snap: 120ms;
  --measure: 29rem;
  --pad: clamp(20px, 4vw, 56px);
}

* { box-sizing: border-box; margin: 0; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body { background: var(--paper); color: var(--ink); font: 400 17px/1.6 var(--sans); -webkit-font-smoothing: antialiased; }
a { color: inherit; text-decoration-color: var(--rule); text-decoration-thickness: 1px; text-underline-offset: 4px; }
a:hover { text-decoration-color: var(--ink); }
:focus-visible { outline: 2px solid var(--live); outline-offset: 3px; }

/* Top bar */
.top { display: flex; justify-content: space-between; align-items: center; padding: 22px var(--pad); font: 400 13px/1 var(--mono); position: relative; z-index: 3; }
.wordmark { display: inline-flex; align-items: center; gap: 10px; font: 600 15px/1 var(--mono); text-decoration: none; }
.mark { display: grid; gap: 3px; width: 18px; }
.mark i { display: block; height: 3px; background: var(--ink); }
.mark i:nth-child(2) { width: 72%; }
.mark i:nth-child(3) { width: 100%; }
.top nav { display: flex; gap: 22px; color: var(--mute); }
.top nav a { text-decoration: none; }
.top nav a:hover { color: var(--ink); }

/* Two columns: words left, the deck right */
.page { display: flex; flex-direction: column; padding: 0 var(--pad); }
.words { display: contents; }
.words > section { order: 2; }
.words > section.hero { order: 0; }
.stage-wrap { order: 1; }
.words > section { padding: 56px 0; border-top: 1px solid var(--rule); }
.words > section.hero { border-top: 0; padding: 24px 0 44px; }

h1 { font: 600 clamp(26px, 8.4vw, 50px)/1.04 var(--sans); letter-spacing: -0.035em; }
h1 span { white-space: nowrap; }
h1 span { display: block; }
.standfirst { font-size: clamp(18px, 1.5vw, 21px); line-height: 1.5; max-width: 34ch; margin-top: 26px; color: #2a2a2a; }
.cta { display: flex; flex-wrap: wrap; align-items: center; gap: 14px 20px; margin-top: 30px; }
.btn { display: inline-block; background: var(--ink); color: #fff; font: 500 14px/1 var(--mono); padding: 14px 18px; border-radius: 2px; text-decoration: none; transition: background var(--snap); }
.btn:hover { background: var(--live); }
.fine { font: 400 12.5px/1.5 var(--mono); color: var(--mute); }

h2 { font: 600 clamp(26px, 2.6vw, 34px)/1.12 var(--sans); letter-spacing: -0.025em; max-width: var(--measure); text-wrap: balance; }
.words p { max-width: var(--measure); margin-top: 14px; color: #2a2a2a; }
.job-head { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; font: 500 13px/1 var(--mono); margin-bottom: 18px; max-width: var(--measure); }
.state { font-weight: 400; color: var(--mute); white-space: nowrap; }
.state.live { color: var(--live); }
.words ul { list-style: none; padding: 0; margin-top: 18px; max-width: var(--measure); border-top: 1px solid var(--rule); font: 400 13px/1.5 var(--mono); }
.words li { display: grid; grid-template-columns: 9ch 1fr; gap: 12px; padding: 9px 0; border-bottom: 1px solid var(--rule); }
.words li b { font-weight: 500; }
.words li span { color: var(--mute); }

pre.file { margin-top: 20px; max-width: var(--measure); border: 1px solid var(--rule); border-radius: 2px; padding: 14px 16px; font: 400 12.5px/1.65 var(--mono); overflow-x: auto; background: var(--wash); }
pre.file .k { color: var(--mute); }
figure.shot { margin-top: 22px; max-width: var(--measure); }
figure.shot img { display: block; width: 100%; height: auto; border: 1px solid var(--rule); border-radius: 2px; }
figure.shot figcaption { font: 400 12px/1.5 var(--mono); color: var(--mute); margin-top: 10px; }

footer { border-top: 1px solid var(--rule); margin: 0 var(--pad); padding: 26px 0 40px; display: flex; flex-wrap: wrap; gap: 8px 24px; justify-content: space-between; font: 400 12.5px/1.5 var(--mono); color: var(--mute); }

/* ---------- The deck (hero animation) ---------- */
.stage-wrap { position: relative; }
.stage { position: relative; height: 460px; margin: 0 calc(var(--pad) * -1); overflow: hidden; background: var(--wash); border-top: 1px solid var(--rule); border-bottom: 1px solid var(--rule); --w: min(520px, calc(100vw - 40px)); }

.bar { position: absolute; z-index: 4; bottom: 20px; left: 50%; width: var(--w); margin-left: calc(var(--w) / -2); height: 44px; display: flex; align-items: center; gap: 10px; padding: 0 14px; background: #fff; border: 1px solid var(--ink); border-radius: 2px; font: 400 13.5px/1 var(--mono); box-shadow: 0 10px 30px -14px rgba(0, 0, 0, .35); }
.bar-label { color: var(--faint); white-space: nowrap; }
.bar-text { white-space: nowrap; overflow: hidden; font-weight: 500; }
.caret { width: 7px; height: 17px; background: var(--ink); margin-left: -8px; animation: blink 1.1s steps(1) infinite; flex: none; }
.bar-count { margin-left: auto; color: var(--mute); white-space: nowrap; font-variant-numeric: tabular-nums; }
@keyframes blink { 50% { opacity: 0; } }

.world { position: absolute; inset: 0; perspective: 1100px; perspective-origin: 50% 10%; animation: sway 18s ease-in-out infinite alternate; -webkit-mask-image: linear-gradient(to bottom, transparent 19%, #000 56%); mask-image: linear-gradient(to bottom, transparent 19%, #000 56%); }
@keyframes sway { from { perspective-origin: 47% 12%; } to { perspective-origin: 53% 8%; } }

.plane { position: absolute; top: 0; left: 50%; width: var(--w); margin-left: calc(var(--w) / -2); transition: opacity var(--snap) linear; }
.plane.back { opacity: .3; }

.strip { position: absolute; top: 0; left: 0; width: 100%; height: 30px; display: grid; grid-template-columns: 16px minmax(0, 1fr) auto 34px; align-items: center; gap: 10px; padding: 0 12px; background: #fff; border: 1px solid var(--rule); border-radius: 2px; font: 400 12px/1 var(--mono); color: var(--mute); transition: transform var(--snap) ease-out, opacity 90ms linear, border-color var(--snap), background var(--snap); }
.strip.dim { opacity: .18; }
.strip.hit { border-color: var(--ink); }
.strip.off { opacity: 0; visibility: hidden; transition: transform var(--snap) ease-out, opacity 90ms linear, visibility 0s 90ms; }
.strip .g { color: var(--ink); text-align: center; font-size: 13px; }
.strip .n { color: var(--ink); font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.strip .n mark { background: var(--live-wash); color: var(--live); border-radius: 1px; }
.strip .s { white-space: nowrap; }
.strip .a { text-align: right; font-variant-numeric: tabular-nums; }
.strip.flash { border-color: var(--live); background: var(--live-wash); }
.strip.flash .g, .strip.flash .a { color: var(--live); }
.strip.new { border-color: var(--ink); }
.strip .spark { position: absolute; right: 96px; top: 6px; width: 46px; height: 17px; opacity: 0; transition: opacity var(--snap); }
.strip.has-spark .spark { opacity: 1; }
.strip.has-spark .s { visibility: hidden; }
@media (max-width: 480px) { .strip .s { display: none; } .strip { grid-template-columns: 16px minmax(0, 1fr) 34px; } .strip .spark { right: 52px; } }

/* The post a card turns into */
.post { position: absolute; z-index: 3; left: 50%; bottom: 78px; width: var(--w); margin-left: calc(var(--w) / -2); background: #fff; border: 1px solid var(--ink); border-radius: 2px; box-shadow: 0 24px 50px -26px rgba(0, 0, 0, .4); overflow: hidden; height: 30px; opacity: 0; visibility: hidden; transition: height 180ms cubic-bezier(.2, .85, .2, 1), opacity 60ms linear, visibility 0s 180ms; }
.post.open { height: 288px; opacity: 1; visibility: visible; transition: height 180ms cubic-bezier(.2, .85, .2, 1), opacity 60ms linear; }
.post-head { display: flex; justify-content: space-between; align-items: center; height: 30px; padding: 0 12px; font: 400 12px/1 var(--mono); color: var(--mute); border-bottom: 1px solid var(--rule); }
.post-head b { color: var(--ink); font-weight: 500; }
.chart-wrap { position: relative; height: 150px; }
.post svg.chart { display: block; width: 100%; height: 150px; }
.post .line { fill: none; stroke: var(--live); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; vector-effect: non-scaling-stroke; stroke-dasharray: 700; stroke-dashoffset: 700; }
.post.draw .line { stroke-dashoffset: 0; transition: stroke-dashoffset 900ms cubic-bezier(.3, .6, .2, 1); }
.post .lbl { position: absolute; font: 500 11px/1 var(--mono); color: var(--ink); opacity: 0; transition: opacity var(--snap) 700ms; }
.post .lbl.sub { font-weight: 400; color: var(--mute); }
.post.draw .lbl { opacity: 1; }
.post .axis { stroke: var(--rule); stroke-width: 1; vector-effect: non-scaling-stroke; }
.post-cap { padding: 2px 14px 0; font: 400 14px/1.4 var(--sans); min-height: 42px; }
.post-foot { position: absolute; left: 0; right: 0; bottom: 0; display: flex; justify-content: space-between; align-items: center; padding: 0 12px 0 14px; height: 44px; border-top: 1px solid var(--rule); font: 400 12px/1 var(--mono); color: var(--mute); }
.post-foot .state { color: var(--ink); }

/* Narration: which job, and what is happening */
.cap { position: absolute; z-index: 4; left: 50%; top: 22px; width: var(--w); margin-left: calc(var(--w) / -2); }
.rail { display: flex; gap: 18px; font: 400 12px/1 var(--mono); color: var(--faint); }
.rail span.on { color: var(--ink); font-weight: 500; }
.rail span.on::before { content: ""; display: inline-block; width: 6px; height: 6px; background: var(--live); margin-right: 7px; vertical-align: 1px; }
.cap-line { font: 600 clamp(18px, 1.7vw, 24px)/1.2 var(--sans); letter-spacing: -0.02em; margin-top: 12px; min-height: 2.4em; }

/* Desktop: the deck stays put while the words scroll past */
@media (min-width: 980px) {
  .words { display: block; }
  .page { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); column-gap: clamp(32px, 5vw, 80px); }
  h1 { font-size: clamp(38px, 4.4vw, 70px); }
  .words > section.hero { display: grid; align-content: center; padding: 0 0 9vh; min-height: calc(100vh - 62px); }
  .words > section { padding: 84px 0; }
  .words > section.job { min-height: 62vh; }
  .stage-wrap { grid-column: 2; grid-row: 1 / span 20; margin-top: -62px; }
  .stage { position: sticky; top: 0; height: 100vh; min-height: 560px; margin: 0 calc(var(--pad) * -1) 0 0; border: 0; border-left: 1px solid var(--rule); --w: min(540px, 38vw); }
  .bar { bottom: 50px; }
  .post { bottom: 108px; }
  .cap { top: 96px; }
}

@media (prefers-reduced-motion: reduce) {
  .world, .caret { animation: none; }
  .plane, .strip, .post, .post .line { transition: none !important; }
  html { scroll-behavior: auto; }
}
