/* ═══════════════════════════════════════════════════════════════
   AARYAN PANCHAL — PERSONAL SITE
   Design system + styles
   Set in Fraunces (display) · Inter (text) · JetBrains Mono (meta)
═══════════════════════════════════════════════════════════════ */


/* ═══════════════════════════════════════════════════
   1. DESIGN TOKENS
═══════════════════════════════════════════════════ */

:root {
  /* Type scale (fluid) */
  --step--1: clamp(0.78rem, 0.74rem + 0.18vw, 0.88rem);
  --step-0:  clamp(0.95rem, 0.90rem + 0.25vw, 1.05rem);
  --step-1:  clamp(1.15rem, 1.05rem + 0.5vw, 1.45rem);
  --step-2:  clamp(1.5rem, 1.25rem + 1.2vw, 2.4rem);
  --step-3:  clamp(2.1rem, 1.6rem + 2.4vw, 3.6rem);
  --step-4:  clamp(3rem, 2rem + 5vw, 7rem);

  /* Fonts */
  --font-display: 'Fraunces', 'Times New Roman', Georgia, serif;
  --font-sans:    'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-mono:    'JetBrains Mono', ui-monospace, 'SF Mono', Menlo, monospace;

  /* Rhythm */
  --gutter: clamp(1.5rem, 5vw, 4rem);
  --maxw: 1240px;

  /* Motion */
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-soft: cubic-bezier(0.4, 0, 0.2, 1);
  --dur: 0.8s;
}

:root[data-theme="dark"] {
  --bg:          #0a0908;
  --bg-1:        #100e0b;
  --bg-2:        #15120e;
  --bg-3:        #1c1813;
  --line:        #2a241c;
  --line-soft:   #1a1611;
  --ink:         #f4efe6;
  --ink-2:       #968f82;
  --ink-3:       #5b554b;
  --accent:        #bccbce;
  --accent-2:      #dbe6e8;
  --accent-soft:   rgba(188,203,206,0.12);
  --on-accent:     #0d1213;
  --grid:        rgba(255,255,255,0.022);
  --nav-bg:      rgba(10,9,8,0.7);
  --grain-op:    0.05;
  --glow-1:      rgba(188,203,206,0.14);
  --glow-2:      rgba(120,150,165,0.07);
  --shadow:      0 30px 80px -40px rgba(0,0,0,0.8);
  color-scheme: dark;
}

:root[data-theme="light"] {
  --bg:          #f4efe6;
  --bg-1:        #ece6da;
  --bg-2:        #e6dfd1;
  --bg-3:        #ddd5c5;
  --line:        #d2cabb;
  --line-soft:   #e0d9cb;
  --ink:         #16130d;
  --ink-2:       #5f584c;
  --ink-3:       #a79d8c;
  --accent:        #4f6970;
  --accent-2:      #3a5158;
  --accent-soft:   rgba(79,105,112,0.10);
  --on-accent:     #f4efe6;
  --grid:        rgba(0,0,0,0.035);
  --nav-bg:      rgba(244,239,230,0.72);
  --grain-op:    0.035;
  --glow-1:      rgba(79,105,112,0.10);
  --glow-2:      rgba(120,150,165,0.05);
  --shadow:      0 30px 80px -40px rgba(40,60,65,0.25);
  color-scheme: light;
}


/* ═══════════════════════════════════════════════════
   2. BASE
═══════════════════════════════════════════════════ */

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

html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }

body {
  background-color: var(--bg);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: var(--step-0);
  line-height: 1.6;
  font-feature-settings: "kern" 1, "liga" 1;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
  transition: background-color 0.7s var(--ease-soft), color 0.7s var(--ease-soft);
}

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

a { color: inherit; text-decoration: none; }

img { max-width: 100%; display: block; }

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

/* Hide reveal content only when JS is active (graceful no-JS fallback) */
.js .reveal {
  opacity: 0;
  transform: translateY(34px);
  transition: opacity 1s var(--ease), transform 1s var(--ease);
  will-change: opacity, transform;
}
.js .reveal.in { opacity: 1; transform: none; }

.d1 { transition-delay: 0.09s; }
.d2 { transition-delay: 0.18s; }
.d3 { transition-delay: 0.30s; }
.d4 { transition-delay: 0.44s; }
.d5 { transition-delay: 0.58s; }

.mono {
  font-family: var(--font-mono);
  font-size: var(--step--1);
  letter-spacing: 0.04em;
}

.serif { font-family: var(--font-display); }


/* ═══════════════════════════════════════════════════
   3. FILM GRAIN + AMBIENT OVERLAYS
═══════════════════════════════════════════════════ */

.grain {
  position: fixed;
  inset: -150%;
  z-index: 9500;
  pointer-events: none;
  opacity: var(--grain-op);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='240' height='240'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  animation: grainShift 0.5s steps(2) infinite;
  transition: opacity 0.7s var(--ease-soft);
}

/* Soft vignette to focus the eye */
.vignette {
  position: fixed;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background: radial-gradient(120% 90% at 50% 0%, transparent 55%, rgba(0,0,0,0.28));
  mix-blend-mode: multiply;
  opacity: 0.55;
}
:root[data-theme="light"] .vignette { opacity: 0.25; }


/* ═══════════════════════════════════════════════════
   4. CUSTOM CURSOR (fine pointers only)
═══════════════════════════════════════════════════ */

#cur-dot, #cur-ring { display: none; }

