/* ==========================================================================
   Muhammad Dawood Hussain — Portfolio
   Editorial Bold · black / yellow / blue
   --------------------------------------------------------------------------
   1. Tokens (light default, dark override)
   2. Base
   3. Layout helpers
   4. Header & navigation
   5. Hero + ticker
   6. Sections (about, work, toolkit, process, contact)
   7. Illustrations
   8. Footer
   9. Motion, reveal & reduced motion
   ========================================================================== */

/* 1. TOKENS ---------------------------------------------------------------- */
:root {
  --font-display: "Bricolage Grotesque", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-body: "Geist", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-mono: "Geist Mono", ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  --font-serif: "Instrument Serif", "Iowan Old Style", Georgia, serif;

  /* Brand constants (same in both themes) */
  --yellow: #FFD400;
  --on-yellow: #0A0A0B;
  --on-blue: #FFFFFF;
  --band: #1F5BFF;            /* full-bleed blue section; white text 5.25:1 */

  /* Light theme (default) */
  --bg: #FFFFFF;
  --surface: #F4F4F0;
  --panel: #FFFFFF;
  --ink: #0B0B0C;             /* 19.7:1 on --bg */
  --ink-2: #2E2E33;           /* 13.0:1 on --bg */
  --muted: #5C5C63;           /* 6.6:1 on --bg, 6.0:1 on --surface */
  --line: #E3E3DD;
  --line-strong: #0B0B0C;
  --blue: #1F5BFF;            /* fills; white text 5.25:1; as text 5.25:1 */
  --link: #1A4FE6;            /* link text 6.35:1 on --bg */
  --focus: #1F5BFF;
  --soft: rgba(11, 11, 12, .08);
  --grid-dot: rgba(11, 11, 12, .13);
  --nav-bg: rgba(255, 255, 255, .82);
  --track: #E6E6E0;
  --track-edge: #0B0B0C;
  --ill-line: rgba(11, 11, 12, .16);
  --hl-soft: rgba(255, 212, 0, .32);   /* soft highlighter wash behind ink text */
  --word: #0B0B0C;                     /* footer wordmark: ink on a yellow highlighter */
  --word-mark: var(--yellow);
  --nav-active: var(--ink);            /* current-section bar: 19.7:1 on the header */

  --radius: 14px;
  --radius-lg: 22px;
  --ease: cubic-bezier(.16, 1, .3, 1);
  --nav-h: 72px;
  --gutter: clamp(1rem, 4vw, 3rem);
  --gap: clamp(1rem, 2vw, 2rem);
  --max: 1400px;

  color-scheme: light;
}

/* Dark theme — chosen explicitly, or by system preference when no choice is stored */
:root[data-theme="dark"] {
  --bg: #0A0A0B;
  --surface: #141416;
  --panel: #1C1C20;
  --ink: #F4F4F0;             /* 17.9:1 on --bg */
  --ink-2: #D2D2CC;
  --muted: #9C9CA4;           /* 7.3:1 on --bg, 6.7:1 on --surface */
  --line: #26262B;
  --line-strong: #F4F4F0;
  --blue: #2A63F6;            /* fills; white text 4.98:1 */
  --link: #6E95FF;            /* link text 6.98:1 on --bg */
  --focus: #FFD400;
  --soft: rgba(255, 255, 255, .1);
  --grid-dot: rgba(255, 255, 255, .09);
  --nav-bg: rgba(10, 10, 11, .78);
  --track: #26262C;
  --track-edge: #686872;      /* 3.3:1 on --surface */
  --ill-line: rgba(255, 255, 255, .14);
  --hl-soft: rgba(255, 212, 0, .16);
  --word: #FFD400;                     /* footer wordmark: solid yellow on black */
  --word-mark: transparent;
  --nav-active: var(--yellow);         /* 13.8:1 on the header */
  color-scheme: dark;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0A0A0B;
    --surface: #141416;
    --panel: #1C1C20;
    --ink: #F4F4F0;
    --ink-2: #D2D2CC;
    --muted: #9C9CA4;
    --line: #26262B;
    --line-strong: #F4F4F0;
    --blue: #2A63F6;
    --link: #6E95FF;
    --focus: #FFD400;
    --soft: rgba(255, 255, 255, .1);
    --grid-dot: rgba(255, 255, 255, .09);
    --nav-bg: rgba(10, 10, 11, .78);
    --track: #26262C;
    --track-edge: #686872;
    --ill-line: rgba(255, 255, 255, .14);
    --hl-soft: rgba(255, 212, 0, .16);
    --word: #FFD400;                     /* footer wordmark: solid yellow on black */
    --word-mark: transparent;
    --nav-active: var(--yellow);
    color-scheme: dark;
  }
}

/* 2. BASE ------------------------------------------------------------------ */
*, *::before, *::after { box-sizing: border-box; }
html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--nav-h) + 1rem);
  overflow-x: clip;
}
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 1.0625rem;
  line-height: 1.6;
  font-feature-settings: "ss01", "cv11";
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  overflow-x: clip;
}
h1, h2, h3, h4, p, ul, ol, dl, dd, figure { margin: 0; }
ul, ol { padding: 0; list-style: none; }
img, svg { display: block; max-width: 100%; }
a { color: inherit; }
button { font: inherit; color: inherit; }
[hidden] { display: none !important; }
.sr-only {
  position: absolute !important;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}
::selection { background: var(--yellow); color: var(--on-yellow); }

:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 3px;
  border-radius: 6px;
}
main:focus { outline: none; }

.skip-link {
  position: absolute;
  left: 1rem;
  top: -100px;
  z-index: 100;
  padding: .75rem 1.1rem;
  background: var(--yellow);
  color: var(--on-yellow);
  font-weight: 600;
  border-radius: 10px;
  text-decoration: none;
}
.skip-link:focus { top: 1rem; outline-color: var(--ink); }

/* Inline text link: blue, highlighter on hover */
.link {
  color: var(--link);
  text-decoration: underline;
  text-decoration-thickness: 1.5px;
  text-underline-offset: .22em;
  border-radius: 3px;
  transition: background-color .2s, color .2s;
}
.link:hover {
  background: var(--yellow);
  color: var(--on-yellow);
  text-decoration-color: transparent;
}

/* Highlighter mark */
.hl {
  color: var(--on-yellow);
  background-image: linear-gradient(var(--yellow), var(--yellow));
  background-repeat: no-repeat;
  background-position: 0 55%;
  background-size: 100% 88%;
  padding: 0 .1em;
  margin: 0 -.04em;
  border-radius: .1em;
  -webkit-box-decoration-break: clone;
  box-decoration-break: clone;
  transition: background-size .9s var(--ease) .3s, color .35s ease .5s;
}

