/* ==========================================================================
   ADUANA VIRTUAL — Design tokens
   Single source of truth. Every component reads from these variables.
   See design-system/MASTER.md for usage rules.
   ========================================================================== */

:root {
  /* ---- Color primitives ------------------------------------------------ */
  --c-ink-900: #0a0b0d;   /* near-black, cinematic sections            */
  --c-ink-800: #121418;
  --c-ink-700: #1c1f25;
  --c-ink-600: #2a2e36;
  --c-ink-400: #6b707b;
  --c-ink-300: #9a9ea8;   /* muted text on ink (7.1:1 on ink-900)      */
  --c-paper-50:  #fbfaf7;
  --c-paper-100: #f3f1ec; /* warm editorial paper                        */
  --c-paper-200: #e8e5de;
  --c-paper-300: #d6d2c8;
  --c-stone-600: #55585f; /* muted text on paper (6.3:1 on paper-100)  */
  --c-navy-900: #08142e;
  --c-navy-800: #0c1d44;  /* "aduana" navy — authority                  */
  --c-navy-600: #17357a;
  /* Brand blue, sampled from the original Aduana Virtual logo (AV symbol). */
  --c-brand-500: #4a6af2; /* logo blue: the single accent; fills, lines (white text on it 4.5:1) */
  --c-brand-600: #3452d8; /* accent as TEXT on light surfaces (5.6:1 on paper, 6.3:1 on white) */
  --c-brand-300: #8aa1f8; /* accent as TEXT on ink / navy (8.0:1 / 6.7:1)                       */
  --c-white: #ffffff;

  /* ---- Typography ------------------------------------------------------ */
  --f-sans: "Inter Tight", "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --f-serif: "Instrument Serif", "Iowan Old Style", "Times New Roman", serif;
  --f-mono: "JetBrains Mono", ui-monospace, "SFMono-Regular", Consolas, monospace;

  /* Fluid type scale (min @ 360px → max @ 1600px) */
  --t-mega: clamp(3.1rem, 1.2rem + 9.6vw, 12.5rem);
  --t-xxl:  clamp(2.6rem, 1.4rem + 5.6vw, 8rem);
  --t-xl:   clamp(2.1rem, 1.3rem + 3.6vw, 5rem);
  --t-l:    clamp(1.6rem, 1.15rem + 1.9vw, 2.9rem);
  --t-m:    clamp(1.25rem, 1.1rem + .6vw, 1.6rem);
  --t-body-l: clamp(1.075rem, 1rem + .3vw, 1.25rem);
  --t-body: 1.0625rem;
  --t-s: .9375rem;
  --t-xs: .8125rem;       /* mono labels; never below 12px              */

  --lh-tight: .92;
  --lh-head: 1.02;
  --lh-snug: 1.25;
  --lh-body: 1.6;
  --tr-tight: -.045em;
  --tr-head: -.03em;
  --tr-label: .14em;

  /* ---- Space (8pt rhythm, generous) ------------------------------------ */
  --s-1: 4px;  --s-2: 8px;  --s-3: 12px; --s-4: 16px; --s-5: 24px;
  --s-6: 32px; --s-7: 48px; --s-8: 64px; --s-9: 96px; --s-10: 128px; --s-11: 192px;
  --sec-y: clamp(96px, 6vw + 64px, 192px);   /* vertical section padding */
  --gutter: clamp(16px, 4vw, 64px);          /* page side padding        */
  --col-gap: clamp(16px, 2vw, 32px);
  --max: 1520px;

  /* ---- Shape & depth --------------------------------------------------- */
  --r-0: 0;
  --r-1: 3px;     /* default: crisp, almost square                      */
  --r-2: 8px;     /* media, panels                                      */
  --r-pill: 999px;/* buttons & chips only                               */
  --line-w: 1px;
  --shadow-book: 0 40px 80px -30px rgba(0,0,0,.55), 0 18px 30px -18px rgba(0,0,0,.45);
  --shadow-float: 0 20px 60px -20px rgba(10,11,13,.35);

  /* ---- Motion ---------------------------------------------------------- */
  --ease-out: cubic-bezier(.16, 1, .3, 1);     /* expo-out: arrivals     */
  --ease-in-out: cubic-bezier(.65, 0, .35, 1); /* transitions            */
  --ease-snap: cubic-bezier(.3, 1.4, .5, 1);   /* micro feedback         */
  --d-1: 160ms;  /* hover / press   */
  --d-2: 320ms;  /* UI state        */
  --d-3: 700ms;  /* reveals         */
  --d-4: 1200ms; /* cinematic       */

  /* ---- Z layers -------------------------------------------------------- */
  --z-header: 50; --z-float: 60; --z-menu: 70; --z-dialog: 80; --z-curtain: 90;

  /* ---- Semantic defaults (paper context) ------------------------------- */
  --bg: var(--c-paper-100);
  --fg: var(--c-ink-900);
  --muted: var(--c-stone-600);
  --line: rgba(10, 11, 13, .14);
  --line-strong: rgba(10, 11, 13, .32);
  --accent: var(--c-brand-500);
  --accent-text: var(--c-brand-600);
  --focus: var(--c-brand-600);
  --surface: var(--c-paper-50);
}

/* Section contexts: a section sets its context, children inherit tokens. */
.ctx-ink {
  --bg: var(--c-ink-900);
  --fg: var(--c-paper-100);
  --muted: var(--c-ink-300);
  --line: rgba(243, 241, 236, .13);
  --line-strong: rgba(243, 241, 236, .34);
  --accent-text: var(--c-brand-300);
  --focus: var(--c-brand-300);
  --surface: var(--c-ink-800);
}
.ctx-navy {
  --bg: var(--c-navy-800);
  --fg: var(--c-paper-100);
  --muted: #a9b4cf;
  --line: rgba(243, 241, 236, .16);
  --line-strong: rgba(243, 241, 236, .4);
  --accent-text: var(--c-brand-300);
  --focus: var(--c-brand-300);
  --surface: var(--c-navy-900);
}
.ctx-paper {
  --bg: var(--c-paper-100);
  --fg: var(--c-ink-900);
  --muted: var(--c-stone-600);
  --line: rgba(10, 11, 13, .14);
  --line-strong: rgba(10, 11, 13, .32);
  --accent-text: var(--c-brand-600);
  --focus: var(--c-brand-600);
  --surface: var(--c-paper-50);
}
.ctx-white {
  --bg: var(--c-white);
  --fg: var(--c-ink-900);
  --muted: var(--c-stone-600);
  --line: rgba(10, 11, 13, .12);
  --line-strong: rgba(10, 11, 13, .3);
  --accent-text: var(--c-brand-600);
  --focus: var(--c-brand-600);
  --surface: var(--c-paper-100);
}
