/* ==========================================================================
   Harshiv Sharma — portfolio
   1 Tokens  2 Base  3 Type  4 Layout  5 Header  6 Buttons  7 Hero  8 Project rows  9 Blocks
   10 Case study  11 Lightbox  12 Footer  13 Motion  14 Scroll story  15 Intro
   ========================================================================== */

/* ---------- Fonts (local files) ---------- */
@font-face { font-family: "Geist"; font-weight: 100 900; font-display: swap; src: url("../fonts/Geist-Variable.woff2") format("woff2"); }
@font-face { font-family: "IBM Plex Mono"; font-weight: 500; font-display: swap; src: url("../fonts/ibm-plex-mono-500.woff2") format("woff2"); }

/* ---------- 1 Tokens ---------- */
:root {
  /* colour — dark: warm ink, paper type, one vermilion accent */
  --bg: #0f0e0c;
  --surface: #171613;
  --raised: #201e1a;
  --mat: #1b1a16;
  --ink: #f3efe6;
  --muted: #a9a396;
  --accent: #ff6a3d;
  --accent-hover: #ff8259;
  --accent-active: #f2572a;
  --accent-soft: rgba(255, 106, 61, .13);
  --on-accent: #1a0d07;
  --line: rgba(243, 239, 230, .10);
  --line-strong: rgba(243, 239, 230, .22);
  --focus: #ffb199;
  --glass: rgba(15, 14, 12, .80);
  --success: #6fcf97;
  --warning: #e9b44c;
  --error: #ff8a8a;
  --disabled: #5f5b52;
  --depth: #f3efe6;
  --shadow-1: 0 1px 2px rgba(0, 0, 0, .4), 0 8px 24px -12px rgba(0, 0, 0, .6);
  --shadow-2: 0 2px 4px rgba(0, 0, 0, .4), 0 32px 64px -28px rgba(0, 0, 0, .8);

  /* type */
  --font-display: "Geist", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-body: "Geist", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  --font-mono: "IBM Plex Mono", ui-monospace, Consolas, Menlo, monospace;
  --fs-hero: clamp(2.5rem, 1.1rem + 4.9vw, 5rem);
  --fs-h1: clamp(2.25rem, 1.3rem + 3.8vw, 4.25rem);
  --fs-h2: clamp(1.75rem, 1.25rem + 2.1vw, 3rem);
  --fs-h3: clamp(1.25rem, 1.1rem + .7vw, 1.75rem);
  --fs-h4: 1.125rem;
  --fs-lead: clamp(1.125rem, 1.02rem + .5vw, 1.375rem);
  --fs-body: 1.0625rem;
  --fs-small: .875rem;
  --fs-label: .75rem;

  /* space: 4 8 12 16 24 32 48 64 96 128 */
  --s1: 4px; --s2: 8px; --s3: 12px; --s4: 16px; --s5: 24px;
  --s6: 32px; --s7: 48px; --s8: 64px; --s9: 96px; --s10: 128px;
  --pad: clamp(20px, 5vw, 64px);
  --max: 1200px;
  --measure: 62ch;
  --section: clamp(72px, 10vw, 144px);
  --header: 68px;

  /* shape, motion, layers */
  --r-s: 8px; --r-m: 14px; --r-l: 22px; --r-pill: 999px;
  --t-fast: 160ms; --t-med: 280ms; --t-slow: 560ms;
  --ease: cubic-bezier(.2, .7, .2, 1);
  --ease-spring: cubic-bezier(.3, 1.4, .5, 1);
  --z-header: 50; --z-menu: 40; --z-dialog: 80;
}
[data-theme="light"] {
  /* colour — light: paper, ink and rust, the palette of the Figma portfolio */
  --bg: #faf8f4;
  --surface: #ffffff;
  --raised: #f1ede5;
  --mat: #ece7dd;
  --ink: #161513;
  --muted: #5f5a50;
  --accent: #c2380f;
  --accent-hover: #a82f0b;
  --accent-active: #8f2708;
  --accent-soft: #f6e4dc;
  --on-accent: #ffffff;
  --line: rgba(22, 21, 19, .12);
  --line-strong: rgba(22, 21, 19, .26);
  --focus: #c2380f;
  --glass: rgba(250, 248, 244, .84);
  --success: #0e7c62;
  --warning: #8a5a00;
  --error: #b3261e;
  --disabled: #a8a39a;
  --depth: #161513;
  --shadow-1: 0 1px 2px rgba(22, 21, 19, .06), 0 8px 24px -12px rgba(22, 21, 19, .18);
  --shadow-2: 0 2px 4px rgba(22, 21, 19, .06), 0 32px 64px -28px rgba(22, 21, 19, .32);
}

