/* ==========================================================================
   Ramtin Totonchi — portfolio
   Plain CSS, no build step. Tokens first, then base, layout, components, pages.
   ========================================================================== */

:root {
  --paper: #f3f1ec;
  --paper-2: #e9e4da;
  --ink: #111110;
  --ink-2: #2a2926;
  --muted: #5c5a55;           /* 6.2:1 on --paper */
  --line: rgba(17, 17, 16, 0.14);
  --dark: #0f0f0e;
  --on-dark: #f3f1ec;
  --on-dark-muted: #a9a59c;   /* 7.4:1 on --dark */
  --accent: #e8462a;          /* decorative / large text only on paper */

  --font-display: "Space Grotesk", ui-sans-serif, system-ui, sans-serif;
  --font-body: "Instrument Sans", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;

  --gutter: clamp(16px, 2.2vw, 32px);
  --header-h: 64px;
  --radius: 6px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-in-out: cubic-bezier(0.65, 0, 0.35, 1);

  --step--1: 0.8125rem;
  --step-0: 1rem;
  --step-1: clamp(1.125rem, 1rem + 0.4vw, 1.375rem);
  --step-2: clamp(1.5rem, 1.2rem + 1vw, 2.125rem);
  --step-3: clamp(2rem, 1.4rem + 2.4vw, 3.5rem);
  --step-4: clamp(3rem, 1.6rem + 6vw, 8rem);
  --step-5: clamp(3.5rem, 1rem + 11vw, 13rem);
}

/* Smooth cross-page fades in browsers that support it */
@view-transition { navigation: auto; }
::view-transition-old(root),
::view-transition-new(root) { animation-duration: 0.35s; }

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: var(--step-0);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
img, svg, video { display: block; max-width: 100%; }
img { height: auto; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
h1, h2, h3, h4, p, ul, ol, figure, blockquote { margin: 0; }
ul, ol { padding: 0; list-style: none; }

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

[hidden] { display: none !important; }

.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0);
  white-space: nowrap; border: 0;
}

.skip-link {
  position: fixed; left: var(--gutter); top: -100px; z-index: 200;
  background: var(--ink); color: var(--paper);
  padding: 10px 14px; border-radius: var(--radius);
  font-weight: 600;
}
.skip-link:focus { top: 12px; }

/* Small uppercase-ish label used to name sections: ■ About */
.label {
  font-family: var(--font-display);
  font-size: var(--step--1);
  font-weight: 500;
  letter-spacing: 0.02em;
  display: inline-flex; align-items: center; gap: 0.6em;
}
.label::before {
  content: ""; width: 0.55em; height: 0.55em;
  background: currentColor; display: inline-block;
}
.label--accent::before { background: var(--accent); }

.muted { color: var(--muted); }

/* ---------- Header (blends over any background) ---------- */
.site-header {
  position: fixed; inset: 0 0 auto 0; z-index: 100;
  height: var(--header-h);
  padding: 18px var(--gutter) 0;
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  column-gap: var(--gutter);
  align-items: start;
  color: #fff;
  mix-blend-mode: difference;
  pointer-events: none;
}
.site-header > * { pointer-events: auto; }

.wordmark {
  grid-column: 1 / span 3;
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 1.0625rem;
  line-height: 1.02;
  letter-spacing: -0.02em;
}
.wordmark span { display: block; }

.site-nav { grid-column: 6 / span 5; }
.site-nav ul { display: flex; gap: clamp(20px, 5vw, 88px); }
.site-nav a {
  font-family: var(--font-display);
  font-size: 0.875rem; font-weight: 500;
  display: inline-flex; gap: 0.45em; align-items: baseline;
  position: relative; padding-block: 2px;
}
.site-nav a sup { font-size: 0.65em; opacity: 0.6; }
.site-nav a::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: -2px; height: 1px;
  background: currentColor; transform: scaleX(0); transform-origin: right;
  transition: transform 0.45s var(--ease);
}
.site-nav a:hover::after,
.site-nav a[aria-current="page"]::after { transform: scaleX(1); transform-origin: left; }

.locale {
  grid-column: 11 / span 2; justify-self: end; text-align: right;
  font-family: var(--font-display);
  font-size: 0.875rem; font-weight: 500; line-height: 1.15;
}
.locale time { display: block; font-weight: 300; font-size: 0.75rem; font-variant-numeric: tabular-nums; }

