/* Client token starter. Apply the exact scale, shape, depth and motion from docs/03-design-spec.md before acceptance. */

/* Metric-matched fallback for the display face. Cormorant Garamond is far
   narrower than the generic serif fallback, so an unadjusted fallback re-wraps
   the hero headline when the web font swaps in (measured 842.5px fallback vs
   638.6px web font at the same size, i.e. 75.8%). Sinhala and Tamil keep their
   plain stacks: a local() face there resolves late and adds its own swap. */
@font-face {
  font-family: "Dunes EN Display Fallback";
  src: local("Georgia"), local("Times New Roman");
  size-adjust: 75.8%;
  ascent-override: 96%;
  descent-override: 26%;
  line-gap-override: 0%;
}

:root {
  color-scheme: dark;
  /* colour — from project.json.design.palette */
  --c-bg: #161E1B;
  --c-surface: #1F2A26;
  --c-ink: #E6EDE8;
  --c-muted: #A3B2AB;
  --c-accent: #D4A84B;
  --c-accent-ink: #161E1B;
  --c-line: #33413C;
  --c-tint: #24332E;

  /* type - EN families from project.json.design.fonts */
  --font-display: "Cormorant Garamond", "Dunes EN Display Fallback", Georgia, serif;
  --font-body: "Karla", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;

  /* SI/TA families from project.json.design.fonts. Keep these separate so
     native switcher labels remain readable while another language is active. */
  --font-si-body: "Noto Sans Sinhala", system-ui, sans-serif;
  --font-si-display: "Noto Serif Sinhala", "Noto Sans Sinhala", serif;
  --font-ta-body: "Noto Sans Tamil", system-ui, sans-serif;
  --font-ta-display: "Noto Serif Tamil", "Noto Sans Tamil", serif;

  --fs-0: clamp(0.875rem, 0.85rem + 0.2vw, 0.95rem);
  --fs-1: clamp(1rem, 0.95rem + 0.3vw, 1.125rem);
  --fs-2: clamp(1.25rem, 1.1rem + 0.8vw, 1.5rem);
  --fs-3: clamp(1.6rem, 1.3rem + 1.6vw, 2.25rem);
  --fs-4: clamp(2.2rem, 1.6rem + 3.2vw, 3.6rem);
  --lh-body: 1.55;
  --lh-heading: 1.05;
  --scale-heading: 1;

  /* space (4-pt) */
  --s-1: .25rem; --s-2: .5rem; --s-3: .75rem; --s-4: 1rem; --s-6: 1.5rem; --s-8: 2rem;
  --s-12: 3rem; --s-16: 4rem; --s-24: 6rem;

  /* shape + depth - ONE radius family per project */
  --r-sm: 0; --r-md: 0; --r-lg: 0;
  --shadow-1: none;
  --shadow-2: none;

  /* motion */
  --t-fast: 150ms; --t-base: 240ms; --ease: cubic-bezier(.2, .7, .2, 1);
  --hero-enter: 280ms; --hero-stagger: 80ms;

  /* layout */
  --max-w: 72rem;
  --gutter: clamp(1rem, 4vw, 2.5rem);
  --header-min: 64px;
  --header-h: 64px;
  --sticky-cta-h: 4.25rem;
}

/* Sinhala / Tamil overrides - docs/I18N.md §4 */
html[data-lang="si"] {
  --font-body: var(--font-si-body);
  --font-display: var(--font-si-display);
}
html[data-lang="ta"] {
  --font-body: var(--font-ta-body);
  --font-display: var(--font-ta-display);
}
html[data-lang="si"],
html[data-lang="ta"] {
  --lh-body: 1.75;
  --lh-heading: 1.25;
  --scale-heading: 0.88;
  letter-spacing: 0;
}

/* Base */
html { scroll-behavior: smooth; scroll-padding-top: calc(var(--header-h) + var(--s-4)); scroll-padding-bottom: calc(var(--sticky-cta-h) + var(--s-4)); }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body {
  margin: 0; background: var(--c-bg); color: var(--c-ink);
  font-family: var(--font-body); font-size: var(--fs-1); line-height: var(--lh-body);
  -webkit-text-size-adjust: 100%; touch-action: manipulation; -webkit-tap-highlight-color: transparent;
}
h1, h2, h3 { font-family: var(--font-display); line-height: var(--lh-heading); text-wrap: balance; margin: 0; }
h1 { font-size: calc(var(--fs-4) * var(--scale-heading)); }
h2 { font-size: calc(var(--fs-3) * var(--scale-heading)); }
h3 { font-size: calc(var(--fs-2) * var(--scale-heading)); }
img, picture, video { max-width: 100%; height: auto; display: block; }
a { color: var(--c-accent); }
:focus-visible { outline: 2px solid var(--c-accent); outline-offset: 2px; }
[translate="no"] { font-variant-numeric: tabular-nums; }
address { font-style: normal; overflow-wrap: anywhere; }
[data-lang-switch="si"] { font-family: var(--font-si-body); }
[data-lang-switch="ta"] { font-family: var(--font-ta-body); }
.skip-link { position: absolute; inset-inline-start: var(--s-4); top: -100%; background: var(--c-accent); color: var(--c-accent-ink); padding: var(--s-2) var(--s-4); z-index: 100; }
.skip-link:focus { top: var(--s-4); }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
