/* ==========================================================================
   DESIGN TOKENS
   The single source of truth for colour, type, space, motion and depth.
   Nothing below this file should hard-code a colour or a duration.
   ========================================================================== */

:root {
  /* --- Colour ------------------------------------------------------------
     A warm, quiet palette: stone, sand, ivory, dark wood, muted bronze.
     Most of the site lives on --c-bg with --c-ink text. The bronze accent is
     deliberately rationed — it appears on rules, active states and numerals,
     never on large fills. */
  --c-bg:            #F5F2EC;  /* ivory / warm paper */
  --c-ink:           #171715;  /* primary dark */
  --c-ink-2:         #292823;  /* secondary dark */
  --c-sand:          #DED8CC;  /* warm neutral */
  --c-line:          #D5D0C6;  /* hairline border */
  /* Bronze, darkened from the brief's #9A8060 so that small uppercase labels
     set in it clear 4.5:1 on paper. The hue is unchanged; only the value moved.
     --c-bronze-light keeps the original tone for rules and marks, where it
     carries no text and contrast rules do not apply. */
  --c-bronze:        #7A664C;  /* 4.90:1 on --c-bg */
  --c-bronze-light:  #9A8060;
  --c-white:         #FFFFFF;

  /* Derived, semantic. Use these in components. */
  --c-surface:       var(--c-bg);
  --c-surface-raised:var(--c-white);
  --c-surface-sunk:  #EFEBE3;
  --c-surface-dark:  var(--c-ink);
  --c-text:          var(--c-ink);
  /* These three are measured, not eyeballed. Each clears WCAG AA (4.5:1) on
     both --c-bg and the slightly darker --c-surface-sunk, while staying far
     enough apart to still read as three levels of emphasis.
     Verify with `node tools/contrast.mjs` after any change here. */
  --c-text-muted:    #54514A;  /* 7.08:1 on --c-bg */
  --c-text-faint:    #6A6760;  /* 4.99:1 on --c-bg, 4.69:1 on sunk */
  --c-text-invert:   #F0EDE6;
  --c-text-invert-muted: rgba(240, 237, 230, 0.62);
  --c-border:        var(--c-line);
  --c-border-soft:   rgba(23, 23, 21, 0.09);
  --c-border-invert: rgba(240, 237, 230, 0.20);
  --c-accent:        var(--c-bronze);
  --c-accent-mark:   var(--c-bronze-light);  /* decorative only, never text */
  --c-accent-soft:   rgba(154, 128, 96, 0.12);

  /* Status. Muted on purpose — no alert-red, no SaaS green. */
  --c-ok:            #4F6B4A;
  --c-pending:       #7A664C;
  --c-fail:          #8C4A3F;
  --c-ok-bg:         rgba(79, 107, 74, 0.10);
  --c-pending-bg:    rgba(154, 128, 96, 0.12);
  --c-fail-bg:       rgba(140, 74, 63, 0.10);

  /* --- Type -------------------------------------------------------------- */
  --font-display: 'Cormorant Garamond', 'Iowan Old Style', 'Palatino Linotype',
                  Georgia, 'Times New Roman', serif;
  --font-sans:    'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI',
                  Helvetica, Arial, sans-serif;

  /* Fluid display sizes. Editorial scale — large jumps, few steps. */
  --t-display-xl: clamp(2.85rem, 8.2vw, 7.5rem);
  --t-display-l:  clamp(2.4rem, 5.6vw, 4.75rem);
  --t-display-m:  clamp(2rem, 3.9vw, 3.25rem);
  --t-display-s:  clamp(1.6rem, 2.6vw, 2.25rem);

  --t-body-l:     clamp(1.0625rem, 1.25vw, 1.1875rem);
  --t-body:       1rem;
  --t-body-s:     0.9375rem;
  --t-caption:    0.8125rem;
  --t-label:      0.6875rem;   /* uppercase micro-label */

  --lh-display:   1.04;
  --lh-heading:   1.12;
  --lh-body:      1.72;

  --ls-display:  -0.022em;
  --ls-label:     0.20em;
  --ls-label-wide:0.28em;

  /* --- Space -------------------------------------------------------------
     A 4px-derived scale. --s-section is fluid so vertical rhythm expands with
     the viewport instead of stepping at breakpoints. */
  --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-section: clamp(5.5rem, 11vw, 11rem);
  --s-gutter:  clamp(1.25rem, 4.5vw, 4.5rem);

  --w-max:     1560px;   /* full bleed content cap */
  --w-text:    62ch;     /* comfortable measure */
  --w-narrow:  980px;

  /* --- Motion ------------------------------------------------------------
     Slow, natural easing. Nothing bounces. */
  --e-out:   cubic-bezier(0.22, 0.61, 0.36, 1);
  --e-inout: cubic-bezier(0.65, 0.05, 0.36, 1);
  --e-settle: cubic-bezier(0.16, 1, 0.3, 1);   /* long, critically damped arrival: no overshoot */
  --d-fast:  240ms;
  --d-base:  420ms;
  --d-slow:  680ms;
  --d-image: 900ms;

  /* --- Depth --------------------------------------------------------------
     Shadows are almost absent by design. Hierarchy comes from hairlines. */
  --shadow-soft:  0 1px 2px rgba(23, 23, 21, 0.04),
                  0 8px 28px rgba(23, 23, 21, 0.06);
  --shadow-lift:  0 2px 6px rgba(23, 23, 21, 0.06),
                  0 24px 60px rgba(23, 23, 21, 0.12);

  --radius: 2px;         /* almost square. Nothing here is a pill. */
  --radius-media: 0px;

  --nav-h: 76px;
}

