/* ============================================================
   Design Tokens — type scale, spacing, color (light + dark)
   ============================================================ */

:root {
  /* Type scale */
  --text-xs: clamp(0.75rem, 0.7rem + 0.25vw, 0.875rem);
  --text-sm: clamp(0.875rem, 0.8rem + 0.35vw, 1rem);
  --text-base: clamp(1rem, 0.95rem + 0.25vw, 1.125rem);
  --text-lg: clamp(1.125rem, 1rem + 0.75vw, 1.5rem);
  --text-xl: clamp(1.5rem, 1.2rem + 1.25vw, 2.25rem);
  --text-2xl: clamp(2rem, 1.2rem + 2.5vw, 3.5rem);
  --text-3xl: clamp(2.5rem, 1rem + 4vw, 5rem);
  --text-hero: clamp(2.75rem, 1rem + 5vw, 6rem);

  /* Spacing — 4px base */
  --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;

  --radius-sm: 0.375rem;
  --radius-md: 0.625rem;
  --radius-lg: 1rem;
  --radius-xl: 1.5rem;
  --radius-full: 9999px;

  --content-default: 1200px;

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

  --font-body: 'Satoshi', 'Helvetica Neue', Arial, sans-serif;
  --font-display: 'Array', 'Satoshi', 'Helvetica Neue', Arial, sans-serif;
}

/* ===================== LIGHT MODE ===================== */
:root,
[data-theme='light'] {
  --color-bg: #f6f5f1;
  --color-surface: #ffffff;
  --color-surface-2: #fbfaf6;
  --color-surface-offset: #ecebe5;
  --color-border: #d8d6cf;
  --color-divider: #e3e1da;

  --color-text: #0e1518;
  --color-text-muted: #5a625f;
  --color-text-faint: #9ea4a1;
  --color-text-inverse: #f6f5f1;

  /* Primary: deep marine teal */
  --color-primary: #0b3b46;
  --color-primary-hover: #0a4a57;
  --color-primary-active: #082c34;

  /* Accent: torch amber (CTA emphasis) */
  --color-accent: #d97706;
  --color-accent-hover: #b86405;
  --color-accent-active: #8a4904;

  --shadow-sm: 0 1px 2px rgba(14, 21, 24, 0.06);
  --shadow-md: 0 6px 18px rgba(14, 21, 24, 0.08);
  --shadow-lg: 0 18px 50px rgba(14, 21, 24, 0.16);
}

/* ===================== DARK MODE ===================== */
[data-theme='dark'] {
  --color-bg: #0a1014;
  --color-surface: #11181d;
  --color-surface-2: #161e24;
  --color-surface-offset: #1b242b;
  --color-border: #2a353c;
  --color-divider: #1f292f;

  --color-text: #ecebe5;
  --color-text-muted: #9aa4a8;
  --color-text-faint: #5a666c;
  --color-text-inverse: #0a1014;

  --color-primary: #4dc6d6;
  --color-primary-hover: #6fd5e3;
  --color-primary-active: #94e1ec;

  --color-accent: #f59e0b;
  --color-accent-hover: #fbb324;
  --color-accent-active: #fcc34d;

  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.4);
  --shadow-md: 0 6px 18px rgba(0, 0, 0, 0.5);
  --shadow-lg: 0 18px 50px rgba(0, 0, 0, 0.6);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme]) {
    --color-bg: #0a1014;
    --color-surface: #11181d;
    --color-surface-2: #161e24;
    --color-surface-offset: #1b242b;
    --color-border: #2a353c;
    --color-divider: #1f292f;
    --color-text: #ecebe5;
    --color-text-muted: #9aa4a8;
    --color-text-faint: #5a666c;
    --color-text-inverse: #0a1014;
    --color-primary: #4dc6d6;
    --color-primary-hover: #6fd5e3;
    --color-primary-active: #94e1ec;
    --color-accent: #f59e0b;
    --color-accent-hover: #fbb324;
    --color-accent-active: #fcc34d;
  }
}

/* ===================== BASE ===================== */
*,
*::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;
  line-height: 1.6;
  font-family: var(--font-body);
  font-size: var(--text-base);
  color: var(--color-text);
  background-color: var(--color-bg);
}

img,
picture,
video,
svg {
  display: block;
  max-width: 100%;
  height: auto;
}

button {
  cursor: pointer;
  background: none;
  border: none;
  color: inherit;
}

input,
textarea,
select,
button {
  font: inherit;
  color: inherit;
}

h1, h2, h3, h4 {
  font-family: var(--font-display);
  line-height: 1.05;
  letter-spacing: -0.02em;
  text-wrap: balance;
}

p {
  text-wrap: pretty;
  max-width: 65ch;
}

a {
  color: inherit;
  text-decoration: none;
  transition:
    color var(--transition-interactive),
    background var(--transition-interactive);
}

::selection {
  background: var(--color-accent);
  color: #0a1014;
}

:focus-visible {
  outline: 2px solid var(--color-accent);
  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;
  }
}

.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;
}

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

@media (min-width: 768px) {
  .container { padding-inline: var(--space-8); }
}
