/* ============================================================
   TOKENS — the SINGLE SOURCE OF TRUTH for every visual decision.
   Re-palette by editing LAYER 1; re-balance in LAYER 2.
   No raw hex / px colors / easings anywhere outside this file
   (project identity palettes live in data/identities.json).
   ============================================================ */

/* ── LAYER 1: palette primitives ── */
:root {
  /* warm paper / ink */
  --paper-50:  #F4F2EC;
  --paper-100: #ECE9E1;
  --paper-200: #DEDACF;
  --ink-900:   #121110;
  --ink-700:   #2B2926;
  --ink-500:   #67645D;

  /* one signal accent — used in small doses (numbers, ticks, hovers) */
  --signal-500: #FF4D00;
  --signal-700: #C23A00;   /* AA on paper for small accent TEXT */
}

/* registered so they interpolate: chameleon.js swaps these three and the
   whole page — including every color-mix() derived from them — cross-fades */
@property --bg     { syntax: "<color>"; inherits: true; initial-value: #F4F2EC; }
@property --ink    { syntax: "<color>"; inherits: true; initial-value: #121110; }
@property --accent { syntax: "<color>"; inherits: true; initial-value: #FF4D00; }
@property --accent-text { syntax: "<color>"; inherits: true; initial-value: #C23A00; }

/* ── LAYER 2: semantic tokens ──
   --bg / --ink / --accent are swapped live by chameleon.js while a project
   chapter is on screen; everything else derives from them, so the whole
   page re-themes from three values. */
:root {
  --bg:         var(--paper-50);
  --ink:        var(--ink-900);
  --accent:     var(--signal-500);
  --accent-ink: var(--ink-900);

  --ink-dim:    color-mix(in oklab, var(--ink) 68%, var(--bg));
  --line:       color-mix(in oklab, var(--ink) 16%, var(--bg));
  --bg-raised:  color-mix(in oklab, var(--ink) 5%, var(--bg));
  --accent-text: var(--signal-700);

  /* the inverted footer slab */
  --slab-bg:    var(--ink-900);
  --slab-ink:   var(--paper-50);
}

/* ── LAYER 3: component knobs ── */
:root {
  --nav-h: 64px;
  --preview-w: 340px;
  --theme-dur: 700ms;
}

/* ── Type ── */
:root {
  --font-sans:  "General Sans", ui-sans-serif, system-ui, sans-serif;
  --font-serif: "Instrument Serif", ui-serif, Georgia, serif;
  --font-mono:  "JetBrains Mono", ui-monospace, "SF Mono", monospace;

  --text-giant:   clamp(4.5rem, 19.5vw, 22rem);   /* the name / footer wordmark */
  --text-display: clamp(2.75rem, 7.5vw, 7.5rem);  /* project titles, contact */
  --text-h2:      clamp(2rem, 4.2vw, 3.75rem);    /* statements */
  --text-lead:    clamp(1.125rem, 1.4vw, 1.375rem);
  --text-body:    1rem;
  --text-small:   0.875rem;
  --text-mono:    0.75rem;
}

/* ── Spacing ── */
:root {
  --space-section: clamp(6rem, 13vw, 11rem);
  --gutter: clamp(1.25rem, 3.5vw, 3rem);
  --wrap: 1440px;
}

/* ── Motion ── */
:root {
  --ease-out-expo: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-in-out:   cubic-bezier(0.87, 0, 0.13, 1);
  --dur-fast: 250ms;
  --dur-med: 650ms;
  --dur-slow: 1000ms;
  --stagger: 70ms;
}

/* ── Fonts (self-hosted woff2) ── */
@font-face {
  font-family: "General Sans";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("assets/fonts/GeneralSans-Regular.woff2") format("woff2");
}
@font-face {
  font-family: "General Sans";
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url("assets/fonts/GeneralSans-Medium.woff2") format("woff2");
}
@font-face {
  font-family: "General Sans";
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url("assets/fonts/GeneralSans-Semibold.woff2") format("woff2");
}
@font-face {
  font-family: "Instrument Serif";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("assets/fonts/InstrumentSerif-normal.woff2") format("woff2");
}
@font-face {
  font-family: "Instrument Serif";
  font-style: italic;
  font-weight: 400;
  font-display: swap;
  src: url("assets/fonts/InstrumentSerif-italic.woff2") format("woff2");
}
@font-face {
  font-family: "JetBrains Mono";
  font-style: normal;
  font-weight: 400 500;
  font-display: swap;
  src: url("assets/fonts/jetbrainsmono-latin.woff2") format("woff2");
}

/* base — reset, elements, type classes, layout primitives */

/* cross-page navigation animation (View Transitions API, MPA).
   New page wipes up from the bottom while the old one lifts and fades. */
@view-transition { navigation: auto; }
::view-transition-old(root) {
  animation: vt-out 700ms var(--ease-in-out) both;
}
::view-transition-new(root) {
  animation: vt-in 700ms var(--ease-in-out) both;
}
@keyframes vt-out { to { transform: translateY(-12%); opacity: 0.4; } }
@keyframes vt-in  { from { clip-path: inset(100% 0 0 0); } to { clip-path: inset(0 0 0 0); } }
@media (prefers-reduced-motion: reduce) {
  ::view-transition-old(root), ::view-transition-new(root) { animation: none; }
}

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

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
  background: var(--bg);
  transition: --bg var(--theme-dur) var(--ease-out-expo),
              --ink var(--theme-dur) var(--ease-out-expo),
              --accent var(--theme-dur) var(--ease-out-expo),
              --accent-text var(--theme-dur) var(--ease-out-expo);
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: var(--text-body);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* film grain — one fixed SVG-noise layer, jittered; sits above everything, never blocks input */
body::after {
  content: "";
  position: fixed;
  inset: -50%;
  z-index: 400;
  pointer-events: none;
  opacity: 0.07;
  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='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.9 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  animation: grain 0.6s steps(3) infinite;
}
@keyframes grain {
  0%   { transform: translate(0, 0); }
  33%  { transform: translate(-3%, 2%); }
  66%  { transform: translate(2%, -3%); }
  100% { transform: translate(0, 0); }
}

::selection { background: var(--ink); color: var(--bg); }

img, svg, picture { display: block; max-width: 100%; }
img { height: auto; }

a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }

h1, h2, h3, p, blockquote { margin: 0; }
figure { margin: 0; }
ul, ol { margin: 0; padding: 0; list-style: none; }

/* ── Type classes ── */
.giant {
  font-size: var(--text-giant);
  line-height: 0.82;
  letter-spacing: -0.055em;
  font-weight: 500;
}
.display {
  font-size: var(--text-display);
  line-height: 0.92;
  letter-spacing: -0.045em;
  font-weight: 500;
}
.h2 {
  font-size: var(--text-h2);
  line-height: 1.04;
  letter-spacing: -0.03em;
  font-weight: 500;
}
.lead { font-size: var(--text-lead); line-height: 1.45; letter-spacing: -0.01em; }
.small { font-size: var(--text-small); }
.mono {
  font-family: var(--font-mono);
  font-size: var(--text-mono);
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
/* the second voice: a real italic serif, used for one or two words at a time */
.serif, em.serif, .h2 em, .display em, .giant em, .lead em {
  font-family: var(--font-serif);
  font-style: italic;
  font-weight: 400;
  letter-spacing: -0.01em;
}
.dim { color: var(--ink-dim); }
.accent { color: var(--accent); }

/* text link with an underline that draws in from the left and exits right */
.ulink {
  background: linear-gradient(currentColor, currentColor) no-repeat right bottom / 0 1px;
  transition: background-size var(--dur-med) var(--ease-out-expo);
  padding-bottom: 2px;
}
.ulink:hover, .ulink:focus-visible { background-size: 100% 1px; background-position-x: left; }

/* ── Layout primitives ── */
.wrap {
  width: 100%;
  max-width: var(--wrap);
  margin-inline: auto;
  padding-inline: var(--gutter);
}
.section { padding-block: var(--space-section); }

/* section head: "(02)  SELECTED WORK ———————— 2025 — 26" */
.section-head {
  display: grid;
  grid-template-columns: auto auto 1fr auto;
  align-items: baseline;
  gap: 1rem;
  margin-bottom: clamp(3rem, 7vw, 6rem);
}
.section-head__num { color: var(--accent); }
.section-head__label { color: var(--ink); }
.section-head__rule {
  height: 1px;
  background: var(--line);
  border: 0;
  margin: 0;
  align-self: center;
  transform: scaleX(0);
  transform-origin: left;
  transition: transform var(--dur-slow) var(--ease-out-expo);
}
.section-head__meta { color: var(--ink-dim); }
.section-head.is-in .section-head__rule { transform: scaleX(1); }

/* ── Buttons ── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  min-height: 48px;
  padding: 0.75rem 1.4rem;
  border: 1px solid var(--ink);
  border-radius: 999px;
  color: var(--ink);
  position: relative;
  overflow: hidden;
  isolation: isolate;
  transition: color var(--dur-fast) var(--ease-out-expo), border-color var(--dur-fast) var(--ease-out-expo);
}
/* fill rises from the bottom on hover */
.btn::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: var(--ink);
  transform: translateY(101%);
  transition: transform 450ms var(--ease-out-expo);
}
.btn:hover, .btn:focus-visible { color: var(--bg); }
.btn:hover::before, .btn:focus-visible::before { transform: none; }
.btn .icon { width: 16px; height: 16px; transition: transform var(--dur-fast) var(--ease-out-expo); }
.btn:hover .icon { transform: translateX(3px); }
.btn--ghost { border-color: var(--line); }

/* ── Focus (a11y) ── */
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 2px;
}

.skip-link {
  position: fixed;
  top: -100px;
  left: 1rem;
  z-index: 500;
  padding: 0.5rem 1rem;
  background: var(--ink);
  color: var(--bg);
  border-radius: 4px;
  transition: top var(--dur-fast) var(--ease-out-expo);
}
.skip-link:focus { top: 1rem; }

.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;
}

/* ── Global reveal contract ── */
[data-reveal] {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity var(--dur-med) var(--ease-out-expo),
              transform var(--dur-med) var(--ease-out-expo);
  transition-delay: calc(var(--i, 0) * var(--stagger));
}
[data-reveal].is-in { opacity: 1; transform: none; }

/* line-masked reveal: lines rise out of an overflow mask */
.mask {
  display: block;
  overflow: hidden;
  padding-bottom: 0.08em;
  margin-bottom: -0.08em;
}
.mask .line {
  display: block;
  transform: translateY(105%);
  transition: transform 1100ms var(--ease-out-expo);
  transition-delay: calc(var(--i, 0) * 90ms);
}
.mask.is-in .line, .is-in .mask .line { transform: none; }

/* clip reveal for images: the CHILD un-clips from the bottom edge.
   (Clipping the observed element itself hides it from IntersectionObserver.) */
[data-clip] > * {
  clip-path: inset(100% 0 0 0);
  transition: clip-path 1200ms var(--ease-in-out), transform 1600ms var(--ease-out-expo);
}
[data-clip].is-in > * { clip-path: inset(0 0 0 0); }

/* No-JS: everything visible, no motion */
.no-js [data-reveal] { opacity: 1; transform: none; transition: none; }
.no-js .mask .line { transform: none; }
.no-js [data-clip] > * { clip-path: none; }
.no-js .section-head__rule { transform: none; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  body::after { animation: none; }
  [data-reveal] { opacity: 1; transform: none; transition: none; }
  .mask .line { transform: none; transition: none; }
  [data-clip] > * { clip-path: none; transition: none; }
  .section-head__rule { transform: scaleX(1); transition: none; }
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}

/* ── Slab: an inverted ink block (contact + footer). Derived tokens are
   re-declared here because color-mix() resolves where it is declared. ── */
.slab {
  --bg: var(--slab-bg);
  --ink: var(--slab-ink);
  --accent: var(--signal-500);
  --accent-text: var(--signal-500);
  --ink-dim: color-mix(in oklab, var(--ink) 68%, var(--bg));
  --line: color-mix(in oklab, var(--ink) 18%, var(--bg));
  background: var(--bg);
  color: var(--ink);
}

/* nav — borderless, chrome-free text bar. mix-blend-mode: difference keeps it
   legible over paper, ink, and every project palette without its own theme state. */
.nav {
  view-transition-name: site-nav;
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 100;
  height: var(--nav-h);
  color: #fff;
  mix-blend-mode: difference;
  pointer-events: none;
}

.nav__inner {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 1rem;
  height: 100%;
  max-width: var(--wrap);
  margin-inline: auto;
  padding-inline: var(--gutter);
}
.nav__inner > * { pointer-events: auto; }

.nav__wordmark {
  display: inline-flex;
  align-items: baseline;
  gap: 0.75rem;
  justify-self: start;
  font-weight: 500;
  letter-spacing: -0.01em;
}
.nav__role { opacity: 0.6; }

.nav__links { display: flex; gap: clamp(1.25rem, 2.6vw, 2.5rem); }
.nav__links a {
  display: inline-flex;
  gap: 0.4rem;
  transition: opacity var(--dur-fast) var(--ease-out-expo);
}
.nav__links a span { opacity: 0.5; }
.nav__links:hover a { opacity: 0.45; }
.nav__links a:hover, .nav__links a:focus-visible, .nav__links a.is-active { opacity: 1; }
.nav__links a.is-active span { opacity: 1; }

.nav__actions {
  display: flex;
  align-items: center;
  justify-self: end;
  gap: clamp(1rem, 2vw, 2rem);
}
.nav__clock { opacity: 0.6; font-variant-numeric: tabular-nums; }
.nav__resume { min-height: 44px; display: inline-flex; align-items: center; }

.nav__menu-btn { display: none; min-height: 44px; min-width: 44px; padding: 0.25rem 0; }

/* scroll progress — OUTSIDE the blend container so the accent stays true */
.nav__progress {
  position: fixed;
  left: 0;
  top: 0;
  z-index: 101;
  width: 100%;
  height: 2px;
  background: var(--accent);
  transform: scaleX(0);
  transform-origin: left;
  transition: background-color var(--theme-dur) var(--ease-out-expo);
}

/* mobile overlay menu — ink sheet that wipes down */
.nav-overlay {
  position: fixed;
  inset: 0;
  z-index: 90;
  display: grid;
  align-content: end;
  gap: 3rem;
  padding: calc(var(--nav-h) + 2rem) var(--gutter) 2rem;
  background: var(--slab-bg);
  color: var(--slab-ink);
  clip-path: inset(0 0 100% 0);
  transition: clip-path 700ms var(--ease-in-out);
}
.nav-overlay.is-open { clip-path: inset(0 0 0 0); }
.nav-overlay__list { display: grid; gap: 0.25rem; }
.nav-overlay__list a {
  display: flex;
  align-items: baseline;
  gap: 1rem;
  font-size: clamp(3rem, 15vw, 5rem);
  font-weight: 500;
  letter-spacing: -0.045em;
  line-height: 1;
}
.nav-overlay__list .mono { color: var(--signal-500); letter-spacing: 0.06em; }
.nav-overlay__foot { opacity: 0.6; }

@media (max-width: 899px) {
  .nav__links, .nav__clock, .nav__role { display: none; }
  .nav__inner { grid-template-columns: 1fr auto; }
  .nav__menu-btn { display: inline; }
}

@media (prefers-reduced-motion: reduce) {
  .nav-overlay { transition: none; }
}

/* hero — the name IS the hero: set edge to edge, with a statement above and a spec strip below */
.hero {
  position: relative;
  min-height: 100svh;
  display: flex;
  padding-top: calc(var(--nav-h) + clamp(2rem, 6vh, 5rem));
  padding-bottom: clamp(1.25rem, 3vh, 2rem);
}
.hero__inner {
  display: grid;
  grid-template-rows: 1fr auto;
  gap: clamp(1.5rem, 4vh, 3rem);
}

/* the name: "Virvadiya" is sized to span the full container width;
   the intro block sits in the empty space to the right of "Mitva" */
.hero__name-wrap {
  position: relative;
  align-self: end;
}
.hero__name {
  /* "Virvadiya" + dot measures ≈ 3.92em (General Sans 500, -0.055em) → 1/3.92 ≈ 0.255; 0.248 leaves air.
     Also capped by height so name + spec always fit the first screen. */
  font-size: min(calc(min(100vw, var(--wrap)) * 0.248 - var(--gutter) * 0.496), 34svh);
  margin-left: -0.04em;
}
.hero__intro {
  position: absolute;
  top: 0;
  right: 0;
  width: min(36%, 30rem);
  display: grid;
  gap: 1.25rem;
  justify-items: start;
}
.hero__kicker { color: var(--ink-dim); }
.hero__statement {
  font-size: clamp(1.375rem, 2.2vw, 2.25rem);
  line-height: 1.1;
  letter-spacing: -0.025em;
  font-weight: 500;
}
.hero__statement em {
  font-family: var(--font-serif);
  font-style: italic;
  font-weight: 400;
  letter-spacing: -0.01em;
  color: var(--accent-text);
}
.hero__cue { color: var(--ink); min-height: 44px; display: inline-flex; align-items: center; }
.hero__dot {
  display: inline-block;
  width: 0.14em;
  height: 0.14em;
  margin-left: 0.04em;
  border-radius: 50%;
  background: var(--accent);
}

.hero__spec {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: var(--gutter);
  margin: 0;
  padding-top: 1rem;
  border-top: 1px solid var(--line);
}
.hero__spec dt { color: var(--ink-dim); margin-bottom: 0.25rem; }
.hero__spec dd { margin: 0; color: var(--ink); font-variant-numeric: tabular-nums; }

/* hero entrance (hero.js adds .is-in once fonts are ready) */
[data-hero] {
  opacity: 0;
  transform: translateY(14px);
  transition: opacity 900ms var(--ease-out-expo) 450ms, transform 900ms var(--ease-out-expo) 450ms;
}
[data-hero].is-in { opacity: 1; transform: none; }
.no-js [data-hero] { opacity: 1; transform: none; }
.hero .mask .line { transition-duration: 1300ms; transition-timing-function: var(--ease-in-out); }

@media (max-width: 899px) {
  .hero { min-height: 88svh; }
  .hero__name-wrap { display: flex; flex-direction: column-reverse; gap: 2.5rem; }
  .hero__intro { position: static; width: auto; }
  .hero__spec { grid-template-columns: repeat(2, minmax(0, 1fr)); row-gap: 1.25rem; }
}
@media (prefers-reduced-motion: reduce) {
  [data-hero] { opacity: 1; transform: none; transition: none; }
}

/* record — four numbers set huge in the serif, hairline-ruled columns */
.record__lede { max-width: 22ch; margin-bottom: clamp(3.5rem, 8vw, 7rem); }
.record__lede em { color: var(--accent-text); }

.record__grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  border-top: 1px solid var(--line);
}
.record__item {
  display: grid;
  grid-template-rows: auto 1fr auto;
  gap: 1rem;
  padding: 1.5rem clamp(1rem, 2vw, 1.75rem) 0 0;
}
.record__item + .record__item {
  padding-left: clamp(1rem, 2vw, 1.75rem);
  border-left: 1px solid var(--line);
}
.record__num {
  font-family: var(--font-serif);
  font-size: clamp(4.5rem, 9.5vw, 9.5rem);
  line-height: 0.9;
  letter-spacing: -0.03em;
  font-variant-numeric: tabular-nums;
}
.record__body { max-width: 24ch; color: var(--ink); }
.record__meta { color: var(--ink-dim); }