@media (hover: hover) and (pointer: fine) {
  body.has-cursor { cursor: none; }
  body.has-cursor a,
  body.has-cursor button { cursor: none; }

  #cur-dot {
    display: block;
    position: fixed; top: 0; left: 0;
    width: 6px; height: 6px;
    background: var(--accent);
    border-radius: 50%;
    pointer-events: none;
    z-index: 9600;
    transform: translate(-50%, -50%);
    transition: width 0.2s, height 0.2s, opacity 0.3s;
    mix-blend-mode: difference;
  }
  #cur-ring {
    display: block;
    position: fixed; top: 0; left: 0;
    width: 38px; height: 38px;
    border: 1px solid var(--accent);
    border-radius: 50%;
    pointer-events: none;
    z-index: 9599;
    transform: translate(-50%, -50%);
    opacity: 0.4;
    transition: width 0.5s var(--ease), height 0.5s var(--ease), opacity 0.3s, background 0.3s;
  }
  body.cur-link #cur-dot  { opacity: 0; }
  body.cur-link #cur-ring { width: 56px; height: 56px; opacity: 0.9; background: var(--accent-soft); }
}


/* ═══════════════════════════════════════════════════
   5. PRELOADER
═══════════════════════════════════════════════════ */

#preloader { display: none; }

.js #preloader {
  display: flex;
  position: fixed;
  inset: 0;
  z-index: 9700;
  background: var(--bg);
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 28px;
  transition: opacity 0.7s var(--ease), visibility 0.7s;
}
#preloader.done { opacity: 0; visibility: hidden; }

.pl-mark {
  font-family: var(--font-display);
  font-size: clamp(2.5rem, 8vw, 5rem);
  font-weight: 400;
  letter-spacing: -0.04em;
  color: var(--ink);
  overflow: hidden;
}
.pl-mark span {
  display: inline-block;
  transform: translateY(110%);
  animation: plRise 0.9s var(--ease) forwards;
}
.pl-mark span:nth-child(2) { animation-delay: 0.08s; }

.pl-bar {
  width: min(220px, 50vw);
  height: 1px;
  background: var(--line);
  position: relative;
  overflow: hidden;
}
.pl-bar::after {
  content: '';
  position: absolute;
  inset: 0;
  background: var(--accent);
  transform: scaleX(0);
  transform-origin: left;
  animation: plLoad 1.1s 0.2s var(--ease-soft) forwards;
}
.pl-count {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.2em;
  color: var(--ink-3);
}


/* ═══════════════════════════════════════════════════
   6. SIDE INDEX RAIL
═══════════════════════════════════════════════════ */

.rail {
  position: fixed;
  right: clamp(1rem, 2.4vw, 2.2rem);
  top: 50%;
  transform: translateY(-50%);
  z-index: 400;
  display: flex;
  flex-direction: column;
  gap: 18px;
  align-items: flex-end;
}
.rail a {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-mono);
  font-size: 0.62rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-3);
  transition: color 0.3s;
}
.rail a .dash {
  width: 16px; height: 1px;
  background: var(--ink-3);
  transition: width 0.4s var(--ease), background 0.3s;
}
.rail a .lbl {
  opacity: 0;
  transform: translateX(6px);
  transition: opacity 0.3s, transform 0.3s;
}
.rail a:hover .lbl,
.rail a.active .lbl { opacity: 1; transform: none; }
.rail a:hover, .rail a.active { color: var(--ink); }
.rail a:hover .dash, .rail a.active .dash { width: 30px; background: var(--accent); }


/* ═══════════════════════════════════════════════════
   7. NAV
═══════════════════════════════════════════════════ */

nav {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 500;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 var(--gutter);
  height: 70px;
  border-bottom: 1px solid transparent;
  transition: background-color 0.5s, backdrop-filter 0.5s, border-color 0.5s, height 0.4s;
}
nav.scrolled {
  background-color: var(--nav-bg);
  backdrop-filter: blur(22px) saturate(140%);
  -webkit-backdrop-filter: blur(22px) saturate(140%);
  border-color: var(--line-soft);
  height: 60px;
}

.nav-logo {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  color: var(--ink);
}
.nav-logo .mark {
  width: 34px; height: 34px;
  object-fit: contain;
  display: block;
  transition: transform 0.5s var(--ease);
}
.nav-logo:hover .mark { transform: rotate(-6deg) scale(1.05); }

/* Theme-aware logo swap (white art on dark, black art on light) */
.theme-logo-light { display: none !important; }
:root[data-theme="light"] .theme-logo-dark { display: none !important; }
:root[data-theme="light"] .theme-logo-light { display: block !important; }
.nav-logo .wordmark {
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 500;
  letter-spacing: -0.02em;
}
@media (max-width: 460px) { .nav-logo .wordmark { display: none; } }

.nav-right { display: flex; align-items: center; gap: clamp(1rem, 3vw, 2.5rem); }

.nav-links { display: flex; gap: clamp(1.2rem, 3vw, 2.4rem); list-style: none; }
.nav-links a {
  position: relative;
  font-size: 0.82rem;
  color: var(--ink-2);
  letter-spacing: 0.01em;
  transition: color 0.25s;
  padding: 4px 0;
}
.nav-links a::after {
  content: '';
  position: absolute;
  left: 0; bottom: 0;
  width: 0; height: 1px;
  background: var(--accent);
  transition: width 0.35s var(--ease);
}
.nav-links a:hover { color: var(--ink); }
.nav-links a:hover::after { width: 100%; }

.theme-btn {
  background: none;
  border: 1px solid var(--line);
  color: var(--ink-2);
  font-family: var(--font-mono);
  font-size: 0.6rem;
  font-weight: 500;
  letter-spacing: 0.12em;
  padding: 8px 14px;
  border-radius: 100px;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: color 0.25s, border-color 0.25s, background 0.25s;
}
.theme-btn:hover { color: var(--ink); border-color: var(--ink-3); }
.theme-btn .ico { width: 11px; height: 11px; }


