/* ==========================================================================
   Loka design tokens -- Tropical Premium
   --------------------------------------------------------------------------
   The same jungle, at a resort: deep emerald, champagne gold, ivory paper,
   a serif for headlines. One source of truth for colour, type, space, shape
   and motion, in two modes.

   How the colour works
   - Rules never name a colour. They name a ROLE: --bg, --surface, --text,
     --primary, --cta, --band. Every role is set twice, once for light and
     once for dark, so a rule written once is right in both.
   - <html data-theme="light|dark"> picks the mode. An inline script in the
     <head> sets it before first paint: the visitor's saved choice, else the
     operating system's preference. Without JavaScript the site is light.

   The roles
     bg / surface / surface-2 / surface-3   page, cards, soft sections, wells
     text / text-muted                      body copy, secondary copy
     primary / primary-hover / tint         links, focus, selection on a page
     cta / on-cta                           the one main button on a page
     band / on-band / band-accent           the deep sections: hero, visa
                                            band, closing banner, footer
     cta-band / on-cta-band                 the main button on a band (gold)
     solid / on-solid                       a filled pill or chip, white text
     accent-text                            gold, as text on a page
     logo / logo-band                       the mark, on a page and on a band
     glow-a / glow-b                        the two soft lights in a band

   One gold thing per screen: on a band, gold is the action. Selection on a
   band is ivory, never a second gold.

   Every text pair is measured in both modes by tests/theme-contrast.test.mjs.
   It fails `npm test` below 4.5:1 for text, 7:1 for body copy, and 3:1 for
   the focus ring.
   ========================================================================== */