.menu-toggle {
  display: none;
  grid-column: 9 / span 4; justify-self: end;
  background: none; border: 0; padding: 4px 0; cursor: pointer;
  font-family: var(--font-display); font-weight: 600; font-size: 0.9375rem;
  align-items: center; gap: 10px;
}
.menu-toggle .bars { width: 18px; height: 8px; position: relative; }
.menu-toggle .bars::before, .menu-toggle .bars::after {
  content: ""; position: absolute; left: 0; right: 0; height: 1.5px; background: currentColor;
  transition: transform 0.4s var(--ease);
}
.menu-toggle .bars::before { top: 0; }
.menu-toggle .bars::after { bottom: 0; }
.menu-open .menu-toggle .bars::before { transform: translateY(3.25px) rotate(45deg); }
.menu-open .menu-toggle .bars::after { transform: translateY(-3.25px) rotate(-45deg); }

.mobile-menu {
  position: fixed; inset: 0; z-index: 90;
  background: var(--dark); color: var(--on-dark);
  padding: calc(var(--header-h) + 40px) var(--gutter) var(--gutter);
  display: flex; flex-direction: column; justify-content: space-between;
  clip-path: inset(0 0 100% 0);
  visibility: hidden;
  transition: clip-path 0.6s var(--ease-in-out), visibility 0s linear 0.6s;
}
.menu-open .mobile-menu {
  clip-path: inset(0 0 0 0); visibility: visible;
  transition: clip-path 0.6s var(--ease-in-out), visibility 0s;
}
.mobile-menu ul a {
  font-family: var(--font-display); font-size: clamp(2.5rem, 12vw, 4.5rem);
  font-weight: 500; letter-spacing: -0.04em; line-height: 1.1;
  display: flex; align-items: baseline; gap: 0.3em;
}
.mobile-menu ul a sup { font-size: 0.3em; color: var(--on-dark-muted); letter-spacing: 0; }
.mobile-menu .mobile-menu__foot { color: var(--on-dark-muted); font-size: var(--step--1); display: flex; justify-content: space-between; }

@media (max-width: 760px) {
  .site-nav, .locale { display: none; }
  .menu-toggle { display: inline-flex; }
}

/* ---------- Generic layout ---------- */
.grid-12 {
  display: grid; grid-template-columns: repeat(12, 1fr);
  column-gap: var(--gutter);
  padding-inline: var(--gutter);
}
.section { padding-block: clamp(72px, 12vw, 180px); }
.section-head { grid-column: 1 / span 3; padding-top: 0.35em; }
.section-body { grid-column: 6 / -1; }
@media (max-width: 900px) {
  .section-head { grid-column: 1 / -1; margin-bottom: 28px; }
  .section-body { grid-column: 1 / -1; }
}

.lede {
  font-family: var(--font-display);
  font-size: var(--step-3);
  font-weight: 500;
  letter-spacing: -0.035em;
  line-height: 1.04;
}

/* Reveal on scroll */
.reveal { opacity: 0; transform: translateY(28px); transition: opacity 0.9s var(--ease), transform 0.9s var(--ease); }
.reveal.is-in { opacity: 1; transform: none; }
.reveal[data-delay="1"] { transition-delay: 0.08s; }
.reveal[data-delay="2"] { transition-delay: 0.16s; }
.reveal[data-delay="3"] { transition-delay: 0.24s; }

/* Word-by-word entrance */
.split-words .w { display: inline-block; overflow: hidden; vertical-align: top; }
.split-words .w > span {
  display: inline-block; transform: translateY(105%);
  transition: transform 0.9s var(--ease);
  transition-delay: calc(var(--i) * 28ms + 150ms);
}
.split-words.is-in .w > span { transform: none; }

/* Bracketed toggle buttons: [ Carousel ] [ Grid ] */
.toggle-group { display: flex; gap: 28px; }
.toggle {
  background: none; border: 0; padding: 4px 0; cursor: pointer;
  font-family: var(--font-display); font-size: 0.9375rem; font-weight: 500;
  color: var(--muted);
  display: inline-flex; gap: 0.35em; align-items: center;
  transition: color 0.3s;
}
.toggle::before { content: "["; opacity: 0; transform: translateX(6px); transition: 0.35s var(--ease); }
.toggle::after  { content: "]"; opacity: 0; transform: translateX(-6px); transition: 0.35s var(--ease); }
.toggle[aria-pressed="true"] { color: var(--ink); }
.toggle[aria-pressed="true"]::before,
.toggle[aria-pressed="true"]::after,
.toggle:hover::before, .toggle:hover::after { opacity: 1; transform: none; }

