
/* The site's tokens: this file is their source of truth. Monochrome shell; colour only
   comes from the work and imagery. */
:root {
  --color-bg: #fff;
  --color-text: #000;
  --color-text-muted: #686868;
  --color-border: #e6e6e6;
  --color-bg-subtle: #f8f8f8;
  --color-illustration-shade: rgb(0 0 0 / 0.12);
  --serif: "Instrument Serif", Georgia, serif;
  --sans: "IBM Plex Sans", "Helvetica Neue", Arial, sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, monospace;
  /* A landscape iPhone's notch and rounded corners (viewport-fit=cover lets backgrounds run under them);
     the same both sides so the page stays centred. 0 everywhere else */
  --safe: max(env(safe-area-inset-left, 0px), env(safe-area-inset-right, 0px));
  --gutter: calc(16px + var(--safe)); /* the page edge, the same on every screen, clear of the notch */
  --content: 1280px; /* page content stops growing here; the huge name still runs edge to edge */
  /* A section's side padding: the gutter, or more once the window is wider than the content */
  --edge: max(var(--gutter), (100% - var(--content)) / 2);
  --ease: cubic-bezier(.2, .7, .2, 1);
  --reveal-ease: cubic-bezier(.25, .6, .3, 1); /* the scroll-in: softer at the start than --ease */
  /* Spacing: one scale on a 4px grid; the number is how many 4s (--space-4 is 16px).
     1–3px nudges and measured optical offsets stay as they are. */
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 20px;
  --space-6: 24px;
  --space-8: 32px;
  --space-10: 40px;
  --space-12: 48px;
  --space-14: 56px;
  --space-16: 64px;
  --space-20: 80px;
  --space-24: 96px;
  --space-30: 120px;
  --space-35: 140px;  /* homepage sections */
  --space-44: 176px;  /* project sections */
  /* Motion: five speeds for the interface and three more curves. The drawings and the dot
     pictures keep their own timing. */
  --duration-xs: 150ms; /* press-in, quick colour changes */
  --duration-s: 200ms;  /* hover colours */
  --duration-m: 400ms;  /* the link sweep, the + turning, fades */
  --duration-l: 600ms;  /* swaps */
  --duration-xl: 900ms; /* things fading up as you scroll */
  --ease-fold: cubic-bezier(.5, 0, 0, 1);   /* the + turning, rows sliding, the description unfolding */
  --ease-fade: cubic-bezier(.2, 0, 0, 1);   /* lines fading up one after another */
  --ease-pop: cubic-bezier(.34, 1.56, .64, 1); /* a small overshoot: the speech bubble, a jump */
  /* Corners: five sizes. Circles (50%) and square corners (0) are shapes, so they stay as they are. */
  --radius-xs: 4px;    /* the focus ring */
  --radius-s: 8px;     /* small tiles: colour swatches, code lines, the parts in Patterns */
  --radius-m: 12px;    /* pictures and work art on phones */
  --radius-l: 16px;    /* pictures, panels, the video */
  --radius-full: 999px; /* buttons, pills, the "$ copied" note */
  /* Type: one token per text style (weight, size/line height, font), plus its letter
     spacing where it has some. Rules use them as font: var(--type-…); letter-spacing:
     var(--type-…-tracking). Sizes that change on smaller screens change here, once. */
  --type-display-xl: 400 clamp(56px, 8.9vw, 128px)/.9375 var(--serif);
  --type-display-xl-tracking: -.04em;
  --type-display-l: 400 clamp(44px, 6.4vw, 92px)/.978 var(--serif);
  --type-display-l-tracking: -.03em;
  --type-display-m: 400 clamp(44px, 5.6vw, 80px)/1 var(--serif);
  --type-display-m-tracking: -.03em;
  --type-display-s: 400 72px/72px var(--serif);
  --type-display-s-tracking: -.03em;
  --type-display-menu: 400 72px/80px var(--serif);
  --type-display-menu-tracking: -.03em;
  --type-heading-stat: 400 40px/40px var(--serif);
  --type-heading-stat-tracking: -.02em;
  --type-heading-pull: 400 28px/32px var(--serif);
  --type-heading-pull-tracking: -.01em;
  --type-body-m: 400 14px/20px var(--sans);
  --type-body-s: 400 12px/18px var(--sans);
  --type-link-nav: 400 12px/24px var(--sans);
  --type-link-company: 500 14px/24px var(--sans);
  --type-label: 500 12px/20px var(--mono);
  --type-label-tracking: .08em;
  --type-label-meta: 500 12px/20px var(--mono);
  --type-label-meta-tracking: .04em;
  color-scheme: light;
}
/* Type on smaller screens */
@media (max-width: 1279px) { :root { --type-heading-stat: 400 32px/32px var(--serif); } }
@media (max-width: 1023px) { :root { --type-heading-stat: 400 28px/28px var(--serif); } }
@media (max-width: 767px) { :root { --type-display-s: 400 44px/44px var(--serif); } }
/* data-theme is set before paint: the saved choice, or the device setting. Dark mode is for
   screens only: printing (and the CV's PDF) always uses the light values above. */
@media screen {
  :root[data-theme="dark"] {
    --color-bg: #000;
    --color-text: #fff;
    --color-text-muted: #a3a3a3;
    --color-border: #262626;
    --color-bg-subtle: #0e0e0e; /* about 1.6 times the light grey's step, which reads as even: small steps near black are harder to see */
    --color-illustration-shade: rgb(255 255 255 / 0.2);
    color-scheme: dark;
  }
  [data-theme="dark"] .on-light, :root:not([data-theme="dark"]) .on-dark { display: none; }
}
@media print { .on-dark { display: none; } }
/* Selected text: black in light mode, white in dark mode */
::selection { background: var(--color-text); color: var(--color-bg); }

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: var(--space-16); /* the 48px top bar + 16px */ }
body {
  margin: 0;
  background: var(--color-bg);
  color: var(--color-text);
  font: var(--type-body-m);
  -webkit-font-smoothing: antialiased;
  overflow-x: clip;
}
img { display: block; max-width: 100%; height: auto; }
button { font: inherit; }
a { color: inherit; }
:focus-visible { outline: 2px solid var(--color-text); outline-offset: 3px; border-radius: var(--radius-xs); }
ul, ol, dl, dd, figure, blockquote, p, h1, h2, h3 { margin: 0; padding: 0; }
ul, ol { list-style: none; }
h1, h2, h3 { font-weight: 400; }

.visually-hidden {
  position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap;
}
/* Skip link and a pause button, both shown together when either has focus */
.skips { position: fixed; top: 8px; left: 8px; z-index: 20; display: flex; gap: var(--space-2); pointer-events: none; }
.skips:focus-within { pointer-events: auto; } /* hidden, it would sit over the logo and catch its clicks */
.skip {
  padding: var(--space-2) 14px; border: 0; background: var(--color-text); color: var(--color-bg);
  font: inherit; border-radius: var(--radius-full); text-decoration: none; cursor: pointer;
  transform: translateY(-200%);
}
.skips:focus-within .skip { transform: none; }

.label {
  font: var(--type-label); letter-spacing: var(--type-label-tracking);
  color: var(--color-text-muted);
}
/* Labels that type in on scroll (site.js typeLabels) hold their room until each key lands */
.label.is-typing .key:not(.is-typed, .is-ghost) { visibility: hidden; }
/* The suggested rest of a word: faint until it's accepted, then it settles to the label's colour */
.label .key.is-ghost { opacity: .35; }
.label.is-typing .key { transition: opacity .16s ease; }
.label .caret::after { top: -11px; height: 13px; }
/* While a suggestion is on offer the caret idles, blinking, as an editor's does */
.label .caret.is-idle::after { animation: caret-blink 1.06s steps(1) infinite; }

/* Top bar */
.top {
  position: fixed; inset: 0 0 auto; z-index: 10;
  display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: var(--space-3);
  padding: var(--space-2) var(--edge); /* 48px tall: 8px above and below the 32px logo */
  font: var(--type-link-nav);
  background: var(--color-bg); /* solid, so Safari's strip above it on iPhone is the same colour */
}
.top a { text-decoration: none; }
.top-home { justify-self: start; display: block; width: 32px; height: 32px; border-radius: 50%; }
.logo { display: block; width: 32px; height: 32px; }
.logo-s { fill: var(--color-text); }
.top-links { display: flex; gap: var(--space-5); }
.top-end { justify-self: end; display: flex; align-items: center; gap: var(--space-5); }
/* Menu (phones only): set like the desktop nav links (Plex Sans 12/24); its + turns to × when open */
.menu-btn {
  display: none; align-items: center; gap: var(--space-2);
  padding: var(--space-1) 0; border: 0; background: none; cursor: pointer;
  font: var(--type-link-nav); color: var(--color-text);
}
.menu-btn__icon { width: 13px; height: 13px; transition: rotate var(--duration-m) var(--ease-fold); }
.menu-btn[aria-expanded="true"] .menu-btn__icon { rotate: 45deg; }
.menu {
  position: fixed; inset: 0; z-index: 9; /* under the top bar, which keeps the logo and Close */
  display: flex; flex-direction: column; justify-content: space-between;
  padding: 104px var(--edge) var(--space-10);
  background: var(--color-bg);
  overflow-y: auto; overscroll-behavior: contain;
}
.menu[hidden] { display: none; }
.menu ul { margin: 0; padding: 0; list-style: none; }
.menu .menu-links { padding-top: var(--space-4); } /* beats the reset above */
.menu a { color: var(--color-text); text-decoration: none; }
.menu-sections { display: grid; gap: var(--space-1); }
.menu-sections a { display: block; width: fit-content; font: var(--type-display-menu); letter-spacing: var(--type-display-menu-tracking); }
.menu-sections a:focus-visible { font-style: italic; }
@media (hover: hover) { .menu-sections a:hover { font-style: italic; } }
.menu-links {
  display: flex; flex-wrap: wrap; gap: var(--space-2) var(--space-5); border-top: 1px solid var(--color-border);
  font: var(--type-link-nav); /* the desktop nav's links */
}
html.menu-open { overflow: hidden; }
.icon-btn {
  display: grid; place-items: center;
  width: 32px; height: 32px; padding: 0;
  border: 0; background: none; color: inherit; cursor: pointer; border-radius: 50%;
}
@media (hover: hover) { .icon-btn:hover { color: var(--color-text); } }
.theme-icon {
  width: 14px; height: 14px; border-radius: 50%;
  border: 1.5px solid currentColor;
  background: linear-gradient(90deg, currentColor 50%, transparent 50%);
  transition: rotate var(--duration-m) var(--ease);
}
[data-theme="dark"] .theme-icon { rotate: 180deg; }
/* Same 14px circle as the theme icon: pause bars while playing, a play triangle when paused */
.motion-icon { width: 14px; height: 14px; overflow: visible; fill: none; stroke: currentColor; stroke-width: 1.5; }
.motion-icon__play { fill: currentColor; stroke: none; display: none; }
[data-motion="paused"] .motion-icon__pause { display: none; }
[data-motion="paused"] .motion-icon__play { display: inline; }