@media (max-width: 860px) {
  :root { --nav-h: 64px; }
}

/* The demo strip (chrome.js → demoBar) sits above the fixed header. While it
   is on the page, --nav-h grows by its height, so every rule that clears the
   header — hero padding, sticky rails, scroll-padding — clears both without
   knowing the strip exists. The header itself subtracts it back out. */
:root { --demo-h: 0px; }
:root:has(.demo-bar) { --demo-h: 30px; --nav-h: calc(76px + var(--demo-h)); }
@media (max-width: 860px) {
  :root:has(.demo-bar) { --nav-h: calc(64px + var(--demo-h)); }
}

/* ==========================================================================
   ROYAL LAYER
   The register the site steps up into for the house's own pages — about,
   dining, experiences, events, and the whole signed-in guest area.

   It is drawn from the building rather than from heraldry. A Dar es Salaam
   coral-stone house wears Swahili-coast colour: indigo from the dye trade,
   malachite from a carved door's recessed field, and brass from the bosses
   studded across it. No navy, no gilt crest, no European coat of arms —
   those belong to a different coastline.

   ── THE CONTRAST RULE ────────────────────────────────────────────────────
   Measured, not eyeballed, exactly as the base palette is:

     brass  #B08D4F  → 4.89:1 on --c-indigo, but only 4.25:1 on --c-indigo-raised
     brass-bright     → 8.05:1 on indigo, 6.98:1 on raised — safe everywhere dark
     brass on ivory   → 2.78:1. FAILS.

   So: brass carries text only on the deep grounds, --c-brass-bright carries it
   on the raised ones, and on ivory the metallics are decoration only — the
   existing --c-bronze remains the accent that is allowed to be read.
   Re-run `node tools/contrast.mjs` after touching anything here.
   ───────────────────────────────────────────────────────────────────────── */

:root {
  --c-indigo:         #16263F;  /* the royal ground */
  --c-indigo-deep:    #0E1A2C;  /* footers, hero scrims, email headers */
  --c-indigo-raised:  #1E3050;  /* a panel lifted off the ground */
  --c-malachite:      #1C4034;  /* the carved door's recessed field */

  --c-brass:          #B08D4F;  /* the door boss */
  --c-brass-bright:   #D8B978;  /* brass catching light — text-safe on dark */
  --c-brass-deep:     #8A6B34;  /* decoration only. 4.44:1 on ivory — under AA. */

  --c-coral-wash:     #EDE4D2;  /* lime-washed coral rag, warmer than the ivory */

  /* Semantic, for use on royal grounds. */
  --c-on-royal:       #F2EEE4;  /* 13.10:1 on indigo */
  --c-on-royal-muted: #B9C2CE;  /* 8.44:1 on indigo */
  --c-royal-line:     rgba(176, 141, 79, 0.28);
  --c-royal-line-soft:rgba(242, 238, 228, 0.14);

  /* Brass does not sit flat. A metal reads as metal because it has a light
     source: a bright band across the middle and darker at both ends. */
  --grad-brass: linear-gradient(
    100deg,
    var(--c-brass-deep) 0%,
    var(--c-brass) 22%,
    var(--c-brass-bright) 48%,
    var(--c-brass) 68%,
    var(--c-brass-deep) 100%
  );

  /* Depth on a dark ground cannot come from a grey shadow — it comes from a
     lit top edge and shadow beneath, the way a raised panel actually behaves. */
  --shadow-royal:
    inset 0 1px 0 rgba(242, 238, 228, 0.07),
    0 2px 8px rgba(6, 12, 22, 0.34),
    0 26px 64px rgba(6, 12, 22, 0.42);

  --s-boss: 34px;   /* the ornament's optical size */
}
