/* =========================================================
   Fonts (self-hosted, latin subset, variable weight)
   ========================================================= */
@font-face {
  font-family: 'Inter';
  src: url('../assets/fonts/inter.woff2') format('woff2');
  font-weight: 400 600;
  font-display: swap;
}

@font-face {
  font-family: 'Inter Tight';
  src: url('../assets/fonts/inter-tight.woff2') format('woff2');
  font-weight: 500 700;
  font-display: swap;
}

@font-face {
  font-family: 'JetBrains Mono';
  src: url('../assets/fonts/jetbrains-mono.woff2') format('woff2');
  font-weight: 400 500;
  font-display: swap;
}

/* =========================================================
   Design tokens
   ========================================================= */
@property --accent {
  syntax: '<color>';
  inherits: true;
  initial-value: #2563eb;
}

/* How much of the current identity colour tints the page background */
@property --tint {
  syntax: '<percentage>';
  inherits: true;
  initial-value: 4%;
}

:root {
  --bg: #fafaf9;
  --surface: #ffffff;
  --text: #0c0c0d;
  --text-muted: #6b6b73;
  --text-faint: #a3a3ab;
  --line: #e7e5e4;

  --accent: #2563eb; /* switched per identity by JS */
  --accent-soft: color-mix(in srgb, var(--accent) 14%, transparent);

  --font-display: 'Inter Tight', 'Inter', system-ui, sans-serif;
  --font-body: 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, Consolas, monospace;

  --radius-lg: 28px;
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-in-out: cubic-bezier(0.65, 0, 0.35, 1);

  --role-duration: 5200ms; /* how long each identity stays */
  --container: 1200px;

  /* the page itself takes a faint tint of whichever identity is being read */
  --page: color-mix(in srgb, var(--accent) var(--tint), var(--bg));

  /* The identity colour fades only on the few elements where the change is seen (.hero__name and .nav; the aurora cross-fades two layers instead).
     Fading it on :root, or on the whole .hero, re-styles that entire subtree every frame and drops frames. */
  --accent-ease: --accent 0.9s var(--ease-in-out), --tint 0.9s var(--ease-in-out);
}

.hero__name {
  transition: var(--accent-ease);
}

/* =========================================================
   Base
   ========================================================= */
*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--page);
  transition: background-color 0.9s var(--ease-in-out); /* the page tint follows the identity colour */
  color: var(--text);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

a {
  color: inherit;
  text-decoration: none;
}

img {
  display: block;
  max-width: 100%;
}

::selection {
  background: var(--accent);
  color: #fff;
}

.container {
  width: 100%;
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 32px;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

/* =========================================================
   Navigation
   ========================================================= */
.nav {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 50;
  transition: background-color 0.3s, box-shadow 0.3s, backdrop-filter 0.3s, var(--accent-ease);
}

.nav.is-scrolled {
  background: color-mix(in srgb, var(--page) 78%, transparent);
  backdrop-filter: saturate(160%) blur(14px);
  -webkit-backdrop-filter: saturate(160%) blur(14px);
  box-shadow: 0 1px 0 var(--line);
}

.nav__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 72px;
}

.logo {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.35rem;
  letter-spacing: -0.03em;
}

.logo__dot {
  color: var(--accent);
}

.nav__links {
  display: flex;
  gap: 36px;
  font-size: 0.925rem;
  color: var(--text-muted);
}

.nav__links a {
  position: relative;
  transition: color 0.2s;
}

.nav__links a::after {
  content: '';
  position: absolute;
  left: 0;
  bottom: -4px;
  width: 100%;
  height: 1.5px;
  background: var(--accent);
  transform: scaleX(0);
  transform-origin: right;
  transition: transform 0.35s var(--ease-out);
}

.nav__links a:hover {
  color: var(--text);
}

.nav__links a:hover::after,
.nav__links a.is-active::after {
  transform: scaleX(1);
  transform-origin: left;
}

/* The section you are reading */
.nav__links a.is-active {
  color: var(--text);
}

/* Light / dark switch */
.nav__links {
  margin-left: auto;
}

.theme-toggle {
  display: grid;
  place-items: center;
  flex: none;
  width: 40px;
  height: 40px;
  margin-left: 24px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
  transition: border-color 0.2s, transform 0.2s;
}

.theme-toggle:hover {
  border-color: var(--accent);
}

.theme-toggle:active {
  transform: translateY(1px);
}

.theme-toggle:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.theme-toggle svg {
  width: 18px;
  height: 18px;
}

.theme-toggle .i-moon,
:root[data-theme='dark'] .theme-toggle .i-sun {
  display: none;
}

:root[data-theme='dark'] .theme-toggle .i-moon {
  display: block;
}

/* Menu button: only on phones */
.nav__toggle {
  display: none;
  position: relative;
  width: 40px;
  height: 40px;
  margin-right: -8px;
  border: 0;
  background: none;
  color: var(--text);
  cursor: pointer;
}

.nav__toggle span {
  position: absolute;
  left: 11px;
  width: 18px;
  height: 1.6px;
  border-radius: 2px;
  background: currentColor;
  transition: transform 0.35s var(--ease-out), top 0.35s var(--ease-out);
}

.nav__toggle span:nth-child(1) { top: 15px; }
.nav__toggle span:nth-child(2) { top: 23px; }

.nav.is-open .nav__toggle span:nth-child(1) { top: 19px; transform: rotate(45deg); }
.nav.is-open .nav__toggle span:nth-child(2) { top: 19px; transform: rotate(-45deg); }

.nav__toggle:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* =========================================================
   Hero
   ========================================================= */
.hero {
  position: relative;
  min-height: 100vh;
  min-height: 100svh;
  display: flex;
  align-items: center;
  padding: 112px 0 96px;
  overflow: hidden;
}

.hero__bg {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.hero__grid {
  position: absolute;
  inset: 0;
  background-image: radial-gradient(circle, #d6d3d1 1px, transparent 1.2px);
  background-size: 28px 28px;
  mask-image: radial-gradient(ellipse 65% 60% at 50% 48%, #000 20%, transparent 75%);
  -webkit-mask-image: radial-gradient(ellipse 65% 60% at 50% 48%, #000 20%, transparent 75%);
  opacity: 0.7;
}

/* ---------- Colour field: fills the hero, fades out at the edges ---------- */
.hero__fx {
  position: absolute;
  inset: 0;
}

/* The field fades into the page at its edges. This is a veil in the page colour on top, not a mask:
   a mask over moving layers makes the browser redraw the whole hero as one offscreen surface every frame. */
.hero__fx::after {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: radial-gradient(ellipse 94% 88% at 50% 50%, transparent 46%, var(--bg) 100%);
}

/* the current identity's colour and its neighbours on the colour wheel */
.hero__aurora {
  --hue-a: var(--accent);
  --hue-b: color-mix(in srgb, var(--accent) 68%, #06b6d4);
  --hue-c: color-mix(in srgb, var(--accent) 68%, #f472b6);
  --hue-d: color-mix(in srgb, var(--accent) 70%, #ffffff);
  position: absolute;
  inset: 0;
  /* Two stacked layers take turns: the one coming in is painted once in its colour, then only its opacity animates */
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.9s var(--ease-in-out), visibility 0s linear 0.9s;
}

.hero__aurora.is-front {
  opacity: 1;
  visibility: visible;
  transition: opacity 0.9s var(--ease-in-out), visibility 0s;
}

@supports (color: oklch(from red l c h)) {
  .hero__aurora {
    --hue-b: oklch(from var(--accent) l c calc(h - 34));
    --hue-c: oklch(from var(--accent) l c calc(h + 38));
    --hue-d: oklch(from var(--accent) calc(l + 0.1) calc(c * 0.8) calc(h + 12));
  }
}

.aurora__blob {
  position: absolute;
  left: var(--x);
  top: var(--y);
  width: max(var(--s), 460px);
  aspect-ratio: 1.15;
  border-radius: 50%;
  translate: -50% -50%;
  background: radial-gradient(closest-side, color-mix(in srgb, var(--bc) 42%, transparent), transparent);
  opacity: 0.55;
  will-change: transform;
  animation: aurora-drift var(--t) ease-in-out var(--dl, 0s) infinite alternate;
}

.b1 { --bc: var(--hue-a); --x: 30%; --y: 40%; --s: 64vw; --t: 26s; --dx: 9vw; --dy: 60px; }
.b2 { --bc: var(--hue-b); --x: 76%; --y: 32%; --s: 56vw; --t: 32s; --dx: -10vw; --dy: 80px; --dl: -9s; }
.b3 { --bc: var(--hue-c); --x: 64%; --y: 80%; --s: 58vw; --t: 29s; --dx: -8vw; --dy: -70px; --dl: -15s; }
.b4 { --bc: var(--hue-d); --x: 18%; --y: 84%; --s: 48vw; --t: 35s; --dx: 12vw; --dy: -50px; --dl: -5s; }

@keyframes aurora-drift {
  0% { transform: translate3d(0, 0, 0) scale(1); }
  50% { transform: translate3d(var(--dx), var(--dy), 0) scale(1.12); }
  100% { transform: translate3d(calc(var(--dx) * -0.7), calc(var(--dy) * -1.1), 0) scale(0.94); }
}

.hero.is-offscreen .aurora__blob {
  animation-play-state: paused;
}

/* the ink wake: drawn by script, soft stamps that fade */
.hero__ink {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0.6;
}

.hero__inner {
  position: relative;
}

/* ---------- Centred text ---------- */
.hero__text {
  --hero-gap: clamp(52px, 9vh, 92px); /* space between the three groups: name, identity, controls */
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  text-align: left;
}

.hero__eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 clamp(14px, 2.4vh, 26px);
  padding: 6px 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: color-mix(in srgb, var(--surface) 70%, transparent);
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--text-muted);
}

.prompt {
  color: var(--accent);
}

.cursor {
  display: inline-block;
  width: 7px;
  height: 1em;
  margin-left: 2px;
  background: var(--text-muted);
  animation: blink 1.1s steps(1) infinite;
}

@keyframes blink {
  50% { opacity: 0; }
}

/* The name is the headline: huge, left-aligned, inked from dark to the identity's colour */
.hero__title {
  margin: 0 0 0 -0.045em; /* optical: the P's stem sits on the text edge */
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(3.4rem, 17vw, 15.5rem);
  line-height: 0.9;
  letter-spacing: -0.06em;
  white-space: nowrap;
}

.hero__name .l {
  display: inline-block;
  white-space: pre;
  /* --b: how far along the name this letter is (0 to 100), --k: how close the pointer is (0 to 1) */
  color: color-mix(in srgb, var(--accent) calc((var(--b, 0) * 0.6 + (100 - var(--b, 0) * 0.6) * var(--k, 0)) * 1%), var(--text));
  transform: translate3d(0, calc(var(--k, 0) * -0.05em), 0);
  will-change: transform;
}

.hero__aka {
  margin: clamp(12px, 2vh, 22px) 0 0;
  font-size: clamp(0.98rem, 1.4vw, 1.1rem);
  color: var(--text-muted);
}

.hero__aka strong {
  color: var(--text);
  font-weight: 600;
}

/* ---------- Rotating role ---------- */
/* Lower row: who I am right now on the left, the controls on the right */
.hero__lower {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 460px);
  align-items: end;
  gap: 24px 64px;
  width: 100%;
  margin-top: var(--hero-gap);
}

.hero__id {
  min-width: 0;
}

.role {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0;
  width: 100%;
}

.role__index {
  font-family: var(--font-display);
  font-size: clamp(1.3rem, 2.4vw, 2rem);
  font-weight: 500;
  letter-spacing: -0.03em;
  color: var(--text-muted);
}

.role__stage {
  position: relative;
  width: 100%;
  height: 1.2em;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(2.1rem, 5.6vw, 4.6rem);
  line-height: 1.2;
  letter-spacing: -0.05em;
  color: var(--accent);
}

.role__word {
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  display: flex;
  justify-content: flex-start;
  white-space: nowrap;
  overflow: hidden;
  padding-bottom: 0.08em; /* keep descenders unclipped */
}

.role__line {
  margin: 4px 0 0;
  font-size: clamp(1.05rem, 1.7vw, 1.3rem);
  color: var(--text-muted);
  transition: opacity 0.25s, transform 0.4s var(--ease-out);
}

.role__line.is-swapping {
  opacity: 0;
  transform: translateY(6px);
}

.char {
  display: inline-block;
  transition:
    transform 0.7s var(--ease-out),
    opacity 0.5s var(--ease-out),
    filter 0.5s var(--ease-out);
  transition-delay: calc(var(--i) * 22ms);
}

.role__word.is-entering .char {
  transform: translateY(105%);
  opacity: 0;
  filter: blur(6px);
  transition: none;
}

.role__word.is-leaving .char {
  transform: translateY(-105%);
  opacity: 0;
  filter: blur(6px);
  transition-duration: 0.45s;
  transition-timing-function: var(--ease-in-out);
  transition-delay: calc(var(--i) * 14ms);
}

@media (max-width: 1080px) {
  .hero__title {
    font-size: 21vw; /* fills the narrower column; the name stays the headline */
  }

  .hero__lower {
    grid-template-columns: minmax(0, 1fr);
    gap: 44px;
  }
}

/* ---------- Progress indicators: one bar per identity, labelled with its verb ---------- */
.progress {
  display: flex;
  gap: 10px;
  width: 100%;
}

/* Bars and the jump button read as one group */
.hero__controls {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 26px;
  width: 100%;
}

.hero__controls .jump {
  margin-top: 0;
}

.progress__item {
  position: relative;
  flex: 1;
  min-width: 0;
  padding: 18px 0 0;
  border: 0;
  background: none;
  cursor: pointer;
  text-align: left;
}

.progress__item::before,
.progress__fill {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  height: 3px;
  border-radius: 3px;
}

.progress__item::before {
  background: var(--line);
  transition: background-color 0.2s;
}

.progress__item:hover::before {
  background: #d6d3d1;
}

.progress__fill {
  background: var(--accent);
  transform: scaleX(0);
  transform-origin: left;
}

.progress__label {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-family: var(--font-mono);
  font-size: 0.74rem;
  letter-spacing: 0.02em;
  color: var(--text-faint);
  transition: color 0.4s;
}

.progress__item:hover .progress__label {
  color: var(--text-muted);
}

.progress__item.is-active .progress__label {
  color: var(--accent);
}

.progress__item.is-done .progress__fill {
  transform: scaleX(1);
}

.progress__item.is-active .progress__fill {
  animation: fill var(--role-duration) linear forwards;
}

.hero.is-paused .progress__item.is-active .progress__fill {
  animation-play-state: paused;
}

@keyframes fill {
  from { transform: scaleX(0); }
  to { transform: scaleX(1); }
}

.progress__item:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 4px;
}

/* ---------- Jump to the current identity's section ---------- */
.jump {
  display: inline-flex;
  align-items: center;
  gap: 16px;
  margin-top: 40px;
  border-radius: 999px;
  color: var(--text);
}

.jump:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 6px;
}

.jump__ring {
  position: relative;
  display: grid;
  place-items: center;
  flex: none;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  border: 1px solid color-mix(in srgb, var(--accent) 35%, transparent);
  background: var(--surface);
  color: var(--accent);
  transition: color 0.3s, border-color 0.3s;
}

/* Accent fill that grows from the centre on hover */
.jump__ring::before {
  content: '';
  position: absolute;
  inset: -1px;
  border-radius: 50%;
  background: var(--accent);
  transform: scale(0);
  transition: transform 0.5s var(--ease-out);
}

/* Soft halo, a quiet "you can click me" */
.jump__ring::after {
  content: '';
  position: absolute;
  inset: -1px;
  border-radius: 50%;
  border: 1px solid var(--accent);
  opacity: 0;
  animation: halo 2.8s var(--ease-out) infinite;
}

@keyframes halo {
  0% { transform: scale(1); opacity: 0.45; }
  70%, 100% { transform: scale(1.45); opacity: 0; }
}

.jump__ring svg {
  position: relative;
  z-index: 1;
}

.jump__arrow {
  animation: nudge 2.8s var(--ease-in-out) infinite;
}

@keyframes nudge {
  0%, 55%, 100% { transform: translateY(0); }
  25% { transform: translateY(3px); }
}

.jump__wait {
  display: none;
}

.jump:hover .jump__ring {
  color: #fff;
  border-color: var(--accent);
}

.jump:hover .jump__ring::before {
  transform: scale(1);
}

.jump__text {
  display: flex;
  flex-direction: column;
  gap: 4px;
  transition: opacity 0.25s, transform 0.3s var(--ease-out);
}

.jump__text.is-swapping {
  opacity: 0;
  transform: translateY(6px);
}

.jump__kicker {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent);
}

.jump__title {
  font-size: 1rem;
  font-weight: 500;
  line-height: 1.3;
}

/* Underline that draws in on hover */
.jump__title span {
  padding-bottom: 2px;
  background: linear-gradient(currentColor, currentColor) 0 100% / 0 1px no-repeat;
  transition: background-size 0.45s var(--ease-out);
}

.jump:hover .jump__title span {
  background-size: 100% 1px;
}

/* Variant that points sideways (to another page) instead of down */
.jump--next .jump__arrow {
  animation-name: nudge-x;
}

@keyframes nudge-x {
  0%, 55%, 100% { transform: translateX(0); }
  25% { transform: translateX(3px); }
}

/* Identity whose section isn't built yet */
.jump.is-disabled {
  pointer-events: none;
}

.jump.is-disabled .jump__ring {
  border: 1px dashed #d6d3d1;
  color: var(--text-muted);
}

.jump.is-disabled .jump__ring::after,
.jump.is-disabled .jump__arrow {
  display: none;
}

.jump.is-disabled .jump__wait {
  display: block;
}

.jump.is-disabled .jump__kicker {
  color: var(--text-faint);
}

.jump.is-disabled .jump__title {
  color: var(--text-muted);
}

/* ---------- Entrance animation ---------- */
.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition:
    opacity 0.9s var(--ease-out),
    transform 0.9s var(--ease-out);
  transition-delay: calc(var(--d, 0) * 110ms + 100ms);
}