/* Hero */
/* The name's foot always sits --bleed below the fold, so a bit of it is cut off by the screen edge.
   --name-size comes from fitName() in app.js. Before it runs, the name is sized from the page
   width by its own width-to-size ratio (--name-ratio), so the fit doesn't jolt the page. */
.hero {
  --name-ratio: 4.1; /* "Stefan Adams" in Instrument Serif is 4.1 times as wide as its size */
  --bleed: calc(var(--name-size, (100vw - 16px - 2 * var(--safe)) / var(--name-ratio)) * .1);
  min-height: calc(100svh + var(--bleed) + 112px);
  display: flex; flex-direction: column; align-items: center; justify-content: flex-end;
  padding: var(--space-30) 0 112px;
  text-align: center;
}
.hero-doodle svg { display: block; width: 100%; height: 100%; overflow: visible; }
.hero-intro {
  width: min(344px, calc(100% - 2 * var(--gutter)));
  padding: var(--space-4) 0 81px;
  box-sizing: content-box;
  font: var(--type-body-m);
  color: var(--color-text-muted);
}
.hero-intro s { text-decoration-thickness: 1px; }
/* The edit (app.js): "users" is selected like text, struck through, let go, then " people."
   is typed after it. Untyped letters take no room, so the centred line grows from its
   middle as each one lands, as typing in centre-aligned text does. Screen readers get
   the whole sentence from a hidden copy meanwhile. Without JavaScript, with Reduce
   motion or with animations paused, it's simply the finished sentence. */
.hero-intro.is-editing .edit-old {
  text-decoration-color: transparent;
  background: linear-gradient(var(--color-text), var(--color-text)) left / 0 100% no-repeat;
  transition: background-size .35s var(--ease), color .2s var(--ease);
}
.hero-intro.is-editing .edit-old.is-selected:not(.is-let-go) { background-size: 100% 100%; color: var(--color-bg); }
.hero-intro.is-editing .edit-old.is-struck { text-decoration-color: currentColor; }
.hero-intro.is-editing .edit-old.is-let-go { background-image: none; }
.hero-intro.is-editing .edit-new .key:not(.is-typed) { display: none; }
/* The caret takes no room, so typing never moves the words around it */
.caret { position: relative; display: inline-block; width: 0; }
.caret::after {
  content: ""; position: absolute; left: 0; top: -15px;
  width: 1px; height: 19px; background: var(--color-text);
}
.caret.is-blinking::after { animation: caret-blink 1s steps(1) 3; }
@keyframes caret-blink { 50% { opacity: 0; } }
.hero-name {
  width: 100%;
  padding: 0 calc(var(--space-2) + var(--safe));
  font: 400 calc((100vw - 16px - 2 * var(--safe)) / var(--name-ratio))/.79 var(--serif);
  letter-spacing: -.045em;
  white-space: nowrap;
}
.hero-name .fit { display: inline-block; }
.hero-intro, .hero-name { opacity: 0; translate: 0 16px; }
.is-ready .hero-intro { opacity: 1; translate: 0; transition: opacity var(--duration-xl) .1s var(--ease), translate var(--duration-xl) .1s var(--ease); }
.is-ready .hero-name { opacity: 1; translate: 0; transition: opacity 1s var(--duration-s) var(--ease), translate 1s var(--duration-s) var(--ease); }
:root:not(.js) :is(.hero-intro, .hero-name) { opacity: 1; translate: 0; } /* no script to fade them in */

/* 404 (Figma "Lab / 404 XL"): the spectators, a label, the line and a way home, stacked from
   the top, then a huge 404 fitted to the page width like the name. The 404's tight
   tracking also follows its last digit, so the measured word is .045em short of the ink;
   the padding gives it back, or the last 4 runs off the edge. The spectators and text fade
   up as one, like the intro. */
/* 80px under the 404, the same as the homepage's last section leaves above the footer */
.hero--404 { justify-content: flex-start; min-height: 0; padding-top: var(--space-30); padding-bottom: var(--space-20); }
/* At this size the digits' line boxes reach well above the heading, over the button, so
   the 404 lets clicks through */
.hero--404 { --name-ratio: 1.156; }
/* The font's own descent (.31em) reaches far below the digits, and browsers count it as
   page, so it can make a black strip under the footer; clipping top and bottom drops it
   (the digits' ink sits inside the box, so nothing visible is cut) */
.hero--404 .hero-name { margin-top: var(--space-16); pointer-events: none; overflow-y: clip; }
.hero--404 .fit { padding-right: .045em; }
.nf-art { width: min(160px, calc(100% - 2 * var(--gutter))); margin-top: var(--space-10); }
.nf-text { display: flex; flex-direction: column; align-items: center; gap: var(--space-4); padding-top: var(--space-8); }
.nf-content { display: flex; flex-direction: column; align-items: center; gap: var(--space-6); }
.hero--404 .hero-intro { width: min(344px, 100vw - 2 * var(--gutter)); padding: 0; opacity: 1; translate: 0; }
:is(.secondary-btn, .primary-btn) { text-decoration: none; }
/* A little terminal looking for the page (404.js types it out). Plex Mono like the career
   dates (Figma Type/label/meta), commands in ink after a muted "$", replies muted. It
   holds its full size from the start, so typing never moves the button. Long addresses
   end in "…". Without JavaScript, with Reduce motion or paused, it's simply all there. */