@media (max-width: 899px) {
  .record__grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .record__item:nth-child(3) { border-left: 0; padding-left: 0; }
  .record__item:nth-child(n + 3) { border-top: 1px solid var(--line); margin-top: 2rem; }
}

/* about — editorial spread: portrait + facts (left) | statement, story, quote (right) */
.about__grid {
  display: grid;
  grid-template-columns: minmax(0, 4fr) minmax(0, 8fr);
  gap: clamp(2rem, 6vw, 6rem);
  align-items: start;
}
.about__side { display: grid; gap: 2.5rem; position: sticky; top: calc(var(--nav-h) + 1.5rem); }
.about__portrait { overflow: hidden; border-radius: 4px; max-width: 380px; }
.about__portrait img { width: 100%; height: auto; filter: grayscale(1) contrast(1.05); transition: filter 900ms var(--ease-out-expo), clip-path 1200ms var(--ease-in-out); }
.about__portrait:hover img { filter: none; }

.about__facts { display: grid; gap: 1.25rem; margin: 0; }
.about__fact { display: grid; grid-template-columns: 7rem 1fr; gap: 1rem; padding-top: 1.25rem; border-top: 1px solid var(--line); }
.about__fact dt { color: var(--ink-dim); padding-top: 0.2em; }
.about__fact dd { margin: 0; font-size: var(--text-small); }