/* 3. LAYOUT ---------------------------------------------------------------- */
.container {
  width: min(100% - 2 * var(--gutter), var(--max));
  margin-inline: auto;
}
.grid {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  column-gap: var(--gap);
}
.section { padding-block: clamp(3.75rem, 7.5vw, 6.5rem); }
.work, .toolkit { padding-top: clamp(2.75rem, 5vw, 4.5rem); }   /* follow a same-colour section: less doubled-up space */

.eyebrow {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  gap: .75rem;
  margin-bottom: clamp(1.5rem, 3vw, 2.5rem);
  font-family: var(--font-mono);
  font-size: .75rem;
  font-weight: 500;
  letter-spacing: .1em;
  line-height: 1;
  text-transform: uppercase;
  color: var(--muted);
}
.eyebrow::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.eyebrow__num { color: var(--ink); }

.section-head {
  align-items: end;
  margin-bottom: clamp(2.25rem, 5vw, 4rem);
}
.section-title {
  grid-column: 1 / span 8;
  font-family: var(--font-display);
  font-weight: 800;
  font-stretch: 80%;
  font-size: clamp(3.25rem, 10.5vw, 9.5rem);
  line-height: .88;
  letter-spacing: -.02em;
}
.section-title em,
.hero__lead em {
  font-family: var(--font-serif);
  font-style: italic;
  font-weight: 400;
  font-stretch: 100%;
  letter-spacing: -.01em;
}
.section-title em { font-size: 1.04em; padding-right: .04em; }
.section-intro {
  grid-column: 9 / -1;
  max-width: 34ch;
  padding-bottom: .5em;
  color: var(--muted);
}

/* 4. HEADER & NAV ---------------------------------------------------------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--nav-bg);
  -webkit-backdrop-filter: saturate(1.4) blur(14px);
  backdrop-filter: saturate(1.4) blur(14px);
  border-bottom: 1px solid transparent;
  transition: border-color .3s;
}
.site-header.is-scrolled { border-bottom-color: var(--line); }
.nav {
  height: var(--nav-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: .7rem;
  text-decoration: none;
  border-radius: 10px;
}
.brand__mark {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 11px;
  background: var(--yellow);
  color: var(--on-yellow);
  font-family: var(--font-display);
  font-weight: 800;
  font-stretch: 85%;
  font-size: 1rem;
  letter-spacing: -.03em;
  transition: transform .35s var(--ease), border-radius .35s var(--ease);
}
.brand:hover .brand__mark { transform: rotate(-8deg); border-radius: 50%; }
.brand__name {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.0625rem;
  letter-spacing: -.02em;
}

.nav__links ul { display: flex; gap: clamp(1.25rem, 2.4vw, 2.25rem); }
.nav__links a {
  position: relative;
  display: inline-flex;
  align-items: baseline;
  padding: .45rem 0;
  font-size: .9375rem;
  font-weight: 500;
  color: var(--ink-2);
  text-decoration: none;
  transition: color .2s;
}
.nav__links a::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: .1rem;
  height: 2px;
  border-radius: 2px;
  background: var(--blue);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform .35s var(--ease), background-color .2s;
}
.nav__links a:hover { color: var(--ink); }
.nav__links a:hover::after { transform: scaleX(1); }
.nav__links a.is-active { color: var(--ink); }
.nav__links a.is-active::after { transform: scaleX(1); background: var(--nav-active); height: 4px; bottom: .05rem; }
.nav__num {
  margin-right: .4em;
  font-family: var(--font-mono);
  font-size: .625rem;
  color: var(--muted);
  transform: translateY(-.35em);
}

.nav__actions { display: flex; align-items: center; gap: .5rem; }
.nav__cv,
.motion-toggle,
.theme-toggle,
.menu-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .4rem;
  height: 42px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: transparent;
  color: var(--ink);
  cursor: pointer;
  transition: background-color .2s, border-color .2s, color .2s;
}
.nav__cv {
  padding: 0 1rem;
  font-family: var(--font-mono);
  font-size: .8125rem;
  font-weight: 500;
  text-decoration: none;
}
.nav__cv svg { width: 15px; height: 15px; }
.theme-toggle,
.motion-toggle { width: 42px; padding: 0; }
.theme-toggle svg { width: 20px; height: 20px; transition: transform .5s var(--ease); }
.motion-toggle svg { width: 17px; height: 17px; }
.nav__cv:hover,
.motion-toggle:hover,
.theme-toggle:hover,
.menu-toggle:hover {
  background: var(--yellow);
  border-color: var(--yellow);
  color: var(--on-yellow);
}
.theme-toggle:hover svg { transform: rotate(-25deg); }
:root[data-theme="dark"] .icon-moon,
:root:not([data-theme="dark"]) .icon-sun { display: none; }
html:not(.js) .theme-toggle,
html:not(.js) .motion-toggle { display: none; }
/* Pause / play: the icon shows the action, aria-pressed carries the state */
html.motion-off .motion-toggle .icon-pause,
html:not(.motion-off) .motion-toggle .icon-play { display: none; }

.menu-toggle { display: none; padding: 0 .9rem 0 1.1rem; gap: .65rem; font-size: .9375rem; font-weight: 500; }
.menu-toggle__icon { position: relative; width: 18px; height: 10px; }
.menu-toggle__icon span {
  position: absolute;
  left: 0;
  width: 100%;
  height: 2px;
  border-radius: 2px;
  background: currentColor;
  transition: transform .35s var(--ease), top .35s var(--ease);
}
.menu-toggle__icon span:first-child { top: 0; }
.menu-toggle__icon span:last-child { top: 8px; }
.menu-toggle[aria-expanded="true"] .menu-toggle__icon span:first-child { top: 4px; transform: rotate(45deg); }
.menu-toggle[aria-expanded="true"] .menu-toggle__icon span:last-child { top: 4px; transform: rotate(-45deg); }

