/* ============================================
   DESIGN TOKENS
   Concept: Clean / modern / tech + Technical / developer / data
   Palette: Deep navy + graphite + warm amber accent + cool teal secondary
   ============================================ */

:root, [data-theme="light"] {
  /* 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, 0.5rem + 6vw, 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;

  /* Surfaces — light mode (warm off-white, cool paper feel) */
  --color-bg: #f6f4ef;
  --color-surface: #fbf9f4;
  --color-surface-2: #ffffff;
  --color-surface-offset: #ece8e0;
  --color-divider: #d9d4ca;
  --color-border: #c8c2b6;

  /* Text */
  --color-text: #15192a;
  --color-text-muted: #5a5e72;
  --color-text-faint: #8d91a3;
  --color-text-inverse: #f6f4ef;

  /* Brand — deep navy primary (operational/serious) */
  --color-primary: #0f2943;
  --color-primary-hover: #1a3958;
  --color-primary-active: #081a2c;
  --color-primary-highlight: #d3dbe5;

  /* Accent — warm amber (energy / signal) */
  --color-accent: #d97706;
  --color-accent-hover: #b45309;
  --color-accent-soft: #fde7c5;

  /* Secondary — cool teal (data / signal pulse) */
  --color-secondary: #0d8b8b;
  --color-secondary-soft: #cfe9e7;

  /* Status */
  --color-success: #15803d;
  --color-success-soft: #d1f0d9;
  --color-error: #b91c1c;

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

  /* Transitions */
  --transition-interactive: 200ms cubic-bezier(0.16, 1, 0.3, 1);
  --transition-slow: 400ms cubic-bezier(0.16, 1, 0.3, 1);

  /* Shadows */
  --shadow-sm: 0 1px 2px oklch(0.2 0.02 250 / 0.06);
  --shadow-md: 0 6px 24px oklch(0.2 0.02 250 / 0.08);
  --shadow-lg: 0 24px 60px oklch(0.2 0.02 250 / 0.14);

  /* Layout */
  --content-narrow: 720px;
  --content-default: 1080px;
  --content-wide: 1240px;

  /* Fonts */
  --font-display: 'Cabinet Grotesk', 'Inter', system-ui, sans-serif;
  --font-body: 'Satoshi', 'Inter', system-ui, sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, monospace;
}

/* DARK MODE — deep navy operational night */
[data-theme="dark"] {
  --color-bg: #0a1220;
  --color-surface: #0e182a;
  --color-surface-2: #142035;
  --color-surface-offset: #1a2840;
  --color-divider: #1f2d47;
  --color-border: #2a3a57;

  --color-text: #ebe7df;
  --color-text-muted: #9aa3b8;
  --color-text-faint: #5b6480;
  --color-text-inverse: #0a1220;

  --color-primary: #f6f4ef;
  --color-primary-hover: #ffffff;
  --color-primary-active: #d8d3c7;
  --color-primary-highlight: #1f2d47;

  --color-accent: #f5a524;
  --color-accent-hover: #fbb944;
  --color-accent-soft: #3d2c0f;

  --color-secondary: #58d4d4;
  --color-secondary-soft: #143838;

  --color-success: #4ade80;
  --color-success-soft: #0f2a18;
  --color-error: #f87171;

  --shadow-sm: 0 1px 2px oklch(0 0 0 / 0.3);
  --shadow-md: 0 8px 32px oklch(0 0 0 / 0.4);
  --shadow-lg: 0 24px 60px oklch(0 0 0 / 0.55);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme]) {
    --color-bg: #0a1220;
    --color-surface: #0e182a;
    --color-surface-2: #142035;
    --color-surface-offset: #1a2840;
    --color-divider: #1f2d47;
    --color-border: #2a3a57;
    --color-text: #ebe7df;
    --color-text-muted: #9aa3b8;
    --color-text-faint: #5b6480;
    --color-text-inverse: #0a1220;
    --color-primary: #f6f4ef;
    --color-primary-hover: #ffffff;
    --color-primary-active: #d8d3c7;
    --color-primary-highlight: #1f2d47;
    --color-accent: #f5a524;
    --color-accent-hover: #fbb944;
    --color-accent-soft: #3d2c0f;
    --color-secondary: #58d4d4;
    --color-secondary-soft: #143838;
  }
}

/* Reset + base */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  scroll-behavior: smooth;
  scroll-padding-top: 80px;
  hanging-punctuation: first last;
}

body {
  min-height: 100dvh;
  line-height: 1.6;
  font-family: var(--font-body);
  font-size: var(--text-base);
  font-weight: 400;
  color: var(--color-text);
  background: var(--color-bg);
  -webkit-font-smoothing: antialiased;
}

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

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

ul[role="list"], ol[role="list"] { list-style: none; }

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

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

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

p, li, figcaption { text-wrap: pretty; }

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

: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;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

a, button, [role="button"] {
  transition:
    color var(--transition-interactive),
    background var(--transition-interactive),
    border-color var(--transition-interactive),
    transform var(--transition-interactive),
    box-shadow var(--transition-interactive),
    opacity var(--transition-interactive);
}

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