/* Button */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 48px; padding: 0 22px;
  background: var(--ink); color: var(--paper);
  border: 1px solid var(--ink); border-radius: 999px;
  font-family: var(--font-display); font-weight: 500;
  cursor: pointer; transition: background 0.3s, color 0.3s;
}
.btn:hover { background: transparent; color: var(--ink); }
.btn .arrow { transition: transform 0.4s var(--ease); }
.btn:hover .arrow { transform: translateX(4px); }

/* Arrow link with underline sweep */
.link {
  position: relative; display: inline-flex; gap: 0.4em; align-items: baseline;
  background: linear-gradient(currentColor 0 0) no-repeat 100% 100% / 0 1px;
  transition: background-size 0.45s var(--ease);
}
.link:hover { background-position: 0 100%; background-size: 100% 1px; }

/* ==========================================================================
   HOME — one-screen carousel
   ========================================================================== */
.home { overflow: hidden; }
.home-main {
  position: relative;
  height: 100vh; height: 100svh;
  display: grid;
  grid-template-rows: 1fr auto;
}

.intro {
  position: absolute; z-index: 3;
  top: clamp(110px, 22vh, 210px);
  left: 50%;
  width: min(30rem, 42vw);
  font-family: var(--font-display);
  font-weight: 500;
  font-size: clamp(1rem, 0.85rem + 0.45vw, 1.25rem);
  line-height: 1.2;
  letter-spacing: -0.015em;
}

.stage {
  position: relative;
  height: 100%;
  perspective: 1800px;
  perspective-origin: 50% 50%;
  touch-action: none;
  user-select: none;
  outline: none;
}
.stage:focus-visible { outline: none; }
.stage:focus-visible .card--front figure { outline: 2px solid var(--accent); outline-offset: 4px; }

.ring {
  position: absolute; left: 50%; top: 54%;
  transform-style: preserve-3d;
  width: 0; height: 0;
}
.card {
  --w: clamp(240px, 27vw, 430px);
  position: absolute; left: 0; top: 0;
  width: var(--w);
  transform-style: preserve-3d;
  backface-visibility: hidden;
  will-change: transform, opacity;
}
.card a { display: block; cursor: pointer; }
.card figure {
  position: relative; overflow: hidden;
  aspect-ratio: 16 / 10;
  border-radius: var(--radius);
  background: var(--paper-2);
}
.card img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.8s var(--ease), filter 0.5s; }
.card-quote {
  position: absolute; inset: 0;
  display: grid; place-items: center; padding: 1.5rem;
  text-align: center; color: #fff;
  font-family: var(--font-display); font-weight: 500;
  font-size: clamp(1rem, 0.8rem + 0.7vw, 1.5rem); line-height: 1.15; letter-spacing: -0.02em;
  background: rgba(10, 10, 10, 0.45);
  opacity: 0; transition: opacity 0.45s var(--ease);
}
.card-meta {
  display: flex; justify-content: space-between; gap: 1rem;
  margin-top: 12px;
  font-family: var(--font-display); font-size: 0.9375rem; font-weight: 500;
  opacity: 0; transform: translateY(6px);
  transition: opacity 0.45s var(--ease), transform 0.45s var(--ease);
}
.card-meta span:last-child { color: var(--muted); font-weight: 400; }
.card a:hover .card-quote,
.card a:focus-visible .card-quote { opacity: 1; }
.card a:hover img { transform: scale(1.04); }
.card a:hover .card-meta,
.card a:focus-visible .card-meta,
.card--front .card-meta { opacity: 1; transform: none; }

/* Giant counter */
.counter {
  position: absolute; z-index: 2; top: 54%;
  transform: translateY(-50%);
  font-family: var(--font-display); font-weight: 300;
  font-size: clamp(5rem, 2rem + 8vw, 10.5rem);
  letter-spacing: -0.06em; line-height: 0.8;
  font-variant-numeric: tabular-nums;
  pointer-events: none;
}
.counter--now { left: calc(var(--gutter) * -0.5); }
.counter--total { right: calc(var(--gutter) * -0.3); }
.counter .digit { display: inline-block; height: 0.8em; overflow: hidden; vertical-align: top; }
.counter .digit > span { display: block; transition: transform 0.7s var(--ease); }