.mobile-menu {
  position: fixed;
  inset: var(--nav-h) 0 0 0;
  z-index: 49;
  overflow-y: auto;
  background: var(--bg);
  border-top: 1px solid var(--line);
  opacity: 0;
  transform: translateY(-8px);
  transition: opacity .25s ease, transform .35s var(--ease);
}
.mobile-menu.is-open { opacity: 1; transform: none; }
.mobile-menu nav { padding-block: 1.5rem 3rem; }
.mobile-menu__list a {
  display: flex;
  align-items: baseline;
  gap: 1rem;
  padding: .9rem 0;
  border-bottom: 1px solid var(--line);
  font-family: var(--font-display);
  font-weight: 800;
  font-stretch: 85%;
  font-size: clamp(2.25rem, 11vw, 3.5rem);
  line-height: 1;
  letter-spacing: -.015em;
  text-decoration: none;
}
.mobile-menu__list a span { font-family: var(--font-mono); font-size: .8rem; font-weight: 500; letter-spacing: .05em; color: var(--muted); }
.mobile-menu__list a:hover { color: var(--link); }
.mobile-menu__foot { margin-top: 2rem; font-family: var(--font-mono); font-size: .75rem; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
html.menu-open { overflow: hidden; }

/* 5. HERO ------------------------------------------------------------------ */
.hero { padding-block: clamp(1.25rem, 3vw, 2.5rem) clamp(2.5rem, 5vw, 4.5rem); }
.hero > .container {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  column-gap: var(--gap);
}
.hero__meta {
  grid-column: 1 / -1;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: .5rem 2rem;
  padding-bottom: 1rem;
  margin-bottom: clamp(1.5rem, 3.5vw, 3rem);
  border-bottom: 1px solid var(--line);
  font-family: var(--font-mono);
  font-size: .75rem;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--muted);
}
.hero__meta p { display: inline-flex; align-items: center; gap: .55rem; }
.hero__meta .link { color: var(--link); }
.dot-blue { width: 8px; height: 8px; border-radius: 50%; background: var(--blue); box-shadow: 0 0 0 4px color-mix(in srgb, var(--blue) 22%, transparent); }

.hero__name {
  grid-column: 1 / -1;
  grid-row: 2;
  font-family: var(--font-display);
  font-weight: 800;
  font-stretch: 78%;
  /* Width-led, but capped by viewport height so the CTAs stay above the fold on short laptop screens */
  font-size: clamp(3.6rem, min(16.5vw, 25vh), 15.5rem);
  line-height: .84;
  letter-spacing: -.012em;
}
.line {
  display: block;
  overflow: hidden;
  padding: .06em .04em .07em;
  margin: -.06em -.04em -.07em;
}
.line__inner { display: inline-block; }
.line--indent { padding-left: .4em; }
.hero__stop { color: var(--blue); }
.hl--hero {
  display: inline-block;
  line-height: .86;
  padding: .02em .1em .06em;
  margin: 0 -.02em;
  border-radius: .07em;
  transform: rotate(-1.2deg);
  background-size: 100% 100%;
}

.hero { --badge: clamp(112px, 11vw, 168px); }
.hero__badge {
  grid-column: 10 / -1;
  grid-row: 2;
  align-self: start;
  justify-self: end;
  width: var(--badge);
  aspect-ratio: 1;
  border-radius: 50%;
  text-decoration: none;
}
.hero__badge svg { width: 100%; height: 100%; overflow: visible; }
.hero__badge text {
  font-family: var(--font-mono);
  font-size: 15px;
  font-weight: 500;
  letter-spacing: .12em;
  fill: var(--ink);
}
.hero__badge-ring { transform-origin: 100px 100px; animation: spin 22s linear infinite; }
.hero__badge-core { fill: var(--blue); transform-origin: 100px 100px; transition: transform .45s var(--ease), fill .2s; }
.hero__badge-arrow { stroke: var(--on-blue); transition: transform .45s var(--ease); }
.hero__badge:hover .hero__badge-core { transform: scale(1.12); }
.hero__badge:hover .hero__badge-arrow { transform: translateY(5px); }
.hero__badge:focus-visible { outline-offset: 6px; border-radius: 50%; }

.hero__foot {
  grid-column: 9 / -1;
  grid-row: 2;
  align-self: end;
  margin-top: calc(var(--badge) + 1.5rem);   /* room for the badge above it, so the two never overlap on short windows */
  padding-top: 1.25rem;
  border-top: 2px solid var(--line-strong);
}
.hero__lead {
  font-family: var(--font-display);
  font-weight: 700;
  font-stretch: 88%;
  font-size: clamp(1.625rem, 2.5vw, 2.5rem);
  line-height: 1.04;
  letter-spacing: -.025em;
  text-wrap: balance;
}
.hero__lead em { font-size: 1.1em; }
.hero__aside { margin-top: 1rem; }
.hero__sub { max-width: 46ch; color: var(--ink-2); font-size: 1.0625rem; }
.hero__ctas { display: flex; flex-wrap: wrap; gap: .75rem; margin-top: 1.5rem; }

.btn {
  display: inline-flex;
  align-items: center;
  gap: .6rem;
  min-height: 52px;
  padding: 0 1.5rem;
  border: 2px solid transparent;
  border-radius: 999px;
  font-size: 1rem;
  font-weight: 600;
  line-height: 1;
  text-decoration: none;
  white-space: nowrap;
  transition: transform .3s var(--ease), box-shadow .3s var(--ease), background-color .2s, color .2s, border-color .2s;
}
.btn svg { width: 20px; height: 20px; transition: transform .3s var(--ease); }
.btn--primary { background: var(--blue); color: var(--on-blue); box-shadow: 0 0 0 0 var(--yellow); }
.btn--primary:hover { transform: translate(-3px, -3px); box-shadow: 5px 5px 0 0 var(--yellow); }
.btn--primary:hover svg { transform: translateX(3px); }
.btn--ghost { border-color: var(--ink); color: var(--ink); }
.btn--ghost:hover { background: var(--yellow); border-color: var(--yellow); color: var(--on-yellow); }
.btn:active { transform: translate(0, 0); box-shadow: 0 0 0 0 var(--yellow); }

/* Ticker tape */
.ticker-wrap {
  overflow: hidden;
  padding-block: clamp(1.25rem, 3vw, 2.5rem);
  margin-top: clamp(-1rem, -1vw, 0rem);
}
.ticker {
  position: relative;
  width: calc(100% + 6rem);
  margin: 0 -3rem;
  overflow: hidden;
  background: var(--yellow);
  color: var(--on-yellow);
  border-block: 2px solid var(--on-yellow);
  transform: rotate(-1.6deg);
}
.ticker__track { display: flex; width: max-content; animation: ticker 76s linear infinite; }
.ticker__group { display: flex; align-items: center; gap: clamp(1rem, 2vw, 1.75rem); padding-right: clamp(1rem, 2vw, 1.75rem); }
.ticker span {
  padding-block: clamp(.6rem, 1.4vw, 1rem);
  font-family: var(--font-display);
  font-weight: 800;
  font-stretch: 82%;
  font-size: clamp(1.25rem, 2.6vw, 2.25rem);
  line-height: 1;
  letter-spacing: 0;
  text-transform: uppercase;
}
.ticker i { font-style: normal; font-size: clamp(.9rem, 1.6vw, 1.35rem); color: var(--band); }

