/* ============================================================
   Malvern Chatikobo Portfolio
   Design system tokens + component styles
   ============================================================ */

/* --- Fonts ---
   Loaded once for all 7 roulette themes: Space Grotesk / Hanken Grotesk / JetBrains Mono
   are the site's original "Earth" pairing; Inter (Grayscale), Playfair Display + Lora
   (Editorial), Rajdhani (Neon), Quicksand + Nunito (Pastel) are added for the other themes. */
@import url('https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@300;400;500;600;700&family=Hanken+Grotesk:wght@300;400;500;600;700&family=JetBrains+Mono:wght@400;500;600&family=Inter:wght@400;500;600;700&family=Playfair+Display:wght@500;600;700&family=Lora:wght@400;500;600&family=Rajdhani:wght@500;600;700&family=Quicksand:wght@500;600;700&family=Nunito:wght@400;500;600;700&display=swap');

/* --- Color tokens --- */
:root {
  --clay-50:  #faf6f1;
  --clay-100: #f3e9dd;
  --clay-200: #e6d2bb;
  --clay-300: #d4b48f;
  --clay-400: #bd8f60;
  --clay-500: #a9743f;
  --clay-600: #8b4513;
  --clay-700: #74380f;
  --clay-800: #5c2d0e;
  --clay-900: #4a2610;
  --clay-950: #2b1608;

  --sand-50:  #faf8f5;
  --sand-100: #f4f0ea;
  --sand-200: #e9e2d8;
  --sand-300: #d8cdbe;
  --sand-400: #b3a594;
  --sand-500: #8a7c6b;
  --sand-600: #6b5d4f;
  --sand-700: #4f443a;
  --sand-800: #382f28;
  --sand-900: #241d18;
  --sand-950: #15100c;

  --olive-500:      #6f7a3f;
  --olive-100:      #eef0e0;
  --ochre-500:      #b8862b;
  --terracotta-500: #b04a2f;

  --white: #ffffff;
  --black: #15100c;

  /* Semantic aliases */
  --bg:            var(--sand-50);
  --bg-subtle:     var(--sand-100);
  --surface:       var(--white);
  --surface-2:     var(--sand-100);
  --surface-inset: var(--sand-200);
  --surface-dark:  var(--sand-900);
  --text:          var(--sand-900);
  --text-muted:    var(--sand-600);
  --text-subtle:   var(--sand-500);
  --text-inverse:  var(--sand-50);
  --text-inverse-muted: var(--sand-300);
  --text-on-accent:var(--white);
  --accent:        var(--clay-600);
  --accent-hover:  var(--clay-700);
  --accent-active: var(--clay-800);
  --accent-soft:   var(--clay-100);
  --accent-text:   var(--clay-700);
  --border:        var(--sand-200);
  --border-strong: var(--sand-300);
  --border-accent: var(--clay-300);
  --ring:          rgba(139, 69, 19, 0.35);
  --success:       var(--olive-500);
  --success-soft:  var(--olive-100);

  /* Monogram gradient — overridable by themes */
  --mono-from: var(--clay-400);
  --mono-to:   var(--clay-700);

  /* Typography */
  --font-display: 'Space Grotesk', ui-sans-serif, system-ui, sans-serif;
  --font-sans:    'Hanken Grotesk', ui-sans-serif, system-ui, sans-serif;
  --font-mono:    'JetBrains Mono', ui-monospace, 'SFMono-Regular', monospace;

  --text-xs:   0.75rem;
  --text-sm:   0.875rem;
  --text-base: 1rem;
  --text-lg:   1.125rem;
  --text-xl:   1.25rem;
  --text-2xl:  1.5rem;
  --text-3xl:  1.875rem;
  --text-4xl:  2.5rem;
  --text-5xl:  3.25rem;
  --text-6xl:  4.25rem;

  --weight-light:    300;
  --weight-regular:  400;
  --weight-medium:   500;
  --weight-semibold: 600;
  --weight-bold:     700;

  --leading-tight:   1.12;
  --leading-snug:    1.3;
  --leading-normal:  1.55;
  --leading-relaxed: 1.72;

  --tracking-tighter: -0.03em;
  --tracking-tight:   -0.015em;
  --tracking-wide:    0.04em;
  --tracking-widest:  0.18em;

  /* Spacing */
  --space-1:  0.25rem;
  --space-2:  0.5rem;
  --space-3:  0.75rem;
  --space-4:  1rem;
  --space-5:  1.25rem;
  --space-6:  1.5rem;
  --space-8:  2rem;
  --space-10: 2.5rem;
  --space-12: 3rem;
  --space-16: 4rem;
  --space-20: 5rem;
  --space-24: 6rem;
  --space-32: 8rem;

  --container:       1200px;
  --container-prose: 720px;
  --gutter:          var(--space-6);
  --section-y:       var(--space-32);

  /* Effects */
  --radius-xs:   2px;
  --radius-sm:   4px;
  --radius-md:   8px;
  --radius-lg:   12px;
  --radius-xl:   16px;
  --radius-2xl:  24px;
  --radius-full: 999px;

  --shadow-xs: 0 1px 2px rgba(43, 22, 8, 0.05);
  --shadow-sm: 0 1px 3px rgba(43, 22, 8, 0.07), 0 1px 2px rgba(43, 22, 8, 0.04);
  --shadow-md: 0 4px 12px rgba(43, 22, 8, 0.07), 0 2px 4px rgba(43, 22, 8, 0.04);
  --shadow-lg: 0 12px 28px rgba(43, 22, 8, 0.09), 0 4px 8px rgba(43, 22, 8, 0.04);
  --shadow-xl: 0 24px 48px rgba(43, 22, 8, 0.12);

  --ring-width: 3px;
  --ease-out:   cubic-bezier(0.22, 1, 0.36, 1);
  --dur-fast:   140ms;
  --dur-base:   220ms;
  --dur-slow:   400ms;

  /* Ambient decoration — derived live from the active theme's accent/surface
     tokens via color-mix(), so drifting blobs and photo washes automatically
     match whichever of the 7 roulette themes is active without redefining
     them in every [data-theme] block. */
  --ambient-1: color-mix(in srgb, var(--accent) 12%, transparent);
  --ambient-2: color-mix(in srgb, var(--accent-hover) 10%, transparent);
  --ambient-3: color-mix(in srgb, var(--success) 8%, transparent);
  --ambient-4: color-mix(in srgb, var(--accent-soft) 45%, transparent);
  --ambient-5: color-mix(in srgb, var(--accent) 8%, transparent);
  --parallax-filter: none;
}