.about__main { display: grid; gap: clamp(2.5rem, 5vw, 4rem); }
.about__statement { max-width: 18ch; }
.about__statement em { color: var(--accent-text); }
.about__story { display: grid; grid-template-columns: 1fr 1fr; gap: var(--gutter); }
.about__story p:not(.lead) { color: var(--ink-dim); }

.about__quote {
  position: relative;
  padding: clamp(1.5rem, 3vw, 2.5rem) 0 0 clamp(2.5rem, 5vw, 4.5rem);
  border-top: 1px solid var(--line);
}
.about__quote::before {
  content: "\201C";
  position: absolute;
  left: 0;
  top: 0.12em;
  font-family: var(--font-serif);
  font-size: clamp(4rem, 8vw, 7rem);
  line-height: 1;
  color: var(--accent);
}
.about__quote p {
  font-family: var(--font-serif);
  font-style: italic;
  font-size: clamp(1.75rem, 3.2vw, 2.75rem);
  line-height: 1.12;
  max-width: 26ch;
}

@media (max-width: 899px) {
  .about__grid { grid-template-columns: 1fr; }
  .about__side { position: static; grid-template-columns: minmax(0, 1fr); }
  .about__portrait { max-width: 260px; }
  .about__story { grid-template-columns: 1fr; }
}