/* ═══════════════════════════════════════════════════
   8. SHARED LAYOUT
═══════════════════════════════════════════════════ */

.section {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: clamp(5rem, 12vw, 9rem) var(--gutter);
}
.section + .section { border-top: 1px solid var(--line-soft); }

.eyebrow {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  font-weight: 500;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--accent);
  display: inline-flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 1.6rem;
}
.eyebrow::before {
  content: '';
  width: 26px; height: 1px;
  background: var(--accent);
  opacity: 0.55;
}

.section-title {
  font-family: var(--font-display);
  font-size: var(--step-3);
  font-weight: 400;
  letter-spacing: -0.02em;
  line-height: 1.04;
  color: var(--ink);
}
.section-title em { font-style: italic; color: var(--accent); }

.lead {
  font-size: var(--step-1);
  font-weight: 300;
  line-height: 1.55;
  color: var(--ink-2);
  letter-spacing: -0.01em;
}


/* ═══════════════════════════════════════════════════
   9. HERO
═══════════════════════════════════════════════════ */

#hero {
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 0 var(--gutter) clamp(4rem, 9vw, 7rem);
  position: relative;
  overflow: hidden;
}
#hero::before {
  content: '';
  position: absolute; inset: 0;
  background-image: radial-gradient(circle, var(--grid) 1px, transparent 1px);
  background-size: 46px 46px;
  pointer-events: none;
  mask-image: radial-gradient(120% 100% at 30% 40%, #000 30%, transparent 80%);
}

/* Ambient drifting glow */
.hero-glow {
  position: absolute;
  z-index: 0;
  pointer-events: none;
  border-radius: 50%;
  filter: blur(80px);
}
.hero-glow.g1 {
  width: 50vw; height: 50vw; max-width: 720px; max-height: 720px;
  top: -10%; right: -8%;
  background: var(--glow-1);
  animation: drift1 18s ease-in-out infinite;
}
.hero-glow.g2 {
  width: 36vw; height: 36vw; max-width: 520px; max-height: 520px;
  bottom: 4%; left: -6%;
  background: var(--glow-2);
  animation: drift2 22s ease-in-out infinite;
}

.hero-inner { position: relative; z-index: 2; max-width: 1000px; width: 100%; }

.hero-label {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: clamp(1.5rem, 3vw, 2.2rem);
  display: flex; align-items: center; gap: 12px;
}
.hero-label::before {
  content: ''; width: 22px; height: 1px; background: var(--accent); opacity: 0.6;
}

h1.hero-name {
  font-family: var(--font-display);
  font-size: var(--step-4);
  font-weight: 400;
  letter-spacing: -0.035em;
  line-height: 0.92;
  color: var(--ink);
  margin-bottom: clamp(1.6rem, 3.5vw, 2.6rem);
}
h1.hero-name .ln { display: block; }
h1.hero-name .ln > span { display: inline-block; }
h1.hero-name em { font-style: italic; font-weight: 300; }

.hero-tagline {
  font-size: var(--step-1);
  font-weight: 300;
  color: var(--ink-2);
  letter-spacing: -0.015em;
  line-height: 1.5;
  max-width: 30ch;
  margin-bottom: clamp(2rem, 4vw, 3rem);
}
.hero-tagline strong { color: var(--ink); font-weight: 400; }
.hero-tagline .hl {
  color: var(--ink);
  font-weight: 400;
  font-style: italic;
  font-family: var(--font-display);
}

.hero-ctas { display: flex; gap: 14px; align-items: center; flex-wrap: wrap; }

.btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 0.85rem;
  font-weight: 500;
  letter-spacing: 0.01em;
  padding: 15px 28px;
  border-radius: 6px;
  transition: transform 0.3s var(--ease), background 0.3s, color 0.3s, border-color 0.3s;
}
.btn .arr { transition: transform 0.35s var(--ease); }
.btn:hover .arr { transform: translateX(4px); }

.btn-fill { background: var(--accent); color: var(--on-accent); }
.btn-fill:hover { background: var(--accent-2); }

.btn-ghost { background: transparent; color: var(--ink-2); border: 1px solid var(--line); }
.btn-ghost:hover { color: var(--ink); border-color: var(--ink-3); }

/* Scroll cue */
.scroll-cue {
  position: absolute;
  bottom: clamp(1.5rem, 4vw, 2.4rem);
  right: var(--gutter);
  display: flex; align-items: center; gap: 12px;
  z-index: 2;
}
.scroll-cue span {
  font-family: var(--font-mono);
  font-size: 0.6rem; letter-spacing: 0.16em; text-transform: uppercase;
  color: var(--ink-3);
}
.scroll-cue .track { width: 46px; height: 1px; background: var(--line); position: relative; overflow: hidden; }
.scroll-cue .track::after {
  content: ''; position: absolute; inset: 0; left: -100%;
  background: var(--accent);
  animation: trackSlide 2.4s var(--ease-soft) infinite;
}


/* ═══════════════════════════════════════════════════
   10. MARQUEE
═══════════════════════════════════════════════════ */

.marquee {
  overflow: hidden;
  border-top: 1px solid var(--line-soft);
  border-bottom: 1px solid var(--line-soft);
  background: var(--bg-1);
  padding: 16px 0;
  transition: background 0.7s, border-color 0.7s;
  position: relative;
  z-index: 2;
}
.marquee-track {
  display: inline-flex;
  white-space: nowrap;
  will-change: transform;
  animation: marquee 42s linear infinite;
}
.marquee:hover .marquee-track { animation-play-state: paused; }
.m-item {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-3);
  display: inline-flex;
  align-items: center;
  gap: 32px;
  padding: 0 32px;
  transition: color 0.7s;
}
.m-item::after {
  content: ''; width: 3px; height: 3px; background: var(--accent); border-radius: 50%; flex-shrink: 0;
}