/* 6a. ABOUT ---------------------------------------------------------------- */
.statement {
  grid-column: 1 / span 11;
  font-family: var(--font-display);
  font-weight: 700;
  font-stretch: 90%;
  font-size: clamp(2rem, 5.4vw, 5rem);
  line-height: 1.02;
  letter-spacing: -.025em;
  text-wrap: balance;
}
.about__copy {
  grid-column: 5 / span 6;
  grid-row: 3;
  margin-top: clamp(2rem, 4.5vw, 3.75rem);
  color: var(--ink-2);
  font-size: 1.125rem;
  line-height: 1.65;
}
.about__copy p + p { margin-top: 1.1em; }
.about__copy p:first-child { color: var(--ink); font-size: 1.25rem; line-height: 1.5; }
.facts {
  grid-column: 1 / span 3;
  grid-row: 3;
  align-self: start;
  margin-top: clamp(2rem, 4.5vw, 3.75rem);
  border-top: 2px solid var(--line-strong);
}
.facts > div { padding: .9rem 0; border-bottom: 1px solid var(--line); }
.facts dt {
  font-family: var(--font-mono);
  font-size: .6875rem;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--muted);
}
.facts dd { margin-top: .2rem; font-family: var(--font-display); font-weight: 600; font-size: 1.125rem; letter-spacing: -.01em; }

/* 6b. WORK ----------------------------------------------------------------- */
.case {
  padding-block: clamp(2.25rem, 4.5vw, 3.75rem) clamp(2.75rem, 5.5vw, 4.5rem);
  border-top: 2px solid var(--line-strong);
}
.case__head {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: end;
  column-gap: clamp(1rem, 3vw, 2.75rem);
  margin-bottom: clamp(1.75rem, 4vw, 3.25rem);
}
.case__num {
  font-family: var(--font-serif);
  font-style: italic;
  font-weight: 400;
  font-size: clamp(3.5rem, 8.5vw, 8rem);
  line-height: .78;
  letter-spacing: -.02em;
  color: var(--muted);
}
.case__kicker {
  margin-bottom: .8rem;
  font-family: var(--font-mono);
  font-size: .75rem;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--muted);
}
.case__title {
  font-family: var(--font-display);
  font-weight: 800;
  font-stretch: 80%;
  font-size: clamp(2.6rem, 7.6vw, 7.25rem);
  line-height: .88;
  letter-spacing: -.015em;
}
.badge {
  display: inline-flex;
  align-items: center;
  gap: .55rem;
  margin-bottom: .35em;
  padding: .55rem .9rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  font-family: var(--font-mono);
  font-size: .75rem;
  font-weight: 500;
  letter-spacing: .06em;
  line-height: 1;
  text-transform: uppercase;
  white-space: nowrap;
}
.badge__dot { width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.badge--yellow { background: var(--yellow); border-color: var(--yellow); color: var(--on-yellow); }
.badge--yellow .badge__dot { animation: pulse 2s ease-in-out infinite; }
.badge--blue { background: var(--blue); border-color: var(--blue); color: var(--on-blue); }

.case__grid {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  column-gap: var(--gap);
  row-gap: 2rem;
  align-items: start;
}
.case__visual { grid-column: 1 / span 7; grid-row: 1; }
.case__body { grid-column: 9 / -1; grid-row: 1; }
.case--flip .case__visual { grid-column: 6 / -1; }
.case--flip .case__body { grid-column: 1 / span 4; }

.case__visual > svg,
.case__visual > img {
  width: 100%;
  height: auto;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background-color: var(--surface);
  background-image: radial-gradient(var(--grid-dot) 1.1px, transparent 1.4px);
  background-size: 24px 24px;
  background-position: 12px 12px;
}
.case__visual figcaption {
  display: flex;
  gap: .9rem;
  margin-top: .9rem;
  font-family: var(--font-mono);
  font-size: .75rem;
  letter-spacing: .02em;
  color: var(--muted);
}
.case__visual figcaption span { color: var(--ink); white-space: nowrap; }

.case__summary {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: clamp(1.25rem, 1.7vw, 1.5rem);
  line-height: 1.32;
  letter-spacing: -.012em;
}
.case__meta {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
  margin-top: 1.75rem;
  padding-top: 1rem;
  border-top: 1px solid var(--line);
}
.case__meta dt,
.case__subhead {
  font-family: var(--font-mono);
  font-size: .6875rem;
  font-weight: 500;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--muted);
}
.case__meta dd { margin-top: .25rem; font-size: .9375rem; font-weight: 500; }
.chips { display: flex; flex-wrap: wrap; gap: .45rem; margin-top: 1.25rem; }
.chips li {
  padding: .42rem .75rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  font-family: var(--font-mono);
  font-size: .75rem;
  line-height: 1.2;
  color: var(--ink-2);
}
.case__subhead { margin: 2rem 0 .35rem; }
.case__list li {
  position: relative;
  padding: .85rem 0 .85rem 1.6rem;
  border-bottom: 1px solid var(--line);
  font-size: 1rem;
  line-height: 1.55;
  color: var(--ink-2);
}
.case__list li:last-child { border-bottom: 0; }
.case__list li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 1.45rem;
  width: .85rem;
  height: .4rem;
  border-radius: 2px;
  background: var(--yellow);
  transform: skewX(-12deg);
}