/* stack — typographic ledger by layer */
.stack { padding-bottom: 0; }
.stack__head { color: var(--ink-dim); margin-bottom: 1.25rem; }
.stack__list { border-top: 1px solid var(--ink); }
.stack__row {
  display: grid;
  grid-template-columns: minmax(7rem, 2fr) minmax(0, 9fr) auto;
  gap: var(--gutter);
  align-items: baseline;
  padding-block: 1.1rem;
  border-bottom: 1px solid var(--line);
}
.stack__label, .stack__count { color: var(--ink-dim); }
.stack__items { font-size: clamp(1.25rem, 2.2vw, 2rem); letter-spacing: -0.025em; font-weight: 500; line-height: 1.25; }
.stack__slash { font-family: var(--font-serif); font-style: italic; font-weight: 400; color: var(--accent-text); margin-inline: 0.35em; }

@media (max-width: 899px) {
  .stack__row { grid-template-columns: 1fr auto; row-gap: 0.4rem; }
  .stack__items { grid-column: 1 / -1; grid-row: 2; }
}

/* experience — ledger rows: dates | role + company | what I did */
.xp__list { border-top: 1px solid var(--ink); }
.xp-row {
  display: grid;
  grid-template-columns: minmax(0, 3fr) minmax(0, 4fr) minmax(0, 5fr);
  gap: var(--gutter);
  padding-block: clamp(1.75rem, 3vw, 2.5rem);
  border-bottom: 1px solid var(--line);
}
.xp-row__dates { color: var(--ink-dim); padding-top: 0.5em; }
.is-current .xp-row__dates { color: var(--accent-text); }
.is-current .xp-row__dates::before {
  content: "";
  display: inline-block;
  width: 7px; height: 7px;
  margin-right: 0.6rem;
  border-radius: 50%;
  background: var(--accent);
  vertical-align: 0.1em;
  animation: pulse 2.4s var(--ease-out-expo) infinite;
}
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.25; } }
.xp-row__role { font-size: clamp(1.5rem, 2.6vw, 2.25rem); font-weight: 500; letter-spacing: -0.03em; line-height: 1.05; }
.xp-row__company { font-family: var(--font-serif); font-style: italic; font-size: clamp(1.25rem, 1.8vw, 1.625rem); color: var(--ink-dim); margin-top: 0.25rem; }
.xp-row__bullets { display: grid; gap: 0.7rem; color: var(--ink-dim); }
.xp-row__bullets li { position: relative; padding-left: 1.25rem; }
.xp-row__bullets li::before { content: "→"; position: absolute; left: 0; color: var(--accent-text); }
.xp-row--now .xp-row__role { font-family: var(--font-serif); font-style: italic; font-weight: 400; }