.is-loaded .reveal {
  opacity: 1;
  transform: none;
}

/* =========================================================
   Sections (shared)
   Each section sets its own --accent via data-accent (see JS),
   so everything inside picks up the identity's colour.
   ========================================================= */
.section {
  position: relative;
  isolation: isolate;
  overflow-x: clip; /* the headline aura reaches past the container; it must never widen the page */
  padding: 140px 0;
  border-top: 1px solid var(--line);
}

/* A soft, still pool of the section colour behind the first headline */
.section:not(.curious):not(#contact) .block:first-child .section__head {
  position: relative;
}

.section:not(.curious):not(#contact) .block:first-child .section__head::before {
  content: '';
  position: absolute;
  left: -140px;
  top: -150px;
  z-index: -1;
  width: 760px;
  height: 440px;
  background: radial-gradient(closest-side, color-mix(in srgb, var(--accent) 13%, transparent), transparent);
  pointer-events: none;
}

.section__head {
  display: grid;
  grid-template-columns: 1fr minmax(0, 420px);
  align-items: end;
  gap: 32px 64px;
  margin-bottom: 80px;
}

.section__eyebrow {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 0 0 18px;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent);
}

.section__num {
  padding: 3px 8px;
  border-radius: 6px;
  background: var(--accent-soft);
}

.section__title {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(2.4rem, 5vw, 4.2rem);
  line-height: 1;
  letter-spacing: -0.045em;
}

.section__lead {
  margin: 0;
  color: var(--text-muted);
  font-size: 1.15rem;
  line-height: 1.5;
}

.section__lead-em {
  display: block;
  margin-top: 6px;
  text-align: right;
  color: var(--text);
  font-weight: 500;
}

/* ---------- Scroll reveal ---------- */
.fade-up {
  opacity: 0;
  transform: translateY(32px);
  transition:
    opacity 0.9s var(--ease-out),
    transform 0.9s var(--ease-out);
  transition-delay: calc(var(--d, 0) * 100ms);
}

.fade-up.is-in {
  opacity: 1;
  transform: none;
}

/* =========================================================
   Education timeline
   ========================================================= */
.timeline {
  --meta-w: 180px;
  --node-w: 56px;
  --node-y: 38px; /* node height, lined up with the school name */
  position: relative;
}

.timeline__list {
  display: grid;
  gap: 40px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.timeline__rail {
  position: absolute;
  top: var(--node-y);
  bottom: 0;
  left: calc(var(--meta-w) + var(--node-w) / 2 - 1px);
  width: 2px;
  border-radius: 2px;
  background: var(--line);
  overflow: hidden;
}

.timeline__fill {
  position: absolute;
  inset: 0;
  background: linear-gradient(to bottom, var(--accent), color-mix(in srgb, var(--accent) 30%, transparent));
  transform: scaleY(var(--progress, 0));
  transform-origin: top;
}

.tl-item {
  display: grid;
  grid-template-columns: var(--meta-w) var(--node-w) 1fr;
  align-items: start;
}

.tl-item__meta {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 10px;
  padding-top: calc(var(--node-y) - 11px);
  text-align: right;
}

.tl-item__date {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  font-weight: 500;
}

.tl-item__node {
  position: relative;
  justify-self: center;
  width: 14px;
  height: 14px;
  margin-top: calc(var(--node-y) - 7px);
  border-radius: 50%;
  background: var(--page);
  border: 2px solid #d6d3d1;
  transition: border-color 0.5s, background-color 0.5s, transform 0.5s var(--ease-out);
}

.tl-item.is-in .tl-item__node {
  border-color: var(--accent);
  background: var(--accent);
  transform: scale(1.1);
  transition-delay: 0.3s;
}

/* The ongoing item gets a live pulse */
.tl-item.is-current .tl-item__node::after {
  content: '';
  position: absolute;
  inset: -2px;
  border-radius: 50%;
  border: 2px solid var(--accent);
  animation: pulse 2.2s var(--ease-out) infinite;
}

@keyframes pulse {
  from { transform: scale(1); opacity: 0.7; }
  to { transform: scale(2.8); opacity: 0; }
}

/* ---------- Badges ---------- */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 3px 10px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--surface);
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--text-muted);
}

.badge--live {
  border-color: color-mix(in srgb, var(--accent) 30%, transparent);
  background: var(--accent-soft);
  color: var(--accent);
}

.badge__dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
  animation: blink 1.6s ease-in-out infinite;
}

/* ---------- Education card ---------- */
.edu-card {
  position: relative;
  display: flex;
  gap: 24px;
  padding: 28px 32px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: var(--surface);
  box-shadow: 0 1px 2px rgba(12, 12, 13, 0.03);
  transition:
    transform 0.5s var(--ease-out),
    box-shadow 0.5s var(--ease-out),
    border-color 0.3s;
}

.edu-card:hover {
  transform: translateY(-4px);
  border-color: color-mix(in srgb, var(--accent) 35%, var(--line));
  box-shadow: 0 24px 48px -24px color-mix(in srgb, var(--accent) 40%, rgba(12, 12, 13, 0.2));
}

.edu-card__logo {
  flex: none;
  width: 64px;
  height: 64px;
  border-radius: 16px;
  object-fit: contain;
  background: #fff;
  box-shadow: 0 0 0 1px rgba(12, 12, 13, 0.08);
  transition: transform 0.5s var(--ease-out);
}

.edu-card:hover .edu-card__logo {
  transform: rotate(-6deg) scale(1.05);
}

.edu-card__body {
  flex: 1;
  min-width: 0;
}

.edu-card__school {
  margin: 2px 0 0;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.45rem;
  line-height: 1.2;
  letter-spacing: -0.02em;
}

.edu-card__place {
  margin: 4px 0 0;
  font-size: 0.85rem;
  color: var(--text-faint);
}

.edu-card__degree {
  margin: 18px 0 0;
  font-weight: 500;
}

.edu-card__major {
  display: inline-block;
  margin: 10px 0 0;
  padding: 4px 12px;
  border-radius: 8px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 0.9rem;
  font-weight: 500;
}

/* ---------- Stat (GPA) ---------- */
.stat {
  margin-top: 20px;
  max-width: 360px;
}

.stat__row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 10px;
}

.stat__label {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.stat__value {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.9rem;
  line-height: 1;
  letter-spacing: -0.03em;
  color: var(--accent);
  font-variant-numeric: tabular-nums;
}

.stat__max {
  font-size: 1rem;
  font-weight: 500;
  color: var(--text-faint);
}

.stat__bar {
  height: 6px;
  border-radius: 6px;
  background: var(--line);
  overflow: hidden;
}

.stat__bar span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, color-mix(in srgb, var(--accent) 45%, #fff), var(--accent));
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 1.6s var(--ease-out) 0.4s;
}

.is-in .stat__bar span {
  transform: scaleX(var(--p));
}

/* ---------- Honour (Dean's Commendation) ---------- */
.honour {
  margin-top: 24px;
  padding: 18px 20px 16px;
  border: 1px solid color-mix(in srgb, var(--accent) 22%, var(--line));
  border-radius: 16px;
  background: linear-gradient(135deg, var(--accent-soft), transparent 70%);
}

.honour__head {
  display: flex;
  align-items: flex-start;
  gap: 14px;
}

.honour__medal {
  flex: none;
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: var(--accent);
  color: #fff;
  box-shadow: 0 8px 18px -8px var(--accent);
}

.honour__text {
  flex: 1;
  min-width: 0;
}

.honour__title {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.05rem;
  line-height: 1.25;
  letter-spacing: -0.01em;
}

.honour__rule {
  display: inline-block;
  margin-top: 4px;
  font-size: 0.78rem;
  color: var(--text-muted);
  text-decoration: underline;
  text-decoration-color: var(--line);
  text-underline-offset: 3px;
  transition: color 0.25s, text-decoration-color 0.25s;
}

.honour__rule:hover,
.honour__rule:focus-visible {
  color: var(--accent);
  text-decoration-color: var(--accent);
}

.honour__count {
  flex: none;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.9rem;
  line-height: 1;
  letter-spacing: -0.03em;
  color: var(--accent);
  font-variant-numeric: tabular-nums;
}

.honour__list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin: 16px 0 0;
  padding: 0;
  list-style: none;
}

