/* ============================================================
   bertmahoney.com — Design Tokens
   Layer 1: raw literals (never referenced directly by components)
   Layer 2: semantic tokens (what components actually use)
   Same two-layer pattern the AIBT theme proved out.

   PALETTE (Nov 2026): the nine-colour mid-century modern set is the
   base. Its tan is dropped on purpose: day mode is a white page.
   The Craftsman set fills the gaps the base leaves (a light blue, a
   lighter brown, a lighter orange, pale creams for light-background
   pages). Hex values were sampled from the two reference images.
   ============================================================ */

/* ---------- Layer 1: literals ---------- */
:root {
  /* mid-century modern — the base */
  --lit-mustard:   #C7A93F;
  --lit-orange:    #C2633B;
  --lit-teal:      #3F8D7E;
  --lit-rust:      #A04D3D;
  --lit-olive:     #7D813A;
  --lit-navy:      #0C1F3E;
  --lit-brown:     #5C3D29;
  --lit-oxblood:   #551E11;

  /* craftsman — the round-out (name = the paint's own name) */
  --lit-champness:    #869EA9;  /* light blue */
  --lit-inglenook:    #98A9A3;  /* grey-sage */
  --lit-norton:       #679C82;  /* lighter teal */
  --lit-craftsman:    #A5C39D;  /* pale green */
  --lit-upper-canada: #9CB969;  /* lighter olive */
  --lit-lichen:       #F4BF89;  /* lighter orange */
  --lit-dusty-rose:   #B0553A;  /* lighter rust */
  --lit-amber:        #A57431;  /* lighter brown */
  --lit-sand:         #D1B880;
  --lit-combed-wool:  #E6D7A0;
  --lit-raw-silk:     #F5EFD9;  /* light-page background */
  --lit-casement:     #FFFEEC;
  --lit-white:        #FFFFFF;

  /* derived tones (mixed from the above; the ratios are in the comments) */
  --lit-teal-deep:    #2F6A5E;  /* teal darkened 25%: links and the primary button on white */
  --lit-navy-60:      #556278;  /* navy mixed 30% to white: quiet text on white */
  --lit-navy-lift:    #1B2C4A;  /* navy mixed 6% to white: raised surfaces at night */
  --lit-navy-edge:    #2E3E59;  /* navy mixed 14% to white: hairlines at night */
  --lit-silk-80:      #D2D0C2;  /* raw silk mixed 15% to navy: secondary text at night */
  --lit-silk-60:      #A3A6A3;  /* raw silk mixed 35% to navy: quiet text at night */
}

/* ---------- Layer 2: semantic tokens — DAY (default) ---------- */
:root {
  color-scheme: light;

  /* surfaces & text */
  --page-bg:         var(--lit-white);
  --surface-tint:    var(--lit-raw-silk);   /* light-background pages (.bm-tint) */
  --surface-raised:  var(--lit-white);      /* cards sitting on a tinted page */
  --card-bg:         var(--lit-raw-silk);
  --ink:             var(--lit-navy);
  --text-secondary:  var(--lit-brown);
  --text-tertiary:   var(--lit-navy-60);
  --text-muted:      var(--lit-navy-60);
  --text-on-dark:    var(--lit-raw-silk);
  --border:          var(--lit-combed-wool);
  --border-strong:   var(--lit-amber);       /* control outlines: 3:1 or better */

  /* the eight discipline lanes, in order: web, mobile, software,
     advertising, packaging, book, editorial, educational. One colour
     per discipline everywhere it appears. Fill/marker use; put the
     discipline's NAME beside it, never rely on colour alone. */
  --spectrum-01: var(--lit-navy);
  --spectrum-02: var(--lit-teal);
  --spectrum-03: var(--lit-olive);
  --spectrum-04: var(--lit-orange);
  --spectrum-05: var(--lit-mustard);
  --spectrum-06: var(--lit-oxblood);
  --spectrum-07: var(--lit-brown);
  --spectrum-08: var(--lit-champness);

  /* text that sits ON each lane colour (best of navy / white) */
  --on-spectrum-01: var(--lit-white);
  --on-spectrum-02: var(--lit-navy);
  --on-spectrum-03: var(--lit-white);
  --on-spectrum-04: var(--lit-white);
  --on-spectrum-05: var(--lit-navy);
  --on-spectrum-06: var(--lit-white);
  --on-spectrum-07: var(--lit-white);
  --on-spectrum-08: var(--lit-navy);

  /* actions */
  --accent-start:    var(--lit-teal-deep);
  --on-accent-start: var(--lit-white);
  --accent-book:     var(--lit-rust);
  --on-accent-book:  var(--lit-white);
  --link:            var(--lit-teal-deep);
}