/* ============================================================
   ROULETTE THEMES — 7 distinct token sets, applied via
   [data-theme] on <html>. The default :root values above are the
   "Earth" theme's tokens too (kept for no-JS fallback); each block
   below overrides the full themeable token set. A theme previewed
   from the playground tools (postMessage APPLY_THEME) sets these
   same custom properties as *inline* styles on <html>, which the
   cascade always ranks above these attribute-selector rules — so
   the two systems never fight each other.
   ============================================================ */

/* 1 — Grayscale: neutral shadcn-style light UI, Inter throughout */
html[data-theme="grayscale"] {
  color-scheme: light;
  --bg: #ffffff; --bg-subtle: #f4f4f5;
  --surface: #ffffff; --surface-2: #f4f4f5; --surface-dark: #18181b;
  --text: #18181b; --text-muted: #52525b; --text-subtle: #71717a;
  --text-inverse: #fafafa; --text-inverse-muted: #a1a1aa;
  --accent: #18181b; --accent-hover: #27272a; --accent-active: #09090b;
  --accent-soft: #f4f4f5; --accent-text: #27272a;
  --border: #e4e4e7; --border-strong: #d4d4d8; --border-accent: #a1a1aa;
  --ring: rgba(24,24,27,0.35);
  --black: #09090b; --white: #ffffff;
  --mono-from: #3f3f46; --mono-to: #18181b;
  --font-display: 'Inter', ui-sans-serif, system-ui, sans-serif;
  --font-sans:    'Inter', ui-sans-serif, system-ui, sans-serif;
}

/* 2 — Editorial: cream paper, ink text, serif, burgundy + gold */
html[data-theme="editorial"] {
  color-scheme: light;
  --bg: #faf7f0; --bg-subtle: #f2ede1;
  --surface: #fffdf8; --surface-2: #f2ede1; --surface-dark: #241f16;
  --text: #241f16; --text-muted: #5c5445; --text-subtle: #8a8171;
  --text-inverse: #f7f1e3; --text-inverse-muted: #baac8b;
  --accent: #7a2e2e; --accent-hover: #8f3737; --accent-active: #611f1f;
  --accent-soft: #f1e1df; --accent-text: #7a2e2e;
  --border: #e6ddc9; --border-strong: #d6c9ab; --border-accent: #b98f4e;
  --ring: rgba(122,46,46,0.30);
  --black: #1a160f; --white: #fffdf8;
  --mono-from: #b98f4e; --mono-to: #7a2e2e;
  --font-display: 'Playfair Display', ui-serif, Georgia, serif;
  --font-sans:    'Lora', ui-serif, Georgia, serif;
}

/* 3 — Earth: the site's original clay/sand palette (default tokens) */
html[data-theme="earth"] {
  color-scheme: light;
  --bg: #faf8f5; --bg-subtle: #f4f0ea;
  --surface: #ffffff; --surface-2: #f4f0ea; --surface-dark: #241d18;
  --text: #241d18; --text-muted: #6b5d4f; --text-subtle: #8a7c6b;
  --text-inverse: #faf8f5; --text-inverse-muted: #d8cdbe;
  --accent: #8b4513; --accent-hover: #74380f; --accent-active: #5c2d0e;
  --accent-soft: #f3e9dd; --accent-text: #74380f;
  --border: #e9e2d8; --border-strong: #d8cdbe; --border-accent: #d4b48f;
  --ring: rgba(139,69,19,0.35);
  --black: #15100c; --white: #ffffff;
  --mono-from: #bd8f60; --mono-to: #74380f;
  --font-display: 'Space Grotesk', ui-sans-serif, system-ui, sans-serif;
  --font-sans:    'Hanken Grotesk', ui-sans-serif, system-ui, sans-serif;
}

/* 4 — Pastel: soft lavender / mint / pink, rounded type */
html[data-theme="pastel"] {
  color-scheme: light;
  --bg: #fbf7fd; --bg-subtle: #f3ecf9;
  --surface: #ffffff; --surface-2: #f3ecf9; --surface-dark: #4a3b5c;
  --text: #3d3450; --text-muted: #7c6f8f; --text-subtle: #9c91ac;
  --text-inverse: #faf5ff; --text-inverse-muted: #d9c9ea;
  --accent: #9660b5; --accent-hover: #7f4c9e; --accent-active: #6b3d87;
  --accent-soft: #f1e3f7; --accent-text: #7f4c9e;
  --border: #ecdff5; --border-strong: #ddc7ec; --border-accent: #e0a8cf;
  --ring: rgba(150,96,181,0.35);
  --black: #3d3450; --white: #ffffff;
  --mono-from: #f3a6c9; --mono-to: #9660b5;
  --font-display: 'Quicksand', ui-sans-serif, system-ui, sans-serif;
  --font-sans:    'Nunito', ui-sans-serif, system-ui, sans-serif;
}

