/* ==========================================================================
   Phaos Creative — design tokens
   Single source of truth for the WordPress theme. Every component style
   should reference these custom properties; no raw colors or sizes elsewhere.

   Themes
   - :root / [data-theme="light"]  Ivory (default)
   - [data-theme="dark"]           Ink
   - .theme-dark / .theme-light    Flip one section inside a page
     (e.g. <section class="theme-dark">). Semantic tokens re-map; brand
     tokens never change.

   Fonts: self-hosted in assets/fonts (see main.css @font-face).
   ========================================================================== */

:root {
  /* ── Brand palette (fixed in every theme) ─────────────────────────────── */
  --color-black:          #0a0a0a; /* brand black — never pure #000 */
  --color-black-raised:   #111111; /* raised fill on black: menus, nested panels */
  --color-ivory:          #f8f6f1; /* brand ivory — default page ground */
  --color-stone:          #efefeb; /* quiet alternate band, tag chips */
  --color-gray:           #8a8a8a; /* muted text on black (5.7:1); not for text on light grounds */
  --color-graphite:       #5e5d59; /* muted text on ivory (6.1:1) and stone (5.7:1) */
  --color-gray-strong:    #83827e; /* control borders on ivory (3.6:1) and stone (3.3:1) */
  --color-gold:           #c9a45c; /* Lux gold — the light. Fill/dot anywhere; text on black only (8.4:1) */
  --color-gold-deep:      #7a5f28; /* gold as text on ivory (5.6:1) / stone (5.2:1) */
  --color-line-on-light:  rgba(10, 10, 10, 0.1);
  --color-line-on-dark:   rgba(248, 246, 241, 0.12);
  --color-grid-on-light:  rgba(10, 10, 10, 0.04);
  --color-grid-on-dark:   rgba(248, 246, 241, 0.04);

  /* ── Typography: families & weights ───────────────────────────────────── */
  --font-serif: "Cormorant Garamond", Georgia, "Times New Roman", serif;
  --font-sans:  "DM Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-weight-light:   300;
  --font-weight-regular: 400;
  --font-weight-medium:  500;

  /* ── Typography: sizes (1rem = 16px) ──────────────────────────────────── */
  --font-size-display:   clamp(2.6rem, 8vw, 6rem);    /* 96px max — hero headline */
  --font-size-h1:        clamp(2.2rem, 4vw, 3.5rem);  /* 56px max — section titles */
  --font-size-h2:        clamp(1.9rem, 3.2vw, 2.5rem);/* 40px max — stats, sub-sections, big numbers */
  --font-size-h3:        1.5rem;    /* 24px — card titles */
  --font-size-statement: 1.4rem;    /* 22.4px — pull quotes (italic) */
  --font-size-h4:        1.2rem;    /* 19.2px — small card / FAQ titles */
  --font-size-wordmark:  1.125rem;  /* 18px — "PHAOS CREATIVE" */
  --font-size-motto:     0.85rem;   /* 13.6px */
  --font-size-body-lg:   1rem;      /* 16px — lead paragraphs */
  --font-size-body:      0.95rem;   /* 15.2px — default body */
  --font-size-input:     0.875rem;  /* 14px — form input text */
  --font-size-body-sm:   0.82rem;   /* 13.1px — card lists, form copy */
  --font-size-button:    0.78rem;   /* 12.5px — buttons, nav links */
  --font-size-eyebrow:   0.72rem;   /* 11.5px — hero eyebrow, marquee */
  --font-size-label:     0.68rem;   /* 10.9px — form labels, tags */
  --font-size-label-xs:  0.65rem;   /* 10.4px — section labels, edge tabs */

  /* ── Typography: line heights ─────────────────────────────────────────── */
  --line-height-display: 1.05;
  --line-height-heading: 1.1;   /* h1, h2 */
  --line-height-title:   1.2;   /* h3 */
  --line-height-snug:    1.3;   /* h4 */
  --line-height-ui:      1;     /* buttons, wordmark */
  --line-height-label:   1.4;   /* labels, motto */
  --line-height-input:   1.5;
  --line-height-quote:   1.6;   /* statement */
  --line-height-body-sm: 1.7;
  --line-height-body-lg: 1.8;
  --line-height-body:    1.9;

  /* ── Typography: letter spacing ───────────────────────────────────────── */
  --tracking-display:  -1px;
  --tracking-none:      0;
  --tracking-meta:      1px;   /* prices, motto */
  --tracking-ui:        2px;   /* buttons, labels */
  --tracking-wide:      3px;   /* nav wordmark */
  --tracking-wider:     4px;   /* eyebrows, section labels */
  --tracking-wordmark:  6px;   /* large wordmark */

  /* ── Spacing (48px grid; space-6 = one grid unit) ─────────────────────── */
  --space-0-5: 4px;
  --space-1:   8px;
  --space-1-5: 12px;
  --space-2:   16px;
  --space-3:   24px;
  --space-4:   32px;
  --space-5:   40px;
  --space-6:   48px;
  --space-8:   64px;
  --space-10:  80px;
  --space-14:  112px;
  --section-pad-y:        var(--space-14);
  --section-pad-x:        var(--space-8);
  --section-pad-y-mobile: 72px;
  --section-pad-x-mobile: var(--space-3);
  --container-max: 1200px;
  --measure:       62ch;   /* max line length for body copy */

  /* ── Radius (Phaos is square) ─────────────────────────────────────────── */
  --radius-none: 0;
  --radius-pill: 999px;   /* only: floating nav, its CTA, EN/ES switch, dots */

  /* ── Borders ──────────────────────────────────────────────────────────── */
  --border-hairline: 0.5px;
  --border-stroke:   1px;
  --border-strong:   2px;   /* error states, card hover rule */
  --focus-offset:    3px;

  /* ── Shadow (nav only) ────────────────────────────────────────────────── */
  --shadow-float: 0 12px 48px rgba(10, 10, 10, 0.12);

  /* ── Section edges: tabs & notches where dark meets light ─────────────── */
  --edge-depth: 24px;    /* how far a tab drops / a notch cuts */
  --edge-tab:   192px;   /* tab/notch width — 4 grid units */
  --edge-inset: 96px;    /* distance from the content edge — 2 grid units */
  --edge-inset-mobile: var(--space-3);

  /* ── Grid texture ─────────────────────────────────────────────────────── */
  --grid-size: 48px;

  /* ── Component sizes ──────────────────────────────────────────────────── */
  --size-logo-nav:     28px;
  --size-logo-header:  38px;
  --size-logo-hero:    88px;
  --size-icon:         40px;
  --size-checkbox:     18px;
  --size-dot:          4px;
  --size-label-rule:   30px;
  --size-nav-max:      1100px;
  --size-textarea-min: 96px;

  /* ── Motion ───────────────────────────────────────────────────────────── */
  --ease:            cubic-bezier(0.76, 0, 0.24, 1);
  --duration-fast:   0.2s;
  --duration-base:   0.35s;
  --duration-slow:   0.8s;
  --duration-pulse:  2.4s;   /* logo ray pulse */
  --duration-spin:   8s;     /* logo slow turn on hover */

  /* ── Layering ─────────────────────────────────────────────────────────── */
  --z-edge: 1;
  --z-nav:  100;

  /* ── Breakpoints (reference values — CSS can't use var() inside @media;
        copy these numbers into media queries) ────────────────────────────── */
  --bp-sm: 480px;    /* phones: stack form rows */
  --bp-md: 768px;    /* tablets: collapse nav, 1-column cards */
  --bp-lg: 1024px;   /* small laptops */
  --bp-xl: 1280px;   /* desktop */
}

