/* =====================================================================
   RAZA RAMEEZ — Product Design Portfolio
   Design system: "Editorial Paper"
   Warm cream paper · near-black ink · a single vermillion accent.
   High-contrast serif display, mono labels, dark interlude sections.
   ===================================================================== */

/* ----------------------------- Tokens ----------------------------- */
:root {
  /* Surfaces — warm paper */
  --paper: #f3efe6;
  --paper-2: #ece5d7;   /* deeper cream for alternating blocks */
  --paper-3: #e6decd;
  --dark: #1a1916;      /* dark interlude background */
  --dark-2: #232118;
  --nav-bg: rgba(243, 239, 230, 0.82);

  /* Ink */
  --ink: #17150f;
  --ink-soft: #36322a;
  --muted: #847e6f;
  --muted-2: #6c6759;
  --on-dark: #efe9da;
  --on-dark-dim: #b8b1a1;
  --on-dark-muted: #7d7768;

  /* Lines */
  --line: rgba(23, 21, 15, 0.14);
  --line-strong: rgba(23, 21, 15, 0.28);
  --line-dark: rgba(239, 233, 218, 0.16);

  /* Accent — vermillion */
  --red: #df4326;
  --red-deep: #c5371d;

  /* Type families */
  --font-display: "Fraunces", Georgia, "Times New Roman", serif;
  --font-body: "Hanken Grotesk", -apple-system, BlinkMacSystemFont, sans-serif;
  --font-mono: "JetBrains Mono", "SF Mono", ui-monospace, monospace;

  /* Type scale (fluid) */
  --step--2: clamp(0.66rem, 0.63rem + 0.12vw, 0.72rem);
  --step--1: clamp(0.78rem, 0.74rem + 0.2vw, 0.875rem);
  --step-0: clamp(1rem, 0.96rem + 0.2vw, 1.0625rem);
  --step-1: clamp(1.2rem, 1.1rem + 0.5vw, 1.45rem);
  --step-2: clamp(1.6rem, 1.35rem + 1.1vw, 2.25rem);
  --step-3: clamp(2.2rem, 1.7rem + 2.2vw, 3.4rem);
  --step-4: clamp(2.9rem, 2rem + 4.4vw, 5.5rem);
  --step-5: clamp(3.6rem, 2.1rem + 7.2vw, 9rem);
  --step-6: clamp(4.5rem, 1rem + 16vw, 18rem);

  /* Layout */
  --maxw: 1320px;
  --gutter: clamp(1.25rem, 4.5vw, 4.5rem);
  --radius: 4px;
  --radius-lg: 10px;

  /* Motion */
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
}

/* --------------------- Dark theme overrides ----------------------- */
[data-theme="dark"] {
  --paper: #141310;
  --paper-2: #1b1914;
  --paper-3: #221f17;
  --dark: #1d1b14;      /* interlude panels — slightly lifted in dark mode */
  --dark-2: #26231a;
  --nav-bg: rgba(20, 19, 16, 0.82);

  --ink: #ece6d8;
  --ink-soft: #c6bfae;
  --muted: #8a8473;
  --muted-2: #a8a08c;

  --line: rgba(236, 230, 216, 0.13);
  --line-strong: rgba(236, 230, 216, 0.24);
  --line-dark: rgba(236, 230, 216, 0.13);

  --on-dark: #ece6d8;
  --on-dark-dim: #bcb5a4;
  --on-dark-muted: #8a8474;
}
[data-theme="dark"] body::before { mix-blend-mode: screen; opacity: 0.04; }
html { transition: background-color 0.5s var(--ease); }

