@charset "UTF-8";
:root {
  --paper: #EFECE4;
  --paper-2: #E7E3D9;
  --ink: #171614;
  --ink-2: #5B574F;
  --ink-3: #68645C; /* AA (4.5:1) on paper and paper-2 */
  --line: rgba(23, 22, 20, .14);
  --wire: rgba(23, 22, 20, .55);
  --sketch: #E2DACA;
  --sketch-dot: rgba(23, 22, 20, .16);
  --accent: #3047F5;
  --redline: #E8368F;
  --danger: #C8381B;
  --success: #2F7A4A;
  /* inverse surface: "work together" section + footer */
  --inv-bg: #171614;
  --inv-fg: #EFECE4;
  --inv-rgb: 239, 236, 228;
  --inv-accent: #8090FF;
  --inv-success: #8FD3A6;

  /* Avenir ships with macOS/iOS; Nunito Sans is the web fallback elsewhere. */
  --display: "Avenir Next", "Avenir", "Nunito Sans", system-ui, sans-serif;
  --sans: "Schibsted Grotesk", system-ui, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, monospace;

  --pad: clamp(20px, 4cqi, 56px);
  --max: 1360px;
  --ease: cubic-bezier(.22, .61, .21, 1);
  --slow: 1.1s;
}

[data-theme="dark"] {
  color-scheme: dark;
  --paper: #131312;
  --paper-2: #1A1A19;
  --ink: #ECE9E1;
  --ink-2: #A9A59C;
  --ink-3: #86827A; /* AA (4.5:1) on paper and paper-2 */
  --line: rgba(236, 233, 225, .13);
  --wire: rgba(236, 233, 225, .45);
  --sketch: #1E1D1B;
  --sketch-dot: rgba(236, 233, 225, .12);
  --accent: #8C9BFF;
  --redline: #FF6FB5;
  --danger: #FF8A6B;
  --success: #7FD19B;
  --inv-bg: #1D1D20;
  --inv-fg: #ECE9E1;
  --inv-rgb: 236, 233, 225;
  --inv-accent: #8C9BFF;
}

/* Matcha: Classic with a matcha-green primary. A deep matcha on the paper (4.5:1 as text, 5.3:1 under white text),
   a light pistachio on dark surfaces (about 9.5:1; in dark mode a lighter #ADD590 at 11:1, with dark text on it). Everything else is Classic. */