.honour__item {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 12px 14px 12px 18px;
  border-radius: 12px;
  background: var(--surface);
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--accent) 20%, var(--line));
  overflow: hidden;
  opacity: 0;
  transform: translateY(8px);
  transition:
    opacity 0.6s var(--ease-out) calc(0.5s + var(--i) * 0.28s),
    transform 0.7s var(--ease-out) calc(0.5s + var(--i) * 0.28s);
}

/* the accent edge fills in after the pill appears, like a bar completing */
.honour__item::before {
  content: '';
  position: absolute;
  inset: 0 auto 0 0;
  width: 4px;
  background: var(--accent);
  transform: scaleY(0);
  transform-origin: top;
  transition: transform 0.7s var(--ease-out) calc(0.8s + var(--i) * 0.28s);
}

.is-in .honour__item {
  opacity: 1;
  transform: none;
}

.is-in .honour__item::before {
  transform: scaleY(1);
}

.honour__sem {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.honour__gpa {
  font-size: 0.85rem;
  color: var(--text-muted);
}

.honour__gpa b {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.35rem;
  letter-spacing: -0.02em;
  color: var(--text);
  font-variant-numeric: tabular-nums;
}

.honour__note {
  margin: 12px 0 0;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.04em;
  color: var(--text-faint);
}

@media (prefers-reduced-motion: reduce) {
  .honour__item,
  .honour__item::before {
    opacity: 1;
    transform: none;
    transition: none;
  }
}

/* =========================================================
   Blocks — sibling parts of one section (e.g. Student →
   Education, Personal Learning). Same header, same accent.
   ========================================================= */
.block {
  scroll-margin-top: 104px; /* clear the fixed nav when jumped to */
}

.block + .block {
  margin-top: 160px;
}

/* Closing row under a block: a short note + a link onward */
.block__more {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 20px 24px;
  margin-top: 48px;
  padding-top: 32px;
  border-top: 1px solid var(--line);
}

.block__note {
  margin: 0;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--text-muted);
}

.block__note span {
  color: var(--accent);
  font-weight: 500;
}

.block__more .jump {
  margin-top: 0;
}

/* ---------- Certificates ---------- */
.tile-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 28px;
}

.tile {
  display: flex;
  flex-direction: column;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: var(--surface);
  overflow: hidden;
  box-shadow: 0 1px 2px rgba(12, 12, 13, 0.03);
  transition:
    transform 0.5s var(--ease-out),
    box-shadow 0.5s var(--ease-out),
    border-color 0.3s;
}

.tile:hover {
  transform: translateY(-4px);
  border-color: color-mix(in srgb, var(--accent) 35%, var(--line));
  box-shadow: 0 28px 56px -28px color-mix(in srgb, var(--accent) 45%, rgba(12, 12, 13, 0.25));
}

.tile__media {
  display: block;
  width: 100%;
  aspect-ratio: 1.41 / 1; /* landscape A4 / letter */
  padding: 0;
  border: 0;
  border-bottom: 1px solid var(--line);
  background: #fff;
  overflow: hidden;
  cursor: zoom-in;
}

.tile__media img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  transition: transform 0.8s var(--ease-out);
}

.tile:hover .tile__media img {
  transform: scale(1.03);
}

.tile__media:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: -4px;
}

.tile__footer {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 14px 16px;
  margin-top: auto;
  padding: 20px 24px 22px;
}

.tile__info {
  min-width: 0;
}

.tile__title {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.15rem;
  line-height: 1.3;
  letter-spacing: -0.02em;
}

.tile__issuer {
  margin: 4px 0 0;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--text-muted);
}

.tile__btn {
  flex: none;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  border: 1px solid color-mix(in srgb, var(--accent) 30%, transparent);
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 0.85rem;
  font-weight: 500;
  white-space: nowrap;
  transition: background-color 0.25s, border-color 0.25s, color 0.25s;
}

/* External-link icon, tinted with the text colour */
.tile__btn::before {
  content: '';
  width: 14px;
  height: 14px;
  background: currentColor;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M15 3h6v6M10 14 21 3M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6'/%3E%3C/svg%3E") center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M15 3h6v6M10 14 21 3M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6'/%3E%3C/svg%3E") center / contain no-repeat;
}

.tile__btn:hover {
  border-color: var(--accent);
  background: var(--accent);
  color: #fff;
}

.tile__btn:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

/* ---------- Tiles with a text body (projects) ---------- */
.tile__body {
  padding: 20px 24px 0;
}

.tile__desc {
  margin: 6px 0 0;
  color: var(--text-muted);
  font-size: 0.95rem;
  line-height: 1.55;
}

.tile__body + .tile__footer {
  padding-top: 16px;
}

.tile__footer > .tile__issuer {
  margin: 0;
}

/* ---------- Architecture diagrams (inline SVG inside a tile) ---------- */
.tile__media--diagram {
  cursor: default;
  background:
    radial-gradient(circle, color-mix(in srgb, var(--accent) 18%, transparent) 1px, transparent 1.2px) 0 0 / 22px 22px,
    color-mix(in srgb, var(--accent) 3%, #fff);
}

.diagram {
  display: block;
  width: 100%;
  height: 100%;
}

/* Dashes march along each connection, like data moving through the system */
.diagram .edge {
  fill: none;
  stroke: color-mix(in srgb, var(--accent) 60%, transparent);
  stroke-width: 1.5;
  stroke-dasharray: 5 6;
  animation: flow 1.4s linear infinite;
}

@keyframes flow {
  to { stroke-dashoffset: -22; }
}

.diagram .node {
  opacity: 0;
  transform: translateY(8px);
  transform-box: fill-box;
  transition:
    opacity 0.7s var(--ease-out),
    transform 0.7s var(--ease-out);
  transition-delay: calc(var(--i, 0) * 110ms + 250ms);
}

.is-in .diagram .node {
  opacity: 1;
  transform: none;
}

.diagram .node > rect:first-child {
  fill: var(--surface);
  stroke: color-mix(in srgb, var(--accent) 40%, var(--line));
  stroke-width: 1.2;
  transition: fill 0.25s, stroke 0.25s;
}

.diagram .node:hover > rect:first-child {
  fill: color-mix(in srgb, var(--accent) 10%, #fff);
  stroke: var(--accent);
}

.diagram .node__label {
  font-family: var(--font-display);
  font-size: 13px;
  font-weight: 600;
  fill: var(--text);
  text-anchor: middle;
}

.diagram .node__sub {
  font-family: var(--font-mono);
  font-size: 10px;
  fill: var(--text-muted);
  text-anchor: middle;
}

.diagram .edge__label {
  font-family: var(--font-mono);
  font-size: 10px;
  fill: var(--accent);
  text-anchor: middle;
  paint-order: stroke;
  stroke: #fff;
  stroke-width: 4px;
}

/* Empty slot: dashed boxes with grey bars where labels will go */
.diagram--empty .node > rect:first-child {
  stroke-dasharray: 4 4;
}

.diagram .node__bar {
  fill: color-mix(in srgb, var(--accent) 22%, var(--line));
}

.diagram .node__bar--sub {
  fill: var(--line);
}

.diagram__note {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.2em;
  fill: color-mix(in srgb, var(--accent) 55%, transparent);
  text-anchor: middle;
}

/* =========================================================
   Tech tags — small pills used on project cards and notes
   ========================================================= */
.tech {
  padding: 5px 12px;
  border: 1px solid transparent;
  border-radius: 8px;
  font-size: 0.875rem;
  font-weight: 500;
  line-height: 1.4;
}

.tech.is-familiar {
  border-color: var(--line);
  background: var(--surface);
  color: var(--text);
}

/* =========================================================
   Engineering with AI — workflow strip + principles
   ========================================================= */
.flow {
  display: flex;
  align-items: center;
}

.flow__step {
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex: none;
  min-width: 128px;
  padding: 14px 20px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--surface);
}

.flow__who {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-faint);
}

.flow__label {
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 600;
  letter-spacing: -0.02em;
}

/* The one step handed to agents */
.flow__step.is-agent {
  border-color: color-mix(in srgb, var(--accent) 35%, transparent);
  background: var(--accent-soft);
}

.flow__step.is-agent .flow__who,
.flow__step.is-agent .flow__label {
  color: var(--accent);
}

.flow__link {
  position: relative;
  flex: 1;
  min-width: 16px;
  height: 2px;
  overflow: hidden;
}

/* The dashes sit on a layer one tile (22px) wider than the link, which slides by exactly one tile.
   Same motion as animating background-position, but a transform runs on the compositor
   instead of repainting the strip on every frame. */
.flow__link::before {
  content: '';
  position: absolute;
  inset: 0 0 0 -22px;
  background: repeating-linear-gradient(
    90deg,
    color-mix(in srgb, var(--accent) 75%, transparent) 0 5px,
    transparent 5px 11px
  );
  background-size: 22px 100%;
  animation: flow-x 1.4s linear infinite;
}

@keyframes flow-x {
  to { transform: translateX(22px); }
}

.flow__caption {
  margin: 20px 0 56px;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--text-muted);
}

.strips__intro {
  margin: 0 0 28px;
}

.strips__label {
  margin: 0 0 10px;
  font-family: var(--font-mono);
  font-size: 0.74rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--accent);
}

.strips__lead {
  max-width: 62ch;
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(1.15rem, 1.7vw, 1.4rem);
  font-weight: 500;
  line-height: 1.4;
  letter-spacing: -0.02em;
  text-wrap: balance;
}

/* Two wide strips for open-source projects: text on the left, links on the right */
.strips {
  display: grid;
  gap: 20px;
}

.strip {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 24px 48px;
  padding: 26px 36px 28px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: var(--surface);
  box-shadow: 0 1px 2px rgba(12, 12, 13, 0.03);
  transition:
    transform 0.5s var(--ease-out),
    box-shadow 0.5s var(--ease-out),
    border-color 0.3s;
}

.strip:hover {
  transform: translateY(-4px);
  border-color: color-mix(in srgb, var(--accent) 35%, var(--line));
  box-shadow: 0 28px 56px -28px color-mix(in srgb, var(--accent) 45%, rgba(12, 12, 13, 0.25));
}

.strip__kicker {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin: 0 0 12px;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--accent);
}

.strip__kicker span {
  padding: 3px 8px;
  border-radius: 6px;
  background: var(--accent-soft);
  letter-spacing: 0.04em;
}

.strip__title {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.45rem;
  line-height: 1.2;
  letter-spacing: -0.025em;
}

.strip__text {
  max-width: 88ch;
  margin: 12px 0 0;
  color: var(--text-muted);
  line-height: 1.65;
}

.strip__note {
  margin: 10px 0 0;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--text-faint);
}

.strip__tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 20px 0 0;
  padding: 0;
  list-style: none;
}

.strip__tags .tech {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  padding: 4px 10px;
}

.strip__links {
  display: flex;
  gap: 10px;
}

/* =========================================================
   Videos — each competition is a wide row: video cover + short text
   ========================================================= */
/* One line of context above the two videos: same voice as the other prose paragraphs */
.vlist__intro {
  max-width: 78ch;
  margin: -24px 0 56px;
  color: var(--text-muted);
  font-size: 1.05rem;
  line-height: 1.7;
}

.vlist {
  display: grid;
  gap: 48px;
}

.vrow {
  display: grid;
  grid-template-columns: minmax(0, 460px) minmax(0, 1fr);
  align-items: center;
  gap: 64px;
}

.vrow__thumb {
  position: relative;
  display: block;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  border-radius: var(--radius-lg);
  background: color-mix(in srgb, var(--accent) 6%, var(--surface));
  box-shadow: 0 1px 2px rgba(12, 12, 13, 0.05), 0 18px 40px -22px color-mix(in srgb, var(--accent) 40%, rgba(12, 12, 13, 0.3));
}

.vrow__thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.9s var(--ease-out);
}