/* Smaller projects */
.bench {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  column-gap: var(--gap);
  align-items: start;
  padding-top: clamp(2rem, 4vw, 3rem);
  border-top: 2px solid var(--line-strong);
}
.bench__title {
  grid-column: 1 / span 4;
  margin: .4rem 0 1.5rem;
  font-family: var(--font-mono);
  font-size: .75rem;
  font-weight: 500;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--muted);
}
.bench__grid { grid-column: 5 / -1; display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--gap); max-width: 52rem; }
.mini {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 1.25rem;
  padding: clamp(1.25rem, 2.5vw, 2rem);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--surface);
  transition: border-color .25s, transform .35s var(--ease);
}
/* After its reveal, the card keeps its own quick hover transitions (beats the slower .reveal timing) */
.mini.reveal.is-in { transition: opacity .9s var(--ease), border-color .25s, transform .35s var(--ease); }
.mini:hover { border-color: var(--ink); transform: translateY(-3px); }
.mini__icon {
  display: grid;
  place-items: center;
  width: 56px;
  height: 56px;
  border-radius: 16px;
  background: var(--yellow);
  color: var(--on-yellow);
}
.mini__icon svg { width: 34px; height: 34px; }
.mini__accent { stroke: var(--band); }
.mini__accent-fill { fill: var(--band); }
.mini__kicker {
  font-family: var(--font-mono);
  font-size: .6875rem;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--muted);
}
.mini__title {
  margin: .3rem 0 .5rem;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.625rem;
  letter-spacing: -.025em;
  line-height: 1.1;
}
.mini p:last-child { color: var(--ink-2); font-size: 1rem; line-height: 1.55; }

/* 6c. TOOLKIT -------------------------------------------------------------- */
.tools {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: var(--gap);
}
.tools__group { padding-top: 1.5rem; border-top: 2px solid var(--line-strong); }
.tools__title {
  display: flex;
  align-items: center;
  gap: .75rem;
  margin-bottom: 1rem;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.375rem;
  letter-spacing: -.02em;
  line-height: 1.15;
}
.tools__title span {
  display: grid;
  place-items: center;
  flex: none;
  width: 30px;
  height: 30px;
  border-radius: 8px;
  background: var(--yellow);
  color: var(--on-yellow);
  font-family: var(--font-mono);
  font-size: .8125rem;
  font-weight: 500;
}
.tools li {
  display: flex;
  flex-direction: column;
  gap: .15rem;
  padding: .9rem 0 1rem;
  border-bottom: 1px solid var(--line);
}
.tools li strong {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.1875rem;
  letter-spacing: -.015em;
  line-height: 1.25;
}
.tools__note { font-size: .9375rem; line-height: 1.45; color: var(--muted); }

/* "Used in" → links to the project it was used in */
.tools__used {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .35rem;
  margin-top: .55rem;
}
.tools__used::before {
  content: "↳";
  content: "↳" / "";
  margin-right: .1rem;
  font-family: var(--font-mono);
  font-size: .8125rem;
  line-height: 1;
  color: var(--muted);
}
.tools__used a {
  display: inline-flex;
  align-items: center;
  padding: .3rem .6rem .32rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  font-family: var(--font-mono);
  font-size: .6875rem;
  font-weight: 500;
  letter-spacing: .03em;
  line-height: 1.2;
  color: var(--ink-2);
  text-decoration: none;
  transition: background-color .2s, border-color .2s, color .2s, transform .3s var(--ease);
}
.tools__used a:hover {
  background: var(--yellow);
  border-color: var(--yellow);
  color: var(--on-yellow);
  transform: translateY(-1px);
}

/* "Next up" strip under the toolkit */
.tools__next {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .75rem 1.25rem;
  margin-top: clamp(2rem, 4vw, 3rem);
  padding: 1.1rem clamp(1rem, 2vw, 1.5rem);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--surface);
}
.tools__next-label {
  display: inline-flex;
  align-items: center;
  gap: .55rem;
  padding: .45rem .8rem;
  border-radius: 999px;
  background: var(--blue);
  color: var(--on-blue);
  font-family: var(--font-mono);
  font-size: .6875rem;
  font-weight: 500;
  letter-spacing: .1em;
  line-height: 1;
  text-transform: uppercase;
  white-space: nowrap;
}
.tools__next-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--yellow);
  animation: pulse 2s ease-in-out infinite;
}
.tools__next-text {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(1.0625rem, 1.5vw, 1.25rem);
  letter-spacing: -.015em;
  line-height: 1.35;
}

