/* ===========================================================================
 * Dijiwa Design System — Global Stylesheet
 * ---------------------------------------------------------------------------
 * Applies tokens everywhere. Bridges tokens.css / motion.css / dye-palette.css
 * to the Tailwind utility classes already in use across the dashboard.
 *
 * Imported once on every dashboard HTML page (after tokens, motion, dye).
 * Out of scope: frontend/login.html (cinematic dark login, separate surface).
 * =========================================================================== */

/* ---- 2.1 Body baseline -------------------------------------------------- */
body {
  font-family: var(--font-body);
  background: var(--warm);
  color: var(--dark);
  font-size: var(--body-size);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ---- 3.x Type scale — apply display role to every heading ---------------- */
h1, h2, h3, h4 {
  font-family: var(--font-display);
  color: var(--dark);
  margin: 0;
}

h1 { font-size: var(--h1-size); font-weight: var(--h1-weight); letter-spacing: var(--h1-track); }
h2 { font-size: var(--h2-size); font-weight: var(--h2-weight); letter-spacing: var(--h2-track); }
h3 { font-size: var(--h3-size); font-weight: var(--h3-weight); letter-spacing: var(--h3-track); }
h4 { font-size: var(--h4-size); font-weight: var(--h4-weight); letter-spacing: var(--h4-track); }

/* ---- 3.1 Fraunces serif helper (replaces the audit's silent-serif gap) ----
 * The audit caught `.serif { font-family: Helvetica Neue ... }` declared in
 * weekly-report.html:20 — that silently used the body face where a serif was
 * intended. Now points to Fraunces.
 * ------------------------------------------------------------------------ */
.serif {
  font-family: var(--font-display);
  font-optical-sizing: auto;
}

/* ===========================================================================
 * Brand Tailwind utility re-bindings
 *
 * The dashboard ships with Tailwind classes that hardcoded the prior
 * warm-gold chrome palette. These re-bindings flip them to the cool-pigment
 * tokens. No warm-gold hex is introduced here.
 * =========================================================================== */
.bg-brand         { background-color: var(--brand); }
.bg-brand-text    { background-color: var(--brand-text); }
.bg-warm          { background-color: var(--warm); }
.bg-dark          { background-color: var(--dark); }
.bg-surface-light { background-color: var(--surface-light); }
.bg-surface-dark  { background-color: var(--surface-dark); }
.bg-tint          { background-color: var(--tint); }
.bg-dijiwa-border { background-color: var(--dijiwa-border); }
.bg-lokalua-border{ background-color: var(--lokalua-border); }

.text-brand       { color: var(--brand); }
.text-brand-text  { color: var(--brand-text); }
.text-warm        { color: var(--warm); }
.text-dark        { color: var(--dark); }
.text-tint        { color: var(--tint); }
.text-dijiwa-border{ color: var(--dijiwa-border); }
.text-lokalua-border{ color: var(--lokalua-border); }

.border-brand     { border-color: var(--brand); }
.border-warm      { border-color: var(--warm); }
.border-dark      { border-color: var(--dark); }
.border-tint      { border-color: var(--tint); }
.border-dijiwa    { border-color: var(--dijiwa-border); }
.border-lokalua   { border-color: var(--lokalua-border); }

/* ===========================================================================
 * Type scale classes (3.2) — apply the project-locked scale to common HTML
 * =========================================================================== */
.eyebrow {
  font-size: var(--eyebrow-size);
  font-weight: var(--eyebrow-weight);
  letter-spacing: var(--eyebrow-track);
  text-transform: uppercase;
  color: var(--brand);
  font-family: var(--font-body);
}
/* LABEL > device — the style-extraction reference's signature suffix. */
.eyebrow::after {
  content: ' >';
  opacity: 0.6;
}

.caption {
  font-size: var(--caption-size);
  font-weight: var(--caption-weight);
  color: var(--dark);
}

.small {
  font-size: var(--small-size);
  font-weight: var(--small-weight);
  color: var(--dark);
}

.num-hero {
  font-size: var(--num-hero-size);
  font-weight: var(--num-hero-weight);
  letter-spacing: var(--num-hero-track);
  color: var(--dark);
  /* proportional numerals — never tabular on the hero number */
  font-variant-numeric: proportional-nums;
  font-family: var(--font-display);
  font-optical-sizing: auto;
}

/* Tabular numerals helper — column-aligned numbers in tables / axis ticks /
 * stacked-bar segment labels. */
.tabular-nums { font-variant-numeric: tabular-nums; }

/* ===========================================================================
 * 5.3 Signature element — Carve-Lintel Booking Curve
 *
 * The single memorable moment of the dashboard. Tapered cyan-green stroke +
 * cyan-green wash + (hero only) 1px dashed filigree.
 * =========================================================================== */
.lintel-curve {
  fill: none;
  stroke: var(--brand);
  stroke-linecap: round;
}

.lintel-curve-path {
  fill: var(--brand);
  fill-opacity: 0.10;
  stroke: none;
}

.lintel-curve-filigree {
  stroke: var(--brand);
  stroke-opacity: 0.35;
  stroke-dasharray: 2 4;
  fill: none;
}

/* ---- Focus visibility (WCAG 2.4.7) --------------------------------------
 * Exactly one of ~220 buttons had a focus style before this. Keyboard users
 * got the UA default ring or nothing. :focus-visible (not :focus) so a mouse
 * click does not paint a ring, only keyboard/AT navigation does.
 * --------------------------------------------------------------------- */
:where(a, button, input, select, textarea, summary, [tabindex]):focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: 2px;
  border-radius: 2px;
}
/* Dark surfaces (sidebar, nav) need the light tint to stay visible. */
:where(.bg-dark, aside, nav) :where(a, button, [tabindex]):focus-visible {
  outline-color: var(--tint);
}
