/* Identia demo — design tokens.
   Rebranded 2026-10-12 from the 1datapipe dark theme to the Identia brand
   guideline (black / white / soft grey / warm gradient) — see PRD.md §13 R15.
   Contrast ratios in comments are measured against --paper #FFFFFF unless
   stated otherwise. See UX-DESIGN-SPEC.md §2 for the full audit. */

/* Single static weight (450). font-weight is declared as a 400-700 range so
   the browser doesn't synthesise faux-bold on 600/700 headings and buttons —
   they render at 450, which is the honest result of having one weight file. */
@font-face {
  font-family: 'Saans';
  src: url('../assets/fonts/Saans/Web%20package%20(WOFF,%20WOFF2)/WOFF2/Saans-w450s0m0.woff2') format('woff2'),
       url('../assets/fonts/Saans/Web%20package%20(WOFF,%20WOFF2)/WOFF/Saans-w450s0m0.woff') format('woff');
  font-weight: 400 700;
  font-style: normal;
  font-display: swap;
}

:root {
  /* Ground — Identia brand guideline */
  --paper: #FFFFFF;
  --mist: #E8DDE0;                  /* the brand's "soft grey" — doubles as the old --surface and --surface-alt */
  --ink: #000000;
  --hairline: #E8DDE0;              /* decorative only — 1.32:1, never an interactive edge */

  /* Text */
  --text: #000000;                  /* 21.00:1 on --paper */
  --text-secondary: #000000;        /* same as --text — the brand gives one dark neutral, not two */
  --text-muted: #3F3836;            /* derived, warm-neutral; brand defines no muted tone. 11.47:1 on --paper, 7.22:1 on --warm-mid, 4.82:1 on --warm-start (was #5C5452, which fell to 3.10:1 on the saturated orange) */
  --text-on-ink: #FFFFFF;           /* 21.00:1 on --ink */

  /* Structural "accent" — the old brand blue's role, with no hue to replace it */
  --ink-soft: rgba(0, 0, 0, 0.08);
  --ink-hover: #262626;

  /* Warm gradient — emphasis only (hero glow, New badge, capability-card art).
     Rewritten 2026-10-12: widened from a pale cream/gold pair to a genuinely
     saturated dark-orange-to-pale range, measured off real brand artwork
     (sampled ~#EB993F at the vivid end, ~#E6E7EF at the faded end) rather
     than estimated. Still never for body text or small fills — black text
     clears 9.16:1 on the vivid end, so the rule from before still holds. */
  --warm-start: #E8954A;
  --warm-mid: #F3C772;
  --warm-end: #FBF4EC;
  --warm-gradient: linear-gradient(135deg, var(--warm-start), var(--warm-mid), var(--warm-end));

  /* Score tiers — one fill for all three; see UX-DESIGN-SPEC.md §2.3 for why */
  --tier-fill: var(--ink);

  /* Match results gauge and bars (2026-10-22): were solid --ink, now the brand orange
     deepening toward the end. The end colour is the same hue darkened: 3.23:1 against
     the --mist track, 4.28:1 on white. The start is --warm-start (1.80:1 on the
     track), so the value never relies on the arc alone: the numeral, the tier word
     and the length of the arc or bar all say it too. */
  --match-from: var(--warm-start);
  --match-to: #C25E14;
  --track-soft: rgba(232, 221, 224, 0.85);       /* empty part of the gauge and bars: --mist, see-through so the page colour shows */
  --scan-line: rgba(232, 149, 74, 0.85);          /* leading edge of the Profile search sweep: --warm-start */
  --scan-glow: rgba(243, 199, 114, 0.35);         /* the trail behind it: --warm-mid */
  --shine: rgba(255, 255, 255, 0.55);            /* the light sweep across a filled bar */

  /* Developer Mode code panel — Identia light theme (rebranded 2026-10-20; it was
     the old dark navy). The panel is the same pale glass as the other cards. Colours
     for the JSON tokens are chosen to clear 4.5:1 on the worst-case panel surface
     (#F6EFEC, i.e. the glass over the darkest part of the page gradient):
     the brand orange #E8954A is only 2.38:1 on white, so strings use it darkened
     to the same hue (#A35815, 4.66:1 on that surface, 5.30:1 on white). */
  --code-bg: var(--glass-panel);     /* 75% white, so the page gradient shows through; see --code-string for why it can't go lower */
  --code-border: var(--border-interactive);
  --code-text: #000000;             /* 18.48:1 */
  --code-muted: #4A4240;            /* urls, punctuation: 8.62:1 */
  --code-string: #7F4510;           /* brand orange darkened to the same hue: 4.67:1 over the darkest part of the page at 75% panel opacity, 7.6:1 on pale areas. Was #A35815 at 92% opacity. Lower opacity needs a darker brown here */
  --code-number: #000000;           /* numbers and booleans read as plain ink; type, not hue, tells them apart */
  --code-head-bg: rgba(232, 221, 224, 0.55);   /* header strip: --mist at 55%, so it is see-through like the body */

  /* Interactive boundaries — WCAG 1.4.11 needs >= 3:1 */
  --border-interactive: #767676;    /*  4.54:1 on --paper, 3.43:1 on --mist */
  --focus-ring: #000000;

  /* Translucent surfaces. Named so the glass cards, the header bar, the hover
     and selected card states and the dark overlays each change in one place.
     Values are the brand white / ink at a fixed opacity, not new colours. */
  --glass:          rgba(255, 255, 255, 0.62);   /* cards sitting on the page gradients */
  --glass-strong:   rgba(255, 255, 255, 0.85);   /* hovered card, step labels, chip panels */
  --header-fade:    4px;                         /* how far the header's bottom edge feathers out */
  --glass-header:   rgba(255, 255, 255, 0.45);   /* sticky header: lets the page gradient show through. Header text measured >= 6.8:1 down to 40% */
  --glass-solid:    rgba(255, 255, 255, 0.92);   /* selected card, drawer */
  --glass-panel:    rgba(255, 255, 255, 0.75);   /* Developer Mode code panel */  --glass-border:   rgba(0, 0, 0, 0.08);
  --scrim:          rgba(0, 0, 0, 0.72);         /* modal backdrop */
  --scrim-strong:   rgba(0, 0, 0, 0.88);         /* loading overlay */
  --pulse-from:     rgba(0, 0, 0, 0.7);
  --pulse-to:       rgba(0, 0, 0, 0);
  --sil:            rgba(0, 0, 0, 0.8);             /* person silhouette on the identity cards */
  --flash:          rgba(232, 149, 74, 0.28);    /* code-line change flash (brand orange wash, visible on the pale panel) */

  /* Text on the dark loading overlay (opacity, not new greys) */
  --on-dark:        #FFFFFF;
  --on-dark-strong: rgba(255, 255, 255, 0.75);
  --on-dark-muted:  rgba(255, 255, 255, 0.65);
  --on-dark-faint:  rgba(255, 255, 255, 0.6);
  --on-dark-line:   rgba(255, 255, 255, 0.35);

  /* Card hover / selected glow: white halo plus the brand gold */
  --glow-white-1:   rgba(255, 255, 255, 0.95);
  --glow-white-2:   rgba(255, 255, 255, 0.75);
  --glow-white-3:   rgba(255, 255, 255, 0.8);
  --glow-gold-1:    rgba(243, 199, 114, 0.7);    /* --warm-mid */
  --glow-gold-2:    rgba(243, 199, 114, 0.75);   /* --warm-mid */
  --glow-hover:     0 0 0 3px var(--glow-white-1), 0 0 24px 6px var(--glow-white-2), 0 0 36px 10px var(--glow-gold-1);   /* every clickable card: product, country, identity */
  --new-wash:       linear-gradient(135deg, rgba(232, 149, 74, .25), rgba(251, 244, 236, .35));

  /* Type — Saans (Displaay Type Foundry), self-hosted from assets/fonts/Saans/,
     for both UI and what used to be the monospace role. Approved as the brand
     typeface, web licence confirmed 2026-10-20. It ships a single static
     weight (450), declared as a 400-700 range in @font-face above so the
     browser does not fake a bold; hierarchy therefore comes from size, case
     and spacing, not weight. */
  --font-ui: 'Saans', -apple-system, 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  --font-mono: 'Saans', -apple-system, 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;

  /* Shape */
  --radius-sm: 4px;
  --radius-md: 6px;
  --radius-lg: 8px;

  --shadow-card: 0 2px 10px rgba(0, 0, 0, 0.3);
  --shadow-float: 0 8px 32px rgba(0, 0, 0, 0.45);

  /* Motion */
  --dur-fast: 120ms;
  --dur-base: 240ms;
  --dur-slow: 420ms;
  --dur-reveal: 640ms;
  --dur-fade: 1100ms;               /* result-page buttons fading in */
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-inout: cubic-bezier(0.65, 0, 0.35, 1);

  /* Space — 4px scale */
  --s1: 4px;  --s2: 8px;  --s3: 12px; --s4: 16px;
  --s5: 24px; --s6: 32px; --s7: 48px; --s8: 64px;
}

@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;
  }
}
