/* ============================================================
   Charles Real Estate (CRE) — Design Tokens
   Token architecture: PRIMITIVES (raw brand values) feed
   SEMANTICS (role names). Components reference semantics only;
   re-skin the whole system by swapping primitive values.
   CRE = property-facing brand of the family (house of brands):
   shared skeleton, CRE's own emerald+gold editorial skin.
   Derived from the approved "Blend" concept. Locked 2026-07-19.
   ============================================================ */
:root {
  /* ---- PRIMITIVES · Emerald (green) ramp — 700 is the anchor ---- */
  --cre-forest-950:#04160E;
  --cre-forest-900:#072B1C;   /* deepest surface (from Blend --forest) */
  --cre-emerald-800:#0A4230;
  --cre-emerald-700:#0C5B3E;  /* ANCHOR (Blend --emerald) */
  --cre-emerald-600:#146A4A;
  --cre-emerald-500:#1E8159;
  --cre-green-400:#37B26B;    /* bright accent — upside, positives only */
  --cre-green-web:#319E5F;    /* web: large upside figures on light — 3.0:1 on cream. Added 2026-11-11 */
  --cre-green-300:#6FC993;
  --cre-green-200:#A9DEC0;
  --cre-green-100:#DAF0E3;
  --cre-green-50 :#EFF8F2;

  /* ---- PRIMITIVES · Gold accent ---- */
  --cre-gold     :#C09A3C;    /* editorial gold — hairlines, issue №, key figures */
  --cre-gold-lt  :#E3CC86;    /* gold on dark surfaces */
  --cre-gold-deep:#9A7A2C;    /* gold on light where more contrast needed */
  --cre-gold-web :#A98735;    /* web: large gold text (24px+, or 19px+ bold) — 3.0:1 on cream, 3.2:1 on paper. Added 2026-11-11 */
  --cre-gold-text:#856A22;    /* web: small gold text — 4.6:1 on cream, 4.9:1 on paper. Added 2026-11-11 */

  /* ---- PRIMITIVES · Warm paper neutrals ---- */
  --cre-paper   :#FCFAF4;     /* primary page — warm white */
  --cre-cream   :#F5F1E8;     /* secondary surface / photo mat */
  --cre-sand    :#E7E4DC;     /* divider pages in print; app/gallery backdrop on screen. Never data pages. */
  --cre-stone   :#8A8676;     /* muted labels, secondary text */
  --cre-stone-text:#6E6A5C;   /* web: small muted text — 4.8:1 on cream, 5.2:1 on paper. Added 2026-11-11 */
  --cre-ink     :#152019;     /* warm near-black, green undertone */
  --cre-white   :#FFFFFF;

  /* ---- SEMANTICS · use these in components ---- */
  --fg          :var(--cre-ink);         /* body text */
  --fg-strong   :var(--cre-emerald-700); /* headings on light */
  --fg-muted    :var(--cre-stone);       /* secondary text */
  --fg-on-dark  :var(--cre-cream);       /* text on emerald surfaces */
  --fg-accent   :var(--cre-gold);        /* accent text/figures on light */
  --fg-accent-dk:var(--cre-gold-lt);     /* accent text on dark */
  --fg-data     :var(--cre-green-400);   /* upside / positive figures only */

  /* ---- SEMANTICS · Web text on light (WCAG 2.1 AA), added 2026-11-11 ----
     Print keeps the brand values above. On screen, text on paper/cream uses these,
     each passing on cream (the darker light surface): normal text 4.5:1,
     large text (24px+, or 19px+ bold) 3:1. Brand gold stays for hairlines and borders.
     Guide: cre-web-style-guide.html. */
  --fg-accent-web  :var(--cre-gold-web);    /* large gold text: price, headline italics, big stats */
  --fg-accent-small:var(--cre-gold-text);   /* small gold text: kickers, issue № */
  --fg-muted-web   :var(--cre-stone-text);  /* small muted text: labels, captions, fine print */
  --fg-data-web    :var(--cre-green-web);   /* large upside figures */

  --bg-page     :var(--cre-paper);
  --bg-surface  :var(--cre-cream);
  --bg-backdrop :var(--cre-sand);
  --bg-dark     :var(--cre-emerald-700);
  --bg-darkest  :var(--cre-forest-900);

  --border      :rgba(21,32,25,.15);     /* faint ink rule */
  --border-accent:var(--cre-gold);       /* gold hairline — masthead, dividers */
  --rule-accent :var(--cre-gold);

  /* ---- SEMANTICS · Geometry ---- */
  --radius-tile :15%;   /* monogram / boxed-C corner radius — % of side (scale-safe), locked 2026-07-19 */

  /* ---- SEMANTICS · Spacing scale (4px base) — use instead of ad-hoc px ---- */
  --space-1 :4px;  --space-2 :8px;   --space-3 :12px; --space-4 :16px;
  --space-5 :24px; --space-6 :32px;  --space-8 :48px; --space-10:64px; --space-12:96px;

  /* ---- SEMANTICS · Buttons (web), added 2026-10-27 ----
     Primary (one per view: the main action) and secondary, each with an
     on-dark version for emerald/forest/weave. Label = Archivo 600 tracked caps;
     arrow = inline SVG 14×8, stroke 1.2. Near-square corners, editorial;
     no glow, gradient, or shadow. */
  --btn-radius     :2px;
  --btn-pad        :14px 28px;           /* with 13px label → 44px+ tap target */
  --btn-font       :600 13px/1 var(--font-text);
  --btn-track      :.16em;
  --btn-bg         :var(--cre-emerald-700);
  --btn-bg-hover   :var(--cre-emerald-600);
  --btn-fg         :var(--cre-cream);      /* 7.2:1 on emerald-700 */
  --btn2-fg        :var(--cre-emerald-700);
  --btn2-border    :var(--cre-gold);       /* 1.5px, echoes the gold hairline */
  --btn2-bg-hover  :var(--cre-cream);
  --btn2-border-hover:var(--cre-gold-deep);
  --btn-dk-bg      :var(--cre-paper);        /* on-dark primary: paper fill */
  --btn-dk-fg      :var(--cre-emerald-700);  /* 7.8:1 on paper */
  --btn-dk-bg-hover:var(--cre-cream);
  --btn2-dk-bg     :rgba(7,43,28,.6);        /* on-dark secondary: forest tint keeps the weave out of the label */
  --btn2-dk-fg     :var(--cre-cream);
  --btn2-dk-border :var(--cre-gold-lt);
  --btn2-dk-bg-hover:rgba(7,43,28,.85);
  --focus-ring     :0 0 0 2px var(--cre-paper), 0 0 0 4px var(--cre-gold-deep);    /* 3.9:1 on paper */
  --focus-ring-dk  :0 0 0 2px var(--cre-emerald-700), 0 0 0 4px var(--cre-gold-lt); /* 5.1:1 on emerald */

  /* ---- SEMANTICS · Emerald weave (signature texture), locked 2026-07-20 ----
     Use on emerald blocks, tabs, dividers, back cover, and photo-less fallbacks.
     NEVER behind a real photo or body copy. Angle locked at 115°.
     Stripe 46/14 (widened from 40/14 on 2026-10-05 to match the 33 brochure). */
  --weave-a:#0D5F40; --weave-b:#0A4A32;
  --weave  :repeating-linear-gradient(115deg, var(--weave-a) 0 46px, var(--weave-b) 46px 60px);

  /* ---- SEMANTICS · Type families ---- */
  --font-display:'Fraunces', Georgia, serif;      /* editorial voice — headlines, POV, stat numbers */
  --font-text   :'Archivo', system-ui, sans-serif;/* labels, brand marks, UI, tracked caps */
  --font-mono   :'Space Mono', ui-monospace, monospace; /* kickers, tags, data eyebrows */
}