/* ═══════════════════════════════════════════════════
   11. WORK
═══════════════════════════════════════════════════ */

.work-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 2rem;
  margin-bottom: clamp(2.5rem, 5vw, 4rem);
  flex-wrap: wrap;
}
.work-count { font-family: var(--font-mono); font-size: 0.7rem; color: var(--ink-3); letter-spacing: 0.12em; }

/* Feature card */
.feature {
  display: grid;
  grid-template-columns: 1.02fr 1fr;
  gap: 1px;
  background: var(--line-soft);
  border: 1px solid var(--line-soft);
  border-radius: 14px;
  overflow: hidden;
  margin-bottom: 14px;
}

.feature-visual {
  background: var(--bg-2);
  min-height: clamp(320px, 42vw, 520px);
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}
.feature-visual .index {
  position: absolute;
  top: 24px; left: 26px;
  font-family: var(--font-mono);
  font-size: 0.66rem;
  color: var(--ink-3);
  letter-spacing: 0.14em;
}

/* pulse-ring placeholder (swap for real photo) */
.ring { position: absolute; border-radius: 50%; border: 1px solid var(--accent); }
.ring-1 { width: 240px; height: 240px; opacity: 0.14; animation: ringPulse 4s 0s ease-in-out infinite; }
.ring-2 { width: 160px; height: 160px; opacity: 0.11; animation: ringPulse 4s 1s ease-in-out infinite; }
.ring-3 { width: 90px;  height: 90px;  opacity: 0.09; animation: ringPulse 4s 2s ease-in-out infinite; }
.core { width: 10px; height: 10px; background: var(--accent); border-radius: 50%; z-index: 1; animation: corePulse 3s ease-in-out infinite; }

.ekg { position: absolute; bottom: 0; left: 0; right: 0; height: 90px; opacity: 0.16; }
.ekg path {
  stroke: var(--accent); stroke-width: 1.4; fill: none;
  stroke-dasharray: 700; stroke-dashoffset: 700;
}
.in .ekg path { animation: drawEKG 2.6s 0.5s var(--ease-soft) forwards; }
.photo-hint {
  position: absolute; bottom: 18px; left: 26px;
  font-family: var(--font-mono); font-size: 0.6rem; letter-spacing: 0.1em;
  text-transform: uppercase; color: var(--ink-3); opacity: 0.7;
}

.feature-body {
  background: var(--bg-1);
  padding: clamp(2rem, 4vw, 3.4rem);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 2rem;
  transition: background 0.7s;
}
.feature-tag {
  font-family: var(--font-mono);
  font-size: 0.66rem; letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--accent); margin-bottom: 1.1rem;
}
.feature-name {
  font-family: var(--font-display);
  font-size: var(--step-2);
  font-weight: 400; letter-spacing: -0.02em; line-height: 1.02;
  color: var(--ink); margin-bottom: 1.1rem;
}
.feature-desc { font-size: var(--step-0); color: var(--ink-2); line-height: 1.7; max-width: 42ch; }

.stats { display: flex; gap: clamp(1.5rem, 4vw, 2.6rem); margin: 2rem 0; flex-wrap: wrap; }
.stat-n {
  font-family: var(--font-display);
  font-size: clamp(2rem, 4vw, 2.8rem);
  font-weight: 400; letter-spacing: -0.03em; color: var(--ink); line-height: 1;
}
.stat-l { font-family: var(--font-mono); font-size: 0.62rem; color: var(--ink-3); letter-spacing: 0.06em; margin-top: 8px; }

.arrow-link {
  display: inline-flex; align-items: center; gap: 10px;
  font-size: 0.88rem; font-weight: 500; color: var(--accent);
  transition: gap 0.3s;
}
.arrow-link:hover { gap: 18px; }

/* Secondary project cards */
.card-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1px;
  background: var(--line-soft);
  border: 1px solid var(--line-soft);
  border-radius: 14px;
  overflow: hidden;
}
.proj {
  background: var(--bg-1);
  padding: clamp(1.8rem, 3.5vw, 2.8rem);
  position: relative;
  overflow: hidden;
  transition: background 0.35s;
}
.proj::before {
  content: '';
  position: absolute; inset: 0;
  background: radial-gradient(120% 80% at 0% 0%, var(--accent-soft), transparent 60%);
  opacity: 0; transition: opacity 0.4s;
}
.proj:hover { background: var(--bg-2); }
.proj:hover::before { opacity: 1; }
.proj > * { position: relative; }
.proj-label {
  font-family: var(--font-mono); font-size: 0.62rem; letter-spacing: 0.12em;
  text-transform: uppercase; color: var(--ink-3); margin-bottom: 1rem;
  display: flex; justify-content: space-between;
}
.proj-title {
  font-family: var(--font-display); font-size: var(--step-1); font-weight: 400;
  letter-spacing: -0.02em; color: var(--ink); margin-bottom: 0.7rem;
}
.proj-desc { font-size: 0.92rem; color: var(--ink-2); line-height: 1.65; margin-bottom: 1.4rem; }
.tags { display: flex; flex-wrap: wrap; gap: 7px; }
.tag {
  font-family: var(--font-mono);
  font-size: 0.6rem; color: var(--ink-3);
  border: 1px solid var(--line);
  padding: 5px 11px; border-radius: 100px; letter-spacing: 0.04em;
  transition: border-color 0.3s, color 0.3s;
}
.proj:hover .tag { border-color: var(--ink-3); color: var(--ink-2); }