/* 5 — Blue Tech: deep navy dark UI, electric blue/violet accent */
html[data-theme="blue-tech"] {
  color-scheme: dark;
  --bg: #0b1220; --bg-subtle: #0f1930;
  --surface: #121b2e; --surface-2: #17233a; --surface-dark: #060a14;
  --text: #e2e8f5; --text-muted: #94a3c4; --text-subtle: #6b7a9e;
  --text-inverse: #eaf0ff; --text-inverse-muted: #8ea3c9;
  --accent: #1f7fe0; --accent-hover: #1568c4; --accent-active: #0f52a0;
  --accent-soft: #16233c; --accent-text: #6cb6ff;
  --border: #1c2942; --border-strong: #263757; --border-accent: #2f8fef;
  --ring: rgba(47,143,239,0.35);
  --black: #04070d; --white: #f5f9ff;
  --mono-from: #2f8fef; --mono-to: #7c3aed;
  --font-display: 'Space Grotesk', ui-sans-serif, system-ui, sans-serif;
  --font-sans:    'Inter', ui-sans-serif, system-ui, sans-serif;
  --parallax-filter: grayscale(0.4) saturate(0.7) brightness(0.8);
}

/* 6 — Terminal: black bg, phosphor-green monospace throughout */
html[data-theme="terminal"] {
  color-scheme: dark;
  --bg: #050805; --bg-subtle: #0a0f0a;
  --surface: #0d120d; --surface-2: #111710; --surface-dark: #000000;
  --text: #baffc9; --text-muted: #6fae7c; --text-subtle: #4f7d59;
  --text-inverse: #d8ffe0; --text-inverse-muted: #7fc98d;
  --accent: #39ff6a; --accent-hover: #2fe25c; --accent-active: #22c94c;
  --accent-soft: #0f2a17; --accent-text: #39ff6a;
  --border: #16301b; --border-strong: #1f4527; --border-accent: #39ff6a;
  --ring: rgba(57,255,106,0.35);
  --black: #000000; --white: #04120a;
  --mono-from: #145c28; --mono-to: #39ff6a;
  --font-display: 'JetBrains Mono', ui-monospace, 'SFMono-Regular', monospace;
  --font-sans:    'JetBrains Mono', ui-monospace, 'SFMono-Regular', monospace;
  --parallax-filter: grayscale(1) brightness(0.45) contrast(1.15);
}

/* 7 — Neon Noir: near-black, high-contrast magenta/cyan neon */
html[data-theme="neon"] {
  color-scheme: dark;
  --bg: #0a0510; --bg-subtle: #120a1c;
  --surface: #150c22; --surface-2: #1c1130; --surface-dark: #05020a;
  --text: #f5e9ff; --text-muted: #b79ed6; --text-subtle: #8a76ab;
  --text-inverse: #fbf3ff; --text-inverse-muted: #c9aee8;
  --accent: #e0157a; --accent-hover: #c9106b; --accent-active: #a80c58;
  --accent-soft: #2a0f24; --accent-text: #ff4fb2;
  --border: #2c1a3d; --border-strong: #3d2555; --border-accent: #00e5ff;
  --ring: rgba(224,21,122,0.40);
  --black: #030106; --white: #fff5fb;
  --mono-from: #e0157a; --mono-to: #00e5ff;
  --font-display: 'Rajdhani', ui-sans-serif, system-ui, sans-serif;
  --font-sans:    'Hanken Grotesk', ui-sans-serif, system-ui, sans-serif;
  --parallax-filter: grayscale(0.6) brightness(0.4) contrast(1.3) saturate(1.4);
}

/* ============================================================
   BASE RESET
   ============================================================ */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; }

html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }

body {
  font-family: var(--font-sans);
  font-size: var(--text-base);
  line-height: var(--leading-normal);
  color: var(--text);
  background-color: var(--bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

h1, h2, h3, h4, h5 {
  font-family: var(--font-display);
  font-weight: var(--weight-medium);
  line-height: var(--leading-tight);
  letter-spacing: var(--tracking-tight);
  color: var(--text);
  text-wrap: balance;
}

p { text-wrap: pretty; }
a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; }
ul { list-style: none; padding: 0; }
img, svg { display: block; }

::selection { background: var(--accent-soft); color: var(--accent-active); }

:focus-visible {
  outline: var(--ring-width) solid var(--ring);
  outline-offset: 2px;
  border-radius: var(--radius-sm);
}

/* ============================================================
   LAYOUT
   ============================================================ */
.ds-container {
  width: 100%;
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.ds-prose { max-width: var(--container-prose); }

/* ============================================================
   EARTH AMBIENT — slow drifting warm blobs
   ============================================================ */
.earth-ambient {
  position: relative;
  isolation: isolate;
}
.earth-ambient::before,
.earth-ambient::after {
  content: "";
  position: absolute;
  inset: -20%;
  z-index: -1;
  pointer-events: none;
  background-repeat: no-repeat;
}
.earth-ambient::before {
  background:
    radial-gradient(38% 38% at 18% 22%, var(--ambient-1) 0%, transparent 70%),
    radial-gradient(42% 42% at 82% 30%, var(--ambient-2) 0%, transparent 70%),
    radial-gradient(46% 46% at 50% 88%, var(--ambient-3) 0%, transparent 70%);
  animation: earth-drift-a 26s ease-in-out infinite;
}
.earth-ambient::after {
  background:
    radial-gradient(34% 34% at 70% 70%, var(--ambient-4) 0%, transparent 70%),
    radial-gradient(30% 30% at 28% 64%, var(--ambient-5) 0%, transparent 70%);
  animation: earth-drift-b 34s ease-in-out infinite;
}
@keyframes earth-drift-a {
  0%, 100% { transform: translate3d(0,0,0) rotate(0deg); }
  50%       { transform: translate3d(2%,-3%,0) rotate(1.5deg); }
}
@keyframes earth-drift-b {
  0%, 100% { transform: translate3d(0,0,0) scale(1); }
  50%       { transform: translate3d(-2.5%,2%,0) scale(1.06); }
}
.earth-grain::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  opacity: 0.4;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.05'/%3E%3C/svg%3E");
}
@media (prefers-reduced-motion: reduce) {
  .earth-ambient::before,
  .earth-ambient::after { animation: none; }
}

/* ============================================================
   EYEBROW
   ============================================================ */
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  font-weight: var(--weight-medium);
  letter-spacing: var(--tracking-widest);
  text-transform: uppercase;
  color: var(--accent-text);
}
.eyebrow-rule {
  display: inline-block;
  width: 24px;
  height: 1px;
  background: currentColor;
  opacity: 0.6;
}