.vrow:hover .vrow__thumb img {
  transform: scale(1.05);
}

.vrow__tag {
  position: absolute;
  left: 12px;
  bottom: 12px;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(12, 12, 13, 0.6);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  font-family: var(--font-mono);
  font-size: 0.68rem;
  letter-spacing: 0.04em;
  color: #fff;
}

.vrow__play {
  position: absolute;
  left: 50%;
  top: 50%;
  display: grid;
  place-items: center;
  width: 56px;
  height: 56px;
  margin: -28px 0 0 -28px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.88);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
  color: var(--accent);
  box-shadow: 0 8px 24px -8px rgba(12, 12, 13, 0.4);
  transition: transform 0.5s var(--ease-out), background-color 0.3s, color 0.3s;
}

.vrow__play svg {
  width: 22px;
  height: 22px;
  margin-left: 2px;
}

.vrow:hover .vrow__play {
  transform: scale(1.12);
  background: var(--accent);
  color: #fff;
}

.vrow__body {
  max-width: 520px;
}

.vrow__kicker {
  margin: 0 0 10px;
  font-family: var(--font-mono);
  font-size: 0.74rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--accent);
}

.vrow__title {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(1.4rem, 2.2vw, 1.8rem);
  font-weight: 600;
  line-height: 1.15;
  letter-spacing: -0.03em;
}

.vrow__desc {
  margin: 12px 0 0;
  color: var(--text-muted);
  font-size: 1.05rem;
  line-height: 1.6;
  text-wrap: pretty;
}

.vrow__link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 18px;
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--accent);
}

.vrow__link svg {
  transition: transform 0.4s var(--ease-out);
}

.vrow__link:hover svg,
.vrow:hover .vrow__link svg {
  transform: translate(2px, -2px);
}

.vrow__link:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 4px;
  border-radius: 4px;
}

@media (max-width: 760px) {
  .vrow {
    grid-template-columns: minmax(0, 1fr);
    gap: 20px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .vrow__thumb img,
  .vrow__play,
  .vrow__link svg {
    transition: none;
  }
}

/* =========================================================
   Notice — one-line statement above a block's content
   ========================================================= */
.notice {
  display: flex;
  align-items: center;
  gap: 14px;
  margin: -24px 0 72px;
  padding: 16px 22px;
  border: 1px solid color-mix(in srgb, var(--accent) 28%, transparent);
  border-radius: 16px;
  background: var(--accent-soft);
  color: var(--text-muted);
}

.notice strong {
  color: var(--accent);
  font-weight: 600;
}

.notice__icon {
  flex: none;
  color: var(--accent);
}

/* =========================================================
   Features — image on one side, story on the other, alternating
   ========================================================= */
.features {
  display: grid;
  gap: 104px;
}

.feature {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  align-items: center;
  gap: 64px;
}

.feature--flip > :first-child {
  order: 2;
}

.feature__media {
  position: relative;
  display: block;
  width: 100%;
  padding: 0;
  cursor: zoom-in;
  aspect-ratio: 16 / 10; /* overridden inline with each screenshot's real ratio */
  border: 1px solid var(--line);
  border-radius: 20px;
  overflow: hidden;
  background:
    radial-gradient(circle, color-mix(in srgb, var(--accent) 18%, transparent) 1px, transparent 1.2px) 0 0 / 22px 22px,
    color-mix(in srgb, var(--accent) 3%, #fff);
  box-shadow: 0 1px 2px rgba(12, 12, 13, 0.03);
  transition:
    transform 0.5s var(--ease-out),
    box-shadow 0.5s var(--ease-out),
    border-color 0.3s;
}

.feature:hover .feature__media {
  transform: translateY(-4px);
  border-color: color-mix(in srgb, var(--accent) 35%, var(--line));
  box-shadow: 0 28px 56px -28px color-mix(in srgb, var(--accent) 45%, rgba(12, 12, 13, 0.25));
}

.feature__media img,
.feature__media svg {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.feature__media:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

/* ---------- Carousel: crossfading screenshots, caption + dots below ---------- */
.carousel__slide {
  position: absolute;
  inset: 0;
  opacity: 0;
  transition: opacity 0.8s var(--ease-in-out);
}

.carousel__slide.is-active {
  opacity: 1;
}

.carousel__frame {
  position: relative;
}

/* Previous / next arrows over the image edges */
.carousel__nav {
  position: absolute;
  top: 50%;
  z-index: 2;
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  margin-top: -20px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: color-mix(in srgb, var(--surface) 90%, transparent);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  box-shadow: 0 6px 18px -6px rgba(12, 12, 13, 0.3);
  color: var(--text);
  cursor: pointer;
  transition:
    background-color 0.25s,
    border-color 0.25s,
    color 0.25s,
    transform 0.3s var(--ease-out);
}

.carousel__nav--prev {
  left: 12px;
}

.carousel__nav--next {
  right: 12px;
}

.carousel__nav:hover {
  border-color: var(--accent);
  background: var(--accent);
  color: #fff;
  transform: scale(1.08);
}

.carousel__nav:active {
  transform: scale(0.96);
}

.carousel__nav:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.carousel__bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-top: 16px;
  padding: 0 4px;
}

.carousel__caption {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent);
}

.carousel__dots {
  display: flex;
  gap: 2px;
}

/* 24px hit area around a small dot */
.carousel__dot {
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  padding: 0;
  border: 0;
  background: none;
  cursor: pointer;
}

.carousel__dot::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 6px;
  background: #d6d3d1;
  transition: width 0.4s var(--ease-out), background-color 0.3s;
}

.carousel__dot:hover::before {
  background: color-mix(in srgb, var(--accent) 50%, #d6d3d1);
}

.carousel__dot.is-active::before {
  width: 18px;
  background: var(--accent);
}

.carousel__dot:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: -2px;
  border-radius: 8px;
}

.feature__kicker,
.prod__kicker {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 14px;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent);
}

.feature__kicker span,
.prod__kicker span {
  padding: 3px 8px;
  border-radius: 6px;
  background: var(--accent-soft);
  letter-spacing: 0.04em;
}

.feature__title,
.prod__title {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(1.5rem, 2.3vw, 1.9rem);
  line-height: 1.2;
  letter-spacing: -0.03em;
}

.feature__sub {
  margin: 8px 0 0;
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: var(--text-muted);
}

/* no one-word last lines in running text, balanced lines in headings */
p,
li,
dd {
  text-wrap: pretty;
}

h2,
h3 {
  text-wrap: balance;
}

.feature__list {
  display: grid;
  gap: 9px;
  margin: 22px 0 0;
  padding: 0;
  list-style: none;
  color: var(--text-muted);
  line-height: 1.55;
}

.feature__list li {
  position: relative;
  padding-left: 20px;
  text-wrap: balance; /* two even lines instead of a long one and a stub */
}

.feature__list li::before {
  content: '';
  position: absolute;
  left: 2px;
  top: 0.62em;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--accent);
}

.feature__tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 24px 0 0;
  padding: 0;
  list-style: none;
}

.feature__tags .tech {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  padding: 4px 10px;
}

.feature__links {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin-top: 22px;
}

/* ---------- In Production / Teaching: light cards for work that has left the lab ---------- */
.prod {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 24px;
}

.prod__card {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  padding: clamp(22px, 2.6vw, 32px);
  border: 1px solid var(--line);
  border-radius: 20px;
  background: var(--surface);
  box-shadow: 0 1px 2px rgba(12, 12, 13, 0.03);
  transition: border-color 0.3s, box-shadow 0.5s var(--ease-out);
}

.prod__card:hover {
  border-color: color-mix(in srgb, var(--accent) 35%, var(--line));
  box-shadow: 0 28px 56px -32px color-mix(in srgb, var(--accent) 45%, rgba(12, 12, 13, 0.25));
}

.prod__kicker {
  margin-bottom: 12px;
}

.prod__title {
  font-size: 1.35rem;
}

.prod__text {
  margin: 10px 0 0;
  color: var(--text-muted);
  line-height: 1.6;
}

.prod .feature__tags {
  margin-top: 16px;
}

.prod__foot {
  margin-top: auto;
  padding-top: 22px;
}

/* a small state pill after the kicker */
.prod__status {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  margin-left: 4px;
  font-style: normal;
  letter-spacing: 0.06em;
  color: var(--text-muted);
}

.prod__status::before {
  content: '';
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--text-faint);
}

.prod__status--live {
  color: #059669;
}

.prod__status--live::before {
  background: currentColor;
}

.prod__status--wip::before {
  background: transparent;
  box-shadow: inset 0 0 0 1.5px currentColor;
}

@media (max-width: 760px) {
  .prod {
    grid-template-columns: 1fr;
  }
}

.feature__hint {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--text-faint);
}

/* GitHub mark instead of the external-link arrow */
.tile__btn--github::before {
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 .297c-6.63 0-12 5.373-12 12 0 5.303 3.438 9.8 8.205 11.385.6.113.82-.258.82-.577 0-.285-.01-1.04-.015-2.04-3.338.724-4.042-1.61-4.042-1.61C4.422 18.07 3.633 17.7 3.633 17.7c-1.087-.744.084-.729.084-.729 1.205.084 1.838 1.236 1.838 1.236 1.07 1.835 2.809 1.305 3.495.998.108-.776.417-1.305.76-1.605-2.665-.3-5.466-1.332-5.466-5.93 0-1.31.465-2.38 1.235-3.22-.135-.303-.54-1.523.105-3.176 0 0 1.005-.322 3.3 1.23.96-.267 1.98-.399 3-.405 1.02.006 2.04.138 3 .405 2.28-1.552 3.285-1.23 3.285-1.23.645 1.653.24 2.873.12 3.176.765.84 1.23 1.91 1.23 3.22 0 4.61-2.805 5.625-5.475 5.92.42.36.81 1.096.81 2.22 0 1.606-.015 2.896-.015 3.286 0 .315.21.69.825.57C20.565 22.092 24 17.592 24 12.297c0-6.627-5.373-12-12-12'/%3E%3C/svg%3E");
  mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 .297c-6.63 0-12 5.373-12 12 0 5.303 3.438 9.8 8.205 11.385.6.113.82-.258.82-.577 0-.285-.01-1.04-.015-2.04-3.338.724-4.042-1.61-4.042-1.61C4.422 18.07 3.633 17.7 3.633 17.7c-1.087-.744.084-.729.084-.729 1.205.084 1.838 1.236 1.838 1.236 1.07 1.835 2.809 1.305 3.495.998.108-.776.417-1.305.76-1.605-2.665-.3-5.466-1.332-5.466-5.93 0-1.31.465-2.38 1.235-3.22-.135-.303-.54-1.523.105-3.176 0 0 1.005-.322 3.3 1.23.96-.267 1.98-.399 3-.405 1.02.006 2.04.138 3 .405 2.28-1.552 3.285-1.23 3.285-1.23.645 1.653.24 2.873.12 3.176.765.84 1.23 1.91 1.23 3.22 0 4.61-2.805 5.625-5.475 5.92.42.36.81 1.096.81 2.22 0 1.606-.015 2.896-.015 3.286 0 .315.21.69.825.57C20.565 22.092 24 17.592 24 12.297c0-6.627-5.373-12-12-12'/%3E%3C/svg%3E");
}

/* =========================================================
   Prose — a plain paragraph inside a block
   ========================================================= */
.prose {
  max-width: 78ch;
  margin: -24px 0 48px;
  color: var(--text-muted);
  font-size: 1.05rem;
  line-height: 1.7;
}

/* =========================================================
   Figure — a titled card holding a large diagram
   ========================================================= */
.figure {
  margin: 0;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: var(--surface);
  overflow: hidden;
  box-shadow: 0 1px 2px rgba(12, 12, 13, 0.03);
}

.figure__title {
  padding: 18px 28px;
  border-bottom: 1px solid var(--line);
  background: color-mix(in srgb, var(--accent) 3%, transparent);
  font-family: var(--font-mono);
  font-size: 0.8rem;
  font-weight: 500;
  letter-spacing: 0.04em;
  color: var(--accent);
}

.figure__scroll {
  overflow-x: auto;
}

.figure__canvas {
  min-width: 760px; /* keeps labels readable; narrower screens scroll sideways */
  padding: 28px;
  background: radial-gradient(circle, color-mix(in srgb, var(--accent) 16%, transparent) 1px, transparent 1.2px) 0 0 / 22px 22px;
}

.figure__legend {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 28px;
  margin: 0;
  padding: 14px 28px;
  border-top: 1px solid var(--line);
  list-style: none;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--text-muted);
}

.figure__legend li {
  display: flex;
  align-items: center;
  gap: 10px;
}

.figure__key {
  width: 26px;
  height: 0;
  border-top: 2px dashed var(--accent);
}