/* ----------------------------- Reset ------------------------------ */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; }
html { -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; scroll-behavior: smooth; }
body {
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: var(--step-0);
  line-height: 1.62;
  font-weight: 400;
  overflow-x: hidden;
}
img, svg, video { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button, input, textarea { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: none; }
ul { list-style: none; padding: 0; }

::selection { background: var(--red); color: var(--paper); }
:focus-visible { outline: 2px solid var(--red); outline-offset: 3px; }

/* Subtle paper grain */
body::before {
  content: "";
  position: fixed; inset: 0; z-index: 1; pointer-events: none;
  opacity: 0.025; mix-blend-mode: multiply;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* --------------------------- Utilities ---------------------------- */
.wrap { width: 100%; max-width: var(--maxw); margin-inline: auto; padding-inline: var(--gutter); }
.content { position: relative; z-index: 2; }
.dot { color: var(--red); }
.red { color: var(--red); }
.italic { font-style: italic; }
.serif { font-family: var(--font-display); }

.label {
  font-family: var(--font-mono);
  font-size: var(--step--2);
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--muted-2);
}
.label.on-dark { color: var(--on-dark-muted); }

h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 400;
  line-height: 1.0;
  letter-spacing: -0.02em;
  font-optical-sizing: auto;
}
.display { font-size: var(--step-5); font-weight: 380; line-height: 0.9; letter-spacing: -0.035em; }
.h-xl { font-size: var(--step-4); font-weight: 400; line-height: 0.95; letter-spacing: -0.03em; }
.h2 { font-size: var(--step-3); font-weight: 400; line-height: 1.0; letter-spacing: -0.025em; }
.h3 { font-size: var(--step-2); }
.lead { font-size: var(--step-0); color: var(--ink-soft); line-height: 1.6; max-width: 40ch; }

.section { padding-block: clamp(4rem, 9vw, 8.5rem); position: relative; }

/* Section meta header row (label left, label right) */
.meta-row {
  display: flex; justify-content: space-between; gap: 1rem;
  padding-bottom: 1.25rem; margin-bottom: clamp(2rem, 5vw, 3.5rem);
  border-bottom: 1px solid var(--line);
  flex-wrap: wrap;
}

/* ----------------------------- Buttons ---------------------------- */
.btn {
  display: inline-flex; align-items: center; gap: 0.6em;
  font-family: var(--font-mono);
  font-size: var(--step--1);
  letter-spacing: 0.04em; text-transform: uppercase;
  padding: 0.85em 1.4em; border-radius: 100px;
  border: 1px solid var(--ink);
  transition: all 0.4s var(--ease);
}
.btn .arrow { transition: transform 0.4s var(--ease); }
.btn:hover .arrow { transform: translate(3px, -3px); }
.btn-primary { background: var(--ink); color: var(--paper); }
.btn-primary:hover { background: var(--red); border-color: var(--red); }
.btn-ghost:hover { background: var(--ink); color: var(--paper); }
.btn-dark { border-color: var(--on-dark); color: var(--on-dark); }
.btn-dark:hover { background: var(--red); border-color: var(--red); color: var(--paper); }

/* Circular arrow button */
.circle-btn {
  width: 58px; height: 58px; border-radius: 50%;
  border: 1px solid var(--line-strong);
  display: inline-grid; place-items: center; flex-shrink: 0;
  font-size: 1.1rem; transition: all 0.5s var(--ease);
}
.circle-btn:hover { background: var(--red); border-color: var(--red); color: var(--paper); transform: rotate(45deg); }

.link { position: relative; display: inline-flex; align-items: center; gap: 0.35em; }
.link::after {
  content: ""; position: absolute; left: 0; bottom: -2px; width: 100%; height: 1px;
  background: var(--red); transform: scaleX(0); transform-origin: right; transition: transform 0.45s var(--ease);
}
.link:hover { color: var(--red); }
.link:hover::after { transform: scaleX(1); transform-origin: left; }

