/* ─────────────────────────────────────────────────────────────────────────
   Azul by Omar — Design Tokens
   "Welcome Home" · Fergusons Marina, Mosman
   Editorial · cinematic · waterfront · Moroccan warmth
   ───────────────────────────────────────────────────────────────────────── */

/* Fonts (Fraunces + Manrope) are loaded via a <link> in partials/head.html so
   the browser can discover them immediately. An @import here would serialize
   the font request behind tokens.css parsing and slow every page's heading LCP. */

:root {
  /* ── Palette ────────────────────────────────────────────────────────── */
  /* Client colour system — supplied by Ashton (Azul), email 2026-07-23.
     Raw client tokens first; semantic tokens map onto them below. */
  --c-navy:        #071628;   /* Primary Navy */
  --c-navy-2:      #1B2E50;   /* Secondary Navy */
  --c-marina:      #4E7996;   /* Marina Blue — 4.2:1 on cream: large text / decorative / focus rings only */
  --c-cream:       #F7F2EA;   /* Warm Cream */
  --c-white-warm:  #FCFAF7;   /* Warm White */
  --c-terra:       #C58A52;   /* Terracotta Accent */
  --c-terra-deep:  #B66A4C;   /* Deep Terracotta — 3.7:1 on cream: decorative only, see --c-clay-text */
  --c-charcoal:    #22252A;   /* Charcoal */
  --c-grey:        #6D6D6D;   /* Soft Grey */
  --c-border:      #D9CCBC;   /* Border */
  --c-blue-soft:   #D9E4EC;   /* Soft Blue Background — CONFIRMED by Ashton 2026-08-08. Her 23 Jul email said "#EEF5" (invalid hex, two digits short); this value was sampled from the menu mock-up's blue bands and she has since confirmed it is right. Not a guess any more — see #180 */

  /* ── Semantic mapping ─────────────────────────────────────────────── */
  --c-ink:        var(--c-navy);          /* deep harbour ink — primary text */
  --c-ink-soft:   var(--c-navy-2);        /* secondary text on cream */
  /* NOT --c-grey. The client's Soft Grey #6D6D6D is 4.64:1 on cream — it only
     just clears AA there, and the site puts the same muted text on two tinted
     bands where it does not: 4.01:1 on --c-blue-soft (the /menu colour blocks,
     the /live-music return band) and 3.28:1 on --c-stone (the /whats-on
     newsletter). Since .eyebrow is --fg-mute, that was every section label on
     those bands, not just captions.
     Darkened once here rather than overridden per band: a scoped list is a
     thing to forget the next time a section changes background, and this is
     the same failure the dark-section list exists to prevent. #565656 clears
     AA on all four surfaces (cream 6.59, warm white 7.04, soft blue 5.68,
     stone 4.65). --c-grey itself is untouched — it is a client palette token. */
  --c-grey-deep:  #565656;
  --c-mute:       var(--c-grey-deep);     /* tertiary text, captions */

  --c-bone:       var(--c-cream);         /* primary surface */
  --c-shell:      var(--c-white-warm);    /* lifted surface */
  --c-stone:      var(--c-border);        /* warm divider / muted bg */

  /* Brand blues — client navy system (replaces logo #36499F derivation) */
  --c-azul:       var(--c-navy-2);        /* primary brand blue — 12.1:1 on cream */
  --c-azul-deep:  var(--c-navy);          /* deeper brand blue */
  --c-azul-glow:  var(--c-marina);        /* daylight blue accent — 4.2:1 on cream, large text / non-text only */
  --c-sky:        var(--c-blue-soft);     /* pale-blue colour-block tier (from main's --c-sky); aligned to client soft-blue */

  /* The brand "accent" — historically saffron, now the brand blue itself.
     Dark-bg sections override this to cream below so contrast survives. */
  --c-saffron:      var(--c-azul);
  /* Text/icon colour that sits ON --c-saffron. Must be flipped wherever
     --c-saffron is, or solid accent buttons render navy-on-navy (1.4:1). */
  --c-on-saffron:   var(--c-cream);       /* cream on navy — 12.1:1 */
  --c-saffron-soft: var(--c-blue-soft);   /* pale blue tint */
  --c-clay:         var(--c-terra);       /* terracotta — decorative accent */
  --c-clay-text:    #A34A28;              /* saturated terracotta for TEXT on cream — 5.3:1 (and 4.6:1 on --c-blue-soft) where --c-terra-deep (3.7:1) fails AA; matches the mock-up's burnt-terracotta prices */
  --c-clay-soft:    color-mix(in oklch, var(--c-terra) 35%, var(--c-cream));

  --c-moss:       oklch(46% 0.05 130);    /* subtle olive / herb green */

  /* Surfaces */
  --bg:            var(--c-bone);
  --bg-lift:       var(--c-shell);
  --bg-sky:        var(--c-sky);      /* pale blue colour-block tier */
  --bg-deep:       var(--c-azul-deep);
  --bg-night:      var(--c-charcoal);

  --fg:            var(--c-ink);
  --fg-soft:       var(--c-ink-soft);
  --fg-mute:       var(--c-mute);
  --fg-on-deep:    var(--c-bone);

  --line:          color-mix(in oklch, var(--c-ink) 14%, transparent);
  --line-soft:     color-mix(in oklch, var(--c-ink) 7%, transparent);
  --line-on-deep:  color-mix(in oklch, var(--c-bone) 18%, transparent);

  /* Form field boundaries. Separate from --line because 1.4.11 asks 3:1 of the
     boundary of a control, and --line is 1.34:1 — the inputs read as floating
     underlines rather than as fields. Dividers and card edges are decoration
     and stay on --line; these are the only borders the SC applies to.
     52% lands at 3.59:1 on cream and 3.45:1 on soft blue; 42% of cream on navy
     is 3.24:1 on navy-2. Both are the lightest step that clears 3:1 — the
     point is a field that is visibly a field, not a heavy box. */
  --line-field:         color-mix(in oklch, var(--c-ink) 52%, transparent);
  --line-field-on-deep: color-mix(in oklch, var(--c-bone) 42%, transparent);

  /* Focus indicator. Overridden to cream on every dark section below — marina
     blue is 2.9:1 on navy-2 and fails 1.4.11 there. */
  --focus-ring:    var(--c-azul-glow);

  --accent:        var(--c-saffron);
  --accent-2:      var(--c-clay);

  /* ── Type ──────────────────────────────────────────────────────────── */
  --font-display: 'Fraunces', 'Cormorant Garamond', 'Iowan Old Style', Georgia, serif;
  --font-body:    'Manrope', 'Helvetica Neue', system-ui, -apple-system, sans-serif;
  --font-mono:    'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, monospace;

  /* Fluid type scale — generous, editorial */
  --t-eyebrow: 0.75rem;
  --t-small:   0.875rem;
  --t-body:    clamp(1rem, 0.95rem + 0.2vw, 1.0625rem);
  --t-lead:    clamp(1.125rem, 1rem + 0.6vw, 1.375rem);
  --t-h6:      1.0625rem;
  --t-h5:      1.25rem;
  --t-h4:      clamp(1.375rem, 1.2rem + 0.8vw, 1.75rem);
  --t-h3:      clamp(1.625rem, 1.3rem + 1.5vw, 2.25rem);
  --t-h2:      clamp(2rem, 1.4rem + 3vw, 3.25rem);
  --t-h1:      clamp(2.5rem, 1.6rem + 4.5vw, 4.5rem);
  --t-display: clamp(3rem, 1.6rem + 7vw, 7rem);
  --t-mega:    clamp(4rem, 1.6rem + 13vw, 13rem);

  --leading-tight:  1.05;
  --leading-snug:   1.18;
  --leading-norm:   1.5;
  --leading-loose:  1.7;

  --tracking-tight: -0.025em;
  --tracking-norm:  -0.005em;
  --tracking-wide:  0.18em;
  --tracking-mega:  -0.045em;

  /* ── Space ─────────────────────────────────────────────────────────── */
  --s-1: 0.25rem;
  --s-2: 0.5rem;
  --s-3: 0.75rem;
  --s-4: 1rem;
  --s-5: 1.5rem;
  --s-6: 2rem;
  --s-7: 3rem;
  --s-8: 4rem;
  --s-9: 6rem;
  --s-10: 8rem;
  --s-11: clamp(6rem, 10vw, 12rem);

  /* Page geometry */
  --gutter:    clamp(1.25rem, 4vw, 2.5rem);
  --col-max:   86rem;     /* 1376px outer */
  /* The widest a full-bleed photo band's content may get. Those bands are meant
     to run to the page edge, and on a 1440 screen they should — but on a 3008px
     ultrawide the same rule threw the text and the photo to opposite ends of the
     desk. Above this the band centres its content instead; below it, nothing
     changes and the bleed is preserved. Wider than --col-max on purpose: these
     are photography bands, not prose. */
  --band-max:  112rem;    /* 1792px */
  --col-text:  44rem;     /* prose comfort */

  /* ── Motion ────────────────────────────────────────────────────────── */
  --ease-out-expo:    cubic-bezier(0.16, 1, 0.3, 1);
  --ease-out-quint:   cubic-bezier(0.22, 1, 0.36, 1);
  --ease-in-out-cubic: cubic-bezier(0.65, 0, 0.35, 1);
  --d-fast: 200ms;
  --d-base: 400ms;
  --d-slow: 700ms;
  --d-cinema: 1200ms;

  /* ── Radii / shadows ───────────────────────────────────────────────── */
  --r-sm: 4px;
  --r-md: 8px;
  --r-lg: 16px;
  --r-pill: 999px;

  /* Soft, warm shadows tinted with brand ink */
  --shadow-1: 0 1px 2px rgb(from var(--c-ink) r g b / 0.06),
              0 4px 16px rgb(from var(--c-ink) r g b / 0.06);
  --shadow-2: 0 2px 4px rgb(from var(--c-ink) r g b / 0.05),
              0 12px 36px rgb(from var(--c-ink) r g b / 0.10);
  --shadow-deep: 0 24px 80px rgb(from var(--c-azul-deep) r g b / 0.35);
}