.home-bar {
  position: relative; z-index: 3;
  display: grid; grid-template-columns: repeat(12, 1fr); column-gap: var(--gutter);
  align-items: center;
  padding: 0 var(--gutter) 22px;
}
.home-bar .toggle-group { grid-column: 1 / span 4; }
.home-bar .section-name { grid-column: 6 / span 3; font-family: var(--font-display); font-size: 0.875rem; font-weight: 500; }
.home-bar .hint { grid-column: 10 / -1; justify-self: end; font-size: var(--step--1); color: var(--muted); display: flex; gap: 16px; align-items: center; }
.step-btn {
  width: 36px; height: 36px; border-radius: 50%;
  border: 1px solid var(--line); background: transparent; cursor: pointer;
  display: grid; place-items: center; transition: background 0.3s, color 0.3s;
}
.step-btn:hover { background: var(--ink); color: var(--paper); }

/* Grid view of the same cards */
.stage.is-grid { perspective: none; overflow-y: auto; touch-action: auto; }
.stage.is-grid .ring {
  position: static; width: auto; height: auto;
  transform: none !important;
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 40px var(--gutter);
  padding: calc(var(--header-h) + 72px) var(--gutter) 40px;
}
.stage.is-grid .card {
  position: static; width: auto;
  transform: none !important; opacity: 1 !important; pointer-events: auto !important;
  animation: grid-in 0.7s var(--ease) both;
  animation-delay: calc(var(--i) * 45ms);
}
.stage.is-grid .card-meta { opacity: 1; transform: none; }
.is-grid ~ .counter { opacity: 0; }
.home-main:has(.stage.is-grid) .hint-text { visibility: hidden; }
.home-main:has(.stage.is-grid) .intro { opacity: 0; transform: translateY(-12px); pointer-events: none; }
.intro { transition: opacity 0.4s, transform 0.5s var(--ease); }
.counter { transition: opacity 0.4s; }
@keyframes grid-in { from { opacity: 0; transform: translateY(24px); } }