/* ------------------------------ Nav ------------------------------- */
.nav { position: fixed; inset: 0 0 auto 0; z-index: 100; transition: all 0.5s var(--ease); border-bottom: 1px solid transparent; }
.nav.scrolled { background: var(--nav-bg); backdrop-filter: blur(12px) saturate(120%); border-bottom-color: var(--line); }
.nav-inner { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; height: 60px; gap: 1rem; }
.brand { font-family: var(--font-mono); font-size: var(--step--1); letter-spacing: 0.06em; display: inline-flex; align-items: center; gap: 0.6em; }
.brand .mono-mark { font-family: var(--font-display); font-size: 1.15rem; letter-spacing: -0.02em; }
.brand .sep { color: var(--muted); }
.nav-links { display: flex; justify-content: center; align-items: center; gap: clamp(1.2rem, 2.5vw, 2.25rem); }
.nav-links a { font-family: var(--font-mono); font-size: var(--step--2); letter-spacing: 0.16em; text-transform: uppercase; color: var(--ink-soft); position: relative; }
.nav-links a:hover { color: var(--red); }
.nav-end { display: flex; justify-content: flex-end; align-items: center; gap: 1rem; position: relative; z-index: 110; }
.nav-status { font-family: var(--font-mono); font-size: var(--step--2); letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted-2); display: inline-flex; align-items: center; gap: 0.5em; }
.nav-status .pulse { width: 7px; height: 7px; border-radius: 50%; background: var(--red); box-shadow: 0 0 0 0 rgba(223,67,38,0.5); animation: pulse 2.4s infinite; }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(223,67,38,0.45); } 70% { box-shadow: 0 0 0 7px rgba(223,67,38,0); } 100% { box-shadow: 0 0 0 0 rgba(223,67,38,0); } }

/* Theme toggle */
.theme-toggle { width: 36px; height: 36px; border-radius: 50%; border: 1px solid var(--line-strong); display: inline-grid; place-items: center; color: var(--ink); transition: all 0.4s var(--ease); flex-shrink: 0; }
.theme-toggle:hover { border-color: var(--red); color: var(--red); transform: rotate(15deg); }
.theme-toggle svg { width: 17px; height: 17px; }
.theme-toggle .ic-sun { display: none; }
[data-theme="dark"] .theme-toggle .ic-sun { display: block; }
[data-theme="dark"] .theme-toggle .ic-moon { display: none; }

.nav-toggle { display: none; }

@media (max-width: 900px) {
  .nav-status, .nav-resume { display: none; }
  .nav-toggle { display: flex; flex-direction: column; gap: 5px; width: 28px; padding: 6px 0; z-index: 110; }
  .nav-toggle span { height: 1.5px; width: 100%; background: var(--ink); transition: all 0.4s var(--ease); }
  .nav.open .nav-toggle span:nth-child(1) { transform: translateY(6.5px) rotate(45deg); }
  .nav.open .nav-toggle span:nth-child(2) { opacity: 0; }
  .nav.open .nav-toggle span:nth-child(3) { transform: translateY(-6.5px) rotate(-45deg); }
  .nav-links { position: fixed; inset: 0; flex-direction: column; justify-content: center; gap: 1.75rem; background: var(--paper); transform: translateX(100%); transition: transform 0.6s var(--ease); }
  .nav-links a { font-size: 1.1rem; }
  .nav.open .nav-links { transform: translateX(0); }
}

/* ------------------------------ Hero ------------------------------ */
.hero { padding-top: clamp(6rem, 12vh, 9rem); padding-bottom: 2rem; }
.hero-top { display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap; padding-bottom: 1.5rem; }
.hero .display { margin: 0.5rem 0 0; }
.hero-lower { display: grid; grid-template-columns: 1.1fr 0.9fr; gap: 2rem; align-items: end; margin-top: clamp(2rem, 5vw, 3.5rem); }
.hero-intro { max-width: 38ch; color: var(--ink-soft); font-size: var(--step-0); }
.hero-selected { display: flex; align-items: center; gap: 1.25rem; justify-content: flex-end; }
.hero-selected .txt { font-family: var(--font-display); font-size: var(--step-1); font-style: italic; }
@media (max-width: 760px) { .hero-lower { grid-template-columns: 1fr; align-items: start; } .hero-selected { justify-content: flex-start; } }

