/* theyworkweplay.com — design tokens (fable, design director). v1.0, 26 Nov 2026.
   Source of truth for colour, type, space, radius, shadow and motion.
   Cursor: load this first in site.css (or paste it at the top); never hard-code a value that exists here.
   Light is default; dark follows the OS (prefers-color-scheme) and can be forced with html[data-theme="dark"|"light"].
   No external fonts, no CDN. Everything is a CSS custom property; nothing here selects a component. */

:root {
  color-scheme: light dark;

  /* ---------- 1. Colour: light ---------- */
  /* Warm paper, warm ink. The brand is teal (trust, "work") with a coral + sun accent (play). */
  --c-paper:        #EEF4F1;   /* page background */
  --c-surface:      #FFFFFF;   /* cards, panels */
  --c-surface-2:    #E2ECE7;   /* wells, code, inset areas */
  --c-surface-3:    #D3E0DA;   /* pressed / selected wells */
  --c-line:         #D0DDD7;   /* hairlines */
  --c-line-strong:  #7E8B87;   /* input borders, dividers that must be seen */

  --c-ink:          #14201E;   /* body text   (vs paper 16.4:1) */
  --c-ink-2:        #3F514D;   /* secondary   (vs paper 8.7:1)  */
  --c-ink-3:        #566864;   /* muted/meta  (vs paper 5.0:1)  */
  --c-ink-inverse:  #EEF4F1;

  --c-brand:        #0A6563;   /* teal: links, primary buttons (white on it 6.3:1 AA) */
  --c-brand-hover:  #074E4C;
  --c-brand-soft:   #D3ECE9;   /* tinted backgrounds, selected chips */
  --c-brand-ink:    #0A6563;   /* teal as text on paper (6.0:1) */

  --c-play:         #E4552A;   /* coral: accents, stickers, large display text only (3.5:1 on paper, AA large only) */
  --c-play-ink:     #B2401A;   /* coral as small text (5.1:1 on paper) */
  --c-play-soft:    #FCE3D9;

  --c-sun:          #F5C04A;   /* highlights, marker underline, "new" dots */
  --c-sun-soft:     #FCEFC6;

  --c-ok:           #2A7631;
  --c-ok-soft:      #DBEFDB;
  --c-warn:         #7F5600;   /* risks callout border + icon (5.9:1 on paper) */
  --c-warn-soft:    #FBEFD2;
  --c-danger:       #B1261E;
  --c-danger-soft:  #F9DDDB;

  --c-focus:        #0A6563;   /* focus ring colour (2px solid + 2px offset) */
  --c-selection:    #FBE7A3;

  /* Autonomy = one hue, increasing fill, never traffic-light colours. */
  --c-autonomy-track: #D9E3DF;
  --c-autonomy-fill:  #0A6563;

  /* ---------- 2. Type ---------- */
  /* System stack only (team rule: no external fonts). Headings: same family, heavy, tight. */
  --font-sans: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif, "Apple Color Emoji", "Segoe UI Emoji";
  --font-mono: ui-monospace, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;

  /* Fluid scale (Utopia-style): min at 390px, max at 1280px. */
  --step--2: clamp(0.72rem, 0.70rem + 0.10vw, 0.78rem);   /* 11.5–12.5px  meta, tag chips */
  --step--1: clamp(0.83rem, 0.80rem + 0.15vw, 0.92rem);   /* 13.3–14.7px  captions, small UI */
  --step-0:  clamp(1.00rem, 0.96rem + 0.20vw, 1.10rem);   /* 16–17.6px    body */
  --step-1:  clamp(1.15rem, 1.08rem + 0.35vw, 1.35rem);   /* 18.4–21.6px  lead, h4 */
  --step-2:  clamp(1.35rem, 1.22rem + 0.60vw, 1.70rem);   /* 21.6–27.2px  h3 */
  --step-3:  clamp(1.65rem, 1.40rem + 1.10vw, 2.25rem);   /* 26.4–36px    h2 */
  --step-4:  clamp(2.05rem, 1.60rem + 1.90vw, 3.10rem);   /* 32.8–49.6px  h1 */
  --step-5:  clamp(2.50rem, 1.80rem + 3.00vw, 4.20rem);   /* 40–67px      home hero only */

  --lh-tight: 1.1;
  --lh-snug:  1.25;
  --lh-body:  1.55;
  --lh-loose: 1.7;

  --tracking-tight: -0.02em;   /* h1, h2 */
  --tracking-snug:  -0.01em;   /* h3 */
  --tracking-caps:   0.06em;   /* small caps labels */

  --measure: 68ch;             /* max line length for prose */

  /* ---------- 3. Space (4px base) ---------- */
  --sp-1: 0.25rem;  /* 4  */
  --sp-2: 0.5rem;   /* 8  */
  --sp-3: 0.75rem;  /* 12 */
  --sp-4: 1rem;     /* 16 */
  --sp-5: 1.25rem;  /* 20 */
  --sp-6: 1.5rem;   /* 24 */
  --sp-8: 2rem;     /* 32 */
  --sp-10: 2.5rem;  /* 40 */
  --sp-12: 3rem;    /* 48 */
  --sp-16: 4rem;    /* 64 */
  --sp-20: 5rem;    /* 80 */
  --sp-24: 6rem;    /* 96 */

  --gutter: clamp(1rem, 4vw, 2rem);     /* page side padding */
  --container: 76rem;                   /* 1216px content max */
  --container-narrow: 46rem;            /* prose pages */
  --section-gap: clamp(3rem, 8vw, 6rem);

  /* ---------- 4. Radius ---------- */
  --r-xs: 4px;
  --r-sm: 6px;     /* chips, small buttons, inputs */
  --r-md: 10px;    /* buttons, inputs */
  --r-lg: 16px;    /* cards, callouts, panels */
  --r-xl: 24px;    /* hero wells, drawers */
  --r-pill: 999px; /* chips, meters, avatars */

  /* ---------- 5. Shadow (warm-tinted, low) ---------- */
  --shadow-1: 0 1px 2px rgba(60, 45, 20, 0.06), 0 1px 1px rgba(60, 45, 20, 0.04);
  --shadow-2: 0 2px 6px rgba(60, 45, 20, 0.08), 0 8px 24px -12px rgba(60, 45, 20, 0.18);
  --shadow-3: 0 12px 40px -12px rgba(60, 45, 20, 0.28), 0 2px 6px rgba(60, 45, 20, 0.08);
  --shadow-focus: 0 0 0 2px var(--c-paper), 0 0 0 4px var(--c-focus);

  /* ---------- 6. Motion ---------- */
  --dur-1: 120ms;   /* hover, colour */
  --dur-2: 200ms;   /* reveal, chips, toggles */
  --dur-3: 320ms;   /* drawers, panels, page bits */
  --ease-out:   cubic-bezier(0.2, 0.8, 0.2, 1);
  --ease-in-out: cubic-bezier(0.65, 0, 0.35, 1);
  --ease-spring: cubic-bezier(0.34, 1.4, 0.64, 1);  /* "play": a tiny overshoot on save/star */

  /* ---------- 7. Layers ---------- */
  --z-header: 50;
  --z-drawer: 70;
  --z-toast: 90;
  --z-dialog: 100;

  /* ---------- 8. Sizes ---------- */
  --tap: 44px;              /* minimum hit target */
  --control-h: 40px;        /* buttons, inputs */
  --control-h-sm: 32px;
  --control-h-lg: 48px;
  --header-h: 64px;
  --icon: 20px;
  --icon-sm: 16px;
}