.figure__key--power {
  border-top: 2px dotted #a8a29e;
}

/* ---------- The rig diagram ---------- */
.rig {
  display: block;
  width: 100%;
  height: auto;
}

.rig__box {
  fill: var(--surface);
  stroke: color-mix(in srgb, var(--accent) 45%, var(--line));
  stroke-width: 1.3;
}

/* Structural parts: bench, legs, rails */
.rig__frame {
  fill: color-mix(in srgb, var(--accent) 9%, #fff);
  stroke: color-mix(in srgb, var(--accent) 45%, var(--line));
  stroke-width: 1.3;
}

.rig__label {
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 500;
  fill: var(--text);
  text-anchor: middle;
}

.rig__note {
  font-family: var(--font-body);
  font-size: 13px;
  fill: var(--text-muted);
}

/* Numbered markers, matched to the legend */
.rig__num-ring {
  fill: var(--accent-soft);
  stroke: color-mix(in srgb, var(--accent) 55%, transparent);
  stroke-width: 1;
}

.rig__num {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 500;
  fill: var(--accent);
  text-anchor: middle;
}

.rig__wire {
  fill: none;
  stroke-width: 1.6;
  stroke-linejoin: round;
}

/* Dashes march along data lines, like the diagrams in the software section */
.rig__wire--data {
  stroke: var(--accent);
  stroke-dasharray: 6 5;
  animation: flow 1.4s linear infinite;
}

.rig__wire--power {
  stroke: #a8a29e;
  stroke-dasharray: 2 4;
  stroke-linecap: round;
}

/* Opaque backing: hides the dot grid inside an enclosed part */
.rig__fill {
  fill: var(--surface);
}

.rig__dotted {
  fill: none;
  stroke: var(--text-faint);
  stroke-width: 1.2;
  stroke-dasharray: 2 3;
}

.rig__thin {
  fill: none;
  stroke: color-mix(in srgb, var(--accent) 45%, var(--line));
  stroke-width: 1.3;
}

.rig__stand {
  fill: none;
  stroke: var(--text-muted);
  stroke-width: 2;
  stroke-linecap: round;
}

.rig__arrow {
  fill: none;
  stroke: var(--text-muted);
  stroke-width: 1.2;
}

.rig__arrowhead {
  fill: var(--text-muted);
}

/* =========================================================
   Quote — a testimonial card
   ========================================================= */
.quote {
  display: flex;
  align-items: center;
  gap: 28px;
  margin: 28px 0 0;
  padding: 28px 32px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: var(--surface);
  box-shadow: 0 1px 2px rgba(12, 12, 13, 0.03);
}

.quote__avatar {
  flex: none;
  display: grid;
  place-items: center;
  width: 80px;
  height: 80px;
  border-radius: 50%;
  border: 1px solid color-mix(in srgb, var(--accent) 35%, transparent);
  background: var(--accent-soft);
  color: var(--accent);
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 600;
  object-fit: cover;
}

.quote__body {
  flex: 1;
  min-width: 0;
}

.quote__text {
  margin: 0;
  font-size: 1.1rem;
  font-style: italic;
  line-height: 1.65;
  color: var(--text);
}

.quote__text p {
  margin: 0;
}

.quote__text p + p {
  margin-top: 8px;
}

.quote__by {
  margin-top: 14px;
  font-family: var(--font-mono);
  font-size: 0.85rem;
  font-weight: 500;
  text-align: right;
  color: var(--accent);
}

/* ---------- Lightbox ---------- */
.lightbox {
  width: min(1100px, calc(100vw - 32px));
  max-width: none;
  max-height: calc(100vh - 32px);
  padding: 0;
  border: 0;
  border-radius: 20px;
  background: var(--surface);
  box-shadow: 0 40px 120px -20px rgba(12, 12, 13, 0.5);
  overflow: hidden;
}

.lightbox[open] {
  animation: lightbox-in 0.45s var(--ease-out);
}

.lightbox::backdrop {
  background: rgba(12, 12, 13, 0.55);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}

.lightbox[open]::backdrop {
  animation: fade 0.3s ease-out;
}

@keyframes lightbox-in {
  from { opacity: 0; transform: translateY(16px) scale(0.96); }
  to { opacity: 1; transform: none; }
}

.lightbox__img {
  display: block;
  width: 100%;
  max-height: calc(100vh - 32px);
  object-fit: contain;
}

.lightbox__close {
  position: absolute;
  top: 14px;
  right: 14px;
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border: 0;
  border-radius: 50%;
  background: rgba(12, 12, 13, 0.6);
  color: #fff;
  cursor: pointer;
  transition: background-color 0.2s;
}

.lightbox__close:hover {
  background: rgba(12, 12, 13, 0.85);
}

/* =========================================================
   Ops — a status-page snapshot of the homelab
   ========================================================= */
.ops {
  display: grid;
  grid-template-columns: minmax(0, 6fr) minmax(0, 5fr);
  border: 1px solid var(--line);
  border-radius: 20px;
  background: var(--surface);
  overflow: hidden;
  box-shadow: 0 1px 2px rgba(12, 12, 13, 0.03);
}

/* ---------- Where it runs: a small tag next to the uptime ---------- */
.ops__chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 4px 11px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: color-mix(in srgb, var(--accent) 5%, var(--surface));
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.04em;
  color: var(--text-muted);
}

.ops__chip::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
}

/* ---------- Status panel ---------- */
.ops__panel {
  display: flex;
  flex-direction: column;
  padding: 32px 36px 28px;
}

.ops__status {
  display: flex;
  align-items: center;
  gap: 12px;
  padding-bottom: 22px;
  border-bottom: 1px solid var(--line);
}

.ops__pulse {
  position: relative;
  flex: none;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--accent);
}

.ops__pulse::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: var(--accent);
  animation: pulse 2.2s var(--ease-out) infinite;
}

.ops__state {
  font-family: var(--font-display);
  font-size: 1.05rem;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.ops__count {
  margin-left: auto;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--text-muted);
}

.ops__count span {
  color: var(--accent);
  font-weight: 500;
}

/* ---------- Live uptime ---------- */
.ops__uptime {
  padding: 26px 0 24px;
}

.ops__labelrow {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
}

.ops__labelrow .ops__label {
  margin: 0;
}

.ops__label {
  margin: 0 0 6px;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-faint);
}

.ops__clock {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 4px 18px;
  margin: 0;
}

.ops__unit {
  display: inline-flex;
  align-items: baseline;
  gap: 3px;
}

.ops__num {
  position: relative;
  display: inline-block;
  font-family: var(--font-display);
  font-size: clamp(2.4rem, 4.2vw, 3.6rem);
  font-weight: 600;
  line-height: 1;
  letter-spacing: -0.04em;
  font-variant-numeric: tabular-nums;
}

/* Odometer: the real text only sets the width; each digit rolls on its own, and only the digits that change move */
.ops__sizer {
  color: transparent;
}

.ops__roll {
  position: absolute;
  inset: 0;
  display: flex;
}

.ops__dg {
  position: relative;
  height: 100%;
  overflow: hidden;
}

.ops__dg-strip {
  display: block;
  transition: transform 0.55s var(--ease-out);
}

.ops__dg-strip.is-reset {
  transition: none;
}

.ops__dg-strip.is-rolling {
  transform: translateY(-1em);
}

.ops__dg-cell {
  display: block;
  height: 1em;
  line-height: 1;
}

.ops__unit:last-child .ops__num {
  color: var(--accent);
}

.ops__suffix {
  font-family: var(--font-mono);
  font-size: 0.95rem;
  color: var(--text-muted);
}

/* ---------- Services (virtual machines) ---------- */
.ops__side {
  padding: 32px 36px 28px;
  border-left: 1px solid var(--line);
}

.ops__side .ops__label {
  margin-bottom: 14px;
}

.ops__services {
  margin: 0;
  padding: 0;
  list-style: none;
  border-top: 1px solid var(--line);
}

/* ---------- Status history: one bar per week since boot ---------- */
.ops__history {
  margin-top: auto;
  padding-top: 24px;
  border-top: 1px solid var(--line);
}

.ops__bars {
  display: flex;
  gap: 3px;
  height: 40px;
}

.ops__bar {
  position: relative;
  flex: 1 1 0;
  min-width: 0;
  border-radius: 3px;
  background: color-mix(in srgb, var(--accent) 72%, #fff);
  opacity: 0;
  transform-origin: bottom;
  transition: background-color 0.2s, transform 0.3s var(--ease-out);
}

.ops.is-in .ops__bar {
  opacity: 1;
  animation: bar-in 0.55s var(--ease-out) backwards;
  animation-delay: calc(var(--i, 0) * 16ms + 0.25s);
}

@keyframes bar-in {
  from { opacity: 0; transform: scaleY(0.15); }
  to { opacity: 1; transform: none; }
}

.ops__bar:hover {
  background: var(--accent);
  transform: scaleY(1.12);
}

.ops__bar.is-now {
  background: var(--accent);
}

.ops__bar.is-incident {
  background: #f59e0b;
}

.ops__bar::after {
  content: attr(data-tip);
  position: absolute;
  bottom: calc(100% + 10px);
  left: 50%;
  z-index: 2;
  padding: 4px 9px;
  border-radius: 6px;
  background: var(--text);
  font-family: var(--font-mono);
  font-size: 0.7rem;
  white-space: nowrap;
  color: #fff;
  opacity: 0;
  translate: -50% 4px;
  pointer-events: none;
  transition: opacity 0.2s, translate 0.3s var(--ease-out);
}

/* near the ends, the label grows inwards so it never leaves the card */
.ops__bar.tip-start::after {
  left: 0;
  translate: 0 4px;
}

.ops__bar.tip-end::after {
  left: auto;
  right: 0;
  translate: 0 4px;
}

.ops__bar:hover::after {
  opacity: 1;
  translate: -50% 0;
}

.ops__bar.tip-start:hover::after,
.ops__bar.tip-end:hover::after {
  translate: 0 0;
}

.ops__axis {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin: 12px 0 0;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--text-faint);
}

.ops__axis [data-summary] {
  color: var(--accent);
}

.ops__service {
  display: grid;
  grid-template-columns: auto 128px minmax(0, 1fr);
  align-items: center;
  gap: 14px;
  position: relative;
  margin: 0 -14px;
  padding: 14px;
  border-radius: 10px;
  transition: background-color 0.25s;
}

/* Hairline between rows, inset so it lines up with the rules above */
.ops__service + .ops__service::before {
  content: '';
  position: absolute;
  top: 0;
  left: 14px;
  right: 14px;
  height: 1px;
  background: var(--line);
  transition: opacity 0.25s;
}

.ops__service:hover {
  background: color-mix(in srgb, var(--accent) 6%, transparent);
}

/* Hide the hairlines touching the highlighted row */
.ops__service:hover::before,
.ops__service:hover + .ops__service::before {
  opacity: 0;
}

.ops__led {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 16%, transparent);
  transition: box-shadow 0.25s;
}

.ops__service:hover .ops__led {
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 24%, transparent), 0 0 10px var(--accent);
}

.ops__name {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  font-weight: 500;
}

.ops__desc {
  overflow: hidden;
  font-size: 0.9rem;
  color: var(--text-muted);
  line-height: 1.45;
  white-space: nowrap; /* one line per service */
  text-overflow: ellipsis;
}

/* ---------- Hardware specs: a strip across the bottom ---------- */
.ops__specs {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: repeat(6, auto); /* each cell as wide as its value needs */
  gap: 1px; /* hairlines between cells, at any column count */
  margin: 0;
  border-top: 1px solid var(--line);
  background: var(--line);
}

.ops__spec {
  padding: 18px 22px 20px;
  background: color-mix(in srgb, var(--accent) 3%, var(--surface));
}

.ops__spec dt {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-faint);
}

.ops__spec dd {
  margin: 6px 0 0;
  font-size: 0.88rem;
  font-weight: 500;
  line-height: 1.4;
}