.nf-log {
  width: fit-content; max-width: min(344px, 100vw - 2 * var(--gutter));
  text-align: left;
  font: var(--type-label-meta); letter-spacing: var(--type-label-meta-tracking); color: var(--color-text-muted);
}
.nf-log p { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.nf-log__cmd { color: var(--color-text); }
.nf-log__cmd::before { content: "$ "; color: var(--color-text-muted); }
.nf-log.is-typing :is(.key:not(.is-typed), p:not(.is-shown)) { visibility: hidden; }
.nf-log .caret::after { top: -11px; height: 13px; }
.nf-art, .nf-text { opacity: 0; translate: 0 16px; }
.is-ready :is(.nf-art, .nf-text) { opacity: 1; translate: 0; transition: opacity .8s .1s var(--ease), translate .8s .1s var(--ease); }
:root:not(.js) :is(.nf-art, .nf-text) { opacity: 1; translate: 0; }

/* Spectators, from the old homepage (Figma "Image / Spectators"): ink lines, the drawings'
   shade. Idle, each sways, breathes or bobs from their feet, the "!" wobbles, pupils
   glance and the moustache twitches. Every few seconds (404.js .is-reacting) they spot
   something: the surprised one hops twice, the "!" pops, the tall man's brow shoots up as
   he leans back, and the others look over. Still with Reduce motion or paused animations. */
.spectators { display: block; width: 100%; height: auto; aspect-ratio: 262 / 270; overflow: visible; }
.spectators .line, .spectators use { fill: var(--color-text-muted); }
.spectators .shade { fill: var(--color-illustration-shade); }
.spectators__tall, .spectators__thinker, .spectators__surprised, .spectators__exclaim { transform-box: fill-box; transform-origin: 50% 100%; }
.spectators__moustache { transform-box: view-box; transform-origin: 39px 86px; }
@media (prefers-reduced-motion: no-preference) {
  .spectators__tall { animation: spectators-sway 4.6s ease-in-out -1s infinite; }
  .spectators__thinker { animation: spectators-breathe 3.3s ease-in-out -.8s infinite; }
  .spectators__surprised { animation: spectators-bob 2.6s ease-in-out infinite; }
  .spectators__exclaim { animation: spectators-wobble 1.8s ease-in-out infinite; }
  .spectators__tall .spectators__glance { animation: spectators-glance-a 4s ease-in-out -1s infinite; }
  .spectators__thinker .spectators__glance { animation: spectators-glance-b 3.4s ease-in-out -2s infinite; }
  .spectators__moustache { animation: spectators-twitch 4.5s ease-in-out -2s infinite; }
  .spectators__look, .spectators__brow, .spectators__tall, .spectators__thinker {
    transition: translate .35s var(--ease-pop), rotate .5s var(--ease-pop);
  }
  .spectators.is-reacting .spectators__surprised { animation: spectators-bob 2.6s ease-in-out infinite, spectators-hop 1.1s ease-in-out; }
  .spectators.is-reacting .spectators__exclaim { animation: spectators-wobble 1.8s ease-in-out infinite, spectators-pop .7s ease-out .15s; }
  .spectators.is-reacting .spectators__tall .spectators__look { translate: 2.2px -.8px; transition-delay: .2s; }
  .spectators.is-reacting .spectators__thinker .spectators__look { translate: 1.2px -.6px; transition-delay: .3s; }
  .spectators.is-reacting .spectators__tall .spectators__brow { translate: 0 -3.5px; transition-delay: .2s; }
  .spectators.is-reacting .spectators__tall { rotate: -3deg; transition-delay: .25s; }
  .spectators.is-reacting .spectators__thinker { rotate: 6deg; transition-delay: .35s; }
}
[data-motion="paused"] :is(.spectators, .spectators *) { animation: none !important; transition: none !important; }
@keyframes spectators-sway { 0%, 100% { transform: rotate(-1.5deg); } 50% { transform: rotate(1.5deg); } }
@keyframes spectators-breathe { 0%, 100% { transform: scale(1, 1); } 50% { transform: scale(1.02, 1.04); } }
@keyframes spectators-bob { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-2px); } }
@keyframes spectators-wobble { 0%, 100% { transform: rotate(-6deg); } 50% { transform: rotate(6deg); } }
@keyframes spectators-glance-a { 0%, 8%, 38%, 46%, 92%, 100% { translate: 0 0; } 16%, 30% { translate: -2.2px .3px; } 54%, 66% { translate: 2px -.8px; } 74%, 84% { translate: -.8px -1px; } }
@keyframes spectators-glance-b { 0%, 6%, 36%, 44%, 90%, 100% { translate: 0 0; } 14%, 28% { translate: 1.2px .3px; } 52%, 64% { translate: -1.1px -.5px; } 72%, 82% { translate: .6px -.8px; } }
@keyframes spectators-twitch { 0%, 84%, 96%, 100% { transform: none; } 86% { transform: scale(1.14, .84) rotate(-6deg); } 88.5% { transform: scale(.94, 1.1) rotate(5deg); } 91% { transform: scale(1.1, .9) rotate(-4deg); } 93.5% { transform: scale(.98, 1.03) rotate(2deg); } }
@keyframes spectators-hop { 0%, 100% { translate: 0 0; scale: 1 1; } 10% { translate: 0 0; scale: 1.06 .92; } 25% { translate: 0 -14px; scale: .95 1.06; } 42% { translate: 0 0; scale: 1.07 .92; } 60% { translate: 0 -9px; scale: .97 1.04; } 78% { translate: 0 0; scale: 1.04 .96; } }
@keyframes spectators-pop { 0%, 100% { scale: 1; rotate: 0deg; translate: 0 0; } 20% { scale: .6; translate: 0 2px; } 55% { scale: 1.6; rotate: 14deg; translate: 0 -6px; } 80% { scale: .9; rotate: -6deg; translate: 0 0; } }

/* Work */
.work { display: grid; gap: var(--space-12); padding: 0 var(--edge) var(--space-35); }
.work-list { display: grid; gap: var(--space-24); }
.work-link { display: block; text-decoration: none; }
/* The image boxes keep the Figma frame's 1360 × 635 shape (3 × 2 on phones) */
.work-art {
  position: relative; display: block; overflow: hidden;
  aspect-ratio: 1360 / 635;
  border: 1px solid var(--color-border); border-radius: var(--radius-l);
}
/* Tiles in dots (home.js): the canvas covers the tile. Without JavaScript, or without
   WebGL (.work-art--still), a screenshot of the dots at rest stands in, in the page's
   theme and in the phone shape on phones. With the dots it's never loaded. */
.work-dots { position: absolute; inset: 0; width: 100%; height: 100%; }
:root:not(.js) .work-art, .work-art--still { background: var(--still) center / cover no-repeat; }
.work-art--multi { --still: url("../assets/work-multi-dots-light.webp"); }
.work-art--debug { --still: url("../assets/work-debug-dots-light.webp"); }
.work-art--plusnet { --still: url("../assets/work-plusnet-dots-light.webp"); }
.work-art--ai { --still: url("../assets/work-ai-dots-light.webp"); }
[data-theme="dark"] .work-art--multi { --still: url("../assets/work-multi-dots-dark.webp"); }
[data-theme="dark"] .work-art--debug { --still: url("../assets/work-debug-dots-dark.webp"); }
[data-theme="dark"] .work-art--plusnet { --still: url("../assets/work-plusnet-dots-dark.webp"); }
[data-theme="dark"] .work-art--ai { --still: url("../assets/work-ai-dots-dark.webp"); }
/* Work meta: above each image, under a line, columns set per size (XL / L / M) */
.work-meta {
  display: grid; grid-template-columns: 174px 349px 1fr auto; column-gap: var(--space-6); row-gap: var(--space-2);
  align-items: start;
  padding: var(--space-6) 0;
  border-top: 1px solid var(--color-border);
}
.work-tag { font: var(--type-label); letter-spacing: var(--type-label-tracking); color: var(--color-text-muted); }
.work-title { justify-self: start; font-weight: 500; } /* only as wide as its words, for the hover highlight */

.work-desc { color: var(--color-text-muted); max-width: 470px; }
/* The stat: a big serif number with a small muted line under it saying what it counts */
.work-stat { display: grid; justify-items: end; gap: var(--space-2); text-align: right; }
.work-stat__num { font: var(--type-heading-stat); letter-spacing: var(--type-heading-stat-tracking); }
.work-stat__label { font: var(--type-body-s); color: var(--color-text-muted); }
@media (max-width: 1279px) {
  .work-meta { grid-template-columns: 118px 236px 1fr auto; }
}
@media (max-width: 1023px) {
  .work-meta { grid-template-columns: 110px 160px 1fr auto; }
}

/* Statement */
.statement {
  display: flex; flex-direction: column; align-items: center; gap: var(--space-8);
  padding: var(--space-35) var(--edge);
  text-align: center;
  border-top: 1px solid var(--color-border);
}
.statement-heading { display: flex; flex-direction: column; align-items: center; gap: var(--space-4); }
.statement-text {
  max-width: 720px;
  font: var(--type-display-l); letter-spacing: var(--type-display-l-tracking);
  text-wrap: balance;
}
/* Every pill is 38px, the same height in both states, so picking one never changes the sizes */
.pills { display: flex; flex-wrap: wrap; justify-content: center; gap: var(--space-2); }
.pill {
  height: 38px; padding: 0 var(--space-4);
  border: 1px solid var(--color-text); border-radius: var(--radius-full);
  background: none; color: var(--color-text); cursor: pointer;
  font: var(--type-body-s);
  transition: background-color var(--duration-s) var(--ease), color var(--duration-s) var(--ease), scale var(--duration-xs) var(--ease);
}
.pill { display: inline-flex; align-items: center; gap: var(--space-2); }
.pill[aria-selected="true"] { background: var(--color-text); color: var(--color-bg); }
/* The icon grows in as its pill is picked and shrinks away as it's left, the pill
   widening and narrowing with it (the -8px cancels the flex gap while it's away) */
.pill .skill-icon {
  transition: width .4s var(--ease), margin .4s var(--ease), opacity .3s var(--ease), scale .4s var(--ease);
}
.pill[aria-selected="false"] .skill-icon { width: 0; margin-right: calc(-1 * var(--space-2)); opacity: 0; scale: .4; }
/* Mobile: always two rows of two, whichever pill is picked. An empty full-width item
   after the second pill forces the break (row gap moved onto the second row's pills). */
@media (max-width: 767px) {
  .pills { row-gap: 0; }
  .pills::after { content: ""; flex-basis: 100%; order: 1; }
  .pill:nth-child(n + 3) { order: 2; margin-top: var(--space-2); }
}
/* The narrowest phones: a little less padding, so a picked pill and its neighbour still fit */
@media (max-width: 359px) { .pill { padding: 0 var(--space-3); } }

/* ---------- Skill icons ----------
   SVGs (the hand-drawn Figma icons split into parts) so the parts can move. They live once,
   in assets/skill-icons.svg, and site.js drops each into its page slot.
   Copied from the live site (css/styles.css). Only the selected pill shows its icon, and it
   loops for as long as that pill is selected:
   - Design Systems: the diamond splits into four small diamonds that tile the same
     shape, then they click back into one
   - UX Design: the circle, triangle and square swap places round the corner, one step
     at a time, until each is home again
   - Accessibility: the figure's arms go up, down by its sides, then up for a wave, while
     the ring turns once round
   - Emerging Tech: the big sparkle flares twice, turning, while the small ones blink
     and spin, twice each
   With Reduce motion on, or animations paused, the icons are simply still. They also loop
   inside .skill-icon-play (the system page shows them bare). */
.skill-icon {
  flex: none;
  width: 20px;
  height: 20px;
  overflow: visible; /* parts travel a little outside the 20×20 drawing */
}

.skill-icon__shadow {
  fill-opacity: 0.12; /* 4 points up on the Figma icons' 8%, in both themes */
}

.skill-icon * {
  transform-box: view-box; /* transform-origin below is in the drawing's 20×20 units */
}

/* The three extra diamonds only show while they're apart */
.skill-icon__tile:not(.skill-icon__tile--1) {
  opacity: 0;
}

