/* ============================================
   PORTFOLIO — Uma Dhamija
   styles.css

   Architecture:
   1. Design Tokens (custom properties)
   2. Light Mode Override — Warm Aurora
   3. Reset & Base
   4. Background System (storm + aurora)
   5. Custom Cursor
   6. Navigation
   7. Accessibility Controls
   8. Hero Section
   9. Section Base + Scroll Reveal
   10. Work / Project Cards
   11. Explorations
   12. Writing / Blog Cards
   13. Contact
   14. Modals
   15. Footer
   16. Case Study / Project Pages
   17. Responsive
   18. Reduced Motion + Quiet Mode
   ============================================ */


/* ============================================
   1. DESIGN TOKENS
   Using semantic names (intent, not value).
   All spacing on 8pt grid.
   ============================================ */

:root {
  /* --- Spacing (8pt grid) --- */
  --sp-1:  0.25rem;  /* 4px  */
  --sp-2:  0.5rem;   /* 8px  */
  --sp-3:  0.75rem;  /* 12px */
  --sp-4:  1rem;     /* 16px */
  --sp-6:  1.5rem;   /* 24px */
  --sp-8:  2rem;     /* 32px */
  --sp-12: 3rem;     /* 48px */
  --sp-16: 4rem;     /* 64px */
  --sp-24: 6rem;     /* 96px */

  /* --- Typography --- */
  /* Display: Cormorant Garamond — elegance, spirituality */
  /* Body: Google Sans Flex — technical precision, warmth */
  --font-display: 'Cormorant Garamond', 'Georgia', serif;
  --font-body:    'Google Sans Flex', system-ui, -apple-system, sans-serif;

  --text-xs:   0.75rem;    /* 12px — labels, captions */
  --text-sm:   0.875rem;   /* 14px — secondary body */
  --text-base: 1rem;       /* 16px — body */
  --text-lg:   1.125rem;   /* 18px — lead text */
  --text-xl:   1.25rem;    /* 20px — card titles */
  --text-2xl:  1.5rem;     /* 24px — sub-section headings */
  --text-3xl:  2rem;       /* 32px — section headings */
  --text-hero: clamp(2.75rem, 6vw, 4.5rem);
  --text-section: clamp(1.85rem, 3.5vw, 2.75rem);

  /* --- Motion --- */
  --ease-smooth: cubic-bezier(0.4, 0, 0.2, 1);
  --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
  --ease-out:    cubic-bezier(0, 0, 0.2, 1);
  --dur-fast:    150ms;
  --dur-base:    300ms;
  --dur-slow:    500ms;
  --t-base:      var(--dur-base) var(--ease-smooth);

  /* --- Layout --- */
  --max-w:      1200px;
  --max-w-text: 720px;
  --r-sm:  8px;
  --r-md:  12px;
  --r-lg:  16px;
  --r-xl:  24px;
  --r-2xl: 32px;
  --r-pill: 9999px;

  /* ============================================
     DARK MODE PALETTE (default)
     Deep indigo-black with neural plasma accents.
     WCAG contrast notes inline where critical.
     ============================================ */

  /* Backgrounds */
  --bg-base:      #07091121;  /* richest depth for shadows */
  --bg-primary:   #0b0e17;   /* page background */
  --bg-secondary: #10152a;   /* nav, footer, elevated surfaces */
  --bg-card:      #161c38;   /* card background */
  --bg-elevated:  #1c2445;   /* hovered/focused cards */

  /* Text — WCAG contrast check (on --bg-primary #0b0e17):
     --text-primary  #dde0f5 → 11.8:1 ✓ AAA
     --text-secondary #a8afdd → 6.4:1  ✓ AA
     --text-muted    #6d7498 → 3.1:1   ✓ AA (large text only — use carefully for body) */
  --text-primary:   #dde0f5;
  --text-secondary: #a8afdd;
  --text-muted:     #6d7498;
  --text-on-accent: #ffffff;

  /* Accents */
  /* --accent-primary on --bg-primary = 4.8:1 → AA ✓ */
  --accent-primary:   #8fa2ff;
  --accent-secondary: #c38fff;
  --accent-subtle:    rgba(143, 162, 255, 0.1);
  --accent-glow:      rgba(143, 162, 255, 0.18);
  --accent-glow-lg:   rgba(143, 162, 255, 0.32);

  /* Glass & Borders */
  --glass-bg:           rgba(14, 18, 52, 0.58);
  --glass-border:       rgba(143, 162, 255, 0.13);
  --glass-border-hover: rgba(143, 162, 255, 0.28);
  --border-subtle:      rgba(143, 162, 255, 0.07);

  /* Shadows */
  --shadow-sm:    0 2px 8px rgba(0, 0, 0, 0.3);
  --shadow-card:  0 4px 24px rgba(0, 0, 0, 0.35);
  --shadow-hover: 0 16px 48px rgba(0, 0, 0, 0.55), 0 0 0 1px var(--glass-border-hover);
  --shadow-glass: 0 8px 32px rgba(0, 0, 0, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.04);
}


/* ============================================
   2. LIGHT MODE OVERRIDE — Warm Aurora
   
   Philosophy: This is NOT a white inversion of dark mode.
   It's a distinct, living experience — warm ivory surfaces,
   three drifting aurora orbs, and a gentle radial cursor 
   glow replacing the lightning effect.

   WCAG contrast checked:
   --text-primary  #1c1814 on --bg-primary #fdf9f3 → 17.4:1 ✓ AAA
   --text-secondary #4a3f33 on --bg-primary          → 8.9:1  ✓ AAA
   --accent-primary #5046e5 on --bg-primary           → 6.1:1  ✓ AA
   ============================================ */

[data-theme="light"] {
  /* Backgrounds — warm ivory scale */
  --bg-primary:   #fdf9f3;
  --bg-secondary: #fff8f0;
  --bg-card:      rgba(255, 252, 246, 0.82);
  --bg-elevated:  #f4ede2;

  /* Text — warm near-black */
  --text-primary:   #1c1814;
  --text-secondary: #4a3f33;
  --text-muted:     #8a7f73;
  --text-on-accent: #ffffff;

  /* Accents — warm indigo (readable on ivory) */
  --accent-primary:   #5046e5;
  --accent-secondary: #8b5cf6;
  --accent-subtle:    rgba(80, 70, 229, 0.07);
  --accent-glow:      rgba(80, 70, 229, 0.11);
  --accent-glow-lg:   rgba(80, 70, 229, 0.2);

  /* Aurora tints — used in orb gradients */
  --aurora-violet: rgba(167, 139, 250, 0.38);
  --aurora-peach:  rgba(253, 186, 140, 0.32);
  --aurora-sky:    rgba(147, 197, 253, 0.28);
  --aurora-rose:   rgba(251, 182, 206, 0.22);

  /* Glass — warm frosted */
  --glass-bg:           rgba(255, 252, 248, 0.75);
  --glass-border:       rgba(80, 70, 229, 0.1);
  --glass-border-hover: rgba(80, 70, 229, 0.22);
  --border-subtle:      rgba(80, 70, 229, 0.06);

  /* Shadows — warm, not black */
  --shadow-sm:    0 2px 8px rgba(80, 70, 229, 0.06);
  --shadow-card:  0 4px 20px rgba(80, 70, 229, 0.07);
  --shadow-hover: 0 16px 40px rgba(80, 70, 229, 0.14), 0 0 0 1px var(--glass-border-hover);
  --shadow-glass: 0 8px 32px rgba(80, 70, 229, 0.07), inset 0 1px 0 rgba(255, 255, 255, 0.9);
}