@media (max-width: 960px) {
  .ops {
    grid-template-columns: 1fr;
  }

  .ops__side {
    border-left: 0;
    border-top: 1px solid var(--line);
  }

  .ops__specs {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 640px) {
  .ops__panel,
  .ops__side {
    padding: 24px 20px 20px;
  }

  .ops__bars {
    gap: 2px;
    height: 34px;
  }

  .ops__axis [data-summary] {
    display: none;
  }

  .ops__clock {
    gap: 4px 12px;
  }

  .ops__num {
    font-size: 2.1rem;
  }

  .ops__service {
    grid-template-columns: auto minmax(0, 1fr);
    gap: 4px 12px;
  }

  .ops__desc {
    grid-column: 2;
    font-size: 0.85rem;
  }

  .ops__specs {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .ops__spec {
    padding: 14px 16px 16px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .ops__pulse::after {
    animation: none;
  }

  .ops.is-in .ops__bar {
    animation: none;
  }

  .ops__dg-strip {
    transition: none;
  }

  .ops__bar,
  .ops__bar::after {
    transition: none;
  }
}

/* =========================================================
   Notes — two problem / solution cards, each with a small live diagram
   ========================================================= */
.notes {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 28px;
}

.note {
  display: flex;
  flex-direction: column;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: var(--surface);
  overflow: hidden;
  box-shadow: 0 1px 2px rgba(12, 12, 13, 0.03);
  transition:
    transform 0.5s var(--ease-out),
    box-shadow 0.5s var(--ease-out),
    border-color 0.3s;
}

.note:hover {
  transform: translateY(-4px);
  border-color: color-mix(in srgb, var(--accent) 35%, var(--line));
  box-shadow: 0 28px 56px -28px color-mix(in srgb, var(--accent) 45%, rgba(12, 12, 13, 0.25));
}

.note__fig {
  padding: 24px 24px 20px;
  border-bottom: 1px solid var(--line);
  background:
    radial-gradient(circle, color-mix(in srgb, var(--accent) 16%, transparent) 1px, transparent 1.2px) 0 0 / 22px 22px,
    color-mix(in srgb, var(--accent) 2%, var(--surface));
}

.note__body {
  display: flex;
  flex: 1;
  flex-direction: column;
  padding: 26px 28px 24px;
}

.note__kicker {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 12px;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent);
}

.note__kicker span {
  padding: 3px 8px;
  border-radius: 6px;
  background: var(--accent-soft);
  letter-spacing: 0.04em;
}

.note__title {
  margin: 0;
  font-family: var(--font-display);
  font-size: 1.35rem;
  font-weight: 600;
  line-height: 1.25;
  letter-spacing: -0.02em;
}

/* Problem / Solution as two labelled rows */
.note__qa {
  display: grid;
  gap: 14px;
  margin: 20px 0 0;
}

.note__qa div {
  display: grid;
  grid-template-columns: 92px minmax(0, 1fr);
  gap: 12px;
}

.note__qa dt {
  padding-top: 3px;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-faint);
}

.note__qa div + div dt {
  color: var(--accent);
}

.note__qa dd {
  margin: 0;
  font-size: 0.95rem;
  line-height: 1.6;
  color: var(--text-muted);
}

.note__foot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-top: auto;
  padding-top: 24px;
}

.note__tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.note__tags .tech {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  padding: 3px 9px;
}

/* Arrow instead of the external-link icon, for links within the site */
.tile__btn--next::before {
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12h14M13 6l6 6-6 6'/%3E%3C/svg%3E");
  mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12h14M13 6l6 6-6 6'/%3E%3C/svg%3E");
}

/* ---------- The small diagrams (shares the .rig box / wire styles) ---------- */
.net {
  display: block;
  width: 100%;
  height: auto;
  overflow: visible;
}

.net__group {
  fill: color-mix(in srgb, var(--accent) 4%, var(--surface));
  stroke: color-mix(in srgb, var(--accent) 35%, var(--line));
  stroke-width: 1.2;
  stroke-dasharray: 4 4;
}

.net__title {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  fill: var(--accent);
}

.net__note {
  font-family: var(--font-mono);
  font-size: 11px;
  fill: var(--text-muted);
}

.net__arrowhead {
  fill: var(--accent);
}

.net__ring {
  fill: var(--surface);
  stroke: color-mix(in srgb, var(--accent) 45%, var(--line));
  stroke-width: 1.3;
}

.net__blades {
  fill: var(--accent);
  animation: spin 1.6s linear infinite;
}

.net__hub {
  fill: var(--surface);
  stroke: var(--accent);
  stroke-width: 1.2;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.net__dot {
  fill: color-mix(in srgb, var(--accent) 35%, var(--line));
}

.net__wheel {
  fill: none;
  stroke: var(--accent);
  stroke-width: 7;
  stroke-dasharray: 9 3;
  opacity: 0.55;
}

.net__track {
  stroke: var(--line);
  stroke-width: 3;
  stroke-linecap: round;
}

.net__knob {
  fill: var(--surface);
  stroke: var(--accent);
  stroke-width: 1.6;
}

/* LEDs light up one after another, like a chase effect */
.net__led {
  fill: var(--accent);
  opacity: 0.2;
  animation: chase 2.1s ease-in-out infinite;
  animation-delay: calc(var(--n) * 0.15s);
}

@keyframes chase {
  0%, 60%, 100% { opacity: 0.2; }
  20% { opacity: 1; }
}

@media (max-width: 960px) {
  .notes {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  .note__fig {
    padding: 14px 8px 10px;
  }

  /* The diagram shrinks to ~65%, so enlarge its text to stay legible */
  .net .rig__label {
    font-size: 15px;
  }

  .net__note,
  .net__title {
    font-size: 13px;
  }

  .note__body {
    padding: 22px 20px 20px;
  }

  .note__qa div {
    grid-template-columns: 1fr;
    gap: 4px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .net__blades,
  .net__led {
    animation: none;
  }

  .net__led {
    opacity: 0.8;
  }

  .note:hover {
    transform: none;
  }
}

/* =========================================================
   Book — the cover floats free on the page, no panel behind it
   ========================================================= */
.book {
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 6fr);
  align-items: center;
  gap: 64px;
}

/* ---------- The cover and the notes orbiting it ---------- */
.book__visual {
  --px: 0; /* pointer position, -0.5 … 0.5, set by script */
  --py: 0;
  position: relative;
  display: grid;
  place-items: center;
  min-height: 540px;
}

.book__art {
  position: relative;
  width: min(100%, 300px);
  transform: translate(calc(var(--px) * 18px), calc(var(--py) * 18px)) rotate(calc(var(--px) * 2.5deg));
  transition: transform 0.9s var(--ease-out);
}

/* Rises into place when the block scrolls into view */
.book__enter {
  opacity: 0;
  transform: translateY(56px) scale(0.93);
  transition: opacity 1s ease 0.1s, transform 1.3s var(--ease-out) 0.1s;
}

.is-in .book__enter {
  opacity: 1;
  transform: none;
}

.book__bob {
  position: relative;
  animation: bob 7s ease-in-out infinite;
}

.book__img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 4px;
  box-shadow:
    0 0 0 1px rgba(12, 12, 13, 0.06),
    0 2px 4px rgba(12, 12, 13, 0.06),
    0 18px 36px -12px rgba(12, 12, 13, 0.22),
    0 56px 96px -32px color-mix(in srgb, var(--accent) 55%, rgba(8, 92, 142, 0.5));
}

/* A band of light that sweeps across the cover now and then */
.book__sheen {
  position: absolute;
  inset: 0;
  overflow: hidden;
  border-radius: 4px;
  pointer-events: none;
}

.book__sheen::before {
  content: '';
  position: absolute;
  top: -10%;
  bottom: -10%;
  left: 0;
  width: 38%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.75), transparent);
  transform: translateX(-160%) skewX(-18deg);
  animation: sheen 7s ease-in-out 2.4s infinite;
}

@keyframes sheen {
  0% { transform: translateX(-160%) skewX(-18deg); }
  32%, 100% { transform: translateX(420%) skewX(-18deg); }
}

/* Callouts: what is inside, floating around the cover at different depths */
.book__callouts {
  position: absolute;
  inset: 0;
  margin: 0;
  padding: 0;
  list-style: none;
  pointer-events: none;
}

.callout {
  position: absolute;
  opacity: 0;
  transform: translate(calc(var(--px) * var(--k) * 1px), calc(var(--py) * var(--k) * 1px));
  transition:
    opacity 0.8s ease calc(0.9s + var(--n) * 0.18s),
    transform 0.9s var(--ease-out);
}

.is-in .callout {
  opacity: 1;
}

.callout span {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 9px 16px 9px 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: color-mix(in srgb, var(--surface) 86%, transparent);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  box-shadow: 0 12px 30px -14px rgba(12, 12, 13, 0.3);
  font-size: 0.85rem;
  font-weight: 500;
  white-space: nowrap;
  animation: bob 6s ease-in-out infinite;
  animation-delay: var(--t);
}

.callout span::before {
  content: '';
  flex: none;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 18%, transparent);
}

.callout--1 { --k: -36; --n: 0; --t: 0s; left: 0; top: 15%; }
.callout--2 { --k: -22; --n: 1; --t: -2s; right: -2%; top: 31%; }
.callout--3 { --k: -30; --n: 2; --t: -4s; left: 2%; bottom: 23%; }
.callout--4 { --k: -42; --n: 3; --t: -1s; right: -2%; bottom: 2%; }

/* ---------- Text side ---------- */
.book__body {
  display: flex;
  flex-direction: column;
}

.book__kicker {
  margin: 0 0 12px;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent);
}

.book__title {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(2rem, 3.4vw, 2.7rem);
  font-weight: 600;
  line-height: 1.08;
  letter-spacing: -0.03em;
}

.book__zh {
  margin: 8px 0 0;
  font-size: 1.05rem;
  color: var(--text-muted);
}

.book__pull {
  margin: 28px 0 0;
  padding-left: 18px;
  border-left: 3px solid var(--accent);
  font-family: var(--font-display);
  font-size: 1.2rem;
  font-weight: 500;
  line-height: 1.45;
  letter-spacing: -0.01em;
}

.book__why {
  margin: 16px 0 0;
  color: var(--text-muted);
  line-height: 1.65;
}

.book__stats {
  display: grid;
  grid-template-columns: repeat(3, auto);
  justify-content: start;
  align-items: end; /* numbers share a baseline even if a label wraps */
  gap: 0 48px;
  margin: 32px 0 0;
  padding: 22px 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.book__stats dt {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-faint);
}

.book__stats dd {
  margin: 6px 0 0;
  font-family: var(--font-display);
  font-size: 2rem;
  font-weight: 700;
  line-height: 1;
  letter-spacing: -0.03em;
  color: var(--accent);
  font-variant-numeric: tabular-nums;
}

/* ---------- Edition history: a line that draws itself, dot by dot ---------- */
.history {
  position: relative;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 20px;
  margin: 30px 0 0;
  padding: 0;
  list-style: none;
}

.history::before,
.history::after {
  content: '';
  position: absolute;
  top: 5px;
  left: 5px;
  right: 0;
  height: 1px;
  background: var(--line);
}

.history::after {
  background: var(--accent);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 1.8s var(--ease-out) 0.5s;
}

.is-in .history::after {
  transform: scaleX(1);
}

.history__item {
  position: relative;
  padding-top: 26px;
}

.history__item::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 11px;
  height: 11px;
  box-sizing: border-box;
  border: 2px solid var(--accent);
  border-radius: 50%;
  background: var(--page);
  transform: scale(0);
  transition: transform 0.5s var(--ease-out) calc(0.5s + var(--n) * 0.6s);
}

.is-in .history__item::before {
  transform: scale(1);
}

/* The edition shown above: filled, with a pulse */
.history__item.is-current::before {
  background: var(--accent);
}

.history__item.is-current::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 11px;
  height: 11px;
  border-radius: 50%;
  border: 2px solid var(--accent);
  animation: pulse 2.2s var(--ease-out) 2.2s infinite;
}

.history__v {
  margin: 0;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--accent);
}

.history__name {
  margin: 6px 0 0;
  font-size: 0.95rem;
  font-weight: 500;
  line-height: 1.3;
}

.history__note {
  margin: 4px 0 0;
  font-size: 0.82rem;
  line-height: 1.45;
  color: var(--text-muted);
}

/* =========================================================
   Reviews — a slow ticker of reader quotes
   ========================================================= */
.reviews {
  margin-top: 48px;
}

.reviews__label {
  margin: 0 0 16px;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-faint);
}

.reviews__window {
  display: flex;
  overflow: hidden;
  /* fade both ends so quotes slide in and out softly */
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 6%, #000 94%, transparent);
  mask-image: linear-gradient(90deg, transparent, #000 6%, #000 94%, transparent);
}

.reviews__track {
  display: flex;
  flex: none;
  gap: 20px;
  margin: 0;
  padding: 4px 20px 8px 0;
  list-style: none;
  animation: ticker 60s linear infinite;
}

.reviews__window:hover .reviews__track {
  animation-play-state: paused;
}

@keyframes ticker {
  to { transform: translateX(-100%); }
}

.review {
  flex: none;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 16px;
  width: 340px;
  padding: 22px 24px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--surface);
}

.review__text {
  margin: 0;
  font-size: 0.95rem;
  line-height: 1.6;
}

.review__by {
  margin: 0;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--text-muted);
}

.review__by strong {
  color: var(--accent);
  font-weight: 500;
}

/* =========================================================
   Translation — one sentence, two passes
   ========================================================= */
