/* ==========================================================================
   base.css — brand tokens, surfaces, reset, typography for NU Care-LAZISNU MWCNU Klojen
   Colours and fonts come from the organisation: its brand guideline, or derived
   from its logo + description. A layout reference contributes no colour or font.
   Colour literals live ONLY in the five --c-* tokens below; everything else uses
   var() or color-mix() of them.  Check: python3 tools/palette.py lint <this css folder>
   ========================================================================== */

:root {
  /* Brand palette: 3 hues + 2 neutrals. BRAND: replace these neutral boilerplate defaults
     with the organisation's colours; `palette.py lint` fails while any hue is still a default. */
  --c-primary: #02542c;   /* Hijau NU: logo dominant colour */
  --c-secondary: #3d7230; /* Hijau Daun: logo leaf green, darkened for paper text */
  --c-accent: #9cc455;    /* Pucuk: highlight on dark surfaces only (1.78:1 on paper) */
  --c-paper: #f6f1e3;     /* Kertas: warm cream */
  --c-ink: #002c15;       /* Hijau Malam: text + dark sections (org landing mockup) */

  /* Text colour on each brand colour: paper or ink, whichever `palette.py contrast` passes. */
  --on-primary: var(--c-paper);
  --on-secondary: var(--c-paper);
  --on-accent: var(--c-ink);

  /* Type: BRAND fonts (never a layout reference's fonts). Load them with NCK_FONTS_URL in functions.php. */
  --font-display: "Source Serif 4", Georgia, serif;
  --font-body: "Figtree", system-ui, sans-serif;
  --fs-xs: 0.75rem;
  --fs-sm: 0.875rem;
  --fs-base: 1rem;
  --fs-lg: 1.125rem;
  --fs-xl: clamp(1.25rem, 1.1rem + 0.5vw, 1.5rem);
  --fs-2xl: clamp(2.125rem, 1.6rem + 1.8vw, 3rem);
  --fs-3xl: clamp(2.625rem, 1.7rem + 3vw, 4rem);
  --fs-hero: clamp(2.75rem, 1.6rem + 5vw, 6rem);

  /* Space & shape */
  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-6: 1.5rem;
  --space-8: 2rem;
  --space-12: 3rem;
  --space-16: 4rem;
  --space-24: 6rem;
  --radius: 0.625rem;
  --radius-sm: 0.375rem;
  --radius-pill: 50rem;

  /* Layout */
  --container: 82.5rem;
  --gutter: 1.25rem;
  --header-h: 4.75rem;

  /* Motion (animate skill): strong curves, never ease-in on UI */
  --ease-out: cubic-bezier(0.23, 1, 0.32, 1);      /* enter / exit, UI */
  --ease-in-out: cubic-bezier(0.77, 0, 0.175, 1);  /* on-screen movement, image reveals, line draw */
  --dur-press: 160ms;
  --dur-hover: 200ms;
  --dur-reveal: 600ms;
  --section-y: 3.75rem;

  /* Derived surfaces (mixes of the tokens above, never new literals) */
  --c-tint: color-mix(in srgb, var(--c-paper) 88%, var(--c-secondary));
  --c-leaf-soft: color-mix(in srgb, var(--c-secondary) 14%, var(--c-paper));
}

@media (min-width: 48rem) {
  :root { --gutter: 1.875rem; --section-y: 7.5rem; }
}

/* Surfaces: the only four section backgrounds. Accent is never a surface.
   Components read --bg/--fg/--muted/--line/--link/--btn-bg/--btn-fg/--focus.
   BRAND: `palette.py contrast` lists the surfaces where accent buttons pass (≥ 3:1);
   on the others, buttons, links and focus use the surface's text colour instead. */