/* ---------- Dark ---------- */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --c-paper:        #0F1716;
    --c-surface:      #172120;
    --c-surface-2:    #1E2A28;
    --c-surface-3:    #283634;
    --c-line:         #283634;
    --c-line-strong:  #5A6765;

    --c-ink:          #ECF3F0;
    --c-ink-2:        #C3D0CB;
    --c-ink-3:        #97A8A2;
    --c-ink-inverse:  #0F1716;

    --c-brand:        #3FB1AD;   /* lighter teal; ink-inverse text on it 6.7:1 */
    --c-brand-hover:  #5FC7C3;
    --c-brand-soft:   #143F3D;
    --c-brand-ink:    #5FC7C3;   /* teal as text on dark paper 8.7:1 */

    --c-play:         #F47A52;
    --c-play-ink:     #F79C7E;
    --c-play-soft:    #3F261D;

    --c-sun:          #F5C04A;
    --c-sun-soft:     #3A3017;

    --c-ok:           #7DC781;
    --c-ok-soft:      #1D3320;
    --c-warn:         #E8B04B;
    --c-warn-soft:    #3A2F14;
    --c-danger:       #F2857B;
    --c-danger-soft:  #3E1F1D;

    --c-focus:        #5FC7C3;
    --c-selection:    #574A1C;

    --c-autonomy-track: #283634;
    --c-autonomy-fill:  #3FB1AD;

    --shadow-1: 0 1px 2px rgba(0,0,0,0.4);
    --shadow-2: 0 2px 6px rgba(0,0,0,0.5), 0 8px 24px -12px rgba(0,0,0,0.7);
    --shadow-3: 0 12px 40px -12px rgba(0,0,0,0.8), 0 2px 6px rgba(0,0,0,0.5);
  }
}
:root[data-theme="dark"] {
  --c-paper:#0F1716; --c-surface:#172120; --c-surface-2:#1E2A28; --c-surface-3:#283634;
  --c-line:#283634; --c-line-strong:#5A6765;
  --c-ink:#ECF3F0; --c-ink-2:#C3D0CB; --c-ink-3:#97A8A2; --c-ink-inverse:#0F1716;
  --c-brand:#3FB1AD; --c-brand-hover:#5FC7C3; --c-brand-soft:#143F3D; --c-brand-ink:#5FC7C3;
  --c-play:#F47A52; --c-play-ink:#F79C7E; --c-play-soft:#3F261D;
  --c-sun:#F5C04A; --c-sun-soft:#3A3017;
  --c-ok:#7DC781; --c-ok-soft:#1D3320; --c-warn:#E8B04B; --c-warn-soft:#3A2F14; --c-danger:#F2857B; --c-danger-soft:#3E1F1D;
  --c-focus:#5FC7C3; --c-selection:#574A1C;
  --c-autonomy-track:#283634; --c-autonomy-fill:#3FB1AD;
  --shadow-1:0 1px 2px rgba(0,0,0,0.4);
  --shadow-2:0 2px 6px rgba(0,0,0,0.5),0 8px 24px -12px rgba(0,0,0,0.7);
  --shadow-3:0 12px 40px -12px rgba(0,0,0,0.8),0 2px 6px rgba(0,0,0,0.5);
}