@media (max-width: 899px) {
  .xp-row { grid-template-columns: 1fr; gap: 0.75rem; }
  .xp-row__dates { padding-top: 0; }
}

/* work — chameleon chapters (each re-themes the page) + the full index */
.work { padding-bottom: 0; }
.work__lede { max-width: 24ch; margin-left: auto; margin-right: 0; }
.work__lede em { color: var(--accent-text); }

/* ── chapters ── */
.chapters { margin-top: clamp(4rem, 10vw, 9rem); }
.chapter {
  padding-block: clamp(4rem, 10vh, 7rem) clamp(5rem, 14vh, 10rem);
}
.chapter__inner {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  column-gap: var(--gutter);
  row-gap: clamp(2rem, 4vw, 3.5rem);
  align-items: start;
}
.chapter__head {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: 1fr auto;
  grid-template-areas: "meta meta" "title identity";
  align-items: end;
  column-gap: var(--gutter);
  row-gap: 1.25rem;
}
.chapter__meta { grid-area: meta; color: var(--ink-dim); display: flex; align-items: center; }
.chapter__sep { display: inline-block; width: 2.5rem; height: 1px; margin-inline: 0.9rem; background: var(--line); }
.chapter__title { grid-area: title; }
.chapter__identity {
  grid-area: identity;
  font-family: var(--font-serif);
  font-style: italic;
  font-size: clamp(1.5rem, 2.6vw, 2.5rem);
  line-height: 1;
  color: var(--accent);
  padding-bottom: 0.35em;
  text-align: right;
}

.chapter__media {
  grid-column: 1 / span 8;
  display: block;
  overflow: hidden;
  border-radius: 6px;
}
.chapter__media img {
  width: 100%;
  height: auto;
  border-radius: 6px;
  box-shadow: 0 30px 80px -30px rgb(0 0 0 / 0.45);
  transform: scale(1.06);
}
.chapter__media.is-in img { transform: scale(1); }
.chapter__media.is-in:hover img { transform: scale(1.02); }