/* ============================================================
   SECTION HEAD
   ============================================================ */
.section-head {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
  margin-bottom: var(--space-12);
}
.section-head h2 { font-size: var(--text-4xl); }
.section-head--centered {
  align-items: center;
  text-align: center;
  max-width: 640px;
  margin-inline: auto;
  margin-bottom: var(--space-12);
}
.section-subtitle {
  font-size: var(--text-lg);
  color: var(--text-muted);
  line-height: var(--leading-normal);
}

/* ============================================================
   BUTTONS
   ============================================================ */
.btn {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding: 0.625rem var(--space-5);
  border: 1px solid transparent;
  border-radius: var(--radius-md);
  font-family: var(--font-sans);
  font-size: var(--text-sm);
  font-weight: var(--weight-medium);
  line-height: 1.4;
  cursor: pointer;
  transition: background var(--dur-base) var(--ease-out),
              border-color var(--dur-base) var(--ease-out),
              color var(--dur-base) var(--ease-out),
              box-shadow var(--dur-base) var(--ease-out);
  -webkit-tap-highlight-color: transparent;
  text-decoration: none;
  white-space: nowrap;
}
.btn:active { transform: translateY(1px); }

.btn-primary {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--text-on-accent);
}
.btn-primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); }
.btn-primary:active { background: var(--accent-active); border-color: var(--accent-active); }

.btn-secondary {
  background: transparent;
  border-color: var(--accent);
  color: var(--accent-text);
}
.btn-secondary:hover { background: var(--accent-soft); }

.btn-ghost {
  background: transparent;
  border-color: transparent;
  color: var(--text-muted);
}
.btn-ghost:hover { background: var(--surface-2); color: var(--text); }

.btn-sm {
  padding: 0.375rem var(--space-4);
  font-size: var(--text-xs);
}

.btn-icon {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

/* ============================================================
   CARDS
   ============================================================ */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
}
.ds-card--interactive {
  transition: transform var(--dur-base) var(--ease-out),
              box-shadow var(--dur-base) var(--ease-out),
              border-color var(--dur-base) var(--ease-out);
}
.ds-card--interactive:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-lg);
  border-color: var(--border-accent);
}

/* ============================================================
   INPUTS
   ============================================================ */
.ds-input {
  width: 100%;
  padding: 0.625rem var(--space-4);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  font-family: var(--font-sans);
  font-size: var(--text-base);
  color: var(--text);
  transition: border-color var(--dur-base) var(--ease-out),
              box-shadow var(--dur-base) var(--ease-out);
  appearance: none;
}
.ds-input::placeholder { color: var(--text-subtle); }
.ds-input:hover:not(:focus) { border-color: var(--border-strong); }
.ds-input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 var(--ring-width) var(--ring);
}
textarea.ds-input { resize: vertical; min-height: 120px; }

/* ============================================================
   NAVBAR
   ============================================================ */
.navbar {
  position: fixed;
  top: 0;
  width: 100%;
  z-index: 1000;
  background: color-mix(in srgb, var(--surface) 88%, transparent);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  transition: box-shadow var(--dur-base) var(--ease-out);
}
.navbar.scrolled { box-shadow: var(--shadow-sm); }

.nav-container {
  max-width: var(--container);
  margin-inline: auto;
  padding: var(--space-4) var(--gutter);
  display: flex;
  align-items: center;
  gap: var(--space-8);
}

.nav-brand {
  font-family: var(--font-display);
  font-weight: var(--weight-semibold);
  font-size: var(--text-base);
  color: var(--text);
  white-space: nowrap;
  margin-right: auto;
}

.nav-menu {
  display: flex;
  align-items: center;
  gap: var(--space-6);
}

.nav-link {
  position: relative;
  font-size: var(--text-sm);
  font-weight: var(--weight-medium);
  color: var(--text-muted);
  transition: color var(--dur-base) var(--ease-out);
  padding-bottom: 2px;
}
.nav-link::after {
  content: '';
  position: absolute;
  left: 0;
  bottom: -4px;
  height: 1.5px;
  width: 0;
  background: var(--accent);
  transition: width var(--dur-base) var(--ease-out);
}
.nav-link:hover,
.nav-link.active { color: var(--text); }
.nav-link:hover::after,
.nav-link.active::after { width: 100%; }

.hamburger {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  padding: var(--space-2);
  cursor: pointer;
}
.bar {
  width: 22px;
  height: 2px;
  background: var(--text);
  border-radius: var(--radius-full);
  transition: transform var(--dur-base) var(--ease-out), opacity var(--dur-base) var(--ease-out);
}
.hamburger.active .bar:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.hamburger.active .bar:nth-child(2) { opacity: 0; }
.hamburger.active .bar:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ============================================================
   SECTION PARALLAX BACKGROUNDS
   ============================================================ */
.parallax-bg {
  position: absolute;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background-size: 100% 100%, cover;
  background-position: center, center;
  background-attachment: scroll, fixed;
  background-repeat: no-repeat, no-repeat;
  filter: var(--parallax-filter, none);
  transition: filter 0.7s var(--ease-out);
}
/* B&W mode when a color simulation (playground palette preview) is active */
body.theme-applied .parallax-bg {
  filter: grayscale(1) brightness(0.82);
  transition: filter 0.7s var(--ease-out);
}
.hero-parallax-bg {
  background-image:
    linear-gradient(color-mix(in srgb, var(--bg) 80%, transparent), color-mix(in srgb, var(--bg) 87%, transparent)),
    url('https://images.unsplash.com/photo-1751200065697-4461cc2b43cb?w=1920&q=80&auto=format&fit=crop');
}
.experience-parallax-bg {
  background-image:
    linear-gradient(color-mix(in srgb, var(--surface) 86%, transparent), color-mix(in srgb, var(--surface) 93%, transparent)),
    url('https://images.unsplash.com/photo-1743862558309-d3e9da38404c?w=1920&q=80&auto=format&fit=crop');
}
.contact-parallax-bg {
  background-image:
    linear-gradient(color-mix(in srgb, var(--surface-dark) 68%, transparent), color-mix(in srgb, var(--surface-dark) 78%, transparent)),
    url('https://images.unsplash.com/photo-1754548930550-be9fa88874f4?w=1920&q=80&auto=format&fit=crop');
}

