@import url("https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@500;700&family=Space+Mono:ital,wght@0,400;0,700;1,400&display=swap");

/* ──────────────────────────────────────────────────────────────
   davidops design tokens — mobile-first defaults.
   Dark is the canonical brand surface (see brand kit §1).
   Hex values below are fixed; do not substitute.
   ────────────────────────────────────────────────────────────── */

:root {
  /* ── Brand palette (confirmed, exact) ── */
  --bg: #0a0e13;
  --panel: #10161d;
  --panel-border: #1e2830;
  --text: #e6edf3;
  --text-muted: #7c8b99;
  --teal: #14b8a6;
  --teal-dim: #0d8f81;

  /* ── Derived from the palette (never new hues) ── */
  --panel-raised: #141c25;
  --teal-wash: rgba(20, 184, 166, 0.09);
  --teal-line: rgba(20, 184, 166, 0.28);
  --hairline: rgba(230, 237, 243, 0.06);
  --focus-ring: rgba(20, 184, 166, 0.65);
  --on-teal: #04120f;
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.4), 0 8px 24px rgba(0, 0, 0, 0.28);

  /* ── Layout ── */
  --content-max: 68rem;
  --prose-max: 42rem;
  --nav-height: 3.5rem;
  --touch-min: 2.75rem;

  /* ── Spacing (mobile base) ── */
  --space-page-x: max(1.15rem, env(safe-area-inset-left, 0px) + 1.15rem);
  --space-page-y: 2.5rem;
  --space-section: 3rem;
  --space-stack: 1rem;

  /* ── Typography ──
     Space Grotesk (500/700) is display only: headings and the nav wordmark.
     Space Mono carries nav links, body copy, labels, and the terminal. */
  --font-display: "Space Grotesk", ui-sans-serif, system-ui, sans-serif;
  --font-mono: "Space Mono", ui-monospace, "SFMono-Regular", Menlo, monospace;
  --text-base: 0.95rem;
  --text-sm: 0.85rem;
  --text-xs: 0.72rem;
  --leading: 1.75;
  --leading-tight: 1.15;
  --tracking-label: 0.14em;

  /* ── Radius & motion ── */
  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-lg: 12px;
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  --duration-fast: 150ms;
  --duration-normal: 260ms;

  /* Breakpoints, for reference in @media below:
     --bp-sm: 40rem (640px) · --bp-md: 48rem (768px)
     --bp-lg: 56.25rem (900px) · --bp-xl: 75rem (1200px) */
}

/* ── Light theme ──
   Derived from the same palette: the teal accent steps down to
   --teal-dim so text and borders keep AA contrast on a light ground. */
html[data-theme="light"] {
  --bg: #f5f8f9;
  --panel: #ffffff;
  --panel-border: #dce4e8;
  --text: #0a0e13;
  --text-muted: #55646f;
  --teal: #0d8f81;
  --teal-dim: #0a7368;

  --panel-raised: #eef3f5;
  --teal-wash: rgba(13, 143, 129, 0.08);
  --teal-line: rgba(13, 143, 129, 0.3);
  --hairline: rgba(10, 14, 19, 0.08);
  --focus-ring: rgba(13, 143, 129, 0.6);
  --on-teal: #ffffff;
  --shadow: 0 1px 2px rgba(10, 14, 19, 0.06), 0 8px 24px rgba(10, 14, 19, 0.07);
}

@media (min-width: 40rem) {
  :root {
    --space-page-x: max(1.75rem, env(safe-area-inset-left, 0px) + 1.75rem);
    --space-page-y: 4rem;
    --space-section: 4.5rem;
    --space-stack: 1.25rem;
    --text-base: 1rem;
  }
}

@media (min-width: 56.25rem) {
  :root {
    --space-page-x: max(3rem, env(safe-area-inset-left, 0px) + 3rem);
    --space-page-y: 5.5rem;
    --space-section: 6rem;
    --nav-height: 4rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  :root {
    --duration-fast: 0ms;
    --duration-normal: 0ms;
  }
}
