@import url('https://fonts.googleapis.com/css2?family=Geist:wght@100..900&family=JetBrains+Mono:wght@400;500&family=Playwrite+US+Trad:wght@100..400&display=swap');

/* ─── TOKENS ─────────────────────────────────────────────────── */

:root {
  /* Surface */
  --bg-primary:      #0C0C0C;
  --bg-secondary:    #141414;
  --bg-tertiary:     #1A1A1A;
  --surface:         #1C1C1C;
  --surface-hover:   #222222;

  /* Accent (dark mode: near-white) */
  --accent:          #E8E8E3;
  --accent-dim:      #B0B0AA;
  --accent-ghost:    rgba(232, 232, 227, 0.06);
  --accent-border:   rgba(232, 232, 227, 0.12);
  --accent-glow:     rgba(232, 232, 227, 0.08);

  /* Text */
  --text-primary:    #EAEAEA;
  --text-secondary:  #A0A09A;
  --text-muted:      #c0c0c0;
  --text-inverse:    #0C0C0C;

  /* Borders */
  --border:          rgba(255, 255, 255, 0.06);
  --border-strong:   rgba(255, 255, 255, 0.10);

  /* Glass */
  --glass-bg:        rgba(20, 20, 20, 0.80);
  --glass-border:    rgba(255, 255, 255, 0.08);
  --glass-blur:      saturate(160%) blur(20px);

  /* Typography */
  --font-display:    'Geist', sans-serif;
  --font-body:       'Geist', sans-serif;
  --font-mono:       'JetBrains Mono', monospace;
  --font-script:     'Playwrite US Trad', cursive;

  /* Scale */
  --text-xs:         0.6875rem;
  --text-sm:         0.8125rem;
  --text-base:       1rem;
  --text-md:         1.125rem;
  --text-lg:         1.375rem;
  --text-xl:         1.75rem;
  --text-2xl:        2.25rem;
  --text-3xl:        3rem;
  --text-4xl:        4rem;
  --text-5xl:        5.5rem;
  --text-6xl:        7.5rem;

  /* 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;

  /* Layout */
  --container:       1280px;
  --container-sm:    900px;
  --nav-height:      72px;

  /* Radius */
  --radius-sm:       4px;
  --radius-md:       8px;
  --radius-lg:       8px;
  --radius-xl:       12px;
  --radius-pill:     999px;

  /* Motion */
  --ease-out:        cubic-bezier(0.16, 1, 0.3, 1);
  --ease-in-out:     cubic-bezier(0.45, 0, 0.55, 1);
  --ease-spring:     cubic-bezier(0.34, 1.56, 0.64, 1);
  --duration-fast:   150ms;
  --duration-base:   250ms;
  --duration-slow:   400ms;
  --duration-enter:  600ms;

  /* Shadows */
  --shadow-sm:       0 1px 3px rgba(0,0,0,0.4);
  --shadow-md:       0 4px 16px rgba(0,0,0,0.5);
  --shadow-lg:       0 12px 40px rgba(0,0,0,0.6);
  --shadow-accent:   0 0 32px rgba(232, 232, 227, 0.06);
}

/* ─── LIGHT THEME ────────────────────────────────────────────── */

[data-theme="light"] {
  --bg-primary:      #F4F4F0;
  --bg-secondary:    #EDEDE9;
  --bg-tertiary:     #E6E6E2;
  --surface:         #FFFFFF;
  --surface-hover:   #F8F8F5;

  /* Accent (light mode: near-black) */
  --accent:          #1C1C1C;
  --accent-dim:      #3A3A3A;
  --accent-ghost:    rgba(28, 28, 28, 0.05);
  --accent-border:   rgba(28, 28, 28, 0.12);
  --accent-glow:     rgba(28, 28, 28, 0.06);

  --text-primary:    #111111;
  --text-secondary:  #4A4A4A;
  --text-muted:      #303030;
  --text-inverse:    #EAEAEA;

  --border:          rgba(0, 0, 0, 0.07);
  --border-strong:   rgba(0, 0, 0, 0.12);

  --glass-bg:        rgba(244, 244, 240, 0.82);
  --glass-border:    rgba(0, 0, 0, 0.08);

  --shadow-sm:       0 1px 3px rgba(0,0,0,0.07);
  --shadow-md:       0 4px 16px rgba(0,0,0,0.09);
  --shadow-lg:       0 12px 40px rgba(0,0,0,0.12);
  --shadow-accent:   0 0 32px rgba(28, 28, 28, 0.08);
}

/* ─── RESET ──────────────────────────────────────────────────── */

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

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

body {
  font-family: var(--font-body);
  font-size: var(--text-base);
  font-weight: 300;
  line-height: 1.6;
  color: var(--text-primary);
  background-color: var(--bg-primary);
  transition:
    background-color var(--duration-slow) var(--ease-in-out),
    color var(--duration-slow) var(--ease-in-out);
  overflow-x: hidden;
}

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

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