/* ═══════════════════════════════════════════════════
   12. ABOUT
═══════════════════════════════════════════════════ */

.about-grid {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: clamp(3rem, 7vw, 6rem);
  align-items: start;
}
.about-text p {
  font-size: var(--step-1);
  font-weight: 300;
  line-height: 1.55;
  letter-spacing: -0.012em;
  color: var(--ink-2);
  margin-bottom: 1.6rem;
  transition: color 0.7s;
}
.about-text p:last-child { margin-bottom: 0; }
.about-text strong { color: var(--ink); font-weight: 400; }
.about-text .pull {
  font-family: var(--font-display);
  font-style: italic;
  color: var(--accent);
  font-weight: 400;
}

.facts { padding-top: 6px; }
.fact {
  display: grid;
  grid-template-columns: 116px 1fr;
  gap: 16px;
  padding: 18px 0;
  border-bottom: 1px solid var(--line-soft);
  transition: border-color 0.7s;
}
.fact:first-child { border-top: 1px solid var(--line-soft); }
.fact-k {
  font-family: var(--font-mono);
  font-size: 0.62rem; letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--ink-3); padding-top: 3px;
}
.fact-v { font-size: 0.92rem; color: var(--ink-2); line-height: 1.6; }
.fact-v a { color: var(--accent); transition: opacity 0.25s; }
.fact-v a:hover { opacity: 0.7; }


/* ═══════════════════════════════════════════════════
   13. APPROACH (principles)
═══════════════════════════════════════════════════ */

.approach-head { max-width: 700px; margin-bottom: clamp(2.5rem, 5vw, 4rem); }
.principles { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px; background: var(--line-soft); border: 1px solid var(--line-soft); border-radius: 14px; overflow: hidden; }
.principle {
  background: var(--bg-1);
  padding: clamp(1.8rem, 3.5vw, 2.6rem);
  transition: background 0.35s;
}
.principle:hover { background: var(--bg-2); }
.principle .num {
  font-family: var(--font-mono); font-size: 0.66rem; color: var(--accent);
  letter-spacing: 0.12em; margin-bottom: 1.8rem;
}
.principle h3 {
  font-family: var(--font-display); font-size: var(--step-1); font-weight: 400;
  letter-spacing: -0.02em; line-height: 1.15; color: var(--ink); margin-bottom: 0.9rem;
}
.principle p { font-size: 0.92rem; color: var(--ink-2); line-height: 1.65; }


/* ═══════════════════════════════════════════════════
   14. CAPABILITIES
═══════════════════════════════════════════════════ */

.cap-head { display: flex; justify-content: space-between; align-items: flex-end; flex-wrap: wrap; gap: 1.5rem; margin-bottom: clamp(2rem, 4vw, 3rem); }
.cap-list { border-top: 1px solid var(--line-soft); }
.cap-row {
  display: grid;
  grid-template-columns: 60px 1.2fr 2fr;
  gap: clamp(1rem, 3vw, 2.5rem);
  align-items: center;
  padding: clamp(1.2rem, 2.5vw, 1.8rem) 0;
  border-bottom: 1px solid var(--line-soft);
  transition: padding-left 0.4s var(--ease), background 0.4s;
}
.cap-row:hover { padding-left: 16px; }
.cap-row .c-num { font-family: var(--font-mono); font-size: 0.66rem; color: var(--ink-3); }
.cap-row .c-name {
  font-family: var(--font-display); font-size: var(--step-1); font-weight: 400;
  letter-spacing: -0.02em; color: var(--ink);
}
.cap-row:hover .c-name { color: var(--accent); }
.cap-row .c-desc { font-size: 0.92rem; color: var(--ink-2); line-height: 1.6; }


/* ═══════════════════════════════════════════════════
   15. CONNECT
═══════════════════════════════════════════════════ */

#connect { text-align: center; position: relative; overflow: hidden; }
#connect .eyebrow { justify-content: center; }
.connect-inner { max-width: 720px; margin: 0 auto; position: relative; z-index: 2; }
.connect-glow {
  position: absolute; z-index: 0; pointer-events: none;
  width: 60vw; max-width: 700px; aspect-ratio: 1;
  top: -20%; left: 50%; transform: translateX(-50%);
  background: var(--glow-1); filter: blur(90px); border-radius: 50%;
}
.connect-title {
  font-family: var(--font-display);
  font-size: var(--step-3);
  font-weight: 400; letter-spacing: -0.025em; line-height: 1.02;
  color: var(--ink); margin-bottom: 1.4rem;
}
.connect-title em { font-style: italic; color: var(--accent); }
.connect-sub { font-size: var(--step-0); font-weight: 300; color: var(--ink-2); line-height: 1.7; margin-bottom: clamp(2.2rem, 4vw, 3.2rem); }

.connect-email {
  display: inline-flex; align-items: center; gap: 12px;
  font-family: var(--font-display);
  font-size: var(--step-1);
  font-weight: 400; color: var(--ink);
  padding-bottom: 6px; margin-bottom: clamp(2.2rem, 4vw, 3rem);
  border-bottom: 1px solid var(--line);
  transition: color 0.3s, border-color 0.3s, gap 0.3s;
}
.connect-email:hover { color: var(--accent); border-color: var(--accent); gap: 18px; }