/* ---------- 2 Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; scroll-padding-top: calc(var(--header) + 72px); }
body {
  margin: 0; min-height: 100vh;
  background: var(--bg); color: var(--ink);
  font: 400 var(--fs-body)/1.6 var(--font-body);
  -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
  overflow-x: clip;
  transition: background-color var(--t-med) ease, color var(--t-med) ease;
}
html.menu-open, html.dialog-open { overflow: hidden; }
img, svg { display: block; max-width: 100%; }
img { height: auto; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
h1, h2, h3, h4, p, ul, ol, dl, dd, figure, blockquote { margin: 0; }
ul, ol { padding: 0; list-style: none; }
::selection { background: var(--accent); color: var(--on-accent); }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 3px; border-radius: 4px; }
[tabindex="-1"]:focus { outline: none; }
.sr-only { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.skip { position: fixed; top: 10px; left: 10px; z-index: 100; padding: 12px 18px; border-radius: var(--r-s); background: var(--accent); color: var(--on-accent); font-weight: 600; transform: translateY(-200%); }
.skip:focus { transform: none; }

/* ---------- 3 Type ---------- */
.display, h1, h2, h3 { font-family: var(--font-display); font-weight: 640; text-wrap: balance; }
.t-hero { font-size: var(--fs-hero); line-height: 1; letter-spacing: -.052em; }
.t-h1 { font-size: var(--fs-h1); line-height: 1.03; letter-spacing: -.046em; }
.t-h2 { font-size: var(--fs-h2); line-height: 1.08; letter-spacing: -.04em; }
.t-h3 { font-size: var(--fs-h3); line-height: 1.18; letter-spacing: -.025em; }
.t-h4 { font: 600 var(--fs-h4)/1.35 var(--font-body); letter-spacing: -.005em; }
.lead { font-size: var(--fs-lead); line-height: 1.5; color: var(--muted); max-width: 46ch; text-wrap: pretty; }
.small { font-size: var(--fs-small); line-height: 1.5; }
.muted { color: var(--muted); }
.accent { color: var(--accent); }
.label { font: 500 var(--fs-label)/1.4 var(--font-mono); letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.label--accent { color: var(--accent); }
.prose { max-width: var(--measure); display: grid; gap: var(--s4); }
.prose p { color: var(--muted); text-wrap: pretty; }
.prose strong { color: var(--ink); font-weight: 600; }
.link { color: var(--ink); background: linear-gradient(var(--accent), var(--accent)) 0 100% / 100% 1px no-repeat; padding-bottom: 2px; transition: background-size var(--t-med) var(--ease), color var(--t-fast) ease; }
.link:hover { color: var(--accent); background-size: 100% 2px; }

/* ---------- 4 Layout ---------- */
.wrap { width: min(100% - 2 * var(--pad), var(--max)); margin-inline: auto; }
.section { padding-block: var(--section); }
.section--tight { padding-block: calc(var(--section) * .6); }
.section + .section { border-top: 1px solid var(--line); }
.head { display: grid; gap: var(--s4); margin-bottom: clamp(32px, 5vw, 64px); }
.head--row { grid-template-columns: 1fr auto; align-items: end; }
.head > .link { justify-self: start; display: inline-flex; align-items: center; min-height: 44px; background-position: 0 calc(100% - 9px); }
.stack { display: grid; gap: var(--s4); }
.stack--l { gap: var(--s6); }
.page-top { padding-top: calc(var(--header) + clamp(48px, 8vw, 112px)); padding-bottom: clamp(40px, 6vw, 80px); }
.page-top .lead { margin-top: var(--s5); max-width: 54ch; }
.page-top .label { margin-bottom: var(--s4); }

/* ---------- 5 Header ---------- */
.header { position: fixed; inset: 0 0 auto 0; z-index: var(--z-header); height: var(--header); border-bottom: 1px solid transparent; transition: background-color var(--t-med) ease, border-color var(--t-med) ease; }
.header.is-scrolled, .menu-open .header { background: var(--glass); border-bottom-color: var(--line); -webkit-backdrop-filter: blur(14px) saturate(1.3); backdrop-filter: blur(14px) saturate(1.3); }
.header__in { height: 100%; display: flex; align-items: center; justify-content: space-between; gap: var(--s5); }
.logo { display: inline-flex; align-items: center; gap: 12px; min-height: 44px; }
.logo__mark { flex: none; width: 34px; height: 34px; transition: transform var(--t-slow) var(--ease-spring); }
.logo:hover .logo__mark { transform: rotate(-8deg) scale(1.05); }
.logo__name { font: 700 1.0625rem/1 var(--font-display); letter-spacing: -.03em; white-space: nowrap; }
.logo__name b { font-weight: 700; color: var(--accent); }
.logo__role { display: block; margin-top: 6px; font: 500 .625rem/1 var(--font-mono); letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.header .logo__role { display: none; }
.nav { display: flex; align-items: center; gap: 2px; }
.nav a { position: relative; padding: 10px 14px; font: 500 .9375rem/1 var(--font-body); color: var(--muted); border-radius: var(--r-s); transition: color var(--t-fast) ease; }
.nav a::after { content: ""; position: absolute; left: 14px; right: 14px; bottom: 3px; height: 1.5px; background: var(--accent); transform: scaleX(0); transform-origin: left; transition: transform var(--t-med) var(--ease); }
.nav a:hover, .nav a[aria-current] { color: var(--ink); }
.nav a:hover::after, .nav a[aria-current]::after { transform: scaleX(1); }
.header__tools { display: flex; align-items: center; gap: var(--s2); }
.icon-btn { width: 44px; height: 44px; display: grid; place-items: center; border-radius: var(--r-s); border: 1px solid var(--line); transition: border-color var(--t-fast) ease, background-color var(--t-fast) ease; }
.icon-btn:hover { border-color: var(--line-strong); background: var(--accent-soft); }
.icon-btn svg { width: 18px; height: 18px; }
.theme .i-sun, [data-theme="light"] .theme .i-moon { display: none; }
[data-theme="light"] .theme .i-sun { display: block; }
.burger { display: none; position: relative; }
.burger span { position: absolute; left: 12px; right: 12px; height: 1.5px; background: currentColor; transition: transform var(--t-med) var(--ease), opacity var(--t-fast) ease; }
.burger span:nth-child(1) { transform: translateY(-5px); }
.burger span:nth-child(3) { transform: translateY(5px); }
.burger[aria-expanded="true"] span:nth-child(1) { transform: rotate(45deg); }
.burger[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.burger[aria-expanded="true"] span:nth-child(3) { transform: rotate(-45deg); }
.menu { position: fixed; inset: 0; z-index: var(--z-menu); padding: calc(var(--header) + 32px) var(--pad) 32px; background: var(--bg); display: flex; flex-direction: column; justify-content: space-between; gap: var(--s6); overflow-y: auto; opacity: 0; transform: translateY(-8px); transition: opacity var(--t-med) ease, transform var(--t-med) var(--ease); }
.menu[hidden] { display: none; }
.menu.is-open { opacity: 1; transform: none; }
.menu ol { display: grid; counter-reset: m; }
.menu li { border-bottom: 1px solid var(--line); }
.menu li a { display: flex; align-items: baseline; gap: var(--s4); padding: 18px 0; font: 700 clamp(1.75rem, 8vw, 2.5rem)/1.1 var(--font-display); letter-spacing: -.035em; }
.menu li a::before { counter-increment: m; content: "0" counter(m); font: 500 var(--fs-label)/1 var(--font-mono); letter-spacing: .08em; color: var(--muted); }
.menu li a[aria-current] { color: var(--accent); }
.menu__foot { display: grid; gap: var(--s2); }

/* ---------- 6 Buttons, tags ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 10px; min-height: 50px; padding: 0 22px; border-radius: var(--r-s); border: 1px solid transparent; font: 600 .9375rem/1 var(--font-body); white-space: nowrap; transition: background-color var(--t-fast) ease, border-color var(--t-fast) ease, color var(--t-fast) ease, transform var(--t-med) var(--ease); }
.btn svg { width: 18px; height: 18px; transition: transform var(--t-med) var(--ease); }
.btn:hover svg { transform: translateX(3px); }
.btn:active { transform: translateY(1px); }
.btn--primary { background: var(--accent); color: var(--on-accent); }
.btn--primary:hover { background: var(--accent-hover); }
.btn--primary:active { background: var(--accent-active); }
.btn--ghost { border-color: var(--line-strong); }
.btn--ghost:hover { border-color: var(--ink); }
.btn-row { display: flex; flex-wrap: wrap; gap: var(--s3); }

/* ---------- 7 Hero: real work layered in depth around the letters UX/UI ---------- */
.hero { position: relative; padding-top: calc(var(--header) + clamp(32px, 6vw, 88px)); padding-bottom: clamp(56px, 8vw, 112px); overflow: clip; }
.hero__grid { display: grid; grid-template-columns: minmax(0, 1.08fr) minmax(0, 1fr); gap: clamp(24px, 4vw, 64px); align-items: center; }
.hero__copy { display: grid; gap: var(--s5); justify-items: start; }
.hero__copy .lead { max-width: 42ch; }
.hero__facts { display: flex; flex-wrap: wrap; gap: 6px 18px; padding-top: var(--s4); border-top: 1px solid var(--line); width: 100%; }
.hero__facts li { display: flex; align-items: center; gap: 8px; }
.hero__facts li::before { content: ""; width: 5px; height: 5px; border-radius: 50%; background: var(--accent); }

/* The stack is one 3D group. Depth order, back to front: slide, letters, poster, phone. */
.stage { position: relative; aspect-ratio: 1 / 1.02; perspective: 1400px; perspective-origin: 50% 36%; }
.stack3d { --rx: 0deg; --ry: 0deg; --flat: 0; position: absolute; inset: 0; transform-style: preserve-3d; transform: translateZ(calc(var(--flat) * -520px)) rotateX(calc((7deg + var(--rx)) * (1 - var(--flat)))) rotateY(calc((-18deg + var(--ry)) * (1 - var(--flat)))); will-change: transform; }
.stack3d > * { opacity: calc(1 - var(--flat) * .85); }
.stage__floor { position: absolute; left: -45%; right: -45%; bottom: -5%; height: 130%; transform-origin: 50% 100%; transform: rotateX(80deg); background-image: linear-gradient(var(--line-strong) 1px, transparent 1px), linear-gradient(90deg, var(--line-strong) 1px, transparent 1px); background-size: 64px 64px; -webkit-mask-image: radial-gradient(58% 80% at 50% 100%, #000 0%, transparent 100%); mask-image: radial-gradient(58% 80% at 50% 100%, #000 0%, transparent 100%); pointer-events: none; }
.depth-type { position: absolute; left: -3%; top: 18%; font: 700 clamp(7.5rem, 16vw, 14.5rem)/.8 var(--font-display); letter-spacing: -.07em; color: var(--depth); white-space: nowrap; transform: translateZ(-46px); pointer-events: none; -webkit-user-select: none; user-select: none; }
.ply { position: absolute; margin: 0; border-radius: var(--r-m); overflow: hidden; background: var(--surface); border: 1px solid var(--line-strong); box-shadow: var(--shadow-2); }
.ply img { width: 100%; height: 100%; object-fit: cover; }
.ply::after { content: ""; position: absolute; inset: 0; pointer-events: none; background: linear-gradient(115deg, rgba(255, 255, 255, .2) 0%, transparent 34%, transparent 70%, rgba(0, 0, 0, .14) 100%); opacity: calc(.4 + var(--sheen, 0) * .5); }
.ply--slide { left: 16%; top: 1%; width: 84%; aspect-ratio: 16 / 9; transform: translateZ(-170px); }
.ply--slide::before { content: ""; position: absolute; inset: 0; z-index: 1; background: var(--bg); opacity: .5; }   /* the back layer sits in shadow so the letters read */
.ply--slide .ply__tag { left: auto; right: 10px; bottom: auto; top: 10px; z-index: 2; }
.ply--poster { left: 0; top: 45%; width: 55%; aspect-ratio: 1085 / 1118; transform: translateZ(70px); }
.ply--phone { right: 1%; top: 39%; width: 24%; aspect-ratio: 390 / 844; border-radius: 22px; border-width: 5px; border-color: #26231d; transform: translateZ(190px); }
.ply__tag { position: absolute; left: 10px; bottom: 10px; z-index: 1; padding: 6px 10px; border-radius: var(--r-pill); background: rgba(15, 14, 12, .8); color: #f3efe6; font: 500 .625rem/1 var(--font-mono); letter-spacing: .08em; text-transform: uppercase; }
@keyframes drift { 0%, 100% { translate: 0 0; } 50% { translate: 0 -10px; } }
.ply--poster { animation: drift 9s ease-in-out infinite; }
.ply--slide { animation: drift 11s ease-in-out -3s infinite; }
.ply--phone { animation: drift 8s ease-in-out -5s infinite; }

/* ---------- 8 Project rows ---------- */
.projects { display: grid; gap: clamp(56px, 8vw, 112px); }
.proj { position: relative; display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: clamp(20px, 3vw, 48px); align-items: center; }
.proj[hidden] { display: none; }
.proj__media { grid-column: 1 / span 7; }
.proj__body { grid-column: 8 / -1; display: grid; gap: var(--s4); justify-items: start; }
.proj:nth-child(even) .proj__media { grid-column: 6 / -1; order: 2; }
.proj:nth-child(even) .proj__body { grid-column: 1 / span 5; }
.proj__num { display: flex; align-items: center; gap: var(--s3); }
.proj__num::after { content: ""; width: 32px; height: 1px; background: var(--line-strong); }
.proj__title a::after { content: ""; position: absolute; inset: 0; z-index: 1; }
.proj__title a:focus-visible { outline: none; }
.proj:has(.proj__title a:focus-visible) .frame { outline: 2px solid var(--focus); outline-offset: 4px; }
.proj__more { display: inline-flex; align-items: center; gap: 8px; font: 600 .9375rem/1 var(--font-body); color: var(--accent); }
.proj__more svg { width: 18px; height: 18px; transition: transform var(--t-med) var(--ease); }
.proj:hover .proj__more svg { transform: translateX(4px); }
.frame { display: grid; place-items: center; aspect-ratio: 16 / 10.4; padding: clamp(14px, 2.4vw, 36px); border-radius: var(--r-l); background: var(--mat); border: 1px solid var(--line); overflow: hidden; perspective: 1200px; }
.frame img { max-height: 100%; width: auto; border-radius: var(--r-s); box-shadow: var(--shadow-2); transition: transform var(--t-slow) var(--ease); }
.proj:hover .frame img { transform: translateY(-6px) rotateX(2deg) scale(1.015); }
.frame--trust { background: #dff3e6; }
.frame--care { background: #d9e9e4; }
.frame--rail { background: #1b2a4a; }
.proj .frame--rail { padding: 0; }
.proj .frame--rail img { width: 100%; height: 100%; max-height: none; object-fit: cover; object-position: 50% 0; border-radius: 0; box-shadow: none; }
.cs-cover .frame--rail img { max-width: min(100%, 620px); }
.frame--truth { background: #e8e2fb; }
.frame--taj { background: #e7ddd0; }
.proj .frame--taj { padding: 0; }
.proj .frame--taj img { width: 100%; height: 100%; max-height: none; object-fit: cover; border-radius: 0; box-shadow: none; }
.facts { display: grid; grid-template-columns: auto 1fr; gap: 6px var(--s4); width: 100%; padding-top: var(--s4); border-top: 1px solid var(--line); }
.facts dt { font: 500 var(--fs-label)/1.7 var(--font-mono); letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.facts dd { font-size: var(--fs-small); line-height: 1.5; }

/* ---------- 9 Blocks ---------- */
.cols { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: clamp(20px, 3vw, 40px); }
.note { display: grid; gap: var(--s3); align-content: start; padding-top: var(--s5); border-top: 1px solid var(--line-strong); }
.note p { color: var(--muted); }
.note .label { color: var(--accent); }
.split { display: grid; grid-template-columns: minmax(0, 4fr) minmax(0, 8fr); gap: clamp(24px, 5vw, 80px); align-items: start; }
.rows { display: grid; }
.rows > li, .rows > div { display: grid; grid-template-columns: minmax(0, 3fr) minmax(0, 7fr); gap: var(--s5); padding: var(--s5) 0; border-top: 1px solid var(--line); }
.rows > :last-child { border-bottom: 1px solid var(--line); }
.rows p { color: var(--muted); }
.rows--wide > li { grid-template-columns: minmax(0, 4fr) minmax(0, 8fr); }
.proof { font-size: var(--fs-small); }
.mt-7 { margin-top: var(--s7); }
.d0 { --d: 0; } .d1 { --d: 1; } .d2 { --d: 2; } .d3 { --d: 3; } .d4 { --d: 4; }
.cta { display: grid; gap: var(--s6); justify-items: start; }
.cta .t-h1 { max-width: 16ch; }
.mail { display: inline-flex; align-items: center; gap: var(--s4); min-height: 44px; font: 700 clamp(1.25rem, .8rem + 2.4vw, 2.5rem)/1.15 var(--font-display); letter-spacing: -.03em; overflow-wrap: anywhere; background: linear-gradient(var(--accent), var(--accent)) 0 100% / 100% 2px no-repeat; padding-bottom: 6px; transition: color var(--t-fast) ease; }
.mail:hover { color: var(--accent); }
.status { display: inline-flex; align-items: center; gap: 10px; }
.status::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--success); box-shadow: 0 0 0 4px color-mix(in srgb, var(--success) 22%, transparent); }

/* ---------- 10 Case study ---------- */
.back { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; font: 500 var(--fs-small)/1 var(--font-body); color: var(--muted); transition: color var(--t-fast) ease; }
.back:hover { color: var(--ink); }
.back svg { width: 16px; height: 16px; transform: rotate(180deg); }
.cs-meta { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--s5); margin-top: clamp(32px, 5vw, 56px); padding-top: var(--s5); border-top: 1px solid var(--line-strong); }
.cs-meta dt { margin-bottom: 6px; }
.cs-meta dd { font-size: .9375rem; line-height: 1.5; }
.cs-cover { margin-top: clamp(32px, 5vw, 64px); }
.cs-cover .frame { aspect-ratio: auto; padding: clamp(14px, 4vw, 56px); }
.cs-cover .frame img { max-height: 76vh; }
.cs-nav { position: sticky; top: var(--header); z-index: 10; background: var(--glass); -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px); border-block: 1px solid var(--line); }
.cs-nav ul { display: flex; gap: 4px; overflow-x: auto; scrollbar-width: none; padding-block: 8px; }
.cs-nav ul::-webkit-scrollbar { display: none; }
.cs-nav a { display: inline-flex; align-items: center; min-height: 40px; padding: 0 14px; border-radius: var(--r-pill); font: 500 .875rem/1 var(--font-body); color: var(--muted); white-space: nowrap; transition: color var(--t-fast) ease, background-color var(--t-fast) ease; }
.cs-nav a:hover { color: var(--ink); }
.cs-nav a.is-on { background: var(--accent-soft); color: var(--accent); }
.cs-sec { display: grid; grid-template-columns: minmax(0, 3fr) minmax(0, 9fr); gap: clamp(20px, 4vw, 64px); padding-block: clamp(56px, 8vw, 104px); border-top: 1px solid var(--line); }
.cs-sec:first-of-type { border-top: 0; }
.cs-sec__side { display: grid; gap: var(--s3); align-content: start; position: sticky; top: calc(var(--header) + 80px); align-self: start; }
.cs-sec__main { display: grid; gap: clamp(24px, 3.4vw, 48px); min-width: 0; }
.fig { display: grid; gap: var(--s3); }
.fig__btn { display: block; width: 100%; border-radius: var(--r-m); overflow: hidden; border: 1px solid var(--line); background: var(--mat); cursor: zoom-in; transition: border-color var(--t-fast) ease; }
.fig__btn:hover { border-color: var(--line-strong); }
.fig__btn img { width: 100%; }
.fig figcaption { font-size: var(--fs-small); line-height: 1.5; color: var(--muted); max-width: 70ch; }
.fig figcaption b { font: 500 var(--fs-label)/1 var(--font-mono); letter-spacing: .08em; text-transform: uppercase; color: var(--ink); margin-right: 8px; }
.fig--tall .fig__btn { max-height: 78vh; overflow-y: auto; }
.fig--narrow { max-width: 520px; }
.fig-pair { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--s5); }
.phones { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(180px, 1fr); gap: var(--s4); overflow-x: auto; padding: clamp(16px, 3vw, 36px); border-radius: var(--r-m); background: var(--mat); border: 1px solid var(--line); scroll-snap-type: x proximity; }
.phones figure { display: grid; gap: var(--s2); scroll-snap-align: start; }
.phones .fig__btn { border-radius: 18px; border: 4px solid #26231d; background: #fff; }
.phones figcaption { font: 500 var(--fs-label)/1.4 var(--font-mono); letter-spacing: .06em; text-transform: uppercase; color: var(--muted); text-align: center; }
.findings { display: grid; counter-reset: f; }
.findings li { counter-increment: f; display: grid; grid-template-columns: 3.2rem 1fr; gap: var(--s3); padding: var(--s4) 0; border-top: 1px solid var(--line); font: 600 clamp(1.0625rem, 1rem + .4vw, 1.3125rem)/1.35 var(--font-body); }
.findings li::before { content: "0" counter(f); font: 500 var(--fs-label)/2 var(--font-mono); letter-spacing: .08em; color: var(--accent); }
.findings li span { display: block; margin-top: 4px; font: 400 1rem/1.55 var(--font-body); color: var(--muted); }
.quote { padding-left: var(--s5); border-left: 2px solid var(--accent); display: grid; gap: var(--s3); }
.quote p { font: 700 var(--fs-h3)/1.25 var(--font-display); letter-spacing: -.02em; text-wrap: balance; }
.quote cite { font-style: normal; }
.pager { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); border-top: 1px solid var(--line); }
.pager a { display: grid; gap: var(--s2); padding: clamp(28px, 5vw, 64px) 0; transition: color var(--t-fast) ease; }
.pager a + a { text-align: right; padding-left: var(--s5); border-left: 1px solid var(--line); }
.pager a:hover { color: var(--accent); }
.pager .t-h3 { transition: transform var(--t-med) var(--ease); }
.pager a:hover .t-h3 { transform: translateX(6px); }
.pager a + a:hover .t-h3 { transform: translateX(-6px); }

/* ---------- 11 Lightbox ---------- */
.lightbox { width: 100vw; height: 100vh; max-width: none; max-height: none; margin: 0; padding: clamp(12px, 3vw, 40px); border: 0; background: rgba(10, 9, 8, .95); color: #f3efe6; }
.lightbox::backdrop { background: rgba(10, 9, 8, .6); }
.lightbox[open] { display: grid; grid-template-rows: 1fr auto; gap: var(--s4); }
.lightbox__scroll { overflow: auto; display: grid; place-items: center; }
.lightbox img { max-width: min(100%, 1800px); border-radius: var(--r-s); cursor: zoom-in; }
.lightbox.is-zoom .lightbox__scroll { place-items: start; }
.lightbox.is-zoom img { max-width: none; cursor: zoom-out; }
.lightbox__bar { display: flex; align-items: center; justify-content: space-between; gap: var(--s4); }
.lightbox__bar p { font-size: var(--fs-small); color: rgba(243, 239, 230, .72); max-width: 80ch; }
.lightbox__close { flex: none; min-height: 44px; padding: 0 18px; border-radius: var(--r-s); border: 1px solid rgba(255, 255, 255, .28); font: 600 .875rem/1 var(--font-body); }
.lightbox__close:hover { border-color: #fff; }

/* ---------- 12 Footer, toast ---------- */
.footer { border-top: 1px solid var(--line); padding-block: clamp(40px, 6vw, 72px) var(--s6); }
.footer__top { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--s5); padding-bottom: var(--s6); }
.footer__nav { display: flex; flex-wrap: wrap; gap: 2px var(--s2); margin-left: -12px; }
.footer__nav a { display: inline-flex; align-items: center; min-height: 44px; padding: 0 12px; font: 500 .9375rem/1 var(--font-body); color: var(--muted); transition: color var(--t-fast) ease; }
.footer__nav a:hover, .footer__nav a[aria-current] { color: var(--ink); }
.footer__base { display: flex; flex-wrap: wrap; justify-content: space-between; gap: var(--s2) var(--s5); padding-top: var(--s5); border-top: 1px solid var(--line); }
.footer .logo__mark { width: 44px; height: 44px; }
.footer .logo__name { font-size: 1.375rem; }
.toast { position: fixed; left: 50%; bottom: 24px; z-index: 90; padding: 12px 18px; border-radius: var(--r-s); background: var(--ink); color: var(--bg); font: 500 var(--fs-small)/1.3 var(--font-body); transform: translate(-50%, 24px); opacity: 0; pointer-events: none; transition: opacity var(--t-med) ease, transform var(--t-med) var(--ease); }
.toast.is-on { opacity: 1; transform: translate(-50%, 0); }

/* ---------- 13 Motion ---------- */
.js [data-r] { opacity: 0; transform: translateY(18px); transition: opacity var(--t-slow) ease, transform 800ms var(--ease); transition-delay: calc(var(--d, 0) * 80ms); }
.js [data-r].is-in, .no-anim [data-r] { opacity: 1; transform: none; }
.js .hero [data-h] { opacity: 0; transform: translateY(20px); animation: rise 900ms var(--ease) forwards; animation-delay: calc(var(--d, 0) * 90ms + 80ms); }
.js .stage { opacity: 0; animation: stage-in 1100ms var(--ease) 260ms forwards; }
@keyframes rise { to { opacity: 1; transform: none; } }
@keyframes stage-in { from { opacity: 0; transform: translateY(28px) scale(.96); } to { opacity: 1; transform: none; } }

/* ---------- Responsive ---------- */
@media (max-width: 1040px) {
  .cs-meta { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .cs-sec { grid-template-columns: 1fr; }
  .cs-sec__side { position: static; }
}
@media (max-width: 900px) {
  .hero__grid { grid-template-columns: 1fr; }
  .stage { max-width: 520px; width: 100%; margin-inline: auto; }
  .proj, .proj:nth-child(even) { grid-template-columns: 1fr; gap: var(--s5); }
  .proj .proj__media, .proj:nth-child(even) .proj__media { grid-column: 1; order: 0; }
  .proj .proj__body, .proj:nth-child(even) .proj__body { grid-column: 1; }
  .cols { grid-template-columns: 1fr; }
  .split { grid-template-columns: 1fr; }
  .head--row { grid-template-columns: 1fr; }
}
@media (max-width: 820px) {
  .nav { display: none; }
  .burger { display: grid; }
}
@media (max-width: 640px) {
  :root { --header: 60px; }
  .rows > li, .rows > div { grid-template-columns: 1fr; gap: var(--s2); }
  .fig-pair { grid-template-columns: 1fr; }
  .pager { grid-template-columns: 1fr; }
  .pager a + a { text-align: left; padding-left: 0; border-left: 0; border-top: 1px solid var(--line); }
  .btn-row .btn { flex: 1 1 100%; }
  .phones { grid-auto-columns: 62%; }
  .lightbox__bar { flex-direction: column; align-items: stretch; }
  .frame { aspect-ratio: 4 / 3; }
  .cs-meta { gap: var(--s4); }
}
@media (max-width: 360px) {
  .header .logo__name { display: none; }
  .cs-meta { grid-template-columns: 1fr; }
}
@media (hover: none) {
  .proj:hover .frame img { transform: none; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
  .js [data-r], .js .hero [data-h], .js .stage { opacity: 1; transform: none; animation: none; }
  .ply { animation: none; }
}
@media print {
  .header, .menu, .cs-nav, .footer__nav, .toast { display: none; }
  .js [data-r] { opacity: 1; transform: none; }
}

/* ==========================================================================
   14 Scroll story — each project is a small 3D scene driven by scroll position.
   site.js sets three custom properties on .scene:
     --p  position: 1 = entering from below, 0 = centred, -1 = leaving at the top
     --a  |p| after the hold zone      --o  layer opacity
   With no JavaScript or with reduced motion they keep their defaults (flat, visible).
   Depth order, back to front: .lay--b1, .lay--b2, .depth-num, .lay--front.
   Scrolling is native: nothing is pinned or hijacked.
   ========================================================================== */
.story { position: relative; padding-top: var(--section); }
.rail { display: none; }
.scenes { display: grid; }
.scene { --p: 0; --a: 0; --o: 1; --ry0: -8deg; --ry: -26deg; --rx: 10deg; position: relative; display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); gap: clamp(24px, 5vw, 80px); align-items: center; min-height: min(80vh, 760px); padding-block: clamp(24px, 4vw, 56px); scroll-margin-top: var(--header); }
.scene:nth-child(even) { --ry0: 8deg; --ry: 26deg; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); }
.scene:nth-child(even) .scene__stage { order: 2; }
.scene__stage { position: relative; aspect-ratio: 1 / .8; perspective: 1500px; perspective-origin: 50% 45%; }
.scene__world { position: absolute; inset: 0; transform-style: preserve-3d; transform: translate3d(0, calc(var(--p) * 60px), calc(var(--a) * -340px)) rotateX(calc(var(--p) * var(--rx))) rotateY(calc(var(--ry0) + var(--p) * var(--ry))); will-change: transform; }
.lay { opacity: var(--o); position: absolute; margin: 0; border-radius: var(--r-m); overflow: hidden; background: var(--surface); border: 1px solid var(--line-strong); box-shadow: var(--shadow-2); transition: translate var(--t-slow) var(--ease); }
.lay img { width: 100%; height: 100%; object-fit: cover; }
.lay--b1::after, .lay--b2::after { content: ""; position: absolute; inset: 0; background: var(--bg); opacity: .34; }   /* back layers sit in shadow */
.lay--front { left: 10%; top: 26%; width: 82%; aspect-ratio: 16 / 9; transform: translateZ(130px); }
.lay--b1 { left: -2%; top: 0; width: 58%; aspect-ratio: 16 / 9; transform: translateZ(-190px) translateY(calc(var(--p) * -60px)) rotateY(8deg); }
.lay--b2 { right: -2%; bottom: 0; width: 58%; aspect-ratio: 16 / 9; transform: translateZ(-90px) translateY(calc(var(--p) * 46px)) rotateY(-6deg); }
.depth-num { position: absolute; right: 0; top: -6%; font: 700 clamp(9rem, 21vw, 19rem)/.8 var(--font-display); letter-spacing: -.07em; color: var(--depth); opacity: var(--o); transform: translateZ(-30px) translateY(calc(var(--p) * -24px)); pointer-events: none; -webkit-user-select: none; user-select: none; }
.scene--rail .lay--front { left: 20%; top: 0; width: 56%; aspect-ratio: 1085 / 1118; }
.scene--rail .lay--b1 { top: 14%; width: 54%; }
.scene--rail .lay--b2 { bottom: 6%; width: 54%; }
.lay--phone { aspect-ratio: 440 / 956; border-radius: 26px; border: 5px solid #26231d; }
.scene--taj .lay--front { left: 36%; top: 1%; width: 28%; aspect-ratio: 440 / 956; }
.scene--taj .lay--b1 { left: 7%; top: 13%; width: 24%; aspect-ratio: 440 / 956; }
.scene--taj .lay--b2 { right: 7%; top: 13%; bottom: auto; width: 24%; aspect-ratio: 440 / 956; }
.scene--taj .depth-num { right: auto; left: 0; }
.scene:hover .lay--front { translate: 0 -8px; }
.scene:hover .proj__more svg { transform: translateX(4px); }
.scene:has(.proj__title a:focus-visible) .lay--front { outline: 2px solid var(--focus); outline-offset: 4px; }
.scene__copy { display: grid; gap: var(--s4); justify-items: start; opacity: calc(1 - var(--a) * .5); transform: translateY(calc(var(--p) * 36px)); }

/* Project index: follows the story down the left margin on wide screens */
@media (min-width: 1180px) {
  .rail { position: sticky; top: 0; z-index: 5; display: flex; align-items: center; height: 100vh; margin-bottom: -100vh; padding-left: max(14px, calc((100vw - var(--max)) / 2 - 76px)); pointer-events: none; }
  .rail ol { display: grid; gap: 6px; pointer-events: auto; }
  .rail a { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 50%; font: 500 var(--fs-label)/1 var(--font-mono); letter-spacing: .04em; color: var(--muted); transition: color var(--t-fast) ease, background-color var(--t-fast) ease; }
  .rail a:hover { color: var(--ink); }
  .rail a[aria-current] { background: var(--accent); color: var(--on-accent); }
}

/* ==========================================================================
   15 Intro — a 3.9 s move through real project screens, home page only,
   first visit of the session. Hidden unless boot.js adds .intro-on.
   Order of events: screens pass, the HS identity draws in, the Station
   Seedha Raasta poster arrives and lands on its place in the hero.
   ========================================================================== */
.intro { display: none; }
html.intro-on { overflow: hidden; }
.intro-on .intro { display: block; position: fixed; inset: 0; z-index: 100; background: var(--bg); color: var(--ink); overflow: hidden; transition: background-color 700ms ease; }
.intro__scene { --ix: 0; --iy: 0; position: absolute; inset: 0; perspective: 1000px; perspective-origin: calc(50% + var(--ix) * 7%) calc(50% + var(--iy) * 6%); }
.intro__world { position: absolute; inset: 0; transform-style: preserve-3d; transform: translateZ(-420px); }
.intro__veil { position: absolute; inset: 0; background: var(--bg); }
.intro.is-play .intro__veil { animation: intro-veil 3900ms linear forwards; }
@keyframes intro-veil { 0% { opacity: 1; } 12%, 23% { opacity: 0; } 30%, 52% { opacity: .8; } 60% { opacity: .5; } 70%, 80% { opacity: .84; } 92%, 100% { opacity: 1; } }
.intro.is-play .intro__world { animation: intro-cam 3900ms linear forwards; }
@keyframes intro-cam {
  0% { transform: translateZ(-420px); animation-timing-function: cubic-bezier(.2, .7, .2, 1); }
  15% { transform: translateZ(0); animation-timing-function: cubic-bezier(.45, 0, .35, 1); }
  37% { transform: translateZ(900px); animation-timing-function: linear; }
  57% { transform: translateZ(1180px); animation-timing-function: cubic-bezier(.6, 0, .4, 1); }
  82%, 100% { transform: translateZ(2500px); }
}
.intro__floor { position: absolute; left: -120vw; right: -120vw; top: 66%; height: 5200px; transform-origin: 50% 0; transform: rotateX(-90deg); background-image: linear-gradient(var(--line-strong) 1px, transparent 1px), linear-gradient(90deg, var(--line-strong) 1px, transparent 1px); background-size: 120px 120px; opacity: .55; -webkit-mask-image: linear-gradient(to bottom, #000 0%, #000 55%, transparent 100%); mask-image: linear-gradient(to bottom, #000 0%, #000 55%, transparent 100%); }
.intro__word { position: absolute; left: 50%; top: 44%; font: 700 46vw/.8 var(--font-display); letter-spacing: -.07em; color: var(--depth); white-space: nowrap; transform: translate(-50%, -50%) translateZ(-2900px); }
.ip { --w: clamp(220px, 36vw, 560px); position: absolute; left: 50%; top: 50%; width: var(--w); margin: 0; aspect-ratio: 16 / 9; border-radius: 12px; overflow: hidden; border: 1px solid var(--line-strong); box-shadow: var(--shadow-2); transform: translate(-50%, -50%) translate3d(var(--x), var(--y), var(--z)) rotateY(var(--r)); }
.ip img { width: 100%; height: 100%; object-fit: cover; }
.ip--phone { --w: clamp(92px, 13vw, 190px); aspect-ratio: 440 / 956; border-radius: 20px; border: 4px solid #26231d; }
.ip--1 { --x: -34vw; --y: -12vh; --z: -900px; --r: 32deg; }
.ip--2 { --x: 30vw; --y: -3vh; --z: -650px; --r: -28deg; }
.ip--3 { --x: 32vw; --y: 16vh; --z: -1700px; --r: -26deg; }
.ip--4 { --x: -32vw; --y: 18vh; --z: -1500px; --r: 26deg; }
.ip--5 { --x: -22vw; --y: -16vh; --z: -2100px; --r: 18deg; }
.ip--6 { --x: 26vw; --y: -18vh; --z: -2300px; --r: -22deg; }
.intro__logo { position: absolute; left: 50%; top: 50%; display: flex; align-items: center; gap: clamp(12px, 1.6vw, 22px); transform: translate(-50%, -50%); opacity: 0; white-space: nowrap; }
.intro.is-play .intro__logo { animation: intro-logo 3900ms linear forwards; }
@keyframes intro-logo {
  0%, 22% { opacity: 0; transform: translate(-50%, -50%) scale(.92); animation-timing-function: cubic-bezier(.2, .7, .2, 1); }
  28%, 52% { opacity: 1; transform: translate(-50%, -50%) scale(1); animation-timing-function: cubic-bezier(.6, 0, .4, 1); }
  58%, 100% { opacity: 0; transform: translate(-50%, calc(-50% - 9vh)) scale(1.04); }
}
.intro__mark { width: clamp(52px, 6.4vw, 92px); height: auto; aspect-ratio: 1; flex: none; overflow: visible; }
.intro__tile { fill: var(--accent); transform-box: fill-box; transform-origin: 50% 50%; transform: scale(0) rotate(-40deg); }
.intro.is-play .intro__tile { animation: intro-tile 560ms cubic-bezier(.3, 1.4, .5, 1) 900ms forwards; }
@keyframes intro-tile { to { transform: none; } }
.intro__stroke { stroke: var(--on-accent); stroke-dasharray: 1; stroke-dashoffset: 1; }
.intro.is-play .intro__stroke { animation: intro-draw 440ms cubic-bezier(.2, .7, .2, 1) 1040ms forwards; }
.intro.is-play .intro__stroke--s { animation-delay: 1160ms; }
@keyframes intro-draw { to { stroke-dashoffset: 0; } }
.intro__id { display: grid; gap: clamp(8px, 1vw, 12px); }
.intro__name { font: 700 clamp(1.75rem, 4.2vw, 3.5rem)/1 var(--font-display); letter-spacing: -.045em; clip-path: inset(0 100% 0 0); }
.intro__name b { font-weight: 700; color: var(--accent); }
.intro.is-play .intro__name { animation: intro-name 480ms cubic-bezier(.2, .7, .2, 1) 1080ms forwards; }
@keyframes intro-name { to { clip-path: inset(0 0 0 0); } }
.intro__role { opacity: 0; }
.intro.is-play .intro__role { animation: intro-role 300ms ease 1400ms forwards; }
@keyframes intro-role { to { opacity: 1; } }
.intro__poster { position: absolute; left: 50%; top: 48%; width: clamp(190px, 30vw, 430px); aspect-ratio: 1085 / 1118; margin: 0; border-radius: 14px; overflow: hidden; border: 1px solid var(--line-strong); box-shadow: var(--shadow-2); opacity: 0; transform: translate(-50%, -50%) translateZ(-2600px) rotateY(-34deg); }
.intro__poster img { width: 100%; height: 100%; object-fit: cover; }
.intro.is-play .intro__poster { animation: intro-poster 3900ms linear forwards; }
@keyframes intro-poster {
  0%, 57% { opacity: 0; transform: translate(-50%, -50%) translateZ(-2600px) rotateY(-34deg); animation-timing-function: cubic-bezier(.3, 0, .2, 1); }
  65% { opacity: 1; }
  83%, 100% { opacity: 1; transform: translate(-50%, -50%) translateZ(0) rotateY(0deg); }
}
.intro__caption { position: absolute; left: 0; right: 0; top: calc(48% + clamp(110px, 16.5vw, 236px)); text-align: center; color: var(--muted); opacity: 0; }
.intro.is-play .intro__caption { animation: intro-cap 3900ms linear forwards; }
@keyframes intro-cap { 0%, 74% { opacity: 0; transform: translateY(10px); } 83%, 100% { opacity: 1; transform: none; } }
.intro__skip { position: absolute; right: var(--pad); bottom: max(24px, env(safe-area-inset-bottom)); min-height: 44px; padding: 0 18px; border-radius: var(--r-pill); border: 1px solid var(--line-strong); background: var(--glass); color: var(--ink); font: 600 .875rem/1 var(--font-body); transition: border-color var(--t-fast) ease, background-color var(--t-fast) ease; }
.intro__skip:hover { border-color: var(--ink); }
.intro.is-out { background-color: transparent; pointer-events: none; }
.intro.is-out .intro__caption, .intro.is-out .intro__skip, .intro.is-out .intro__world, .intro.is-out .intro__veil, .intro.is-out .intro__logo { opacity: 0 !important; transition: opacity 300ms ease; animation: none !important; }
.intro.is-out.is-fast .intro__poster { opacity: 0 !important; transition: opacity 260ms ease; }
/* The hero waits underneath in its final state so the poster can land on it */
.intro-on .hero [data-h] { animation-play-state: paused; }
.intro-on .stage, .intro-done .stage { animation: none; opacity: 1; }
.intro-on .ply { animation: none; }

@media (max-width: 900px) {
  .scene, .scene:nth-child(even) { grid-template-columns: 1fr; gap: var(--s5); min-height: 0; padding-block: clamp(32px, 8vw, 56px); }
  .scene:nth-child(even) .scene__stage { order: 0; }
  .scene__stage { aspect-ratio: 1 / .8; max-width: 560px; width: 100%; margin-inline: auto; }
  .scene__world { transform: translate3d(0, calc(var(--p) * 24px), calc(var(--a) * -160px)) rotateX(calc(var(--p) * 6deg)) rotateY(calc(var(--ry0) * .6 + var(--p) * var(--ry) * .4)); }
  .scene__copy { transform: translateY(calc(var(--p) * 16px)); }
  .depth-num { font-size: clamp(7.5rem, 36vw, 13rem); }
  .lay--phone { border-width: 3px; border-radius: 18px; }
  .depth-type { font-size: min(37vw, 13.5rem); }
  .intro__word { font-size: 60vw; }
  .ip--5, .ip--6 { display: none; }
  .ip--1 { --x: -30vw; --y: -18vh; }
  .ip--2 { --x: 30vw; --y: -8vh; }
  .ip--3 { --x: 28vw; --y: 20vh; }
  .ip--4 { --x: -28vw; --y: 22vh; }
}
@media (prefers-reduced-motion: reduce) {
  .scene__world, .scene__copy, .lay--b1, .lay--b2 { transform: none; opacity: 1; }
  .lay--front, .depth-num { transform: none; }
  .intro { display: none !important; }
}
@media print { .intro { display: none !important; } }

