/* =========================================================================
   Kadella — tokens, reset, typography, layout helpers
   Palette follows resources/brand-tokens.css (red roof, black wordmark).
   ========================================================================= */
:root {
  /* Brand */
  --red: #E00012;
  --red-deep: #AA0010;
  --red-tint: #FDECEE;
  --ink: #151515;
  --ink-2: #2A2928;
  --white: #FFFFFF;
  --canvas: #F8F7F4;
  --canvas-2: #F1EFEA;
  --line: #E7E4DF;
  --line-2: #D6D2CB;
  --muted: #595959;

  /* Status (never colour alone: always paired with text) */
  --ok: #17703F;
  --warn: #9A5200;
  --wa: #0F7A3E;

  /* Type */
  --font: "Archivo", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-si: "Noto Sans Sinhala", "Iskoola Pota", system-ui, sans-serif;
  --font-ta: "Noto Sans Tamil", "Latha", system-ui, sans-serif;

  --fs-xs: 0.8125rem;
  --fs-sm: 0.875rem;
  --fs-md: 1rem;
  --fs-lg: 1.125rem;
  --fs-h3: 1.25rem;
  --fs-h2: clamp(1.625rem, 1.2rem + 1.5vw, 2.375rem);
  --fs-h1: clamp(2.25rem, 1.4rem + 3.4vw, 4rem);

  /* Space (4px grid) */
  --s1: 4px; --s2: 8px; --s3: 12px; --s4: 16px; --s5: 24px; --s6: 32px; --s7: 48px; --s8: 64px; --s9: 96px;

  --radius: 10px;
  --radius-sm: 8px;
  --shadow-1: 0 1px 2px rgba(21, 21, 21, .06), 0 2px 8px rgba(21, 21, 21, .05);
  --shadow-2: 0 10px 30px -8px rgba(21, 21, 21, .22), 0 2px 6px rgba(21, 21, 21, .06);
  --ease: cubic-bezier(.16, 1, .3, 1);
  --container: 1280px;
  --gutter: clamp(16px, 4vw, 32px);
}

/* ---- Reset ------------------------------------------------------------ */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: 24px; }
body {
  margin: 0;
  font-family: var(--font);
  font-size: var(--fs-md);
  line-height: 1.55;
  color: var(--ink);
  background: var(--white);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
body.is-locked { overflow: hidden; }
img, svg { display: block; max-width: 100%; }
img { height: auto; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: inherit; text-decoration-thickness: 1px; text-underline-offset: 3px; }
h1, h2, h3, h4 { margin: 0; line-height: 1.1; text-wrap: balance; }
p { margin: 0; text-wrap: pretty; }
ul, ol { margin: 0; padding: 0; list-style: none; }
address { font-style: normal; }
[hidden] { display: none !important; }
:lang(si) { font-family: var(--font-si); }
:lang(ta) { font-family: var(--font-ta); }

::selection { background: var(--red); color: var(--white); }
:focus-visible { outline: 2px solid var(--red); outline-offset: 2px; border-radius: 4px; }
input, textarea { caret-color: var(--red); }
html { scrollbar-color: var(--line-2) transparent; }

/* ---- Type helpers ----------------------------------------------------- */
.display {
  font-size: var(--fs-h1);
  font-weight: 800;
  font-stretch: 80%;
  letter-spacing: -0.02em;
  line-height: 1;
}
h2, .h2 { font-size: var(--fs-h2); font-weight: 800; font-stretch: 84%; letter-spacing: -0.015em; }
h3, .h3 { font-size: var(--fs-h3); font-weight: 700; font-stretch: 92%; }
.lead { font-size: var(--fs-lg); color: var(--ink-2); max-width: 60ch; }
.muted { color: var(--muted); }
.small { font-size: var(--fs-sm); }
.prose { max-width: 68ch; }
.prose p + p, .prose p + ul, .prose ul + p { margin-top: 1em; }
.prose ul { list-style: disc; padding-left: 1.25em; }
.prose li + li { margin-top: .35em; }
.prose h2 { margin: 1.8em 0 .5em; }
.prose h3 { margin: 1.6em 0 .4em; }
.num { font-variant-numeric: tabular-nums; }

/* ---- Layout ----------------------------------------------------------- */
.container { width: 100%; max-width: var(--container); margin-inline: auto; padding-inline: var(--gutter); }
.section { padding-block: clamp(48px, 7vw, 88px); }
.section--tight { padding-block: clamp(32px, 4vw, 48px); }
.section--canvas { background: var(--canvas); }
.stack > * + * { margin-top: var(--s4); }
.sr-only {
  position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.skip {
  position: absolute; left: 12px; top: -60px; z-index: 100;
  background: var(--ink); color: var(--white); padding: 10px 14px; border-radius: var(--radius-sm);
  font-weight: 700; text-decoration: none;
}
.skip:focus { top: 12px; }

/* ---- Icons ------------------------------------------------------------ */
.icon { width: 20px; height: 20px; flex: none; }
.icon--sm { width: 14px; height: 14px; }

/* ---- Roof mark -------------------------------------------------------- */
.roof__l { fill: var(--red-deep); }
.roof__r { fill: var(--red); }
.roof--mark { width: 30px; height: auto; flex: none; }
.roof--empty { width: 96px; margin: 0 auto var(--s4); opacity: .9; }

/* ---- Reveal (content visible by default; JS opts in) ----------------- */
.can-reveal [data-reveal] { opacity: 0; transform: translateY(18px); transition: opacity .8s var(--ease), transform .8s var(--ease); }
.can-reveal [data-reveal].is-in { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