.socials { display: flex; justify-content: center; gap: clamp(1.4rem, 4vw, 2.4rem); flex-wrap: wrap; }
.socials a {
  font-family: var(--font-mono); font-size: 0.66rem; letter-spacing: 0.1em; text-transform: uppercase;
  color: var(--ink-3); display: inline-flex; align-items: center; gap: 7px;
  transition: color 0.25s;
}
.socials a:hover { color: var(--ink); }
.socials a .ext { transition: transform 0.3s; }
.socials a:hover .ext { transform: translate(2px, -2px); }


/* ═══════════════════════════════════════════════════
   16. FOOTER
═══════════════════════════════════════════════════ */

footer {
  padding: 2rem var(--gutter);
  border-top: 1px solid var(--line-soft);
  display: flex; align-items: center; justify-content: space-between;
  flex-wrap: wrap; gap: 1rem;
  transition: border-color 0.7s;
}
footer .col { font-family: var(--font-mono); font-size: 0.66rem; color: var(--ink-3); letter-spacing: 0.04em; }
footer .col a { color: var(--ink-2); transition: color 0.25s; }
footer .col a:hover { color: var(--accent); }
.status { display: flex; align-items: center; gap: 9px; font-family: var(--font-mono); font-size: 0.66rem; color: var(--ink-3); letter-spacing: 0.04em; }
.status .dot { width: 6px; height: 6px; background: #5ec27a; border-radius: 50%; box-shadow: 0 0 0 0 rgba(94,194,122,0.6); animation: blink 2.4s ease-in-out infinite; }


/* ═══════════════════════════════════════════════════
   17. KEYFRAMES
═══════════════════════════════════════════════════ */

@keyframes plRise   { to { transform: translateY(0); } }
@keyframes plPop    { to { opacity: 1; transform: none; } }
@keyframes plLoad   { to { transform: scaleX(1); } }
@keyframes grainShift {
  0% { transform: translate(0,0); } 25% { transform: translate(-3%,2%); }
  50% { transform: translate(2%,-3%); } 75% { transform: translate(-2%,-2%); }
  100% { transform: translate(0,0); }
}
@keyframes marquee { from { transform: translateX(0); } to { transform: translateX(-50%); } }
@keyframes trackSlide { 0% { left: -100%; } 50% { left: 0; } 100% { left: 100%; } }
@keyframes ringPulse { 0%,100% { transform: scale(1); opacity: 0.12; } 50% { transform: scale(1.08); opacity: 0.24; } }
@keyframes corePulse { 0%,100% { box-shadow: 0 0 0 0 rgba(188,203,206,0.5); } 50% { box-shadow: 0 0 0 12px rgba(188,203,206,0); } }
@keyframes drawEKG { to { stroke-dashoffset: 0; } }
@keyframes blink { 0%,100% { opacity: 1; } 50% { opacity: 0.35; } }
@keyframes drift1 {
  0%,100% { transform: translate(0,0) scale(1); }
  50% { transform: translate(-6%,5%) scale(1.12); }
}
@keyframes drift2 {
  0%,100% { transform: translate(0,0) scale(1); }
  50% { transform: translate(7%,-5%) scale(1.1); }
}


/* ═══════════════════════════════════════════════════
   18. RESPONSIVE
═══════════════════════════════════════════════════ */

@media (max-width: 980px) {
  .rail { display: none; }
  .feature { grid-template-columns: 1fr; }
  .about-grid { grid-template-columns: 1fr; gap: 2.5rem; }
  .principles { grid-template-columns: 1fr; }
  .cap-row { grid-template-columns: 40px 1fr; }
  .cap-row .c-desc { grid-column: 2; }
}

@media (max-width: 620px) {
  .nav-links { display: none; }
  .scroll-cue { display: none; }
  .card-grid { grid-template-columns: 1fr; }
  .stats { gap: 1.6rem; }
  .feature-name { font-size: clamp(1.8rem, 8vw, 2.4rem); }
}


/* ═══════════════════════════════════════════════════
   19. SCROLL MOTION LAYER
═══════════════════════════════════════════════════ */

/* Top scroll-progress bar */
.scroll-prog {
  position: fixed; top: 0; left: 0; right: 0;
  height: 2px; z-index: 9550;
  background: transparent; pointer-events: none;
}
.scroll-prog span {
  display: block; height: 100%; width: 100%;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  transform: scaleX(0); transform-origin: left;
  will-change: transform;
}

/* Giant kinetic background words */
.has-bg { position: relative; overflow: hidden; isolation: isolate; }
.bgword {
  position: absolute; z-index: -1;
  pointer-events: none; user-select: none;
  font-family: var(--font-display);
  font-weight: 400; line-height: 0.8; white-space: nowrap;
  font-size: clamp(5rem, 21vw, 17rem);
  letter-spacing: -0.04em;
  color: transparent;
  -webkit-text-stroke: 1px var(--line);
  text-stroke: 1px var(--line);
  opacity: 0.55;
  will-change: transform;
  transition: opacity 0.7s;
}
.bgword.solid {
  color: var(--bg-2);
  -webkit-text-stroke: 0; text-stroke: 0;
  opacity: 1;
}

/* Parallax / drift hooks (JS writes the transforms) */
[data-speed], [data-drift] { will-change: transform; }

/* Word-by-word "scatter → assemble" reveal */
.js .split-words { }
.js .split-words .w-out { display: inline-block; }
.js .split-words .w-in {
  display: inline-block;
  opacity: 0;
  transform: translate(var(--dx, 0), 0.7em) rotate(var(--dr, 0deg));
  filter: blur(6px);
  transition:
    opacity 0.7s var(--ease),
    transform 0.95s var(--ease),
    filter 0.7s var(--ease);
  transition-delay: var(--d, 0s);
  will-change: transform, opacity, filter;
}
.js .split-words.in .w-in {
  opacity: 1; transform: none; filter: blur(0);
}

/* Parallax / drift hooks (JS fallback writes the transforms) */
.parx, .drift { will-change: transform; }

/* Preloader logo */
.pl-logo {
  width: clamp(56px, 13vw, 92px);
  height: auto;
  color: var(--ink);
  opacity: 0;
  transform: scale(0.86) translateY(8px);
  animation: plPop 0.9s 0.1s var(--ease) forwards;
}


/* ═══════════════════════════════════════════════════
   20. NATIVE SCROLL-DRIVEN ANIMATIONS
   Progressive enhancement — see https://scroll-driven-animations.style
   Activated only when the browser supports it AND JS adds `.sd`
   (Chrome/Edge today). Everything below has a JS fallback for Safari/FF.
═══════════════════════════════════════════════════ */

@supports (animation-timeline: view()) {

  /* Scroll progress bar tied to document scroll */
  .sd .scroll-prog span {
    animation: progressGrow linear both;
    animation-timeline: scroll(root block);
  }

  /* Reveal blocks as they scroll into view */
  .sd .reveal {
    opacity: 0;
    transition: none;
    animation: revealIn linear both;
    animation-timeline: view();
    animation-range: entry 0% entry 78%;
  }

  /* Vertical parallax */
  .sd .parx {
    animation: parY linear both;
    animation-timeline: view();
    animation-range: cover;
  }

  /* Horizontal drift (kinetic background words, etc.) */
  .sd .drift {
    animation: drX linear both;
    animation-timeline: view();
    animation-range: cover;
  }

  @keyframes progressGrow { to { transform: scaleX(1); } }
  @keyframes revealIn {
    from { opacity: 0; transform: translateY(38px); }
    to   { opacity: 1; transform: none; }
  }
  @keyframes parY {
    from { transform: translate3d(0, calc(var(--par, 1) *  70px), 0); }
    to   { transform: translate3d(0, calc(var(--par, 1) * -70px), 0); }
  }
  @keyframes drX {
    from { transform: translate3d(calc(var(--drift, 120) * -1px), 0, 0); }
    to   { transform: translate3d(calc(var(--drift, 120) *  1px), 0, 0); }
  }
}


/* ═══════════════════════════════════════════════════
   21. STYLE EXTRAS / COMPONENTS
═══════════════════════════════════════════════════ */

/* Cursor "VIEW" label */
.cur-txt {
  font-family: var(--font-mono);
  font-size: 0.5rem; letter-spacing: 0.16em; text-transform: uppercase;
  color: var(--on-accent);
  opacity: 0; transition: opacity 0.25s;
}
@media (hover: hover) and (pointer: fine) {
  #cur-ring { display: flex; align-items: center; justify-content: center; }
  body.cur-view #cur-ring {
    width: 76px; height: 76px; opacity: 1;
    background: var(--accent); border-color: transparent;
  }
  body.cur-view #cur-dot { opacity: 0; }
  body.cur-view .cur-txt { opacity: 1; }
}