/* Large text accessibility mode */
body.large-text {
  --text-base: 1.125rem;
  --text-sm:   1rem;
  --text-lg:   1.25rem;
}


/* ============================================
   3. RESET & BASE
   ============================================ */

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

html {
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
  /* scroll-behavior: smooth is set here as fallback;
     JS overrides with reduced-motion awareness */
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-body);
  font-size: var(--text-base);
  background: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.65;
  overflow-x: hidden;
  /* Only transition color & bg — avoids all-property thrash */
  transition: background-color 0.4s var(--ease-smooth), color 0.4s var(--ease-smooth);
}

/* Fix: 100% not 100vw — prevents horizontal overflow
   in constrained parent containers */
img {
  max-width: 100%;
  height: auto;
  display: block;
}

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

button, [role="button"] {
  font-family: inherit;
  cursor: pointer;
}

/* ============================================
   FOCUS STYLES — WCAG 2.2 AA Requirement
   :focus-visible = keyboard users only.
   Mouse users see no ring (prevents visual noise).
   Ring is always 2px solid in accent color.
   ============================================ */

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

:focus:not(:focus-visible) {
  outline: none;
}

/* Ensure interactive elements are reachable by keyboard */
a, button, input, textarea, select, [tabindex]:not([tabindex="-1"]) {
  /* Already covered by :focus-visible — just ensuring no 
     overrides accidentally remove outlines */
}


/* ============================================
   4. BACKGROUND SYSTEM
   
   Dark: storm-base (texture) + storm-reveal (lightning cursor)
   Light: aurora orbs + cursor radial glow
   
   Z-index stack:
   0 — bg-layer (contains all bg elements)
   1 — storm-reveal / aurora-layer
   2 — light-cursor-glow
   10 — hero content
   900 — nav
   9000 — modals
   ============================================ */

/* Root container — fixed, pointer-events: none */
.bg-layer {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
}

/* --- Dark mode: atmospheric base --- */
/* Heavy blur + very low opacity — creates soft textural depth
   without distracting from content */
.storm-base {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(
      160deg,
      rgba(7, 9, 22, 0.94) 0%,
      rgba(11, 14, 23, 0.85) 50%,
      rgba(15, 20, 42, 0.9) 100%
    ),
    url('images/thunder.jpeg') center / cover no-repeat;
  background-attachment: fixed;
  filter: blur(28px) brightness(0.1) contrast(0.75);
  opacity: 0.07;
}

[data-theme="light"] .storm-base { display: none; }

/* --- Dark mode: lightning cursor reveal ---
   This IS the signature interaction.
   JS applies mask-image to create the spotlight.
   mix-blend-mode: screen → additive glow quality. */
.storm-reveal {
  position: fixed;
  inset: 0;
  background: url('images/thunder.jpeg') center / cover;
  background-attachment: fixed;
  filter: brightness(0.48) contrast(1.2) saturate(0.85);
  opacity: 0;
  transition: opacity var(--dur-slow) var(--ease-smooth);
  z-index: 1;
  pointer-events: none;
  mix-blend-mode: screen;
  will-change: mask-image;
}

/* Show reveal when animations are on */
body:not(.quiet-mode) .storm-reveal { opacity: 1; }

/* Never show in light mode — different effect used */
[data-theme="light"] .storm-reveal { display: none; }

/* --- Light mode: living aurora orbs ---
   Three gradient orbs drift slowly in organic paths.
   Pure CSS animation — no JS needed for this layer.
   The cursor glow (light-cursor-glow) adds the
   interactive element separately. */
.aurora-layer {
  position: absolute;
  inset: 0;
  opacity: 0;
  transition: opacity 0.8s var(--ease-smooth);
  pointer-events: none;
}

[data-theme="light"] .aurora-layer { opacity: 1; }

.aurora-orb {
  position: absolute;
  border-radius: 50%;
  /* Heavy blur creates smooth, light-leak quality */
  filter: blur(100px);
  will-change: transform;
  /* Ensure orbs don't cause scrollbars */
  overflow: hidden;
}

.aurora-orb-1 {
  width: clamp(400px, 55vw, 750px);
  height: clamp(400px, 55vw, 750px);
  background: radial-gradient(circle, var(--aurora-violet, rgba(167,139,250,0.38)) 0%, transparent 70%);
  top: -15%;
  left: -8%;
  animation: aurora-drift-1 30s ease-in-out infinite;
}

.aurora-orb-2 {
  width: clamp(350px, 45vw, 620px);
  height: clamp(350px, 45vw, 620px);
  background: radial-gradient(circle, var(--aurora-peach, rgba(253,186,140,0.32)) 0%, transparent 70%);
  top: 30%;
  right: -12%;
  animation: aurora-drift-2 38s ease-in-out infinite;
}

.aurora-orb-3 {
  width: clamp(300px, 40vw, 560px);
  height: clamp(300px, 40vw, 560px);
  background: radial-gradient(circle, var(--aurora-sky, rgba(147,197,253,0.28)) 0%, transparent 70%);
  bottom: 5%;
  left: 15%;
  animation: aurora-drift-3 24s ease-in-out infinite;
}

@keyframes aurora-drift-1 {
  0%,  100% { transform: translate(0, 0) scale(1); }
  33%        { transform: translate(4%, 9%) scale(1.08); }
  66%        { transform: translate(-3%, 4%) scale(0.94); }
}

@keyframes aurora-drift-2 {
  0%,  100% { transform: translate(0, 0) scale(1); }
  40%        { transform: translate(-7%, 5%) scale(1.12); }
  75%        { transform: translate(3%, -6%) scale(0.92); }
}

@keyframes aurora-drift-3 {
  0%,  100% { transform: translate(0, 0) scale(1); }
  50%        { transform: translate(6%, -8%) scale(1.1); }
}

/* --- Light mode: cursor radial warmth ---
   MUCH more visible than before — increased opacity,
   radius, and contrast. Uses a warm violet-peach mix
   that reads clearly on the ivory background.
   JS positions via left/top (lerped). */