html[data-palette="matcha"] { --accent: #42781C; --inv-accent: #97CA72; }
html[data-palette="matcha"][data-theme="dark"] { --accent: #ADD590; --inv-accent: #ADD590; }
/* The Last of UX keeps Classic's colours in Matcha: the game and its manual sprites (runner.js reads --accent from each canvas) */
html[data-palette="matcha"] :is([data-runner], canvas[data-sprite]) { --accent: #3047F5; }
html[data-palette="matcha"][data-theme="dark"] :is([data-runner], canvas[data-sprite]) { --accent: #8C9BFF; }

/* smooth cross-fade only while the theme is being switched */
html.theme-anim *, html.theme-anim *::before, html.theme-anim *::after {
  transition: background-color .5s var(--ease), color .5s var(--ease), border-color .5s var(--ease), fill .5s var(--ease) !important;
}

*, *::before, *::after { box-sizing: border-box; }
/* anchor jumps land below the sticky top bar instead of under it */
/* no smooth scrolling: tab switches jump to their section under a quick view transition (script.js) */
/* the root carries the page colour itself, so nothing behind the page (a browser's white) can ever show through */
html { background-color: var(--paper); scroll-padding-top: 104px; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 400 17px/1.55 var(--sans);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
/* faint paper grain, kept static so it never competes with content */
body::before {
  content: "";
  position: fixed; inset: 0;
  pointer-events: none;
  z-index: 100;
  opacity: .35;
  mix-blend-mode: multiply;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 0.1  0 0 0 0 0.09  0 0 0 0 0.08  0 0 0 .08 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

h1, h2, h3, h4, p { margin: 0; }
a { color: inherit; }
::selection { background: var(--accent); color: var(--paper); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }

.mono {
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: .02em;
  text-transform: uppercase;
}
.display {
  font-family: var(--display);
  font-weight: 500;
  letter-spacing: -.028em;
  line-height: 1;
}
.display em { font-style: normal; }
.lede { font-size: clamp(19px, 1.6cqi, 23px); line-height: 1.45; max-width: 34ch; }

.skip {
  position: absolute; left: 12px; top: -60px; z-index: 200;
  background: var(--ink); color: var(--paper); padding: 10px 14px;
}
.skip:focus { top: 12px; }

section { padding: 0 var(--pad); max-width: var(--max); margin: 0 auto; }
/* Breakpoints follow the width the content actually has, not the window: when the Ask me pane docks,
   main and the project viewer narrow by its width and their layouts adapt (container queries, cqi units). */
main, .case-modal { container: page / inline-size; }
.topbar { container: bar / inline-size; }

/* ---------- Top bar ---------- */
.topbar {
  position: sticky; top: 0; z-index: 50;
  display: grid; grid-template-columns: 1fr auto; align-items: center;
  padding: 16px clamp(16px, 2.2vw, 32px);
  background: color-mix(in srgb, var(--paper) 86%, transparent);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}
.topbar { transition: border-color .4s var(--ease), background-color .6s var(--ease), color .6s var(--ease); }
.topbar.is-dark {
  background: color-mix(in srgb, var(--inv-bg) 88%, transparent); color: var(--inv-fg);
  border-bottom-color: rgba(var(--inv-rgb), .12);
}
.topbar.is-dark .theme-toggle { border-color: rgba(var(--inv-rgb), .3); }
/* hug the wordmark: as a grid item it would otherwise stretch across the bar, turning the empty space into a homepage link */
.topbar__name { justify-self: start; display: inline-flex; align-items: center; font-family: var(--display); font-size: 23px; font-weight: 600; text-decoration: none; letter-spacing: -.02em; }
.topbar__accent { color: var(--accent); }
.topbar.is-dark .topbar__accent { color: var(--inv-accent); }
.topbar__nav { justify-self: end; display: flex; gap: 26px; align-items: center; font-size: 15px; }
.topbar__nav a { text-decoration: none; position: relative; }
.nav-link { display: inline-flex; align-items: center; gap: 4px; }
/* CollabX: the X is set in the primary colour, bold (top bar and bottom nav) */
.nav-x { font-weight: 700; color: var(--accent); }
.topbar.is-dark .nav-x { color: var(--inv-accent); }
.nav-link .nav-x { margin-left: -4px; }
.nav-link::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: -4px; height: 1px;
  background: currentColor; transform: scaleX(0); transform-origin: right;
  transition: transform .45s var(--ease), background-color .3s, height .3s;
}
.nav-link:hover::after { transform: scaleX(1); transform-origin: left; }
.nav-link.is-active::after { transform: scaleX(1); height: 2px; background: var(--accent); }
.topbar.is-dark .nav-link.is-active::after { background: var(--inv-accent); }

/* Projects dropdown: opens on hover or keyboard focus */
.nav-menu { position: relative; }
.nav-menu__chev { width: 12px; height: 12px; transition: transform .4s var(--ease); }
.nav-menu:hover .nav-menu__chev, .nav-menu:focus-within .nav-menu__chev { transform: rotate(180deg); }
/* Projects sits near the right of the bar, so its menu opens leftward from the link's right edge and never pushes past the window */
.nav-menu__panel { right: -12px; width: min(400px, 90vw); }
/* invisible bridge so the pointer can travel from the link to the panel */
.nav-menu__panel::before { content: ""; position: absolute; left: 0; right: 0; top: -16px; height: 16px; }
.nav-menu:hover .nav-menu__panel, .nav-menu:focus-within .nav-menu__panel {
  opacity: 1; visibility: visible; transform: none; transition-delay: 0s;
}
.nav-menu__list { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.nav-menu__list a { display: grid; grid-template-columns: 1fr auto; gap: 12px; align-items: baseline; }
.nav-menu__list .mono { font-size: 11px; color: var(--ink-3); }
.nav-menu__all { display: flex; justify-content: space-between; margin-top: 6px; padding-top: 12px; border-top: 1px solid var(--line); color: var(--ink-2); }

.theme-toggle {
  width: 34px; height: 34px; padding: 0; border-radius: 50%;
  display: grid; place-items: center; cursor: pointer;
  background: transparent; color: inherit; border: 1px solid var(--line);
  transition: border-color .3s var(--ease);
}
.theme-toggle:hover { border-color: currentColor; }
/* opens the Ask me pane: primary (accent fill) when closed, secondary (accent outline) while the pane is open */
.chat-toggle {
  --ct-fill: var(--accent); --ct-on: #fff;
  width: 34px; height: 34px; padding: 0; border-radius: 50%; margin-left: -12px;
  display: grid; place-items: center; cursor: pointer;
  background: var(--ct-fill); color: var(--ct-on); border: 1px solid var(--ct-fill);
  transition: border-color .3s var(--ease), background .3s var(--ease), color .3s var(--ease);
}
[data-theme="dark"] .chat-toggle { --ct-on: #10121F; }
.topbar.is-dark .chat-toggle { --ct-fill: var(--inv-accent); --ct-on: var(--inv-bg); }
.chat-toggle svg { width: 19px; height: 19px; fill: currentColor; transition: transform .5s var(--ease); }
.chat-toggle:hover { background: color-mix(in srgb, var(--ct-fill) 86%, var(--ink)); border-color: color-mix(in srgb, var(--ct-fill) 86%, var(--ink)); }
.chat-toggle:hover svg { transform: rotate(90deg) scale(1.08); }
.chat-toggle[aria-expanded="true"], .chat-toggle[aria-expanded="true"]:hover { background: transparent; border-color: var(--ct-fill); color: var(--ct-fill); }
.chat-toggle:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.chat-toggle:focus:not(:focus-visible) { outline: none; }
.theme-toggle__icon {
  width: 14px; height: 14px; border-radius: 50%;
  border: 1.5px solid currentColor;
  background: linear-gradient(90deg, currentColor 50%, transparent 50%);
  transition: transform .8s var(--ease);
}
[data-theme="dark"] .theme-toggle__icon { transform: rotate(180deg); }

/* Theme menu: light/dark plus colour themes, opened from the toggle */
.theme-menu { position: relative; }
.theme-menu__panel { right: 0; width: 290px; }
.theme-menu__panel[hidden] { display: none; }
.theme-menu__modes { display: grid; grid-template-columns: 1fr 1fr; margin: 0 6px 6px; padding: 3px; border: 1px solid var(--line); border-radius: 100px; }
.theme-menu__modes button {
  padding: 7px 10px; border: 0; border-radius: 100px; background: transparent; color: var(--ink-2);
  font: 500 14px/1 var(--sans); cursor: pointer; transition: background .25s, color .25s;
}
.theme-menu__modes button[aria-pressed="true"] { background: var(--ink); color: var(--paper); }
.theme-menu__list { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.theme-menu__list button { width: 100%; display: flex; align-items: center; gap: 12px; text-align: left; border: 0; background: transparent; color: var(--ink); cursor: pointer; font: inherit; }
.theme-menu__swatch { display: flex; flex: none; width: 48px; }
.theme-menu__swatch i { flex: 1; height: 26px; border: 1px solid var(--line); margin-left: -1px; }
.theme-menu__swatch i:first-child { border-radius: 6px 0 0 6px; margin-left: 0; }
.theme-menu__swatch i:last-child { border-radius: 0 6px 6px 0; }
.theme-menu__name { display: grid; gap: 3px; }
.theme-menu__name .mono { font-size: 10px; color: var(--ink-3); }

/* ---------- shared popover: Projects and Theme menus use one panel, label and row style ---------- */
.nav-menu__panel, .theme-menu__panel {
  position: absolute; top: calc(100% + 14px); z-index: 70; box-sizing: border-box; padding: 6px;
  background: var(--paper); color: var(--ink);
  border: 1px solid var(--line); border-radius: 0;
  box-shadow: 0 18px 48px -18px rgba(0, 0, 0, .3);
}
.nav-menu__panel {
  opacity: 0; visibility: hidden; transform: translateY(-6px);
  transition: opacity .25s var(--ease), transform .35s var(--ease), visibility 0s .25s;
}
.theme-menu__panel:not([hidden]) { animation: pop-in .25s var(--ease); }
@keyframes pop-in { from { opacity: 0; transform: translateY(-6px); } }
.nav-menu__label, .theme-menu__label { display: block; margin: 0; padding: 10px 12px 6px; color: var(--ink-3); font-size: 11px; }
.nav-menu__list a, .theme-menu__list button, .nav-menu__all {
  padding: 10px 12px; border-radius: 0; font-size: 15px; line-height: 1.25; text-decoration: none;
  transition: background .2s, color .2s;
}
.theme-menu__list button { padding: 8px 12px; }
.nav-menu__list a:hover, .nav-menu__list a:focus-visible, .theme-menu__list button:hover, .theme-menu__list button:focus-visible, .nav-menu__all:hover, .nav-menu__all:focus-visible {
  background: color-mix(in srgb, var(--ink) 6%, transparent); color: var(--ink); outline: none;
}
/* Projects menu: the hovered or focused project name takes the primary colour */
.nav-menu__list a:hover, .nav-menu__list a:focus-visible, .nav-menu__all:hover, .nav-menu__all:focus-visible { color: var(--accent); }
.nav-menu__list a[aria-current="page"], .theme-menu__list button[aria-pressed="true"] {
  /* the accent is nudged toward the ink so the label keeps 4.5:1 on its own tint */
  background: color-mix(in srgb, var(--accent) 12%, transparent); color: color-mix(in srgb, var(--accent) 80%, var(--ink));
}
.nav-menu__list a[aria-current="page"] .mono, .theme-menu__list button[aria-pressed="true"] .mono { color: inherit; opacity: .75; }
.nav-menu__all.mono { font-size: 12px; }

/* ---------- Intro ---------- */
.intro { padding-top: clamp(32px, 5vh, 56px); padding-bottom: clamp(80px, 14vh, 160px); }
/* fireflies: five or six large, very soft glows drifting slowly over the hero (drawn by script.js). The canvas covers the top
   of the page down to the value cards (script.js sets its height) and fades out at the bottom, so it scrolls away with the hero.
   The body becomes its own layer so the glows sit above the page colour but under all content. */
body:has(> .fireflies) { position: relative; z-index: 0; }
.fireflies {
  position: absolute; top: 0; left: 0; z-index: -1; width: 100%; height: 100vh; pointer-events: none;
  -webkit-mask-image: linear-gradient(to bottom, #000 calc(100% - 200px), transparent);
  mask-image: linear-gradient(to bottom, #000 calc(100% - 200px), transparent);
}
.intro__title {
  font-size: clamp(36px, 8.6cqi, 140px);
  margin: 0 0 clamp(88px, 11vh, 128px);
}
/* masks the slide-up vertically only, so "obvious" can glide in from the side */
.line { display: block; clip-path: inset(0 -100vw); padding-bottom: .06em; margin-bottom: -.06em; }
.line > span {
  display: inline-block; transform: translateY(105%);
  transition: transform 1.3s var(--ease);
}
.line:nth-child(2) > span { transition-delay: .12s; }
.is-loaded .line > span { transform: none; }
.is-settled .line { clip-path: none; }

/* arrow leading into "obvious": draws in once the headline has slid up */
.intro__arrow {
  display: inline-block; width: .62em; height: .4em; margin-right: .2em; vertical-align: .1em;
  overflow: visible; fill: none; stroke: currentColor; stroke-width: 4.5; stroke-linecap: round; stroke-linejoin: round;
}
.intro__arrow path { stroke-dasharray: 1; stroke-dashoffset: 1; transition: stroke-dashoffset .9s var(--ease) 1.15s; }
.is-loaded .intro__arrow path, .no-js .intro__arrow path { stroke-dashoffset: 0; }

/* "obvious" in the accent colour */
.measure { color: var(--accent); white-space: nowrap; }
/* letters glide in from just past the right edge of the window (offsets set in script.js), o first, s last,
   then overshoot and rebound like a damped spring */
.measure__ch { display: inline-block; opacity: 0; transform: translateX(var(--dx, 0)); }
/* animate only once loaded, so setting the start offset in JS doesn't move anything */
.is-loaded .measure__ch {
  opacity: 1; transform: none;
  animation: obvious-in 1.6s calc(.85s + var(--i) * .07s) both;
}
@keyframes obvious-in {
  0%   { transform: translateX(var(--dx, 0)); animation-timing-function: cubic-bezier(.25, .6, .45, 1); }
  58%  { transform: translateX(-.09em); animation-timing-function: cubic-bezier(.45, 0, .55, 1); }
  76%  { transform: translateX(.035em); animation-timing-function: cubic-bezier(.45, 0, .55, 1); }
  90%  { transform: translateX(-.012em); animation-timing-function: cubic-bezier(.45, 0, .55, 1); }
  100% { transform: none; }
}
main { overflow-x: clip; }

/* two-thirds / one-third split so the portrait box lines up with the third values column below */
.intro__body {
  display: grid; grid-template-columns: 2fr 1fr;
  align-items: start;
}
.trusted {
  display: grid; grid-template-columns: repeat(12, 1fr); gap: 24px; align-items: center;
  padding-block: var(--band); border-top: 1px solid var(--line);
}
.trusted__title { grid-column: 1 / span 2; color: var(--accent); font-size: 11px; }
.trusted__grid {
  grid-column: 3 / -1;
  list-style: none; margin: 0; padding: 0;
  display: flex; align-items: center; justify-content: space-between; gap: 24px;
}
.logo { display: grid; place-items: center; height: 56px; }
.logo img { grid-area: 1 / 1; height: 28px; width: auto; max-width: 150px; object-fit: contain; }
/* optical sizing: tall marks need more height to read at the same weight as wordmarks */
.logo--chitkara img { height: 34px; }
.logo--harman img { height: 50px; }
.logo--1mg img { height: 25px; }
.logo--iitg img { height: 56px; }
/* per-logo correction so dark marks stay visible on the dark theme */
[data-theme="dark"] .logo--1mg { --logo-fix: invert(1); }
/* logos with an official dark-background version swap files instead of being filtered */
.logo .on-dark, [data-theme="dark"] .logo .on-light { display: none; }
[data-theme="dark"] .logo .on-dark { display: block; }

/* calm loop: logos rest in greyscale and take turns gently lighting up */
.logo img {
  filter: var(--logo-fix, ) grayscale(1); opacity: .45;
  animation: logo-glow 12.5s ease-in-out infinite;
  animation-delay: calc(var(--n) * 2.5s);
}
@keyframes logo-glow {
  0%, 26%, 100% { filter: var(--logo-fix, ) grayscale(1); opacity: .45; }
  9%, 15% { filter: var(--logo-fix, ) grayscale(0); opacity: 1; }
}
.logo--cv a {
  display: inline-flex; align-items: center; gap: 8px; padding: 10px 18px; border-radius: 100px;
  border: 1px solid var(--accent); background: var(--accent); color: #fff; font-size: 15px; line-height: 1; white-space: nowrap; text-decoration: none;
  transition: background-color .35s var(--ease), border-color .35s var(--ease);
}
[data-theme="dark"] .logo--cv a { color: #10121F; }
.logo--cv span { transition: transform .45s var(--ease); }
.logo--cv a:hover, .logo--cv a:focus-visible { background: color-mix(in srgb, var(--accent) 88%, #000); border-color: color-mix(in srgb, var(--accent) 88%, #000); }
[data-theme="dark"] .logo--cv a:hover, [data-theme="dark"] .logo--cv a:focus-visible { background: color-mix(in srgb, var(--accent) 85%, #fff); border-color: color-mix(in srgb, var(--accent) 85%, #fff); }
.logo--cv a:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.logo--cv a:hover span { transform: translateX(4px); }
/* hero illustration: one per theme, no frame or effects; it rises into the gap under the headline */
/* it grows left into the space beside the intro text, and its desk line sits on the section line below */
.intro__portrait {
  grid-column: 2; align-self: end; justify-self: end; width: 128%; margin: 0;
}
.intro__portrait[data-reveal] { opacity: 1; transform: none; }
.intro__portrait img { display: block; width: 100%; height: auto; }

/* ---------- hero magnifier (built in script.js): a metal-rimmed lens with a handle and a skill label ---------- */
.intro__portrait { position: relative; }
.intro__portrait.is-lens { cursor: none; }
.hero-lens {
  --ls: 136px;
  position: absolute; left: 0; top: 0; z-index: 5; width: var(--ls); height: var(--ls);
  pointer-events: none; opacity: 0; transition: opacity .2s var(--ease);
}
.hero-lens.is-on { opacity: 1; }
.hero-lens__ring {
  position: absolute; inset: 0; z-index: 1; padding: 6px; border-radius: 50%; box-sizing: border-box;
  background: conic-gradient(from 200deg, #ffffff, #b9bec6 18%, #6a7079 34%, #d7dbe0 52%, #ffffff 62%, #858b94 80%, #ffffff);
  box-shadow: 0 22px 36px -12px rgba(0, 0, 0, .5), 0 4px 10px rgba(0, 0, 0, .22), inset 0 1px 1px rgba(255, 255, 255, .9);
  transition: box-shadow .25s var(--ease);
}
.hero-lens.has-tip .hero-lens__ring { box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 55%, transparent), 0 22px 36px -12px rgba(0, 0, 0, .5), 0 4px 10px rgba(0, 0, 0, .22); }
.hero-lens__glass {
  position: relative; display: block; width: 100%; height: 100%; border-radius: 50%; overflow: hidden; transition: filter .3s var(--ease);
  background-color: var(--paper); background-repeat: no-repeat;
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .3), inset 0 8px 16px rgba(0, 0, 0, .22);
}
/* specular highlight and darker edge sell the curved glass */
.hero-lens__glass::after {
  content: ""; position: absolute; inset: 0; border-radius: 50%;
  background:
    radial-gradient(55% 38% at 32% 20%, rgba(255, 255, 255, .6), rgba(255, 255, 255, 0) 70%),
    radial-gradient(circle at 50% 50%, transparent 64%, rgba(0, 0, 0, .2) 100%);
}
/* over a skill, the inside of the lens lights up in the accent colour */
.hero-lens__glass::before {
  content: ""; position: absolute; inset: 0; border-radius: 50%; opacity: 0; transition: opacity .3s var(--ease);
  background: radial-gradient(circle at 50% 55%, color-mix(in srgb, var(--accent) 22%, transparent) 0%, transparent 62%);
  box-shadow: inset 0 0 22px 4px color-mix(in srgb, var(--accent) 55%, transparent);
}
.hero-lens.has-tip .hero-lens__glass::before { opacity: 1; }
.hero-lens.has-tip .hero-lens__glass { filter: saturate(1.15) brightness(1.04); }
.hero-lens__handle {
  position: absolute; left: 50%; top: 50%; z-index: 0; width: 18px; height: calc(var(--ls) * .42 + var(--ls) / 2);
  margin-left: -9px; transform-origin: 50% 0; transform: rotate(-45deg);
  border-radius: 0 0 10px 10px;
  background: linear-gradient(90deg, #1c1c1f, #55555c 42%, #2a2a2e 70%, #151517);
  box-shadow: 6px 10px 16px -6px rgba(0, 0, 0, .55);
}
/* the metal collar where the handle meets the rim */
.hero-lens__handle::before {
  content: ""; position: absolute; left: -3px; right: -3px; top: calc(var(--ls) / 2 - 4px); height: 16px; border-radius: 4px;
  background: linear-gradient(90deg, #8a9099, #f2f4f6 45%, #7a8089);
}
/* the skill label is an accent speech bubble whose tail points at the lens */
.hero-lens__tip {
  --tip-fg: #fff; --dx: 0px;
  position: absolute; left: 50%; bottom: calc(100% + 18px); z-index: 2;
  padding: 12px 18px; white-space: nowrap; font: 600 17px/1.2 var(--sans); letter-spacing: -.01em;
  background: var(--accent); color: var(--tip-fg);
  box-shadow: 0 16px 34px -14px color-mix(in srgb, var(--accent) 70%, #000), 0 0 0 4px color-mix(in srgb, var(--accent) 18%, transparent);
  opacity: 0; transform: translate(calc(-50% + var(--dx)), 6px) scale(.92); transform-origin: calc(50% - var(--dx)) 100%;
  transition: opacity .2s var(--ease), transform .35s cubic-bezier(.34, 1.56, .64, 1);
}
.hero-lens__tip::after {
  content: ""; position: absolute; left: calc(50% - var(--dx)); top: 100%; margin-left: -9px;
  border: 9px solid transparent; border-top-color: var(--accent); border-bottom: 0;
}
[data-theme="dark"] .hero-lens__tip { --tip-fg: #10121F; }
.hero-lens.tip-below .hero-lens__tip { bottom: auto; top: calc(100% + 18px); transform: translate(calc(-50% + var(--dx)), -6px) scale(.92); transform-origin: calc(50% - var(--dx)) 0; }
.hero-lens.tip-below .hero-lens__tip::after { top: auto; bottom: 100%; border-top: 0; border-bottom: 9px solid var(--accent); }
.hero-lens.has-tip .hero-lens__tip { opacity: 1; transform: translate(calc(-50% + var(--dx)), 0) scale(1); }
@media (prefers-reduced-motion: reduce) {
  .hero-lens, .hero-lens__tip, .hero-lens__ring { transition: none; }
  .ask-cta { animation: none; }
}

/* ---------- "Ask me": a speech-bubble button above the illustrated head ---------- */
/* a comic speech bubble: white fill, ink outline, a hard offset shadow and a tail aimed at the head */
.ask-cta {
  --ink-line: #17171A; --spark: var(--accent);
  position: absolute; left: 61%; top: 35%; z-index: 6;
  display: inline-flex; align-items: center; gap: 7px; padding: 9px 16px 9px 12px;
  border: 2px solid var(--ink-line); border-radius: 100px; cursor: pointer;
  background: #fff; color: var(--ink-line); font: 700 14px/1 var(--sans); letter-spacing: -.005em;
  filter: drop-shadow(3px 3px 0 var(--ink-line));
  transform: translate(-50%, -100%);
  animation: ask-bob 2.8s var(--ease) infinite;
  transition: filter .2s var(--ease);
}
/* the tail is a rotated square whose white half covers the bubble's outline, so it reads as one shape */
.ask-cta::after {
  content: ""; position: absolute; left: 36%; bottom: -8px; width: 13px; height: 13px;
  background: #fff; border: solid var(--ink-line); border-width: 0 2px 2px 0;
  transform: rotate(45deg) skew(10deg, 10deg);
}
.ask-cta svg { position: relative; z-index: 1; width: 17px; height: 17px; fill: var(--spark); stroke: none; }
.ask-cta:hover { animation-play-state: paused; filter: drop-shadow(4px 4px 0 var(--ink-line)); }
.ask-cta:active { filter: drop-shadow(1px 1px 0 var(--ink-line)); }
.ask-cta:focus-visible { outline: 2px solid var(--accent); outline-offset: 5px; }
/* light accents wash out on white, so dark themes use a deeper sparkle */
[data-theme="dark"] .ask-cta { --spark: color-mix(in srgb, var(--accent) 55%, #10121F); }
@keyframes ask-bob { 0%, 100% { transform: translate(-50%, -100%); } 50% { transform: translate(-50%, calc(-100% - 5px)); } }

/* ---------- chat side pane ---------- */
/* one corner radius for bubbles, chips and fields; buttons are circles */
.chat {
  --on-accent: #fff; --bubble: color-mix(in srgb, var(--ink) 6%, transparent); --r: 20px;
  position: fixed; inset: 0 0 0 auto; z-index: 80; margin: 0; padding: 0; box-sizing: border-box;
  width: min(var(--chat-w), 100vw); height: 100dvh; max-width: none; max-height: none;
  border: 0; border-left: 1px solid var(--line); background: var(--paper); color: var(--ink);
  box-shadow: -24px 0 60px -30px rgba(0, 0, 0, .45);
}
[data-theme="dark"] .chat { --on-accent: #10121F; }
/* only the message log scrolls; the header and input bar stay pinned */
.chat[open] { display: grid; grid-template-rows: auto minmax(0, 1fr) auto; overflow: hidden; animation: chat-in .38s var(--ease); }
/* docked, not overlaid: on wide screens the page reflows into the space left of the pane */
:root { --chat-w: 400px; }
body { transition: padding-right .38s var(--ease); }
html.chat-instant body, html.chat-instant .chat[open], html.chat-instant .case-modal { transition: none; animation: none; }
@media (min-width: 900px) {
  html.chat-open body { padding-right: var(--chat-w); }
  .chat { box-shadow: none; }
}
@keyframes chat-in { from { transform: translateX(28px); opacity: 0; } }
.chat__head { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 12px; padding: 16px 18px; border-bottom: 1px solid var(--line); }
.chat__avatar { display: block; width: 38px; height: 38px; border-radius: 50%; object-fit: cover; filter: grayscale(1) contrast(1.05); outline: 1px solid var(--line); outline-offset: -1px; }
.chat__heading { display: flex; align-items: center; gap: 10px; min-width: 0; }
.chat__title { margin: 0; font: 500 18px/1.2 var(--display); letter-spacing: -.01em; }
.chat__new {
  display: grid; place-items: center; flex: none; width: 32px; height: 32px; padding: 0;
  border: 0; border-radius: 50%; background: var(--accent); color: var(--on-accent); cursor: pointer;
}
.chat__new:hover { opacity: .85; }
.chat__new svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; }
.chat__sub { margin: 3px 0 0; color: var(--ink-3); font-size: 10px; }
.chat__close { display: grid; place-items: center; width: 36px; height: 36px; padding: 0; border: 1px solid var(--line); border-radius: 50%; background: none; color: inherit; cursor: pointer; }
.chat__close:hover { border-color: currentColor; }
.chat__close svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; }
.chat__log { overflow-y: auto; overscroll-behavior: contain; scroll-behavior: smooth; padding: 20px 18px 24px; display: flex; flex-direction: column; gap: 14px; }
.msg { max-width: 88%; padding: 11px 14px; border-radius: var(--r); font-size: 15px; line-height: 1.55; overflow-wrap: anywhere; white-space: pre-line; }
.msg--bot { align-self: flex-start; background: var(--bubble); }
.msg--user { align-self: flex-end; background: var(--accent); color: var(--on-accent); }
/* the blinking dot that rides the end of a reply while it is being typed */
/* streamed words fade in as they arrive, overlapping, so the reply flows rather than ticks */
.msg__w { animation: msg-word .5s cubic-bezier(.2, .7, .2, 1) both; }
@keyframes msg-word { from { opacity: 0; } }
.chat__links, .chat__chips { animation: msg-word .45s var(--ease) both; }
.msg--thinking { display: inline-flex; gap: 5px; padding: 14px 16px; }
.msg--thinking i { width: 7px; height: 7px; border-radius: 50%; background: var(--ink-3); animation: think 1.1s var(--ease) infinite; }
.msg--thinking i:nth-child(2) { animation-delay: .15s; }
.msg--thinking i:nth-child(3) { animation-delay: .3s; }
@keyframes think { 0%, 60%, 100% { opacity: .3; transform: none; } 30% { opacity: 1; transform: translateY(-3px); } }
.chat__links { display: flex; flex-wrap: wrap; gap: 6px 14px; margin-top: 10px; white-space: normal; }
.chat__links a { color: var(--accent); font-size: 13px; text-decoration: none; }
.chat__links a:hover { text-decoration: underline; text-underline-offset: 3px; }
.chat__chips { display: flex; flex-wrap: wrap; gap: 8px; align-self: stretch; }
.chat__chips-label { flex-basis: 100%; color: var(--ink-3); font-size: 10px; margin: 2px 0 0; }
.chat__chip {
  padding: 8px 12px; border: 1px solid var(--line); border-radius: var(--r); background: none; color: var(--ink);
  font: 500 14px/1.25 var(--sans); text-align: left; cursor: pointer; transition: border-color .2s, color .2s, background .2s;
}
.chat__chip:hover, .chat__chip:focus-visible { border-color: var(--accent); color: var(--accent); outline: none; }
.chat__notify { display: flex; gap: 6px; margin-top: 12px; white-space: normal; }
.chat__notify input { flex: 1; min-width: 0; padding: 9px 14px; border: 1px solid var(--line); border-radius: var(--r); background: var(--paper); color: var(--ink); font: inherit; font-size: 14px; }
.chat__notify button { padding: 9px 14px; border: 0; border-radius: var(--r); background: var(--accent); color: var(--on-accent); font: 600 13px/1 var(--sans); cursor: pointer; }
.chat__bar { display: flex; gap: 8px; padding: 14px 16px calc(14px + env(safe-area-inset-bottom)); }
.chat__bar input {
  flex: 1; min-width: 0; padding: 12px 18px; border: 1px solid var(--line); border-radius: var(--r);
  background: transparent; color: var(--ink); font: 400 15px/1.3 var(--sans); transition: border-color .2s;
}
.chat__bar input::placeholder { color: var(--ink-3); }
.chat__bar input:focus { outline: none; border-color: var(--accent); }
.chat__send { flex: none; align-self: center; display: grid; place-items: center; width: 46px; height: 46px; padding: 0; border: 0; border-radius: 50%; background: var(--accent); color: var(--on-accent); cursor: pointer; transition: opacity .2s; }
.chat__send:disabled { opacity: .45; cursor: default; }
.chat__send svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
@media (prefers-reduced-motion: reduce) {
  .chat[open], .msg__w, .chat__links, .chat__chips, .msg--thinking i { animation: none; }
  .chat__log { scroll-behavior: auto; }
}
.intro__portrait .on-dark, [data-theme="dark"] .intro__portrait .on-light { display: none; }
[data-theme="dark"] .intro__portrait .on-dark { display: block; }
/* Sky Glass has its own blue illustrations, light and dark */
.intro__portrait .on-sky, .intro__portrait .on-sky-dark { display: none; }
[data-palette="glass"]:not([data-theme="dark"]) .intro__portrait .on-light { display: none; }
[data-palette="glass"]:not([data-theme="dark"]) .intro__portrait .on-sky { display: block; }
[data-palette="glass"][data-theme="dark"] .intro__portrait .on-dark { display: none; }
[data-palette="glass"][data-theme="dark"] .intro__portrait .on-sky-dark { display: block; opacity: .75; }
/* Matcha has its own green illustrations, light and dark */
.intro__portrait .on-matcha, .intro__portrait .on-matcha-dark { display: none; }
[data-palette="matcha"]:not([data-theme="dark"]) .intro__portrait .on-light { display: none; }
[data-palette="matcha"]:not([data-theme="dark"]) .intro__portrait .on-matcha { display: block; }
[data-palette="matcha"][data-theme="dark"] .intro__portrait .on-dark { display: none; }
[data-palette="matcha"][data-theme="dark"] .intro__portrait .on-matcha-dark { display: block; }
.intro__body .lede { grid-column: 1; align-self: end; padding-right: 24px; margin-bottom: clamp(28px, 4.5vh, 56px); max-width: 34ch; font-size: clamp(22px, 2.2cqi, 32px); line-height: 1.3; }
.lede__hi { display: block; margin-bottom: .8em; font-size: 1.25em; line-height: 1.15; font-weight: 500; }
.lede__hi em { font-style: normal; color: var(--accent); }

.values {
  list-style: none; padding: 0; margin: 0;
  display: grid; grid-template-columns: repeat(3, 1fr);
  border-top: 1px solid var(--line);

}
/* three stacked bands (values, stats, logos) share one rhythm: thin rules, equal padding, full-height dividers */
.intro { --band: clamp(32px, 5vh, 48px); }
.values li { padding: var(--band) 28px var(--band) 0; display: flex; flex-direction: column; justify-content: center; }
.values li + li { padding-left: 28px; border-left: 1px solid var(--line); }
.values__icon {
  display: grid; place-items: center; width: 44px; height: 44px; margin-bottom: 18px;
  border-radius: 50%; color: var(--accent);
  background: color-mix(in srgb, var(--accent) 9%, transparent);
}
.values__icon svg { width: 22px; height: 22px; }
.values h2 { font: 500 19px/1.3 var(--sans); margin: 0 0 8px; }
.values p { color: var(--ink-2); max-width: 34ch; }

.stats {
  display: grid; grid-template-columns: repeat(3, 1fr);
  margin: 0; border-top: 1px solid var(--line);
}
.stats div { padding: var(--band) 28px; display: flex; flex-direction: column; justify-content: flex-start; }
.stats div:first-child { padding-left: 0; }
.stats div + div { border-left: 1px solid var(--line); }
.stats dt { color: var(--ink-2); margin-top: 12px; max-width: 28ch; line-height: 1.5; }
.stats dd { margin: 0; font: 500 clamp(40px, 4.2cqi, 62px)/1 var(--display); letter-spacing: -.03em; font-variant-numeric: tabular-nums;  color: var(--accent); }

/* ---------- Section heads ---------- */
.section-head {
  display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between;
  gap: 8px 22px; padding-bottom: clamp(40px, 6vh, 72px);
}
.section-head h2 { font-size: clamp(38px, 5cqi, 80px); color: var(--accent); }

/* ---------- Work ---------- */
.work { padding-bottom: 0; }
.frame { margin: 0; }

/* thumbnail grid in hairline cells, matching the intro bands; each tile opens the project summary in a modal */
.case-grid {
  --band: clamp(32px, 5vh, 48px);
  --gutter: 28px;
  /* the middle column carries padding on both sides, so widen it to keep all thumbnails the same size */
  --cell: calc((100% - 4 * var(--gutter)) / 3);
  display: grid;
  grid-template-columns: calc(var(--cell) + var(--gutter)) calc(var(--cell) + 2 * var(--gutter)) calc(var(--cell) + var(--gutter));
  border-top: 1px solid var(--line);
}
.case { padding: var(--band) var(--gutter); border-bottom: 1px solid var(--line); }
.case:nth-child(3n + 1) { padding-left: 0; }
.case:nth-child(3n) { padding-right: 0; }
.case:not(:nth-child(3n + 1)) { border-left: 1px solid var(--line); }
.case__tile { display: flex; flex-direction: column; text-decoration: none; color: inherit; border-radius: 6px; }
.case__tile:focus-visible { outline-offset: 6px; }
.case__tile .frame { margin-bottom: 18px; transition: transform 1.2s var(--ease); }
.case__tile .frame--shot { border-radius: 8px; }
/* tiles: title, then "product · year" on one line */
.case__tile .case__meta { margin-top: 10px; color: var(--ink-3); }
.case__name {
  margin: 0; font: 500 clamp(22px, 1.9cqi, 28px)/1.15 var(--display); letter-spacing: -.025em;
  transition: color .3s;
}
@media (hover: hover) {
  .case__tile:hover .frame { transform: translateY(-4px); }
  .case__tile:hover .case__name { color: var(--accent); }
}

.case__meta { display: flex; gap: 12px; color: var(--ink-2); }
.case__meta span + span::before { content: "·"; margin-right: 12px; }
.case__title { font: 500 clamp(32px, 3.2cqi, 48px)/1.08 var(--display); letter-spacing: -.03em; margin: 18px 0 16px; }
.case__summary { color: var(--ink-2); max-width: 40ch; }
.case__outcome {
  display: flex; align-items: baseline; gap: 14px; margin: 26px 0 20px;
  padding: 14px 0; border-block: 1px solid var(--line);
}
.case__outcome strong { font: 500 36px/1 var(--display); letter-spacing: -.03em; white-space: nowrap; font-variant-numeric: tabular-nums; }
.case__outcome span { color: var(--ink-2); font-size: 15px; }
/* three impact metrics in one box, split by hairlines */
.case__metrics {
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr));
  margin: 26px 0 20px; border-radius: 4px;
  background: color-mix(in srgb, var(--accent) 8%, transparent);
}
.case__metrics div { display: flex; flex-direction: column; padding: 16px 14px 18px; min-width: 0; }
.case__metrics div + div { border-left: 1px solid color-mix(in srgb, var(--accent) 16%, transparent); }
.case__metrics dd { margin: 0; font: 500 clamp(22px, 2cqi, 28px)/1 var(--display); letter-spacing: -.03em; white-space: nowrap; font-variant-numeric: tabular-nums; }
.case__metrics dt { margin-top: 10px; color: var(--ink-2); font-size: 13px; line-height: 1.4; }
.tags { list-style: none; padding: 0; margin: 0 0 24px; display: flex; flex-wrap: wrap; gap: 6px; }
.tags li { border: 1px solid var(--line); border-radius: 100px; padding: 4px 10px; font-size: 11px; color: var(--ink-2); }

/* artboards: wireframe → final, staggered per block */
.artboard {
  position: relative; aspect-ratio: 16 / 10; overflow: hidden;
  border-radius: 4px;
  background-color: var(--sketch);
  background-image: radial-gradient(var(--sketch-dot) 1px, transparent 1px);
  background-size: 14px 14px;
  outline: 1px solid var(--line);
  transition: background-color .9s var(--ease);
}
.b {
  position: absolute;
  left: calc(var(--x) * 1%); top: calc(var(--y) * 1%);
  width: calc(var(--w) * 1%); height: calc(var(--h) * 1%);
  border-radius: var(--r, 4px);
  border: 1px dashed var(--wire);
  background: transparent;
  transition:
    background-color .8s var(--ease) calc(var(--i) * 55ms),
    border-color .8s var(--ease) calc(var(--i) * 55ms),
    box-shadow .8s var(--ease) calc(var(--i) * 55ms),
    color .8s var(--ease) calc(var(--i) * 55ms);
}
.b--text {
  display: grid; place-items: center; color: transparent;
  font: 500 clamp(24px, 3.4cqi, 54px)/1 var(--display); letter-spacing: -.03em;
}
.b--pill { font: 500 clamp(9px, .9cqi, 12px)/1 var(--sans); }
.is-final .artboard { background-color: var(--bg); background-image: none; }
.is-final .b {
  background-color: var(--c); border-color: transparent;
  box-shadow: 0 1px 2px rgba(0, 0, 0, .04);
}
.is-final .b--text { color: #1B1E28; }
.b--chart { display: block; color: transparent; }
.b--chart svg { position: absolute; inset: 14% 8%; width: 84%; height: 72%; overflow: visible; }
.is-final .b--chart { color: #3047F5; }
html[data-palette="matcha"] .is-final .b--chart { color: var(--accent); }
[data-theme="dark"] .artboard { transition: background-color .9s var(--ease), filter .6s; }
[data-theme="dark"] .is-final .artboard { filter: brightness(.9) saturate(.95); }
.is-final .b--pill { color: #fff; }

/* hover reveals the wireframe underneath */
@media (hover: hover) {
  .case:hover .is-final .artboard { background-color: var(--sketch); background-image: radial-gradient(var(--sketch-dot) 1px, transparent 1px); }
  .case:hover .is-final .b {
    background-color: transparent; border-color: var(--wire); box-shadow: none; color: transparent;
    transition-delay: calc((12 - var(--i)) * 25ms);
  }
}
.frame { transition: transform 1.2s var(--ease); }

/* ---------- Record ---------- */
.record { padding-bottom: clamp(80px, 14vh, 160px); }
.record__block {
  display: grid; grid-template-columns: repeat(12, 1fr); gap: 24px;
  padding: 28px 0 clamp(48px, 8vh, 88px);
  border-top: 1px solid var(--line);

}
.record__title { grid-column: 1 / span 3; color: var(--ink-2); }
.ledger, .timeline, .edu { grid-column: 4 / -1; list-style: none; padding: 0; margin: 0; }

.ledger li {
  display: grid; grid-template-columns: 96px 1fr auto; gap: 24px; align-items: baseline;
  padding: 18px 0; border-bottom: 1px solid var(--line);
  position: relative;
}
.ledger li:first-child { padding-top: 0; }
.ledger li:last-child { border-bottom: 0; }
.ledger li > .mono:first-child, .timeline__years { color: var(--ink-3); }
.ledger p { font-size: 18px; }
.ledger strong { font-weight: 500; }
.ledger__tag { color: var(--ink-3); font-size: 11px; }

.edu { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
.edu__item { border-left: 1px solid var(--line); padding-left: 18px; }
.edu__item .mono { color: var(--ink-3); }
.edu__item h4 { font: 500 22px/1.25 var(--display); letter-spacing: -.02em; margin: 10px 0 6px; }
.edu__item p:last-child { color: var(--ink-2); font-size: 15px; }

.timeline li {
  display: grid; grid-template-columns: 170px minmax(0, 1fr) minmax(0, 1.3fr); gap: 24px;
  padding: 22px 0; border-bottom: 1px solid var(--line); position: relative;
}
.timeline li:first-child { padding-top: 0; }
.timeline li:last-child { border-bottom: 0; }
.timeline h4 { font: 500 18px/1.3 var(--sans); }
.timeline__org { color: var(--ink-2); font-family: var(--display); font-size: 16px; }
.timeline li > p { color: var(--ink-2); }

/* row hover: a ringed dot appears beside the year/label */
.ledger li > .mono:first-child, .timeline__years { position: relative; }
.ledger li > .mono:first-child::before, .timeline__years::before {
  content: ""; position: absolute; left: -24px; top: .775em;
  width: 12px; height: 12px; margin-top: -6px; border-radius: 50%;
  border: 1px solid var(--accent);
  background: radial-gradient(circle, var(--accent) 0 2.5px, transparent 3px);
  opacity: 0; transform: scale(.4);
  transition: opacity .3s var(--ease), transform .45s var(--ease);
}
.ledger li:hover > .mono:first-child::before, .timeline li:hover .timeline__years::before { opacity: 1; transform: none; }

/* ---------- CV page (cv.html): the record, expanded from the résumé ---------- */
.cv-hero { display: grid; grid-template-columns: repeat(12, 1fr); gap: 24px; align-items: end; padding-top: clamp(40px, 7vh, 88px); padding-bottom: clamp(48px, 8vh, 88px); }
.cv-hero__text { grid-column: 1 / span 8; align-self: start; }
.cv-hero__title { font-size: clamp(44px, 7cqi, 112px); margin: 0 0 clamp(20px, 3vh, 32px); color: var(--accent); }
.cv-hero__lede { max-width: 58ch; font-size: clamp(20px, 1.9cqi, 27px); line-height: 1.38; color: var(--ink-2); }
.cv-hero__lede strong { display: block; color: var(--ink); font-weight: 500; }
.cv-hero__actions { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 14px; margin-top: clamp(24px, 4vh, 40px); }
/* primary: Hire me, in the accent; it opens the Collab page on its Hire me form */
.btn.cv-hero__hire { text-decoration: none; background: var(--accent); color: #fff; }
.btn.cv-hero__hire:hover { background: color-mix(in srgb, var(--accent) 88%, #000); }
[data-theme="dark"] .btn.cv-hero__hire { color: #10121F; }
[data-theme="dark"] .btn.cv-hero__hire:hover { background: color-mix(in srgb, var(--accent) 85%, #fff); }
/* secondary: text only, in the ink colour; it takes the accent on hover */
.btn.btn--text { text-decoration: none; background: transparent; color: var(--ink); padding-inline: 12px; transition: color .3s; }
.btn.btn--text:hover { background: transparent; color: var(--accent); }
.cv-hero__download svg { width: 18px; height: 18px; transition: transform .45s var(--ease); }
.cv-hero__download:hover svg { transform: translateY(3px); }
/* phones: tighter pills so Hire me and Download resume share one row */
@media (max-width: 480px) { .cv-hero__actions { gap: 10px; } .cv-hero__actions .btn { padding: 14px 18px; gap: 10px; font-size: 15px; } }
.cv-hero__photo { grid-column: 10 / -1; margin: 0; align-self: start; }
.cv-hero__photo img { filter: grayscale(1) contrast(1.05); display: block; width: 100%; height: auto; aspect-ratio: 1; object-fit: cover; border-radius: 12px; background: var(--paper-2); outline: 1px solid var(--line); outline-offset: -1px; }
.cv-hero__facts { grid-column: 1 / -1; margin-top: 0; }
/* the column dividers run from the top hairline down to the next one (the summary's), with each fact centred between them */
html:not([data-palette="glass"]) .cv-hero { padding-bottom: 0; }
/* Sky Glass: the next card has no top hairline, so the facts close their own grid */
html[data-palette="glass"] .cv-hero__facts { border-bottom: 1px solid var(--line); }
.cv-hero__facts.cs-facts div { display: flex; flex-direction: column; justify-content: center; padding-top: clamp(24px, 4vh, 36px); padding-bottom: clamp(24px, 4vh, 36px); }
.cv-hero__facts a { color: inherit; text-decoration: none; transition: color .3s; }
.cv-hero__facts a:hover { color: var(--accent); }
/* LinkedIn and Behance, each with its brand mark */
.cv-socials { display: flex; flex-wrap: wrap; gap: 6px 18px; }
.cv-social { display: inline-flex; align-items: center; gap: 8px; }
.cv-social svg { flex: none; width: 16px; height: 16px; fill: var(--brand); }

/* one card per part of the CV; Sky Glass adds its glass surface through .record__card */
.cv { display: grid; padding-bottom: clamp(56px, 9vh, 104px); }
/* Classic: open sections split by hairlines; Sky Glass turns each into a rounded glass card */
.cv-card { padding: clamp(36px, 6vh, 64px) 0; border-top: 1px solid var(--line); }
html[data-palette="glass"] .cv { gap: clamp(16px, 2cqi, 24px); }
html[data-palette="glass"] .cv-card { padding: clamp(24px, 3cqi, 44px); }
.cv-card__title { margin: 0 0 clamp(20px, 3vh, 32px); color: var(--ink-2); }
.stream-w { opacity: 0; }
.stream-w.on { opacity: 1; animation: msg-word .5s cubic-bezier(.2, .7, .2, 1) both; }
.stream-w.is-current { position: relative; }
.is-streaming .stream-w.is-current::after {
  content: ""; position: absolute; right: -.2em; bottom: .1em; width: 2px; height: .9em;
  background: var(--accent); pointer-events: none;
}
[data-stream] svg { opacity: 0; transition: opacity .3s; }
[data-stream]:has(.stream-w.on) svg, html.no-js [data-stream] svg { opacity: 1; }
@media (prefers-reduced-motion: reduce) {
  .stream-w { opacity: 1; animation: none !important; }
  .is-streaming .stream-w.is-current::after { display: none; }
  [data-stream] svg { opacity: 1; transition: none; }
}

.cv-summary__lead { margin: 0; font: 500 clamp(24px, 2.6cqi, 38px)/1.3 var(--display); letter-spacing: -.02em; color: var(--ink); }
.cv-summary__lead strong { color: var(--accent); font-weight: 500; }
/* the strength columns run down to the section's bottom edge, so their dividers meet the next hairline */
#summary.cv-card { padding-bottom: 0; }
.cv-strengths { display: grid; grid-template-columns: repeat(4, 1fr); margin-top: clamp(28px, 4vh, 44px); border-top: 1px solid var(--line); }
.cv-strength { padding: 28px clamp(16px, 2cqi, 28px) clamp(36px, 6vh, 56px); }
.cv-strength + .cv-strength { border-left: 1px solid var(--line); }
.cv-strength h3 { display: flex; align-items: flex-start; gap: 10px; margin: 0 0 10px; font: 500 18px/1.3 var(--display); letter-spacing: -.01em; }
.cv-strength h3 svg { flex: none; width: 22px; height: 22px; margin-top: 1px; fill: none; stroke: var(--accent); stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.cv-strength p { margin: 0; color: var(--ink-2); font-size: 15px; line-height: 1.55; }

/* square brand tiles for companies and schools */
.cv-logo { flex: none; display: grid; place-items: center; width: 48px; height: 48px; border-radius: 10px; overflow: hidden; background: #fff; outline: 1px solid var(--line); outline-offset: -1px; }
.cv-logo img { display: block; width: 100%; height: 100%; object-fit: contain; }
.cv-logo img[src$=".svg"] { width: 80%; height: 80%; }
.cv-logo img[src*="microsoft"] { width: 56%; height: 56%; }
.cv-logo img[src*="iitg"], .cv-logo img[src*="spav"] { width: 74%; height: 74%; }

.cv-roles { list-style: none; margin: 0; padding: 0; }
.cv-role + .cv-role { margin-top: clamp(28px, 4vh, 40px); padding-top: clamp(28px, 4vh, 40px); border-top: 1px solid var(--line); }
.cv-role__head { display: flex; align-items: center; gap: 16px; }
.cv-role__head > div { flex: 1; min-width: 0; }
.cv-role__head h3 { margin: 0; font: 500 22px/1.25 var(--display); letter-spacing: -.02em; }
.cv-role__org { margin: 4px 0 0; color: var(--ink-2); font-family: var(--display); font-size: 15px; }
.cv-role__dates { white-space: nowrap; color: var(--ink-3); }
.cv-role__sep { margin: 0 12px; color: var(--line); color: color-mix(in srgb, var(--ink-2) 45%, transparent); }
/* projects sit under the role, indented past the logo, with a hairline between each */
.cv-project, .cv-role__text { margin-left: 64px; }
.cv-project { margin-top: 20px; padding-top: 20px; border-top: 1px dashed var(--line); }
.cv-project h4 { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 12px; margin: 0; font: 500 17px/1.35 var(--sans); }
.cv-project h4 .mono { color: var(--ink-3); font-size: 11px; font-weight: 400; }
.cv-project ul { margin: 10px 0 0; padding-left: 18px; list-style: disc; display: grid; gap: 8px; max-width: 80ch; }
.cv-project li { color: var(--ink-2); line-height: 1.55; }
.cv-project li::marker { color: var(--accent); }
.cv-project strong { color: var(--ink); font-weight: 500; }
.cv-role__text { margin-top: 14px; color: var(--ink-2); max-width: 80ch; }

.cv-edu { display: grid; grid-template-columns: repeat(2, 1fr); gap: 24px; }
.cv-school { display: flex; gap: 16px; align-items: flex-start; }
.cv-school h3 { margin: 0 0 6px; font: 500 20px/1.3 var(--display); letter-spacing: -.02em; }
.cv-school p { margin: 0; color: var(--ink-2); font-size: 15px; }
.cv-school .cv-school__dates { margin-top: 8px; color: var(--ink-3); font-size: 12px; }

/* tools: brand-coloured marks; near-black marks follow the text colour so they work in dark mode */
.cv-tools { display: flex; flex-wrap: wrap; gap: 10px; list-style: none; padding: 0; margin: 0; }
.cv-tools li { display: inline-flex; align-items: center; gap: 10px; padding: 9px 16px 9px 12px; border: 1px solid var(--line); border-radius: 100px; font-size: 15px; color: var(--ink); }
.cv-tools svg { width: 20px; height: 20px; fill: var(--brand, currentColor); flex: none; }
.cv-tools img { width: 20px; height: 20px; border-radius: 5px; flex: none; }

.cv-ledger li { grid-template-columns: 120px 1fr; }
/* like the experience bullets: muted text with the key phrases in the primary colour */
.cv-ledger p { color: var(--ink-2); }
.cv-ledger strong { color: var(--accent); }
.together.cs-end.cv-end, .together.cs-end.home-end { padding-top: clamp(56px, 9vh, 104px); padding-bottom: clamp(56px, 9vh, 104px); }
@container page (max-width: 1200px) and (min-width: 641px) {
  .cv-strengths { grid-template-columns: repeat(2, 1fr); }
  .cv-strength:nth-child(odd) { border-left: 0; }
  .cv-strength:nth-child(n+3) { border-top: 1px solid var(--line); }
}

/* ---------- Forms (shared) ---------- */
.form { display: grid; gap: 22px; }
.field { border: 0; padding: 0; margin: 0; min-width: 0; display: grid; gap: 8px; }
.field label, .field legend { font-size: 14px; color: var(--ink-2); padding: 0; }
.field legend { margin-bottom: 10px; }
.optional { color: var(--ink-3); }
.field input, .field textarea {
  font: inherit; color: inherit; width: 100%;
  background: transparent; border: 0; border-bottom: 1px solid var(--ink-3);
  padding: 8px 0 10px; border-radius: 0; resize: vertical;
  background-image: linear-gradient(var(--accent), var(--accent));
  background-size: 0 1px; background-position: left bottom; background-repeat: no-repeat;
  transition: background-size .6s var(--ease), border-color .3s;
}
.field input:focus, .field textarea:focus { outline: none; background-size: 100% 1px; }
.field textarea::placeholder { color: var(--ink-3); }
.field__error { color: var(--danger); min-height: 1em; font-size: 11px; text-transform: none; }
.field.has-error input, .field.has-error textarea { border-bottom-color: var(--danger); }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }

.btn {
  justify-self: start; display: inline-flex; gap: 14px; align-items: center;
  font: 500 16px/1 var(--sans); color: var(--paper); background: var(--ink);
  border: 0; border-radius: 100px; padding: 16px 24px; cursor: pointer;
  transition: transform .4s var(--ease), background .3s;
}
.btn span:last-child { transition: transform .45s var(--ease); }
.btn:hover span:last-child { transform: translateX(4px); }
.btn:active { transform: scale(.98); }
.btn[disabled] { opacity: .55; cursor: progress; }
.form__status { text-transform: none; min-height: 1.4em; color: var(--ink-2); }
.form__status.is-success { color: var(--success); }

/* ---------- Contact ---------- */
.contact { padding-bottom: clamp(100px, 16vh, 180px); }
.contact__grid { display: grid; grid-template-columns: repeat(12, 1fr); gap: 24px; }
.contact__aside { grid-column: 1 / span 5; }
.contact .form { grid-column: 7 / -1; }
.links { list-style: none; padding: 0; margin: 36px 0 0; border-top: 1px solid var(--line); }
.links li { border-bottom: 1px solid var(--line); }
.links a {
  display: flex; justify-content: space-between; padding: 14px 0; text-decoration: none;
  transition: padding .45s var(--ease), color .3s;
}
.links a::after { content: "\2197"; color: var(--ink-3); transition: color .3s; }
.links a:hover { padding-left: 8px; }
.links a:hover::after { color: var(--accent); }

/* ---------- Let's work together (inverted) ---------- */
.together {
  max-width: none; margin: 0;
  background: var(--inv-bg); color: var(--inv-fg);
  padding-top: clamp(56px, 9vh, 112px); padding-bottom: clamp(56px, 9vh, 112px);
  --line: rgba(var(--inv-rgb), .16);
}
.together__inner {
  max-width: var(--max); margin: 0 auto;
  display: grid; grid-template-columns: repeat(12, 1fr); gap: 24px;
}
.together__head { grid-column: 1 / span 5; align-self: start; }
.together__head :is(h1, h2) { font-size: clamp(48px, 6cqi, 96px); margin: 0 0 30px; }
.together__head em { color: var(--inv-accent); }
.together__head .lede { color: rgba(var(--inv-rgb), .72); }
.together .form { grid-column: 7 / -1; }
/* Collab page: the "What are you looking for?" pills pick which form shows below them, and the intro beside it follows */
.together .collab__panel { grid-column: 7 / -1; display: grid; gap: 22px; align-content: start; }
.together .collab__panel .form { grid-column: auto; }
.collab__modes { padding-bottom: 28px; margin-bottom: 6px; border-bottom: 1px solid var(--line); }
.form[hidden] { display: none; }
.collab__panel .form:not([hidden]), .is-swapped { animation: collab-in .45s var(--ease); }
@keyframes collab-in { from { opacity: 0; transform: translateY(8px); } }

.form--dark .field label, .form--dark .field legend { color: rgba(var(--inv-rgb), .7); }
.form--dark .field input, .form--dark .field textarea { border-bottom-color: rgba(var(--inv-rgb), .35); }
.form--dark .field textarea::placeholder { color: rgba(var(--inv-rgb), .35); }
.form--dark .optional { color: rgba(var(--inv-rgb), .6); }
.form--dark .form__status { color: rgba(var(--inv-rgb), .7); }
.form--dark .form__status.is-success { color: var(--inv-success, #8FD3A6); }
.btn--light { background: var(--inv-fg); color: var(--inv-bg); }
/* form submit buttons (Send note, Send brief) use the primary accent */
.contact .btn, .together .btn { background: var(--accent); color: #fff; }
.contact .btn:hover, .together .btn:hover { background: color-mix(in srgb, var(--accent) 88%, #000); }
[data-theme="dark"] .contact .btn, [data-theme="dark"] .together .btn { color: #10121F; }
[data-theme="dark"] .contact .btn:hover, [data-theme="dark"] .together .btn:hover { background: color-mix(in srgb, var(--accent) 85%, #fff); }
.form--dark .field input:focus, .form--dark .field textarea:focus { background-image: linear-gradient(var(--inv-accent), var(--inv-accent)); }

.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { position: relative; cursor: pointer; }
.chip input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.chip > span {
  display: inline-flex; align-items: center; gap: 8px; padding: 9px 16px; border-radius: 100px;
  border: 1px solid rgba(var(--inv-rgb), .3); font-size: 15px;
  transition: background .35s var(--ease), color .35s var(--ease), border-color .35s;
}
.chip:hover > span { border-color: rgba(var(--inv-rgb), .7); }
/* selected: no fill, just the primary colour on the label and the outline */
.chip input:checked + span { background: transparent; color: var(--inv-accent); border-color: var(--inv-accent); }
.chip input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }
/* keep each row of pills on one line while the form column is narrow */
@container page (max-width: 1280px) and (min-width: 961px) {
  .chips { gap: 6px; }
  .chip > span { padding: 8px 12px; font-size: 14px; gap: 6px; }
}
@container page (max-width: 1100px) and (min-width: 961px) {
  .together .form, .together .collab__panel { grid-column: 6 / -1; }
}

/* ---------- custom dropdowns: the closed state looks like the field it replaces, the menu follows the theme ---------- */
.dd { position: relative; --dd-bg: var(--paper); --dd-fg: var(--ink); --dd-rgb: var(--ink-rgb, 20, 20, 20); --dd-accent: var(--accent); }
.form--dark .dd { --dd-bg: color-mix(in srgb, var(--inv-fg) 7%, var(--inv-bg)); --dd-fg: var(--inv-fg); --dd-rgb: var(--inv-rgb); --dd-accent: var(--inv-accent); }
.dd__btn { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
.dd__btn svg { flex: none; width: 12px; height: 8px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; opacity: .65; transition: transform .3s var(--ease); }
.dd__btn[aria-expanded="true"] svg { transform: rotate(180deg); }
.dd__btn--field {
  display: flex; align-items: center; justify-content: space-between; gap: 12px; width: 100%; text-align: left;
  padding: 8px 4px 10px 0; border-bottom: 1px solid rgba(var(--dd-rgb), .35);
  background-image: linear-gradient(var(--dd-accent), var(--dd-accent));
  background-size: 0 1px; background-position: left bottom; background-repeat: no-repeat;
  transition: background-size .6s var(--ease);
}
.dd__btn--field:focus-visible, .dd__btn--field[aria-expanded="true"] { outline: none; background-size: 100% 1px; }

.dd__menu {
  position: absolute; z-index: 30; top: calc(100% + 8px); left: 0; min-width: 100%; margin: 0; padding: 6px;
  list-style: none; box-sizing: border-box; white-space: nowrap;
  background: var(--dd-bg); color: var(--dd-fg);
  border: 1px solid rgba(var(--dd-rgb), .16); border-radius: 0;
  box-shadow: 0 18px 40px -12px rgba(0, 0, 0, .45);
  animation: dd-in .18s var(--ease);
}
.dd__menu:focus { outline: none; }
@keyframes dd-in { from { opacity: 0; transform: translateY(-4px); } }
/* .field label would otherwise strip the row padding and dim the text */
.dd__menu [role="option"] {
  position: relative; display: flex; align-items: center; gap: 10px;
  padding: 10px 12px 10px 36px; border-radius: 0; font-size: 15px; color: inherit; cursor: pointer;
}
.dd__menu [role="option"]:hover, .dd__menu [role="option"].is-active { background: rgba(var(--dd-rgb), .09); }
.dd__menu [role="option"][aria-selected="true"] { color: var(--dd-accent); }
.dd__menu [role="option"][aria-selected="true"]::before {
  content: ""; position: absolute; left: 14px; top: 50%; width: 10px; height: 5px; margin-top: -4px;
  border: solid currentColor; border-width: 0 0 1.6px 1.6px; transform: rotate(-45deg);
}

/* ---------- Footer ---------- */
.footer {
  display: flex; flex-wrap: wrap; gap: 12px 32px; justify-content: space-between;
  padding: 22px var(--pad); background: var(--inv-bg); color: rgba(var(--inv-rgb), .55);
  border-top: 1px solid rgba(var(--inv-rgb), .12);
}
.footer a { text-decoration: none; }
.footer a:hover { color: var(--inv-fg); }
.heart { color: var(--redline); }

/* ---------- Scroll reveals ---------- */
[data-reveal] {
  opacity: 0; transform: translateY(18px);
  transition: opacity var(--slow) var(--ease) var(--d, 0s), transform var(--slow) var(--ease) var(--d, 0s);
}
[data-reveal].in { opacity: 1; transform: none; }
/* content that lands in view on a tab switch appears at once, under the switch's own fade */
html.is-jumping [data-reveal] { transition: none; }
.no-js [data-reveal] { opacity: 1; transform: none; }

/* ---------- Case study pages ---------- */
a.frame { display: block; }
.case__info .case__title a { text-decoration: none; }
.case__info .case__title a:hover { color: var(--accent); }

.cs-hero { padding-top: clamp(40px, 7vh, 88px); padding-bottom: clamp(40px, 7vh, 72px); }
.cs-back {
  display: inline-flex; gap: 10px; align-items: center; color: var(--ink-2); text-decoration: none;
  margin-bottom: clamp(32px, 6vh, 64px); transition: color .3s, gap .45s var(--ease);
}
.cs-back:hover { color: var(--accent); gap: 14px; }
.cs-hero__title { font-size: clamp(44px, 7cqi, 112px); margin: 22px 0 clamp(24px, 4vh, 40px); max-width: 16ch; color: var(--accent); }
.cs-hero__title em { color: var(--accent); }
.cs-hero__lede { max-width: 46ch; font-size: clamp(20px, 1.9cqi, 27px); line-height: 1.38; color: var(--ink-2); }
.cs-hero__lede strong { color: var(--ink); font-weight: 500; }

.cs-facts {
  display: grid; grid-template-columns: repeat(4, 1fr); margin: clamp(40px, 7vh, 72px) 0 0;
  border-top: 1px solid var(--line);
}
.cs-facts div { padding: 22px 24px 0 0; }
.cs-facts div + div { padding-left: 24px; border-left: 1px solid var(--line); }
.cs-facts dt { color: var(--ink-3); }
.cs-facts dd { margin: 8px 0 0; font-size: 16px; line-height: 1.45; }

.cs-figure { padding-bottom: clamp(48px, 8vh, 96px); display: grid; grid-template-columns: repeat(12, 1fr); gap: 24px; }
.cs-figure .frame { grid-column: 4 / -1; }
.cs-figure figcaption, .cs-inline-figure figcaption { margin-top: 12px; color: var(--ink-3); }

.cs-stats {
  --band: clamp(28px, 4.5vh, 44px);
  display: grid; grid-template-columns: repeat(4, 1fr);
  border-block: 1px solid var(--line); padding: 0; margin: 0;
}
.cs-stats div { padding: var(--band) 24px; display: flex; flex-direction: column; gap: 10px; }
.cs-stats div:first-child { padding-left: 0; }
.cs-stats div + div { border-left: 1px solid var(--line); }
.cs-stats dt { order: 2; color: var(--ink-2); font-size: 15px; line-height: 1.4; max-width: 26ch; }
.cs-stats dd { order: 1; margin: 0; font: 500 clamp(34px, 3.6cqi, 54px)/1 var(--display); letter-spacing: -.03em; font-variant-numeric: tabular-nums; color: var(--accent); }
.prose > .cs-stats { margin-top: 2.4em; }
.prose > .cs-note { margin-top: 14px; }
.cs-note { margin-top: 14px; color: var(--ink-3); text-transform: none; }
/* footnotes read as small print, below the body size that .prose p would otherwise give them */
.prose p.cs-note { font-size: 12px; line-height: 1.55; letter-spacing: .02em; max-width: 72ch; }

.cs-body { padding-bottom: clamp(24px, 4vh, 48px); }
.chapter {
  display: grid; grid-template-columns: repeat(12, 1fr); gap: 24px;
  padding: 28px 0 clamp(48px, 8vh, 88px);
  border-top: 1px solid var(--line);
}
.chapter__title { grid-column: 1 / span 3; align-self: start; position: sticky; top: 96px; color: var(--ink-2); display: flex; gap: 14px; }
.chapter__title span { color: var(--accent); }
.chapter__body { grid-column: 4 / -1; min-width: 0; }

.prose > * + * { margin-top: 1.1em; }
.prose p { max-width: 64ch; font-size: 18px; line-height: 1.62; }
.prose p.lead { font: 500 clamp(22px, 2cqi, 28px)/1.35 var(--display); letter-spacing: -.015em; max-width: 36ch; }
.prose h3 { font: 500 20px/1.3 var(--sans); margin-top: 2em; }
.prose > h3:first-child { margin-top: 0; }
.prose strong { font-weight: 500; }
.prose a { color: var(--accent); text-underline-offset: 3px; }
.prose ul { list-style: none; padding: 0; max-width: 64ch; }
.prose ul li { position: relative; padding: 10px 0 10px 28px; border-bottom: 1px solid var(--line); font-size: 17px; }
.prose ul li:first-child { border-top: 1px solid var(--line); }
.prose ul li::before { content: ""; position: absolute; left: 0; top: 1.25em; width: 12px; height: 1px; background: var(--accent); }

.insights {
  list-style: none; padding: 0; counter-reset: ins;
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 32px;
}
.insights--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.insights li { counter-increment: ins; padding: 20px 0 24px; border-top: 1px solid var(--line); }
.insights li::before {
  content: counter(ins, decimal-leading-zero); display: block; margin-bottom: 14px;
  font: 12px/1 var(--mono); letter-spacing: .02em; color: var(--accent);
}
.insights li:has(.num)::before { display: none; }
.insights h3 { font: 500 19px/1.3 var(--sans); margin: 0 0 8px; }
.insights p { color: var(--ink-2); font-size: 16px; line-height: 1.55; }
.insights .num { font: 500 40px/1 var(--display); letter-spacing: -.03em; color: var(--ink); display: block; margin-bottom: 10px; }

.steps {
  list-style: none; padding: 0; counter-reset: step;
  display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 0 24px;
}
.steps li { counter-increment: step; padding: 16px 0 20px; border-top: 1px solid var(--line); position: relative; font-size: 16px; line-height: 1.5; }
.steps li::before {
  content: attr(data-label); display: block; margin-bottom: 10px;
  font: 12px/1 var(--mono); letter-spacing: .02em; text-transform: uppercase; color: var(--accent);
}
.steps li:not([data-label])::before { content: "Step " counter(step); }

/* DOM order stays sequential; wider layouts follow the arrows back and forth. */
.workflow-flow {
  --flow-gap: 32px;
  list-style: none; padding: 0; counter-reset: flow-step;
  display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--flow-gap);
}
.workflow-flow > li {
  counter-increment: flow-step; position: relative; min-width: 0; padding: 16px;
  border: 1px solid var(--line); border-radius: 12px; background: var(--paper-2);
  color: var(--ink); font-size: 16px; line-height: 1.5;
}
.workflow-flow > li::before {
  content: counter(flow-step, decimal-leading-zero); display: block; margin-bottom: 10px;
  font: 12px/1 var(--mono); color: var(--accent);
}
.workflow-flow > li:not(:last-child)::after {
  content: ""; position: absolute; width: var(--flow-gap); height: 12px;
  left: 50%; top: calc(100% + var(--flow-gap) / 2);
  transform: translate(-50%, -50%) rotate(90deg); background: var(--accent);
  clip-path: polygon(0 42%, 70% 42%, 70% 12%, 100% 50%, 70% 88%, 70% 58%, 0 58%);
}
.workflow-flow > li:first-child, .workflow-flow > li:last-child { border-color: var(--accent); }
@container page (min-width: 1100px) {
  .workflow-flow { grid-template-columns: repeat(4, minmax(0, 1fr)); grid-auto-flow: row dense; }
  .workflow-flow > li:nth-child(8n+1), .workflow-flow > li:nth-child(8n) { grid-column: 1; }
  .workflow-flow > li:nth-child(8n+2), .workflow-flow > li:nth-child(8n+7) { grid-column: 2; }
  .workflow-flow > li:nth-child(8n+3), .workflow-flow > li:nth-child(8n+6) { grid-column: 3; }
  .workflow-flow > li:nth-child(8n+4), .workflow-flow > li:nth-child(8n+5) { grid-column: 4; }
  .workflow-flow > li:not(:nth-child(4n))::after {
    left: calc(100% + var(--flow-gap) / 2); top: 50%;
    transform: translate(-50%, -50%);
  }
  .workflow-flow > li:nth-child(8n+5)::after,
  .workflow-flow > li:nth-child(8n+6)::after,
  .workflow-flow > li:nth-child(8n+7)::after {
    left: calc(var(--flow-gap) / -2); transform: translate(-50%, -50%) rotate(180deg);
  }
}

.milestones { list-style: none; padding: 0; }
.milestones li {
  display: grid; grid-template-columns: 120px 1fr; gap: 24px; align-items: baseline;
  padding: 14px 0; border-bottom: 1px solid var(--line); position: relative;
}
.milestones li:first-child { border-top: 1px solid var(--line); }
.milestones .mono { color: var(--ink-3); }

.pull { margin: 2.2em 0 !important; padding: 0 0 0 28px; border-left: 2px solid var(--redline); max-width: 760px; }
.pull p { font: 500 clamp(22px, 2.1cqi, 30px)/1.3 var(--display) !important; letter-spacing: -.02em; max-width: none !important; }
.pull cite { display: block; margin-top: 14px; font: normal 12px/1.4 var(--mono); letter-spacing: .02em; text-transform: uppercase; color: var(--ink-3); }
/* reference tables in case studies: hairline rows, mono column heads, scroll sideways on narrow screens */
.cs-table { margin: 1.8em 0 !important; overflow-x: auto; }
.cs-table table { width: 100%; border-collapse: collapse; font-size: 15px; line-height: 1.45; }
.cs-table th, .cs-table td { padding: 11px 16px 11px 0; text-align: left; vertical-align: top; border-bottom: 1px solid var(--line); }
.cs-table thead th { font: 500 11px/1.4 var(--mono); letter-spacing: .04em; text-transform: uppercase; color: var(--ink-3); border-bottom-color: var(--ink-3); }
.cs-table tbody th { font-weight: 500; color: var(--ink); white-space: nowrap; }
.cs-table td { color: var(--ink-2); }
.prose code { font: 13px/1.5 var(--mono); padding: 1px 5px; background: color-mix(in srgb, var(--ink) 7%, transparent); overflow-wrap: anywhere; }

.quotes { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px 32px; }
.quotes blockquote { margin: 0; padding: 20px 0 0; border-top: 1px solid var(--line); }
.quotes p { font: 500 21px/1.35 var(--display); letter-spacing: -.015em; }
.quotes cite { display: block; margin-top: 10px; font: normal 11px/1.4 var(--mono); letter-spacing: .02em; text-transform: uppercase; color: var(--ink-3); }

.cs-inline-figure { margin: 2.2em 0 0 !important; }
/* real product screenshots */
.cs-shot { margin: 2.2em 0 0 !important; }
.cs-shot img, .cs-shot video {
  display: block; width: 100%; height: auto; border-radius: 6px; background: var(--paper-2);
  outline: 1px solid var(--line); outline-offset: -1px;
  box-shadow: 0 24px 48px -28px rgba(0, 0, 0, .35);
}
.cs-shot figcaption { margin-top: 12px; color: var(--ink-3); }
/* game manual: sprite cards (drawn by runner.js) and the controls list */
.prose .manual__grid {
  list-style: none; padding: 0; max-width: none;
  display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 12px;
}
.prose .manual__grid li { padding: 18px; border: 1px solid var(--line); border-radius: 6px; font-size: 16px; }
.prose .manual__grid li::before { display: none; }
.manual__art { display: flex; align-items: flex-end; height: 72px; margin-bottom: 14px; }
.manual__art canvas { display: block; image-rendering: pixelated; }
.prose .manual__grid h3 { font: 500 17px/1.3 var(--sans); margin: 0 0 6px; }
.prose .manual__grid p { font-size: 15px; line-height: 1.5; color: var(--ink-2); }
.prose .manual__keys li { display: grid; grid-template-columns: minmax(150px, 13em) 1fr; gap: 16px; padding-left: 0; }
.prose .manual__keys li::before { display: none; }
.manual__keys b { font-weight: 500; }
.manual__keys span { color: var(--ink-2); }
kbd {
  display: inline-block; min-width: 1.6em; padding: 1px 6px; text-align: center;
  font: 12px/1.6 var(--mono); color: var(--ink); border: 1px solid var(--line); border-bottom-width: 2px; border-radius: 4px;
}
.cs-shot--hero { margin: 0 !important; grid-column: 4 / -1; }
/* screenshots that bring their own rounded, transparent edges */
.cs-shot--cutout img { background: none; outline: 0; border-radius: 0; box-shadow: none; filter: drop-shadow(0 24px 32px rgba(0, 0, 0, .22)); }
.cs-shots { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px; margin-top: 2.2em !important; }
.cs-shots--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; }
.cs-shots--3 figcaption { font-size: 11px; }

/* homepage thumbnails: real screens cropped to the card's 16:10 frame */
.frame--shot { position: relative; display: block; overflow: hidden; border-radius: 4px; outline: 1px solid var(--line); background: var(--paper-2); }
.frame--shot img {
  display: block; width: 100%; height: auto; aspect-ratio: 16 / 10; object-fit: cover; object-position: top left;
  transition: transform .9s var(--ease), border-radius .9s var(--ease);
}
@media (hover: hover) {
  .case__tile:hover .frame--shot img { transform: scale(1.06); }
}
[data-theme="dark"] .frame--shot img { filter: brightness(.92); }
.cs-shots .cs-shot { margin: 0 !important; }
/* slide exports carry their own rounded corners; clip past them (percent keeps it proportional at any width) */
.cs-shot--slide img { border-radius: 2.2% / 3.9%; }
.cs-inline-figure .artboard { max-width: 760px; }

/* ---------- Project viewer (full-screen modal) ---------- */
.case-modal {
  width: 100vw; height: 100dvh; max-width: none; max-height: none; margin: 0;
  padding: 0; border: 0; overflow: auto; overscroll-behavior: contain;
  background: var(--paper); color: var(--ink);
  opacity: 0; transform: translateY(24px);
  transition: opacity .35s var(--ease), transform .5s var(--ease), overlay .35s allow-discrete, display .35s allow-discrete;
}
.case-modal[open] { opacity: 1; transform: none; }
@starting-style { .case-modal[open] { opacity: 0; transform: translateY(24px); } }
.case-modal::backdrop { background: var(--paper); }
html:has(.case-modal[open]) { overflow: hidden; }
/* the viewer is non-modal so the Ask me pane can dock beside it; with the pane open it fills the space left of it.
   It opens below the site's top bar (--topbar-h is measured in script.js), which stays usable above it. */
.case-modal[open]:not(:modal) { position: fixed; inset: var(--topbar-h, 0px) auto auto 0; height: calc(100dvh - var(--topbar-h, 0px)); z-index: 75; transition: opacity .35s var(--ease), transform .5s var(--ease), width .38s var(--ease), display .35s allow-discrete; }
/* the top bar's menus and (on phones) the bottom nav stay above the viewer */
html:has(.case-modal[open]) :is(.topbar, .bottom-nav) { z-index: 77; }
@media (min-width: 900px) { html.chat-open .case-modal[open]:not(:modal) { width: calc(100vw - var(--chat-w)); } }

/* the title bar stays pinned while the video, summary and case study scroll beneath it */
.case-modal__head {
  position: sticky; top: 0; z-index: 3; display: flex; align-items: center; gap: clamp(16px, 2cqi, 32px);
  padding: clamp(14px, 2.2vh, 26px) var(--pad); background: var(--paper);
  border-bottom: 1px solid transparent; transition: border-color .3s;
}
.case-modal.is-scrolled .case-modal__head { border-bottom-color: var(--line); }
/* first screen: the video fills what the title bar leaves, the summary strip sits at the bottom */
.case-modal__hero {
  display: grid; grid-template-rows: minmax(0, 1fr) auto; gap: clamp(14px, 2.2vh, 26px);
  height: calc(100dvh - var(--topbar-h, 0px) - var(--head-h, 96px)); padding: 0 var(--pad) clamp(8px, 1.4vh, 16px);
}
.case-modal__titlebar { flex: 1; min-width: 0; }
.case-modal__head .case__title { margin: 0; font-size: clamp(24px, 2.4cqi, 34px); color: var(--accent); }
/* product, year and tags grouped as one details cluster beside the close button */
.case-modal__details { display: flex; align-items: center; flex-wrap: wrap; justify-content: flex-end; gap: 10px 18px; }
.case-modal__details .case__meta { margin: 0; }
.case-modal__details .tags { margin: 0; }

/* the stage sizes the media to the largest 16:9 box that fits */
.case-modal__stage { container-type: size; display: grid; place-items: center; min-height: 0; }
.case-modal__media {
  display: block; width: min(100cqw, 100cqh * 16 / 9); height: auto; aspect-ratio: 16 / 9;
  border-radius: 8px; background: #000; object-fit: contain; outline: 1px solid var(--line); outline-offset: -1px;
}
img.case-modal__media { background: var(--paper-2); }
img.case-modal__media.is-cutout { background: none; outline: 0; border-radius: 0; }
/* The Last of UX plays right in the stage; it draws in the theme's colours over the paper tone */
canvas.case-modal__media { background: var(--paper); cursor: pointer; touch-action: manipulation; }
canvas.case-modal__media:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.case-modal__media[hidden] { display: none; }
/* centred play/pause; while playing it fades away until the video is hovered or the button is focused */
.case-modal__stage { position: relative; }
.case-modal__play {
  position: absolute; left: 50%; top: 50%; z-index: 1; translate: -50% -50%;
  display: grid; place-items: center; width: clamp(56px, 6cqi, 76px); aspect-ratio: 1; padding: 0;
  border: 0; border-radius: 50%; background: rgba(10, 10, 9, .55); color: #fff; cursor: pointer;
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  box-shadow: 0 8px 28px -10px rgba(0, 0, 0, .5);
  transition: opacity .35s var(--ease), scale .35s var(--ease), background .3s;
}
.case-modal__play[hidden] { display: none; }
.case-modal__play:hover { scale: 1.06; background: rgba(10, 10, 9, .7); }
.case-modal__play svg { width: 42%; height: 42%; }
.case-modal__play .i-pause, .case-modal__play.is-playing .i-play { display: none; }
.case-modal__play.is-playing .i-pause { display: block; }
.case-modal__play.is-playing:not(:focus-visible) { opacity: 0; }
.case-modal__stage:hover .case-modal__play.is-playing { opacity: 1; }

/* the poster, the media and the lock all share one cell of the stage */
.case-modal__stage > :not(.case-modal__play) { grid-area: 1 / 1; }
.case-modal__media.is-poster { object-fit: cover; }
/* NDA projects: the thumbnail blurs behind a lock until the password is entered */
.case-modal__stage.is-locked img.case-modal__media { filter: blur(22px) saturate(.85); transform: scale(1.06); clip-path: inset(3% round 8px); }
.case-modal__lock {
  position: relative; z-index: 1; width: min(100cqw, 100cqh * 16 / 9); aspect-ratio: 16 / 9; box-sizing: border-box;
  display: grid; place-content: center; justify-items: center; gap: 12px; padding: 24px; text-align: center;
  border-radius: 8px; background: color-mix(in srgb, var(--paper) 70%, transparent); outline: 1px solid var(--line); outline-offset: -1px;
}
.case-modal__lock[hidden] { display: none; }
.case-modal__lock-icon { width: 34px; height: 34px; color: var(--ink); margin-bottom: 2px; }
.case-modal__lock-kicker { margin: 0; color: var(--ink); font-size: 11px; }
.case-modal__lock-title { margin: 0; font: 500 clamp(22px, 2.4cqi, 34px)/1.15 var(--display); letter-spacing: -.02em; max-width: 22ch; }
/* a public YouTube film for an NDA project: poster first, the player loads on play */
.case-modal__yt { position: relative; overflow: hidden; }
.case-modal__yt > * { display: block; width: 100%; height: 100%; border: 0; }
.case-modal__yt-poster { position: relative; padding: 0; background: #000; cursor: pointer; }
.case-modal__yt-poster img { display: block; width: 100%; height: 100%; object-fit: cover; }
.case-modal__yt-poster:hover .case-modal__play { scale: 1.06; background: rgba(10, 10, 9, .7); }
.case-modal__yt-poster:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
/* ...and the password panel moves below the summary strip, where the case study will appear */
.case-modal__lock.is-inline {
  width: auto; aspect-ratio: auto; margin: clamp(16px, 3vh, 32px) var(--pad);
  padding: clamp(36px, 6vh, 64px) 24px; background: var(--paper-2);
}
/* Classic: no card; the summary strip closes with a hairline (so the metric dividers meet it) and the panel sits open beneath */
html:not([data-palette="glass"]) .case-modal:has(.case-modal__lock.is-inline:not([hidden])) .case-modal__hero { padding-bottom: 0; }
html:not([data-palette="glass"]) .case-modal:has(.case-modal__lock.is-inline:not([hidden])) .case-modal__foot { border-bottom: 1px solid var(--line); }
html:not([data-palette="glass"]) .case-modal__lock.is-inline {
  margin: 0 var(--pad); padding: clamp(48px, 8vh, 88px) 24px; background: none; outline: 0; border-radius: 0;
}
.case-modal__lock-access { padding: 4px 0; border: 0; background: none; color: var(--accent); font: 500 14px/1.4 var(--sans); cursor: pointer; }
.case-modal__lock-access:hover { text-decoration: underline; text-underline-offset: 3px; }
.case-modal__lock:not(.is-inline) .case-modal__lock-access { display: none; }
/* the strip button reads "Request access" while locked, so its arrow points ahead instead of down */
[data-modal-more].is-access svg { rotate: -90deg; }
/* the password field carries its own submit: a secondary, outlined arrow button inside its right edge */
.case-modal__unlock-field { position: relative; display: inline-block; }
.case-modal__unlock { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 8px; margin-top: 6px; }
.case-modal__unlock input {
  display: block; box-sizing: border-box; width: 260px; padding: 11px 52px 11px 16px; border: 1px solid var(--line); border-radius: 100px;
  background: color-mix(in srgb, var(--paper) 80%, transparent); color: var(--ink); font: 15px/1.2 var(--sans);
}
.case-modal__unlock input:focus { outline: 2px solid var(--accent); outline-offset: 1px; }
.case-modal__unlock button {
  position: absolute; top: 50%; right: 5px; translate: 0 -50%;
  display: grid; place-items: center; width: 32px; height: 32px; padding: 0;
  border: 1px solid var(--ink-3); border-radius: 50%; background: transparent; color: var(--ink); cursor: pointer;
  transition: border-color .2s, background .2s, color .2s;
}
.case-modal__unlock button svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; transition: transform .3s var(--ease); }
.case-modal__unlock button:hover, .case-modal__unlock button:focus-visible { border-color: var(--ink); background: color-mix(in srgb, var(--ink) 8%, transparent); outline: none; }
.case-modal__unlock button:hover svg { transform: translateX(2px); }
.case-modal__unlock button:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.case-modal__unlock button[disabled] { opacity: .55; cursor: progress; }
.case-modal__unlock-msg { flex-basis: 100%; min-height: 1.3em; margin: 0; font-size: 11px; color: var(--ink-2); text-transform: none; }
/* the status line only takes space when there's something to say, so "Request access" sits close to the field */
.case-modal__unlock-msg:empty { display: none; }
/* while a protected film decrypts, the play button spins */
/* while loading, the button keeps its play icon and the spinner runs as a ring on its edge */
.case-modal__play.is-loading .i-pause, .case-modal__play.is-loading.is-playing .i-pause { display: none; }
.case-modal__play.is-loading .i-play, .case-modal__play.is-loading.is-playing .i-play { display: block; }
/* a spinner stays visible even over a playing film (where the pause button otherwise fades out) */
.case-modal__play.is-loading, .case-modal__play.is-playing.is-loading:not(:focus-visible) { opacity: 1; cursor: progress; }
.case-modal__yt-poster.is-loading { cursor: progress; }
.case-modal__yt-poster.is-loading:hover .case-modal__play { scale: 1; }
/* a film that failed to load: a message centred on the stage, in place of the play button */
.case-modal__error {
  position: relative; z-index: 3; align-self: center; justify-self: center; box-sizing: border-box; max-width: min(360px, calc(100% - 32px));
  display: grid; justify-items: center; gap: 6px; padding: 20px 24px; text-align: center;
  border-radius: 14px; background: rgba(10, 10, 9, .74); color: #fff;
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); box-shadow: 0 8px 28px -10px rgba(0, 0, 0, .5);
}
.case-modal__error[hidden] { display: none; }
.case-modal__error-title { margin: 0; font: 500 17px/1.3 var(--display); }
.case-modal__error-text { margin: 0; font-size: 14px; line-height: 1.45; color: rgba(255, 255, 255, .75); }
.case-modal__error-retry {
  margin-top: 8px; padding: 8px 16px; border: 1px solid rgba(255, 255, 255, .6); border-radius: 100px;
  background: none; color: #fff; font: 500 14px/1 var(--sans); cursor: pointer; transition: background .25s, color .25s;
}
.case-modal__error-retry:hover, .case-modal__error-retry:focus-visible { background: #fff; color: #111; outline: none; }
.case-modal__error-retry:focus-visible { box-shadow: 0 0 0 2px rgba(10, 10, 9, .74), 0 0 0 4px #fff; }
.case-modal__stage.has-error .case-modal__play { display: none; }
/* a YouTube poster stays on top of the loading player until it's ready */
.case-modal__yt > .case-modal__yt-poster.is-loading { position: absolute; inset: 0; z-index: 1; }
.case-modal__play.is-loading::after {
  content: ""; position: absolute; inset: 0; box-sizing: border-box; border-radius: 50%; pointer-events: none;
  border: 3px solid rgba(255, 255, 255, .22); border-top-color: #fff;
  animation: spin .9s linear infinite;
}
@keyframes spin { to { rotate: 360deg; } }
/* decrypted screenshots stay invisible (keeping their space) until they're ready */
[data-vault-pending] { visibility: hidden; }

/* request access: a small dialog over the viewer */
.access-modal {
  width: min(520px, calc(100vw - 32px)); max-height: calc(100dvh - 32px); box-sizing: border-box; overflow: auto;
  padding: clamp(24px, 4cqi, 40px); border: 1px solid var(--line); border-radius: 16px;
  background: var(--paper); color: var(--ink); box-shadow: 0 30px 80px -30px rgba(0, 0, 0, .45);
}
.access-modal::backdrop { background: rgba(10, 10, 9, .45); backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px); }
.access-modal__close {
  position: absolute; top: 14px; right: 14px; display: grid; place-items: center; width: 40px; height: 40px; padding: 0;
  border: 1px solid var(--line); border-radius: 50%; background: transparent; color: var(--ink); cursor: pointer;
}
.access-modal__close svg { width: 18px; height: 18px; }
.access-modal__kicker { margin: 0 0 10px; color: var(--accent); font-size: 11px; }
.access-modal__title { margin: 0 48px 10px 0; font: 500 clamp(26px, 3cqi, 34px)/1.1 var(--display); letter-spacing: -.025em; }
.access-modal__lede { margin: 0 0 24px; color: var(--ink-2); }
.access-modal .form { display: grid; gap: 18px; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

/* the public stub of a protected case study (seen only with ?static) */
.cs-locked { padding-block: clamp(48px, 10vh, 120px); display: grid; gap: 14px; justify-items: start; border-top: 1px solid var(--line); }
.cs-locked h2 { margin: 0; font: 500 clamp(28px, 3cqi, 44px)/1.1 var(--display); letter-spacing: -.03em; }
.cs-locked p { margin: 0; color: var(--ink-2); }
.cs-locked .mono { color: var(--accent); }

/* one strip: summary | metric | metric | metric | CTA, all centred on the same axis */
.case-modal__foot {
  --strip-y: clamp(14px, 2.2vh, 24px);
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.7fr) auto; align-items: stretch;
  column-gap: clamp(20px, 3cqi, 48px); border-top: 1px solid var(--line);
}
.case-modal__about { align-self: center; padding: var(--strip-y) 0; }
.case-modal__about .case__summary { margin: 0; max-width: 56ch; }
/* rows are shared (subgrid) so the numbers and labels line up across all three, centred as a group */
.case-modal__impact .case__metrics { height: 100%; margin: 0; border-radius: 0; background: none; grid-template-rows: 1fr auto auto 1fr; }
/* the vertical lines run the full height of the strip */
.case-modal__impact .case__metrics div {
  display: grid; grid-row: 1 / -1; grid-template-rows: subgrid;
  padding: var(--strip-y) clamp(16px, 2cqi, 28px); border-left: 1px solid var(--line);
}
.case-modal__impact .case__metrics dd { grid-row: 2; }
.case-modal__impact .case__metrics dt { grid-row: 3; }
.case-modal__foot .btn { align-self: center; }
.case-modal__foot .btn svg { width: 18px; height: 18px; transition: transform .45s var(--ease); }
.case-modal__foot .btn:hover svg { transform: translateY(3px); }

/* secondary: an outlined pill in the ink colour, filling on hover like "Work together" in the nav */
.case-modal__foot .btn { text-decoration: none; background: transparent; color: var(--ink); box-shadow: inset 0 0 0 1px currentColor; white-space: nowrap; transition: transform .4s var(--ease), background .3s, color .3s; }
.case-modal__foot .btn:hover { background: var(--ink); color: var(--paper); }

.case-modal__close {
  flex: none; display: grid; place-items: center; width: 44px; height: 44px; padding: 0;
  border: 1px solid var(--line); border-radius: 50%; background: var(--paper); color: var(--ink); cursor: pointer;
  transition: background .3s, color .3s, transform .4s var(--ease);
}
.case-modal__close:hover { background: var(--ink); color: var(--paper); transform: rotate(90deg); }
.case-modal__close svg { width: 18px; height: 18px; }
/* the case study, loaded from its page, continues below the first screen */
/* holds space only while the case study loads, so an empty or locked page leaves no gap */
.case-modal__page[aria-busy="true"] { min-height: 40vh; }
.case-modal__page { display: flow-root; }
.case-modal__page[aria-busy="true"]::before { content: "Loading the case study…"; display: block; padding: 48px var(--pad); color: var(--ink-3); font: 13px/1 var(--mono); }
.case-modal__facts { padding-bottom: clamp(40px, 7vh, 72px); }
.case-modal__facts .cs-facts { margin-top: clamp(24px, 4vh, 40px); }
.case-modal .chapter__title { top: calc(var(--head-h, 96px) + 24px); }
.case-modal__fallback { padding: 48px var(--pad); }
@media (prefers-reduced-motion: reduce) {
  .case-modal { transition: none; }
}

/* closing band: lesson + next project, reuses the inverted "together" surface */
/* tighter than the homepage band: a short pitch, then the next project */
.together.cs-end { padding-top: clamp(48px, 8vh, 88px); padding-bottom: 0; }
.cs-end .together__inner { align-items: end; row-gap: clamp(36px, 6vh, 64px); }
.cs-cta { grid-column: 1 / -1; display: grid; grid-template-columns: repeat(12, 1fr); gap: 24px; align-items: end; }
.cs-cta__copy { grid-column: 1 / span 7; }
.cs-cta__copy .mono { color: var(--inv-accent); }
.cs-cta__copy h2 { margin-top: 14px; font: 500 clamp(30px, 3.4cqi, 52px)/1.08 var(--display); letter-spacing: -.03em; max-width: 18ch; }
.cs-cta__copy em { font-style: normal; color: var(--inv-accent); }
.cs-cta__action { grid-column: 9 / -1; display: grid; gap: 20px; justify-items: start; }
.cs-cta__action p { color: rgba(var(--inv-rgb), .7); font-size: 16px; line-height: 1.55; max-width: 36ch; }
.cs-cta__btn { text-decoration: none; background: var(--inv-accent); color: var(--inv-bg); }
.cs-cta__btn:hover { background: color-mix(in srgb, var(--inv-accent) 85%, var(--inv-fg)); }
/* the next project steps out of the inverted band onto the page colour, bleeding edge to edge */
.cs-next {
  grid-column: 1 / -1; display: flex; flex-direction: column; align-items: center; gap: 12px; text-align: center;
  padding-block: clamp(40px, 6vh, 64px); text-decoration: none;
  background: var(--paper); color: var(--ink);
  box-shadow: 0 0 0 100vmax var(--paper); clip-path: inset(0 -100vmax);
}
.cs-next .mono { color: var(--accent); }
.cs-next strong { display: flex; align-items: center; gap: .28em; font: 500 clamp(24px, 2.4cqi, 34px)/1.08 var(--display); letter-spacing: -.03em; transition: color .3s; }
/* a plain arrow sized to the title, its stroke matched to the display weight */
.cs-next svg { flex: none; width: .9em; height: .9em; color: inherit; transition: transform .5s var(--ease); }
.cs-next svg path { stroke-width: 2.1; }
.cs-next:hover strong { color: var(--accent); }
.cs-next:hover svg { transform: translateX(8px); }

/* homepage close: the projects grid runs straight into the same "next" link the case studies end with (to Career), then the pitch */
.home-next .cs-next strong { flex-wrap: wrap; justify-content: center; color: var(--ink); }
.home-next__career { display: inline-flex; align-items: center; gap: .28em; color: var(--accent); }
/* the Collab page: the brief fills the screen under the top bar */
.together.collab { min-height: calc(100svh - 72px); }

/* ---------- Responsive ---------- */
@container page (max-width: 960px) {
  .cs-facts, .cs-stats { grid-template-columns: repeat(2, 1fr); }
  .cs-facts div, .cs-facts div + div { padding: 18px 0 0; border-left: 0; }
  .cs-facts div:nth-child(even) { padding-left: 20px; border-left: 1px solid var(--line); }
  .cs-stats div, .cs-stats div + div { padding: 24px 20px 24px 0; border-left: 0; }
  .cs-stats div:nth-child(even) { padding-left: 20px; border-left: 1px solid var(--line); }
  .cs-stats div:nth-child(n+3) { border-top: 1px solid var(--line); }
  .cs-figure { grid-template-columns: 1fr; }
  .cs-figure .frame, .cs-shot--hero { grid-column: auto; }
  .cs-shots, .cs-shots--3 { grid-template-columns: 1fr; }
  .chapter { grid-template-columns: 1fr; gap: 18px; }
  .chapter__title, .chapter__body { grid-column: auto; position: static; }
  .insights, .insights--3, .quotes { grid-template-columns: 1fr; }
  .steps { grid-template-columns: 1fr; }
  .milestones li { grid-template-columns: 1fr; gap: 4px; }
}

/* the nav needs about 700px; below that its text links fold away (measured on the bar itself, so a docked pane counts) */
@container bar (max-width: 760px) {
  .topbar__nav .nav-link, .nav-menu { display: none; }
  .topbar__nav { gap: 12px; }
  .topbar .chat-toggle { margin-left: -4px; }
}

/* ---------- Mobile: bottom nav (built in script.js from the topbar links) ----------
   Classic: a solid bar docked to the bottom edge with a hairline on top. Sky Glass: a floating glass card. */
.bottom-nav { display: none; }
@media (max-width: 760px) {
  .topbar .chat-toggle { display: none; }
  /* the project viewer scrolls its last lines clear of the bottom nav (--bnav-h is measured in script.js) */
  .case-modal { padding-bottom: var(--bnav-h, 0px); }
  .footer { padding-bottom: calc(22px + 74px + env(safe-area-inset-bottom)); }
  .bottom-nav {
    --bn-cut: var(--paper);
    position: fixed; z-index: 60; left: 0; right: 0; bottom: 0;
    display: flex; gap: 4px; padding: 10px 8px calc(10px + env(safe-area-inset-bottom));
    background: var(--paper); color: var(--ink);
    border-top: 1px solid var(--line);
  }
  .bottom-nav__item {
    flex: 1 1 0; min-width: 0; display: grid; justify-items: center; gap: 3px; padding: 7px 4px 6px;
    font-size: 11.5px; line-height: 1.1; text-decoration: none; white-space: nowrap; color: var(--ink-2);
    transition: color .25s var(--ease);
    -webkit-tap-highlight-color: transparent;
  }
  /* tabs share the width equally, so the Ask me button stays dead centre */
  .bottom-nav__item svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
  .bottom-nav__item svg * { transition: fill .25s var(--ease), stroke .25s var(--ease); }
  .bottom-nav__item:active { opacity: .7; }
  .bottom-nav__item:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 8px; }
  /* selected tab: no background, just a filled icon and accent label; inner details are cut out in the bar colour */
  .bottom-nav__item.is-active { color: var(--accent); }
  .bottom-nav__item.is-active svg .f { fill: currentColor; }
  .bottom-nav__item.is-active svg .d { stroke: var(--bn-cut); }
  /* Ask me: the topbar's sparkle button, moved to the middle of the bar */
  .bottom-nav .bottom-nav__ai { flex: none; align-self: center; width: 46px; height: 46px; margin: 0 4px; }
  .bottom-nav .bottom-nav__ai svg { width: 21px; height: 21px; }

  html[data-palette="glass"] .footer { padding-bottom: calc(22px + 88px + env(safe-area-inset-bottom)); }
  html[data-palette="glass"] .bottom-nav {
    left: 12px; right: 12px; bottom: calc(12px + env(safe-area-inset-bottom)); max-width: 420px; margin-inline: auto;
    padding: 6px;
    background: color-mix(in srgb, var(--paper) 98%, transparent);
    border: 1px solid var(--glass-edge); border-radius: var(--glass-r);
    box-shadow: var(--glass-hl), var(--glass-shadow-hover);
  }
}
@container page (max-width: 960px) {

  .intro__body { grid-template-columns: 1fr; }
  .trusted { grid-template-columns: 1fr; gap: 14px; }
  .trusted__title, .trusted__grid { grid-column: auto; }
  .trusted__grid { flex-wrap: wrap; justify-content: flex-start; gap: 20px 32px; }
  .intro__body .lede { grid-column: auto; }
  /* the figure hugs the image so overlays (Ask me, the lens) stay anchored to the artwork */
  .intro__portrait { grid-column: auto; justify-self: start; width: min(100%, 520px); margin: 24px 0 0; }


  .case-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .case:nth-child(n) { padding: var(--band) 24px; border-left: 0; }
  .case:nth-child(odd) { padding-left: 0; }
  .case:nth-child(even) { padding-right: 0; border-left: 1px solid var(--line); }
  /* on narrow screens the viewer scrolls: video at full width, then text */
  .case-modal__hero { height: auto; grid-template-rows: auto auto; }
  .case-modal__stage { container-type: normal; }
  .case-modal__media { width: 100%; }
  .case-modal__lock { width: 100%; aspect-ratio: auto; min-height: 56cqi; padding: 18px 14px; gap: 8px; }
  .case-modal__lock:not(.is-inline) .case-modal__lock-icon { display: none; }
  .case-modal__lock.is-inline { min-height: 0; }
  .case-modal__lock-title { font-size: 19px; }
  .case-modal__unlock input { width: 220px; }
  /* the blurred thumbnail fills exactly the box the lock needs */
  .case-modal__stage.is-locked img.case-modal__media { align-self: stretch; height: 100%; aspect-ratio: auto; }
  .case-modal__head { flex-wrap: wrap; }
  .case-modal__details { order: 3; flex-basis: 100%; justify-content: flex-start; }
  .case-modal__foot { grid-template-columns: 1fr; }
  .case-modal__impact { border-top: 1px solid var(--line); }
  .case-modal__impact .case__metrics div:first-child { border-left: 0; padding-left: 0; }
  .case-modal__foot .btn { justify-self: start; margin: 8px 0 var(--strip-y); }

  .record__block { grid-template-columns: 1fr; }
  .record__title, .ledger, .timeline, .edu { grid-column: auto; }
  .cv-hero__text, .cv-hero__photo { grid-column: 1 / -1; }
  /* stacked layouts: the portrait spans the column at its natural proportions (capped and centred on wider tablets) */
  .cv-hero__photo { order: -1; width: 100%; max-width: 560px; justify-self: center; }
  .cv-hero__photo img { aspect-ratio: 900 / 845; }
  .cv-project, .cv-role__text { margin-left: 0; }
  .cv-role__head { flex-wrap: wrap; }
  .cv-ledger li { grid-template-columns: 1fr; }
  .edu { grid-template-columns: 1fr; }
  .timeline li { grid-template-columns: 1fr; gap: 6px; }
  .ledger li { grid-template-columns: 1fr; gap: 4px; }
  .ledger__tag { display: none; }
  .prose .manual__keys li { grid-template-columns: 1fr; gap: 4px; }

  .contact__grid, .together__inner { grid-template-columns: 1fr; gap: 48px; }
  .cs-cta { grid-template-columns: 1fr; }
  .cs-cta__copy, .cs-cta__action { grid-column: auto; }
  .contact__aside, .contact .form, .together__head, .together .form, .together .collab__panel { grid-column: auto; }
}
/* three short rows (values, stats) hold their columns until the content is genuinely narrow */
@container page (max-width: 720px) {
  .values { grid-template-columns: 1fr; }
  .values li, .values li + li { padding: 20px 0; border-left: 0; border-bottom: 1px solid var(--line); }
  .values li:last-child { border-bottom: 0; }
  .stats { grid-template-columns: 1fr; }
  .stats div, .stats div + div { padding: 24px 0; border-left: 0; }
  .stats div + div { border-top: 1px solid var(--line); }
}
@container page (max-width: 640px) {
  .cv-strengths, .cv-edu { grid-template-columns: 1fr; }
  .cv-strength, .cv-strength + .cv-strength { padding: 20px 0; border-left: 0; }
  .cv-strength + .cv-strength { border-top: 1px solid var(--line); }
}
/* phone widths: the fact strip (CV header, case studies) stacks so values like an email address never squeeze */
@container page (max-width: 480px) {
  .cs-facts { grid-template-columns: 1fr; }
  .cs-facts div:nth-child(even) { padding-left: 0; border-left: 0; }
}
@container page (max-width: 560px) {
  .field-row { grid-template-columns: 1fr; }
  .case-grid { grid-template-columns: 1fr; }
  .case:nth-child(n) { padding: 28px 0; border-left: 0; }
  .case-modal__impact .case__metrics { grid-template-columns: 1fr; }
  .case-modal__impact .case__metrics { grid-template-rows: none; }
  .case-modal__impact .case__metrics div { grid-row: auto; grid-template-rows: none; border-left: 0; padding-left: 0; }
  .case-modal__impact .case__metrics div + div { border-top: 1px solid var(--line); }
}

/* ---------- Page transitions (home ↔ CV): the bars stay put while the content slides the way the nav reads.
   The direction (forward toward Career, back toward Projects) is set by each page's head script. ---------- */
@media (prefers-reduced-motion: no-preference) {
  @view-transition { navigation: auto; }
}
.topbar { view-transition-name: topbar; }
.bottom-nav { view-transition-name: bottom-nav; }
.chat[open] { view-transition-name: chat; }
/* while the two views cross-fade, any gap between them shows the page colour, never the browser's white */
::view-transition { background-color: var(--paper); }
::view-transition-group(*) { animation-duration: .5s; animation-timing-function: var(--ease); }
::view-transition-old(root) { animation: .22s cubic-bezier(.4, 0, 1, 1) both vt-fade-out; }
::view-transition-new(root) { animation: .46s var(--ease) .12s both vt-fade-in; }
html:active-view-transition-type(forward)::view-transition-old(root) { animation-name: vt-out-left; }
html:active-view-transition-type(forward)::view-transition-new(root) { animation-name: vt-in-right; }
html:active-view-transition-type(back)::view-transition-old(root) { animation-name: vt-out-right; }
html:active-view-transition-type(back)::view-transition-new(root) { animation-name: vt-in-left; }
@keyframes vt-fade-out { to { opacity: 0; } }
@keyframes vt-fade-in { from { opacity: 0; } }
@keyframes vt-out-left { to { opacity: 0; transform: translateX(-56px); } }
@keyframes vt-in-right { from { opacity: 0; transform: translateX(56px); } }
@keyframes vt-out-right { to { opacity: 0; transform: translateX(56px); } }
@keyframes vt-in-left { from { opacity: 0; transform: translateX(-56px); } }

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation: none !important;
    transition-duration: .01ms !important;
    transition-delay: 0s !important;
  }
  [data-reveal] { opacity: 1; transform: none; }
  .line > span { transform: none; }
  .logo img { opacity: .75; }
}
