:root {
  --ink: #0f0f10;
  --ink-2: #18181a;
  --ink-3: #202022;
  --ink-line: #2f2f32;
  --on-ink: #e4e4e6;
  --on-ink-soft: #9a9a9f;

  --paper: #121213;
  --paper-2: #18181a;
  --paper-line: #2f2f32;
  --chip: #202022;
  --text: #e4e4e6;
  --text-soft: #9a9a9f;

  --signal: #9db2c6;
  --fill: #dcdcdf;
  --on-fill: #141415;
  --mark: #b3a8cc;
  --signal-deep: #9db2c6;
  --warn: #c9c9cd;

  --font-head: "Big Shoulders Display", "Arial Narrow", Impact, sans-serif;
  --display: "Sora", "Segoe UI", system-ui, sans-serif;
  --body: "IBM Plex Sans", "Segoe UI", system-ui, sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, Menlo, Consolas, monospace;

  --gutter: clamp(16px, 4vw, 40px);
  --bar: 60px;
}

/* Graphics keep their own colours: the story art, diagrams, icons, charts and dial. */
.stage, .flow, .xart, .dots, .dial, .build-btn svg, .detail-art {
  --signal: #7fbdb2;
  --warn: #a59fc4;
  --fill: #7fbdb2;
  --on-fill: #121213;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--bar) + 16px);
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--body);
  font-size: 17px;
  line-height: 1.6;
  color: var(--text);
  background: var(--paper);
  -webkit-font-smoothing: antialiased;
  overflow-wrap: break-word;
}

ul, ol { list-style: none; }
a { color: inherit; }
button { font: inherit; color: inherit; }
code { font-family: var(--mono); font-size: 0.9em; }

:focus-visible {
  outline: 2px solid var(--signal-deep);
  outline-offset: 3px;
  border-radius: 3px;
}
.ink :focus-visible, .topbar :focus-visible { outline-color: var(--signal); }

.wrap {
  width: 100%;
  max-width: 1240px;
  margin: 0 auto;
  padding-inline: var(--gutter);
}

.skip {
  position: fixed;
  top: 8px;
  left: 8px;
  z-index: 100;
  padding: 8px 14px;
  background: var(--fill);
  color: var(--on-fill);
  border-radius: 6px;
  transform: translateY(-200%);
}
.skip:focus { transform: none; }

.ink { background: var(--ink); color: var(--on-ink); }

/* ---- Two shades of black take turns down the page ---- */
.shade-b {
  --ink: #131315;
  --ink-2: #1b1b1e;
  --ink-3: #2a2a2e;
  --ink-line: #3a3a3f;
  --paper: #202024;
  --paper-2: #202024;
  --paper-line: #3a3a3f;
  --chip: #2a2a2e;
  color: var(--text);
  background: var(--paper);
}
/* The darker shade again, for a block inside a .shade-b section. */
.shade-a {
  --ink: #0f0f10;
  --ink-2: #18181a;
  --ink-3: #202022;
  --ink-line: #2f2f32;
  --paper: #121213;
  --paper-2: #18181a;
  --paper-line: #2f2f32;
  --chip: #202022;
}

/* ---- Top bar ---- */
.topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--ink);
  color: var(--on-ink);
  border-bottom: 1px solid var(--ink-3);
}
.topbar-in {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: var(--bar);
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--display);
  font-weight: 700;
  font-size: 18px;
  text-decoration: none;
}
.brand svg { color: var(--signal); }
.nav { display: flex; gap: 4px; }
.nav a {
  padding: 6px 12px;
  font-size: 15px;
  color: var(--on-ink-soft);
  text-decoration: none;
  border-radius: 6px;
  transition: color 0.15s, background 0.15s;
}
.nav a:hover { color: var(--on-ink); background: var(--ink-3); }
.nav a.here { color: var(--signal); }
.menu-btn { display: none; }

/* ---- Hero ---- */
.hero {
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-height: calc(var(--screen) - var(--bar));
  padding-block: clamp(32px, 4.5vw, 60px) clamp(28px, 3.5vw, 44px);
}
.hero-sub {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) auto;
  gap: 20px 48px;
  align-items: end;
}
.tag {
  font-family: var(--mono);
  font-size: 13px;
  letter-spacing: 0.01em;
  color: var(--on-ink-soft);
}
.tag-live { display: flex; align-items: center; gap: 10px; }
.pulse {
  flex: none;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--fill);
}
h1, .contact h2 {
  font-family: var(--font-head);
  font-weight: 800;
  font-size: clamp(62px, 10.2vw, 150px);
  line-height: 0.92;
  letter-spacing: 0.004em;
  margin-top: 22px;
  text-wrap: balance;
}
h1 em, .contact h2 em { font-style: normal; color: var(--signal); }
/* The padding holds the letter tails (p, y) inside the rotor's own box, so nothing below can collide
   with them. A hidden phrase moves 1.29em, more than this 1.18em box, so it stays clipped. */