/* ============================================================
   HERO
   ============================================================ */
.hero {
  padding-top: calc(var(--section-y) + 40px);
  padding-bottom: var(--section-y);
  overflow: hidden;
}
.hero-inner {
  display: grid;
  grid-template-columns: 1.35fr 0.9fr;
  gap: var(--space-16);
  align-items: center;
}

.hero-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  font-weight: var(--weight-medium);
  letter-spacing: var(--tracking-widest);
  text-transform: uppercase;
  color: var(--accent-text);
  margin-bottom: var(--space-5);
}

.hero-name {
  font-size: clamp(2.6rem, 6vw, var(--text-6xl));
  letter-spacing: var(--tracking-tighter);
  margin-bottom: var(--space-4);
}

.hero-title {
  font-family: var(--font-sans);
  font-size: var(--text-xl);
  font-weight: var(--weight-medium);
  color: var(--accent-text);
  margin-bottom: var(--space-5);
}

.hero-description {
  font-size: var(--text-lg);
  color: var(--text-muted);
  line-height: var(--leading-relaxed);
  max-width: 540px;
  margin-bottom: var(--space-8);
}

.hero-buttons {
  display: flex;
  gap: var(--space-3);
  flex-wrap: wrap;
  margin-bottom: var(--space-12);
}

/* Upgrade hero buttons to standard size */
.hero-buttons .btn {
  padding: 0.75rem var(--space-6);
  font-size: var(--text-base);
}

.hero-stats {
  display: flex;
  gap: var(--space-10);
}
.stat-value {
  display: block;
  font-family: var(--font-display);
  font-size: var(--text-2xl);
  font-weight: var(--weight-semibold);
  color: var(--text);
  letter-spacing: var(--tracking-tight);
}
.stat-label {
  display: block;
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  letter-spacing: var(--tracking-wide);
  text-transform: uppercase;
  color: var(--text-muted);
  margin-top: var(--space-1);
}

/* Monogram */
.hero-visual {
  display: flex;
  justify-content: center;
}
.hero-monogram-wrap {
  position: relative;
  width: 280px;
  height: 280px;
}
.hero-monogram {
  position: absolute;
  inset: 0;
  border-radius: var(--radius-2xl);
  background: linear-gradient(150deg, var(--mono-from), var(--mono-to));
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-xl);
  font-family: var(--font-display);
  font-size: 5rem;
  font-weight: var(--weight-bold);
  color: var(--text-inverse);
  letter-spacing: -0.04em;
}
.hero-badge {
  position: absolute;
  bottom: -18px;
  left: -18px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--space-2) var(--space-4);
  box-shadow: var(--shadow-md);
  display: flex;
  align-items: center;
  gap: var(--space-2);
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  font-weight: var(--weight-medium);
  color: var(--success);
  letter-spacing: var(--tracking-wide);
  white-space: nowrap;
}
.badge-dot {
  width: 8px;
  height: 8px;
  border-radius: var(--radius-full);
  background: var(--success);
  flex-shrink: 0;
  animation: badge-pulse 2s ease-in-out infinite;
}
@keyframes badge-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

/* ============================================================
   ABOUT
   ============================================================ */
.about {
  padding: var(--section-y) 0;
  background: var(--surface);
  border-top: 1px solid var(--border);
}
.about-inner {
  display: grid;
  grid-template-columns: 1fr 0.85fr;
  gap: var(--space-16);
}
.about-paragraphs {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}
.about-paragraphs p {
  font-size: var(--text-lg);
  color: var(--text-muted);
  line-height: var(--leading-relaxed);
}
.about-facts {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  padding-top: 8.5rem;
}
.fact-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  padding: var(--space-5);
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
}
.fact-label {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  letter-spacing: var(--tracking-wide);
  text-transform: uppercase;
  color: var(--accent-text);
}
.fact-value {
  font-size: var(--text-base);
  color: var(--text);
}

/* ============================================================
   SKILLS
   ============================================================ */
.skills-section {
  padding: var(--section-y) 0;
  background: var(--bg-subtle);
}
.skills-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  column-gap: var(--space-16);
  row-gap: var(--space-6);
}
.skill-row {
  display: flex;
  align-items: center;
  gap: var(--space-3);
}
.skill-row-icon {
  width: 15px;
  height: 15px;
  flex-shrink: 0;
  color: var(--accent);
}
.skill-name {
  font-size: var(--text-sm);
  font-weight: var(--weight-medium);
  color: var(--text);
  min-width: 110px;
  flex-shrink: 0;
}
.skill-track {
  flex: 1;
  height: 6px;
  background: var(--border);
  border-radius: var(--radius-full);
  overflow: hidden;
}
.skill-fill {
  height: 100%;
  width: 0;
  background: var(--accent);
  border-radius: var(--radius-full);
  transition: width 0.9s var(--ease-out);
}
.skill-pct {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  color: var(--text-muted);
  min-width: 32px;
  text-align: right;
}

/* ============================================================
   EXPERIENCE
   ============================================================ */