button {
  font-family: var(--font-body);
  cursor: pointer;
  border: none;
  background: none;
}

ul, ol {
  list-style: none;
}

/* ─── TYPOGRAPHY ─────────────────────────────────────────────── */

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-display);
  font-weight: 400;
  line-height: 1.1;
  letter-spacing: -0.01em;
  color: var(--text-primary);
}

h1 { font-size: var(--text-5xl); }
h2 { font-size: var(--text-4xl); }
h3 { font-size: var(--text-3xl); }
h4 { font-size: var(--text-xl); }
h5 { font-size: var(--text-lg); }
h6 { font-size: var(--text-md); }

p {
  font-size: var(--text-base);
  line-height: 1.7;
  color: var(--text-secondary);
}

.label {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.text-muted    { color: var(--text-muted); }
.text-primary  { color: var(--text-primary); }
.text-accent   { color: var(--accent); }

/* ─── LAYOUT ─────────────────────────────────────────────────── */

.container {
  width: 100%;
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: var(--space-8);
}

.container--sm {
  max-width: var(--container-sm);
}

.section {
  padding-block: var(--space-32);
}

/* ─── BUTTONS ────────────────────────────────────────────────── */

.btn {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  font-family: var(--font-body);
  font-size: var(--text-sm);
  font-weight: 400;
  letter-spacing: 0.02em;
  padding: var(--space-2) var(--space-5);
  border-radius: var(--radius-md);
  transition:
    background var(--duration-base) var(--ease-out),
    color var(--duration-base) var(--ease-out),
    border-color var(--duration-base) var(--ease-out),
    box-shadow var(--duration-base) var(--ease-out),
    transform var(--duration-fast) var(--ease-out);
  white-space: nowrap;
}

.btn:active {
  transform: scale(0.97);
}

.btn--primary {
  background: var(--accent);
  color: var(--text-inverse);
  font-weight: 500;
}

.btn--primary:hover {
  background: var(--accent-dim);
  box-shadow: var(--shadow-accent);
}

.btn--ghost {
  background: transparent;
  color: var(--text-primary);
  border: 1px solid var(--border-strong);
}

.btn--ghost:hover {
  border-color: var(--accent-border);
  background: var(--accent-ghost);
}

/* ─── CARDS ──────────────────────────────────────────────────── */

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  transition:
    border-color var(--duration-base) var(--ease-out),
    transform var(--duration-base) var(--ease-out),
    box-shadow var(--duration-base) var(--ease-out);
}

.card:hover {
  border-color: var(--accent-border);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

/* ─── GLASS ──────────────────────────────────────────────────── */

.glass {
  background: var(--glass-bg);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border: 1px solid var(--glass-border);
}

/* ─── DIVIDER ────────────────────────────────────────────────── */

.divider {
  width: 100%;
  height: 1px;
  background: var(--border);
}

/* ─── SCROLL REVEAL ──────────────────────────────────────────── */

.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition:
    opacity var(--duration-enter) var(--ease-out),
    transform var(--duration-enter) var(--ease-out);
}

.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

.reveal-delay-1 { transition-delay: 100ms; }
.reveal-delay-2 { transition-delay: 200ms; }
.reveal-delay-3 { transition-delay: 300ms; }
.reveal-delay-4 { transition-delay: 400ms; }
.reveal-delay-5 { transition-delay: 500ms; }

/* ─── NOISE OVERLAY ──────────────────────────────────────────── */

body::before {
  content: '';
  position: fixed;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)' opacity='1'/%3E%3C/svg%3E");
  opacity: 0.022;
  pointer-events: none;
  z-index: 9999;
}

/* ─── SCROLLBAR ──────────────────────────────────────────────── */

::-webkit-scrollbar { width: 4px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
  background: var(--surface-hover);
  border-radius: var(--radius-pill);
}

/* ─── SELECTION ──────────────────────────────────────────────── */

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

/* ─── FOCUS ──────────────────────────────────────────────────── */

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

/* ─── RESPONSIVE BREAKPOINTS ─────────────────────────────────── */

@media (max-width: 1024px) {
  :root {
    --text-5xl: 4.5rem;
    --text-4xl: 3.25rem;
    --text-3xl: 2.5rem;
  }

  .container {
    padding-inline: var(--space-6);
  }
}

@media (max-width: 768px) {
  :root {
    --text-5xl: 3.25rem;
    --text-4xl: 2.5rem;
    --text-3xl: 2rem;
    --text-2xl: 1.75rem;
  }

  .container {
    padding-inline: var(--space-5);
  }

  .section {
    padding-block: var(--space-20);
  }
}

@media (max-width: 480px) {
  :root {
    --text-5xl: 2.5rem;
    --text-4xl: 2rem;
    --text-3xl: 1.75rem;
  }
}