/* ---------- NIGHT — same family, not a generic invert. Chosen by
   the sun-theme plugin (sets data-theme on <html> from sunrise/
   sunset). With no JS it falls back to the OS setting. ---------- */
:root[data-theme="dark"] {
  color-scheme: dark;
  --page-bg:         var(--lit-navy);
  --surface-tint:    var(--lit-navy-lift);
  --surface-raised:  var(--lit-navy);
  --card-bg:         var(--lit-navy-lift);
  --ink:             var(--lit-raw-silk);
  --text-secondary:  var(--lit-silk-80);
  --text-tertiary:   var(--lit-silk-60);
  --text-muted:      var(--lit-silk-60);
  --text-on-dark:    var(--lit-raw-silk);
  --border:          var(--lit-navy-edge);
  --border-strong:   var(--lit-champness);

  /* lanes re-pitched for a navy ground (every one 3:1 or better) */
  --spectrum-01: var(--lit-champness);
  --spectrum-02: var(--lit-norton);
  --spectrum-03: var(--lit-upper-canada);
  --spectrum-04: var(--lit-orange);
  --spectrum-05: var(--lit-mustard);
  --spectrum-06: var(--lit-dusty-rose);
  --spectrum-07: var(--lit-amber);
  --spectrum-08: var(--lit-craftsman);

  --on-spectrum-01: var(--lit-navy);
  --on-spectrum-02: var(--lit-navy);
  --on-spectrum-03: var(--lit-navy);
  --on-spectrum-04: var(--lit-navy);
  --on-spectrum-05: var(--lit-navy);
  --on-spectrum-06: var(--lit-white);
  --on-spectrum-07: var(--lit-navy);
  --on-spectrum-08: var(--lit-navy);

  --accent-start:    var(--lit-mustard);
  --on-accent-start: var(--lit-navy);
  --accent-book:     var(--lit-lichen);
  --on-accent-book:  var(--lit-navy);
  --link:            var(--lit-craftsman);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme]) {
    color-scheme: dark;
    --page-bg:         var(--lit-navy);
    --surface-tint:    var(--lit-navy-lift);
    --surface-raised:  var(--lit-navy);
    --card-bg:         var(--lit-navy-lift);
    --ink:             var(--lit-raw-silk);
    --text-secondary:  var(--lit-silk-80);
    --text-tertiary:   var(--lit-silk-60);
    --text-muted:      var(--lit-silk-60);
    --text-on-dark:    var(--lit-raw-silk);
    --border:          var(--lit-navy-edge);
    --border-strong:   var(--lit-champness);
    --spectrum-01: var(--lit-champness);
    --spectrum-02: var(--lit-norton);
    --spectrum-03: var(--lit-upper-canada);
    --spectrum-04: var(--lit-orange);
    --spectrum-05: var(--lit-mustard);
    --spectrum-06: var(--lit-dusty-rose);
    --spectrum-07: var(--lit-amber);
    --spectrum-08: var(--lit-craftsman);
    --on-spectrum-01: var(--lit-navy);
    --on-spectrum-02: var(--lit-navy);
    --on-spectrum-03: var(--lit-navy);
    --on-spectrum-04: var(--lit-navy);
    --on-spectrum-05: var(--lit-navy);
    --on-spectrum-06: var(--lit-white);
    --on-spectrum-07: var(--lit-navy);
    --on-spectrum-08: var(--lit-navy);
    --accent-start:    var(--lit-mustard);
    --on-accent-start: var(--lit-navy);
    --accent-book:     var(--lit-lichen);
    --on-accent-book:  var(--lit-navy);
    --link:            var(--lit-craftsman);
  }
}