/* Skills marquee/divider row */
.marquee {
  margin-top: clamp(2.5rem, 6vw, 4.5rem);
  padding-block: 1.4rem; border-block: 1px solid var(--line);
  overflow: hidden; -webkit-mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent);
  mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent);
}
.marquee-track { display: flex; width: max-content; animation: marquee 36s linear infinite; }
.marquee:hover .marquee-track { animation-play-state: paused; }
.marquee-item { font-family: var(--font-display); font-size: var(--step-1); display: inline-flex; align-items: center; white-space: nowrap; }
.marquee-item::after { content: "·"; color: var(--red); margin-inline: clamp(1.5rem, 3vw, 2.75rem); }
@keyframes marquee { to { transform: translateX(-50%); } }
@media (prefers-reduced-motion: reduce) {
  .marquee-track { animation: none; flex-wrap: wrap; gap: 0.5rem 1rem; width: 100%; }
}

/* Smooth magnetic return (overrides the slower "all" transitions) */
.circle-btn, .btn-primary, .btn-ghost, .theme-toggle {
  transition: transform 0.28s var(--ease), background-color 0.4s var(--ease),
              border-color 0.4s var(--ease), color 0.4s var(--ease);
  will-change: transform;
}

/* ------------------------- Work grid ------------------------------ */
.work-head { display: grid; grid-template-columns: 1fr 0.8fr; gap: 2rem; align-items: end; margin-bottom: 2.5rem; }
.work-head .h2 { max-width: 12ch; }
.work-head p { color: var(--ink-soft); font-size: var(--step--1); max-width: 34ch; justify-self: end; }
@media (max-width: 760px) { .work-head { grid-template-columns: 1fr; } .work-head p { justify-self: start; } }

.work-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: clamp(1rem, 2vw, 1.5rem); }
@media (max-width: 720px) { .work-grid { grid-template-columns: 1fr; } }

.work-card {
  position: relative; display: block; border-radius: var(--radius-lg); overflow: hidden;
  aspect-ratio: 16 / 11; background: var(--dark);
  border: 1px solid var(--line);
  transition: transform 0.3s var(--ease); will-change: transform; transform-origin: center;
}
.work-card .glow {
  position: absolute; inset: 0; z-index: 1; pointer-events: none; opacity: 0;
  background: radial-gradient(220px circle at var(--mx, 50%) var(--my, 50%), rgba(223, 67, 38, 0.22), transparent 60%);
  transition: opacity 0.4s var(--ease);
}
.work-card:hover .glow { opacity: 1; }
.work-card .card-inner { z-index: 2; }
.work-card .media {
  position: absolute; inset: 0;
  background-size: cover; background-position: center;
  transition: transform 0.9s var(--ease);
}
.work-card .media.ph {
  background:
    radial-gradient(120% 120% at 20% 10%, rgba(223,67,38,0.22), transparent 55%),
    repeating-linear-gradient(135deg, rgba(239,233,218,0.04) 0 14px, rgba(239,233,218,0.0) 14px 28px),
    var(--dark);
}
.work-card:hover .media { transform: scale(1.04); }
.work-card .scrim { position: absolute; inset: 0; background: linear-gradient(180deg, rgba(20,19,15,0.35) 0%, rgba(20,19,15,0) 35%, rgba(20,19,15,0.78) 100%); }
.work-card .card-inner { position: absolute; inset: 0; padding: clamp(1.25rem, 2.5vw, 2rem); display: flex; flex-direction: column; justify-content: space-between; }
.work-card .card-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 1rem; }
.work-card .cat { font-family: var(--font-mono); font-size: var(--step--2); letter-spacing: 0.14em; text-transform: uppercase; color: var(--on-dark-dim); }
.work-card .card-go { width: 42px; height: 42px; border-radius: 50%; border: 1px solid var(--line-dark); display: grid; place-items: center; color: var(--on-dark); transition: all 0.5s var(--ease); flex-shrink: 0; }
.work-card:hover .card-go { background: var(--red); border-color: var(--red); transform: rotate(45deg); }
.work-card .card-title { font-family: var(--font-display); font-size: var(--step-2); line-height: 1.02; color: var(--on-dark); max-width: 16ch; }
.work-card .card-outcome { font-family: var(--font-mono); font-size: var(--step--2); letter-spacing: 0.06em; color: var(--red); margin-top: 0.6rem; }
.work-foot { margin-top: 2.5rem; }

