/* ==========================================================================
   tokens.css  |  Personal site design system, "Field Notes"
   Single source of truth. Every color, size and space in the site comes from
   here. Do not hard-code hex values or px sizes in components.
   ========================================================================== */

/* Font: add once in <head>, before your stylesheet:
   <link rel="preconnect" href="https://fonts.googleapis.com">
   <link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
   <link rel="stylesheet" href="https://fonts.googleapis.com/css2?family=Figtree:wght@400;500;600;700&display=swap">
*/

:root {
  /* Color: light (warm-neutral gray ground, teal-slate ink, ochre accent) */
  --bg:         #F4F4F2;  /* page ground */
  --surface:    #E9EAE7;  /* quotes, panels, code */
  --ink:        #1C2A2D;  /* body and headings (13.4:1 on bg) */
  --ink-muted:  #58656A;  /* secondary text, labels (5.5:1 on bg) */
  --line:       #D5D7D2;  /* hairlines and borders, decorative only */
  --accent:     #9A5A14;  /* buttons, link underlines, markers (5.0:1 on bg) */
  --on-accent:  #FFFFFF;  /* text on an accent fill (5.5:1) */
  --illustration: #4E6A68;/* line art stroke (5.3:1 on bg) */
  --focus:      #1C2A2D;  /* keyboard focus ring */

  /* Type */
  --font: "Figtree", system-ui, -apple-system, "Segoe UI", sans-serif;
  --fw-regular: 400;
  --fw-medium: 500;
  --fw-semibold: 600;
  --fw-bold: 700;

  --text-xs:   0.8125rem;  /* 13px  labels, captions */
  --text-sm:   0.9375rem;  /* 15px  secondary */
  --text-base: 1.0625rem;  /* 17px  body */
  --text-lg:   1.25rem;    /* 20px  lede, card titles */
  --text-xl:   1.5rem;     /* 24px  section headings */
  --text-2xl:  clamp(1.75rem, 1.3rem + 1.8vw, 2.25rem);  /* page headings */
  --text-display: clamp(2.125rem, 1.3rem + 3.4vw, 3.5rem); /* hero only */

  --lh-tight: 1.12;   /* display and headings */
  --lh-snug: 1.3;
  --lh-body: 1.6;

  --track-display: -0.02em;
  --track-heading: -0.01em;
  --track-label: 0.1em;  /* uppercase labels only */

  /* Space (4px base) */
  --space-1: 0.25rem;  --space-2: 0.5rem;  --space-3: 0.75rem;
  --space-4: 1rem;     --space-5: 1.5rem;  --space-6: 2rem;
  --space-7: 3rem;     --space-8: 4.5rem;  --space-9: 6rem;

  /* Shape */
  --radius-s: 6px;     /* tags, inputs */
  --radius-m: 10px;    /* buttons, panels */
  --rule: 1px;         /* hairline weight */
  --stroke: 1.25;      /* illustration line weight (SVG units) */

  /* Layout */
  --wrap: 780px;       /* reading width */
  --wrap-wide: 1040px; /* grids and case studies */
  --gutter: max(16px, env(safe-area-inset-left, 0px));

  /* Motion */
  --ease: cubic-bezier(.2, .6, .2, 1);
  --dur: 160ms;
}

/* Color: dark. System preference, unless the user forced light.
   Scoped to screen so printing (the resume) always uses the light palette. */
@media screen and (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #121819;
    --surface: #1A2224;
    --ink: #E8ECEA;
    --ink-muted: #9AA8A8;
    --line: #2A3436;
    --accent: #E0A152;
    --on-accent: #121819;
    --illustration: #8FA3A0;
    --focus: #E8ECEA;
    color-scheme: dark;
  }
}
/* Explicit user choice from the theme toggle (theme.js). Dark is screen-only so print stays light. */
:root[data-theme="light"] { color-scheme: light; }
@media screen {
:root[data-theme="dark"] {
  --bg: #121819;
  --surface: #1A2224;
  --ink: #E8ECEA;
  --ink-muted: #9AA8A8;
  --line: #2A3436;
  --accent: #E0A152;
  --on-accent: #121819;
  --illustration: #8FA3A0;
  --focus: #E8ECEA;
  color-scheme: dark;
}
}

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