@media (prefers-reduced-motion: no-preference) {
  :is(.pill[aria-selected="true"], .skill-icon-play) .skill-icon * {
    animation-duration: var(--skill-icon-time);
    animation-fill-mode: both;
    animation-iteration-count: infinite;
    animation-timing-function: cubic-bezier(0.45, 0, 0.55, 1); /* a soft ease, so no step stalls at its ends */
  }

  /* All four play together and take the same time, so they start and end as one */
  .skill-icon { --skill-icon-time: 2s; }

  /* Design Systems: four half-size diamonds exactly fill the big one */
  .skill-icon__tile { transform-origin: 10px 10px; }
  :is(.pill[aria-selected="true"], .skill-icon-play) .skill-icon .skill-icon__tile--1 { animation-name: skill-tile-1; }
  :is(.pill[aria-selected="true"], .skill-icon-play) .skill-icon .skill-icon__tile--2 { animation-name: skill-tile-2; }
  :is(.pill[aria-selected="true"], .skill-icon-play) .skill-icon .skill-icon__tile--3 { animation-name: skill-tile-3; }
  :is(.pill[aria-selected="true"], .skill-icon-play) .skill-icon .skill-icon__tile--4 { animation-name: skill-tile-4; }

  /* UX Design: round the corner, circle → top → right → home */
  :is(.pill[aria-selected="true"], .skill-icon-play) .skill-icon .skill-icon__shape--circle { animation-name: skill-shuffle-circle; }
  :is(.pill[aria-selected="true"], .skill-icon-play) .skill-icon .skill-icon__shape--triangle { animation-name: skill-shuffle-triangle; }
  :is(.pill[aria-selected="true"], .skill-icon-play) .skill-icon .skill-icon__shape--square { animation-name: skill-shuffle-square; }

  /* Accessibility: arms pivot at the shoulders */
  .skill-icon__ring { transform-origin: 10px 10px; }
  .skill-icon__arm { transform-origin: 10.3px 7.3px; }
  :is(.pill[aria-selected="true"], .skill-icon-play) .skill-icon .skill-icon__ring { animation-name: skill-ring-turn; animation-timing-function: linear; } /* turns without stopping */
  :is(.pill[aria-selected="true"], .skill-icon-play) .skill-icon .skill-icon__person { animation-name: skill-person-lift; }
  :is(.pill[aria-selected="true"], .skill-icon-play) .skill-icon .skill-icon__arm--l { animation-name: skill-arm-left; }
  :is(.pill[aria-selected="true"], .skill-icon-play) .skill-icon .skill-icon__arm--r { animation-name: skill-arm-right; }

  /* Emerging Tech */
  .skill-icon__spark--big { transform-origin: 10px 10px; }
  .skill-icon__spark--top { transform-origin: 5.24px 4.95px; }
  .skill-icon__spark--bottom { transform-origin: 5.85px 14.33px; }
  :is(.pill[aria-selected="true"], .skill-icon-play) .skill-icon .skill-icon__spark--big { animation-name: skill-spark-big; }
  :is(.pill[aria-selected="true"], .skill-icon-play) .skill-icon .skill-icon__spark--top { animation-name: skill-spark-top; }
  :is(.pill[aria-selected="true"], .skill-icon-play) .skill-icon .skill-icon__spark--bottom { animation-name: skill-spark-bottom; animation-delay: calc(var(--skill-icon-time) * -.4); } /* out of step with the top one, so one is always moving */
}

:root[data-motion="paused"] .skill-icon * {
  animation: none !important;
}

/* Every loop runs straight into the next: the only rests are short, even beats between
   steps, the same length at the end as in the middle, so the seam doesn't show */
@keyframes skill-tile-1 {
  0%, 100% { transform: none; }
  28%, 38% { transform: translate(0, -5.6px) scale(0.5); }
  68% { transform: scale(1.06); }
}

@keyframes skill-tile-2 {
  0%, 100% { transform: none; opacity: 0; }
  10%, 40% { opacity: 1; }
  58% { opacity: 0; }
  28%, 38% { transform: translate(5.6px, 0) scale(0.5); }
  68% { transform: scale(1.06); }
}

@keyframes skill-tile-3 {
  0%, 100% { transform: none; opacity: 0; }
  10%, 40% { opacity: 1; }
  58% { opacity: 0; }
  28%, 38% { transform: translate(0, 5.6px) scale(0.5); }
  68% { transform: scale(1.06); }
}

@keyframes skill-tile-4 {
  0%, 100% { transform: none; opacity: 0; }
  10%, 40% { opacity: 1; }
  58% { opacity: 0; }
  28%, 38% { transform: translate(-5.6px, 0) scale(0.5); }
  68% { transform: scale(1.06); }
}

/* Spots: circle (4.6, 15.4), triangle (10.9, 5), square (15.6, 15.2). Three moves, each
   followed by the same short beat, home included. */
@keyframes skill-shuffle-circle {
  0%, 100% { transform: none; }
  27%, 33% { transform: translate(6.3px, -10.4px); }
  60%, 67% { transform: translate(11px, -0.2px); }
  93% { transform: none; }
}

@keyframes skill-shuffle-triangle {
  0%, 100% { transform: none; }
  27%, 33% { transform: translate(4.7px, 10.2px); }
  60%, 67% { transform: translate(-6.3px, 10.4px); }
  93% { transform: none; }
}

@keyframes skill-shuffle-square {
  0%, 100% { transform: none; }
  27%, 33% { transform: translate(-11px, 0.2px); }
  60%, 67% { transform: translate(-4.7px, -10.2px); }
  93% { transform: none; }
}

@keyframes skill-ring-turn {
  from { transform: none; }
  to { transform: rotate(360deg); }
}

/* Arms up (with a little lift), down by the sides, up again with a wave, then straight
   back into the next "arms up" */
@keyframes skill-person-lift {
  0%, 100% { transform: none; }
  16% { transform: translateY(-0.6px); }
  28%, 40% { transform: none; }
  52%, 80% { transform: translateY(-0.6px); }
}

@keyframes skill-arm-left {
  0%, 100% { transform: none; }
  16% { transform: rotate(32deg); }
  34% { transform: rotate(-55deg); }
  52%, 80% { transform: rotate(32deg); }
}

@keyframes skill-arm-right {
  0%, 100% { transform: none; }
  16% { transform: rotate(-32deg); }
  34% { transform: rotate(55deg); }
  52% { transform: rotate(-32deg); }
  61% { transform: rotate(-10deg); }
  70% { transform: rotate(-32deg); }
  80% { transform: rotate(-20deg); }
}

/* Two flares, the second turning back the other way */
@keyframes skill-spark-big {
  0%, 100% { transform: none; }
  20% { transform: scale(1.12) rotate(25deg); }
  38% { transform: scale(0.92) rotate(40deg); }
  56% { transform: scale(1.1) rotate(10deg); }
  76% { transform: scale(0.97) rotate(-4deg); }
}

/* The small ones blink twice each, spinning a little as they pop back, evenly spread
   through the loop (the bottom one runs out of step with the top one) */
@keyframes skill-spark-top {
  0%, 100% { transform: none; }
  15%, 55% { transform: scale(0); }
  27%, 67% { transform: scale(1.5) rotate(45deg); }
  40%, 80% { transform: rotate(90deg); }
}

@keyframes skill-spark-bottom {
  0%, 100% { transform: none; }
  15%, 55% { transform: scale(0); }
  27%, 67% { transform: scale(1.5) rotate(-45deg); }
  40%, 80% { transform: rotate(-90deg); }
}
/* The lines stack in one cell; the hidden ones keep their room, so picking a long one moves nothing */
.skill-descs { display: grid; justify-items: center; }
.skill-desc { grid-area: 1 / 1; max-width: 400px; color: var(--color-text-muted); }
.skill-desc[hidden] { display: block; visibility: hidden; }

/* About */
.about {
  display: grid; grid-template-columns: minmax(0, 520px) minmax(0, 695px); justify-content: space-between;
  column-gap: var(--space-12);
  align-items: center;
  padding: var(--space-35) var(--edge);
  border-top: 1px solid var(--color-border);
  overflow-x: clip; /* the portrait's dots spread past its frame, without widening the page on phones */
}
.about-text { display: grid; gap: var(--space-14); }
.about-intro { display: grid; gap: 14px; }
.about-intro p:not(.label) { font: var(--type-body-m); color: var(--color-text-muted); }
/* Shipped for: a little log under the career rows, in the 404 log's type (Plex Mono 12/20,
   Type/label/meta). The prompt and command are muted, so the clients stand out: one line
   that never wraps, as many as fit, two spaces apart like ls, in ink. While the next page
   loads it says "fetching" with a spinner, muted (home.js). */
.ship-log { font: var(--type-label-meta); letter-spacing: var(--type-label-meta-tracking); }
.ship-log p { font-size: inherit; line-height: inherit; }
p.ship-log__cmd { color: var(--color-text-muted); }
.ship-log__cmd::before { content: "$ "; color: var(--color-text-muted); }
.ship-log__out { white-space: pre; overflow: hidden; text-overflow: ellipsis; }
p.ship-log__out { color: var(--color-text-muted); }
.ship-log__page { color: var(--color-text); }
.ship-log.is-typing :is(.key:not(.is-typed), .ship-log__out) { visibility: hidden; }
.ship-log .caret::after { top: -11px; height: 13px; }
.about-title { font: var(--type-display-s); letter-spacing: var(--type-display-s-tracking); margin-bottom: 10px; }
.about .label { margin-bottom: 10px; } /* 24px to the title, with the 14px gap (Figma Intro) */
.career { border-bottom: 1px solid var(--color-border); }
.career li {
  display: grid; grid-template-columns: 1fr auto 40px; gap: var(--space-4); align-items: center;
  padding: var(--space-4) 0;
  border-top: 1px solid var(--color-border);
  position: relative;
  transition: translate var(--duration-m) var(--ease-fold);
}
/* The company link stretches over its whole row, so a click anywhere on it opens their site */
.career-co::after { content: ""; position: absolute; inset: 0; }
/* Like bruce-cao.com: the row you're on slides over and the portrait changes */
.career li.is-active { translate: 12px 0; }
.career-text { display: grid; }
.career-co { justify-self: start; font: var(--type-link-company); color: inherit; text-decoration: none; } /* a link to the company, as wide as its name */
.career-role { color: var(--color-text-muted); }
.career-when { font: var(--type-label-meta); letter-spacing: var(--type-label-meta-tracking); color: var(--color-text-muted); }
.career-logo { width: 40px; height: 40px; color: var(--color-text); } /* 8px corners on its hairline tile */
/* Each company's mark in ink inside a hairline tile, like the work tiles' border */
.career-logo__tile { fill: none; stroke: var(--color-border); stroke-width: 1; vector-effect: non-scaling-stroke; }