.surface-paper {
  --bg: var(--c-paper); --fg: var(--c-ink); --card: var(--c-tint);
  --muted: color-mix(in srgb, var(--c-ink) 72%, var(--c-paper));
  --line: color-mix(in srgb, var(--c-ink) 14%, var(--c-paper));
  --heading: var(--c-primary);
  --link: var(--c-primary); --btn-bg: var(--c-primary); --btn-fg: var(--on-primary); --focus: var(--c-primary);
}
/* Kleno's light sections are a tinted ground with lighter cards: our tint + paper cards. */
.surface-paper.is-tint { --bg: var(--c-tint); --card: var(--c-paper); }
.surface-primary {
  --bg: var(--c-primary); --fg: var(--on-primary); --card: color-mix(in srgb, var(--c-paper) 8%, var(--c-primary));
  --muted: color-mix(in srgb, var(--on-primary) 80%, var(--c-primary));
  --line: color-mix(in srgb, var(--on-primary) 22%, var(--c-primary));
  --heading: var(--on-primary);
  --link: var(--c-accent); --btn-bg: var(--c-accent); --btn-fg: var(--on-accent); --focus: var(--c-accent);
}
.surface-secondary {
  --bg: var(--c-secondary); --fg: var(--on-secondary); --card: color-mix(in srgb, var(--c-paper) 10%, var(--c-secondary));
  --muted: color-mix(in srgb, var(--on-secondary) 82%, var(--c-secondary));
  --line: color-mix(in srgb, var(--on-secondary) 24%, var(--c-secondary));
  --heading: var(--on-secondary);
  --link: var(--on-secondary); --btn-bg: var(--c-paper); --btn-fg: var(--c-ink); --focus: var(--c-paper);
}
.surface-ink {
  --bg: var(--c-ink); --fg: var(--c-paper); --card: color-mix(in srgb, var(--c-paper) 7%, var(--c-ink));
  --muted: color-mix(in srgb, var(--c-paper) 74%, var(--c-ink));
  --line: color-mix(in srgb, var(--c-paper) 16%, var(--c-ink));
  --heading: var(--c-paper);
  --link: var(--c-accent); --btn-bg: var(--c-accent); --btn-fg: var(--on-accent); --focus: var(--c-accent);
}
[class*="surface-"] { background: var(--bg); color: var(--fg); }

/* Reset ------------------------------------------------------------------ */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: calc(var(--header-h) + var(--space-4)); }
body {
  min-height: 100vh;
  font-family: var(--font-body);
  font-size: var(--fs-base);
  line-height: 1.6;
  color: var(--c-ink);
  background: var(--c-paper);
  -webkit-font-smoothing: antialiased;
}
img, picture, svg, video, iframe { display: block; max-width: 100%; }
img { height: auto; }
input, button, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; }
p, h1, h2, h3, h4, h5, h6, li { overflow-wrap: break-word; }
ul[class], ol[class], nav ul, nav ol { list-style: none; padding: 0; }
a { color: inherit; text-underline-offset: 0.18em; }

/* Typography ------------------------------------------------------------- */
h1, h2, h3, h4 { font-family: var(--font-display); font-weight: 600; line-height: 1.15; letter-spacing: -0.015em; color: var(--heading, inherit); text-wrap: balance; }
h1 { font-size: var(--fs-3xl); }
h2 { font-size: var(--fs-2xl); }
h3 { font-size: var(--fs-xl); line-height: 1.25; letter-spacing: -0.005em; }
h4 { font-size: var(--fs-lg); }
.lead { font-size: var(--fs-lg); line-height: 1.55; color: var(--muted); max-width: 60ch; }

/* Long-form content (WordPress the_content() lands here) */
.prose { font-size: 1.0625rem; line-height: 1.75; max-width: 68ch; }
.prose > * + * { margin-top: var(--space-6); }
.prose h2 { margin-top: var(--space-12); }
.prose ul, .prose ol { padding-left: var(--space-6); }
.prose a { color: var(--link); font-weight: 600; }
.prose blockquote { border-left: 4px solid var(--focus, var(--c-accent)); padding-left: var(--space-6); font-size: var(--fs-xl); }

/* Accessibility ---------------------------------------------------------- */
:focus-visible { outline: 3px solid var(--focus, var(--c-accent)); outline-offset: 3px; }
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.skip-link {
  position: absolute; left: var(--space-4); top: -100%; z-index: 100;
  padding: var(--space-2) var(--space-4); background: var(--c-ink); color: var(--c-paper);
  border-radius: var(--radius-sm); font-weight: 700;
}
.skip-link:focus { top: var(--space-4); }

/* Reduced motion: gentler, not zero. Movement is removed per component in components.css
   (motion section); opacity fades stay so state changes remain legible. */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}