/* Animated gradient (shimmer) text */
.shimmer {
  background: linear-gradient(100deg, var(--ink) 18%, var(--accent) 50%, var(--ink) 82%);
  background-size: 220% auto;
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent; color: transparent;
  animation: shimmer 7s linear infinite;
}
@keyframes shimmer { to { background-position: 220% center; } }

/* Availability pill */
.avail {
  display: inline-flex; align-items: center; gap: 9px;
  font-family: var(--font-mono); font-size: 0.62rem;
  letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--ink-2);
  border: 1px solid var(--line); border-radius: 100px;
  padding: 8px 15px; margin-bottom: 1.6rem;
  background: var(--bg-1);
}
.avail .d {
  width: 6px; height: 6px; border-radius: 50%; background: #5ec27a;
  box-shadow: 0 0 0 0 rgba(94,194,122,0.6); animation: blink 2.4s ease-in-out infinite;
}

/* 3D tilt cards */
.tilt { transition: transform 0.4s var(--ease), background 0.35s; transform-style: preserve-3d; }

/* Manifesto slab */
.manifesto {
  max-width: var(--maxw); margin: 0 auto;
  padding: clamp(6rem, 14vw, 11rem) var(--gutter);
  border-top: 1px solid var(--line-soft);
  text-align: center;
}
.manifesto-text {
  font-family: var(--font-display);
  font-size: clamp(1.9rem, 4.6vw, 4.2rem);
  font-weight: 300; line-height: 1.18; letter-spacing: -0.025em;
  color: var(--ink); max-width: 18ch; margin: 0 auto;
}
.manifesto-text em { font-style: italic; color: var(--accent); }
.manifesto-sig {
  margin-top: 2.5rem; font-family: var(--font-mono);
  font-size: 0.66rem; letter-spacing: 0.16em; text-transform: uppercase; color: var(--ink-3);
}

/* Reverse marquee variant */
.marquee-track.rev { animation: marqueeRev 50s linear infinite; }
@keyframes marqueeRev { from { transform: translateX(-50%); } to { transform: translateX(0); } }

/* Giant kinetic footer wordmark */
.bigfoot {
  border-top: 1px solid var(--line-soft);
  padding: clamp(3rem, 8vw, 6rem) var(--gutter) 0;
  overflow: hidden; position: relative; isolation: isolate;
}
.bigfoot-name {
  font-family: var(--font-display);
  font-size: clamp(3.5rem, 17vw, 15rem);
  font-weight: 400; line-height: 0.82; letter-spacing: -0.04em;
  white-space: nowrap;
  color: transparent;
  -webkit-text-stroke: 1px var(--line); text-stroke: 1px var(--line);
  transition: -webkit-text-stroke 0.4s, color 0.4s;
}
.bigfoot:hover .bigfoot-name { color: var(--bg-2); -webkit-text-stroke: 1px var(--accent); }