/* ------------------------- Bio (dark) ----------------------------- */
.bio { background: var(--dark); color: var(--on-dark); }
.bio .meta-row { border-color: var(--line-dark); }
.bio-grid { display: grid; grid-template-columns: 1.15fr 0.85fr; gap: clamp(2rem, 6vw, 5rem); align-items: start; }
.bio-statement { font-family: var(--font-display); font-size: var(--step-3); font-weight: 380; line-height: 1.08; letter-spacing: -0.02em; }
.bio-statement em { font-style: italic; }
.bio-body { display: grid; gap: 1.2rem; color: var(--on-dark-dim); margin-top: 2rem; max-width: 52ch; }
.bio-portrait {
  aspect-ratio: 4/5; border-radius: var(--radius-lg); overflow: hidden;
  background:
    radial-gradient(120% 90% at 70% 10%, rgba(223,67,38,0.25), transparent 55%),
    repeating-linear-gradient(45deg, rgba(239,233,218,0.05) 0 12px, transparent 12px 24px),
    var(--dark-2);
  display: grid; place-items: center; color: var(--on-dark-muted);
  font-family: var(--font-mono); font-size: var(--step--1); text-align: center; padding: 1rem;
  background-size: cover; background-position: center;
}
.bio-facts { margin-top: 1.5rem; border-top: 1px solid var(--line-dark); }
.bio-fact { display: flex; justify-content: space-between; gap: 1rem; padding: 0.85rem 0; border-bottom: 1px solid var(--line-dark); }
.bio-fact .k { font-family: var(--font-mono); font-size: var(--step--2); letter-spacing: 0.12em; text-transform: uppercase; color: var(--on-dark-muted); }
.bio-fact .v { color: var(--on-dark); text-align: right; }
@media (max-width: 820px) { .bio-grid { grid-template-columns: 1fr; } }

/* ------------------------ Process / practice ---------------------- */
.process-grid { display: grid; grid-template-columns: 1.5fr 0.9fr; gap: clamp(2rem, 6vw, 5rem); align-items: start; }
.practice { display: grid; }
.practice-row { display: grid; grid-template-columns: auto 1fr; gap: clamp(1.25rem, 3vw, 2.5rem); padding: clamp(1.5rem, 3vw, 2rem) 0; border-top: 1px solid var(--line); align-items: baseline; }
.practice-row:last-child { border-bottom: 1px solid var(--line); }
.practice-row .num { font-family: var(--font-display); font-style: italic; font-size: var(--step-1); color: var(--red); }
.practice-row h3 { font-family: var(--font-display); font-size: var(--step-2); margin-bottom: 0.5rem; }
.practice-row p { color: var(--ink-soft); font-size: var(--step--1); max-width: 52ch; }
.process-side .label { display: block; margin-bottom: 1.25rem; }
.process-side ul { display: grid; gap: 0.7rem; }
.process-side li { display: flex; gap: 0.7rem; align-items: baseline; color: var(--ink-soft); }
.process-side li::before { content: ""; width: 5px; height: 5px; background: var(--red); flex-shrink: 0; position: relative; top: 0.5em; }
.process-note { margin-top: 2rem; border: 1px solid var(--line-strong); border-radius: var(--radius-lg); padding: 1.5rem; }
.process-note .big { font-family: var(--font-display); font-size: var(--step-1); line-height: 1.15; }
.process-note .big em { font-style: italic; color: var(--red); }
@media (max-width: 820px) { .process-grid { grid-template-columns: 1fr; } }