.xl {
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 6fr);
  align-items: center;
  gap: 64px;
}

.xl__title {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(1.5rem, 2.3vw, 1.9rem);
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: -0.03em;
}

.xl__text {
  margin: 16px 0 0;
  color: var(--text-muted);
  line-height: 1.65;
}

.xl__intro .feature__list {
  margin-top: 24px;
}

.xl__intro .feature__list strong {
  color: var(--text);
  font-weight: 600;
}

.xl__card {
  margin: 0;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: var(--surface);
  overflow: hidden;
  box-shadow: 0 1px 2px rgba(12, 12, 13, 0.03);
}

.xl__cap {
  padding: 16px 24px;
  border-bottom: 1px solid var(--line);
  background: color-mix(in srgb, var(--accent) 3%, transparent);
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--text-muted);
}

.xl__cap span {
  margin-right: 8px;
  padding: 2px 8px;
  border-radius: 5px;
  background: var(--accent-soft);
  color: var(--accent);
  font-weight: 500;
}

.xl__row {
  display: grid;
  grid-template-columns: 128px minmax(0, 1fr);
  align-items: baseline;
  gap: 16px;
  padding: 22px 24px;
}

.xl__row + .xl__row {
  border-top: 1px solid var(--line);
}

.xl__row--ai {
  background: color-mix(in srgb, var(--text) 3%, transparent);
}

.xl__row--ok {
  background: color-mix(in srgb, var(--accent) 5%, transparent);
}

.xl__tag {
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 0;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-faint);
}

.xl__row--ok .xl__tag {
  color: var(--accent);
}

.xl__line {
  margin: 0;
  font-size: 1.15rem;
  line-height: 1.6;
}

.xl__line--en {
  font-family: var(--font-display);
  font-style: italic;
  letter-spacing: -0.01em;
}

/* Edits: the AI's wording is struck out, the person's wording is marked */
.xl__line del {
  position: relative;
  text-decoration: none;
  color: var(--text-muted);
}

.xl__line del::after {
  content: '';
  position: absolute;
  left: -1px;
  right: -1px;
  top: 52%;
  height: 2px;
  border-radius: 2px;
  background: var(--accent);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.6s var(--ease-out) 0.7s;
}

.xl__line ins {
  text-decoration: none;
  font-weight: 500;
  border-radius: 4px;
  background: linear-gradient(color-mix(in srgb, var(--accent) 22%, transparent), color-mix(in srgb, var(--accent) 22%, transparent)) 0 100% / 0 100% no-repeat;
  transition: background-size 0.7s var(--ease-out) 1.3s;
}

.is-in .xl__line del::after {
  transform: scaleX(1);
}

.is-in .xl__line ins {
  background-size: 100% 100%;
}

.xl__note {
  margin: 0;
  padding: 14px 24px;
  border-top: 1px solid var(--line);
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--text-faint);
}

@media (max-width: 960px) {
  .book {
    grid-template-columns: 1fr;
    gap: 40px;
  }

  .book__visual {
    width: 100%;
    max-width: 520px;
    margin-inline: auto;
  }

  .xl {
    grid-template-columns: 1fr;
    gap: 40px;
  }
}

@media (max-width: 640px) {
  /* Phones: the callouts drop out of orbit and sit under the cover */
  .book__visual {
    min-height: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
  }

  .book__art {
    width: min(72%, 232px);
  }

  .book__callouts {
    position: static;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px;
    margin-top: 32px;
  }

  .callout {
    position: static;
    transform: none;
  }

  .book__stats {
    gap: 0 28px;
  }

  .history {
    grid-template-columns: 1fr;
    gap: 22px;
    padding-left: 28px;
  }

  .history::before,
  .history::after {
    top: 5px;
    bottom: 5px;
    left: 5px;
    right: auto;
    width: 1px;
    height: auto;
  }

  .history::after {
    transform: scaleY(0);
    transform-origin: top;
  }

  .is-in .history::after {
    transform: scaleY(1);
  }

  .history__item {
    padding-top: 0;
  }

  .history__item::before,
  .history__item.is-current::after {
    top: 3px;
    left: -28px;
  }

  .review {
    width: 290px;
  }

  .xl__row {
    grid-template-columns: 1fr;
    gap: 6px;
    padding: 18px 20px;
  }

  .xl__cap,
  .xl__note {
    padding-inline: 20px;
  }
}

@media (prefers-reduced-motion: reduce) {
  /* No ticker: the quotes wrap into a plain grid, the second copy is dropped */
  .reviews__window {
    display: block;
    -webkit-mask-image: none;
    mask-image: none;
  }

  .reviews__track {
    flex-wrap: wrap;
    padding-right: 0;
    animation: none;
  }

  .reviews__track[aria-hidden='true'] {
    display: none;
  }

  .review {
    width: min(340px, 100%);
  }

  .xl__line del::after {
    transform: scaleX(1);
    transition: none;
  }

  .xl__line ins {
    background-size: 100% 100%;
    transition: none;
  }

  /* The cover and callouts stay put, the history line is already drawn */
  .book__bob,
  .book__sheen::before,
  .callout span,
  .history__item.is-current::after {
    animation: none;
  }

  .book__enter,
  .callout,
  .book__art,
  .history::after,
  .history__item::before {
    opacity: 1;
    transform: none;
    transition: none;
  }

  .history::after {
    transform: scaleX(1);
  }

  .history__item::before {
    transform: scale(1);
  }
}

/* =========================================================
   Reach — the closing section: one big address, a few ways to follow
   ========================================================= */
.reach {
  display: grid;
  gap: 72px;
}

.reach__label {
  margin: 0 0 14px;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-faint);
}

.reach__mail {
  display: inline-flex;
  align-items: flex-start;
  gap: 14px;
  max-width: 100%;
  font-family: var(--font-display);
  font-size: clamp(1.7rem, 4.3vw, 3.3rem);
  font-weight: 600;
  line-height: 1.12;
  letter-spacing: -0.035em;
}

.reach__mail > span {
  position: relative;
  padding-bottom: 12px;
}

/* The underline carries every identity's colour and keeps moving */
.reach__mail > span::after,
.reach__link strong::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 3px;
  border-radius: 3px;
  background: linear-gradient(90deg, #2563eb, #7c3aed, #ea580c, #059669, #e11d48, #2563eb) 0 0 / 200% 100%;
  animation: ribbon 9s linear infinite;
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 1.3s var(--ease-out) 0.3s, height 0.3s;
}

.is-in .reach__mail > span::after {
  transform: scaleX(1);
}

.reach__mail:hover > span::after {
  height: 6px;
}

@keyframes ribbon {
  to { background-position: -200% 0; }
}

.reach__arrow {
  flex: none;
  margin-top: 0.14em;
  width: 0.62em;
  height: 0.62em;
  color: var(--text-faint);
  transition: transform 0.4s var(--ease-out), color 0.3s;
}

.reach__mail:hover .reach__arrow,
.reach__link:hover .reach__arrow {
  color: var(--text);
  transform: translate(4px, -4px);
}

.reach__mail:focus-visible,
.reach__link:focus-visible,
.reach__btn:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 6px;
  border-radius: 8px;
}

/* ---------- Below the address: availability on the left, profiles on the right ---------- */
.reach__cols {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 64px;
  align-items: start;
}

.reach__status {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 0;
  font-family: var(--font-display);
  font-size: 1.15rem;
  letter-spacing: -0.01em;
}

.reach__dot {
  position: relative;
  flex: none;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #059669;
}

.reach__dot::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: #059669;
  animation: pulse 2.2s var(--ease-out) infinite;
}

.reach__text {
  max-width: 44ch;
  margin: 12px 0 0;
  color: var(--text-muted);
  line-height: 1.65;
}

.reach__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 28px;
}

.reach__btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 12px 22px;
  border: 1px solid var(--accent);
  border-radius: 999px;
  background: var(--accent);
  color: #fff;
  font-family: var(--font-body);
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  transition: transform 0.3s var(--ease-out), box-shadow 0.3s, background-color 0.3s, color 0.3s, border-color 0.3s;
}

.reach__btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 14px 28px -14px rgba(12, 12, 13, 0.5);
}

.reach__btn--ghost {
  border-color: var(--line);
  background: var(--surface);
  color: var(--text);
}

.reach__btn--ghost:hover {
  border-color: var(--accent);
  box-shadow: none;
}

.reach__links {
  margin: 0;
  padding: 0;
  list-style: none;
  border-bottom: 1px solid var(--line);
}

.reach__link {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 18px;
  padding: 20px 0;
  border-top: 1px solid var(--line);
  transition: padding 0.4s var(--ease-out);
}

.reach__link:hover {
  padding-left: 10px;
}

.reach__icon {
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface);
  transition: background-color 0.3s, color 0.3s, border-color 0.3s;
}

.reach__link:hover .reach__icon {
  border-color: var(--accent);
  background: var(--accent);
  color: #fff;
}

.reach__who {
  display: grid;
  gap: 2px;
}

.reach__who strong {
  position: relative;
  justify-self: start;
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-weight: 600;
  letter-spacing: -0.01em;
}

/* a short underline sweeps in under the name on hover */
.reach__link strong::after {
  bottom: -3px;
  height: 2px;
  animation-duration: 6s;
  transform: scaleX(0);
  transition: transform 0.5s var(--ease-out);
}

.reach__link:hover strong::after {
  transform: scaleX(1);
}

.reach__who span {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--text-muted);
}

.reach__link .reach__arrow {
  width: 20px;
  height: 20px;
  margin: 0;
}

/* =========================================================
   Footer
   ========================================================= */
.footer {
  border-top: 1px solid var(--line);
}

.footer__inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px 24px;
  padding-block: 28px 36px;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--text-muted);
}

.footer__inner p {
  margin: 0;
}

.footer__inner a {
  transition: color 0.2s;
}

.footer__inner a:hover {
  color: var(--text);
}

@media (max-width: 960px) {
  .reach {
    gap: 56px;
  }

  .reach__cols {
    grid-template-columns: 1fr;
    gap: 48px;
  }
}

@media (max-width: 860px) {
  .nav__links {
    gap: 24px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .reach__mail > span::after,
  .reach__link strong::after,
  .reach__dot::after {
    animation: none;
  }

  .reach__mail > span::after {
    transform: scaleX(1);
    transition: none;
  }
}

/* =========================================================
   Responsive
   ========================================================= */
@media (max-width: 960px) {
  .section__head {
    grid-template-columns: 1fr;
    margin-bottom: 56px;
  }

  .features {
    gap: 80px;
  }

  .strip {
    grid-template-columns: minmax(0, 1fr);
  }

  .feature {
    grid-template-columns: 1fr;
    gap: 28px;
  }

  /* Stacked: image always comes first */
  .feature--flip > :first-child {
    order: 0;
  }

  .flow__step {
    min-width: 0;
    padding: 12px 14px;
  }
}

@media (max-width: 640px) {
  .container {
    padding: 0 20px;
  }

  .nav__toggle {
    display: block;
  }

  .theme-toggle {
    margin-left: auto;
    margin-right: 10px;
  }

  /* The links drop down from the bar */
  .nav__links {
    position: absolute;
    top: 72px;
    left: 0;
    right: 0;
    flex-direction: column;
    gap: 0;
    padding: 4px 20px 12px;
    border-bottom: 1px solid var(--line);
    background: var(--page); /* opaque: a backdrop blur nested in the bar's would not work */
    font-size: 1.05rem;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-8px);
    transition: opacity 0.3s, transform 0.4s var(--ease-out), visibility 0s 0.4s;
  }

  .nav.is-open .nav__links {
    opacity: 1;
    visibility: visible;
    transform: none;
    transition-delay: 0s;
  }

  .nav.is-open {
    background: var(--page);
    box-shadow: 0 1px 0 var(--line);
  }

  .nav__links a {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 0;
    border-top: 1px solid var(--line);
  }

  .nav__links a::after {
    position: static;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    transform: scale(0);
    transform-origin: center;
  }

  .nav__links a:hover::after,
  .nav__links a.is-active::after {
    transform: scale(1);
  }

  .hero {
    padding: 104px 0 88px;
  }

  .progress {
    gap: 6px;
  }

  .progress__label {
    font-size: 0.62rem;
    letter-spacing: 0;
  }

  .section {
    padding: 96px 0;
  }

  /* Timeline: rail on the left, date row above each card */
  .timeline {
    --meta-w: 0px;
    --node-w: 28px;
    --node-y: 12px;
  }

  .tl-item {
    grid-template-columns: var(--node-w) 1fr;
    grid-template-areas:
      'node meta'
      '.    card';
    row-gap: 14px;
  }

  .tl-item__node {
    grid-area: node;
  }

  .tl-item__meta {
    grid-area: meta;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    padding: 0 0 0 8px;
    text-align: left;
  }

  .edu-card {
    grid-area: card;
    flex-direction: column;
    gap: 16px;
    margin-left: 8px;
    padding: 22px;
  }

  .edu-card__logo {
    width: 52px;
    height: 52px;
    border-radius: 13px;
  }

  .edu-card__school {
    font-size: 1.25rem;
  }

  .honour {
    padding: 16px;
  }

  .honour__list {
    grid-template-columns: 1fr;
  }

  .honour__head {
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    row-gap: 12px;
  }

  .honour__text {
    order: 3;
    flex-basis: 100%;
  }

  .honour__count {
    font-size: 1.5rem;
  }

  .jump {
    margin-top: 36px;
  }

  .block + .block {
    margin-top: 112px;
  }

  .tile-grid {
    grid-template-columns: 1fr;
    gap: 24px;
  }

  .tile__body {
    padding: 16px 18px 0;
  }

  .prose {
    margin: -8px 0 36px;
    font-size: 1rem;
  }

  .figure__title,
  .figure__legend {
    padding-left: 18px;
    padding-right: 18px;
  }

  /* The diagram is wider than the screen here — say so */
  .figure__legend::after {
    content: 'Swipe sideways to see the whole diagram →';
    flex-basis: 100%;
    color: var(--text-faint);
  }

  .figure__canvas {
    padding: 18px;
  }

  .quote {
    flex-direction: column;
    align-items: flex-start;
    gap: 18px;
    padding: 22px;
  }

  .quote__avatar {
    width: 60px;
    height: 60px;
    font-size: 1.15rem;
  }

  .quote__text {
    font-size: 1rem;
  }

  .notice {
    align-items: flex-start;
    margin: -8px 0 48px;
    padding: 14px 16px;
  }

  .features {
    gap: 64px;
  }

  /* Workflow runs top to bottom on phones */
  .flow {
    flex-direction: column;
    align-items: stretch;
  }

  .flow__step {
    flex-direction: row;
    align-items: baseline;
    justify-content: space-between;
  }

  .flow__link {
    flex: none;
    align-self: center;
    width: 1.5px;
    height: 18px;
    min-width: 0;
    background: repeating-linear-gradient(
      180deg,
      color-mix(in srgb, var(--accent) 60%, transparent) 0 5px,
      transparent 5px 11px
    );
    animation: none;
  }

  .flow__link::before {
    display: none;
  }

  .flow__caption {
    margin-bottom: 40px;
  }

  .strip {
    padding: 22px 22px 24px;
  }

  /* Always stack on phones, so every card's footer lines up the same way */
  .tile__footer {
    flex-direction: column;
    align-items: flex-start;
    padding: 16px 18px 18px;
  }
}

