/* ─────────────────────────────────────────────────────────────
   Base — reset, tokens, typography
──────────────────────────────────────────────────────────────── */

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

html {
  font-size: 16px;
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* ── Design tokens ── */
:root {
  --font-display: 'Syne', sans-serif;
  --font-body:    'Inter', sans-serif;
  --font-mono:    'DM Mono', monospace;

  --radius-sm: 10px;
  --radius-md: 18px;
  --radius-lg: 28px;
  --radius-pill: 999px;

  --ease: cubic-bezier(0.65, 0, 0.35, 1);
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --dur: 0.4s;
}

/* ── Dark mode (default) — soft slate neumorphism ── */
[data-mode="dark"] {
  --bg:        #1c1d22;
  --surface:   #1c1d22;
  --text:      #e8e6e1;
  --muted:     #8a8780;
  --accent:    #c9a76a;
  --accent-2:  #6c8dff;
  --accent-dim: rgba(201, 167, 106, 0.16);

  /* Neumorphism shadows */
  --neu-light: rgba(255, 255, 255, 0.04);
  --neu-dark:  rgba(0, 0, 0, 0.55);
  --neu-raised:
    -8px -8px 20px var(--neu-light),
     10px 10px 24px var(--neu-dark);
  --neu-raised-sm:
    -4px -4px 10px var(--neu-light),
     5px 5px 12px var(--neu-dark);
  --neu-inset:
    inset 4px 4px 10px var(--neu-dark),
    inset -4px -4px 10px var(--neu-light);

  /* Liquid glass */
  --glass-bg:     rgba(28, 29, 34, 0.45);
  --glass-border: rgba(255, 255, 255, 0.10);
  --glass-hi:     rgba(255, 255, 255, 0.08);
  --nav-blur:     rgba(28, 29, 34, 0.55);

  /* Ambient blob colors */
  --blob-1: #c9a76a;
  --blob-2: #6c8dff;
  --blob-3: #b46bff;
}

/* ── Light mode — soft beige neumorphism ── */
[data-mode="light"] {
  --bg:        #e6e7ee;
  --surface:   #e6e7ee;
  --text:      #2a2c33;
  --muted:     #6e7280;
  --accent:    #b8923a;
  --accent-2:  #4a6cf7;
  --accent-dim: rgba(184, 146, 58, 0.14);

  --neu-light: rgba(255, 255, 255, 0.95);
  --neu-dark:  rgba(163, 177, 198, 0.55);
  --neu-raised:
    -9px -9px 22px var(--neu-light),
     10px 10px 26px var(--neu-dark);
  --neu-raised-sm:
    -4px -4px 10px var(--neu-light),
     5px 5px 12px var(--neu-dark);
  --neu-inset:
    inset 4px 4px 10px var(--neu-dark),
    inset -4px -4px 10px var(--neu-light);

  --glass-bg:     rgba(255, 255, 255, 0.45);
  --glass-border: rgba(255, 255, 255, 0.65);
  --glass-hi:     rgba(255, 255, 255, 0.85);
  --nav-blur:     rgba(230, 231, 238, 0.55);

  --blob-1: #ffd28a;
  --blob-2: #a5c2ff;
  --blob-3: #d9b6ff;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-weight: 400;
  font-size: 17px;
  line-height: 1.65;
  overflow-x: hidden;
  transition: background var(--dur), color var(--dur);
}

@media (hover: hover) and (pointer: fine) {
  body { cursor: none; }
}

/* Lenis required */
html.lenis, html.lenis body { height: auto; }
.lenis.lenis-smooth { scroll-behavior: auto !important; }
.lenis.lenis-smooth [data-lenis-prevent] { overscroll-behavior: contain; }
.lenis.lenis-stopped { overflow: hidden; }

/* ── Ambient gradient blobs ── */
.ambient {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
}
.blob {
  position: absolute;
  width: 55vmax;
  height: 55vmax;
  border-radius: 50%;
  filter: blur(120px);
  opacity: 0.35;
  mix-blend-mode: screen;
  will-change: transform;
}
[data-mode="light"] .blob { opacity: 0.55; mix-blend-mode: multiply; }
.blob-1 { background: var(--blob-1); top: -20vmax; left: -10vmax; }
.blob-2 { background: var(--blob-2); top: 30vmax; right: -15vmax; }
.blob-3 { background: var(--blob-3); bottom: -20vmax; left: 20vmax; }

/* ── Liquid glass surface ── */
.glass {
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  -webkit-backdrop-filter: blur(22px) saturate(180%);
          backdrop-filter: blur(22px) saturate(180%);
  border-radius: var(--radius-lg);
  position: relative;
  isolation: isolate;
  box-shadow:
    0 1px 0 var(--glass-hi) inset,
    0 30px 60px -20px rgba(0, 0, 0, 0.35);
}
.glass::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  padding: 1px;
  background: linear-gradient(135deg, var(--glass-hi), transparent 40%, transparent 60%, var(--glass-hi));
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
          mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
          mask-composite: exclude;
  pointer-events: none;
  opacity: 0.7;
}

/* ── Neumorphic surfaces ── */
.neu-raised {
  background: var(--surface);
  border-radius: var(--radius-md);
  box-shadow: var(--neu-raised);
}
.neu-inset {
  background: var(--surface);
  border-radius: var(--radius-md);
  box-shadow: var(--neu-inset);
}

/* ── Reveal animations (driven by GSAP, this is a fallback) ── */
.reveal { opacity: 0; transform: translateY(40px); }

@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; }
  .blob { animation: none !important; }
  * { transition-duration: 0.01s !important; animation-duration: 0.01s !important; }
}