.chapter__body {
  grid-column: 9 / -1;
  position: sticky;
  top: calc(var(--nav-h) + 2rem);
  display: grid;
  gap: 1.5rem;
  justify-items: start;
}
.chapter__points { display: grid; gap: 0.75rem; color: var(--ink-dim); font-size: var(--text-small); }
.chapter__points li { padding-left: 1.25rem; position: relative; }
.chapter__points li::before { content: "→"; position: absolute; left: 0; color: var(--accent); }
.chapter__stack { color: var(--ink-dim); padding-top: 1rem; border-top: 1px solid var(--line); width: 100%; }
.chapter__links { display: flex; flex-wrap: wrap; align-items: center; gap: 1.5rem; }

/* typographic tile for builds without screenshots */
.work-tile {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  aspect-ratio: 1440 / 900;
  background: var(--bg-raised);
  color: var(--accent);
}
.work-tile__mono {
  font-family: var(--font-serif);
  font-style: italic;
  font-size: clamp(4rem, 10vw, 8rem);
  line-height: 1;
}
.work-tile .mono { color: var(--ink-dim); }

/* ── index ── */
.ix { padding-block: var(--space-section); }
.ix__head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1.5rem;
  margin-bottom: clamp(2.5rem, 5vw, 4rem);
}
.ix__title sup { font-size: var(--text-mono); vertical-align: top; margin-left: 0.5rem; color: var(--accent-text); letter-spacing: 0.06em; }
.ix__note { max-width: 30ch; color: var(--ink-dim); }

.ix__list { border-top: 1px solid var(--ink); }
.ix-row {
  display: grid;
  grid-template-columns: 3.5rem minmax(0, 4fr) minmax(0, 3fr) minmax(0, 3fr) 5rem;
  align-items: baseline;
  gap: 1rem;
  padding-block: 1.1rem;
  border-bottom: 1px solid var(--line);
  transition: opacity 350ms var(--ease-out-expo), padding 450ms var(--ease-out-expo);
}
.ix-row__num, .ix-row__domain, .ix-row__year { color: var(--ink-dim); }
.ix-row__title { font-size: clamp(1.25rem, 2.1vw, 1.875rem); font-weight: 500; letter-spacing: -0.025em; line-height: 1.1; }
.ix-row__identity { font-family: var(--font-serif); font-style: italic; font-size: clamp(1.125rem, 1.6vw, 1.5rem); line-height: 1.1; color: var(--ink-dim); }
.ix-row__year { text-align: right; }

/* focus-dim: hovering one row quiets every other row */
@media (hover: hover) {
  .ix__list:hover .ix-row { opacity: 0.28; }
  .ix__list .ix-row:hover, .ix__list .ix-row:focus-visible { opacity: 1; padding-left: 1rem; }
  .ix-row:hover .ix-row__identity { color: var(--accent-text); }
}
.ix__foot { padding-top: clamp(2.5rem, 5vw, 4rem); }

/* cursor-following preview (index-preview.js) */
.ix-preview {
  position: fixed;
  left: 0;
  top: 0;
  z-index: 60;
  width: var(--preview-w);
  aspect-ratio: 1440 / 900;
  pointer-events: none;
  border-radius: 4px;
  overflow: hidden;
  opacity: 0;
  transform: translate3d(-50%, -50%, 0) scale(0.85);
  transition: opacity 300ms var(--ease-out-expo), scale 400ms var(--ease-out-expo);
  box-shadow: 0 20px 60px -20px rgb(0 0 0 / 0.5);
  background: var(--ink);
}
.ix-preview.is-on { opacity: 1; scale: 1.18; }
.ix-preview img { width: 100%; height: 100%; object-fit: cover; }

@media (max-width: 899px) {
  .chapter__head { grid-template-columns: 1fr; grid-template-areas: "meta" "title" "identity"; }
  .chapter__identity { text-align: left; }
  .chapter__meta { flex-wrap: wrap; gap: 0.25rem 0.9rem; }
  .chapter__sep { display: none; }
  .chapter__media, .chapter__body { grid-column: 1 / -1; }
  .chapter__body { position: static; }
  .work__lede { margin-left: 0; }
  .ix-row { grid-template-columns: 2.5rem minmax(0, 1fr) auto; row-gap: 0.25rem; }
  .ix-row__identity { grid-column: 2; grid-row: 2; }
  .ix-row__domain { display: none; }
  .ix-row__year { grid-column: 3; grid-row: 1; }
  .ix-preview { display: none; }
}

/* projects page — a wall of covers, each in its own palette; and case studies */

/* anything that sets --bg/--ink/--accent locally must re-derive the mixes,
   because color-mix() resolves where it is declared (on :root) */
.cover, .case__next {
  --ink-dim: color-mix(in oklab, var(--ink) 68%, var(--bg));
  --line: color-mix(in oklab, var(--ink) 18%, var(--bg));
  background: var(--bg);
  color: var(--ink);
}

/* ── header ── */
.pg-hero { padding-top: calc(var(--nav-h) + clamp(2rem, 6vh, 4rem)); display: grid; gap: clamp(1.5rem, 3vw, 2.5rem); }
.pg-hero__kicker, .case__kicker { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 1rem; color: var(--ink-dim); }
.pg-hero__kicker a, .case__kicker a { color: var(--ink); min-height: 44px; display: inline-flex; align-items: center; }
.pg-hero__title sup { font-size: var(--text-mono); vertical-align: top; margin-left: 0.75rem; color: var(--accent-text); letter-spacing: 0.06em; }
.pg-hero__lede { max-width: 22ch; margin-left: auto; }
.pg-hero__lede em { color: var(--accent-text); }