/* ── Semantic tokens: Ivory theme (default) ─────────────────────────────── */
:root,
[data-theme="light"],
.theme-light {
  --color-surface:        var(--color-ivory);
  --color-surface-alt:    var(--color-stone);
  --color-ink:            var(--color-black);
  --color-ink-muted:      var(--color-graphite);
  --color-line:           var(--color-line-on-light);
  --color-grid-line:      var(--color-grid-on-light);
  --color-control-border: var(--color-gray-strong);
  --color-accent:         var(--color-gold-deep);  /* gold as text on this ground */
  --color-accent-on-ink:  var(--color-gold);       /* gold on an ink-filled element (black here) */
  --color-glow:           var(--color-gold);       /* gold as a fill / dot */
  --color-focus:          var(--color-black);
}

/* ── Semantic tokens: Ink theme ─────────────────────────────────────────── */
[data-theme="dark"],
.theme-dark {
  --color-surface:        var(--color-black);
  --color-surface-alt:    var(--color-black-raised);
  --color-ink:            var(--color-ivory);
  --color-ink-muted:      var(--color-gray);
  --color-line:           var(--color-line-on-dark);
  --color-grid-line:      var(--color-grid-on-dark);
  --color-control-border: var(--color-gray);
  --color-accent:         var(--color-gold);
  --color-accent-on-ink:  var(--color-gold-deep);  /* ink-filled elements are ivory here */
  --color-glow:           var(--color-gold);
  --color-focus:          var(--color-gold);
  --shadow-float: 0 12px 48px rgba(0, 0, 0, 0.5);
}

/* Section flips paint their own ground and text */
.theme-light,
.theme-dark {
  background-color: var(--color-surface);
  color: var(--color-ink);
}

/* ==========================================================================
   Theme overrides (merged from the design handoff's older src/tokens.css)
   The handoff tokens were renamed to the names above; it is not shipped.
   Where values differed:
   - Colour / contrast: the design system wins (e.g. --color-control-border
     is gray-strong 3.6:1 on ivory, not gray).
   - Motion: ANIMATION-SPEC.md wins (--duration-fast .3s, --duration-base .5s).
   - Type scale + responsive spacing: the approved dist/ pages win.
   ========================================================================== */
:root {
  --duration-fast: 0.3s;   /* ANIMATION-SPEC: hover, chips, menu, icons */
  --duration-base: 0.5s;   /* ANIMATION-SPEC: nav, sticky split states */

  --font-size-display: clamp(2.75rem, 6.7vw, 6rem);   /* 44 → 96 */
  --font-size-h1:      clamp(2.25rem, 3.9vw, 3.5rem); /* 36 → 56 */
  --font-size-h2:      2.5rem;                        /* 40 */
  --line-height-body:  1.85;

  /* Breakpoints actually used by the approved layout (dist/) */
  --bp-nav:   960px;   /* nav collapses to the menu button, card grids stack */
  --bp-split: 900px;   /* two-column sections and the sticky split stack */
}

@media (max-width: 768px) {
  :root {
    --section-pad-y: var(--section-pad-y-mobile);
    --section-pad-x: var(--section-pad-x-mobile);
    --edge-tab:      160px;
    --edge-inset:    var(--edge-inset-mobile);
  }
}