/* Dot portrait (after bruce-cao.com). Without JavaScript, a screenshot of the dots at rest */
/* The photo fits the window: its height minus an 80px gap above and below, up to the
   photos' own 764px, so a tall window doesn't crop their sides */
.dots-portrait { position: relative; border-radius: var(--radius-l); height: min(100svh - 160px, 764px); min-height: 480px; }
/* The screenshot's own shape (taken at 695 × 740), so it scales whole and none of its
   edge or corner dots are cropped */
:root:not(.js) .dots-portrait { height: auto; min-height: 0; aspect-ratio: 695 / 740; background: url("../assets/about-stefan-dots-light.webp") center / cover no-repeat; }
/* The canvas reaches 80px past the frame all round (like the video's dots), so a stir can
   spread the dots out of it; at rest they fill the frame, rounded in whole dots (home.js) */
.dots-canvas { position: absolute; inset: -80px; width: calc(100% + 160px); height: calc(100% + 160px); pointer-events: none; }

/* Words */
.words {
  display: flex; flex-direction: column; align-items: center; gap: var(--space-24);
  padding: var(--space-35) var(--edge);
  border-top: 1px solid var(--color-border);
}
/* The label over the title, 16px above it (Figma Words "Heading") */
.words-heading { display: grid; justify-items: center; gap: var(--space-4); }

.section-title {
  max-width: 519px; text-align: center;
  font: var(--type-display-m); letter-spacing: var(--type-display-m-tracking);
}
/* After svsd.school: a short serif pull line over a small sans paragraph */
.quotes { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--space-14); width: 100%; align-items: start; }
.quotes li { padding-top: var(--space-8); border-top: 1px solid var(--color-border); }
/* Each quote keeps its own layer, so the fade never strands a sliver of the serif's
   overhanging ink on the page in iOS Safari (home.js fades them) */
.js .quotes li { will-change: opacity, translate; }
.quotes figure { display: grid; gap: var(--space-4); }
/* Side by side, the pull lines, paragraphs and names share rows so they line up across */
@media (min-width: 1024px) {
  .quotes li, .quotes figure { display: grid; grid-row: span 3; grid-template-rows: subgrid; }
}
.pull { font: var(--type-heading-pull); letter-spacing: var(--type-heading-pull-tracking); }
.quotes blockquote { font: var(--type-body-m); color: var(--color-text-muted); }
.quotes figcaption { font: var(--type-body-m); color: var(--color-text-muted); } /* the role */
.who { color: var(--color-text); font-weight: 500; margin-right: var(--space-2); }
/* The sets of quotes (three, or two when stacked) share one spot, as tall as the tallest
   set, so swapping never moves the page; those not showing are hidden and inert (home.js) */
.quotes-wrap { display: grid; justify-items: center; gap: var(--space-14); width: 100%; }
.quote-sets { display: grid; width: 100%; }
.quote-sets > .quotes { grid-area: 1 / 1; }
.quotes.is-off { visibility: hidden; }
/* "More receipts": an ink link like the nav's (12/24, Figma Type/link/nav), with a fine ↻
   that turns once */
.quotes-more {
  display: inline-flex; align-items: center; gap: var(--space-2);
  padding: 0; border: 0; background: none; cursor: pointer;
  font: var(--type-link-nav); color: var(--color-text);
}
.quotes-more__icon { width: 13px; height: 13px; }

/* Contact */
.contact {
  display: flex; flex-direction: column; align-items: center; gap: var(--space-16);
  padding: var(--space-35) var(--edge) var(--space-30);
  text-align: center;
  border-top: 1px solid var(--color-border);
  overflow-x: clip; /* the people run off at the window's edges, without widening the page */
}
.contact-message { position: relative; z-index: 2; display: flex; flex-direction: column; align-items: center; gap: var(--space-5); } /* over the video's dots as they fly in */
/* The label over the title, 16px above it, as in Words */
.contact-heading { display: grid; justify-items: center; gap: var(--space-4); }
.contact-title { max-width: 715px; font: var(--type-display-xl); letter-spacing: var(--type-display-xl-tracking); }
.contact-actions { display: flex; flex-direction: column; align-items: center; gap: var(--space-8); }
.contact-sub { color: var(--color-text-muted); }
.email-btn, .primary-btn {
  display: inline-flex; align-items: center; gap: var(--space-2);
  height: 48px; padding: 0 var(--space-5);
  border-radius: var(--radius-full);
  background: var(--color-text); color: var(--color-bg);
  font: var(--type-body-m); /* like every button */
  text-decoration: none;
  transition: background-color var(--duration-s) var(--ease), scale var(--duration-xs) var(--ease);
}

.contact-buttons { display: flex; flex-wrap: wrap; justify-content: center; gap: var(--space-2); }
/* Secondary button (Figma "Secondary button"): outlined, Type/body/s label, a fine play icon
   that becomes a fine cross while the video is open */
:is(.video-btn, .secondary-btn) {
  display: inline-flex; align-items: center; gap: var(--space-2);
  height: 48px; padding: 0 var(--space-5);
  border: 1px solid var(--color-text); border-radius: var(--radius-full);
  background: var(--color-bg); color: var(--color-text);
  font: var(--type-body-m); /* like every button */
  cursor: pointer;
  transition: background-color var(--duration-s) var(--ease), scale var(--duration-xs) var(--ease);
}
.video-btn.is-open .video-btn__play, .video-btn:not(.is-open) .video-btn__close { display: none; }

/* Fine-line icons, drawn at Plex's stroke weight */
.line-icon {
  flex: none; width: 14px; height: 14px; overflow: visible;
  fill: none; stroke: currentColor; stroke-width: 1.25; stroke-linecap: round; stroke-linejoin: round;
}

/* Video (Figma Contact "Video"): shares the people's spot, so swapping them never moves the page */
/* As on the live site, the people never shrink below 600px wide: on narrower screens the
   row stays centred and runs off both edges (.contact clips it) */
.people-wrap { display: grid; grid-template-columns: minmax(0, 1fr); justify-items: center; min-width: 600px; }
.people, .video-stage { grid-area: 1 / 1; }
.video-stage { display: grid; align-content: start; gap: var(--space-3); width: 65.5%; visibility: hidden; }
.people-wrap.is-video .video-stage { visibility: visible; }
.people-wrap.is-video .people { visibility: hidden; }
/* The video is taller than the people, so its room isn't kept while it's shut: the slot is
   the people's height and eases open when the video comes in, pushing the footer down (home.js) */
.people-wrap:not(.is-video) .video-stage { position: absolute; top: 0; }
.video-box { position: relative; }
.video-frame {
  position: relative; aspect-ratio: 16 / 9; overflow: hidden; isolation: isolate;
  border: 1px solid var(--color-border); border-radius: var(--radius-l);
  background: var(--color-bg-subtle); cursor: pointer;
}
.video-frame video {
  display: block; width: 100%; height: 100%; object-fit: cover;
  border-radius: inherit; /* browsers draw video on its own layer and can ignore the frame's rounded clip */
}
/* The thumbnail rests as dots, with Play over them. Pressing Play solidifies it into the
   video, and the controls fade in after. While the dots form or scatter, the player hides. */
.video-player { position: relative; z-index: 1; }
.video-stage.is-forming .video-player { opacity: 0; }
/* The description link fades in once the dots have formed, and out as they scatter */
.video-desc { transition: opacity .4s ease; }
.people-wrap:not(.is-video) .video-desc, .video-stage.is-forming .video-desc { opacity: 0; }
@media (prefers-reduced-motion: reduce) { .video-desc { transition: none; } }
.video-frame { transition: border-color var(--duration-l) ease, background-color var(--duration-l) ease; }
.video-frame video { transition: opacity var(--duration-l) ease; }
.video-seek, .video-controls { transition: opacity var(--duration-m) ease .3s; }
.video-stage.is-dotted .video-frame { border-color: transparent; background-color: transparent; }
.video-stage.is-dotted .video-frame video { opacity: 0; }
.video-stage.is-dotted :is(.video-seek, .video-controls) { opacity: 0; visibility: hidden; transition: none; }
.video-dots {
  position: absolute; inset: -80px; width: calc(100% + 160px); height: calc(100% + 160px);
  pointer-events: none;
}

/* Before the first play: outlined like the Secondary button, so the email button stays the
   only filled one in Contact */