.light-cursor-glow {
  position: fixed;
  width: 420px;
  height: 420px;
  border-radius: 50%;
  background: radial-gradient(
    circle,
    rgba(100, 80, 240, 0.28) 0%,
    rgba(160, 80, 220, 0.18) 28%,
    rgba(80, 70, 229, 0.1) 55%,
    rgba(120, 100, 255, 0.04) 72%,
    transparent 85%
  );
  pointer-events: none;
  transform: translate(-50%, -50%);
  opacity: 0;
  transition: opacity 0.5s var(--ease-smooth);
  z-index: 2;
  will-change: left, top;
}

/* Show in light mode when animations are active */
[data-theme="light"] body:not(.quiet-mode) .light-cursor-glow { opacity: 1; }


/* ============================================
   5. CUSTOM CURSOR
   Dark mode: accent-colored dot with additive blend.
   Light mode: dark dot + warm radial glow.
   ============================================ */

.cursor-dot {
  position: fixed;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  pointer-events: none;
  z-index: 9999;
  transform: translate(-50%, -50%);
  will-change: left, top;
  transition: width 100ms, height 100ms, opacity 150ms;
}

/* Dark mode dot — glowing accent, additive blend */
body:not([data-theme="light"]) .cursor-dot {
  background: var(--accent-primary);
  opacity: 0.92;
  mix-blend-mode: plus-lighter;
  box-shadow: 0 0 6px 2px rgba(143, 162, 255, 0.4);
}

/* Light mode dot — warm dark dot, visible against ivory */
[data-theme="light"] .cursor-dot {
  background: #3730a3;  /* deep indigo — high contrast on ivory */
  opacity: 0.75;
  mix-blend-mode: normal;
  box-shadow: 0 0 0 2px rgba(80, 70, 229, 0.15);
}

/* Hide on touch/coarse devices */
@media (pointer: coarse) {
  .cursor-dot { display: none !important; }
  body { cursor: default !important; }
}

/* Custom cursor only on fine-pointer devices */
@media (pointer: fine) {
  body { cursor: none; }
}


/* ============================================
   6. NAVIGATION
   ============================================ */

.site-nav {
  position: fixed;
  top: 0;
  width: 100%;
  z-index: 900;
  padding: var(--sp-4) var(--sp-8);
  background: var(--glass-bg);
  backdrop-filter: blur(20px) saturate(1.5);
  -webkit-backdrop-filter: blur(20px) saturate(1.5);
  border-bottom: 1px solid var(--border-subtle);
  transition: background var(--t-base), box-shadow var(--t-base), border-color var(--t-base);
}

/* JS adds .scrolled class — elevated appearance */
.site-nav.scrolled {
  box-shadow: var(--shadow-glass);
  border-bottom-color: var(--glass-border);
}

.nav-container {
  max-width: var(--max-w);
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

/* Logo */
.nav-logo {
  font-family: var(--font-display);
  font-size: var(--text-xl);
  font-weight: 600;
  color: var(--accent-primary);
  letter-spacing: 0.02em;
  transition: color var(--t-base), transform var(--t-base);
}

.nav-logo:hover { color: var(--accent-secondary); }
.nav-logo:focus-visible { border-radius: var(--r-sm); }

/* Nav links */
.nav-links {
  display: flex;
  list-style: none;
  gap: var(--sp-8);
  align-items: center;
}

.nav-links a {
  color: var(--text-secondary);
  font-weight: 500;
  font-size: var(--text-sm);
  letter-spacing: 0.025em;
  position: relative;
  padding: var(--sp-1) 0;
  transition: color var(--t-base);
}

.nav-links a:hover,
.nav-links a[aria-current="true"] {
  color: var(--accent-primary);
}

/* Animated underline indicator */
.nav-links a::after {
  content: '';
  position: absolute;
  bottom: -3px;
  left: 0;
  width: 0;
  height: 1.5px;
  background: var(--accent-primary);
  border-radius: var(--r-pill);
  transition: width var(--dur-base) var(--ease-out);
}

.nav-links a:hover::after,
.nav-links a[aria-current="true"]::after { width: 100%; }

/* Mobile hamburger toggle */
.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  background: none;
  border: none;
  padding: var(--sp-2);
  border-radius: var(--r-sm);
  cursor: pointer;
  min-width: 44px;  /* WCAG: minimum 44px touch target */
  min-height: 44px;
}

.nav-toggle span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--text-primary);
  border-radius: var(--r-pill);
  transition: transform var(--dur-base) var(--ease-smooth),
              opacity var(--dur-base);
  transform-origin: center;
}

/* X state when open */
.nav-toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; transform: scaleX(0); }
.nav-toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }


/* ============================================
   7. ACCESSIBILITY CONTROLS
   Minimal glass panel with clear hover/focus states.
   ============================================ */

.accessibility-controls {
  position: fixed;
  top: 4.75rem;
  right: var(--sp-6);
  z-index: 901;
  display: flex;
  flex-direction: column;
  gap: var(--sp-2);
  padding: var(--sp-1);
  border-radius: var(--r-lg);
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  box-shadow: var(--shadow-sm);
  opacity: 0.84;
  transition: opacity var(--t-base), border-color var(--t-base);
}

/* Show fully on hover OR when keyboard focus is inside */
.accessibility-controls:hover,
.accessibility-controls:focus-within {
  opacity: 1;
  border-color: var(--glass-border-hover);
}

.control-btn {
  width: 2.5rem;
  height: 2.5rem;
  min-width: 44px;
  min-height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.95rem;
  cursor: pointer;
  position: relative;
  isolation: isolate;
  overflow: hidden;
  border: 1px solid var(--border-subtle);
  border-radius: var(--r-sm);
  background: transparent;
  box-shadow: none;
  color: var(--text-secondary);
  transition: transform var(--dur-fast) ease,
              background-color var(--t-base),
              border-color var(--t-base),
              color var(--t-base);
}

.control-btn::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: radial-gradient(
    52px circle at var(--btn-mx, 50%) var(--btn-my, 50%),
    rgba(143, 162, 255, 0.28) 0%,
    transparent 78%
  );
  opacity: 0;
  transition: opacity var(--dur-fast) ease;
  pointer-events: none;
  z-index: 0;
}

.control-btn::after { content: none; }

.control-btn:hover {
  color: var(--text-primary);
  border-color: var(--glass-border-hover);
  background: var(--accent-subtle);
  transform: translateY(-1px);
}

.control-btn:hover::before { opacity: 0.65; }

.control-btn.active {
  color: var(--text-primary);
  background: rgba(143, 162, 255, 0.18);
  border-color: var(--accent-primary);
}

[data-theme="light"] .control-btn.active { background: rgba(80, 70, 229, 0.15); }

.control-btn > i { position: relative; z-index: 1; }


/* ============================================
   8. HERO SECTION
   ============================================ */