.experience-section {
  padding: var(--section-y) 0;
  background: var(--surface);
  border-top: 1px solid var(--border);
  position: relative;
  isolation: isolate;
}
.timeline {
  position: relative;
}
.timeline-entry {
  display: grid;
  grid-template-columns: 180px 1fr;
  gap: var(--space-8);
  position: relative;
  padding-bottom: var(--space-10);
}
.timeline-entry:not(.timeline-entry--last)::after {
  content: '';
  position: absolute;
  left: 180px;
  top: 8px;
  bottom: 0;
  width: 1px;
  background: var(--border);
  transform: translateX(calc(var(--space-8) / 2 - 0.5px));
}
.timeline-meta {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: var(--space-3);
  padding-top: 2px;
}
.timeline-period {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  letter-spacing: var(--tracking-wide);
  text-transform: uppercase;
  color: var(--text-subtle);
  text-align: right;
}
.timeline-dot {
  width: 10px;
  height: 10px;
  border-radius: var(--radius-full);
  background: var(--accent);
  border: 2px solid var(--surface);
  box-shadow: 0 0 0 2px var(--accent);
  margin-right: calc(var(--space-8) / 2 - 5px + var(--space-8));
  flex-shrink: 0;
}
.timeline-body {
  padding-left: var(--space-4);
}
.timeline-role {
  font-size: var(--text-xl);
  font-weight: var(--weight-semibold);
  color: var(--text);
  margin-bottom: var(--space-1);
}
.timeline-company {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  letter-spacing: var(--tracking-wide);
  text-transform: uppercase;
  color: var(--accent-text);
  margin-bottom: var(--space-4);
}
.timeline-duties {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}
.timeline-duties li {
  position: relative;
  padding-left: var(--space-4);
  font-size: var(--text-base);
  color: var(--text-muted);
  line-height: var(--leading-normal);
}
.timeline-duties li::before {
  content: '›';
  position: absolute;
  left: 0;
  color: var(--accent);
  font-weight: var(--weight-medium);
}

/* ============================================================
   SERVICES
   ============================================================ */
.services-section {
  padding: var(--section-y) 0;
  background: var(--bg-subtle);
}
.services-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-6);
}
.service-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  padding: var(--space-8);
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}
.service-icon-wrap {
  display: inline-flex;
  width: 48px;
  height: 48px;
  border-radius: var(--radius-md);
  background: var(--accent-soft);
  color: var(--accent-text);
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.service-icon {
  width: 22px;
  height: 22px;
}
.service-title {
  font-size: var(--text-lg);
  font-weight: var(--weight-semibold);
  color: var(--text);
}
.service-description {
  font-size: var(--text-sm);
  color: var(--text-muted);
  line-height: var(--leading-normal);
  flex: 1;
}

/* ============================================================
   PLAYGROUND
   ============================================================ */
.playground-section {
  padding: var(--section-y) 0;
  background: var(--surface);
  border-top: 1px solid var(--border);
}
.playground-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-6);
  align-items: stretch;
}
.playground-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  padding: var(--space-8);
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
  height: 100%;
}
.tool-icon-wrap {
  display: inline-flex;
  width: 48px;
  height: 48px;
  border-radius: var(--radius-md);
  background: var(--accent-soft);
  color: var(--accent-text);
  align-items: center;
  justify-content: center;
}
.tool-icon { width: 22px; height: 22px; }
.tool-title {
  font-size: var(--text-xl);
  font-weight: var(--weight-semibold);
  color: var(--text);
}
.tool-desc {
  font-size: var(--text-sm);
  color: var(--text-muted);
  line-height: var(--leading-normal);
  flex: 1;
}
.tool-actions {
  display: flex;
  gap: var(--space-3);
  flex-wrap: wrap;
  margin-top: var(--space-2);
}

.tool-frame-wrap {
  margin-top: var(--space-8);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}
.tool-frame-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-3) var(--space-4);
  border-bottom: 1px solid var(--border);
  background: var(--surface-2);
}
.tool-frame-label {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  letter-spacing: var(--tracking-wide);
  text-transform: uppercase;
  color: var(--text-muted);
}
.tool-frame-actions {
  display: flex;
  gap: var(--space-2);
  align-items: center;
}

/* ============================================================
   CONTACT
   ============================================================ */
.contact-section {
  padding: var(--section-y) 0;
  background: var(--surface-dark);
  overflow: hidden;
}
.contact-inner {
  display: grid;
  grid-template-columns: 0.9fr 1.1fr;
  gap: var(--space-16);
  align-items: start;
}
.contact-channels {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  margin-bottom: var(--space-8);
}
.contact-channel {
  display: flex;
  align-items: center;
  gap: var(--space-4);
}
.channel-icon {
  display: inline-flex;
  width: 42px;
  height: 42px;
  flex-shrink: 0;
  border-radius: var(--radius-md);
  background: rgba(255,255,255,0.08);
  color: var(--text-inverse-muted);
  align-items: center;
  justify-content: center;
}
.channel-icon svg, .channel-icon i { width: 18px; height: 18px; }
.channel-label {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  letter-spacing: var(--tracking-wide);
  text-transform: uppercase;
  color: var(--text-inverse-muted);
  margin-bottom: 2px;
}
.channel-value {
  font-size: var(--text-base);
  color: var(--text-inverse);
}
.social-links {
  display: flex;
  gap: var(--space-2);
}
.social-btn {
  display: inline-flex;
  width: 40px;
  height: 40px;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-md);
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.14);
  color: var(--text-inverse);
  transition: background var(--dur-base) var(--ease-out);
}
.social-btn:hover { background: rgba(255,255,255,0.12); }

.contact-form-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  padding: var(--space-8);
}
.contact-form {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}
.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-4);
}
.form-field {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}
.form-label {
  font-size: var(--text-sm);
  font-weight: var(--weight-medium);
  color: var(--text);
}
.contact-success {
  display: none;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: var(--space-3);
  padding: var(--space-12) 0;
}
.contact-success.visible { display: flex; }
.success-icon {
  display: inline-flex;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--success-soft);
  color: var(--success);
  align-items: center;
  justify-content: center;
}

/* ============================================================
   FOOTER
   ============================================================ */