/* ── filter bar ── */
.pg-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-block: clamp(3rem, 6vw, 5rem) clamp(1.5rem, 3vw, 2.5rem);
  padding-block: 1rem;
  border-block: 1px solid var(--line);
}
.pg-chips { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.pg-chip {
  font-family: var(--font-mono);
  font-size: var(--text-mono);
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  min-height: 40px;
  display: inline-flex;
  align-items: center;
  padding: 0.4rem 0.95rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--ink-dim);
  transition: color var(--dur-fast) var(--ease-out-expo), border-color var(--dur-fast) var(--ease-out-expo), background-color var(--dur-fast) var(--ease-out-expo);
}
.pg-chip:hover { color: var(--ink); border-color: var(--ink); }
.pg-chip[aria-pressed="true"] { color: var(--bg); background: var(--ink); border-color: var(--ink); }
.pg-chip__count { opacity: 0.6; margin-left: 0.5rem; }
.pg-counter { color: var(--ink-dim); }
.pg-counter b { color: var(--ink); font-weight: inherit; }
.pg-empty { padding: 4rem 0; color: var(--ink-dim); }

/* ── covers ── */
.pg-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: clamp(0.75rem, 1.5vw, 1.25rem);
  padding-bottom: var(--space-section);
}
.cover { border-radius: 8px; overflow: hidden; }
.cover[hidden] { display: none; }
.cover__link {
  display: grid;
  gap: 1.25rem;
  height: 100%;
  padding: clamp(1.25rem, 2.2vw, 2rem);
}
.cover__meta { display: flex; gap: 1.25rem; color: var(--ink-dim); }
.cover__meta span:last-child { margin-left: auto; }
.cover__media { overflow: hidden; border-radius: 4px; }
.cover__media img { width: 100%; height: auto; transition: transform 900ms var(--ease-out-expo); }
.cover__link:hover .cover__media img { transform: scale(1.035); }
.cover__text { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 0.25rem 1rem; }
.cover__title { font-size: clamp(1.75rem, 3vw, 2.75rem); font-weight: 500; letter-spacing: -0.035em; line-height: 1; }
.cover__identity { font-family: var(--font-serif); font-style: italic; font-size: clamp(1.25rem, 1.8vw, 1.625rem); color: var(--accent); }
.cover__tagline { color: var(--ink-dim); max-width: 48ch; }
.cover__stack { display: flex; justify-content: space-between; gap: 1rem; padding-top: 1rem; border-top: 1px solid var(--line); color: var(--ink-dim); }
.cover__go { color: var(--accent); transition: transform var(--dur-fast) var(--ease-out-expo); }
.cover__link:hover .cover__go { transform: translateX(6px); }

/* ── case study ── */
.case__head { display: grid; gap: clamp(1.25rem, 2.5vw, 2rem); padding-top: calc(var(--nav-h) + clamp(2rem, 6vh, 4rem)); }
.case__intro { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: end; gap: 1.5rem var(--gutter); }
.case__identity { font-family: var(--font-serif); font-style: italic; font-size: clamp(1.75rem, 3.4vw, 3rem); line-height: 1; color: var(--accent); }
.case__tagline { max-width: 34ch; }
.case__hero { margin-block: clamp(2.5rem, 5vw, 4rem); border-radius: 6px; overflow: hidden; }
.case__hero img, .case__shot img { width: 100%; height: auto; }

.case__grid {
  display: grid;
  grid-template-columns: minmax(0, 7fr) minmax(0, 5fr);
  gap: clamp(2rem, 6vw, 6rem);
  align-items: start;
  padding-block: clamp(1rem, 3vw, 2rem) clamp(3rem, 7vw, 6rem);
}
.case__label { color: var(--ink-dim); margin-bottom: 1.5rem; }
.case__points { display: grid; gap: 1.5rem; }
.case__points li {
  font-size: var(--text-lead);
  line-height: 1.4;
  letter-spacing: -0.01em;
  padding-top: 1.5rem;
  border-top: 1px solid var(--line);
}
.case__aside { position: sticky; top: calc(var(--nav-h) + 1.5rem); }
.case__facts { display: grid; gap: 1.25rem; margin: 0; }
.case__facts > div { display: grid; grid-template-columns: 6.5rem 1fr; gap: 1rem; padding-top: 1rem; border-top: 1px solid var(--line); }
.case__facts dt { color: var(--ink-dim); padding-top: 0.2em; }
.case__facts dd { margin: 0; }
.case__cta { padding-top: 2rem; }

.case__gallery {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--gutter);
  align-items: start;
  padding-bottom: var(--space-section);
}
.case__shot { border-radius: 6px; overflow: hidden; }
.case__shot--offset { margin-top: clamp(3rem, 10vw, 9rem); }

.case__next { display: block; padding-block: clamp(4rem, 10vw, 8rem); border-top: 1px solid var(--line); }
.case__next-inner { display: grid; gap: 1rem; }
.case__next .mono { color: var(--ink-dim); }
.case__next-title { transition: transform 600ms var(--ease-out-expo); }
.case__next:hover .case__next-title { transform: translateX(1.5rem); }
.case__next-identity { font-family: var(--font-serif); font-style: italic; font-size: clamp(1.5rem, 2.6vw, 2.25rem); color: var(--accent); }