/* ---------- Motion: respect the user ---------- */
@media (prefers-reduced-motion: reduce) {
  :root { --dur-1: 0ms; --dur-2: 0ms; --dur-3: 0ms; }
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; scroll-behavior: auto !important; }
}

/* ---------- Base (tiny, token-driven; components live in site.css) ---------- */
*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { background: var(--c-paper); color: var(--c-ink); font-family: var(--font-sans); font-size: 100%; -webkit-text-size-adjust: 100%; }
body { margin: 0; font-size: var(--step-0); line-height: var(--lh-body); text-rendering: optimizeLegibility; }
::selection { background: var(--c-selection); color: var(--c-ink); }
:focus-visible { outline: 2px solid var(--c-focus); outline-offset: 2px; border-radius: var(--r-xs); }
a { color: var(--c-brand-ink); text-decoration-thickness: 1px; text-underline-offset: 0.15em; }
a:hover { color: var(--c-brand-hover); }
h1, h2, h3, h4 { line-height: var(--lh-snug); margin: 0 0 var(--sp-3); text-wrap: balance; }
h1 { font-size: var(--step-4); letter-spacing: var(--tracking-tight); line-height: var(--lh-tight); font-weight: 800; }
h2 { font-size: var(--step-3); letter-spacing: var(--tracking-tight); font-weight: 750; }
h3 { font-size: var(--step-2); letter-spacing: var(--tracking-snug); font-weight: 700; }
h4 { font-size: var(--step-1); font-weight: 650; }
p { margin: 0 0 var(--sp-4); max-width: var(--measure); }
small, .meta { font-size: var(--step--1); color: var(--c-ink-3); }
code, kbd, pre { font-family: var(--font-mono); font-size: 0.92em; }
kbd { border: 1px solid var(--c-line-strong); border-bottom-width: 2px; border-radius: var(--r-xs); padding: 0 0.4em; background: var(--c-surface); }
img, svg, video { max-width: 100%; height: auto; display: block; }
button, input, select, textarea { font: inherit; color: inherit; }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap; }