@media (max-width: 1100px) { .stage.is-grid .ring { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 760px) {
  .intro { left: var(--gutter); right: var(--gutter); width: auto; top: calc(var(--header-h) + 36px); }
  .ring { top: 60%; }
  .card { --w: min(70vw, 320px); }
  .card-meta { flex-direction: column; gap: 2px; }
  .counter { display: none; }
  .home-bar .section-name, .home-bar .hint .hint-text { display: none; }
  .home-bar .toggle-group { grid-column: 1 / span 8; }
  .home-bar .hint { grid-column: 9 / -1; }
  .stage.is-grid .ring { grid-template-columns: 1fr 1fr; padding-top: calc(var(--header-h) + 32px); gap: 24px 12px; }
}

/* No-JS / reduced-motion fallback: plain scrollable grid */
.no-js .stage { overflow-y: auto; perspective: none; }
.no-js .ring { position: static; display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 32px; padding: 220px var(--gutter) 40px; width: auto; height: auto; }
.no-js .card { position: static; width: auto; }
.no-js .card-meta { opacity: 1; transform: none; }
.no-js .counter, .no-js .home-bar .toggle-group, .no-js .hint { display: none; }

/* ==========================================================================
   Dark "word | image | word" hero (About, Contact)
   ========================================================================== */
.split-hero {
  background: var(--dark); color: var(--on-dark);
  position: relative;
}
.split-hero--scroll { height: 220vh; }
.split-hero__sticky {
  position: sticky; top: 0; height: 100vh; height: 100svh;
  display: grid; place-items: center; overflow: hidden;
}
.split-hero__media {
  --p: 0;
  width: calc(46vw + 54vw * var(--p));
  height: calc(42vh + 58vh * var(--p));
  border-radius: calc(var(--radius) * (1 - var(--p)));
  overflow: hidden;
}
.split-hero__media img { width: 100%; height: 100%; object-fit: cover; transform: scale(calc(1.15 - 0.15 * var(--p))); }
.split-hero__word {
  position: absolute; top: 50%; z-index: 2;
  transform: translateY(-50%);
  font-family: var(--font-display); font-weight: 500;
  font-size: var(--step-5); letter-spacing: -0.06em; line-height: 0.85;
  color: #fff; mix-blend-mode: difference;
}
.split-hero__word--l { left: var(--gutter); }
.split-hero__word--r { right: var(--gutter); }
.split-hero--static .split-hero__sticky { position: relative; height: auto; padding: 18vh 0; }
.split-hero--static .split-hero__media { width: min(46vw, 640px); height: auto; aspect-ratio: 16/10; }
@media (max-width: 760px) {
  .split-hero__word { font-size: 4rem; }
  .split-hero__word--l { top: 22%; }
  .split-hero__word--r { top: auto; bottom: 18%; transform: none; }
  .split-hero__media { width: calc(78vw + 22vw * var(--p)); height: calc(38vh + 62vh * var(--p)); }
  .split-hero--static .split-hero__media { width: 78vw; }
  .split-hero--static .split-hero__word--l { top: 10%; }
  .split-hero--static .split-hero__word--r { bottom: 8%; }
}

/* ==========================================================================
   ABOUT
   ========================================================================== */
.statement p + p { margin-top: 1.4em; }
.statement .body {
  margin-top: 40px; max-width: 38rem;
  font-size: var(--step-1); line-height: 1.45; color: var(--ink-2);
}
.role-list { margin-top: 40px; display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  border: 1px solid var(--line); border-radius: 999px;
  padding: 6px 14px; font-size: var(--step--1); font-family: var(--font-display); font-weight: 500;
}
.chip--primary { background: var(--ink); color: var(--paper); border-color: var(--ink); }

/* Stacked sticky service cards */
.stack { grid-column: 1 / -1; margin-top: 8px; }
.stack-card {
  position: sticky;
  top: calc(var(--header-h) + 24px + var(--i) * 18px);
  background: var(--paper);
  border-top: 1px solid var(--ink);
  padding: 20px 0 48px;
  display: grid; grid-template-columns: repeat(12, 1fr); column-gap: var(--gutter);
  min-height: min(78vh, 640px);
}
.stack-card__media { grid-column: 4 / span 4; border-radius: var(--radius); overflow: hidden; align-self: start; aspect-ratio: 4/3; }
.stack-card__media img { width: 100%; height: 100%; object-fit: cover; }
.stack-card__body { grid-column: 9 / -1; display: flex; flex-direction: column; justify-content: space-between; }
.stack-card__list { font-family: var(--font-display); font-size: 0.9375rem; line-height: 1.6; }
.stack-card__list li::before { content: "— "; color: var(--muted); }
.stack-card__title {
  font-family: var(--font-display); font-weight: 500;
  font-size: var(--step-3); letter-spacing: -0.04em; line-height: 0.95;
  margin-top: 40px;
}
.stack-card__foot {
  grid-column: 1 / span 3; align-self: end;
  display: flex; flex-direction: column; gap: 4px;
  font-family: var(--font-display); font-size: 0.875rem;
}
.stack-card__num { font-variant-numeric: tabular-nums; font-size: var(--step-2); font-weight: 300; letter-spacing: -0.04em; }
@media (max-width: 900px) {
  .stack-card { grid-template-columns: 1fr; min-height: 0; gap: 20px; padding-bottom: 32px; }
  .stack-card__media, .stack-card__body, .stack-card__foot { grid-column: 1; }
  .stack-card__foot { flex-direction: row; justify-content: space-between; order: -1; }
}

/* Scroll-lit paragraph */
.scroll-lit {
  font-family: var(--font-display); font-weight: 500;
  font-size: var(--step-3); letter-spacing: -0.035em; line-height: 1.06;
}
.scroll-lit .w { opacity: 0.16; transition: opacity 0.25s linear; }
.scroll-lit .w.on { opacity: 1; }

/* Experience table with hover preview */
.xp { grid-column: 1 / -1; margin-top: 8px; }
.xp-row { border-top: 1px solid var(--line); }
.xp-row:last-child { border-bottom: 1px solid var(--line); }
.xp-row > a, .xp-row > div {
  display: grid; grid-template-columns: repeat(12, 1fr); column-gap: var(--gutter);
  padding: 22px 0; align-items: baseline;
  font-family: var(--font-display);
  transition: padding 0.45s var(--ease), color 0.3s;
}
.xp-row .c1 { grid-column: 1 / span 4; font-size: var(--step-2); font-weight: 500; letter-spacing: -0.03em; line-height: 1.1; }
.xp-row .c2 { grid-column: 6 / span 4; font-size: 0.9375rem; }
.xp-row .c3 { grid-column: 10 / span 2; font-size: 0.9375rem; color: var(--muted); font-variant-numeric: tabular-nums; }
.xp-row .c4 { grid-column: 12; justify-self: end; transition: transform 0.45s var(--ease); }
.xp-row > a:hover { padding-left: 14px; }
.xp-row > a:hover .c4 { transform: rotate(-45deg); }
@media (max-width: 760px) {
  .xp-row > a, .xp-row > div { grid-template-columns: 1fr auto; row-gap: 4px; }
  .xp-row .c1 { grid-column: 1 / -1; }
  .xp-row .c2 { grid-column: 1; }
  .xp-row .c3 { grid-column: 2; }
  .xp-row .c4 { display: none; }
}
.hover-preview {
  position: fixed; left: 0; top: 0; z-index: 50;
  width: 300px; aspect-ratio: 16/10; border-radius: var(--radius); overflow: hidden;
  pointer-events: none;
  opacity: 0; transform: translate(-50%, -50%) scale(0.85);
  transition: opacity 0.3s var(--ease), transform 0.4s var(--ease);
}
.hover-preview.on { opacity: 1; }
.hover-preview img { width: 100%; height: 100%; object-fit: cover; }
@media (hover: none) { .hover-preview { display: none; } }

/* Stats */
.stats { grid-column: 1 / -1; display: grid; grid-template-columns: repeat(4, 1fr); gap: var(--gutter); }
.stat { border-top: 1px solid var(--ink); padding-top: 18px; }
.stat__n {
  font-family: var(--font-display); font-weight: 300;
  font-size: var(--step-4); letter-spacing: -0.06em; line-height: 0.9;
  font-variant-numeric: tabular-nums;
}
.stat__l { margin-top: 14px; max-width: 18rem; color: var(--muted); font-size: 0.9375rem; }
.stats-note { grid-column: 1 / -1; margin-top: 28px; font-size: var(--step--1); color: var(--muted); }
@media (max-width: 900px) { .stats { grid-template-columns: 1fr 1fr; row-gap: 48px; } }

/* Work cards (About + Work index) */
.work-grid {
  grid-column: 1 / -1;
  display: grid; grid-template-columns: repeat(2, 1fr); gap: 64px var(--gutter);
}
.work-card a { display: block; }
.work-card__top {
  display: flex; justify-content: space-between;
  font-family: var(--font-display); font-size: var(--step--1); font-weight: 500;
  padding-bottom: 10px;
}
.work-card figure { overflow: hidden; border-radius: var(--radius); aspect-ratio: 16/10; background: var(--paper-2); }
.work-card img { width: 100%; height: 100%; object-fit: cover; transition: transform 1s var(--ease); }
.work-card a:hover img { transform: scale(1.045); }
.work-card__bottom { display: flex; justify-content: space-between; align-items: baseline; gap: 1rem; padding-top: 14px; }
.work-card__title { font-family: var(--font-display); font-size: var(--step-1); font-weight: 600; letter-spacing: -0.02em; }
.work-card__client { color: var(--muted); font-size: 0.9375rem; text-align: right; }
.work-grid > :nth-child(4n+2), .work-grid > :nth-child(4n+3) { }
@media (min-width: 901px) {
  .work-grid > :nth-child(even) { margin-top: 18vh; }
}
@media (max-width: 900px) { .work-grid { grid-template-columns: 1fr; gap: 48px; } }

/* List view of work */
.work-list { grid-column: 1 / -1; display: none; }
.work-index.is-list .work-grid { display: none; }
.work-index.is-list .work-list { display: block; }

/* ---------- Contact ---------- */
.contact-copy { font-size: var(--step-1); line-height: 1.45; max-width: 40rem; }
.contact-direct { margin-top: 28px; display: flex; flex-wrap: wrap; gap: 12px 32px; font-family: var(--font-display); font-weight: 500; }
.form { margin-top: 64px; display: grid; grid-template-columns: 1fr 1fr; gap: 36px var(--gutter); }
.field { display: flex; flex-direction: column; gap: 8px; }
.field--full { grid-column: 1 / -1; }
.field label { font-family: var(--font-display); font-size: var(--step--1); font-weight: 500; }
.field input, .field select, .field textarea {
  border: 0; border-bottom: 1px solid var(--ink); background: transparent;
  padding: 10px 0; border-radius: 0; min-height: 44px;
  transition: border-color 0.3s;
}
.field textarea { min-height: 120px; resize: vertical; }
.field input:focus, .field select:focus, .field textarea:focus { outline: none; border-bottom: 2px solid var(--accent); }
.field input::placeholder, .field textarea::placeholder { color: #8a867d; }
.form .btn { grid-column: 2; justify-self: end; min-width: 200px; }
.form-status { grid-column: 1 / -1; font-size: var(--step--1); color: var(--muted); min-height: 1.5em; }
@media (max-width: 760px) {
  .form { grid-template-columns: 1fr; }
  .form .btn { grid-column: 1; justify-self: stretch; }
}

/* ---------- Footer ---------- */
.site-footer {
  border-top: 1px solid var(--line);
  padding: 28px var(--gutter);
  display: grid; grid-template-columns: repeat(12, 1fr); column-gap: var(--gutter); row-gap: 16px;
  font-family: var(--font-display); font-size: 0.875rem;
}
.site-footer .copy { grid-column: 1 / span 4; color: var(--muted); }
.site-footer .social { grid-column: 6 / span 5; display: flex; gap: clamp(16px, 4vw, 64px); }
.site-footer .top { grid-column: 11 / -1; justify-self: end; }
@media (max-width: 760px) {
  .site-footer .copy, .site-footer .social, .site-footer .top { grid-column: 1 / -1; justify-self: start; }
}

/* ==========================================================================
   WORK INDEX page
   ========================================================================== */
.page-top { padding-top: calc(var(--header-h) + clamp(80px, 14vh, 160px)); }
.index-head {
  grid-column: 1 / -1; display: flex; justify-content: space-between; align-items: end;
  margin-bottom: 40px; gap: 24px; flex-wrap: wrap;
}
.index-head h1 { font-family: var(--font-display); font-weight: 500; font-size: var(--step-4); letter-spacing: -0.055em; line-height: 0.9; }
.index-head h1 sup { font-size: 0.25em; letter-spacing: 0; vertical-align: top; margin-left: 0.2em; }

/* ==========================================================================
   CASE STUDY
   ========================================================================== */
.cs-hero {
  position: relative; height: 100vh; height: 100svh; min-height: 560px;
  overflow: hidden; color: #fff; background: var(--dark);
}
.cs-hero__img { position: absolute; inset: 0; }
.cs-hero__img img { width: 100%; height: 115%; object-fit: cover; transform: translateY(var(--parallax, 0)); }
.cs-hero::after { content: ""; position: absolute; inset: 0; background: linear-gradient(to top, rgba(0,0,0,.55), rgba(0,0,0,0) 55%); }
.cs-hero__inner {
  position: absolute; inset: auto 0 0 0; z-index: 2;
  display: grid; grid-template-columns: repeat(12, 1fr); column-gap: var(--gutter);
  padding: 0 var(--gutter) var(--gutter); align-items: end;
}
.cs-hero__num {
  grid-column: 1 / span 5;
  font-family: var(--font-display); font-weight: 300;
  font-size: var(--step-5); letter-spacing: -0.07em; line-height: 0.78;
  font-variant-numeric: tabular-nums;
  margin-bottom: -0.06em;
}
.cs-hero__title { grid-column: 7 / -1; padding-bottom: 0.4em; }
.cs-hero__title h1 { font-family: var(--font-display); font-weight: 500; font-size: var(--step-3); letter-spacing: -0.04em; line-height: 1; }
.cs-hero__title p { margin-top: 10px; font-family: var(--font-display); font-size: var(--step-1); opacity: 0.85; }
@media (max-width: 760px) {
  .cs-hero__num { grid-column: 1 / -1; font-size: 7rem; order: 2; }
  .cs-hero__title { grid-column: 1 / -1; }
}

.cs-meta {
  grid-column: 1 / -1;
  display: grid; grid-template-columns: repeat(4, 1fr); gap: var(--gutter);
  border-top: 1px solid var(--ink); padding-top: 18px;
  font-family: var(--font-display);
}
.cs-meta dt { font-size: var(--step--1); color: var(--muted); }
.cs-meta dd { margin: 4px 0 0; font-weight: 500; }
@media (max-width: 760px) { .cs-meta { grid-template-columns: 1fr 1fr; row-gap: 20px; } }

.cs-block { padding-block: clamp(48px, 7vw, 100px); border-top: 1px solid var(--line); }
.cs-block:first-of-type { border-top: 0; }
.cs-block h2 { font-family: var(--font-display); font-weight: 500; font-size: var(--step--1); }
.cs-block .prose { font-size: var(--step-1); line-height: 1.5; max-width: 42rem; color: var(--ink-2); }
.cs-block .prose p + p { margin-top: 1em; }
.cs-block .prose--big { font-family: var(--font-display); font-weight: 500; font-size: var(--step-2); letter-spacing: -0.025em; line-height: 1.2; color: var(--ink); }
.cs-list { counter-reset: d; max-width: 42rem; }
.cs-list li {
  counter-increment: d;
  display: grid; grid-template-columns: 3rem 1fr; padding: 16px 0;
  border-bottom: 1px solid var(--line); font-size: var(--step-1);
}
.cs-list li::before { content: counter(d, decimal-leading-zero); font-family: var(--font-display); font-size: var(--step--1); color: var(--muted); padding-top: 0.35em; }
.cs-results { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--gutter); }
.cs-results .stat__n { font-size: var(--step-3); }
@media (max-width: 760px) { .cs-results { grid-template-columns: 1fr; gap: 32px; } }
.cs-tags { display: flex; flex-wrap: wrap; gap: 8px; }

.cs-gallery {
  grid-column: 1 / -1; display: grid; grid-template-columns: repeat(12, 1fr); gap: var(--gutter);
  padding-block: clamp(24px, 4vw, 60px);
}
.cs-gallery figure { border-radius: var(--radius); overflow: hidden; background: var(--paper-2); }
.cs-gallery figure img { width: 100%; height: 100%; object-fit: cover; }
.cs-gallery .g-wide { grid-column: 1 / -1; aspect-ratio: 21 / 9; }
.cs-gallery .g-a { grid-column: 1 / span 7; aspect-ratio: 4 / 3; }
.cs-gallery .g-b { grid-column: 8 / -1; aspect-ratio: 4 / 5; align-self: end; }
.cs-gallery figcaption { font-size: var(--step--1); color: var(--muted); padding-top: 8px; }
@media (max-width: 760px) { .cs-gallery .g-a, .cs-gallery .g-b { grid-column: 1 / -1; } }

.next-project { background: var(--dark); color: var(--on-dark); }
.next-project a {
  display: grid; grid-template-columns: repeat(12, 1fr); column-gap: var(--gutter);
  padding: clamp(60px, 10vw, 140px) var(--gutter); align-items: end;
}
.next-project .label { grid-column: 1 / -1; margin-bottom: 24px; color: var(--on-dark-muted); }
.next-project .np-title {
  grid-column: 1 / span 9;
  font-family: var(--font-display); font-weight: 500;
  font-size: var(--step-4); letter-spacing: -0.055em; line-height: 0.92;
  transition: transform 0.6s var(--ease);
}
.next-project .np-arrow { grid-column: 11 / -1; justify-self: end; font-size: var(--step-3); transition: transform 0.6s var(--ease); }
.next-project a:hover .np-title { transform: translateX(16px); }
.next-project a:hover .np-arrow { transform: translateX(10px); }

.other-projects { padding-bottom: 80px; }
.other-projects ul { grid-column: 1 / -1; columns: 2; column-gap: var(--gutter); margin-top: 24px; }
.other-projects li { break-inside: avoid; border-top: 1px solid var(--line); }
.other-projects a { display: flex; justify-content: space-between; padding: 14px 0; font-family: var(--font-display); font-weight: 500; }
.other-projects a span:last-child { color: var(--muted); font-weight: 400; font-size: 0.875rem; }
@media (max-width: 760px) { .other-projects ul { columns: 1; } }

/* 404 */
.notfound { min-height: 100svh; display: grid; place-items: center; text-align: center; padding: var(--gutter); }
.notfound h1 { font-family: var(--font-display); font-weight: 300; font-size: var(--step-5); letter-spacing: -0.07em; line-height: 0.85; }
.notfound p { margin: 24px 0 32px; color: var(--muted); }

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; transition-delay: 0s !important; }
  .reveal, .split-words .w > span { opacity: 1; transform: none; }
  .split-hero--scroll { height: auto; }
  .split-hero--scroll .split-hero__sticky { position: relative; }
  .split-hero__media { --p: 0.35 !important; }
  .scroll-lit .w { opacity: 1; }
  @view-transition { navigation: none; }
}