/* =========================================================
   Reduced motion
   ========================================================= */
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  .aurora__blob,
  .cursor {
    animation: none;
  }

  .hero__name .l {
    transform: none;
  }

  .char,
  .role__word.is-leaving .char {
    transition: opacity 0.3s;
    transform: none !important;
    filter: none !important;
  }

  .reveal,
  .fade-up,
  .diagram .node {
    transform: none;
  }

  .badge__dot,
  .tl-item.is-current .tl-item__node::after,
  .jump__arrow,
  .jump__ring::after,
  .diagram .edge,
  .rig__wire--data,
  .flow__link::before {
    animation: none;
  }
}

@keyframes fade {
  from { opacity: 0; }
  to { opacity: 1; }
}

/* =========================================================
   Beyond the five — a lively page: each topic's colour drifts and blends in the background
   ========================================================= */
.curious {
  overflow: hidden;
  isolation: isolate;
}

.curious__bg {
  position: absolute;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  /* the colours fade out towards the neighbouring sections */
  -webkit-mask-image: linear-gradient(to bottom, transparent, #000 18%, #000 82%, transparent);
  mask-image: linear-gradient(to bottom, transparent, #000 18%, #000 82%, transparent);
}

.orb {
  position: absolute;
  left: var(--x);
  top: var(--y);
  width: var(--s, 46vw);
  min-width: 340px;
  aspect-ratio: 1;
  border-radius: 50%;
  translate: -50% -50%;
  background: radial-gradient(
    circle,
    color-mix(in srgb, var(--c) 75%, transparent) 0,
    color-mix(in srgb, var(--c) 28%, transparent) 38%,
    transparent 70%
  );
  mix-blend-mode: multiply;
  opacity: 0.5;
  will-change: transform;
  animation: orb-drift var(--t, 28s) ease-in-out var(--dl, 0s) infinite alternate;
  transition:
    opacity 0.7s var(--ease-out),
    scale 0.9s var(--ease-out);
}

@keyframes orb-drift {
  0% { transform: translate3d(0, 0, 0) scale(1); }
  50% { transform: translate3d(var(--dx, 10vw), var(--dy, 80px), 0) scale(1.14); }
  100% { transform: translate3d(calc(var(--dx, 10vw) * -0.7), calc(var(--dy, 80px) * -1.1), 0) scale(0.92); }
}

.orb--data { --x: 12%; --y: 26%; --t: 27s; --dx: 14vw; --dy: 70px; }
.orb--ai { --x: 80%; --y: 20%; --t: 33s; --dx: -12vw; --dy: 110px; --dl: -9s; }
.orb--phil { --x: 48%; --y: 60%; --t: 29s; --dx: 10vw; --dy: -90px; --dl: -4s; }
.orb--econ { --x: 88%; --y: 78%; --t: 36s; --dx: -16vw; --dy: -60px; --dl: -14s; }
.orb--photo { --x: 20%; --y: 84%; --t: 25s; --dx: 15vw; --dy: -80px; --dl: -7s; }

.orb--b { --s: 30vw; opacity: 0.4; }
.orb--data.orb--b { --x: 66%; --y: 52%; --t: 31s; --dx: -9vw; --dy: 100px; --dl: -18s; }
.orb--ai.orb--b { --x: 30%; --y: 46%; --t: 26s; --dx: 12vw; --dy: -70px; --dl: -2s; }
.orb--phil.orb--b { --x: 92%; --y: 44%; --t: 34s; --dx: -10vw; --dy: 80px; --dl: -12s; }
.orb--econ.orb--b { --x: 6%; --y: 58%; --t: 30s; --dx: 12vw; --dy: -100px; --dl: -6s; }
.orb--photo.orb--b { --x: 58%; --y: 92%; --t: 24s; --dx: -14vw; --dy: -50px; --dl: -16s; }

/* Hovering a topic lets its colour take over the background */
.curious[data-active] .orb {
  opacity: 0.22;
}

.curious[data-active='data'] .orb--data {
  opacity: 0.8;
  scale: 1.3;
}

.curious[data-active='data'] .topic--data.topic > * {
  opacity: 1;
}

.curious[data-active='ai'] .orb--ai {
  opacity: 0.8;
  scale: 1.3;
}

.curious[data-active='ai'] .topic--ai.topic > * {
  opacity: 1;
}

.curious[data-active='phil'] .orb--phil {
  opacity: 0.8;
  scale: 1.3;
}

.curious[data-active='phil'] .topic--phil.topic > * {
  opacity: 1;
}

.curious[data-active='econ'] .orb--econ {
  opacity: 0.8;
  scale: 1.3;
}

.curious[data-active='econ'] .topic--econ.topic > * {
  opacity: 1;
}

.curious[data-active='photo'] .orb--photo {
  opacity: 0.8;
  scale: 1.3;
}

.curious[data-active='photo'] .topic--photo.topic > * {
  opacity: 1;
}

.topics {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: 64px 36px;
  align-items: start;
  margin: 0;
  padding: 0;
  list-style: none;
}

.topic {
  grid-column: span 4;
  animation: topic-bob 7s ease-in-out calc(var(--f, 0) * -1.6s) infinite alternate;
}

.topic--data { grid-column: 1 / span 6; }
.topic--ai { grid-column: 7 / span 6; margin-top: 72px; }
.topic--phil { grid-column: 1 / span 4; }
.topic--econ { grid-column: 5 / span 4; margin-top: 56px; }
.topic--photo { grid-column: 9 / span 4; margin-top: 20px; }

@keyframes topic-bob {
  from { translate: 0 -7px; }
  to { translate: 0 7px; }
}

.topic > * {
  transition: opacity 0.4s, transform 0.6s var(--ease-out);
}

.curious[data-active] .topic > * {
  opacity: 0.3;
}

.topic__icon {
  box-sizing: content-box;
  padding: 12px;
  border-radius: 50%;
  background: color-mix(in srgb, var(--c) 14%, rgba(255, 255, 255, 0.7));
  color: var(--c);
}

.topic:hover .topic__icon {
  transform: rotate(-12deg) scale(1.1);
}

.topic__name {
  margin: 20px 0 0;
  font-family: var(--font-display);
  font-size: clamp(2.1rem, 5.2vw, 4.4rem);
  font-weight: 600;
  line-height: 1.02;
  letter-spacing: -0.045em;
  text-wrap: balance;
  color: var(--c);
  outline: none;
  transform-origin: left center;
}

.topic:hover .topic__name,
.topic__name:focus-visible {
  transform: scale(1.04);
}

.topic__text {
  margin: 14px 0 0;
  max-width: 30ch;
  font-size: 1.05rem;
  line-height: 1.5;
  color: var(--text-muted);
}

.curious__more {
  margin: 88px 0 0;
  font-family: var(--font-mono);
  font-size: 0.95rem;
  letter-spacing: 0.02em;
  background: linear-gradient(90deg, #0891b2, #6366f1, #db2777, #d97706, #65a30d, #0891b2);
  background-size: 200% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
  animation: more-shift 9s linear infinite;
}

@keyframes more-shift {
  to { background-position: -200% 0; }
}

/* Motion stops when the section is off screen */
.curious:not(.is-live) .orb,
.curious:not(.is-live) .topic,
.curious:not(.is-live) .curious__more {
  animation-play-state: paused;
}

@media (max-width: 900px) {
  .topics {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 48px 24px;
  }

  .topic,
  .topic--data,
  .topic--ai,
  .topic--phil,
  .topic--econ,
  .topic--photo {
    grid-column: auto;
    margin-top: 0;
  }

  .topic--ai { margin-top: 40px; }
  .topic--photo { grid-column: 1 / -1; }
}

@media (max-width: 560px) {
  .topics {
    grid-template-columns: minmax(0, 1fr);
  }

  .topic--ai,
  .topic--photo {
    margin-top: 0;
    grid-column: auto;
  }

  .topic__name {
    font-size: clamp(2rem, 11vw, 2.8rem);
  }

  .curious__more {
    margin-top: 56px;
  }

  .orb {
    min-width: 300px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .orb,
  .topic,
  .curious__more {
    animation: none;
  }

  .topic > *,
  .orb {
    transition: none;
  }
}

/* =========================================================
   Placeholder links: a "Coming soon" hint on hover
   ========================================================= */
a[data-placeholder] {
  position: relative;
}

a[data-placeholder]::after {
  content: 'Coming soon';
  position: absolute;
  left: 0;
  bottom: calc(100% + 10px);
  padding: 5px 12px;
  border-radius: 999px;
  background: var(--text);
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.04em;
  white-space: nowrap;
  color: #fff;
  opacity: 0;
  translate: 0 4px;
  pointer-events: none;
  transition:
    opacity 0.25s,
    translate 0.35s var(--ease-out);
}

a[data-placeholder]:hover::after,
a[data-placeholder]:focus-visible::after {
  opacity: 1;
  translate: 0 0;
}

/* =========================================================
   Off-screen animations rest
   main.js marks .hero / .section / .block / .fade-up with .is-idle while they are far from the viewport.
   Every endless animation below stops there, so the page only animates what you can see
   (they pick up exactly where they paused). One-shot entrances and the hero's identity timer
   are deliberately not listed.
   ========================================================= */
.is-idle .cursor,
.is-idle .badge__dot,
.is-idle .jump__arrow,
.is-idle .rig__wire--data,
.is-idle .net__blades,
.is-idle .net__led,
.is-idle .book__bob,
.is-idle .callout span,
.is-idle .reviews__track,
.is-idle .reach__mail > span::after,
.is-idle .reach__link strong::after,
.is-idle .reach__dot::after,
.is-idle .ops__pulse::after,
.is-idle .jump__ring::after,
.is-idle .book__sheen::before,
.is-idle .flow__link::before,
.is-idle .tl-item.is-current .tl-item__node::after,
.is-idle .history__item.is-current::after,
/* these are observed units themselves, so .is-idle sits on the element (or its owner) rather than an ancestor */
.topic.is-idle,
.curious__more.is-idle,
.rig__wire--data.is-idle,
.reach__link.is-idle strong::after {
  animation-play-state: paused;
}