.site-footer {
  background: var(--black);
  padding: var(--space-8) 0;
}
.footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: var(--space-3);
}
.footer-brand {
  font-family: var(--font-display);
  font-weight: var(--weight-semibold);
  color: var(--text-inverse);
}
.footer-copy {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  color: var(--text-inverse-muted);
}

/* ============================================================
   THEME BAR — applied-theme notification
   ============================================================ */
.theme-bar {
  position: fixed;
  bottom: 84px;
  right: 30px;
  z-index: 998;
  background: var(--surface-dark);
  color: var(--text-inverse);
  border: 1px solid rgba(255,255,255,0.10);
  border-radius: var(--radius-lg);
  padding: var(--space-3) var(--space-5);
  box-shadow: var(--shadow-lg);
  display: flex;
  align-items: center;
  gap: var(--space-4);
  font-size: var(--text-sm);
  opacity: 0;
  visibility: hidden;
  transform: translateY(8px);
  transition: opacity var(--dur-base) var(--ease-out),
              visibility var(--dur-base) var(--ease-out),
              transform var(--dur-base) var(--ease-out);
}
.theme-bar.visible { opacity: 1; visibility: visible; transform: translateY(0); }
.theme-bar-dot {
  width: 8px; height: 8px; border-radius: var(--radius-full);
  background: var(--accent); flex-shrink: 0;
}
.theme-bar-label {
  font-family: var(--font-mono); font-size: var(--text-xs);
  letter-spacing: var(--tracking-wide); text-transform: uppercase;
  color: var(--text-inverse-muted);
}
.theme-bar-name { font-size: var(--text-sm); font-weight: var(--weight-medium); color: var(--text-inverse); }
.theme-bar-reset {
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.14);
  color: rgba(255,255,255,0.75);
  border-radius: var(--radius-sm);
  padding: 3px var(--space-3);
  font-size: var(--text-xs);
  font-family: var(--font-sans);
  cursor: pointer;
  white-space: nowrap;
  transition: background var(--dur-fast) var(--ease-out),
              color var(--dur-fast) var(--ease-out);
}
.theme-bar-reset:hover { background: rgba(255,255,255,0.15); color: white; }

/* ============================================================
   THEME ROULETTE — full-viewport reveal animation + "spin again" pill
   Overlay chrome intentionally uses a fixed neutral palette (not the
   theme tokens) so it reads consistently no matter which of the 7
   themes ends up winning; only the per-chamber swatch/glow colors
   (set inline by script.js from the same theme data used to pick the
   winner) vary.
   ============================================================ */
/* Body stays hidden (set synchronously in <head>, before first paint) until
   script.js reveals it — either instantly (reduced motion) or once the
   spin animation finishes fading the overlay out. A hard JS fallback timer
   also clears this class in case script.js ever fails to run. */
html.roulette-pending body { visibility: hidden; }

.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.roulette-overlay {
  position: fixed;
  inset: 0;
  z-index: 10000;
  visibility: visible; /* override the body-level visibility:hidden above */
  display: none;
  align-items: center;
  justify-content: center;
  background: radial-gradient(120% 120% at 50% 28%, #17171d 0%, #050507 100%);
  opacity: 1;
  transition: opacity 0.55s ease;
  font-family: 'Space Grotesk', ui-sans-serif, system-ui, sans-serif;
}
.roulette-overlay.visible { display: flex; }
.roulette-overlay.fading  { opacity: 0; }

.roulette-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2.75rem;
}