/* 6d. PROCESS (blue band, same in both themes) ---------------------------- */
.process {
  position: relative;
  background: var(--band);
  color: #FFFFFF;
  overflow: hidden;
}
.process::before {
  content: "";
  position: absolute;
  right: -12vw;
  top: -10vw;
  width: 48vw;
  aspect-ratio: 1;
  border-radius: 50%;
  border: clamp(40px, 6vw, 96px) solid rgba(255, 255, 255, .07);
  pointer-events: none;
}
.process .container { position: relative; }
.process .eyebrow,
.process .eyebrow__num,
.process .section-intro { color: #FFFFFF; }
.process .eyebrow::after { background: rgba(255, 255, 255, .35); }
.process .section-title em { color: var(--yellow); }   /* large text: 3.7:1 on --band */
.steps {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: var(--gap);
  counter-reset: step;
}
.step { padding-top: 1.5rem; border-top: 2px solid #FFFFFF; }
.step__num {
  display: block;
  font-family: var(--font-display);
  font-weight: 800;
  font-stretch: 80%;
  font-size: clamp(3rem, 5.5vw, 5rem);
  line-height: .9;
  letter-spacing: -.01em;
  color: var(--yellow);                               /* large text */
}
.step__title {
  margin: 1.25rem 0 .6rem;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.5rem;
  letter-spacing: -.02em;
}
.step p { font-size: 1rem; line-height: 1.6; color: #FFFFFF; }
.process { --focus: #FFD400; }

.ai-note {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  column-gap: var(--gap);
  row-gap: 1.25rem;
  margin-top: clamp(3rem, 6vw, 4.5rem);
  padding-top: clamp(1.75rem, 3vw, 2.5rem);
  border-top: 1px solid rgba(255, 255, 255, .35);
}
.ai-note__label {
  grid-column: 1 / span 3;
  display: inline-flex;
  align-items: center;
  align-self: start;
  justify-self: start;
  gap: .55rem;
  padding: .5rem .85rem;
  border-radius: 999px;
  background: var(--yellow);
  color: var(--on-yellow);
  font-family: var(--font-mono);
  font-size: .75rem;
  font-weight: 500;
  letter-spacing: .1em;
  line-height: 1;
  text-transform: uppercase;
  white-space: nowrap;
}
.ai-note__label svg { width: 15px; height: 15px; }
.ai-note__quote {
  grid-column: 4 / -1;
  position: relative;
  max-width: 30ch;
  font-family: var(--font-display);
  font-weight: 700;
  font-stretch: 90%;
  font-size: clamp(1.625rem, 3.4vw, 3rem);                 /* always ≥ 24px: "large text" for the yellow em */
  line-height: 1.08;
  letter-spacing: -.025em;
  text-wrap: balance;
  color: #FFFFFF;
}
.ai-note__quote::before {
  content: "“";
  content: "“" / "";
  position: absolute;
  left: -.5em;
  top: -.08em;
  font-family: var(--font-serif);
  font-weight: 400;
  color: var(--yellow);
}
.ai-note__quote em {
  font-family: var(--font-serif);
  font-style: italic;
  font-weight: 400;
  font-stretch: 100%;
  font-size: 1.08em;
  letter-spacing: -.01em;
  color: var(--yellow);                                         /* large text: 3.7:1 on --band */
}

/* 6e. CONTACT -------------------------------------------------------------- */
.contact__title {
  font-family: var(--font-display);
  font-weight: 800;
  font-stretch: 78%;
  font-size: clamp(3.25rem, 12.5vw, 12rem);
  line-height: .9;
  letter-spacing: -.015em;
  text-wrap: balance;
}
.contact__title .hl { background-size: 100% 92%; background-position: 0 60%; padding: 0 .06em; }
.contact__grid {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  column-gap: var(--gap);
  row-gap: 2rem;
  margin-top: clamp(2rem, 4.5vw, 3.75rem);
}
.contact__lead {
  grid-column: 1 / span 5;
  font-size: 1.25rem;
  line-height: 1.5;
  color: var(--ink-2);
  max-width: 34ch;
}
.contact__links { grid-column: 7 / -1; }
.contact__email {
  display: inline-block;
  margin-bottom: 1.25rem;
  font-family: var(--font-display);
  font-weight: 700;
  font-stretch: 88%;
  font-size: clamp(1.5rem, 3.4vw, 3rem);
  line-height: 1.1;
  letter-spacing: -.03em;
  color: var(--link);
  text-decoration: underline;
  text-decoration-thickness: 3px;
  text-underline-offset: .14em;
  max-width: 100%;
  overflow-wrap: break-word;   /* script.js adds a break hint before the @ */
  border-radius: 6px;
  transition: background-color .2s, color .2s;
}
.contact__email:hover { background: var(--yellow); color: var(--on-yellow); text-decoration-color: transparent; }
.contact__list { border-top: 2px solid var(--line-strong); }
.contact__list a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.1rem .25rem;
  border-bottom: 1px solid var(--line);
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(1.375rem, 2.2vw, 1.875rem);
  letter-spacing: -.02em;
  text-decoration: none;
  transition: background-color .25s, color .25s, padding .35s var(--ease);
}
.contact__list svg { width: 26px; height: 26px; flex: none; color: var(--link); transition: transform .35s var(--ease); }
.contact__list a:hover { background: var(--yellow); color: var(--on-yellow); padding-inline: 1rem; }
.contact__list a:hover svg { color: var(--on-yellow); transform: translate(2px, -2px); }
.contact__empty {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 1.25rem;
  padding: clamp(1.25rem, 2.5vw, 1.75rem);
  border: 2px solid var(--line-strong);
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: 6px 6px 0 0 var(--yellow);
}
.contact__empty-icon {
  position: relative;
  display: grid;
  place-items: center;
  width: 60px;
  height: 60px;
  border-radius: 16px;
  background: var(--blue);
  color: var(--on-blue);
}
.contact__empty-icon svg { width: 30px; height: 30px; }
.contact__empty-icon i {
  position: absolute;
  top: -4px;
  right: -4px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--yellow);
  border: 2px solid var(--surface);
  animation: pulse 2s ease-in-out infinite;
}
.contact__empty-title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(1.25rem, 2vw, 1.5rem);
  letter-spacing: -.02em;
  line-height: 1.15;
  text-wrap: balance;
}
/* Without JavaScript the CONFIG links can't be shown: don't claim they're coming, and don't
   point the hero "Get in touch" button at a section with nothing to click */
html:not(.js) .contact__empty,
html:not(.js) [data-config-fallback-hide] { display: none; }

.contact__facts {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: var(--gap);
  margin-top: clamp(1.75rem, 3vw, 2.5rem);
}
.contact__facts > div { padding-top: .85rem; border-top: 1px solid var(--line); }
.contact__facts dt {
  font-family: var(--font-mono);
  font-size: .6875rem;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--muted);
}
.contact__facts dd {
  margin-top: .3rem;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.1875rem;
  letter-spacing: -.01em;
}
.contact__tz { font-family: var(--font-mono); font-size: .75rem; font-weight: 500; letter-spacing: .06em; color: var(--muted); }

/* 8. FOOTER ---------------------------------------------------------------- */
.site-footer {
  padding-top: 2rem;
  border-top: 1px solid var(--line);
  overflow: hidden;
}
.footer__row {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: .75rem 2rem;
  font-size: .875rem;
  color: var(--muted);
}
.footer__row p { margin: 0; }
.footer__actions { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem 1.5rem; }
/* Auto margins: evenly spaced on one row; when the row wraps, the last item lines up under the credit */
.footer__row .footer__credit,
.footer__actions { margin-left: auto; }
.footer__top { color: var(--ink); text-decoration: none; font-weight: 500; border-radius: 4px; transition: color .2s; }
.footer__top span { display: inline-block; transition: transform .3s var(--ease); }
.footer__top:hover { color: var(--link); }
.footer__top:hover span { transform: translateY(-3px); }
.footer__word {
  margin-top: clamp(2rem, 5vw, 4rem);
  margin-bottom: -.1em;
  font-family: var(--font-display);
  font-weight: 800;
  font-stretch: 75%;
  font-size: clamp(6rem, 33vw, 30rem);
  line-height: .9;
  letter-spacing: -.02em;
  white-space: nowrap;
  color: var(--word);
  user-select: none;
}
/* Light mode: ink wordmark over a tilted yellow highlighter stroke. Dark mode: solid yellow. */
.footer__word { position: relative; isolation: isolate; }
.footer__word-text { position: relative; }
.footer__word-text::before {
  content: "";
  position: absolute;
  z-index: -1;
  left: -.04em;
  right: -.02em;
  top: 50%;
  bottom: 25%;
  border-radius: .05em;
  background: var(--word-mark);
  transform: rotate(-1.2deg);
}
.footer__word-dot { color: var(--blue); }

