/* ============================================================================
 * Veraterre Design System v2 — Tokens, Reset, Base
 * ----------------------------------------------------------------------------
 * Warm-light theme derived from the Claude Design mine-detail prototype.
 * Single source of truth for design tokens. components.css consumes these
 * via var(--token-name) and never references raw hex values.
 *
 * Typography: IBM Plex Sans (UI) + IBM Plex Mono (data) + Newsreader (editorial)
 * Palette:    Warm cream background, dark-brown ink, moss/amber/rust accents
 * ========================================================================= */

/* ============================================================================
 * Design Tokens
 * ========================================================================= */

:root {
  /* -- Brand surfaces ----------------------------------------------------- */
  --bg:          #f3efe6;
  --bg-paper:    #faf7f0;
  --bg-dark:     #1c1a16;

  /* -- Ink (text) — opacity scale on dark brown base ---------------------- */
  --ink:         #1c1a16;
  --ink-70:      rgba(28, 26, 22, 0.72);
  --ink-50:      rgba(28, 26, 22, 0.52);
  --ink-30:      rgba(28, 26, 22, 0.32);
  --ink-12:      rgba(28, 26, 22, 0.12);
  --ink-06:      rgba(28, 26, 22, 0.06);

  /* -- Light ink (for dark backgrounds) ----------------------------------- */
  --ink-light:   #f3efe6;
  --ink-light-70: rgba(243, 239, 230, 0.72);
  --ink-light-50: rgba(243, 239, 230, 0.52);

  /* -- Semantic accents --------------------------------------------------- */
  --moss:        #2d4a36;
  --moss-soft:   rgba(45, 74, 54, 0.10);
  --amber:       #b88a3e;
  --amber-soft:  rgba(184, 138, 62, 0.12);
  --rust:        #a85433;
  --rust-soft:   rgba(168, 84, 51, 0.12);

  /* -- Data visualization palette ----------------------------------------- */
  --viz-bare:    #a8895c;
  --viz-water:   #3a6273;
  --viz-built:   #5b5048;

  /* -- Borders & rules ---------------------------------------------------- */
  --rule:        rgba(28, 26, 22, 0.16);
  --rule-strong: rgba(28, 26, 22, 0.32);

  /* -- Interactive (CTA) -------------------------------------------------- */
  --cta-bg:      var(--moss);
  --cta-hover:   #243d2c;
  --focus-ring:  rgba(45, 74, 54, 0.4);

  /* -- Typography --------------------------------------------------------- */
  --font-sans:   'IBM Plex Sans', system-ui, -apple-system, sans-serif;
  --font-serif:  'Newsreader', 'Source Serif 4', Georgia, serif;
  --font-mono:   'IBM Plex Mono', ui-monospace, 'SFMono-Regular', monospace;

  /* Named size scale (px values for clarity; rem used in rules below) */
  --fs-hero:     88px;    /* Mine name, page title */
  --fs-display:  56px;    /* Section headlines */
  --fs-title:    44px;    /* Bond headline */
  --fs-heading:  36px;    /* Subheads */
  --fs-subhead:  26px;    /* Operator/regulator names */
  --fs-tagline:  22px;    /* Hero tagline */
  --fs-large:    18px;    /* Source names, CTA text */
  --fs-body:     15px;    /* Body copy */
  --fs-small:    13px;    /* Secondary text */
  --fs-label:    12px;    /* Breadcrumb, labels */
  --fs-caption:  11px;    /* Mono captions, disclaimers */
  --fs-fine:     10px;    /* Fine print */

  --fw-light:    300;
  --fw-regular:  400;
  --fw-medium:   500;
  --fw-semibold: 600;
  --fw-bold:     700;

  --lh-none:     0.96;
  --lh-tight:    1.15;
  --lh-snug:     1.3;
  --lh-base:     1.55;
  --lh-relaxed:  1.7;

  --ls-tight:    -0.03em;
  --ls-normal:   0;
  --ls-wide:     0.04em;
  --ls-wider:    0.08em;

  /* -- Spacing scale ------------------------------------------------------ */
  --sp-1:  4px;
  --sp-2:  8px;
  --sp-3:  12px;
  --sp-4:  16px;
  --sp-5:  20px;
  --sp-6:  24px;
  --sp-7:  28px;
  --sp-8:  32px;
  --sp-10: 40px;
  --sp-12: 48px;
  --sp-14: 56px;
  --sp-16: 64px;
  --sp-22: 88px;

  /* -- Layout ------------------------------------------------------------- */
  --page-width:    1440px;
  --page-padding:  88px;
  --section-gap:   56px;
  --subsection-gap: 28px;

  /* -- Border radius ------------------------------------------------------ */
  --radius-sm:  3px;
  --radius-md:  5px;
  --radius-lg:  8px;
  --radius-xl:  12px;
  --radius-full: 9999px;

  /* -- Transitions -------------------------------------------------------- */
  --ease-fast: 0.12s ease;
  --ease-base: 0.2s ease;
  --ease-slow: 0.3s ease;

  /* -- Breakpoints (documentation; used in @media queries) ---------------- */
  /* --bp-lg: 1440px; */
  /* --bp-md: 1024px; */
  /* --bp-sm: 768px;  */
  /* --bp-xs: 480px;  */
}

/* ============================================================================
 * CSS Reset
 * ========================================================================= */

*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

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

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

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

ul, ol {
  list-style: none;
}

/* ============================================================================
 * Base Typography
 * ========================================================================= */

html {
  font-size: 16px;
}

body {
  font-family: var(--font-sans);
  background: var(--bg);
  color: var(--ink);
  line-height: var(--lh-base);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

a {
  color: var(--ink);
  text-decoration: none;
  transition: color var(--ease-fast);
}

a:hover {
  color: var(--moss);
}

a:focus-visible {
  outline: 2px solid var(--focus-ring);
  outline-offset: 2px;
  border-radius: var(--radius-sm);
}

h1, h2, h3, h4, h5, h6 {
  line-height: var(--lh-tight);
  font-weight: var(--fw-bold);
  color: var(--ink);
}

p {
  line-height: var(--lh-base);
}

/* ============================================================================
 * Page Shell
 * ========================================================================= */

.page-shell {
  width: var(--page-width);
  max-width: 100%;
  margin: 0 auto;
  background: var(--bg);
}

.page-section {
  padding: var(--sp-10) var(--page-padding) var(--sp-12);
}

.page-section--paper {
  background: var(--bg-paper);
}

.page-section--dark {
  background: var(--bg-dark);
  color: var(--ink-light);
}

/* ============================================================================
 * Utility: screen-reader only
 * ========================================================================= */

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

/* ============================================================================
 * Responsive
 * ========================================================================= */

@media (max-width: 1024px) {
  :root {
    --page-padding: 40px;
  }
}

@media (max-width: 768px) {
  :root {
    --page-padding: 24px;
    --fs-hero:    48px;
    --fs-display: 36px;
    --fs-title:   30px;
    --fs-heading: 26px;
    --fs-subhead: 22px;
    --fs-tagline: 18px;
  }
}

@media (max-width: 480px) {
  :root {
    --page-padding: 16px;
    --fs-hero:    36px;
    --fs-display: 28px;
    --fs-title:   24px;
    --fs-heading: 22px;
  }
}