.roulette-cylinder {
  position: relative;
  width: 260px;
  height: 260px;
  flex-shrink: 0;
}
.roulette-chamber {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 68px;
  height: 68px;
  margin: -34px 0 0 -34px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
  border-radius: 50%;
  background: #1b1b22;
  border: 1px solid #2c2c36;
  transform: rotate(calc(var(--i) * 51.4286deg)) translateY(-108px) rotate(calc(var(--i) * -51.4286deg));
  transition: background 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease, transform 0.3s ease;
}
.roulette-chamber-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #55555f;
  flex-shrink: 0;
  transition: background 0.2s ease, box-shadow 0.2s ease;
}
.roulette-chamber-label {
  font-size: 0.58rem;
  font-weight: 600;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: #82828d;
  transition: color 0.2s ease;
}
.roulette-chamber.active {
  transform: rotate(calc(var(--i) * 51.4286deg)) translateY(-108px) rotate(calc(var(--i) * -51.4286deg)) scale(1.22);
  background: #24242e;
  border-color: var(--chamber-glow, #fff);
  box-shadow: 0 0 0 3px rgba(255,255,255,0.06), 0 0 20px color-mix(in srgb, var(--chamber-glow, #fff) 55%, transparent);
}
.roulette-chamber.active .roulette-chamber-dot {
  background: var(--chamber-glow, #fff);
  box-shadow: 0 0 10px color-mix(in srgb, var(--chamber-glow, #fff) 80%, transparent);
}
.roulette-chamber.active .roulette-chamber-label { color: #fff; }
.roulette-chamber.winner {
  animation: roulette-winner-pulse 0.85s ease-in-out infinite;
}

@keyframes roulette-winner-pulse {
  0%, 100% { box-shadow: 0 0 0 3px rgba(255,255,255,0.10), 0 0 20px color-mix(in srgb, var(--chamber-glow, #fff) 55%, transparent); }
  50%      { box-shadow: 0 0 0 5px rgba(255,255,255,0.22), 0 0 38px color-mix(in srgb, var(--chamber-glow, #fff) 80%, transparent); }
}

.roulette-readout {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.4rem;
  text-align: center;
}
.roulette-readout-eyebrow {
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 0.7rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: #7a7a86;
}
.roulette-readout-name {
  font-size: 1.85rem;
  font-weight: 600;
  color: #f4f4f6;
  min-height: 1.3em;
  letter-spacing: -0.01em;
  transition: color 0.2s ease;
}
.roulette-overlay.landed .roulette-readout-eyebrow { color: var(--chamber-glow, #7a7a86); }
.roulette-overlay.landed .roulette-readout-name { color: #fff; }

@media (max-width: 480px) {
  .roulette-cylinder { width: 220px; height: 220px; }
  .roulette-chamber { width: 56px; height: 56px; margin: -28px 0 0 -28px; }
  .roulette-chamber { transform: rotate(calc(var(--i) * 51.4286deg)) translateY(-90px) rotate(calc(var(--i) * -51.4286deg)); }
  .roulette-chamber.active,
  .roulette-chamber.winner {
    transform: rotate(calc(var(--i) * 51.4286deg)) translateY(-90px) rotate(calc(var(--i) * -51.4286deg)) scale(1.22);
  }
  .roulette-readout-name { font-size: 1.5rem; }
}

/* Persistent "current theme / spin again" control — bottom-LEFT, so it
   never collides with the theme-bar or scroll-top button (both bottom-right). */
.roulette-pill {
  position: fixed;
  bottom: 30px;
  left: 30px;
  z-index: 998;
  display: flex;
  align-items: center;
  gap: var(--space-3);
  background: var(--surface-dark);
  color: var(--text-inverse);
  border: 1px solid rgba(255,255,255,0.10);
  border-radius: var(--radius-full);
  padding: var(--space-2) var(--space-2) var(--space-2) var(--space-4);
  box-shadow: var(--shadow-lg);
  font-size: var(--text-sm);
}
.roulette-pill-swatch {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--accent);
  border: 2px solid rgba(255,255,255,0.25);
  flex-shrink: 0;
}
.roulette-pill-text {
  display: flex;
  flex-direction: column;
  line-height: 1.25;
}
.roulette-pill-label {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  letter-spacing: var(--tracking-wide);
  text-transform: uppercase;
  color: var(--text-inverse-muted);
}
.roulette-pill-name { font-weight: var(--weight-medium); }
.roulette-pill-btn {
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.14);
  color: rgba(255,255,255,0.85);
  border-radius: 50%;
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background var(--dur-fast) var(--ease-out);
  flex-shrink: 0;
}
.roulette-pill-btn svg { width: 15px; height: 15px; }
.roulette-pill-btn:hover { background: rgba(255,255,255,0.16); }
.roulette-pill-btn.spinning svg { animation: roulette-icon-spin 0.7s linear infinite; }
@keyframes roulette-icon-spin { to { transform: rotate(360deg); } }

@media (max-width: 480px) {
  .roulette-pill { left: 16px; bottom: 16px; padding: 6px 6px 6px 12px; }
  .roulette-pill-text { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  .roulette-overlay,
  .roulette-chamber,
  .roulette-chamber-dot,
  .roulette-chamber-label,
  .roulette-pill-btn svg {
    transition: none !important;
    animation: none !important;
  }
}

/* ============================================================
   SCROLL TO TOP
   ============================================================ */
.scroll-top {
  position: fixed;
  bottom: 30px;
  right: 30px;
  width: 44px;
  height: 44px;
  border-radius: var(--radius-full);
  background: var(--accent);
  color: var(--white);
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-md);
  opacity: 0;
  visibility: hidden;
  transform: translateY(8px);
  transition: opacity var(--dur-base) var(--ease-out),
              visibility var(--dur-base) var(--ease-out),
              transform var(--dur-base) var(--ease-out),
              background var(--dur-base) var(--ease-out);
  z-index: 999;
}
.scroll-top.visible {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}
.scroll-top:hover { background: var(--accent-hover); }
.scroll-top svg { width: 18px; height: 18px; }

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 900px) {
  .services-grid { grid-template-columns: repeat(2, 1fr); }
  .skills-grid { grid-template-columns: 1fr; }
}

@media (max-width: 768px) {
  :root { --section-y: var(--space-20); }

  /* iOS Safari doesn't support background-attachment:fixed */
  .parallax-bg {
    background-attachment: scroll, scroll;
  }

  .nav-menu {
    position: fixed;
    top: 61px;
    left: 0;
    width: 100%;
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    flex-direction: column;
    align-items: flex-start;
    padding: var(--space-4) var(--gutter);
    gap: var(--space-4);
    transform: translateY(-100%);
    opacity: 0;
    pointer-events: none;
    transition: transform var(--dur-base) var(--ease-out), opacity var(--dur-base) var(--ease-out);
    box-shadow: var(--shadow-lg);
    z-index: 999;
  }
  .nav-menu.open {
    transform: translateY(0);
    opacity: 1;
    pointer-events: auto;
  }
  .hamburger { display: flex; }
  .nav-cta { display: none; }

  .hero-inner {
    grid-template-columns: 1fr;
    text-align: center;
  }
  .hero-description { margin-inline: auto; }
  .hero-buttons { justify-content: center; }
  .hero-stats { justify-content: center; }
  .hero-visual { order: -1; }
  .hero-monogram-wrap { width: 200px; height: 200px; }
  .hero-monogram { font-size: 3.5rem; }
  .hero-badge { bottom: -14px; left: -12px; }

  .about-inner {
    grid-template-columns: 1fr;
  }
  .about-facts { padding-top: 0; }

  .timeline-entry {
    grid-template-columns: 1fr;
    gap: var(--space-3);
  }
  .timeline-entry::after { display: none; }
  .timeline-meta { flex-direction: row; align-items: center; }
  .timeline-dot { margin-right: 0; }

  .services-grid { grid-template-columns: 1fr; }
  .playground-grid { grid-template-columns: 1fr; }

  .contact-inner { grid-template-columns: 1fr; }
  .form-row { grid-template-columns: 1fr; }

  .section-head h2 { font-size: var(--text-3xl); }
}

@media (max-width: 480px) {
  .hero-name { font-size: clamp(2rem, 8vw, 2.6rem); }
  .hero-stats { flex-direction: column; gap: var(--space-4); align-items: center; }
}