/* 7. ILLUSTRATIONS --------------------------------------------------------- */
.ill { display: block; }
.ill .f-ink { fill: var(--ink); }
.ill .f-bg { fill: var(--bg); }
.ill .f-panel { fill: var(--panel); }
.ill .f-soft { fill: var(--soft); }
.ill .f-muted { fill: var(--muted); }
.ill .f-yellow { fill: var(--yellow); }
.ill .f-blue { fill: var(--blue); }
.ill .f-hl { fill: var(--hl-soft); }
.ill .s-ink { stroke: var(--ink); }
.ill .s-bg { stroke: var(--bg); }
.ill .s-line { stroke: var(--ill-line); }
.ill .s-soft { stroke: var(--soft); }
.ill .s-blue { stroke: var(--blue); }
.ill .s-track { stroke: var(--track); }
.ill .s-track-edge { stroke: var(--track-edge); }
.ill .t-ui { font-family: var(--font-body); font-weight: 600; }
.ill .t-body { font-family: var(--font-body); font-weight: 400; }
.ill .t-mono { font-family: var(--font-mono); font-weight: 500; letter-spacing: .06em; }
.ill .t-display { font-family: var(--font-display); font-weight: 800; font-stretch: 82%; letter-spacing: -.01em; }
/* Small figures: labels carry a larger size in style="--m: …" (in viewBox units). The bump follows
   the figure's own width, so labels stay readable in narrow columns as well as on phones. */
.case__visual { container-type: inline-size; }
@container (max-width: 670px) {
  .ill [style*="--m"] { font-size: var(--m); }
  .ill .m-hide { display: none; }
}

/* 9. MOTION ---------------------------------------------------------------- */
@keyframes rise { from { transform: translateY(105%); } to { transform: none; } }
@keyframes fade-up { from { opacity: 0; transform: translateY(18px); } to { opacity: 1; transform: none; } }
@keyframes sweep {
  from { background-size: 0% 100%; color: var(--ink); }
  to { background-size: 100% 100%; color: var(--on-yellow); }
}
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes ticker { to { transform: translateX(-50%); } }
@keyframes pulse { 50% { opacity: .35; } }
@keyframes blink { 50% { opacity: .2; } }
@keyframes bob { 50% { translate: 0 -7px; } }
@keyframes float { 50% { translate: 0 -9px; } }
@keyframes dash { to { stroke-dashoffset: -28; } }
@keyframes flow { to { stroke-dashoffset: -24; } }
@keyframes steam { 0%, 100% { opacity: .35; translate: 0 2px; } 50% { opacity: .9; translate: 0 -4px; } }

/* Hero entrance (pure CSS; ends fully visible even without JS) */
.hero__name .line__inner { animation: rise 1.1s var(--ease) both; }
.hero__name .line:nth-child(2) .line__inner { animation-delay: .08s; }
.hero__name .line:nth-child(3) .line__inner { animation-delay: .16s; }
.hl--hero { animation: sweep .8s var(--ease) .75s both; }
.hero__meta, .hero__badge, .hero__foot { animation: fade-up 1s var(--ease) .35s both; }
.hero__foot { animation-delay: .5s; }

.ill .blink { animation: blink 1.4s ease-in-out infinite; }
.ill .bob { animation: bob 3.6s ease-in-out infinite; }
.ill .steam path { animation: steam 2.6s ease-in-out infinite; }
.ill .steam path:nth-child(2) { animation-delay: .4s; }
.ill .steam path:nth-child(3) { animation-delay: .8s; }
.ill .float--a { animation: float 5.5s ease-in-out infinite; }
.ill .float--b { animation: float 6.5s ease-in-out -2s infinite; }
.ill .float--c { animation: float 6s ease-in-out -4s infinite; }
.ill .racing-dash { animation: dash 1.4s linear infinite; }
.ill .flow { stroke-dasharray: 6 6; animation: flow 1.2s linear infinite; }

/* Scroll reveal: only hides content once JS is confirmed running */
html.js .reveal { transition: opacity .9s var(--ease), transform .9s var(--ease); }
html.js:not(.no-reveal) .reveal:not(.is-in) { opacity: 0; transform: translateY(28px); }
html.js:not(.no-reveal) .reveal:not(.is-in) .hl { background-size: 0% 88%; color: inherit; }

/* Smooth theme switch (class added briefly by script.js) */
html.theme-anim,
html.theme-anim *,
html.theme-anim *::before,
html.theme-anim *::after {
  transition: background-color .4s ease, color .4s ease, border-color .4s ease, fill .4s ease, stroke .4s ease !important;
}

/* "Pause animations" button (script.js): freezes every looping animation in place.
   The one-off hero entrance is skipped instead, so its content is never left hidden. */
html.motion-off *,
html.motion-off *::before,
html.motion-off *::after { animation-play-state: paused !important; }
html.motion-off .hero__name .line__inner,
html.motion-off .hl--hero,
html.motion-off .hero__meta,
html.motion-off .hero__badge,
html.motion-off .hero__foot { animation: none !important; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: .001ms !important;
    animation-delay: 0s !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
    transition-delay: 0s !important;
  }
  .ticker__track, .hero__badge-ring, .ill * { animation: none !important; }
  .motion-toggle { display: none; }   /* nothing moves, so there is nothing to pause */
  html.js .reveal { opacity: 1 !important; transform: none !important; }
  html.js .reveal .hl { background-size: 100% 88% !important; color: var(--on-yellow) !important; }
}

/* RESPONSIVE --------------------------------------------------------------- */
@media (max-width: 1240px) {
  .hero__foot {
    grid-column: 1 / -1;
    grid-row: 3;
    align-self: start;
    display: grid;
    grid-template-columns: repeat(12, minmax(0, 1fr));
    column-gap: var(--gap);
    row-gap: 1.25rem;
    margin-top: clamp(1.5rem, 3vw, 2.25rem);
  }
  /* The intro sits under the name: lead + buttons on the left, paragraph on the right */
  .hero__aside { display: contents; }
  .hero__foot .hero__lead { grid-column: 1 / span 6; grid-row: 1; }
  .hero__foot .hero__ctas { grid-column: 1 / span 6; grid-row: 2; margin-top: 0; align-self: end; }
  .hero__foot .hero__sub { grid-column: 7 / -1; grid-row: 1 / span 2; align-self: start; }
}
/* Laptop widths (e.g. 1024×768): a smaller name keeps the buttons above the fold */
@media (min-width: 961px) and (max-width: 1240px) {
  .hero__name { font-size: clamp(5.5rem, min(12.5vw, (100vh - 25.5rem) / 2.52), 10rem); }
  .hero__meta { margin-bottom: clamp(1.25rem, 2.5vw, 2rem); }
  .hero { --badge: clamp(104px, 10vw, 128px); }
}

