/* =====================================================================
   JJD design system — tokens from the JJD Portfolio Figma file
   (Main: 3127:12897 · Portfolio PDF version: 3194:15725)

   This file is the single source of truth for colour, type and shadow.
   styles.css refers to these tokens with its old values as fallbacks,
   so removing the <link> to this file restores the previous look exactly.
   Text on blue surfaces stays dark grey (#181818 family) by design choice, not white.
   ===================================================================== */

/* ---------- 1. Primitive tokens (named as in Figma) ---------- */
:root{
  /* Dynamic Black — neutral ramp */
  --db-100:#E9E9E9;
  --db-200:#D2D2D2;
  --db-300:#9E9E9E;   /* added: muted text on dark (6.6:1 on 700). Not yet in Figma */
  --db-400:#787878;   /* borders / decoration only: 4.0:1 on 700 is too faint for small text */
  --db-500:#4B4B4B;
  --db-600:#1E1E1E;
  --db-700:#181818;
  --white:#FFFFFF;

  /* N l Blue */
  --blue-400:#0098FE; /* added: accent text on dark (5.9:1 on 700). Blue/500 is 4.45:1, just under AA */
  --blue-500:#3378FE;
  --blue-600:#0056FE; /* brand blue */
  --blue-700:#0043C7; /* added: pressed state */

  /* Effects */
  --shadow-1:0 4px 33px rgba(124,133,137,.13); /* "Drop Shadow" */

  /* Type scale. Figma sizes are drawn on a 1920px canvas, so each size scales with the
     viewport (size ÷ 1920) and stops at the Figma value, with a readable floor on small screens. */
  --fs-display:clamp(44px,6.667vw,128px);   /* H1 128/100 (set in the site font, Inter Tight) */
  --fs-subtitle:clamp(32px,2.5vw,48px);     /* Subtitle 48/48 */
  --fs-h4:clamp(24px,1.5625vw,30px);        /* H4 30/48 */
  --fs-lead:clamp(18px,1.25vw,24px);        /* body 24/42 */
  --fs-body:clamp(16px,1.146vw,22px);       /* Body Copy 22/33 */
  --fs-small:14px;                          /* 14pt 14/24 */
  --fs-label:12px;                          /* LOCATION-style spaced caps */

  --lh-display:.95; --lh-subtitle:1.05; --lh-h4:1.3; --lh-lead:1.6; --lh-body:1.6; --lh-small:1.7;
  --ls-display:-.035em; --ls-subtitle:-.03em;

}

/* ---------- 2. Semantic tokens: dark (default) ---------- */
:root,:root:not([data-theme="light"]){
  --bg:var(--db-700);
  --ink:var(--db-100);
  --mute:var(--db-300);
  --line:color-mix(in srgb,var(--db-500) 55%,var(--db-700));
  --ph:var(--db-600);
  --stage:var(--db-600);
  --face:var(--db-100);
  --accent:var(--blue-400);
  --accent-press:var(--blue-600);
  --accent-surface:var(--blue-600);   /* blue panels, flip faces, buttons */
}
/* ---------- 3. Semantic tokens: light ---------- */
:root[data-theme="light"]{
  --bg:var(--db-100);
  --ink:var(--db-700);
  --mute:var(--db-500);
  --line:var(--db-200);
  --ph:var(--white);
  --stage:var(--white);
  --stage-sh:var(--shadow-1);
  --face:var(--db-200);
  --accent:var(--blue-600);
  --accent-press:var(--blue-700);
  --accent-surface:var(--blue-600);
  --tick:var(--db-200);
  --reg:var(--db-400);
}

/* ---------- 4. Type ---------- */
html body{font-size:var(--fs-body);line-height:var(--lh-body)}
:root{--fs-h1:var(--fs-display);--fs-h2d:var(--fs-subtitle);--fs-h2:var(--fs-h4);--fs-h3:var(--fs-lead)}
html body :is(.hero h1,.how h1,.ab-hero h1,.ct h1){letter-spacing:var(--ls-display);line-height:var(--lh-display)}
html body :is(.how h2,.cta h2,.lead h2,.q .qt){letter-spacing:var(--ls-subtitle);line-height:var(--lh-subtitle)}
html body :is(.txt h2,.gh,.ab2-l h2,.ct-grid h2){line-height:var(--lh-h4)}
html body :is(.txt p,.gi,.arch-tx p,.pp-d p){line-height:var(--lh-body)}

/* ---------- 5. Shadows: one token, light mode only (it reads as nothing on dark) ---------- */
:root[data-theme="light"] .cl-grid .cl{box-shadow:var(--shadow-1)}

/* ---------- 6. Case study header, as in the PDF ----------
   "Case study 01" label underlined in blue, "Client | Name", and blue field labels on a short blue rule. */
html body #side .cs-k{display:block;width:fit-content;margin:28px 0 18px;padding-bottom:8px;border-bottom:1px solid var(--accent);color:var(--accent);font-size:var(--fs-small);font-weight:500;letter-spacing:0}
html body #side .co{display:flex;align-items:baseline;gap:10px;flex-wrap:wrap}
html body #side .co .co-k{display:inline;color:var(--mute);font-weight:400}
html body #side .co .co-k::after{content:"";display:inline-block;width:1px;height:.95em;margin-left:10px;background:var(--accent);vertical-align:-.1em}
html body #side .lbl{display:inline-block;color:var(--accent);padding-bottom:6px;border-bottom:1px solid var(--accent);margin-bottom:8px}