.hero-section {
  position: relative;
  min-height: 100svh; /* svh handles mobile browser chrome correctly */
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--sp-8);
  z-index: 10;
  overflow: hidden;
}

.hero-content {
  position: relative;
  z-index: 10;
  text-align: center;
  max-width: 760px;
  width: 100%;
  padding: var(--sp-12) var(--sp-8);
  /* Dark mode: very subtle glass so lightning can bleed through */
  background: rgba(8, 10, 22, 0.32);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  border: 1px solid var(--glass-border);
  border-radius: var(--r-2xl);
  box-shadow: var(--shadow-glass);
}

/* Light mode: warmer, more opaque glass panel */
[data-theme="light"] .hero-content {
  background: rgba(255, 252, 248, 0.72);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-color: var(--glass-border);
  box-shadow: var(--shadow-glass);
}

/* Profile image */
.profile-image {
  width: 140px;
  height: 140px;
  margin: 0 auto var(--sp-6);
  border-radius: 50%;
  overflow: hidden;
  border: 3px solid var(--glass-border);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3),
              0 0 0 8px var(--accent-subtle);
  transition: transform var(--t-base), box-shadow var(--t-base);
}

.profile-image:hover {
  transform: scale(1.04) translateY(-2px);
  box-shadow: 0 14px 40px rgba(0, 0, 0, 0.35),
              0 0 0 10px var(--accent-subtle);
}

.profile-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Hero name — display font, elegant weight */
.hero-name {
  font-family: var(--font-display);
  font-size: var(--text-hero);
  font-weight: 300; /* Light weight = more elegance for Cormorant */
  letter-spacing: 0.05em;
  color: var(--text-primary);
  line-height: 1.05;
  margin-bottom: var(--sp-3);
}

/* Role / subtitle */
.hero-role {
  font-size: clamp(0.82rem, 1.2vw, 0.95rem);
  letter-spacing: 0.06em;
  text-transform: lowercase;
  color: var(--text-secondary);
  font-weight: 500;
  line-height: 1.55;
  max-width: 46rem;
  margin: 0 auto var(--sp-6);
}

/* Bio — readable, not too dense */
.hero-bio {
  font-size: var(--text-base);
  color: var(--text-secondary);
  max-width: 520px;
  margin: 0 auto var(--sp-8);
  line-height: 1.82;
}

/* Social icons row */
.social-links {
  display: flex;
  gap: var(--sp-3);
  justify-content: center;
  margin-bottom: var(--sp-8);
  flex-wrap: wrap;
}

.social-link {
  width: 2.5rem;
  height: 2.5rem;
  min-width: 44px;
  min-height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.05rem;
  position: relative;
  isolation: isolate;
  overflow: visible;
  border: 1px solid var(--glass-border);
  border-radius: var(--r-sm);
  background: var(--glass-bg);
  box-shadow: var(--shadow-sm);
  color: var(--text-secondary);
  transition: transform var(--dur-fast) ease,
              background-color var(--t-base),
              border-color var(--t-base),
              color var(--t-base);
}

/* Mouse-tracking glow on social icons */
.social-link::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: radial-gradient(
    52px circle at var(--btn-mx, 50%) var(--btn-my, 50%),
    rgba(143, 162, 255, 0.28) 0%,
    transparent 78%
  );
  opacity: 0;
  transition: opacity var(--dur-fast) ease;
  pointer-events: none;
  z-index: 0;
}

.social-link::after {
  content: attr(title);
  position: absolute;
  left: 50%;
  bottom: calc(100% + 0.5rem);
  transform: translate(-50%, 4px);
  background: var(--bg-secondary);
  color: var(--text-primary);
  border: 1px solid var(--border-subtle);
  border-radius: var(--r-sm);
  padding: 0.28rem 0.55rem;
  font-size: var(--text-xs);
  line-height: 1;
  letter-spacing: 0.03em;
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  transition: opacity var(--dur-fast) ease, transform var(--dur-fast) ease;
  box-shadow: var(--shadow-sm);
  z-index: 5;
}

.social-link:hover {
  color: var(--text-primary);
  border-color: var(--glass-border-hover);
  background: var(--accent-subtle);
  transform: translateY(-1px);
}

.social-link:hover::before { opacity: 0.7; }
.social-link:hover::after,
.social-link:focus-visible::after {
  opacity: 1;
  transform: translate(-50%, 0);
}
.social-link > i { position: relative; z-index: 1; }

/* CTA button group */
.cta-group {
  display: flex;
  gap: var(--sp-3);
  justify-content: center;
  flex-wrap: wrap;
}

/* ============================================
   BUTTON SYSTEM
   Minimal glass treatment with subtle hover glow.
   JS still sets --btn-mx / --btn-my for pointer-aware highlights.
   ============================================ */

.btn {
  padding: 0.78rem 1.7rem;
  border-radius: var(--r-pill);
  font-weight: 550;
  font-size: var(--text-sm);
  letter-spacing: 0.01em;
  display: inline-flex;
  align-items: center;
  gap: var(--sp-2);
  min-height: 44px;
  cursor: pointer;
  position: relative;
  isolation: isolate;
  overflow: hidden;
  border: 1px solid var(--glass-border);
  text-decoration: none;
  background: rgba(12, 16, 34, 0.72);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.3);
  color: var(--text-primary);
  transition: transform var(--dur-fast) ease,
              background-color var(--t-base),
              border-color var(--t-base),
              box-shadow var(--t-base),
              color var(--t-base);
}

/* Mouse-tracking glow — JS sets --btn-mx / --btn-my (percentages) */
.btn::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: radial-gradient(
    90px circle at var(--btn-mx, 50%) var(--btn-my, 50%),
    rgba(143, 162, 255, 0.22) 0%,
    rgba(143, 162, 255, 0.12) 45%,
    transparent 80%
  );
  opacity: 0;
  transition: opacity var(--dur-fast) ease;
  pointer-events: none;
  z-index: 0;
}

.btn:hover::before { opacity: 0.85; }

.btn::after { content: none; }

/* Hover: lift */
.btn:hover {
  transform: translateY(-1px);
  border-color: var(--glass-border-hover);
  background: rgba(20, 26, 52, 0.82);
  box-shadow: 0 12px 26px rgba(0, 0, 0, 0.34);
}

/* Press: sink */
.btn:active {
  transform: translateY(0);
  box-shadow: 0 5px 14px rgba(0, 0, 0, 0.3);
}

.btn-primary {
  background: linear-gradient(
    180deg,
    rgba(143, 162, 255, 0.2) 0%,
    rgba(17, 22, 44, 0.82) 100%
  );
}

.btn-secondary { background: rgba(11, 15, 30, 0.65); }

.btn-primary:hover { background: linear-gradient(180deg, rgba(143, 162, 255, 0.3), rgba(17, 22, 44, 0.88)); }
.btn-secondary:hover { background: rgba(17, 22, 44, 0.8); }