/* Short desktop windows: a smaller badge, so the space reserved for it doesn't push the buttons below the fold */
@media (min-width: 1241px) and (max-height: 760px) {
  .hero { --badge: clamp(88px, 14vh, 128px); }
}

@media (min-width: 961px) and (min-height: 720px) {
  /* The illustration rides alongside the longer case-study text (only when it fits the screen) */
  .case__visual { position: sticky; top: calc(var(--nav-h) + 1.5rem); }
}

@media (max-width: 1180px) {
  .case__visual { grid-column: 1 / span 7; }
  .case__body { grid-column: 8 / -1; }
  .case--flip .case__visual { grid-column: 6 / -1; }
  .case--flip .case__body { grid-column: 1 / span 5; }
}

@media (max-width: 960px) {
  .section-title { grid-column: 1 / -1; }
  .section-intro { grid-column: 1 / -1; margin-top: 1.5rem; }
  .statement { grid-column: 1 / -1; }
  .about__copy { grid-column: 1 / -1; grid-row: auto; max-width: 62ch; }
  .facts { grid-column: 1 / -1; grid-row: auto; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: var(--gap); }
  .case__visual,
  .case__body,
  .case--flip .case__visual,
  .case--flip .case__body { grid-column: 1 / -1; grid-row: auto; }
  .case__body { max-width: 68ch; }
  .tools { grid-template-columns: repeat(2, minmax(0, 1fr)); row-gap: 2.5rem; }
  .steps { grid-template-columns: repeat(2, minmax(0, 1fr)); row-gap: 2.5rem; }
  .contact__lead, .contact__links { grid-column: 1 / -1; }
  .contact__links { max-width: 640px; }
  .hero__foot .hero__lead,
  .hero__foot .hero__sub,
  .hero__foot .hero__ctas { grid-column: 1 / -1; grid-row: auto; }
  .hero__lead { max-width: 20ch; }
  .hero__foot .hero__ctas { margin-top: .25rem; }
  .ai-note__label, .ai-note__quote { grid-column: 1 / -1; }
  .ai-note__quote { padding-left: .5em; }
  .ai-note__quote::before { left: 0; }
  .bench__title, .bench__grid { grid-column: 1 / -1; }
}

@media (max-width: 880px) {
  :root { --nav-h: 64px; }
  .nav__links { display: none; }
  .menu-toggle { display: inline-flex; }
  html:not(.js) .menu-toggle { display: none; }
  html:not(.js) .nav { height: auto; flex-wrap: wrap; padding-block: .75rem; }
  html:not(.js) .nav__links { display: block; order: 3; width: 100%; }
  html:not(.js) .nav__links ul { flex-wrap: wrap; gap: .25rem 1rem; }
  html:not(.js) .site-header { position: static; }   /* the taller wrapped header scrolls away, so anchors aren't hidden */
}

@media (max-width: 720px) {
  .hero__badge { display: none; }
  .hero__meta p:nth-child(2) { display: none; }
  .line--indent { padding-left: .35em; }
  .case__head { grid-template-columns: auto minmax(0, 1fr); row-gap: 1rem; }
  .case__head .badge { grid-column: 1 / -1; justify-self: start; margin: 0; }
  .bench__grid { grid-template-columns: 1fr; }
  .brand__name { display: none; }
}

@media (max-width: 560px) {
  body { font-size: 1rem; }
  .hero__name { font-size: 17.6vw; }
  .tools, .steps { grid-template-columns: 1fr; }
  .facts { grid-template-columns: 1fr 1fr; }
  .case__meta { grid-template-columns: 1fr 1fr; }
  .case__num { font-size: 3.25rem; }
  .mini { grid-template-columns: 1fr; }
  .hero__ctas .btn { flex: 1 1 auto; justify-content: center; }
  .about__copy p:first-child { font-size: 1.125rem; }
  .ticker { transform: rotate(-2.2deg); }
  .footer__row { flex-direction: column; }
  .footer__row .footer__credit,
  .footer__actions { margin-left: 0; }
  .contact__empty { gap: 1rem; box-shadow: 4px 4px 0 0 var(--yellow); }
  .contact__empty-icon { width: 48px; height: 48px; border-radius: 13px; }
  .contact__empty-icon svg { width: 24px; height: 24px; }
  .contact__facts { grid-template-columns: 1fr 1fr; }
  .tools__next { border-radius: var(--radius); }

  /* Illustrations: full-bleed plates with a tighter 8:7 crop (the artwork keeps its key
     content inside the centre of the 800×600 canvas) */
  .case__visual { margin-inline: calc(-1 * var(--gutter)); }
  .case__visual > svg,
  .case__visual > img { aspect-ratio: 8 / 7; border-radius: 0; border-inline: 0; }
  .case__visual figcaption { padding-inline: var(--gutter); }
}

/* PRINT / SAVE AS PDF ------------------------------------------------------- */
@media print {
  /* Always print the light palette, with its colour fills, whatever theme is on screen */
  :root[data-theme],
  :root:not([data-theme]) {
    --bg: #FFFFFF;
    --surface: #F4F4F0;
    --panel: #FFFFFF;
    --ink: #0B0B0C;
    --ink-2: #2E2E33;
    --muted: #5C5C63;
    --line: #E3E3DD;
    --line-strong: #0B0B0C;
    --blue: #1F5BFF;
    --link: #1A4FE6;
    --soft: rgba(11, 11, 12, .08);
    --grid-dot: rgba(11, 11, 12, .13);
    --track: #E6E6E0;
    --track-edge: #0B0B0C;
    --ill-line: rgba(11, 11, 12, .16);
    --hl-soft: rgba(255, 212, 0, .32);
    --word: #0B0B0C;
    --word-mark: var(--yellow);
    --nav-bg: #FFFFFF;
    --nav-active: var(--ink);
    color-scheme: light !important;
  }
  html { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  *, *::before, *::after { animation: none !important; transition: none !important; }

  /* Scroll reveal never fires on paper: show everything */
  html.js .reveal { opacity: 1 !important; transform: none !important; }
  html.js .reveal .hl { background-size: 100% 88% !important; color: var(--on-yellow) !important; }

  .site-header, .case__visual { position: static; }
  .ticker-wrap, .hero__badge, .hero__ctas, .nav__actions, .footer__actions, .mobile-menu, .skip-link { display: none !important; }
  .case__head, .case__visual, .step, .mini, .tools__group, .contact__links { break-inside: avoid; }
}