.video-start {
  position: absolute; top: 50%; left: 50%; z-index: 1; translate: -50% -50%;
  display: inline-flex; align-items: center; gap: var(--space-2);
  height: 48px; padding: 0 var(--space-5);
  border: 1px solid var(--color-text); border-radius: var(--radius-full);
  background: var(--color-bg); color: var(--color-text);
  font: var(--type-body-m); /* like every button */
  cursor: pointer;
  transition: opacity .3s ease, background-color .2s var(--ease), scale .15s var(--ease);
}
/* The length, dimmed, after the label (also on Watch my video, hidden once it's open) */
:is(.video-start__length, .video-btn__length) { opacity: .6; letter-spacing: 0; font-variant-numeric: tabular-nums; }
.video-btn.is-open .video-btn__length { display: none; }
.video-start__length:empty { display: none; }
/* Hover and pressed, the same for every button: filled ones soften a little towards the
   page colour, outlined ones (and the skill pills) take a faint ink tint, and pressing
   pushes them in. No shadows or glow. */
@media (hover: hover) {
  :is(.email-btn, .primary-btn):hover { background-color: color-mix(in srgb, var(--color-text) 84%, var(--color-bg)); }
  :is(.video-btn, .secondary-btn, .video-start, .pill[aria-selected="false"]):hover { background-color: color-mix(in srgb, var(--color-text) 8%, var(--color-bg)); }
  .pill[aria-selected="true"]:hover { background-color: color-mix(in srgb, var(--color-text) 84%, var(--color-bg)); }
}
:is(.email-btn, .primary-btn, .pill[aria-selected="true"]):active { background-color: color-mix(in srgb, var(--color-text) 72%, var(--color-bg)); }
:is(.video-btn, .secondary-btn, .video-start, .pill[aria-selected="false"]):active { background-color: color-mix(in srgb, var(--color-text) 14%, var(--color-bg)); }
:is(.email-btn, .primary-btn, .video-btn, .secondary-btn, .video-start, .pill):active { scale: .96; }
.video-player[data-started] .video-start { opacity: 0; visibility: hidden; transition: opacity .3s ease, visibility 0s .3s; }

/* Under the frame: a hairline that fills as it plays, then one row of quiet text controls */
.video-seek {
  --played: 0%;
  display: block; width: 100%; height: 20px; margin: var(--space-1) 0 0;
  background: none; cursor: pointer; appearance: none; -webkit-appearance: none;
}
.video-seek::-webkit-slider-runnable-track { height: 1px; background: linear-gradient(to right, var(--color-text) var(--played), var(--color-border) var(--played)); }
.video-seek::-moz-range-track { height: 1px; background: linear-gradient(to right, var(--color-text) var(--played), var(--color-border) var(--played)); }
.video-seek::-webkit-slider-thumb { width: 9px; height: 9px; margin-top: calc(-1 * var(--space-1)); border: 0; border-radius: 50%; background: var(--color-text); appearance: none; -webkit-appearance: none; transition: scale var(--duration-xs) ease; }
.video-seek::-moz-range-thumb { width: 9px; height: 9px; border: 0; border-radius: 50%; background: var(--color-text); transition: scale var(--duration-xs) ease; }
.video-seek:active::-webkit-slider-thumb { scale: 1.4; }
.video-seek:active::-moz-range-thumb { scale: 1.4; }
.video-seek:focus-visible { outline: 2px solid var(--color-text); outline-offset: 2px; border-radius: var(--radius-xs); }
.video-controls {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--space-1) var(--space-4);
  font: var(--type-label-meta); letter-spacing: var(--type-label-meta-tracking); /* the video controls stay mono */
  color: var(--color-text-muted);
}
.video-controls__group { display: flex; align-items: center; gap: var(--space-4); }
.vctl {
  display: inline-flex; align-items: center; gap: var(--space-2); min-height: 24px; /* a 24px target (WCAG 2.5.8) */
  padding: 0; border: 0; background: none;
  color: inherit; font: inherit; letter-spacing: inherit;
  cursor: pointer;
}
.vctl[hidden] { display: none; }
/* The audio description toggle: a small dot, filled while it's on */
.vctl--toggle::before { content: ""; width: 5px; height: 5px; border: 1px solid currentColor; border-radius: 50%; }
.vctl--toggle[aria-pressed="true"] { color: var(--color-text); }
.vctl--toggle[aria-pressed="true"]::before { background: currentColor; }
.video-time { font-variant-numeric: tabular-nums; }
/* Full screen: the film always spans the screen's width at 16:9 (its lines reach the frame's
   edge, so a side gap reads as a border), centred, trimmed top and bottom on screens wider
   than 16:9. The controls sit over its foot on a solid bar like the top bar's, and fade away
   while the mouse rests (home.js). No colour fade on the frame, or its grey would show in the
   letterbox for a moment. */
