/* Current State brand tokens: the one source for colour, type, shape and spacing.
   Master rules: system/DESIGN-RULES.md in Van-Man/current-state-ops (D-0396, D-0397).
   Every page, preview and component reads from here. Nothing else defines a brand colour,
   font, radius or spacing value. Change a value here and everything follows.
   Check: python3 tools/check_tokens.py FILE.css ... (fails on a hard-coded colour outside this file). */

:root {
  /* ---- 1. Brand colours (primitives). Do not use these names in components; use section 2. ---- */
  --brand-navy: #1A2B4A;
  --brand-navy-deep: #0F1C33;       /* pressed and hover state of navy */
  --brand-gold: #B5822A;            /* decoration only: rules, rings, bars, icons (3.1:1 on paper) */
  --brand-gold-text: #8F6618;       /* gold you can read: text on paper, and fills under white text (4.7:1 or better) */
  --brand-gold-wash: #FBE6D4;       /* hover and selected wash */
  --brand-paper: #FFF1E5;           /* salmon page background */
  --brand-card: #FFF8F1;            /* cream card */
  --brand-white: #FFFFFF;
  --brand-rule: #E8D9C9;            /* hairlines and card edges */
  --brand-muted: #5C6478;           /* secondary text (5.3:1 on paper) */
  --brand-cream: #FEF3EA;           /* wordmark and text on navy */
  --brand-ai: #1F7A8C;              /* anything AI: voice tag, AI pill, Lily's label (D-0564) */
  --brand-ok: #2F6B4F;              /* confirmation text */
  --brand-alert: #8A3B2E;           /* error text */

  /* ---- 2. Roles (use these in components). One meaning each: gold is no longer used for six jobs (inconsistency 6). ---- */

  --c-action-bg: var(--brand-navy);         /* the main button */
  --c-action-text: var(--brand-cream);
  --c-action-bg-hover: var(--brand-navy-deep);

  --c-pill-ai-bg: var(--brand-ai);          /* "AI": anything Lily writes or says */
  --c-pill-ai-text: #FFFFFF;



  /* ---- 3. Type ---- */
  --font-serif: 'Source Serif 4', Georgia, 'Times New Roman', serif;   /* headlines and article text */
  --font-sans: 'Source Sans 3', system-ui, -apple-system, 'Segoe UI', Helvetica, Arial, sans-serif; /* controls, labels, meta */


  /* ---- 4. Shape ---- */
  --radius-pill: 999px;       /* chips, tabs, tags, pills and main action buttons: no square buttons */
  --radius-card: 8px;         /* cards, boxes, bubbles */
  --shadow-pop: 0 8px 24px rgba(26, 43, 74, 0.2);       /* bubbles and menus */

  /* ---- 5. Space (4px grid) and size ---- */
  --sp-2: 8px;
  --sp-4: 16px;
  --sp-5: 24px;
  --tap: 44px;                /* minimum size of anything you touch */
  --bar-bottom-h: 60px;

  /* ---- 6. Layers and motion ---- */
  --z-bar: 20;
  --z-lily: 40;
  --z-share: 35;
  --z-sheet: 60;
  --z-overlay: 80;           /* above everything: the skip link and short notices */
  --dur-fast: 150ms;
  --dur-slow: 400ms;
  --ease: cubic-bezier(.3,.7,.2,1);  /* the one curve for transitions (D-0661 G); the thank-you slide keeps its own */
}

/* Motion is slow and small, and stops for "reduce motion" (posters show as stills). */
@media (prefers-reduced-motion: reduce) {
  :root { --dur-fast: 0ms; --dur-slow: 0ms; }
}

/* ---- v4 mock-up: values the walked v3 pages actually show, where they differ from the draft above (D-0413: tokens follow v3) ---- */
:root {
  --brand-rule-page: #DCC8B3;       /* v3 page hairlines and card edges (v3 Lily parts use --brand-rule) */
  --brand-gold-text-page: #8A5F18;  /* v3 page tags, labels and links on paper (twist and Lily use --brand-gold-text) */
  --brand-muted-page: #5A6680;      /* v3 page meta text */
  --brand-input-edge: #B9A58E;      /* v3 form field edge */

  /* bridge: the names the v3 pages use, pointed at the tokens */
  --paper: var(--brand-paper);
  --card: var(--brand-card);
  --navy: var(--brand-navy);
  --gold: var(--brand-gold);
  --goldt: var(--brand-gold-text-page);
  --rule: var(--brand-rule-page);
  --mute: var(--brand-muted-page);
  --serif: var(--font-serif);
  --sans: var(--font-sans);
  --white: var(--brand-white);
  --cream: var(--brand-cream);
}

/* ---- spacing rhythm for the pages (Joe, 24 Nov): one set for a computer, one for a phone. Rules: system/DESIGN-RULES.md, Spacing ---- */
:root {
  --space-hero-after: 24px;   /* each side of the gap between the opening block and the first list, so 48px in all */
  --space-list-link: 32px;    /* between the last row of a list and its 'All issues' link */
  --space-section: 48px;      /* between two main sections */
  --space-block: 24px;        /* between blocks inside a section */
}
@media (max-width: 620px) {
  :root { --space-hero-after: 20px; --space-list-link: 24px; --space-section: 36px; --space-block: 20px; }
}

/* ---- 7. Dark set (D-0661 I): the same names with their dark values. The page follows the device setting only:
   there is no manual switch (D-0767). ---- */
:root {
  --dark-field: #0F1C33; /* dark theme only: form field fill */
  --dark-field-edge: #6A7FA6; /* dark theme only: form field edge */
  --dark-placeholder: #8795AD; /* dark theme only: placeholder text */
  --dark-ok-soft: #7FC8A0; /* dark theme only: thank-you text */
  --dark-lede: #C4CCDA;  /* dark theme only: lede and card date text */
  --dark-gold-lit: #EFC878; /* dark theme only: headline twist sheen highlight */
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --brand-paper:#101A2C;
    --brand-card:#182641;
    --brand-navy:#F3E9DC;
    --brand-cream:#101A2C;
    --brand-white:#1B2B49;
    --brand-gold:#D9A64A;
    --brand-gold-text:#E0B35A;
    --brand-gold-text-page:#E0B35A;
    --brand-gold-wash:#22324F;
    --brand-rule:#2B3C5C;
    --brand-rule-page:#2B3C5C;
    --brand-muted:#A9B3C4;
    --brand-muted-page:#A9B3C4;
    --brand-navy-deep:#FFFFFF;
    --brand-input-edge:#3A4C6E;
    --brand-alert:#F0A394;
    --brand-ok:#8FD0AE;
    --brand-ai:#5CC0D2;
    --c-pill-ai-bg:var(--brand-ai);
    --c-pill-ai-text:var(--brand-paper);
  }
}
