/* ==========================================================================
   RCS DESIGN SYSTEM — BASE
   Fonts, reset, element defaults, typographic primitives, utilities.
   ========================================================================== */

/* ---------- 1. FONTS (self-hosted, no CDN) ---------- */
@font-face {
  font-family: "Poppins";
  src: url("../assets/fonts/poppins-600.woff2") format("woff2");
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Poppins";
  src: url("../assets/fonts/poppins-700.woff2") format("woff2");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Poppins";
  src: url("../assets/fonts/poppins-800.woff2") format("woff2");
  font-weight: 800;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Inter";
  src: url("../assets/fonts/inter-var.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}
/* Sinhala + Tamil coverage for both families */
@font-face {
  font-family: "Noto Sans Sinhala";
  src: url("../assets/fonts/noto-sinhala.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0D80-0DFF, U+200C-200D, U+25CC;
}
@font-face {
  font-family: "Noto Sans Tamil";
  src: url("../assets/fonts/noto-tamil.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0B82-0BFA, U+200C-200D, U+25CC;
}

/* ---------- 2. RESET ---------- */
*,
*::before,
*::after { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-height) + var(--space-4));
}

body {
  margin: 0;
  background-color: var(--color-surface);
  color: var(--color-text);
  font-family: var(--font-body);
  font-size: var(--text-md);
  font-weight: var(--weight-regular);
  line-height: var(--leading-relaxed);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

h1, h2, h3, h4, h5, h6, p, figure, blockquote, dl, dd, ul, ol {
  margin: 0;
}

ul[class], ol[class] {
  padding: 0;
  list-style: none;
}

img, picture, svg, video {
  display: block;
  max-width: 100%;
}
img { height: auto; }

button, input, select, textarea {
  font: inherit;
  color: inherit;
}

a {
  color: var(--color-accent-text);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.18em;
}
a:hover { color: var(--color-accent-fill-active); }

address { font-style: normal; }

/* ---------- 3. FOCUS + MOTION ---------- */
:focus-visible {
  outline: 3px solid var(--color-focus-ring);
  outline-offset: 2px;
  border-radius: var(--radius-xs);
}
.on-ink :focus-visible,
.rcs-footer :focus-visible {
  outline-color: var(--palette-white);
}

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

/* ---------- 4. HEADINGS ---------- */
.h1, .h2, .h3, .h4,
h1, h2, h3, h4 {
  font-family: var(--font-heading);
  font-weight: var(--weight-bold);
  line-height: var(--leading-tight);
  letter-spacing: var(--tracking-tight);
  color: var(--color-text);
  text-wrap: balance;
}
.h1, h1 { font-size: var(--text-5xl); font-weight: var(--weight-black); }
.h2, h2 { font-size: var(--text-4xl); }
.h3, h3 { font-size: var(--text-2xl); }
.h4, h4 { font-size: var(--text-xl); font-weight: var(--weight-semibold); line-height: var(--leading-snug); }

/* ---------- 5. TEXT PRIMITIVES ---------- */
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: var(--space-3);
  margin: 0 0 var(--space-4);
  font-family: var(--font-heading);
  font-size: var(--text-xs);
  font-weight: var(--weight-bold);
  letter-spacing: var(--tracking-widest);
  text-transform: uppercase;
  color: var(--color-accent-text);
}
.eyebrow::before {
  content: "";
  inline-size: 28px;
  block-size: 3px;
  flex: none;
  background: var(--color-accent);
  border-radius: var(--radius-pill);
}
.on-ink .eyebrow { color: var(--palette-white); }
.on-ink .eyebrow::before { background: var(--color-accent); }

.lead {
  max-width: var(--measure-lead);
  font-size: var(--text-lg);
  line-height: var(--leading-relaxed);
  color: var(--color-text-muted);
}
.on-ink .lead { color: var(--color-text-inverse-muted); }

.prose { max-width: var(--measure-prose); }
.prose p + p { margin-top: var(--space-4); }

.text-muted { color: var(--color-text-muted); }
.text-accent { color: var(--color-accent-text); }

/* Inverse context: everything on charcoal / photographic backgrounds */
.on-ink,
.on-ink h1, .on-ink h2, .on-ink h3, .on-ink h4 {
  color: var(--color-text-inverse);
}
.on-ink .text-muted { color: var(--color-text-inverse-muted); }

/* ---------- 6. UTILITIES ---------- */
.visually-hidden {
  position: absolute;
  inline-size: 1px;
  block-size: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: absolute;
  inset-inline-start: var(--space-4);
  inset-block-start: calc(var(--space-4) * -10);
  z-index: var(--z-float);
  padding: var(--space-3) var(--space-5);
  background: var(--color-surface-inverse);
  color: var(--color-text-inverse);
  font-weight: var(--weight-semibold);
  text-decoration: none;
  border-radius: var(--radius-sm);
  transition: inset-block-start var(--duration-fast) var(--ease-out);
}
.skip-link:focus { inset-block-start: var(--space-4); color: var(--color-text-inverse); }

.icon {
  inline-size: 1em;
  block-size: 1em;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex: none;
}
.icon--filled { fill: currentColor; stroke: none; }

/* Scroll-reveal: opt-in, and inert when JS is unavailable */
.js .reveal {
  opacity: 0;
  transform: translateY(18px);
  transition:
    opacity var(--duration-reveal) var(--ease-out),
    transform var(--duration-reveal) var(--ease-out);
}
.js .reveal.is-visible {
  opacity: 1;
  transform: none;
}
.js .reveal[data-reveal-delay="1"] { transition-delay: 80ms; }
.js .reveal[data-reveal-delay="2"] { transition-delay: 160ms; }
.js .reveal[data-reveal-delay="3"] { transition-delay: 240ms; }