.video-player:fullscreen { background: #000; /* black in both themes, like a cinema */ }
.video-player:fullscreen[data-idle] { cursor: none; }
.video-player:fullscreen .video-frame {
  position: absolute; inset: 0; display: grid; align-content: center; aspect-ratio: auto;
  border: 0; border-radius: 0; background: #000; transition: none;
}
.video-player:fullscreen .video-frame video { height: auto; aspect-ratio: 16 / 9; }
.video-player:fullscreen .video-bar {
  position: absolute; inset: auto 0 0; z-index: 1;
  padding: 0 var(--edge) var(--space-2); background: var(--color-bg);
  transition: opacity .3s ease, visibility 0s;
}
.video-player:fullscreen[data-idle] .video-bar { opacity: 0; visibility: hidden; transition: opacity .3s ease, visibility 0s .3s; }
@media (prefers-reduced-motion: reduce) { .video-player:fullscreen .video-bar, .video-player:fullscreen[data-idle] .video-bar { transition: none; } }

/* Video description: a muted link like the nav's (12px, underline on hover), led by a fine
   + like the site's other icons. Opening it turns the + 's upright stroke flat into a −, with
   the career rows' easing */
.video-desc { font: var(--type-body-m); }
.video-desc summary {
  display: flex; align-items: center; gap: var(--space-2); width: fit-content; margin: 0 auto;
  font: var(--type-link-nav); /* like the nav links */
  color: var(--color-text-muted); cursor: pointer; list-style: none;
}
.video-desc summary::-webkit-details-marker { display: none; }
.fold-icon { width: 13px; height: 13px; }
.fold-icon__bar { transform-box: view-box; transform-origin: 8px 8px; transition: rotate var(--duration-m) var(--ease-fold); }
.video-desc.is-open .fold-icon__bar { rotate: 90deg; }
.video-desc__body { display: grid; gap: var(--space-2); padding-top: var(--space-5); color: var(--color-text-muted); text-align: left; }
.video-desc__body strong { color: var(--color-text); font-weight: 500; }
.video-desc__body strong:first-child { display: block; }
.video-desc__body ul { display: grid; gap: var(--space-1); margin: 0; padding: 0; list-style: none; }
@media (prefers-reduced-motion: reduce) { .fold-icon__bar, .video-start { transition: none; } }

/* People drawing: eight figures in an 889-high strip, cut at the waist (Figma Image / People) */
.people-wrap { position: relative; width: min(760px, 100%); }
.people { position: relative; width: 100%; aspect-ratio: 2699 / 889; }
.people-stage { position: absolute; inset: 0; }
.person {
  position: absolute; top: 0;
  left: var(--left); width: var(--width); height: 100%;
  transform-origin: var(--origin);
  -webkit-tap-highlight-color: transparent;
}
.person svg { display: block; width: 100%; height: 100%; overflow: visible; transform-origin: 50% 90%; }
.person__line, .hero-doodle .line { fill: var(--color-text-muted); }
.person__shade, .hero-doodle .shade { fill: var(--color-illustration-shade); }
.person .person__lip { fill: var(--color-bg); }
.person__pupil { transition: transform .22s cubic-bezier(.3, .7, .4, 1); }
.person__eye, .person__brow, .person__lip { transform-box: fill-box; transform-origin: center; }
.person__brow { transition: transform .3s ease; }

/* The hero head is one drawing on its own, so it isn't placed in a strip */
.hero-doodle.person { position: relative; display: block; left: auto; top: auto; width: 44px; height: 92px; }
/* The hero boy blinks now and then (sometimes twice) and raises his eyebrows on a
   different beat, so the two rarely line up. Paused or Reduce motion: eyes open, still. */
.hero-doodle :is(.eye, .brow) { transform-box: fill-box; transform-origin: center; }
@media (prefers-reduced-motion: no-preference) {
  :root:not([data-motion="paused"]) .hero-doodle .eye { animation: doodle-blink 5.2s ease-in-out 2.4s infinite; }
  :root:not([data-motion="paused"]) .hero-doodle .brow { animation: doodle-brow 7.4s var(--ease) 3.6s infinite; }
}
@keyframes doodle-blink {
  0%, 44%, 47.5%, 92%, 95.5%, 97%, 100% { scale: 1 1; }
  45.5%, 93.5%, 98.5% { scale: 1 .12; }
}
@keyframes doodle-brow {
  0%, 30%, 52%, 100% { translate: 0 0; rotate: 0deg; }
  34%, 46% { translate: 0 -1.6px; rotate: -6deg; }
}

/* Speech bubble: pops out of the 4th person while they're hovered or tapped (and once,
   on its own, when the people first come into view), saying "Watch the video".
   Tail tip lands just above their head (45% across, 24.8% down the drawing).
   A quarter bigger than the drawing's 10.937%, to fit two lines. */
.speech-bubble {
  --tip-x: 45.165%;
  --tip-y: 24.8%;
  --bubble-w: 13.7%;
  position: absolute;
  left: calc(var(--tip-x) - var(--bubble-w) * .827);
  bottom: calc(100% - var(--tip-y));
  width: var(--bubble-w);
  overflow: visible; pointer-events: none;
  opacity: 0;
  transform: scale(.3) rotate(-8deg); transform-origin: 82.7% 100%;
  /* Going, the coming-in spring played backwards: a little swell, then it shrinks and tips
     back into the head, fading only at the very end */
  transition: opacity .12s ease .33s, transform .45s cubic-bezier(.36, 0, .66, -.56);
}
.speech-bubble__fill { fill: var(--color-bg); }
.speech-bubble__line { fill: var(--color-text-muted); stroke: var(--color-text-muted); stroke-width: 1.8; stroke-linejoin: round; }
.speech-bubble__text { fill: var(--color-text-muted); font: 500 13px var(--mono); letter-spacing: .04em; } /* in viewBox units, so it grows with the bubble */
.people-wrap.is-talking .speech-bubble {
  opacity: 1; transform: none;
  transition: opacity .12s ease, transform .45s var(--ease-pop);
}
@media (hover: hover) {
  .people-wrap:has(.person:nth-child(4):hover) .speech-bubble {
    opacity: 1; transform: none;
    transition: opacity .12s ease, transform .45s var(--ease-pop);
  }
}
/* Reduce motion or paused animations: the bubble just fades in and out, without the spring */
@media (prefers-reduced-motion: reduce) {
  .people-wrap .speech-bubble { transform: none; transition: opacity .15s ease; }
}
:root[data-motion="paused"] .people-wrap .speech-bubble { transform: none; transition: opacity .15s ease; }

/* Drawings' life, as on the live site: they pop up when they first come on screen,
   each has its own idle loop, someone random hops every few seconds, a hover (or tap)
   makes them jump. Pausing holds every pose; Reduce motion keeps them still. */
:root[data-motion="paused"] .person { animation: var(--idle-loop); animation-play-state: paused; }
@media (prefers-reduced-motion: no-preference) {
  .person {
    --idle-loop: var(--idle) ease-in-out var(--delay, 0s) infinite;
    animation: var(--idle-loop);
  }
  .people:not(.is-settled) .person {
    animation: var(--idle-loop), person-enter .75s cubic-bezier(.3, .7, .4, 1) calc(.3s + var(--enter, 0s)) backwards;
  }
  /* The hero boy fades in over the whole rise, not just its start */
  .hero:not(.is-settled) .hero-doodle {
    animation: var(--idle-loop), person-enter .75s cubic-bezier(.3, .7, .4, 1) .3s backwards, doodle-fade .7s ease-out .3s backwards;
  }
  /* The people wait below their frame until they scroll into view */
  .people:not(.is-shown) .person { animation-play-state: paused; }
  .hero-doodle { --idle: person-sway 4.6s; --enter: 0s; }
  .people-stage .person:nth-child(1) { --idle: person-sway 4.2s; --enter: .12s; }
  .people-stage .person:nth-child(2) { --idle: person-bob 3.4s; --delay: -1.7s; --enter: .3s; }
  .people-stage .person:nth-child(3) { --idle: person-breathe 3.1s; --delay: -1.2s; --enter: 0s; }
  .people-stage .person:nth-child(4) { --idle: person-lean 6.1s; --delay: .8s; --enter: .2s; }
  .people-stage .person:nth-child(5) { --idle: person-breathe 3.6s; --delay: -2.9s; --enter: .36s; }
  .people-stage .person:nth-child(6) { --idle: person-sway 5.7s; --delay: -2.1s; --enter: .06s; }
  .people-stage .person:nth-child(7) { --idle: person-bob 2.9s; --delay: -.6s; --enter: .26s; }
  .people-stage .person:nth-child(8) { --idle: person-breathe 3.7s; --delay: -2.4s; --enter: .16s; }
  .person.is-hopping { animation: var(--idle-loop), person-hop .9s ease-in-out; }
  .person.is-jumping { animation: var(--idle-loop), person-jump .6s ease-out; }
  @media (hover: hover) {
    .person:hover { animation: var(--idle-loop), person-jump .6s ease-out; }
  }
  .person__eye.is-blinking { animation: person-blink .18s ease-in-out; }
  .person.is-surprised .person__brow { transform: translateY(-9px); }
  :root:not([data-motion="paused"]) .people-wrap.is-talking .person__lip--bottom { animation: person-talk .16s ease-in-out infinite alternate; }
  :root:not([data-motion="paused"]) .people-wrap.is-talking .person__lip--top { animation: person-talk-top .16s ease-in-out infinite alternate; }
  @media (hover: hover) {
    :root:not([data-motion="paused"]) .people-wrap:has(.person:nth-child(4):hover) .person__lip--bottom { animation: person-talk .16s ease-in-out infinite alternate; }
    :root:not([data-motion="paused"]) .people-wrap:has(.person:nth-child(4):hover) .person__lip--top { animation: person-talk-top .16s ease-in-out infinite alternate; }
  }
}
@keyframes person-sway { 0%, 100% { transform: rotate(-1.5deg); } 50% { transform: rotate(1.5deg); } }
@keyframes person-breathe { 0%, 100% { transform: scale(1, 1); } 50% { transform: scale(1.015, 1.03); } }
@keyframes person-bob { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-1.2%); } }
@keyframes person-lean { 0%, 60%, 100% { transform: rotate(0); } 20%, 40% { transform: rotate(-2.5deg); } }
@keyframes person-enter {
  0% { translate: 0 100%; scale: 1 1; opacity: 0; }
  20% { opacity: 1; }
  65% { translate: 0 -3%; scale: .98 1.03; }
  85% { translate: 0 0; scale: 1.02 .98; }
  100% { translate: 0 0; scale: 1 1; }
}
@keyframes doodle-fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes person-hop {
  0%, 100% { translate: 0 0; scale: 1 1; }
  20% { translate: 0 0; scale: 1.04 .96; }
  50% { translate: 0 -4%; scale: .98 1.03; }
  80% { translate: 0 0; scale: 1.03 .97; }
}
@keyframes person-jump {
  0%, 100% { translate: 0 0; scale: 1 1; }
  15% { translate: 0 0; scale: 1.05 .95; }
  45% { translate: 0 -7%; scale: .97 1.04; }
  80% { translate: 0 0; scale: 1.04 .96; }
}
@keyframes person-blink { 0%, 100% { transform: scaleY(1); } 50% { transform: scaleY(.1); } }
@keyframes person-talk { from { transform: translateY(0); } to { transform: translateY(7px); } }
@keyframes person-talk-top { from { transform: translateY(0); } to { transform: translateY(-2px); } }

/* Footer */
.foot {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--space-2) var(--space-6);
  padding: var(--space-6) var(--edge);
  font: var(--type-body-s); color: var(--color-text-muted);
}
.foot-controls { grid-column: 1 / -1; justify-self: center; display: flex; gap: var(--space-2); margin-top: var(--space-4); }
/* The day, live time and place, said as a terminal would (home: typed in, fun.js) */
.foot .foot-date {
  grid-column: 1 / -1; justify-self: center; text-align: center; margin-top: var(--space-1);
  font: var(--type-label-meta); letter-spacing: var(--type-label-meta-tracking); white-space: nowrap;
}
.foot-date [data-type]:first-child { color: var(--color-text); }
.foot-date .clock { font-variant-numeric: tabular-nums; }
/* Desktop, in the same order as phones: what the site is and where I am across the top
   (the sentences left and centre, the date right), then the controls, then the copyright */
@media (min-width: 768px) {
  .foot p:nth-child(2) { grid-area: 1 / 1; }
  .foot p:nth-child(3) { grid-area: 1 / 2; text-align: center; }
  .foot .foot-date { grid-area: 1 / 3; justify-self: end; text-align: right; margin-top: -1px; } /* on the sentences' baseline */
  .foot-controls { grid-row: 2; }
  .foot p:nth-child(1) { grid-area: 3 / 1 / 4 / -1; justify-self: center; margin-top: var(--space-2); }
}

/* Tablet (M, L): the same layout with narrower columns */
@media (max-width: 1279px) {
  .about { grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); }
  .pull { font-size: 24px; line-height: 28px; }
}

/* M: one quote per row, the pull line beside its paragraph */
@media (min-width: 768px) and (max-width: 1023px) {
  .quotes { grid-template-columns: 1fr; gap: var(--space-12); }
  .quotes figure { grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); column-gap: var(--space-10); }
  .pull { grid-row: 1 / 3; }
}

/* Small screens without a mouse (phones) don't stir the dots, so the portrait's canvas is
   just the frame and nothing reaches over the section above. With a mouse it keeps the
   room to stir at any width. */
@media (max-width: 767px) and (hover: none), (max-width: 767px) and (pointer: coarse) {
  .dots-canvas { inset: 0; width: 100%; height: 100%; }
}
/* Mobile (XS + S, under 768px): text runs the full width. Safari's pretty/balance wrapping
   evens out every line, so copy stopped well short of the edge; the desktop measures go too. */