/* ----------------------------- Contact ---------------------------- */
.contact-grid { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(2rem, 6vw, 5rem); align-items: start; }
.contact-line { font-family: var(--font-display); font-size: var(--step-4); font-weight: 380; line-height: 0.98; letter-spacing: -0.03em; }
.contact-line em { font-style: italic; }
.contact-email { display: inline-block; margin-top: 2rem; font-family: var(--font-display); font-size: var(--step-1); }
.contact-socials { display: flex; flex-wrap: wrap; gap: 1.5rem; margin-top: 2rem; }
.contact-socials a { font-family: var(--font-mono); font-size: var(--step--1); letter-spacing: 0.06em; }
.contact-form { display: grid; gap: 1.25rem; }
.field { display: grid; gap: 0.5rem; }
.field label { font-family: var(--font-mono); font-size: var(--step--2); letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted-2); }
.field input, .field textarea { background: transparent; border: none; border-bottom: 1px solid var(--line-strong); padding: 0.6rem 0; font-size: var(--step-0); color: var(--ink); transition: border-color 0.3s var(--ease); }
.field input:focus, .field textarea:focus { outline: none; border-color: var(--red); }
.field textarea { resize: vertical; min-height: 90px; }
.form-note { font-family: var(--font-mono); font-size: var(--step--2); color: var(--muted); letter-spacing: 0.04em; }
@media (max-width: 820px) { .contact-grid { grid-template-columns: 1fr; } }

/* ------------------------ Footer (dark, big) ---------------------- */
.footer { background: var(--dark); color: var(--on-dark); padding-top: clamp(3rem, 7vw, 6rem); overflow: hidden; }
.footer-top { display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap; padding-bottom: 2rem; border-bottom: 1px solid var(--line-dark); }
.footer-top a:hover { color: var(--red); }
.footer-name { font-family: var(--font-display); font-weight: 380; font-size: var(--step-6); line-height: 0.82; letter-spacing: -0.04em; margin-top: clamp(2rem, 5vw, 4rem); white-space: nowrap; }
.footer-fine { display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap; padding-block: 2rem; }
.footer-fine small { font-family: var(--font-mono); font-size: var(--step--2); letter-spacing: 0.08em; color: var(--on-dark-muted); }

/* ------------------------ Scroll progress bar --------------------- */
.progress { position: fixed; top: 0; left: 0; height: 2px; background: var(--red); width: 0%; z-index: 200; transition: width 0.1s linear; }

/* --------------------------- Reveal anim -------------------------- */
.reveal { opacity: 0; transform: translateY(24px); transition: opacity 0.9s var(--ease-out), transform 0.9s var(--ease-out); }
.reveal.in { opacity: 1; transform: none; }
.reveal[data-delay="1"] { transition-delay: 0.07s; }
.reveal[data-delay="2"] { transition-delay: 0.14s; }
.reveal[data-delay="3"] { transition-delay: 0.21s; }
.reveal[data-delay="4"] { transition-delay: 0.28s; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.001ms !important; transition-duration: 0.001ms !important; }
  .reveal { opacity: 1; transform: none; }
  html { scroll-behavior: auto; }
}

/* =====================================================================
   CASE STUDY DETAIL PAGE (paper theme)
   ===================================================================== */
.cs-hero { padding-top: clamp(6rem, 12vh, 9rem); padding-bottom: 1rem; }
.cs-breadcrumb { font-family: var(--font-mono); font-size: var(--step--1); color: var(--muted-2); letter-spacing: 0.06em; }
.cs-breadcrumb a:hover { color: var(--red); }
.cs-title { font-size: var(--step-4); font-weight: 380; line-height: 0.96; letter-spacing: -0.03em; margin: 1.5rem 0; max-width: 16ch; }
.cs-tagline { font-size: var(--step-1); color: var(--ink-soft); max-width: 50ch; }