.btn-primary:active,
.btn-secondary:active { transform: translateY(0); }

.btn > span,
.btn > i {
  position: relative;
  z-index: 1;
}

/* Primary: warmer purple glow tint on tracking */
.btn-primary::before {
  background: radial-gradient(
    90px circle at var(--btn-mx, 50%) var(--btn-my, 50%),
    rgba(195, 143, 255, 0.25) 0%,
    rgba(143, 162, 255, 0.18) 45%,
    transparent 80%
  );
}

/* Light mode button treatments */
[data-theme="light"] .btn {
  background: rgba(255, 252, 246, 0.92);
  color: #2a2440;
  border-color: rgba(80, 70, 229, 0.17);
  box-shadow: 0 8px 20px rgba(80, 70, 229, 0.12);
}

[data-theme="light"] .btn:hover {
  background: rgba(255, 252, 246, 1);
  border-color: rgba(80, 70, 229, 0.28);
  box-shadow: 0 12px 24px rgba(80, 70, 229, 0.16);
}

[data-theme="light"] .btn-primary {
  background: linear-gradient(
    180deg,
    rgba(80, 70, 229, 0.14) 0%,
    rgba(255, 252, 246, 0.96) 100%
  );
}

[data-theme="light"] .btn-secondary { background: rgba(255, 252, 246, 0.9); }
[data-theme="light"] .btn-primary:hover {
  background: linear-gradient(
    180deg,
    rgba(80, 70, 229, 0.2) 0%,
    rgba(255, 252, 246, 1) 100%
  );
}

/* Animated scroll indicator */
.scroll-indicator {
  position: absolute;
  bottom: var(--sp-8);
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--sp-2);
  color: var(--text-muted);
  font-size: var(--text-xs);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  z-index: 10;
  pointer-events: none;
  animation: scroll-fade 2.5s ease-in-out infinite;
}

.scroll-indicator::after {
  content: '';
  width: 1px;
  height: 36px;
  background: linear-gradient(to bottom, var(--accent-primary), transparent);
  border-radius: var(--r-pill);
}

@keyframes scroll-fade {
  0%, 100% { opacity: 0.4; transform: translateX(-50%) translateY(0); }
  50%       { opacity: 0.85; transform: translateX(-50%) translateY(5px); }
}


/* ============================================
   9. SECTION BASE + SCROLL REVEAL
   ============================================ */

.section {
  position: relative;
  z-index: 10;
  padding: var(--sp-24) var(--sp-8);
  max-width: var(--max-w);
  margin: 0 auto;
}

/* Section header block */
.section-header {
  text-align: center;
  margin-bottom: var(--sp-12);
}

/* Label above section title */
.section-label {
  display: inline-block;
  font-size: var(--text-xs);
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--accent-primary);
  font-weight: 600;
  margin-bottom: var(--sp-3);
}

.section-title {
  font-family: var(--font-display);
  font-size: var(--text-section);
  font-weight: 400;
  color: var(--text-primary);
  margin-bottom: var(--sp-4);
  letter-spacing: 0.025em;
  line-height: 1.15;
}

.section-intro {
  color: var(--text-secondary);
  max-width: 560px;
  margin: 0 auto;
  font-size: var(--text-base);
  line-height: 1.78;
}

/* --- Scroll Reveal ---
   JS adds .in-view via IntersectionObserver.
   Elements start invisible + slightly below position.
   Disabled when quiet-mode or prefers-reduced-motion. */

[data-reveal] {
  opacity: 0;
  transform: translateY(22px);
  transition: opacity 0.65s var(--ease-out),
              transform 0.65s var(--ease-out);
}

[data-reveal].in-view {
  opacity: 1;
  transform: translateY(0);
}

/* Staggered reveal for grid children */
[data-reveal-stagger] > * {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 0.55s var(--ease-out),
              transform 0.55s var(--ease-out);
}

[data-reveal-stagger].in-view > * { opacity: 1; transform: translateY(0); }
[data-reveal-stagger].in-view > *:nth-child(1) { transition-delay: 0ms; }
[data-reveal-stagger].in-view > *:nth-child(2) { transition-delay: 85ms; }
[data-reveal-stagger].in-view > *:nth-child(3) { transition-delay: 170ms; }
[data-reveal-stagger].in-view > *:nth-child(4) { transition-delay: 255ms; }
[data-reveal-stagger].in-view > *:nth-child(5) { transition-delay: 340ms; }
[data-reveal-stagger].in-view > *:nth-child(6) { transition-delay: 420ms; }


/* ============================================
   10. WORK / PROJECT CARDS
   ============================================ */

.projects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: clamp(1.75rem, 2.8vw, 2.6rem);
}

.project-card {
  display: block;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--r-xl);
  overflow: hidden;
  position: relative;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  /* Animate border + shadow, not color (avoids paint) */
  transition: transform var(--t-base),
              box-shadow var(--t-base),
              border-color var(--t-base);
}

.project-card:not(.coming-soon):hover {
  transform: translateY(-6px);
  box-shadow: var(--shadow-hover);
  border-color: var(--glass-border-hover);
}

/* Image container */
.project-thumb {
  width: 100%;
  height: 220px;
  background: linear-gradient(
    135deg,
    var(--accent-subtle) 0%,
    rgba(195, 143, 255, 0.05) 100%
  );
  overflow: hidden;
  position: relative;
}

.project-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.65s var(--ease-smooth);
}

.project-card:hover .project-thumb img { transform: scale(1.05); }

/* Placeholder when no image */
.project-thumb-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 3rem;
  color: var(--accent-primary);
  opacity: 0.25;
}

/* Card body */
.project-body {
  padding: var(--sp-6);
}

.project-body h3 {
  font-size: var(--text-xl);
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: var(--sp-2);
  line-height: 1.3;
}

.project-body p {
  color: var(--text-secondary);
  font-size: var(--text-sm);
  line-height: 1.72;
  margin-bottom: var(--sp-4);
}

/* Tag pills */
.project-tags {
  display: flex;
  gap: var(--sp-2);
  flex-wrap: wrap;
  margin-bottom: var(--sp-4);
}

.tag {
  padding: 0.3rem 0.875rem;
  background: var(--accent-subtle);
  border: 1px solid var(--border-subtle);
  border-radius: var(--r-pill);
  font-size: var(--text-xs);
  color: var(--accent-primary);
  font-weight: 500;
  letter-spacing: 0.03em;
}

/* Tool icons row */
.tools-row {
  display: flex;
  gap: var(--sp-2);
  flex-wrap: wrap;
  padding-top: var(--sp-4);
  margin-top: var(--sp-4);
  border-top: 1px solid var(--border-subtle);
}