@media screen and (max-width: 767px) {
  * { text-wrap-style: auto !important; } /* over every page's pretty/balance, the CV's too; the style only, so nowrap text stays on one line */
  /* …except the big serif headings, which keep their even lines */
  .statement-text, .case-title, .chapter-title, .case-quote blockquote, .case-cta__title { text-wrap-style: balance !important; }
  .work-desc, .skill-desc, .section-title, .statement-text, .contact-title { max-width: none; } /* project.css does its own */
}
@media (max-width: 767px) {
  .top-links, .top-end { display: none; }
  .top { grid-template-columns: auto 1fr; }
  .menu-btn { display: inline-flex; justify-self: end; }
  .top-end { gap: 14px; }
  .work { padding-bottom: var(--space-30); }
  .work-list { gap: var(--space-14); }
  .work-art { border-radius: var(--radius-m); aspect-ratio: 4 / 3; } /* taller, so the art isn't a thin strip and has room round it */
  .work-art--multi { --still: url("../assets/work-multi-dots-phone-light.webp"); }
  .work-art--debug { --still: url("../assets/work-debug-dots-phone-light.webp"); }
  .work-art--plusnet { --still: url("../assets/work-plusnet-dots-phone-light.webp"); }
  .work-art--ai { --still: url("../assets/work-ai-dots-phone-light.webp"); }
  [data-theme="dark"] .work-art--multi { --still: url("../assets/work-multi-dots-phone-dark.webp"); }
  [data-theme="dark"] .work-art--debug { --still: url("../assets/work-debug-dots-phone-dark.webp"); }
  [data-theme="dark"] .work-art--plusnet { --still: url("../assets/work-plusnet-dots-phone-dark.webp"); }
  [data-theme="dark"] .work-art--ai { --still: url("../assets/work-ai-dots-phone-dark.webp"); }
  /* The line above, as on desktop; then the tag over the title, the stat beside both, then the description */
  .work-meta { grid-template-columns: 1fr auto; align-items: baseline; padding: var(--space-4) 0; }
  .work-desc { grid-column: 1 / -1; }
  .work-stat { grid-row: 1 / span 2; grid-column: 2; align-self: start; gap: var(--space-1); } /* the number and label sit at the top of the row, level with the tag */
  .statement { padding: var(--space-30) var(--edge); }
  .about { grid-template-columns: 1fr; row-gap: var(--space-12); padding-top: var(--space-30); padding-bottom: var(--space-30); }
  .dots-portrait { height: auto; min-height: 0; aspect-ratio: 695 / 764; }
  :root:not(.js) .dots-portrait { aspect-ratio: 695 / 764; background-image: url("../assets/about-stefan-dots-phone-light.webp"); }
  .career li { grid-template-columns: 1fr 40px; row-gap: 0; } /* the dates sit straight under the role (Figma Narrow) */
  .career-when { grid-column: 1; grid-row: 2; }
  .career-logo { grid-column: 2; grid-row: 1 / 3; }
  .words { gap: var(--space-12); padding-top: var(--space-30); padding-bottom: var(--space-30); }
  .quotes-wrap { gap: var(--space-10); }
  .quotes { grid-template-columns: 1fr; gap: var(--space-10); }
  .pull { font-size: 22px; line-height: 26px; }
  .contact { padding-top: var(--space-30); padding-bottom: var(--space-30); gap: var(--space-12); }
  .video-stage { width: calc(100vw - 2 * var(--gutter)); } /* the screen's width, not the wider people row's */
  /* Footer, centred: the two lines in Plex Sans, then the © and the place in mono labels
     (like "My career"), then the theme and pause buttons */
  .foot { grid-template-columns: 1fr; justify-items: center; gap: var(--space-1); padding: var(--space-8) var(--edge) var(--space-10); }
  .foot p:nth-child(n) { text-align: center; }
  .foot .foot-date { order: 1; margin-top: var(--space-5); }
  .foot p:nth-child(1) { order: 3; margin-top: var(--space-5); } /* the copyright closes the page, under the controls */
  .foot-date__sep { display: none; } /* the place takes its own line */
  .foot-date__place { display: block; }
  .foot-controls { order: 2; justify-self: center; margin-top: var(--space-5); }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition-duration: .01ms !important; }
  .hero-intro, .hero-name, .nf-art, .nf-text { opacity: 1; translate: 0; }
}
/* Pause animations goes as far as Reduce motion: no smooth scrolling, and hover fills,
   fades and the menu icon change at once */
:root[data-motion="paused"] { scroll-behavior: auto; }
:root[data-motion="paused"] *, :root[data-motion="paused"] *::before, :root[data-motion="paused"] *::after { transition-duration: .01ms !important; }
:root[data-motion="paused"] :is(.hero-intro, .hero-name, .nf-art, .nf-text) { opacity: 1; translate: 0; }

/* Links highlight on hover (and keyboard focus) like the hero's "users": an ink fill
   sweeps across from the left, the way selecting text does, the words turn to the page
   colour, and an underline draws across with the fill, in step. The underline is a 1px
   background line --ul up from the bottom, where the text's own underline would sit.
   With Reduce motion on it simply appears. */
.top a:not(.top-home), .work-title, .vctl, .video-desc summary, .career-co, .quotes-more, .menu-btn, .menu-links a, .sys-index a, .foot-link {
  --ul: 4px;
  background:
    linear-gradient(var(--color-bg), var(--color-bg)) left 0 bottom var(--ul) / 0 1px no-repeat,
    linear-gradient(var(--color-text), var(--color-text)) left / 0 100% no-repeat;
  transition: background-size var(--duration-m) var(--ease), color var(--duration-s) var(--ease);
}
.work-title { --ul: 1px; } /* 14px text on 20px lines sits lower in its box */
/* The footer's link: muted and plain until hovered or focused, then the same ink sweep. It
   sits in a sentence on 18px lines, so an invisible 4px above and below makes it a 24px
   target (WCAG 2.5.8) without spacing the line out. */
.foot-link { position: relative; --ul: 1px; color: var(--color-text-muted); text-decoration: none; }
.foot-link::after { content: ""; position: absolute; inset: -4px 0; }
.career-co { --ul: 2px; }
/* A fine ↗ after each company name: it opens their site in a new tab (Plex has no ↗, so it's drawn) */
.career-co { display: inline-flex; align-items: center; gap: 3px; }
.career-co__arrow { width: 13px; height: 13px; }
:is(.top a:not(.top-home), .vctl, .video-desc summary, .career-co, .quotes-more, .menu-btn, .menu-links a, .sys-index a, .foot-link):focus-visible,
.work-link:focus-visible .work-title,
.career li.is-active .career-co { /* the whole row: hovered or focused (home.js) */
  background-size: 100% 1px, 100% 100%;
  color: var(--color-bg);
}
/* Hover only where there's a real pointer: on phones and tablets a tap would leave it stuck on */
@media (hover: hover) {
  :is(.top a:not(.top-home), .vctl, .video-desc summary, .career-co, .quotes-more, .menu-btn, .menu-links a, .sys-index a, .foot-link):hover,
  .work-link:hover .work-title {
    background-size: 100% 1px, 100% 100%;
    color: var(--color-bg);
  }
}
@media (prefers-reduced-motion: reduce) {
  .top a:not(.top-home), .work-title, .vctl, .video-desc summary, .career-co, .quotes-more, .menu-btn, .menu-links a, .sys-index a, .foot-link { transition: none; }
  .menu-btn__icon { transition: none; }
}

/* ---------- Code fun (on trial, js/fun.js) ----------
   The 404's terminal voice in three quiet places (the fifth is a note in the browser
   console). Plex Mono 12/20 at 4% (Figma Type/label/meta), muted, ink where it's typed.
   Each line holds its room from the start, so nothing moves while it types. */
.foot-date.is-waiting { visibility: hidden; }
.foot-date.is-typing :is(.key:not(.is-typed), [data-type="out"]:not(.is-typed)) { visibility: hidden; }
:is(.foot-date, .copy-reply) .caret::after { top: -11px; height: 13px; }

/* 3. Hero: the diff of the edit, under the line, for a moment */
.hero-intro { position: relative; }
.hero-diff {
  position: absolute; left: 50%; top: calc(100% - 69px); translate: -50% 4px; /* 12px under the words (the intro has 81px below them) */
  display: flex; gap: var(--space-4); white-space: nowrap;
  font: var(--type-label-meta); letter-spacing: var(--type-label-meta-tracking);
  opacity: 0; transition: opacity var(--duration-l) var(--ease), translate var(--duration-l) var(--ease);
}
.hero-diff.is-shown { opacity: 1; translate: -50% 0; }
.hero-diff__del { color: var(--color-text-muted); }
.hero-diff__add { color: var(--color-text); }

/* 5. Email: "$ copied" right under whatever was pressed (the email button, the Message
   link, or the Menu button on phones), the same in each place; fun.js lines it up */
.contact-actions { position: relative; }
.copy-reply {
  position: absolute; left: 50%; top: calc(100% + 6px); translate: -50% 4px;
  padding: 0 var(--space-2); border-radius: var(--radius-full);
  background: var(--color-bg);
  font: var(--type-label-meta); letter-spacing: var(--type-label-meta-tracking); color: var(--color-text-muted); white-space: nowrap;
  pointer-events: none;
  opacity: 0; transition: opacity .3s var(--ease), translate .3s var(--ease);
}
.copy-reply.is-shown { opacity: 1; translate: -50% 0; }

/* ---------- On scroll, every page (site.js) ----------
   Headings, text, lists and cards fade up, one after another, as they reach the screen.
   Only what starts below the screen plays, once; each keeps its room from the start, so
   nothing around it moves. Reduce motion or paused: all simply there. */
.reveal { opacity: 0; transform: translateY(24px); transition: opacity var(--duration-xl) var(--reveal-ease) var(--reveal-delay, 0s), transform var(--duration-xl) var(--reveal-ease) var(--reveal-delay, 0s); }
.reveal.is-in { opacity: 1; transform: none; }
/* The career rows' own transition (their hover slide) would otherwise replace the fade's */
.career li.reveal { transition: opacity var(--duration-xl) var(--reveal-ease) var(--reveal-delay, 0s), transform var(--duration-xl) var(--reveal-ease) var(--reveal-delay, 0s), translate var(--duration-m) var(--ease-fold); }

@media print {
  .reveal { opacity: 1 !important; transform: none !important; }
}