/* ============================================================
   Typography tokens. The @font-face rules live in fonts.css
   (self-hosted woff2 in /assets/fonts).
   ============================================================ */

:root {
  --font-serif: 'Fraunces', Georgia, serif;
  --font-sans:  'Geist', -apple-system, sans-serif;
  --font-mono:  'Geist Mono', monospace;

  /* Fraunces' optical-size axis is doing the real work here —
     letterforms de-contrast at small opsz so text stays sturdy
     at 1rem instead of just rendering a thinner display cut. */
  --opsz-display: 144;   /* hero headlines — "The whole spectrum." */
  --opsz-heading: 60;    /* project titles */
  --opsz-text:    16;    /* body-adjacent serif moments */
  --opsz-micro:   9;     /* anything under 14px */

  /* ---------- Display H1–H6: true golden ratio, base-up.
     H6 is the base unit (1rem); every step above multiplies
     by phi (1.618). This is the disciplined heading ladder —
     used for real content hierarchy across pages. ---------- */
  --ratio-golden: 1.618;
  --text-h6: 1rem;        /* 16px  — phi^0 */
  --text-h5: 1.618rem;    /* ~26px — phi^1 */
  --text-h4: 2.618rem;    /* ~42px — phi^2 */
  --text-h3: 4.236rem;    /* ~68px — phi^3 */
  --text-h2: 6.854rem;    /* ~110px — phi^4 */
  --text-h1: 11.089rem;   /* ~177px — phi^5 */

  /* ---------- Hero display: NOT part of the golden ladder above.
     This is the one-off treatment for the full-viewport "The whole
     spectrum." moment only — fluid off viewport height (it lives in
     a 100vh stage), floored at H1's golden value so it never reads
     smaller than the top of the real scale, ceilinged at ~300px so
     it can't run away on very tall displays. ---------- */
  --text-hero: clamp(var(--text-h1), 25vh, 18.75rem);
  --hero-measure: 60rem; /* line-length cap on the hero text block */

  /* type scale — clamp() so display sizing doesn't need its
     own breakpoint story */
  --text-display: var(--text-hero); /* kept as an alias — existing code referenced this name */
  --text-body:    1rem;
  --text-meta:    0.75rem;   /* "DIGITAL · LED TEAM OF 4–14" */

  /* the eyebrow/label treatment used constantly in the mockup —
     nav items, "SELECTED WORK", "SECTORS" — bundled once so it's
     one decision, applied consistently, not re-invented per use */
  --label-size:      0.6875rem;
  --label-tracking:  0.15em;
  --label-transform: uppercase;
  --label-weight:    600;
}

.label {
  font-family: var(--font-sans);
  font-size: var(--label-size);
  letter-spacing: var(--label-tracking);
  text-transform: var(--label-transform);
  font-weight: var(--label-weight);
  color: var(--text-tertiary);
}

/* ============================================================
   Motion — the Calder / Powers-of-Ten layer.
   Every value here is overridden to zero movement under
   prefers-reduced-motion — see below.
   ============================================================ */
:root {
  /* zoom stages — Powers-of-Ten vertical axis (scale traversal) */
  --zoom-duration: 1800ms;
  --zoom-ease: cubic-bezier(0.65, 0, 0.35, 1);

  /* lateral lanes — Calder axis. Deliberately its own, shorter
     duration: moving between siblings should feel quick and light,
     not share the zoom axis's slow, dramatic timing. */
  --lane-duration: 420ms;

  /* parallax lanes — Calder lateral axis. Three speeds, not six —
     more layers than this reads as noise ("less is more"). Each
     is a ratio applied to scroll delta, not a fixed pixel value. */
  --parallax-back: 0.4;   /* background plane — slowest */
  --parallax-mid:  0.7;
  --parallax-fore: 1.0;   /* foreground — moves 1:1 with scroll */
}

@media (prefers-reduced-motion: reduce) {
  :root {
    --zoom-duration: 0ms;
    --lane-duration: 0ms;
    --parallax-back: 1;
    --parallax-mid:  1;
    --parallax-fore: 1;
  }
}