@media (max-width: 899px) {
  .pg-grid { grid-template-columns: 1fr; }
  .pg-hero__lede { margin-left: 0; }
  .case__grid { grid-template-columns: 1fr; }
  .case__aside { position: static; }
  .case__gallery { grid-template-columns: 1fr; }
  .case__shot--offset { margin-top: 0; }
}

/* contact — first half of the ink slab */
.contact { padding-bottom: clamp(4rem, 8vw, 7rem); }
.contact__grid {
  display: grid;
  grid-template-columns: minmax(0, 7fr) minmax(0, 5fr);
  gap: var(--gutter);
  align-items: end;
}
.contact__title em { color: var(--accent); }
.contact__side { display: grid; gap: 2rem; justify-items: start; }
.contact__note { color: var(--ink-dim); max-width: 40ch; }
.contact__email {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  font-size: clamp(1.5rem, 2.8vw, 2.5rem);
  font-weight: 500;
  letter-spacing: -0.03em;
}
.contact__email .ulink { padding-bottom: 4px; background-size: 100% 1px; background-position-x: left; }
.contact__email:hover .ulink { background-size: 0 1px; background-position-x: right; }
.contact__email .icon { width: 0.8em; height: 0.8em; color: var(--accent); transition: transform var(--dur-fast) var(--ease-out-expo); }
.contact__email:hover .icon { transform: translateX(6px) rotate(-45deg); }
.contact__links { display: flex; flex-wrap: wrap; gap: 0.75rem 1.75rem; }
.contact__links a { min-height: 44px; display: inline-flex; align-items: center; }

@media (max-width: 899px) {
  .contact__grid { grid-template-columns: 1fr; gap: 3rem; }
}

/* footer — second half of the ink slab: the name, edge to edge */
.footer { padding-top: clamp(2rem, 5vw, 4rem); overflow: hidden; }
.footer__mark {
  /* "Mitva Virvadiya" + dot ≈ 6.35em wide at -0.06em tracking → 1/6.35 ≈ 0.157 */
  font-size: calc(min(100vw, var(--wrap)) * 0.153 - var(--gutter) * 0.306);
  font-weight: 500;
  letter-spacing: -0.06em;
  line-height: 0.8;
  white-space: nowrap;
  margin-left: -0.04em;
  padding-bottom: 0.08em;
}
.footer__dot {
  display: inline-block;
  width: 0.13em;
  height: 0.13em;
  margin-left: 0.04em;
  border-radius: 50%;
  background: var(--accent);
}
.footer__row {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.75rem 2rem;
  padding-block: 1.5rem 2rem;
  margin-top: clamp(1.5rem, 3vw, 2.5rem);
  border-top: 1px solid var(--line);
  color: var(--ink-dim);
}
.footer__row #clock-footer { font-variant-numeric: tabular-nums; }
.footer__top { color: var(--ink); }

/* loader — a 1.6s intro on the first homepage visit per session.
   Name rises, a serif counter runs to 100, then the sheet lifts away and the
   hero's own name rises underneath — one continuous move, not a wait screen. */
.loader {
  position: fixed;
  inset: 0;
  z-index: 300;
  display: grid;
  grid-template-rows: auto 1fr auto;
  padding: calc(var(--gutter) * 0.9) var(--gutter);
  background: var(--slab-bg);
  color: var(--slab-ink);
  clip-path: inset(0 0 0 0);
  transition: clip-path 1000ms var(--ease-in-out);
}
.loader.is-done { clip-path: inset(0 0 100% 0); pointer-events: none; }
.no-js .loader, .intro-seen .loader { display: none; }

.loader__top { display: flex; justify-content: space-between; opacity: 0.6; }
.loader__name {
  align-self: center;
  font-size: clamp(2.75rem, 9vw, 9rem);
  font-weight: 500;
  letter-spacing: -0.05em;
  line-height: 0.95;
}
.loader__name em { font-family: var(--font-serif); font-style: italic; font-weight: 400; letter-spacing: -0.02em; color: var(--signal-500); }
.loader__mask { display: inline-block; overflow: hidden; vertical-align: bottom; padding-bottom: 0.08em; }
.loader__mask > * { display: inline-block; transform: translateY(105%); animation: loader-rise 900ms var(--ease-out-expo) forwards; }
.loader__mask + .loader__mask > * { animation-delay: 120ms; }
@keyframes loader-rise { to { transform: none; } }

.loader__bottom { display: flex; justify-content: space-between; align-items: flex-end; gap: 1rem; padding-bottom: 1rem; }
.loader__label { opacity: 0.6; font-variant-numeric: tabular-nums; }
.loader__pct {
  font-family: var(--font-serif);
  font-size: clamp(4rem, 12vw, 11rem);
  line-height: 0.8;
  font-variant-numeric: tabular-nums;
}
.loader__pct sup { font-size: 0.35em; vertical-align: top; margin-left: 0.05em; color: var(--signal-500); }
.loader__bar { height: 1px; background: rgb(255 255 255 / 0.15); }
.loader__bar i { display: block; height: 100%; background: var(--signal-500); transform: scaleX(var(--p, 0)); transform-origin: left; }

/* content inside the sheet fades a beat before it lifts */
.loader.is-done > * { opacity: 0; transition: opacity 400ms var(--ease-out-expo); }