/* On dark sections the brand-blue accent disappears against the dark-blue
   background — locally override the accent token to a warm cream so all
   `var(--c-saffron)` references read with proper contrast. */
.scroll-hero,
.visit-cta,
.footer,
/* Home: .home-music turned navy and .testimony turned cream in the 2026-08-05
   rebuild, so they swapped places in this list. .signatures and .events-teaser
   no longer exist on the page. If you change a section's background, change
   its membership here in the same edit. */
.home-music,
/* Weddings, rebuilt to Ashton's mock 2026-08-07 — the navy hero and the
   "turns to dancing" band. Both are dark, so both belong here. */
.w-hero,
.w-band--ink,
.r-music,
.section--ink,
.section--night,
.page-hero,
.pkg--feature,
.four-oh,
/* --c-navy, and it already flipped --c-saffron inline, but it was never added
   here — so --c-azul and --c-clay-text still resolved to their on-cream values
   inside it. Added 2026-08-10 when darkening the terracotta eyebrow dropped it
   to 3.09:1.
   .lm-day was alongside it until 2026-08-13, when Ashton asked for that band in
   soft blue. It is a light section now, so it belongs out of this list — left
   in, every accent inside it would resolve to cream on #D9E4EC. */
.about-final,
.ev-includes {
  --c-saffron: var(--c-cream);   /* warm cream accent on dark — 12.1:1 on navy-2 */
  --c-on-saffron: var(--c-ink);  /* ...so what sits on it flips back to ink */
  /* The client navy (--c-azul) is unreadable on dark backgrounds — flip any
     blue-coloured text to cream here too. */
  --c-azul: var(--c-cream);
  /* Marina blue is 2.9:1 on navy-2 and 3.9:1 on navy — the focus ring failed
     1.4.11 on every dark section, the short footer worst. Cream is 12.1:1. */
  --focus-ring: var(--c-cream);
  /* The darkening that rescues terracotta text on cream inverts on dark: the
     burnt --c-clay-text is 3.09:1 on navy where the lighter --c-clay is 6.18:1.
     So the accessible terracotta on a dark section is the ORIGINAL one. */
  --c-clay-text: var(--c-clay);
}

/* Display italics overlaid on dark sections: cream text carrying a
   marina-blue highlight, so the accent stays blue without costing contrast. */
:is(.visit-cta, .home-music, .r-music,
    .section--ink, .section--night,
    .pkg--feature) :is(h1, h2) em {
  color: var(--c-cream);
  background: color-mix(in oklch, var(--c-marina) 42%, transparent);
  padding-inline: 0.14em;
  border-radius: 3px;
  -webkit-box-decoration-break: clone;
  box-decoration-break: clone;
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}