:root {
  color-scheme: light;

  /* --- type -------------------------------------------------------------- */
  --font-display: "Fraunces", Georgia, "Times New Roman", serif;
  --font-body: "Instrument Sans", "Segoe UI", system-ui, sans-serif;
  --fw-display: 500;      /* Fraunces is variable 400-700 as loaded */
  --fw-display-strong: 560;

  --fs-xs: 0.75rem;
  --fs-sm: 0.875rem;
  --fs-base: 1rem;
  --fs-md: 1.125rem;
  --fs-lg: 1.375rem;
  --fs-xl: clamp(1.5rem, 2.2vw, 1.875rem);
  --fs-2xl: clamp(2rem, 3.6vw, 3rem);
  --fs-3xl: clamp(2.6rem, 5.4vw, 4.4rem);
  --lh-tight: 1.08;
  --lh-snug: 1.3;
  --lh-body: 1.6;
  --tracking-display: -0.015em;
  --tracking-label: 0.14em;

  /* --- space (4px grid) -------------------------------------------------- */
  --sp-1: 4px;  --sp-2: 8px;  --sp-3: 12px; --sp-4: 16px; --sp-5: 24px;
  --sp-6: 32px; --sp-7: 48px; --sp-8: 64px; --sp-9: 96px;
  --section-y: clamp(72px, 9vw, 120px);

  /* --- shape ------------------------------------------------------------- */
  --r-sm: 10px;
  --r-md: 14px;
  --r-lg: 20px;
  --r-pill: 999px;

  /* --- components: one size and shape for every control ------------------
     Buttons, fields and segmented controls share a height and a corner, so
     a row of them lines up without anyone measuring.                       */
  --r-control: 12px;
  --h-control: 48px;
  --h-control-lg: 60px;
  --h-control-sm: 38px;
  --ring: 0 0 0 4px color-mix(in srgb, var(--focus) 24%, transparent);
  --press: scale(0.98);

  /* --- motion: quick out, gentle settle ---------------------------------- */
  --ease: cubic-bezier(0.2, 0.8, 0.2, 1);
  --dur: 200ms;

  /* --- derived roles: written once, follow the mode ---------------------- */
  --line: rgba(var(--line-rgb), 0.1);
  --line-strong: rgba(var(--line-rgb), 0.18);
  --line-band: rgba(var(--on-band-rgb), 0.16);
  --glass: rgba(var(--bg-rgb), 0.78);
  --glass-strong: rgba(var(--bg-rgb), 0.94);
  --focus: var(--primary);
  --on-solid: #ffffff;
  --shadow-sm: 0 1px 2px rgba(var(--shadow-rgb), calc(0.05 * var(--shadow-k))),
    0 1px 1px rgba(var(--shadow-rgb), calc(0.03 * var(--shadow-k)));
  --shadow-md: 0 2px 6px rgba(var(--shadow-rgb), calc(0.04 * var(--shadow-k))),
    0 12px 32px rgba(var(--shadow-rgb), calc(0.08 * var(--shadow-k)));
  --shadow-lg: 0 8px 20px rgba(var(--shadow-rgb), calc(0.06 * var(--shadow-k))),
    0 30px 70px rgba(var(--shadow-rgb), calc(0.14 * var(--shadow-k)));
  --shadow-rgb: 16, 35, 29;
  --shadow-k: 1;

  /* --- status: visa badges and the like. Mode-aware ---------------------- */
  --free-fg: #0e6b3a;  --free-bg: #e3f4ea;
  --voa-fg: #7a4e00;   --voa-bg: #fff1d6;
  --evisa-fg: #1f4fa8; --evisa-bg: #e6eefb;
  --danger-fg: #b42318; --danger-bg: #fdecea;

  /* --- colour, light ----------------------------------------------------- */
  --bg: #fbf8f1;        --bg-rgb: 251, 248, 241;
  --surface: #fffdf8;
  --surface-2: #f3eee2;
  --surface-3: #e8e0cf;
  --text: #10231d;
  --text-muted: #525f58;
  --line-rgb: 16, 35, 29;
  --primary: #0b5d45;
  --primary-hover: #08473a;
  --tint: #e4efe8;
  --cta: #0b4f3c;       --cta-hover: #083d2f;  --on-cta: #fbf5e6;
  --accent-text: #7e5f1d;
  --solid: #10231d;
  --band: #0a3d2f;      --band-2: #082f24;  --band-rgb: 10, 61, 47;
  --on-band: #f6f1e4;   --on-band-rgb: 246, 241, 228;
  --on-band-muted: #c9d6cc;
  --band-accent: #d9b76e;
  --cta-band: #d4b06a;  --cta-band-hover: #e0c07e;  --on-cta-band: #1a1405;
  --logo: linear-gradient(160deg, #c9a24e, #8e6a24);
  --logo-band: linear-gradient(160deg, #f0dba6, #c9a24e);
  --glow-a: rgba(212, 176, 106, 0.18);
  --glow-b: rgba(16, 120, 90, 0.35);

  /* ======================================================================
     Legacy aliases. Every older rule on the site was written against these
     names; pointing them at roles is what lets 678 pages follow the design
     and the mode without each rule being rewritten.
     ====================================================================== */
  --color-ink: var(--text);
  --color-ink-soft: var(--text-muted);
  --color-sand: var(--surface-2);
  --color-sand-deep: var(--surface-3);
  --color-paper: var(--surface);
  --color-white: #ffffff;              /* rules now say --surface or --on-solid */
  --color-accent: var(--primary);
  --color-accent-dark: var(--solid);   /* was a fill behind white text */
  --color-accent-text: var(--primary);
  --color-forest: var(--free-fg);
  --color-border: var(--line);
  --color-shadow: var(--shadow-md);
  /* Gutter grows from 16px on phones to 40px on laptops. */
  --container-width: min(1200px, calc(100vw - 2 * clamp(16px, 4vw, 40px)));
  --radius-large: var(--r-lg);
  --radius-medium: var(--r-md);
  --radius-small: var(--r-sm);
  --transition: var(--dur) var(--ease);

  /* names the destination and visa templates use */
  --accent: var(--primary);
  --accent-dark: var(--solid);
  /* --accent-text is a role above (gold as text); the templates' own use of
     the name gets the gold, which is what a highlight means here. */
  --ink: var(--text);
  --ink-soft: var(--text-muted);
  --bg-soft: var(--surface-2);
}

/* ==========================================================================
   Dark mode. Same roles, night values: a resort after sunset. Links and the
   main button turn gold; the bands keep their emerald.
   ========================================================================== */
:root[data-theme="dark"] {
  color-scheme: dark;
  --shadow-rgb: 0, 0, 0;
  --shadow-k: 4;
  --free-fg: #74d99f;  --free-bg: #0f2e1f;
  --voa-fg: #ffc96b;   --voa-bg: #33240a;
  --evisa-fg: #9dbcff; --evisa-bg: #14244a;
  --danger-fg: #ff9b90; --danger-bg: #3a1411;

  --bg: #07130f;        --bg-rgb: 7, 19, 15;
  --surface: #0d1c17;
  --surface-2: #0a1813;
  --surface-3: #15291f;
  --text: #f2ede1;
  --text-muted: #b3bfb6;
  --line-rgb: 242, 237, 225;
  --primary: #d9b76e;
  --primary-hover: #e8cf94;
  --tint: #2a2414;
  --cta: #d4b06a;       --cta-hover: #e0c07e;  --on-cta: #1a1405;
  --accent-text: #e8cf94;
  --solid: #0b5d45;
  --band: #0a3328;      --band-2: #072920;  --band-rgb: 10, 51, 40;
  --on-band: #f6f1e4;   --on-band-rgb: 246, 241, 228;
  --on-band-muted: #c2cfc5;
  --band-accent: #d9b76e;
  --cta-band: #d4b06a;  --cta-band-hover: #e0c07e;  --on-cta-band: #1a1405;
  --logo: linear-gradient(160deg, #f0dba6, #c9a24e);
  --logo-band: linear-gradient(160deg, #f0dba6, #c9a24e);
}
