/* ===========================================================
   Tokens
   =========================================================== */
:root {
  --text-xs: clamp(0.75rem, 0.7rem + 0.2vw, 0.85rem);
  --text-sm: clamp(0.875rem, 0.82rem + 0.3vw, 1rem);
  --text-base: clamp(1rem, 0.95rem + 0.25vw, 1.125rem);
  --text-lg: clamp(1.125rem, 1rem + 0.6vw, 1.4rem);
  --text-xl: clamp(1.375rem, 1.1rem + 1.2vw, 2rem);
  --text-2xl: clamp(1.85rem, 1.2rem + 2.2vw, 3.1rem);
  --text-3xl: clamp(2.25rem, 1.2rem + 3.4vw, 4rem);
  --text-hero: clamp(2.5rem, 1.2rem + 4.5vw, 4.75rem);

  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-5: 1.25rem;
  --space-6: 1.5rem;
  --space-7: 1.75rem;
  --space-8: 2rem;
  --space-10: 2.5rem;
  --space-12: 3rem;
  --space-14: 3.5rem;
  --space-16: 4rem;
  --space-20: 5rem;
  --space-24: 6rem;
  --space-32: 8rem;

  --radius-sm: 0.375rem;
  --radius-md: 0.5rem;
  --radius-lg: 0.75rem;
  --radius-xl: 1rem;
  --radius-2xl: 1.5rem;
  --radius-full: 9999px;

  --transition-interactive: 200ms cubic-bezier(0.16, 1, 0.3, 1);

  --content-narrow: 720px;
  --content-default: 1080px;
  --content-wide: 1280px;

  --font-body: 'Satoshi', system-ui, -apple-system, 'Helvetica Neue', sans-serif;
  --font-display: 'Satoshi', system-ui, -apple-system, sans-serif;
  --font-serif: 'Fraunces', 'Iowan Old Style', Georgia, serif;
  --font-mono: 'JetBrains Mono', ui-monospace, 'SF Mono', Menlo, Consolas, monospace;
}

/* ===========================================================
   Theme: dark (default)
   =========================================================== */
:root,
[data-theme="dark"] {
  --color-bg:           #07090a;
  --color-bg-grid:      rgba(255, 255, 255, 0.022);
  --color-surface:      #0d1012;
  --color-surface-2:    #11161a;
  --color-surface-3:    #161c21;
  --color-surface-alt:  #0a0d0f;

  --color-border:        rgba(255, 255, 255, 0.07);
  --color-border-strong: rgba(255, 255, 255, 0.13);
  --color-divider:       rgba(255, 255, 255, 0.05);

  --color-text:         #e7eaec;
  --color-text-muted:   #98a0a8;
  --color-text-faint:   #5e656d;
  --color-text-inverse: #07090a;

  /* Soft clinical green — credible, not toy-like */
  --color-primary:        #84e0a8;
  --color-primary-strong: #a8eec3;
  --color-primary-deep:   #4cb87a;
  --color-primary-dim:    rgba(132, 224, 168, 0.10);
  --color-primary-dim-2:  rgba(132, 224, 168, 0.20);

  --color-amber:  #f0c674;
  --color-blue:   #7ab0ff;
  --color-pink:   #f49ac1;

  --shadow-sm: 0 1px 2px rgba(0,0,0,0.30);
  --shadow-md: 0 8px 24px rgba(0,0,0,0.35);
  --shadow-lg: 0 28px 80px rgba(0,0,0,0.55);
  --shadow-glow: 0 0 0 1px rgba(132, 224, 168, 0.18), 0 30px 100px -30px rgba(132, 224, 168, 0.40);
}

/* ===========================================================
   Theme: light
   =========================================================== */
[data-theme="light"] {
  --color-bg:           #f8f8f6;
  --color-bg-grid:      rgba(0, 0, 0, 0.04);
  --color-surface:      #ffffff;
  --color-surface-2:    #fbfbf9;
  --color-surface-3:    #f1f1ed;
  --color-surface-alt:  #efefeb;

  --color-border:        rgba(0, 0, 0, 0.09);
  --color-border-strong: rgba(0, 0, 0, 0.18);
  --color-divider:       rgba(0, 0, 0, 0.06);

  --color-text:         #11151a;
  --color-text-muted:   #525860;
  --color-text-faint:   #8a9099;
  --color-text-inverse: #ffffff;

  --color-primary:        #1a7f4f;
  --color-primary-strong: #11603b;
  --color-primary-deep:   #0d4c2e;
  --color-primary-dim:    rgba(26, 127, 79, 0.10);
  --color-primary-dim-2:  rgba(26, 127, 79, 0.18);

  --color-amber:  #b07e26;
  --color-blue:   #2c5fcc;
  --color-pink:   #c45a8d;

  --shadow-sm: 0 1px 2px rgba(0,0,0,0.05);
  --shadow-md: 0 8px 24px rgba(0,0,0,0.06);
  --shadow-lg: 0 28px 80px rgba(0,0,0,0.10);
  --shadow-glow: 0 0 0 1px rgba(26, 127, 79, 0.15), 0 30px 100px -30px rgba(26, 127, 79, 0.30);
}

/* ===========================================================
   Reset
   =========================================================== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html {
  -webkit-text-size-adjust: none;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  scroll-behavior: smooth;
  scroll-padding-top: 5rem;
}
body {
  min-height: 100dvh;
  font-family: var(--font-body);
  font-size: var(--text-base);
  line-height: 1.6;
  color: var(--color-text);
  background: var(--color-bg);
  overflow-x: hidden;
}
img, svg, video { display: block; max-width: 100%; }
ul, ol { list-style: none; }
a { color: inherit; text-decoration: none; }
button { background: none; border: none; cursor: pointer; font: inherit; color: inherit; }
input, textarea, select { font: inherit; color: inherit; }
h1, h2, h3, h4, h5, h6 {
  text-wrap: balance;
  line-height: 1.1;
  font-family: var(--font-display);
  font-weight: 600;
  letter-spacing: -0.018em;
}
p { text-wrap: pretty; }
table { border-collapse: collapse; width: 100%; }

::selection { background: var(--color-primary-dim-2); color: var(--color-text); }
:focus-visible { outline: 2px solid var(--color-primary); outline-offset: 3px; border-radius: var(--radius-sm); }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

a, button {
  transition:
    color var(--transition-interactive),
    background var(--transition-interactive),
    border-color var(--transition-interactive),
    box-shadow var(--transition-interactive),
    transform var(--transition-interactive);
}

.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0,0,0,0);
  white-space: nowrap; border: 0;
}
