/* =============================================================================
   base.css — Design tokens, reset, typography, and shared utilities.
   ============================================================================= */

/* ---------------------------------------------------------------------------
   Design tokens (CSS custom properties)
   --------------------------------------------------------------------------- */
:root {
  /* Surfaces */
  --bg:          oklch(0.985 0.004 95);   /* page background */
  --surface:     oklch(0.965 0.008 240);  /* alternate section bg */
  --card:        oklch(1 0 0);            /* card / dialog bg */

  /* Text */
  --fg:          oklch(0.26 0.05 250);    /* primary text */
  --fg-muted:    oklch(0.48 0.03 252);    /* secondary text */
  --fg-muted2:   oklch(0.65 0.02 240);    /* tertiary text */

  /* Brand */
  --primary:     oklch(0.34 0.07 255);    /* deep navy ≈ #1e3a5f */
  --primary-fg:  oklch(0.985 0.003 247);  /* text on primary */
  --accent:      oklch(0.54 0.085 185);   /* teal ≈ #0f766e */
  --accent-fg:   oklch(0.99 0 0);         /* text on accent */

  /* Borders */
  --border:      oklch(0.91 0.012 245);

  /* Code editor */
  --code-bg:     oklch(0.93 0.012 245);
  --code-fg:     oklch(25.873% 0.05028 250.379 / 0.527);

  /* Shadows */
  --shadow-card: 0 1px 2px rgba(15, 23, 42, 0.04),
                 0 8px 28px -14px rgba(15, 23, 42, 0.10);

  /* Spacing / radii */
  --radius:      0.875rem;
  --radius-sm:   calc(var(--radius) - 4px);
  --radius-md:   calc(var(--radius) - 2px);
  --radius-lg:   var(--radius);
  --radius-xl:   calc(var(--radius) + 4px);
  --radius-2xl:  calc(var(--radius) + 8px);

  /* Typography */
  --font-sans:  "Inter", ui-sans-serif, system-ui, sans-serif;
  --font-serif: "Fraunces", ui-serif, Georgia, serif;
  --font-mono:  "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
}

/* ---------------------------------------------------------------------------
   Reset & base
   --------------------------------------------------------------------------- */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  border-color: var(--border);
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: 2rem;
  overflow-x: hidden;
}

body {
  background-color: var(--bg);
  color: var(--fg);
  font-family: var(--font-sans);
  overflow-x: hidden;
  font-size: 1rem;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

h1, h2, h3 {
  font-family: var(--font-serif);
  font-weight: 450;
  letter-spacing: -0.02em;
  line-height: 1.08;
}

code, pre, kbd, samp {
  font-family: var(--font-mono);
}

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

ul, ol {
  list-style: none;
}

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

/* ---------------------------------------------------------------------------
   Layout helpers
   --------------------------------------------------------------------------- */
.container {
  width: 100%;
  max-width: 72rem; /* 1152px */
  margin-inline: auto;
  padding-inline: 1.5rem;
}

.container--narrow {
  max-width: 56rem; /* 896px */
}

/* ---------------------------------------------------------------------------
   Section header (eyebrow + title + description)
   --------------------------------------------------------------------------- */
.section-header {
  /* max-width: 42rem; */
}

.section-header__eyebrow {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.2em;
  color: var(--accent);
  margin-bottom: 0.75rem;
}

.section-header__title {
  font-family: var(--font-serif);
  font-size: clamp(1.75rem, 4vw, 2.5rem);
  color: var(--fg);
}

.section-header__desc {
  margin-top: 1rem;
  font-size: 1rem;
  line-height: 1.7;
  color: var(--fg-muted);
}

/* ---------------------------------------------------------------------------
   Buttons
   --------------------------------------------------------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.625rem 1rem;
  border-radius: var(--radius-md);
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  transition: background-color 0.15s, border-color 0.15s, color 0.15s,
              transform 0.15s, opacity 0.15s;
  border: 1px solid transparent;
  text-decoration: none;
  white-space: nowrap;
}

.btn:disabled {
  opacity: 0.6;
  cursor: default;
}

/* Primary (navy) */
.btn--primary {
  background-color: var(--primary);
  color: var(--primary-fg);
}
.btn--primary:hover:not(:disabled) {
  background-color: oklch(0.30 0.07 255);
}

/* Accent (teal) */
.btn--accent {
  background-color: var(--accent);
  color: var(--accent-fg);
  font-size: 0.75rem;
  padding: 0.5rem 1rem;
}
.btn--accent:hover:not(:disabled) {
  background-color: oklch(0.50 0.085 185);
}

/* Outline */
.btn--outline {
  background-color: var(--card);
  color: var(--fg);
  border-color: var(--border);
}
.btn--outline:hover:not(:disabled) {
  background-color: var(--surface);
}

/* Secondary (small, for modal toolbar) */
.btn--secondary {
  background-color: oklch(0.95 0.012 240);
  color: oklch(0.30 0.06 255);
  border-color: var(--border);
  font-size: 0.75rem;
  padding: 0.375rem 0.75rem;
}
.btn--secondary:hover:not(:disabled) {
  background-color: oklch(0.91 0.012 245);
}