.rotor { display: grid; overflow: hidden; padding-bottom: 0.26em; margin-bottom: 0; }
.rotor em {
  grid-area: 1 / 1;
  white-space: nowrap;
  opacity: 0;
  transform: translateY(140%);
}
.rotor em.on, .rotor em.out { opacity: 1; transition: transform 0.42s cubic-bezier(0.3, 0.8, 0.3, 1); }
.rotor em.on { transform: none; }
.rotor em.out { transform: translateY(-140%); }
.rotor em:nth-child(4n + 1) { color: #79c7b9; }
.rotor em:nth-child(4n + 2) { color: #a9a1dc; }
.rotor em:nth-child(4n + 3) { color: #d3a093; }
.rotor em:nth-child(4n) { color: #9db8d6; }
.rotor.fast em.on, .rotor.fast em.out { transition-duration: 0.24s; }

/* Tick bars under the rotating line: one per phrase, the current one fills */
.rotor-ticks { display: flex; gap: 6px; margin-top: 14px; }
.rotor-ticks i { position: relative; width: 30px; height: 3px; overflow: hidden; background: var(--ink-line); border-radius: 2px; }
.rotor-ticks i::after { content: ""; position: absolute; inset: 0; background: var(--signal); transform: scaleX(0); transform-origin: left; }
.rotor-ticks i:nth-child(4n + 1)::after { background: #79c7b9; }
.rotor-ticks i:nth-child(4n + 2)::after { background: #a9a1dc; }
.rotor-ticks i:nth-child(4n + 3)::after { background: #d3a093; }
.rotor-ticks i:nth-child(4n)::after { background: #9db8d6; }
.rotor-ticks i.done::after { transform: none; }
.rotor-ticks i.now::after { animation: tick-fill var(--ms, 2600ms) linear forwards; }
@keyframes tick-fill { to { transform: none; } }

/* Hero entrance: plays as the welcome intro lifts away (html.hero-go is added by script.js) */
.hw { display: inline-block; }
@keyframes hero-rise { from { opacity: 0; transform: translateY(0.45em); filter: blur(8px); } }
@keyframes hero-fade { from { opacity: 0; transform: translateY(18px); } }
.hero-go .hero .hw { animation: hero-rise 0.75s cubic-bezier(0.2, 0.8, 0.2, 1) both; animation-delay: calc(var(--i) * 90ms + 120ms); }
.hero-go .hero .rotor { animation: hero-rise 0.75s cubic-bezier(0.2, 0.8, 0.2, 1) 0.5s both; }
.hero-go .hero .tag { animation: hero-fade 0.6s ease-out both; }
.hero-go .hero .rotor-ticks { animation: hero-fade 0.5s ease-out 0.85s both; }
.hero-go .hero .lede { animation: hero-fade 0.6s ease-out 0.95s both; }
.hero-go .hero .actions { animation: hero-fade 0.6s ease-out 1.1s both; }
.hero-go .hero .proof { animation: hero-fade 0.6s ease-out 1.25s both; }

/* ---- Welcome intro ----
   One promise up close, then what I can automate pops in tile by tile, then the full wall, then
   "Hello, I'm Sumit Patel", then the screen wipes up into the hero.
   Shown on every desktop page load with animations on (html.intro-on). */
.intro { display: none; }
html.intro-on { overflow: hidden; }
.intro-on .intro {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: grid;
  place-items: center;
  overflow: hidden;
  color: #f1f1f3;
  background: #0f0f10;
  clip-path: inset(0 0 0 0);
  /* If the script never runs, the intro still gets out of the way. */
  animation: intro-failsafe 0s 12s forwards;
}
@keyframes intro-failsafe { to { visibility: hidden; } }
.intro.out { animation: intro-out 0.8s cubic-bezier(0.75, 0, 0.2, 1) forwards, intro-failsafe 0s 12s forwards; }
@keyframes intro-out { to { clip-path: inset(0 0 100% 0); } }

/* The grid: a zero-size point at the screen centre. Tiles sit around it in px; the script scales the
   whole grid from a close-up of the centre tile out to a wall of tiles. */
.intro-pages { position: absolute; left: 50%; top: 50%; width: 0; height: 0; transform-origin: 0 0; }
.intro.hello .intro-pages { animation: pages-out 0.5s ease-in forwards; }
@keyframes pages-out { to { opacity: 0; filter: blur(10px) brightness(0.4); } }

/* Tiles use the site's own language: matte dark card, thin border, one teal accent. No gradients. */
.ipanel {
  position: absolute;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 14px;
  width: 360px;
  height: 360px;
  overflow: hidden;
  padding: 30px;
  color: #ececee;
  text-align: center;
  /* The tile's own accent (--tc, one of the site's four soft hues) as a faint tint on the matte card */
  background: color-mix(in srgb, var(--tc, #79c7b9) 9%, #18181a);
  border: 2px solid color-mix(in srgb, var(--tc, #79c7b9) 24%, #2f2f32);
  border-radius: 18px;
  opacity: 0;
  transform: scale(0.9);
  transition: opacity 0.22s ease-out, transform 0.35s cubic-bezier(0.2, 0.8, 0.2, 1), border-color 0.4s ease-out;
}
.ipanel.on { opacity: 1; transform: none; }
/* The newest tile gets its full accent border, so the eye knows where to look */
.ipanel.now { border-color: var(--tc, #79c7b9); }
.ipanel em { font-family: var(--mono); font-size: 20px; font-style: normal; color: var(--tc, #79c7b9); }
.ipanel b { font-family: var(--font-head); font-weight: 800; font-size: 96px; line-height: 0.92; letter-spacing: 0.004em; overflow-wrap: break-word; color: var(--tc, #ececee); }
.ipanel b.long { font-size: 72px; }
.ipanel b.longer { font-size: 58px; }
.ipanel small { font-family: var(--mono); font-size: 20px; line-height: 1.35; color: #b4b4ba; }
.ipanel-lead { border-color: var(--tc); }
.ipanel-lead b, .ipanel-lead b.long, .ipanel-lead b.longer { font-size: 78px; color: #ececee; }
/* The promise builds itself line by line while the camera settles on it */
.ipanel-lead.on > * { animation: lead-in 0.35s cubic-bezier(0.2, 0.8, 0.2, 1) both; }
.ipanel-lead.on > :nth-child(2) { animation-delay: 0.06s; }
.ipanel-lead.on > :nth-child(3) { animation-delay: 0.14s; }
@keyframes lead-in { from { opacity: 0; transform: translateY(18px); } }

.intro-hello { position: relative; z-index: 2; padding-inline: 20px; text-align: center; visibility: hidden; }
.intro.hello .intro-hello { visibility: visible; }
.intro-hi { font-family: var(--mono); font-size: clamp(20px, 2.6vw, 30px); color: #79c7b9; }
.intro-name { margin-top: 10px; font-family: var(--font-head); font-weight: 900; font-size: clamp(66px, 15vw, 230px); line-height: 0.9; letter-spacing: 0.01em; }
.intro-name span { display: inline-block; }
.intro-welcome { margin-top: 18px; font-family: var(--display); font-weight: 600; font-size: clamp(19px, 2.5vw, 30px); color: #c9c9ce; }
/* One part at a time: the wall fades (0.5 s), then "Hello, I'm", then the name letter by letter, then the
   welcome line, then a short hold to read it (script.js finishes 3.4 s after "hello" starts). */
.intro.hello .intro-hi { animation: hero-fade 0.5s ease-out 0.5s both; }
.intro.hello .intro-name span { animation: name-in 0.55s cubic-bezier(0.2, 0.8, 0.2, 1) both; animation-delay: calc(var(--i) * 45ms + 1.05s); }
@keyframes name-in { from { opacity: 0; transform: translateY(0.35em) scale(1.5); filter: blur(12px); } }
.intro.hello .intro-welcome { animation: hero-fade 0.5s ease-out 2.15s both; }
.intro-skip {
  position: absolute;
  right: 18px;
  bottom: calc(18px + env(safe-area-inset-bottom));
  z-index: 3;
  min-height: 44px;
  padding: 8px 18px;
  font-family: var(--mono);
  font-size: 14px;
  color: #f1f1f3;
  background: rgba(11, 11, 12, 0.7);
  border: 1px solid rgba(241, 241, 243, 0.5);
  border-radius: 999px;
  cursor: pointer;
}
.intro-skip:hover { color: #0b0b0c; background: #f1f1f3; }
.lede {
  max-width: 34em;
  margin-top: 24px;
  font-size: clamp(18px, 1.5vw, 20px);
  line-height: 1.5;
  color: var(--on-ink-soft);
}
.actions, .links { display: flex; flex-wrap: wrap; gap: 12px; }
/* The hero has one short tagline under the rotating line, not an explanation */
.hero .lede.hero-tagline { margin-top: 22px; font-family: var(--display); font-weight: 600; font-size: clamp(19px, 1.7vw, 24px); line-height: 1.3; color: var(--on-ink-soft); }
.actions { margin-top: 24px; }

.btn {
  display: inline-flex;
  align-items: center;
  min-height: 46px;
  padding: 10px 22px;
  font-weight: 600;
  font-size: 16px;
  text-decoration: none;
  border: 1.5px solid transparent;
  border-radius: 8px;
  background: transparent;
  cursor: pointer;
  transition: transform 0.15s, background 0.15s, color 0.15s, border-color 0.15s;
}
.btn:hover { opacity: 0.86; }
.btn-solid { background: var(--fill); color: var(--on-fill); }
.btn-line { border-color: var(--ink-line); color: var(--on-ink); }
.btn-line:hover { border-color: var(--on-ink); }
.btn-solid-dark { background: var(--fill); color: var(--on-fill); }
.btn-line-dark { border-color: var(--text); color: var(--text); }
.btn-line-dark:hover { background: var(--text); color: var(--ink); }

/* ---- Project test consoles ---- */
html:not(.js) .bench { display: none; }
.bench {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 470px);
  grid-template-areas: "side flow" "verdict flow" "foot flow";
  grid-template-rows: auto 1fr auto;
  gap: 14px clamp(24px, 4vw, 60px);
  margin-top: 26px;
  padding: clamp(16px, 3vw, 36px);
  color: var(--on-ink);
  background: var(--ink);
  border-radius: 14px;
  border: 1px solid var(--paper-line);
}
.bench :focus-visible { outline-color: var(--signal); }
.bench-side { grid-area: side; min-width: 0; }
.bench-kicker { font-family: var(--mono); font-size: 13.5px; color: var(--signal); }
.bench-head {
  margin-top: 6px;
  font-family: var(--font-head);
  font-weight: 800;
  font-size: clamp(36px, 4.4vw, 58px);
  line-height: 1.04;
  letter-spacing: 0.004em;
  text-wrap: balance;
}
.bench-tabs { display: grid; gap: 8px; margin-top: 20px; }
.bench-tabs button {
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  min-height: 54px;
  padding: 8px 16px;
  font-family: var(--display);
  font-size: 18px;
  font-weight: 700;
  text-align: left;
  color: var(--on-fill);
  background: var(--fill);
  border: 0;
  border-radius: 10px;
  cursor: pointer;
  transition: transform 0.12s;
}
.bench-tabs button.is-alt { color: var(--on-ink); background: var(--ink-3); border: 1px solid var(--ink-line); }
.bench-tabs button::before {
  content: "";
  flex: none;
  width: 0;
  height: 0;
  border-left: 11px solid currentColor;
  border-block: 7px solid transparent;
}
.bench-tabs button::after { content: ""; margin-left: auto; font-family: var(--mono); font-size: 12.5px; font-weight: 400; }
.bench-tabs button.done::after { content: "Done ✓"; }
/* The buttons take turns: every couple of seconds one lifts, glows and nudges its arrow (script.js
   "Project test consoles"), so it is clear they can be pressed without saying so. */
.bench-tabs button.nudge { animation: tab-nudge 1.1s cubic-bezier(0.3, 0.7, 0.3, 1); }
.bench-tabs button.nudge::before { animation: arrow-nudge 1.1s ease-in-out; }
@keyframes tab-nudge {
  0%, 100% { transform: none; box-shadow: 0 0 0 0 rgba(255, 255, 255, 0); }
  35% { transform: translateX(6px) scale(1.02); box-shadow: 0 0 0 4px rgba(255, 255, 255, 0.18); }
  70% { transform: none; box-shadow: 0 0 0 8px rgba(255, 255, 255, 0); }
}
@keyframes arrow-nudge { 0%, 100% { transform: none; } 30%, 60% { transform: translateX(5px); } 45% { transform: translateX(1px); } }
.bench-tabs button:hover { opacity: 0.88; }
.bench-tabs button:active, .bench-tabs button[aria-pressed="true"] { opacity: 0.72; }
.bench-verdict {
  grid-area: verdict;
  align-self: start;
  padding: 14px 16px;
  min-height: 118px;
  background: var(--ink-2);
  border: 1px solid var(--ink-line);
  border-radius: 10px;
}
.bench-verdict b { display: block; font-family: var(--display); font-weight: 700; font-size: 21px; line-height: 1.2; }
.bench-verdict.ready b { color: var(--signal); }
.bench-verdict.ready.alt b { color: var(--warn); }
.bench-verdict p { margin-top: 5px; font-size: 16px; line-height: 1.45; color: var(--on-ink-soft); }
.bench-verdict .bench-count { margin-top: 6px; font-family: var(--mono); font-size: 12.5px; color: var(--on-ink-soft); }
.bench-foot { grid-area: foot; font-family: var(--mono); font-size: 12.5px; color: var(--on-ink-soft); }

.flow { grid-area: flow; display: block; width: 100%; height: auto; align-self: center; }
.edges path { fill: none; stroke: var(--ink-line); stroke-width: 1.5; }
.trail { fill: none; stroke: var(--signal); stroke-width: 3; stroke-linecap: round; stroke-dasharray: 1; stroke-dashoffset: 1; }
.flow.alt .trail { stroke: var(--warn); }
.node rect { fill: var(--ink-3); stroke: var(--ink-line); stroke-width: 1.2; transition: fill 0.2s, stroke 0.2s; }
.node text { font-family: var(--mono); font-size: 13px; fill: var(--on-ink-soft); text-anchor: middle; transition: fill 0.2s; }
.node.on rect { stroke: var(--signal); stroke-width: 2; }
.node.on text { fill: var(--on-ink); }
.flow.alt .node.on rect { stroke: var(--warn); }
.node.fail rect { stroke: #b5786c; stroke-dasharray: 5 4; fill: transparent; }
.node.fail text { fill: #c48f84; text-decoration: line-through; }
.node.fail, .node.caught { animation: shake 0.4s; }
@keyframes shake {
  25% { transform: translateX(-5px); }
  50% { transform: translateX(5px); }
  75% { transform: translateX(-3px); }
}
.node.caught rect, .flow.alt .node.caught rect { stroke: #c48f84; stroke-width: 2; fill: rgba(196, 143, 132, 0.12); }
.node-out.on rect, .flow.alt .node-out.on rect { stroke-width: 1.2; }
.node-out.on rect { fill: var(--signal); }
.node-out.on text { fill: var(--ink); font-weight: 500; }
.flow.alt .node-out.on rect { fill: var(--warn); stroke: var(--warn); }
.packet { fill: var(--on-ink); }

/* ---- Proof strip ---- */
.hero > .wrap:last-child { margin-top: auto; }
.hero > .wrap:first-child { margin-block: auto; }
.proof {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin-top: clamp(36px, 5vw, 64px);
  border-top: 1px solid var(--ink-line);
}
.proof li { padding: 20px 24px 0 0; }
.proof li + li { padding-left: 24px; border-left: 1px solid var(--ink-line); }
.proof strong {
  display: block;
  font-family: var(--font-head);
  font-weight: 800;
  font-size: clamp(38px, 4.4vw, 56px);
  line-height: 1;
  letter-spacing: 0.004em;
  color: var(--signal);
}
.proof strong i, .stat-num i { font-style: normal; font-size: 0.55em; font-weight: 500; opacity: 0.8; }
.proof span { display: block; margin-top: 8px; max-width: 24em; font-size: 15px; color: var(--on-ink-soft); }

/* ---- Sections ---- */
.sec, .contact {
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-height: calc(var(--screen) - var(--bar));
  padding-block: clamp(60px, 8vw, 104px);
}
.sec-tight { padding-block: clamp(44px, 6vw, 72px); }
.sec-alt { background: var(--paper-2); }
/* ---- About: three-chapter scroll story ---- */
.story { padding-block: clamp(60px, 8vw, 100px) clamp(40px, 6vw, 70px); }
.story-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.08fr) minmax(0, 0.92fr);
  gap: clamp(28px, 5vw, 72px);
  align-items: start;
}
.stage-pin {
  position: sticky;
  top: calc(var(--bar) + var(--head));
  z-index: 2;
  display: flex;
  align-items: center;
  height: calc(var(--screen) - var(--bar) - var(--head));
}
.stage { width: 100%; }
html:not(.js) .stage-pin { display: none; }
html:not(.js) .story-grid { grid-template-columns: minmax(0, 1fr); }
.stage { padding: 12px 14px; background: var(--ink-2); border: 1px solid var(--ink-line); border-radius: 12px; }
.stage-top { display: flex; justify-content: space-between; gap: 12px; font-family: var(--mono); font-size: 13.5px; color: var(--signal); }
.stage-top span:last-child { color: var(--on-ink-soft); }
#stage-svg { display: block; width: 100%; height: auto; max-height: 52vh; margin-top: 6px; }
.scene { opacity: 0; --ln: var(--signal); }
.scene path, .scene circle { fill: none; }
.scene .d {
  stroke: var(--ln);
  stroke-width: 1.8;
  stroke-linejoin: round;
  stroke-dasharray: 1;
  stroke-dashoffset: calc(1 - var(--draw, 1));
  transition: stroke 0.3s;
}
.scene .flowline { stroke: var(--on-ink); stroke-width: 2.5; stroke-linecap: round; stroke-dasharray: 0.05 0.95; animation: run 2.6s linear infinite; }
@keyframes run { to { stroke-dashoffset: -1; } }
.silk { font-family: var(--mono); font-size: 13px; fill: var(--on-ink-soft); text-anchor: middle; }
.scene .ground { stroke: var(--ink-line); stroke-width: 1.5; }
.scene .track { stroke: var(--ln); stroke-width: 7; stroke-dasharray: 11 7; opacity: var(--draw, 1); }
.scene .wheel, .scene .wheel path { stroke: var(--ln); stroke-width: 1.8; opacity: var(--draw, 1); }
.scene .datal { stroke: var(--on-ink); stroke-width: 1.8; stroke-dasharray: 6 6; animation: dash 1.1s linear infinite; opacity: var(--data, 0); }
@keyframes dash { to { stroke-dashoffset: -24; } }
#scene-tank.fault { --ln: #c48f84; }
#scene-tank.fault .datal { stroke: #c48f84; }
#scene-ai .link { stroke: var(--ln); stroke-width: 1; opacity: 0.45; }
#scene-ai .nd { stroke: var(--ln); stroke-width: 1.8; fill: var(--ink-2); }
#scene-ai.drift { --ln: var(--warn); }
.gate { stroke: var(--signal); stroke-width: 3; stroke-dasharray: 9 7; }
.gate-text { fill: var(--signal); }
.scene .teach-dot { fill: var(--ln); transition: opacity 0.2s; }
.scene .teach-dot.b { fill: var(--warn); }
.spot { display: none; cursor: pointer; outline: none; }
.scene.live .spot { display: inline; }
.spot .hit { fill: transparent; }
.spot .core { fill: var(--warn); }
.spot .ring { fill: none; stroke: var(--warn); stroke-width: 2; transform-box: fill-box; transform-origin: center; animation: spot 1.8s infinite; }
@keyframes spot { 0% { transform: scale(0.6); opacity: 1; } 100% { transform: scale(1.8); opacity: 0; } }
.spot.active .core, .spot:hover .core { fill: var(--on-ink); }
.spot:focus-visible .hit { stroke: var(--signal); stroke-width: 2; }
.stage-info { min-height: 3em; margin-top: 8px; font-size: 15.5px; line-height: 1.5; color: var(--on-ink-soft); }
.stage-info b { color: var(--on-ink); font-weight: 600; }
.steps { min-width: 0; }
.step {
  display: flex;
  align-items: center;
  min-height: 75vh;
  font-family: var(--display);
  font-weight: 500;
  font-size: clamp(25px, 2.9vw, 37px);
  line-height: 1.2;
  letter-spacing: -0.015em;
}
html:not(.js) .step { min-height: 0; padding-block: 16px; }
.step:first-child { min-height: 70vh; }
.step mark { color: inherit; background: none; transition: color 0.35s; }
.step.on mark, html:not(.js) .step mark { color: var(--signal); }
.step.on mark.bad, html:not(.js) .step mark.bad { color: #c48f84; }
.step.on mark.warn, html:not(.js) .step mark.warn { color: var(--mark); }

/* Words arrive with the scroll */
.w { display: inline-block; transition: opacity 0.25s, transform 0.3s; }
.w:not(.lit) { opacity: 0.13; transform: translateY(7px); }

/* ---- Pinned headings and the Skills sequence ---- */
:root { --head: 0px; --screen: 100vh; --nav-room: 0px; }
@supports (height: 100svh) { :root { --screen: 100svh; } }
html.pin-on { --head: clamp(92px, 7.8vw, 112px); }
@media (max-width: 1020px) {
  html.pin-on { --head: 76px; }
}
.pin-head {
  margin-bottom: 26px;
  font-family: var(--font-head);
  font-weight: 800;
  font-size: clamp(38px, 4.9vw, 64px);
  line-height: 1;
  letter-spacing: 0.004em;
}
.pin-head span { display: inline-block; transform-origin: 0 0; }
.pin-on .pin-head span { opacity: 0; }
.pin-on .pin-head {
  position: sticky;
  top: var(--bar);
  z-index: 6;
  display: flex;
  align-items: center;
  height: var(--head);
  margin: 0;
}
.pin-on .pin-head::before {
  content: "";
  position: absolute;
  inset: 0 -100vmax;
  z-index: -1;
  background: var(--ink);
  border-bottom: 1px solid var(--ink-line);
  opacity: var(--settled, 0);
}
.pin-on .story { padding-top: 0; overflow-x: clip; }
.pin-on .story-grid { margin-top: 70vh; }

.pin-on .skills-sec { display: block; height: 440vh; padding: 0; }
.pin-on .pin-stage {
  position: sticky;
  top: var(--bar);
  height: calc(var(--screen) - var(--bar));
  overflow: hidden;
}
.pin-on .pin-stage .wrap { position: relative; height: 100%; }
.pin-on .pin-stage .pin-head { position: absolute; left: var(--gutter); right: var(--gutter); top: 0; }
.pin-on .pin-stage .pin-head::before { display: none; }
.pin-count { display: none; }
.pin-on .pin-count {
  position: absolute;
  top: calc(var(--head) / 2 - 10px);
  right: var(--gutter);
  display: block;
  font-family: var(--mono);
  font-size: 14px;
  color: var(--text-soft);
}
.pin-on .skills { position: absolute; inset: var(--head) var(--gutter) 0; }
.pin-on .skills > div {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: clamp(18px, 3vw, 34px);
  padding: 0 0 5vh;
  border: 0;
  perspective: 1000px;
  opacity: 0;
}
.pin-on .skills > div:first-child { padding-top: 0; }
.pin-on .skills dt {
  font-family: var(--font-head);
  font-weight: 800;
  font-size: clamp(50px, 8.8vw, 128px);
  line-height: 1;
  letter-spacing: 0.004em;
}
.pin-on .skills .chips { gap: clamp(8px, 1vw, 13px); }
.pin-on .skills .chips li {
  padding: clamp(5px, 0.7vw, 9px) clamp(11px, 1.2vw, 17px);
  font-size: clamp(14px, 1.45vw, 19px);
  background: var(--chip);
}

/* ---- Scroll progress ---- */
.progress {
  position: absolute;
  left: 0;
  right: 0;
  bottom: -1px;
  height: 2px;
  background: var(--fill);
  transform: scaleX(var(--p, 0));
  transform-origin: left;
}

/* ---- Skills ---- */
.skills > div {
  display: grid;
  grid-template-columns: 240px minmax(0, 1fr);
  gap: 16px;
  padding-block: 16px;
  border-bottom: 1px solid var(--paper-line);
}
.skills > div:first-child { padding-top: 0; }
.skills dt { font-weight: 600; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chips li {
  padding: 3px 10px;
  font-family: var(--mono);
  font-size: 13.5px;
  background: var(--chip);
  border: 1px solid var(--paper-line);
  border-radius: 5px;
}
.chips-quiet li { background: transparent; }
.chips li { transition: background 0.16s, color 0.16s, border-color 0.16s; }
.chips li:hover { color: var(--on-fill); background: var(--fill); border-color: var(--fill); }
.chips-small { margin-top: 14px; }
.chips-small li { font-size: 13px; }

/* ---- Projects ---- */
html:not(.pin-on) .case + .case {
  margin-top: clamp(52px, 7vw, 88px);
  padding-top: clamp(40px, 5vw, 60px);
  border-top: 1px solid var(--paper-line);
}
.proj-big { margin-bottom: 20px; font-family: var(--font-head); font-weight: 800; font-size: clamp(38px, 4.9vw, 64px); line-height: 1; letter-spacing: 0.004em; }
html:not(.pin-on) .proj-intro { width: 100%; max-width: 1240px; margin: 0 auto; padding-inline: var(--gutter); }
.pin-on #projects { display: block; padding: 0; overflow-x: clip; }
/* Projects title: fills the screen first, then lands as the section heading (script.js "Pinned headings") */
.pin-on .proj-intro { height: 160vh; }
.pin-on .proj-intro .pin-stage .proj-head { position: static; height: auto; padding-top: clamp(28px, 4vw, 56px); }
.proj-lead { max-width: 40em; color: var(--text-soft); font-size: clamp(16px, 1.3vw, 19px); }

.pin-on .case-head {
  position: sticky;
  top: var(--bar);
  z-index: 5;
  padding-block: 18px;
  opacity: 0;
}
.pin-on .case-head::before {
  content: "";
  position: absolute;
  inset: 0 -100vmax;
  z-index: -1;
  background: var(--paper-2);
  border-bottom: 1px solid var(--paper-line);
  opacity: var(--settled, 0);
}
.pin-on .case-head h3 { font-size: clamp(36px, 4.4vw, 60px); transform-origin: 0 100%; }
.pin-on .case-head p { font-size: clamp(15px, 1.25vw, 18px); }
.pin-on .case-head .btn { min-height: 42px; padding: 7px 18px; font-size: 15px; }
.pin-on .case-step:first-of-type { margin-top: 80vh; }
.pin-on .case-step {
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-height: calc(var(--screen) - var(--bar) - var(--case-head, 100px));
  padding-block: 18px;
}
.pin-on .case-step-short { min-height: 60vh; }
.pin-on .case-step:last-child { padding-bottom: clamp(60px, 9vw, 110px); }
.pin-on .case-step > * { transition: transform 0.28s ease-out, opacity 0.28s ease-out; }
.pin-on .case-step .bench, .pin-on .case-step .panel { margin-top: 0; }
.flow { scroll-margin-top: calc(var(--bar) + var(--case-head, 0px) + 10px); }
.tools-title {
  display: none;
  font-family: var(--font-head);
  font-weight: 800;
  font-size: clamp(38px, 5.8vw, 78px);
  line-height: 1;
  letter-spacing: 0.004em;
}
.pin-on .tools-title { display: block; }
.pin-on .tools .chips-small { margin-top: 22px; }
.pin-on .tools .chips li {
  padding: clamp(6px, 0.7vw, 9px) clamp(12px, 1.2vw, 18px);
  font-size: clamp(14px, 1.4vw, 19px);
  background: var(--chip);
  transition: transform 0.28s ease-out, opacity 0.28s ease-out, background 0.16s, color 0.16s;
}
.pin-on .more-read summary { padding-block: 18px; font-family: var(--display); font-weight: 700; font-size: clamp(21px, 2.4vw, 30px); }
.case-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px 24px;
  align-items: end;
}
.case-head h3 {
  grid-column: 1;
  font-family: var(--font-head);
  font-weight: 800;
  font-size: clamp(36px, 5.2vw, 64px);
  line-height: 1.02;
  letter-spacing: 0.004em;
}
.case-head p { grid-column: 1; font-size: clamp(18px, 1.6vw, 21px); color: var(--text-soft); }
.case-head .links { grid-column: 2; grid-row: 1 / span 2; }

.panel {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 20px clamp(20px, 3vw, 40px);
  margin-top: 14px;
  padding: 22px;
  color: var(--on-ink);
  background: var(--ink);
  border: 1px solid var(--paper-line);
  border-radius: 14px;
}
.panel-title { font-family: var(--mono); font-size: 13.5px; color: var(--signal); }
.stat { margin-top: 12px; font-size: 15.5px; line-height: 1.4; color: var(--on-ink-soft); }
.stat-num {
  font-family: var(--font-head);
  font-weight: 800;
  font-size: 50px;
  line-height: 1.02;
  letter-spacing: 0.004em;
  color: var(--on-ink);
}
.dots { display: flex; flex-wrap: wrap; gap: 4px; max-width: 251px; margin-block: 8px 6px; }
.dots span {
  width: 13px;
  height: 13px;
  border-radius: 3px;
  border: 1.5px solid var(--signal);
  background: var(--fill);
  transition: opacity 0.3s, transform 0.3s;
  transition-delay: calc(var(--i) * 28ms);
}
.dots span.miss { background: transparent; border-color: var(--warn); }
.dots-warn span:not(.miss) { background: var(--warn); border-color: var(--warn); }
.js .dots:not(.in) span { opacity: 0; transform: scale(0.4); }
.panel-note {
  grid-column: 1 / -1;
  padding-top: 14px;
  font-size: 14px;
  line-height: 1.5;
  color: var(--on-ink-soft);
  border-top: 1px solid var(--ink-line);
}
.panel-note b { color: var(--on-ink); font-weight: 600; }
.more-read { margin-top: 16px; border-top: 1px solid var(--paper-line); border-bottom: 1px solid var(--paper-line); }
.more-read summary { padding-block: 14px; font-weight: 600; cursor: pointer; }
.case-copy { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px clamp(24px, 4vw, 48px); padding-bottom: 20px; }
.case-copy h4 { font-family: var(--mono); font-weight: 500; font-size: 13.5px; color: var(--signal-deep); }
.case-copy p { margin-top: 4px; }

/* ---- Experience ---- */
.exp-lead {
  margin-top: 10px;
  max-width: 30em;
  font-family: var(--display);
  font-weight: 700;
  font-size: clamp(22px, 2.7vw, 36px);
  line-height: 1.12;
  letter-spacing: -0.015em;
}
.exp-window { padding-inline: var(--gutter); }
.exp-track { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr)); gap: 16px; max-width: 1160px; margin: 24px auto 0; }
.xcard {
  display: flex;
  flex-direction: column;
  padding: 18px;
  background: var(--ink-2);
  border: 1px solid var(--ink-line);
  border-radius: 14px;
  transition: border-color 0.3s, background 0.3s;
}
.xcard h3 { font-family: var(--display); font-weight: 700; font-size: clamp(21px, 2vw, 26px); line-height: 1.15; }
.xcard p { margin-top: 6px; font-size: 16px; line-height: 1.45; color: var(--on-ink-soft); }
.xcard-role { justify-content: center; }
.xcard-role time { font-family: var(--mono); font-size: 14px; color: var(--signal); }
.xcard-role h3 { margin-top: 10px; font-size: clamp(30px, 3.2vw, 44px); line-height: 1.04; letter-spacing: -0.02em; }
.xart { min-height: 150px; margin-bottom: 12px; }
.xart svg { display: block; width: 100%; height: 110px; }
.xart path, .xart rect, .xart circle { fill: none; }
.xgrid { stroke: var(--ink-line); stroke-width: 1; }
.xart .xrow rect { fill: var(--signal); animation: slide 4s linear infinite; }
.xart .r2 rect { fill: var(--warn); animation-duration: 4s; }
.xart .r3 rect { fill: var(--on-ink-soft); }
@keyframes slide { to { transform: translateX(-100px); } }
.xnow { stroke: var(--on-ink); stroke-width: 1.5; stroke-dasharray: 4 4; }
.xbox { stroke: var(--signal); stroke-width: 2; }
.xlink { stroke: var(--ink-line); stroke-width: 2; transition: stroke 0.2s; }
.xlink.on { stroke: var(--signal); stroke-dasharray: 8 7; animation: dash 0.9s linear infinite; }
.xbtns { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 5px; margin-top: 4px; }
.xbtns button, .xrun {
  min-height: 34px;
  padding: 4px 6px;
  font-family: var(--mono);
  font-size: 12.5px;
  color: var(--on-ink);
  background: transparent;
  border: 1px solid var(--ink-line);
  border-radius: 6px;
  cursor: pointer;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}
.xbtns button:hover, .xrun:hover { border-color: var(--signal); }
.xbtns button[aria-pressed="true"], .xrun { color: var(--on-fill); background: var(--fill); border-color: var(--fill); }
.xdraw { stroke: var(--signal); stroke-width: 2.5; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 1; stroke-dashoffset: 1; }
.xcard.seen .xdraw, html:not(.pin-on) .xdraw { stroke-dashoffset: 0; transition: stroke-dashoffset 1.2s ease-out; }
.xcard.seen .xdraw.x2 { transition-delay: 0.7s; }
.xart .xdot { fill: var(--signal); }
.xchecks { display: grid; gap: 5px; min-height: 96px; font-family: var(--mono); font-size: 13.5px; color: var(--on-ink-soft); }
.xchecks li { display: flex; align-items: center; gap: 9px; transition: color 0.25s; }
.xchecks li::before { content: ""; flex: none; width: 15px; height: 15px; border: 1.5px solid var(--ink-line); border-radius: 4px; transition: background 0.25s, border-color 0.25s; }
.xchecks li.ok { color: var(--on-ink); }
.xchecks li.ok::before { background: var(--fill); border-color: var(--fill); }
.xrun { width: 100%; min-height: 40px; margin-top: 8px; font-size: 13.5px; font-weight: 500; }
.xrun:disabled { opacity: 0.6; cursor: default; }
html:not(.js) .xbtns, html:not(.js) .xrun { display: none; }

.pin-on .exp-run { height: 420vh; }
.pin-on .exp-run .pin-stage { display: flex; flex-direction: column; }
.pin-on .exp-run .pin-stage .wrap { height: auto; }
.pin-on .exp-run .wrap:first-child { padding-top: var(--head); }
.pin-on .exp-lead { opacity: 0; }
.pin-on .exp-window {
  flex: 1;
  display: flex;
  align-items: center;
  min-height: 0;
  padding: 0;
  overflow: hidden;
}
.pin-on .exp-track {
  position: relative;
  display: flex;
  align-items: stretch;
  gap: 18px;
  max-width: none;
  width: max-content;
  margin: 0;
  padding-inline: max(var(--gutter), calc((100vw - 1160px) / 2));
  opacity: 0;
}
.pin-on .xcard { width: clamp(286px, 33vw, 520px); opacity: 0.55; transition: opacity 0.35s, border-color 0.35s, transform 0.35s; }
.pin-on .xcard.now { opacity: 1; border-color: var(--signal); transform: translateY(-6px); }
.pin-on .xcard p { font-size: clamp(15px, 1.15vw, 18px); }
.pin-on .xart svg { height: clamp(100px, 17vh, 180px); }
.exp-rail { display: none; }
.pin-on .exp-rail { display: block; height: 3px; margin-block: 8px 22px; background: var(--ink-line); border-radius: 3px; overflow: hidden; }
.exp-rail span { display: block; height: 100%; background: var(--fill); transform: scaleX(var(--p, 0)); transform-origin: left; }

.flip-run { padding-block: clamp(56px, 8vw, 96px); background: var(--paper-2); }
.flip-run.shade-a { background: var(--ink); }
.pin-on .flip-run { height: 300vh; padding: 0; overflow-x: clip; }
.pin-on .flip-body {
  position: absolute;
  inset: var(--head) var(--gutter) 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
}
.flip-slot { grid-column: span 2; min-width: 0; display: grid; }
.flip-slot:nth-child(n + 4) { grid-column: span 3; }
.pin-on .flip-slot { opacity: 0; transition: transform 0.25s ease-out, opacity 0.25s ease-out; }
.flips { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 14px; margin-top: 26px; perspective: 1400px; }
.flip {
  display: grid;
  min-height: clamp(190px, 26vh, 280px);
  padding: 0;
  text-align: left;
  color: inherit;
  background: none;
  border: 0;
  cursor: pointer;
  transform-style: preserve-3d;
  transition: transform 0.6s cubic-bezier(0.3, 1.3, 0.5, 1);
}
.flip:hover { transform: translateY(-4px) rotateY(5deg); }
.flip[aria-pressed="true"] { transform: rotateY(180deg); }
.flip-face {
  grid-area: 1 / 1;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 16px;
  padding: 20px;
  border-radius: 14px;
  backface-visibility: hidden;
}
.flip-face small { font-family: var(--mono); font-size: 13px; }
.flip-face b { font-family: var(--display); font-weight: 700; font-size: clamp(22px, 2.2vw, 28px); line-height: 1.15; }
.flip-front { background: var(--ink); border: 1px solid var(--paper-line); }
.flip-front small { color: var(--signal); }
.flip-front::after { content: "Flip"; align-self: flex-end; font-family: var(--mono); font-size: 13px; color: var(--signal); }
.flip-back { color: var(--on-fill); background: var(--fill); transform: rotateY(180deg); }
.flip-back b { font-size: clamp(19px, 1.8vw, 23px); font-weight: 700; }
html:not(.js) .flip { cursor: default; gap: 6px; }
html:not(.js) .flip-front { grid-area: 1 / 1; }
html:not(.js) .flip-back { grid-area: 2 / 1; transform: none; }

/* ---- Sections with a landing heading ---- */
.run-sec { position: relative; padding-block: clamp(60px, 8vw, 104px); }
.pin-on .run-sec { padding-top: 0; overflow-x: clip; }
.pin-on .run-sec .pin-head::before { background: var(--paper); border-color: var(--paper-line); }
.pin-on .run-sec.sec-alt .pin-head::before { background: var(--paper-2); }
.pin-on .run-body { margin-top: 100vh; }
.pin-on .run-sec { padding-bottom: 0; }
#more-start { scroll-margin-top: var(--head); }
.jump-mark { position: absolute; }
.pin-on .exp-run { position: relative; }
.pin-on .jump-mark { top: calc((420vh - 100vh + var(--bar)) * 0.2 + 16px); }

/* ---- The rest of the story ---- */
.more-step { margin-bottom: 40px; }
.group-title {
  margin-bottom: 16px;
  font-family: var(--font-head);
  font-weight: 800;
  font-size: clamp(42px, 6.8vw, 96px);
  line-height: 1;
  letter-spacing: 0.004em;
}
.pin-on .more-step {
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-height: calc(var(--screen) - var(--bar) - var(--head));
  margin: 0;
  padding-block: 20px;
}
.pin-on .group-title, .pin-on .more-step .build, .pin-on .more-step .edu article {
  transition: transform 0.26s ease-out, opacity 0.26s ease-out, border-color 0.2s, background 0.2s;
}
.pin-on .more-step .builds, .pin-on .more-step .edu { perspective: 1200px; }
.builds { display: grid; grid-auto-flow: dense; gap: 12px; }
.builds-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.builds-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.builds-5 { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.pin-on .build-btn { min-height: clamp(180px, 30vh, 300px); }
.pin-on .builds-2 .build-btn svg, .pin-on .builds-3 .build-btn svg { width: 84px; height: 84px; }
.builds-2 .build-name, .builds-3 .build-name { font-size: clamp(28px, 3vw, 42px); }
.build {
  overflow: hidden;
  background: var(--chip);
  border: 1px solid var(--paper-line);
  border-radius: 12px;
  transition: border-color 0.2s, background 0.2s;
}
.build:hover { border-color: var(--signal); }
.build-btn {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: 100%;
  height: 100%;
  min-height: 176px;
  padding: 16px;
  text-align: left;
  color: inherit;
  background: none;
  border: 0;
  cursor: pointer;
  transition: transform 0.15s;
}
.build-btn:hover { transform: perspective(600px) rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg)); }
/* The card is the main thing; its pill is a secondary action. At rest the pill is a soft tint of the
   accent (clearly a button, quieter than the card title). It fills solid only when the card is hovered
   or focused, so it never competes with the content. */
.js .build-btn::after {
  content: "Open +";
  position: absolute;
  top: 14px;
  right: 14px;
  padding: 5px 12px;
  font-family: var(--mono);
  font-size: 13px;
  font-weight: 500;
  color: var(--signal);
  background: color-mix(in srgb, var(--signal) 16%, transparent);
  border: 1px solid color-mix(in srgb, var(--signal) 45%, transparent);
  border-radius: 999px;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}
.build-btn:hover::after, .build-btn:focus-visible::after { color: var(--on-fill); background: var(--fill); border-color: var(--fill); }
.build:hover { background: rgba(255, 255, 255, 0.06); }
.build-btn svg { flex: none; width: 58px; height: 58px; fill: none; stroke: var(--signal); stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; transition: transform 0.25s, stroke 0.2s; }
.build-btn:hover svg { transform: scale(1.14) rotate(-4deg); stroke: var(--warn); }
.build-name { margin-top: auto; font-family: var(--font-head); font-weight: 800; font-size: clamp(24px, 2.2vw, 30px); line-height: 1.04; letter-spacing: 0.004em; }
.build-btn small { font-family: var(--mono); font-size: 13px; color: var(--signal-deep); }
.build-body { padding: 0 16px 16px; }
.js .build-body { display: none; }
.build-body p { font-size: 16px; line-height: 1.5; color: var(--text-soft); }
.build-body a { display: inline-block; margin-top: 10px; padding-block: 4px; font-weight: 600; color: var(--signal); text-underline-offset: 3px; }
.build-meta { margin-top: 3px; font-family: var(--mono); font-size: 13px; color: var(--signal-deep); }

/* ---- Project pop-up ---- */
.detail {
  width: min(900px, calc(100vw - 2 * var(--gutter)));
  max-height: calc(var(--screen) - 40px);
  margin: auto;
  padding: 0;
  overflow-y: auto;
  color-scheme: dark;
  color: var(--on-ink);
  background: var(--ink);
  border: 1px solid var(--signal);
  border-radius: 16px;
}
.detail[open] { display: grid; grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.2fr); animation: detail-in 0.32s cubic-bezier(0.2, 0.9, 0.3, 1.1); }
.detail::backdrop { background: rgba(15, 15, 16, 0.86); }
@keyframes detail-in { from { opacity: 0; transform: translateY(26px) scale(0.93); } }
.detail :focus-visible { outline-color: var(--signal); }
.detail-close {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 1;
  width: 42px;
  height: 42px;
  color: var(--on-ink);
  background: var(--ink-3);
  border: 1px solid var(--ink-line);
  border-radius: 50%;
  cursor: pointer;
}
.detail-close:hover { border-color: var(--signal); }
.detail-art { display: grid; place-items: center; min-height: 320px; background: var(--paper-2); }
.detail-art svg { width: 150px; height: 150px; fill: none; stroke: var(--signal); stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.detail-copy { display: flex; flex-direction: column; align-items: flex-start; padding: 26px; }
.detail-group { font-family: var(--mono); font-size: 13.5px; color: var(--signal); }
.detail h3 { margin-top: 6px; padding-right: 40px; font-family: var(--font-head); font-weight: 800; font-size: clamp(34px, 4vw, 52px); line-height: 1.02; }
.detail-meta { margin-top: 4px; font-family: var(--mono); font-size: 13.5px; color: var(--on-ink-soft); }
.detail-text { margin-block: 14px; font-size: 17px; line-height: 1.55; color: var(--on-ink-soft); }
.detail-nav { display: flex; justify-content: space-between; align-items: center; gap: 10px; width: 100%; margin-top: auto; padding-top: 16px; font-family: var(--mono); font-size: 13px; color: var(--on-ink-soft); }
.detail-nav button { min-height: 40px; padding: 4px 8px; color: var(--on-ink); background: none; border: 0; cursor: pointer; }
.detail-nav button:hover { color: var(--signal); }

/* ---- Education ---- */
.edu { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; align-items: stretch; }
.edu article { padding: 20px; background: var(--chip); border: 1px solid var(--paper-line); border-radius: 14px; }
.edu h3 { font-family: var(--font-head); font-weight: 800; font-size: clamp(26px, 2.5vw, 34px); line-height: 1.04; letter-spacing: 0.004em; }
.edu p:not(.build-meta) { margin-top: 8px; font-size: 16px; line-height: 1.5; color: var(--text-soft); }
.edu-lang b { font-weight: 600; color: var(--text); }
.dial { position: relative; width: min(180px, 60%); margin-bottom: 14px; }
.dial svg { display: block; transform: rotate(-90deg); }
.dial circle { fill: none; stroke-width: 9; }
.dial-back { stroke: var(--paper-line); }
.dial-fill { stroke: var(--signal); stroke-linecap: round; stroke-dasharray: 1; stroke-dashoffset: var(--dial, 0.153); }
.dial span { position: absolute; inset: 0; display: grid; place-items: center; font-family: var(--font-head); font-weight: 800; font-size: clamp(40px, 4.4vw, 58px); }
.cert-lead, .js .cert-full { display: none; }
.js .cert-lead { display: block; }
.pipe { display: none; }
.js .pipe { display: block; margin-top: 14px; }
.pipe-steps { position: relative; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 4px; }
.pipe-steps button {
  min-height: 42px;
  padding: 4px 2px;
  font-family: var(--mono);
  font-size: 12.5px;
  color: var(--text);
  background: transparent;
  border: 1px solid var(--paper-line);
  border-radius: 6px;
  cursor: pointer;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}
.pipe-steps button:hover { border-color: var(--signal); }
.pipe-steps button.past { border-color: var(--signal); color: var(--signal); }
.pipe-steps button[aria-pressed="true"] { color: var(--on-fill); background: var(--fill); border-color: var(--fill); }
.pipe-bar { height: 3px; margin-top: 8px; background: var(--paper-line); border-radius: 3px; overflow: hidden; }
.pipe-bar span { display: block; height: 100%; background: var(--fill); transform: scaleX(var(--p, 0.25)); transform-origin: left; transition: transform 0.35s ease-out; }
.edu .pipe-text { min-height: 4.6em; margin-top: 10px; color: var(--text); }

/* ---- Contact ---- */
.contact h2 { margin-top: 0; max-width: 12em; }
.contact-list { margin-top: clamp(32px, 5vw, 56px); border-top: 1px solid var(--ink-line); }
.contact-list a {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: baseline;
  gap: 2px 20px;
  padding-block: 16px;
  text-decoration: none;
  border-bottom: 1px solid var(--ink-line);
  transition: color 0.15s, padding 0.2s;
}
.contact-list span { font-family: var(--mono); font-size: 14px; color: var(--on-ink-soft); }
.contact-list b { font-family: var(--display); font-weight: 700; font-size: clamp(20px, 3vw, 32px); min-width: 0; }
.contact-list a:hover { color: var(--signal); padding-inline: 8px; }

.foot { padding-block: 22px; font-size: 14px; color: var(--on-ink-soft); }
.foot-in { display: flex; justify-content: space-between; gap: 16px; }
.foot a { text-underline-offset: 3px; }

/* ---- Animations on or off ---- */
.motion-toggle {
  display: none;
  padding: 4px 0;
  font: inherit;
  color: inherit;
  text-decoration: underline;
  text-underline-offset: 3px;
  background: none;
  border: 0;
  cursor: pointer;
}
.js .foot .motion-toggle { display: inline-block; }
.js .nav .motion-toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-left: 10px;
  padding: 6px 0 6px 14px;
  font-size: 14px;
  color: var(--on-ink-soft);
  text-decoration: none;
  white-space: nowrap;
  border-left: 1px solid var(--ink-line);
}
.js .nav .motion-toggle:hover { color: var(--on-ink); }
.motion-switch i {
  position: relative;
  width: 30px;
  height: 17px;
  background: var(--ink-3);
  border: 1px solid var(--ink-line);
  border-radius: 9px;
}
.motion-switch i::after {
  content: "";
  position: absolute;
  top: 2px;
  left: 2px;
  width: 11px;
  height: 11px;
  background: var(--on-ink-soft);
  border-radius: 50%;
}
.motion-switch[aria-checked="true"] i::after { left: 15px; background: var(--signal); }
.foot-in { align-items: center; flex-wrap: wrap; }

/* ---- Previous and Next (phones and tablets) ----
   Touch devices move one stop per tap (script.js "One tap, one step"). Each tap plays the next part of
   the animation, so these devices keep the original, longer scroll runways. */
html.step-buttons { overflow: hidden; overscroll-behavior: none; --nav-room: 80px; }
html.step-buttons, html.step-buttons body { touch-action: pinch-zoom; }
.detail { touch-action: pan-y pinch-zoom; overscroll-behavior: contain; }
.step-nav {
  position: fixed;
  right: 14px;
  bottom: calc(14px + env(safe-area-inset-bottom));
  z-index: 40;
  display: flex;
  gap: 8px;
}
.step-nav[hidden] { display: none; }
.step-nav button {
  min-width: 92px;
  min-height: 48px;
  padding: 8px 14px;
  font-family: var(--display);
  font-size: 15px;
  font-weight: 600;
  border: 0;
  border-radius: 999px;
  cursor: pointer;
}
#next-btn, #back-btn { color: #e4e4e6; background: #2a2a2d; border: 1px solid #5c5c61; }
.step-nav button:disabled { opacity: 0.4; cursor: default; }
.step-buttons.pin-on .skills-sec { height: 860vh; }
.step-buttons.pin-on .exp-run { height: 680vh; }
.step-buttons.pin-on .jump-mark { top: calc((680vh - 100vh + var(--bar)) * 0.2 + 16px); }
/* Phones (720 px and below) keep "What I carried into AI" at its natural height, as before; only wider
   touch screens get the long runway. */
@media (min-width: 721px) { .step-buttons.pin-on .flip-run { height: 460vh; } }
.step-buttons.pin-on .story-grid { margin-top: 135vh; }
.step-buttons.pin-on .case-step:first-of-type { margin-top: 125vh; }
.step-buttons .step { min-height: 120vh; }
.step-buttons .step:first-child { min-height: 90vh; }

/* Short button labels for small screens, so the hero buttons stay side by side */
.lbl-short { display: none; }

/* ---- Scroll reveal ---- */
.js .reveal { opacity: 0; transform: translateY(16px); transition: opacity 0.6s, transform 0.6s; }
.js .reveal.in { opacity: 1; transform: none; }

/* ---- Contact button, always in the top bar ---- */
.bar-end { display: flex; align-items: center; gap: 10px; }
.bar-cta { min-height: 38px; padding: 6px 16px; font-size: 15px; white-space: nowrap; }
.bar-cta:hover { opacity: 1; background: var(--on-ink); }

/* ---- Buttons: one consistent language ----
   Primary = solid fill. Secondary = outline. Demo = pastel with ▶. Expander = full-width row with a chevron.
   Everything clickable has a visible hover, press and keyboard state. */
.btn:active, .deep-toggle:active, .more-read summary:active { transform: translateY(1px) scale(0.99); }
.btn-line, .btn-line-dark { gap: 8px; }
.btn-line:hover { background: var(--ink-3); }
:focus-visible { outline-offset: 3px; }

.more-read summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding-inline: 14px;
  list-style: none;
  border-radius: 8px;
  transition: background 0.15s, color 0.15s;
}
.more-read summary::-webkit-details-marker { display: none; }
.more-read summary::after {
  content: "+";
  flex: none;
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  font-family: var(--mono);
  font-size: 20px;
  color: var(--signal);
  border: 1px solid var(--signal);
  border-radius: 50%;
  transition: transform 0.2s, background 0.15s, color 0.15s;
}
.more-read[open] summary::after { content: "−"; }
.more-read summary:hover { background: rgba(255, 255, 255, 0.05); color: var(--signal); }
.more-read summary:hover::after { color: var(--on-fill); background: var(--fill); border-color: var(--fill); }
.more-read[open] > :not(summary) { margin-top: 16px; }
.more-read .tools { margin-top: 24px; }
.more-read .tools-title { display: block; font-family: var(--display); font-size: 18px; font-weight: 700; }
.more-read .case-copy { margin-top: 24px; }

/* Project summary: who it is for, the result, three numbers */
.case-sum { display: grid; gap: 20px; }
.case-pitch { max-width: 46em; font-size: clamp(17px, 1.4vw, 20px); line-height: 1.5; color: var(--text-soft); }
.case-pitch b { color: var(--text); }
.headline { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.headline li { display: grid; gap: 4px; padding: 16px 18px; background: var(--chip); border: 1px solid var(--paper-line); border-radius: 12px; }
.headline b { font-family: var(--font-head); font-weight: 800; font-size: clamp(38px, 4vw, 56px); line-height: 1; color: var(--signal); }
.headline i { font-style: normal; font-size: 0.5em; color: var(--text-soft); }
.headline span { font-size: 15px; line-height: 1.4; color: var(--text-soft); }

/* Services */
.svc-sec { padding-block: clamp(64px, 9vw, 112px); }
.svc-title { font-family: var(--font-head); font-weight: 800; font-size: clamp(38px, 4.9vw, 64px); line-height: 1; letter-spacing: 0.004em; }
.svc-sec .proj-lead { margin-top: 12px; color: var(--on-ink-soft); }
.svc-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; margin-top: 32px; }
.svc { display: flex; flex-direction: column; gap: 10px; padding: 22px; background: var(--ink-2); border: 1px solid var(--ink-line); border-radius: 14px; }
.svc-kicker { font-family: var(--mono); font-size: 13px; color: var(--signal); }
.svc h3 { font-family: var(--display); font-weight: 700; font-size: clamp(20px, 1.8vw, 24px); line-height: 1.2; }
.svc p { line-height: 1.5; color: var(--on-ink-soft); }
.svc .svc-meta { margin-top: auto; padding-top: 8px; font-family: var(--mono); font-size: 13px; color: var(--on-ink); }
.how { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin-top: 28px; counter-reset: how; }
.how li { display: grid; gap: 4px; padding-top: 14px; border-top: 2px solid var(--ink-line); counter-increment: how; }
.how b::before { content: counter(how) ". "; color: var(--signal); }
.how span { font-size: 15px; color: var(--on-ink-soft); }
.svc-sec .actions { margin-top: 32px; }

/* The full story button */
.deep { padding-block: clamp(48px, 7vw, 88px); background: var(--paper-2); border-top: 1px solid var(--paper-line); border-bottom: 1px solid var(--paper-line); }
/* Parts of the full story that are not open (a card opens only its own part) */
#deep-body [hidden] { display: none !important; }
.deep-in { display: grid; justify-items: center; gap: 18px; text-align: center; }
.deep-note { max-width: 34em; color: var(--text-soft); font-size: clamp(16px, 1.3vw, 19px); }
.deep-title { font-family: var(--font-head); font-weight: 800; font-size: clamp(34px, 4.2vw, 56px); line-height: 1; letter-spacing: 0.004em; }

/* Table of contents for the full story: each tile opens it at that part */
.deep-tiles { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; width: 100%; margin-block: 6px 10px; text-align: left; }
.deep-tiles a {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 6px;
  height: 100%;
  min-height: 150px;
  padding: 18px 18px 16px;
  color: inherit;
  text-decoration: none;
  background: var(--chip);
  border: 1px solid var(--paper-line);
  border-radius: 14px;
  transition: border-color 0.15s, background 0.15s, transform 0.15s;
}
.deep-tiles a::after {
  content: "→";
  position: absolute;
  top: 14px;
  right: 14px;
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  font-size: 16px;
  color: var(--signal);
  border: 1px solid var(--signal);
  border-radius: 50%;
  transition: background 0.15s, color 0.15s, transform 0.15s;
}
.deep-tiles a:hover { border-color: var(--signal); background: rgba(255, 255, 255, 0.06); transform: translateY(-3px); }
.deep-tiles a:hover::after { color: var(--on-fill); background: var(--fill); transform: translateX(2px); }
.deep-tiles a:active { transform: translateY(0) scale(0.99); }
.deep-tiles small { padding-right: 36px; font-family: var(--mono); font-size: 13px; color: var(--signal); }
.deep-tiles b { margin-top: auto; font-family: var(--display); font-weight: 700; font-size: clamp(19px, 1.7vw, 23px); line-height: 1.15; }
.deep-tiles span { font-size: 14.5px; line-height: 1.4; color: var(--text-soft); }
#skills { scroll-margin-top: var(--bar); }
#edu-start { scroll-margin-top: calc(var(--bar) + var(--head)); }

/* Core stack strip in Services */
.stack { margin-top: 28px; }
.stack-title { margin-bottom: 10px; font-family: var(--mono); font-size: 13px; color: var(--signal); }
.stack .chips li { color: var(--on-ink); background: var(--ink-2); border-color: var(--ink-line); }
.deep-toggle {
  display: inline-flex;
  align-items: center;
  gap: 14px;
  min-height: 60px;
  padding: 12px 18px 12px 28px;
  font-family: var(--display);
  font-weight: 700;
  font-size: clamp(19px, 2vw, 24px);
  color: var(--text);
  background: var(--chip);
  border: 1.5px solid var(--signal);
  border-radius: 999px;
  cursor: pointer;
  transition: background 0.15s, color 0.15s, transform 0.15s;
}
.deep-toggle:hover { color: var(--on-fill); background: var(--fill); }
.deep-icon { display: grid; place-items: center; width: 36px; height: 36px; color: var(--on-fill); background: var(--fill); border-radius: 50%; transition: transform 0.25s; }
.deep-toggle:hover .deep-icon { color: var(--fill); background: var(--on-fill); }
.deep-toggle[aria-expanded="true"] .deep-icon { transform: rotate(180deg); }
.pin-on .deep-toggle[aria-expanded="false"] .deep-icon { animation: nudge 1.8s ease-in-out infinite; }
@keyframes nudge { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(4px); } }

/* Flip cards say they flip */
.flip-front::after {
  content: "↻ Tap to flip";
  padding: 5px 12px;
  background: color-mix(in srgb, var(--signal) 16%, transparent);
  border: 1px solid color-mix(in srgb, var(--signal) 45%, transparent);
  border-radius: 999px;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}
.flip:hover .flip-front::after, .flip:focus-visible .flip-front::after { color: var(--on-fill); background: var(--fill); border-color: var(--fill); }
.flip-back::after { content: "↻ Back"; align-self: flex-end; font-family: var(--mono); font-size: 13px; }
.flip:hover .flip-front { border-color: var(--signal); }

/* Story board: the hint reads as an instruction, not a caption */
.stage-info { padding-left: 12px; border-left: 2px solid var(--warn); color: var(--on-ink); }

/* Emulation button looks like a button */
.xrun { color: var(--on-fill); background: var(--fill); border: 0; border-radius: 8px; cursor: pointer; }
.xrun::before { content: "▶ "; }
.xbtns button { cursor: pointer; }

.contact .actions { margin-top: 28px; }
.contact-also { margin-top: 18px; font-size: 15px; color: var(--on-ink-soft); }
.rotor { overflow: clip; }

/* ---- Responsive ---- */
@media (max-width: 1020px) {
  .svc-grid { grid-template-columns: minmax(0, 1fr); }
  .deep-tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .how { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .hero-sub { grid-template-columns: minmax(0, 1fr); }
  .bench { grid-template-columns: minmax(0, 1fr); grid-template-areas: "side" "flow" "verdict" "foot"; grid-template-rows: none; }
  .flow { max-width: 470px; margin-inline: auto; }
  .story-grid { grid-template-columns: minmax(0, 1fr); display: block; }
  .stage-pin { display: block; height: auto; top: calc(var(--bar) + var(--head)); margin-inline: calc(var(--gutter) * -1); padding: 6px var(--gutter) 8px; background: var(--ink); }
  #stage-svg { height: 26vh; max-height: 250px; margin-inline: auto; }
  .stage-info { min-height: 3em; margin-top: 2px; font-size: 14.5px; }
  .hero { padding-bottom: calc(var(--nav-room) + 10px); }
  .pin-on .skills > div { padding-bottom: var(--nav-room); }
  .pin-on .exp-rail { margin-bottom: var(--nav-room); }
  .pin-on .case-head { padding-block: 16px; }
  .pin-on .exp-window { align-items: flex-start; padding-top: 14px; }
  .pin-on .exp-lead { margin-top: 2px; }
  .pin-on .more-step { padding-block: 16px; }
  .foot { padding-bottom: var(--nav-room); }
  .step { min-height: 80vh; }
  .step:first-child { min-height: 70vh; }
  .step-buttons .step { min-height: 105vh; }
  .step-buttons .step:first-child { min-height: 90vh; }
  .panel { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .flip-slot, .flip-slot:nth-child(n + 4) { grid-column: span 3; }
  .edu { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .builds-5 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .edu-main { grid-column: span 2; }
}

@media (max-width: 1020px) and (max-height: 700px) {
  #stage-svg { height: 19vh; }
  .step { font-size: 21px; }
  .pin-on .xart svg { height: 76px; }
  .pin-on .xart { min-height: 100px; }
}

@media (max-width: 1020px) and (max-height: 620px) {
  #stage-svg { height: 16vh; }
  .stage-info { display: none; }
  .step { font-size: 18px; }
  .pin-on .exp-lead { display: none; }
  .xcard p { font-size: 14px; }
}

/* Top bar collapses to the Menu button on tablets and phones (the full row wraps to two lines below ~1020px) */
@media (max-width: 1020px) {
  .menu-btn {
    display: inline-flex;
    align-items: center;
    min-height: 40px;
    padding: 6px 14px;
    background: transparent;
    border: 1px solid var(--ink-line);
    border-radius: 6px;
    cursor: pointer;
  }
  .nav {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    display: none;
    flex-direction: column;
    padding: 8px var(--gutter) 14px;
    background: var(--ink);
    border-bottom: 1px solid var(--ink-3);
  }
  .nav.open { display: flex; }
  .nav a { padding: 11px 10px; font-size: 17px; }
  .js .nav .motion-toggle { display: flex; justify-content: space-between; margin-left: 0; padding: 11px 10px; font-size: 17px; border-left: 0; }
}

/* Small phones (320 to 400px): keep logo, Contact and Menu on one row without touching */
@media (max-width: 400px) {
  .topbar-in { gap: 8px; }
  .brand { gap: 6px; font-size: 15px; flex: none; white-space: nowrap; }
  .brand svg { width: 20px; height: 13px; flex: none; }
  .bar-end { gap: 6px; flex: none; }
  .bar-cta { padding: 6px 9px; font-size: 13.5px; }
  .menu-btn { padding: 6px 9px; font-size: 14px; }
}

@media (max-width: 720px) {
  body { font-size: 16px; }
  .bar-end { gap: 8px; }
  .bar-cta { min-height: 40px; padding: 6px 12px; font-size: 14.5px; }
  .headline { grid-template-columns: minmax(0, 1fr); }
  .hero .lede.hero-tagline { margin-top: 14px; font-size: 18px; }
  .headline li { grid-template-columns: auto minmax(0, 1fr); align-items: center; gap: 14px; padding: 12px 14px; }
  .how { grid-template-columns: minmax(0, 1fr); }
  .deep-toggle { width: 100%; justify-content: space-between; }
  .deep-tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .deep-tiles a { min-height: 132px; padding: 14px 14px 12px; }
  .deep-tiles span { display: none; }
  .lbl-long { display: none; }
  .lbl-short { display: inline; }
  .contact .actions, .svc-sec .actions { flex-wrap: wrap; }
  .contact .actions .btn, .svc-sec .actions .btn { flex: 1 1 100%; justify-content: center; }
  .proof { margin-top: 18px; }
  .proof li { padding: 10px 12px 0 0; }
  .proof li + li { padding-left: 12px; }
  .proof strong { font-size: 34px; }
  .proof span { margin-top: 3px; font-size: 13.5px; line-height: 1.3; }
  h1 { font-size: min(calc((100vw - 2 * var(--gutter)) / 7.2), 76px); margin-top: 12px; }
  .lede { margin-top: 12px; font-size: 16px; }
  .actions { flex-wrap: nowrap; margin-top: 14px; gap: 8px; }
  .actions .btn { min-height: 42px; padding: 7px 14px; font-size: 15px; white-space: nowrap; }
  .hero-sub { gap: 0; }
  .about-cols { grid-template-columns: minmax(0, 1fr); }
  .skills > div { grid-template-columns: minmax(0, 1fr); gap: 8px; }
  .case-head { grid-template-columns: minmax(0, 1fr); }
  .pin-on .case-head { gap: 3px 16px; padding-block: 8px; }
  .pin-on .case-head h3 { font-size: 31px; }
  .pin-on .case-head p { font-size: 14px; line-height: 1.3; }
  .pin-on .case-head .btn { min-height: 34px; padding: 3px 12px; font-size: 14px; }
  .case-head .links { grid-column: 1; grid-row: auto; margin-top: 4px; }
  .edu { grid-template-columns: minmax(0, 1fr); }
  .edu-main { grid-column: span 1; }
  .builds-2, .builds-3, .builds-5 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .pin-on .build-btn { min-height: 150px; }
  .detail[open] { grid-template-columns: minmax(0, 1fr); }
  .detail-art { min-height: 130px; }
  .detail-copy { padding: 18px; }
  .detail-text { font-size: 16px; }
  .detail-art svg { width: 96px; height: 96px; }
  .build-btn { min-height: 150px; }
  .js .build-btn::after { position: static; align-self: flex-start; margin-top: 4px; }
  .build-btn svg { width: 46px; height: 46px; }
  .pin-on .run-sec .pin-head { font-size: clamp(28px, 8.2vw, 38px); white-space: nowrap; }
  .stage { padding: 8px 10px; }
  .panel, .case-copy { grid-template-columns: minmax(0, 1fr); }
  .flips { grid-template-columns: minmax(0, 1fr); }
  .flip-slot, .flip-slot:nth-child(n + 4) { grid-column: auto; }
  .flip { min-height: 170px; }
  .pin-on .flip-run { height: auto; padding-block: 56px; }
  .pin-on .flip-run .pin-stage { position: static; height: auto; overflow: visible; }
  .pin-on .flip-run .pin-head { position: static; height: auto; font-size: clamp(26px, 7vw, 36px); line-height: 1.05; }
  .pin-on .flip-body { position: static; margin-top: 8px; }
  .pin-on .xcard { width: 82vw; }
  .pin-on .exp-track { padding-inline: 9vw; }
  .pin-on .exp-run .pin-head { font-size: clamp(28px, 8.6vw, 38px); white-space: nowrap; }
  .xbtns { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .exp-lead { font-size: 20px; }
  .xcard p { font-size: 15px; }
}

html.calm { scroll-behavior: auto; }
html.calm *, html.calm *::before, html.calm *::after { animation: none !important; transition: none !important; }
html.calm.js .reveal, html.calm .w:not(.lit) { opacity: 1; transform: none; }
html.calm .scene .flowline, html.calm .spot .ring { display: none; }
html.calm.js .bridge-row:not(.bridge-head) span:last-child { opacity: 1; transform: none; }
html.calm.js .dots:not(.in) span { opacity: 1; transform: none; }

/* ---- Phone spacing system ----
   6px  parts of one thing (title and its caption)
   12px items in one group (card and card, chip and chip)
   16px inside a card
   24px between groups */
@media (max-width: 720px) {
  /* Hero */
  .tag-live { line-height: 1.4; }
  h1 { margin-top: 12px; }
  .hero .lede { margin-top: 12px; }
  .actions { margin-top: 16px; }

  /* Headings under the bar */
  .pin-on .run-sec .pin-head, .pin-on .exp-run .pin-head { line-height: 1; }

  /* Skills */
  .pin-on .skills > div { gap: 16px; }

  /* About */
  .stage { padding: 12px; }
  #stage-svg { margin-top: 6px; }
  .stage-info { margin-top: 6px; }

  /* Projects */
  .pin-on .case-head { gap: 6px; }
  .pin-on .case-head .links { margin-top: 6px; }
  .pin-on .case-step { padding-block: 24px; }
  .bench { gap: 16px; padding: 16px; }
  .bench-head { margin-top: 6px; }
  .bench-tabs { margin-top: 16px; }
  .bench-verdict { min-height: 0; padding: 12px; }
  .panel { gap: 24px; padding: 16px; }
  .panel-col + .panel-col { padding-top: 16px; border-top: 1px solid var(--ink-line); }
  .stat { margin-top: 12px; }
  .stat-num + p, .dots + p { margin-top: 6px; }
  .pin-on .tools .chips-small { margin-top: 16px; }
  .more-read summary { padding-block: 16px; }
  .case-copy { gap: 16px; padding-bottom: 16px; }

  /* Experience */
  .exp-lead { margin-top: 6px; }
  .pin-on .exp-window { padding-top: 16px; }
  .xcard { padding: 16px; }
  .xart { margin-bottom: 12px; }
  .xcard p { margin-top: 6px; }

  /* AI lessons */
  .flips { gap: 12px; margin-top: 16px; }
  .flip-face { gap: 12px; padding: 16px; }
  .pin-on .flip-run { padding-block: 24px; }

  /* The rest of the story */
  .pin-on .more-step { padding-block: 24px; }
  .group-title { margin-bottom: 12px; }
  .builds { gap: 12px; }
  .build-btn { gap: 6px; padding: 16px; }
  .edu { gap: 12px; }
  .edu article { padding: 16px; }
  .dial { margin-bottom: 12px; }
  .edu p:not(.build-meta) { margin-top: 6px; }
  .js .pipe { margin-top: 12px; }
  .edu .pipe-text { margin-top: 12px; }
  .cert .build-meta { margin-top: 6px; }

  /* About graphic: clear of the heading band, close to its text */
  .stage-pin { padding-top: 12px; padding-bottom: 0; }

  /* Contact */
  .contact .lede { margin-top: 12px; }
  .contact-list { margin-top: 24px; }
  .contact-list a { padding-block: 12px; }

  /* Footer */
  .foot-in { gap: 6px 16px; font-size: 13px; }
  .foot .motion-toggle { order: 3; width: 100%; text-align: left; }

  /* Pop-up */
  .detail h3 { margin-top: 6px; }
  .detail-text { margin-block: 12px; }
  .detail-nav { padding-top: 12px; }
}

/* ---- A little soft colour in the projects ---- */
.case-head, .bench, .panel, .case-copy {
  --signal: #79c7b9;
  --signal-deep: #79c7b9;
  --warn: #a9a1dc;
  --fill: #79c7b9;
  --on-fill: #121213;
}
.flow { --signal: #6fcdbc; --warn: #a9a1dc; --fill: #6fcdbc; }
.case-head p { color: #a7d3ca; }
.bench-tabs button { color: #121213; background: #79c7b9; }
.bench-tabs button.is-alt { color: #121213; background: #a9a1dc; border: 0; }
.case-head .btn-line-dark { color: #a7d3ca; border-color: #5f8f86; }
.case-head .btn-line-dark:hover { color: #121213; background: #a7d3ca; }