.tool {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.25rem;
  height: 2.25rem;
  background: var(--accent-subtle);
  border: 1px solid var(--border-subtle);
  border-radius: var(--r-sm);
  color: var(--accent-primary);
  font-size: 0.95rem;
  cursor: default;
  transition: all var(--t-base);
}

.tool:hover {
  background: var(--glass-border);
  border-color: var(--accent-primary);
  transform: translateY(-2px);
}

/* Tooltip — appears above */
.tool::after {
  content: attr(data-tool);
  position: absolute;
  bottom: calc(100% + 6px);
  left: 50%;
  transform: translateX(-50%);
  background: var(--text-primary);
  color: var(--bg-primary);
  padding: 0.3rem 0.7rem;
  border-radius: var(--r-sm);
  font-size: var(--text-xs);
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--dur-base);
  font-weight: 500;
  z-index: 10;
}

.tool:hover::after,
.tool:focus-visible::after { opacity: 1; }

/* Coming Soon */
.project-card.coming-soon {
  opacity: 0.4;
  cursor: not-allowed;
  pointer-events: none;
}

.badge-coming-soon {
  display: inline-block;
  padding: 0.3rem 1rem;
  background: var(--text-muted);
  color: var(--bg-primary);
  border-radius: var(--r-pill);
  font-size: var(--text-xs);
  font-weight: 600;
  letter-spacing: 0.06em;
  margin-top: var(--sp-3);
}


/* ============================================
   11. EXPLORATIONS
   ============================================ */

.explorations-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(1.3rem, 2.2vw, 2rem);
}

.exploration-item {
  aspect-ratio: 1;
  display: block;
  width: 100%;
  padding: 0;
  background: transparent;
  appearance: none;
  -webkit-appearance: none;
  cursor: zoom-in;
  border-radius: var(--r-lg);
  overflow: hidden;
  border: 1px solid var(--border-subtle);
  transition: transform var(--t-base), box-shadow var(--t-base);
}

.exploration-item:hover {
  transform: scale(1.03);
  box-shadow: var(--shadow-hover);
}

.exploration-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.6s var(--ease-smooth);
}

.exploration-item:hover img { transform: scale(1.06); }

.exploration-item:focus-visible {
  border-color: var(--accent-primary);
  box-shadow: 0 0 0 3px var(--accent-glow), var(--shadow-hover);
}


/* ============================================
   12. WRITING / BLOG CARDS
   ============================================ */

.writing-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: var(--sp-6);
}

.writing-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--r-xl);
  padding: var(--sp-6);
  cursor: pointer;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  transition: transform var(--t-base),
              box-shadow var(--t-base),
              border-color var(--t-base);
  /* Cards need role="button" or <button> in HTML for keyboard access */
}

.writing-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-hover);
  border-color: var(--glass-border-hover);
}

.writing-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: var(--sp-4);
}

.writing-date,
.writing-read-time {
  font-size: var(--text-xs);
  color: var(--text-muted);
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.writing-card h3 {
  font-family: var(--font-display);
  font-size: var(--text-2xl);
  font-weight: 400;
  color: var(--text-primary);
  margin-bottom: var(--sp-3);
  line-height: 1.3;
}

.writing-card p {
  color: var(--text-secondary);
  font-size: var(--text-sm);
  line-height: 1.72;
  margin-bottom: var(--sp-4);
}

.read-more {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-1);
  color: var(--accent-primary);
  font-size: var(--text-sm);
  font-weight: 500;
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  transition: gap var(--dur-fast), color var(--t-base);
}

.read-more:hover {
  color: var(--accent-secondary);
  gap: var(--sp-2);
}


/* ============================================
   13. CONTACT
   ============================================ */

.contact-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--sp-16);
  align-items: start;
}

.contact-info h3 {
  font-family: var(--font-display);
  font-size: var(--text-section);
  font-weight: 400;
  color: var(--text-primary);
  margin-bottom: var(--sp-4);
  line-height: 1.2;
}

.contact-info p {
  color: var(--text-secondary);
  line-height: 1.82;
  margin-bottom: var(--sp-4);
  font-size: var(--text-base);
}

.contact-email {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-2);
  color: var(--accent-primary);
  font-weight: 500;
  font-size: var(--text-base);
  transition: color var(--t-base);
  margin-bottom: var(--sp-6);
}

.contact-email:hover { color: var(--accent-secondary); }

/* Contact form */
.contact-form {
  background: var(--bg-card);
  padding: var(--sp-8);
  border-radius: var(--r-xl);
  border: 1px solid var(--border-subtle);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.form-group { margin-bottom: var(--sp-6); }

.form-label {
  display: block;
  margin-bottom: var(--sp-2);
  font-weight: 500;
  color: var(--text-secondary);
  font-size: var(--text-sm);
}

.form-input,
.form-textarea {
  width: 100%;
  padding: 0.875rem var(--sp-4);
  background: var(--bg-secondary);
  border: 1px solid var(--border-subtle);
  border-radius: var(--r-md);
  color: var(--text-primary);
  font-family: inherit;
  font-size: var(--text-base);
  transition: border-color var(--t-base), box-shadow var(--t-base);
  -webkit-appearance: none;
}

/* Note: outline reset here + custom focus ring below
   (border + glow) is intentional — :focus-visible provides
   the outline fallback for keyboard users */
.form-input:focus,
.form-textarea:focus {
  border-color: var(--accent-primary);
  box-shadow: 0 0 0 3px var(--accent-glow);
  outline: none;
}

.form-textarea {
  resize: vertical;
  min-height: 140px;
}

.form-input::placeholder,
.form-textarea::placeholder { color: var(--text-muted); }

.contact-submit {
  width: 100%;
  max-width: none;
  justify-content: center;
  gap: var(--sp-2);
  border-radius: var(--r-md);
  padding: 0.92rem var(--sp-4);
  letter-spacing: 0.02em;
}

.contact-submit i { font-size: 0.95rem; }


/* ============================================
   14. BLOG MODALS
   ============================================ */

.modal {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.72);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  z-index: 9000;
  padding: var(--sp-8);
  overflow-y: auto;
  /* Flex used for centering, but flex-start so content 
     can scroll on short viewports */
  align-items: flex-start;
  justify-content: center;
  padding-top: 8vh;
}

.modal.active { display: flex; }

.modal-content {
  background: var(--bg-secondary);
  max-width: 740px;
  width: 100%;
  border-radius: var(--r-xl);
  padding: var(--sp-12);
  position: relative;
  border: 1px solid var(--border-subtle);
  max-height: 82vh;
  overflow-y: auto;
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.45);
  animation: modal-rise 0.38s var(--ease-spring);
}