.cs-overview { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 0; border-top: 1px solid var(--line); margin-top: clamp(2.5rem, 6vw, 4rem); }
.cs-overview .cell { padding: 1.5rem 1.5rem 1.5rem 0; border-bottom: 1px solid var(--line); }
.cs-overview .k { font-family: var(--font-mono); font-size: var(--step--2); text-transform: uppercase; letter-spacing: 0.12em; color: var(--muted-2); }
.cs-overview .v { margin-top: 0.6rem; color: var(--ink); font-size: var(--step-0); }

.cs-banner { margin-block: clamp(3rem, 8vw, 5rem); aspect-ratio: 16 / 8; border-radius: var(--radius-lg); overflow: hidden;
  background: radial-gradient(120% 100% at 25% 15%, rgba(223,67,38,0.2), transparent 55%), repeating-linear-gradient(135deg, rgba(239,233,218,0.05) 0 14px, transparent 14px 28px), var(--dark);
  display: grid; place-items: center; color: var(--on-dark-muted); font-family: var(--font-mono); font-size: var(--step--1); }

.cs-block { padding-block: clamp(2.5rem, 6vw, 4.5rem); border-top: 1px solid var(--line); }
.cs-block:first-of-type { border-top: none; }
.cs-block-grid { display: grid; grid-template-columns: 0.4fr 1.6fr; gap: clamp(1.5rem, 5vw, 4rem); align-items: start; }
.cs-block-num { font-family: var(--font-mono); font-size: var(--step--1); color: var(--red); letter-spacing: 0.08em; }
.cs-block h2 { font-size: var(--step-2); margin-top: 0.5rem; }
.cs-block p { color: var(--ink-soft); margin-bottom: 1.1rem; max-width: 64ch; }
.cs-block p:last-child { margin-bottom: 0; }
.cs-block h3 { font-family: var(--font-mono); font-size: var(--step--1); text-transform: uppercase; letter-spacing: 0.12em; color: var(--ink); margin: 1.75rem 0 0.9rem; }
@media (max-width: 820px) { .cs-block-grid { grid-template-columns: 1fr; gap: 1rem; } }

.cs-list { display: grid; gap: 0.85rem; margin-bottom: 1.3rem; }
.cs-list li { display: flex; gap: 0.9rem; color: var(--ink-soft); align-items: baseline; }
.cs-list li::before { content: ""; width: 6px; height: 6px; flex-shrink: 0; background: var(--red); position: relative; top: 0.5em; }

.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 1.25rem; margin-top: 1.5rem; }
.card { background: var(--paper-2); border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 1.75rem; transition: transform 0.4s var(--ease); }
.card:hover { transform: translateY(-4px); }
.card .role { font-family: var(--font-mono); font-size: var(--step--2); text-transform: uppercase; letter-spacing: 0.1em; color: var(--red); }
.card .name { font-family: var(--font-display); font-size: var(--step-1); margin: 0.5rem 0 0.8rem; }
.card .quote { color: var(--ink-soft); font-style: italic; font-family: var(--font-display); }
.card p { font-size: var(--step--1); margin-top: 0.8rem; color: var(--ink-soft); }

.metrics { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 0; border-top: 1px solid var(--line); margin-top: 1.5rem; }
.metric { padding: 2rem 1.5rem 2rem 0; border-bottom: 1px solid var(--line); }
.metric .big { font-family: var(--font-display); font-size: var(--step-3); color: var(--red); line-height: 1; }
.metric .cap { color: var(--muted-2); font-size: var(--step--1); margin-top: 0.6rem; }

.figure { margin: 1.25rem 0; }
.figure .frame { border-radius: var(--radius-lg); border: 1px solid var(--line); background: var(--paper-2); aspect-ratio: 16/9; display: grid; place-items: center; color: var(--muted); font-family: var(--font-mono); font-size: var(--step--1); text-align: center; padding: 1rem; }
.figure figcaption { font-family: var(--font-mono); font-size: var(--step--2); color: var(--muted); margin-top: 0.7rem; letter-spacing: 0.04em; }
.figure-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 1.25rem; }