/* Media (image) slots with reveal + zoom */
.media {
  position: relative; overflow: hidden; border-radius: 14px;
  background: var(--bg-2); border: 1px solid var(--line-soft);
}
.media img { width: 100%; height: 100%; object-fit: cover; display: block; transform: scale(1.1); transition: transform 1.3s var(--ease); }
.js .reveal.in .media img, .media.in img { transform: none; }
.media .ph {
  position: absolute; inset: 0;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px;
  color: var(--ink-3); font-family: var(--font-mono);
  font-size: 0.62rem; letter-spacing: 0.12em; text-transform: uppercase;
  border: 1px dashed var(--line); border-radius: 14px; text-align: center; padding: 1rem;
}
.media .ph svg { width: 28px; height: 28px; opacity: 0.6; }


/* ═══════════════════════════════════════════════════
   22. CASE STUDY PAGE
═══════════════════════════════════════════════════ */

.cs-hero {
  padding: clamp(8rem, 16vw, 12rem) var(--gutter) clamp(3rem, 6vw, 5rem);
  max-width: var(--maxw); margin: 0 auto;
  position: relative; overflow: hidden; isolation: isolate;
}
.cs-back {
  display: inline-flex; align-items: center; gap: 9px;
  font-family: var(--font-mono); font-size: 0.66rem; letter-spacing: 0.1em; text-transform: uppercase;
  color: var(--ink-2); margin-bottom: 2rem; transition: gap 0.3s, color 0.25s;
}
.cs-back:hover { gap: 15px; color: var(--accent); }
.cs-title {
  font-family: var(--font-display);
  font-size: var(--step-4); font-weight: 400; letter-spacing: -0.035em; line-height: 0.92;
  color: var(--ink); margin: 0.4rem 0 1.6rem;
}
.cs-sub { font-size: var(--step-1); font-weight: 300; color: var(--ink-2); line-height: 1.5; max-width: 42ch; }
.cs-meta {
  display: flex; flex-wrap: wrap; gap: clamp(1.5rem, 4vw, 3rem);
  margin-top: clamp(2.5rem, 5vw, 3.5rem); padding-top: 2rem;
  border-top: 1px solid var(--line-soft);
}
.cs-meta .k { font-family: var(--font-mono); font-size: 0.6rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--ink-3); margin-bottom: 7px; }
.cs-meta .v { font-size: 0.92rem; color: var(--ink); }

.cs-figure { max-width: var(--maxw); margin: 0 auto; padding: 0 var(--gutter); }
.cs-figure .media { min-height: clamp(280px, 48vw, 620px); }

.cs-section {
  max-width: var(--maxw); margin: 0 auto;
  padding: clamp(4rem, 9vw, 7rem) var(--gutter);
  display: grid; grid-template-columns: 0.8fr 1.2fr; gap: clamp(2rem, 6vw, 5rem);
  align-items: start;
}
.cs-section + .cs-section { border-top: 1px solid var(--line-soft); }
.cs-section .cs-h {
  font-family: var(--font-display); font-size: var(--step-2); font-weight: 400;
  letter-spacing: -0.02em; line-height: 1.05; color: var(--ink);
  position: sticky; top: 100px;
}
.cs-section .cs-body p {
  font-size: var(--step-0); color: var(--ink-2); line-height: 1.75; margin-bottom: 1.3rem;
}
.cs-section .cs-body p strong { color: var(--ink); font-weight: 500; }
.cs-section .cs-body p:last-child { margin-bottom: 0; }

.cs-gallery {
  max-width: var(--maxw); margin: 0 auto; padding: 0 var(--gutter) clamp(4rem,9vw,7rem);
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px;
}
.cs-gallery .media { aspect-ratio: 3/4; }
.cs-cap { font-family: var(--font-mono); font-size: 0.62rem; letter-spacing: 0.06em; color: var(--ink-3); margin-top: 12px; }

.cs-stats {
  max-width: var(--maxw); margin: 0 auto;
  padding: clamp(4rem,9vw,6rem) var(--gutter);
  border-top: 1px solid var(--line-soft);
  display: grid; grid-template-columns: repeat(4, 1fr); gap: clamp(1.5rem,4vw,3rem);
}
.cs-stat .n { font-family: var(--font-display); font-size: clamp(2.4rem,5vw,3.6rem); font-weight: 400; letter-spacing: -0.03em; color: var(--ink); line-height: 1; }
.cs-stat .l { font-family: var(--font-mono); font-size: 0.62rem; letter-spacing: 0.06em; color: var(--ink-3); margin-top: 10px; }

@media (max-width: 820px) {
  .cs-section { grid-template-columns: 1fr; gap: 1.5rem; }
  .cs-section .cs-h { position: static; }
  .cs-gallery { grid-template-columns: 1fr; }
  .cs-stats { grid-template-columns: repeat(2, 1fr); }
}


/* ═══════════════════════════════════════════════════
   23. REDUCED MOTION
═══════════════════════════════════════════════════ */

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
  .grain { display: none; }
  .js .reveal { opacity: 1 !important; transform: none !important; }
  .js .split-words .w-in { opacity: 1 !important; transform: none !important; filter: none !important; }
  .parx, .drift, .bgword { transform: none !important; }
  .shimmer { animation: none !important; -webkit-text-fill-color: var(--ink); color: var(--ink); }
  .tilt { transform: none !important; }
  .media img { transform: none !important; }
  #preloader { display: none !important; }
}