@keyframes modal-rise {
  from { opacity: 0; transform: translateY(24px) scale(0.97); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

.modal-close {
  position: absolute;
  top: var(--sp-6);
  right: var(--sp-6);
  width: 2.25rem;
  height: 2.25rem;
  min-width: 44px;
  min-height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--accent-subtle);
  border: 1px solid var(--border-subtle);
  border-radius: var(--r-sm);
  font-size: 1.2rem;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all var(--t-base);
}

.modal-close:hover {
  background: var(--accent-primary);
  color: var(--text-on-accent);
  border-color: var(--accent-primary);
}

.modal-content h2 {
  font-family: var(--font-display);
  font-size: var(--text-3xl);
  font-weight: 400;
  text-align: left;
  margin-bottom: var(--sp-3);
  color: var(--text-primary);
  padding-right: 3rem; /* Clear close button */
}

.blog-meta {
  margin-bottom: var(--sp-6);
  padding-bottom: var(--sp-4);
  border-bottom: 1px solid var(--border-subtle);
  color: var(--text-muted);
  font-size: var(--text-sm);
}

.blog-body {
  color: var(--text-secondary);
  line-height: 1.88;
}

.blog-body p { margin-bottom: var(--sp-6); }
.blog-body p:last-child { margin-bottom: 0; }

.exploration-modal-content {
  width: auto;
  max-width: min(94vw, 1120px);
  padding: 0;
  background: transparent;
  border: none;
  box-shadow: none;
  border-radius: 0;
  overflow: visible;
  max-height: none;
}

.exploration-modal-content h2 {
  display: none;
}

.exploration-modal-image {
  display: block;
  width: auto;
  max-width: 100%;
  height: auto;
  max-height: 88vh;
  border-radius: 0;
  object-fit: contain;
  border: none;
  background: transparent;
}

.modal-image .modal-close {
  top: var(--sp-3);
  right: var(--sp-3);
  background: rgba(10, 14, 28, 0.8);
  border-color: rgba(255, 255, 255, 0.22);
  color: #fff;
}

.exploration-modal-caption {
  display: none;
}


/* ============================================
   15. FOOTER
   ============================================ */

footer {
  position: relative;
  z-index: 10;
  background: var(--bg-secondary);
  border-top: 1px solid var(--border-subtle);
  padding: var(--sp-12) var(--sp-8);
  text-align: center;
}

.footer-name {
  font-family: var(--font-display);
  font-size: var(--text-2xl);
  font-weight: 400;
  color: var(--text-primary);
  margin-bottom: var(--sp-6);
  letter-spacing: 0.04em;
}

.footer-links {
  display: flex;
  gap: var(--sp-6);
  justify-content: center;
  margin-bottom: var(--sp-6);
  flex-wrap: wrap;
}

.footer-links a {
  color: var(--text-secondary);
  font-size: var(--text-sm);
  font-weight: 500;
  transition: color var(--t-base);
  position: relative;
}

.footer-links a::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 0;
  height: 1px;
  background: var(--accent-primary);
  transition: width var(--t-base);
}

.footer-links a:hover { color: var(--accent-primary); }
.footer-links a:hover::after { width: 100%; }

.footer-copy {
  color: var(--text-muted);
  font-size: var(--text-xs);
  letter-spacing: 0.05em;
}

.scroll-top-btn {
  position: fixed;
  right: var(--sp-6);
  bottom: var(--sp-6);
  width: 2.7rem;
  height: 2.7rem;
  min-width: 44px;
  min-height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  border: 1px solid var(--glass-border);
  background: var(--glass-bg);
  color: var(--text-primary);
  box-shadow: var(--shadow-sm);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  cursor: pointer;
  z-index: 906;
  opacity: 0;
  pointer-events: none;
  transform: translateY(12px);
  transition: opacity var(--t-base),
              transform var(--t-base),
              background-color var(--t-base),
              border-color var(--t-base),
              color var(--t-base);
}

.scroll-top-btn.visible {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}

.scroll-top-btn:hover {
  background: var(--accent-subtle);
  border-color: var(--glass-border-hover);
  color: var(--accent-primary);
}


/* ============================================
   16. CASE STUDY / PROJECT PAGES
   ============================================ */

.project-page {
  position: relative;
  z-index: 10;
}

.project-page-hero {
  padding: 7rem var(--sp-8) var(--sp-12);
  max-width: 880px;
  margin: 0 auto;
  text-align: center;
}

.back-link {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-2);
  color: var(--accent-primary);
  font-size: var(--text-sm);
  font-weight: 500;
  margin-bottom: var(--sp-8);
  transition: gap var(--dur-fast), color var(--t-base);
}

.back-link:hover {
  color: var(--accent-secondary);
  gap: var(--sp-3);
}

.project-page-title {
  font-family: var(--font-display);
  font-size: clamp(2.25rem, 5vw, 3.75rem);
  font-weight: 300;
  letter-spacing: 0.04em;
  color: var(--text-primary);
  margin-bottom: var(--sp-4);
  line-height: 1.08;
}

.project-page-subtitle {
  font-size: var(--text-lg);
  color: var(--text-secondary);
  max-width: 580px;
  margin: 0 auto var(--sp-8);
  line-height: 1.72;
}

/* Meta row — role, timeline, team, year */
.project-meta-row {
  display: flex;
  gap: var(--sp-12);
  justify-content: center;
  flex-wrap: wrap;
  margin: var(--sp-8) 0;
  padding: var(--sp-6) var(--sp-8);
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--r-xl);
  backdrop-filter: blur(8px);
}

.meta-item { text-align: center; }

.meta-label {
  display: block;
  font-size: var(--text-xs);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: var(--sp-1);
}

.meta-value {
  font-size: var(--text-base);
  font-weight: 600;
  color: var(--accent-primary);
}

/* Tools row on project page */
.tools-used {
  display: flex;
  gap: var(--sp-2);
  justify-content: center;
  flex-wrap: wrap;
  margin-top: var(--sp-6);
}

/* Body content */
.project-body-content {
  max-width: 740px;
  margin: 0 auto;
  padding: 0 var(--sp-8) var(--sp-16);
}

/* Case study section */
.case-section {
  margin-bottom: var(--sp-16);
}

.case-section-title {
  font-family: var(--font-display);
  font-size: var(--text-3xl);
  font-weight: 400;
  color: var(--accent-primary);
  margin-bottom: var(--sp-6);
  letter-spacing: 0.02em;
}

.case-section p {
  color: var(--text-secondary);
  line-height: 1.88;
  margin-bottom: var(--sp-4);
  font-size: var(--text-base);
}

.case-section ul {
  list-style: none;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: var(--sp-3);
  margin: var(--sp-4) 0;
}

.case-section li {
  color: var(--text-secondary);
  padding-left: var(--sp-6);
  position: relative;
  line-height: 1.75;
  font-size: var(--text-base);
}

/* Arrow bullet — using content not background-image for encoding safety */
.case-section li::before {
  content: '→';
  position: absolute;
  left: 0;
  color: var(--accent-primary);
}