/* Long-form case study extras */
.cs-proto { margin-top: clamp(1.5rem, 4vw, 2.25rem); }
.cs-flow { display: flex; flex-direction: column; align-items: flex-start; gap: 0.5rem; margin: 0.5rem 0 1.3rem; }
.cs-flow-step { font-family: var(--font-mono); font-size: var(--step--1); color: var(--ink); border: 1px solid var(--line); border-radius: var(--radius); padding: 0.6rem 1rem; background: var(--paper-2); }
.cs-flow-arrow { color: var(--red); font-size: var(--step--1); line-height: 1; padding-left: 1rem; }

.cs-next { background: var(--dark); color: var(--on-dark); padding-block: clamp(3rem, 8vw, 5.5rem); }
.cs-next a { display: flex; align-items: center; justify-content: space-between; gap: 2rem; flex-wrap: wrap; }
.cs-next .label { color: var(--on-dark-muted); }
.cs-next .next-title { font-family: var(--font-display); font-size: var(--step-3); transition: color 0.4s var(--ease); }
.cs-next a:hover .next-title { color: var(--red); }
.cs-next .circle-btn { border-color: var(--line-dark); color: var(--on-dark); }

[data-cs-root]:empty::after { content: "Loading…"; color: var(--muted); font-family: var(--font-mono); display: block; padding: 8rem var(--gutter); }

/* =====================================================================
   Custom cursor (pointer-only; enabled via JS body.cursor-on)
   ===================================================================== */
.cursor { display: none; }
body.cursor-on .cursor { display: block; }
body.cursor-on, body.cursor-on a, body.cursor-on button, body.cursor-on .work-card { cursor: none; }
body.cursor-on input, body.cursor-on textarea { cursor: text; }

#cursorDot {
  position: fixed; left: 0; top: 0; z-index: 320; pointer-events: none;
  width: 7px; height: 7px; margin: -3.5px 0 0 -3.5px; border-radius: 50%;
  background: var(--red); transition: opacity 0.3s var(--ease);
}
body.cursor-hide-dot #cursorDot { opacity: 0; }

#cursorRing { position: fixed; left: 0; top: 0; z-index: 319; pointer-events: none; }
#cursorRing .cursor-ring-i {
  position: absolute; left: 0; top: 0; width: 38px; height: 38px;
  transform: translate(-50%, -50%); border: 1px solid #fff; border-radius: 50%;
  mix-blend-mode: difference; display: grid; place-items: center;
  transition: width 0.35s var(--ease), height 0.35s var(--ease), background-color 0.3s var(--ease), border-color 0.3s var(--ease);
}
#cursorRing.is-link .cursor-ring-i { width: 56px; height: 56px; }
#cursorRing.is-view .cursor-ring-i { width: 92px; height: 92px; mix-blend-mode: normal; background: var(--red); border-color: var(--red); }
#cursorRing.is-down .cursor-ring-i { width: 26px; height: 26px; }
.cursor-label { font-family: var(--font-mono); font-size: 9px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--paper); opacity: 0; transition: opacity 0.25s var(--ease); }
#cursorRing.is-view .cursor-label { opacity: 1; }

/* =====================================================================
   Page transition overlay (exit fade; safe fallback)
   ===================================================================== */
.page-transition {
  position: fixed; inset: 0; z-index: 400; pointer-events: none;
  background: var(--paper); opacity: 0; visibility: hidden;
  transition: opacity 0.36s var(--ease), visibility 0.36s var(--ease);
}
.page-transition.active { opacity: 1; visibility: visible; }
@media (prefers-reduced-motion: reduce) { .page-transition { display: none; } }
.stats {
  padding: 3rem 0 1rem;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  padding: 2rem 0;
}

.stat {
  text-align: center;
}

.stat-number {
  font-family: var(--font-display);
  font-size: clamp(2rem, 4vw, 3.5rem);
  line-height: 1;
  color: var(--red);
}

.stat-label {
  margin-top: .5rem;
  font-family: var(--font-mono);
  font-size: var(--step--2);
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--muted-2);
}

@media (max-width: 768px) {
  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}