/* Case study images */
.case-img {
  width: 100%;
  border-radius: var(--r-xl);
  margin: var(--sp-8) 0;
  border: 1px solid var(--border-subtle);
  background: var(--bg-card);
  display: block;
  /* If no actual image, min-height provides visual space */
  min-height: 40px;
  object-fit: cover;
}

/* Figma / external link button */
.project-cta-link {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-2);
  padding: 0.7rem 1.5rem;
  background: var(--accent-subtle);
  color: var(--accent-primary);
  border: 1px solid var(--glass-border);
  border-radius: var(--r-pill);
  font-size: var(--text-sm);
  font-weight: 500;
  transition: all var(--t-base);
  margin-top: var(--sp-4);
}

.project-cta-link:hover {
  background: var(--accent-primary);
  color: var(--text-on-accent);
  border-color: var(--accent-primary);
  box-shadow: 0 4px 16px var(--accent-glow);
  transform: translateY(-1px);
}

/* Bottom nav footer */
.case-nav-footer {
  margin-top: var(--sp-16);
  padding-top: var(--sp-8);
  border-top: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  flex-wrap: wrap;
}

.case-nav-footer .back-link { margin-bottom: 0; }

.next-link {
  margin-left: auto;
  justify-content: flex-end;
}

.project-lead {
  font-size: var(--text-lg);
  color: var(--text-secondary);
  line-height: 1.75;
  margin-bottom: var(--sp-6);
}

.project-highlights {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--sp-3);
  margin: var(--sp-6) 0 var(--sp-8);
}

.project-highlight-item {
  padding: var(--sp-4);
  border-radius: var(--r-lg);
  border: 1px solid var(--border-subtle);
  background: var(--bg-card);
  color: var(--text-secondary);
  line-height: 1.7;
  font-size: var(--text-sm);
}

.project-highlight-item strong {
  display: block;
  color: var(--accent-primary);
  margin-bottom: var(--sp-1);
  font-size: var(--text-xs);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.case-img-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--sp-4);
  margin: var(--sp-8) 0;
}

.case-img-grid .case-img {
  margin: 0;
  height: 100%;
}

.project-page .case-img.expandable-media {
  cursor: zoom-in;
}

.case-caption {
  margin-top: var(--sp-3);
  color: var(--text-muted);
  font-size: var(--text-sm);
  line-height: 1.6;
}

.article-links {
  list-style: none;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: var(--sp-3);
  margin-top: var(--sp-4);
}

.article-links li {
  padding: 0;
}

.article-links li::before {
  content: none;
}

.article-links .project-cta-link {
  margin-top: 0;
}


/* ============================================
   17. RESPONSIVE
   ============================================ */

@media (max-width: 1100px) {
  .explorations-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 900px) {
  .contact-layout {
    grid-template-columns: 1fr;
    gap: var(--sp-8);
  }

  .project-highlights {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 768px) {
  /* Show hamburger, slide-in nav links */
  .nav-toggle { display: flex; }

  .nav-links {
    position: fixed;
    top: 4rem;
    left: 0;
    right: 0;
    background: var(--glass-bg);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    border-bottom: 1px solid var(--border-subtle);
    flex-direction: column;
    align-items: flex-start;
    padding: var(--sp-6) var(--sp-8);
    gap: var(--sp-4);
    transform: translateY(-110%);
    opacity: 0;
    transition: transform var(--t-base), opacity var(--t-base);
    z-index: 899;
    pointer-events: none;
    list-style: none;
  }

  .nav-links.open {
    transform: translateY(0);
    opacity: 1;
    pointer-events: auto;
  }

  .nav-links a { font-size: var(--text-base); }

  .accessibility-controls {
    right: var(--sp-4);
    top: 4.25rem;
  }

  .section {
    padding: var(--sp-16) var(--sp-4);
  }

  .projects-grid,
  .explorations-grid,
  .writing-grid {
    grid-template-columns: 1fr;
  }

  .hero-content {
    padding: var(--sp-8) var(--sp-6);
  }

  .modal-content {
    padding: var(--sp-6);
    border-radius: var(--r-lg);
    max-height: 88vh;
  }

  .project-page-hero {
    padding: 6rem var(--sp-4) var(--sp-8);
  }

  .project-body-content {
    padding: 0 var(--sp-4) var(--sp-12);
  }

  .project-meta-row {
    gap: var(--sp-6);
    padding: var(--sp-4);
  }

  .project-highlights,
  .case-img-grid {
    grid-template-columns: 1fr;
  }

  .case-nav-footer {
    flex-direction: column;
    align-items: flex-start;
  }

  .next-link { margin-left: 0; }

  .scroll-top-btn {
    right: var(--sp-4);
    bottom: var(--sp-4);
  }
}

@media (max-width: 480px) {
  .cta-group {
    flex-direction: column;
    align-items: center;
  }

  .btn {
    width: 100%;
    justify-content: center;
    max-width: 280px;
  }

  .contact-submit { max-width: none; }

  .footer-links { gap: var(--sp-4); }

  .social-links { gap: var(--sp-2); }
}


/* ============================================
   18. REDUCED MOTION + QUIET MODE

   prefers-reduced-motion: system preference.
   quiet-mode: user-toggled via button.
   Both disable decorative motion while keeping
   functional transitions (theme, focus states).
   ============================================ */

@media (prefers-reduced-motion: reduce) {
  body { cursor: auto !important; }

  /* Disable decorative animations — keep functional state transitions */
  .aurora-orb,
  .scroll-indicator,
  .storm-reveal,
  .light-cursor-glow,
  .cursor-dot {
    display: none !important;
  }

  /* Reveal elements immediately — no entrance animation */
  [data-reveal],
  [data-reveal-stagger] > * {
    opacity: 1 !important;
    transform: none !important;
    transition: none !important;
  }

  /* Disable card/button hover transforms */
  .project-card:hover,
  .social-link:hover,
  .btn:hover {
    transform: none !important;
  }

  @keyframes modal-rise {
    from { opacity: 1; transform: none; }
    to   { opacity: 1; transform: none; }
  }

  .scroll-top-btn,
  .scroll-top-btn.visible {
    transform: none !important;
    transition: opacity var(--dur-fast) linear !important;
  }
}

/* User-toggled quiet mode — more permissive than prefers-reduced-motion
   (keeps some transitions for usability) */
body.quiet-mode .storm-reveal,
body.quiet-mode .light-cursor-glow,
body.quiet-mode .cursor-dot { display: none !important; }

@media (pointer: fine) {
  body.quiet-mode { cursor: auto !important; }
}

body.quiet-mode .aurora-orb { animation-play-state: paused; }

body.quiet-mode [data-reveal],
body.quiet-mode [data-reveal-stagger] > * {
  opacity: 1 !important;
  transform: none !important;
}
