/* Reset, typography, layout primitives and utilities. */

*,
*::before,
*::after { box-sizing: border-box; }

html {
  font-size: calc(100% * var(--font-scale, 1));
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-padding-top: calc(var(--nav-h) + 32px);
  scroll-behavior: smooth;
}

/* Scrollbars: a slim rounded thumb on a transparent track, page and inner scroll areas alike.
 * Chromium and Safari use the ::-webkit-scrollbar styles; Firefox gets the standard properties. */
::-webkit-scrollbar { width: 12px; height: 12px; background: transparent; }
::-webkit-scrollbar-track, ::-webkit-scrollbar-corner { background: transparent; }
::-webkit-scrollbar-thumb {
  background: var(--scroll-thumb);
  background-clip: padding-box;
  border: 3px solid transparent;
  border-radius: 999px;
  min-height: 48px;
}
::-webkit-scrollbar-thumb:hover { background: var(--scroll-thumb-hover); background-clip: padding-box; }
::-webkit-scrollbar-thumb:active { background: var(--primary); background-clip: padding-box; }
::-webkit-scrollbar-button { display: none; width: 0; height: 0; }
@supports not selector(::-webkit-scrollbar) {
  * { scrollbar-width: thin; scrollbar-color: var(--scroll-thumb) transparent; }
}
/* Only the page itself has a scrollbar. Areas inside it scroll with the wheel, touch or keys, and show
 * faded edges and arrow buttons instead (KIS.ui.scrollAreas in js/ui.js). */
body * { scrollbar-width: none; }
body *::-webkit-scrollbar { display: none; width: 0; height: 0; }
::selection { background: var(--sun); color: var(--navy-950); }

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: var(--text-md);
  line-height: var(--leading-body);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: clip;
}

img, svg, video { display: block; max-width: 100%; }
svg.icon { display: inline-block; flex: none; vertical-align: middle; }
[data-icon] { display: inline-flex; align-items: center; justify-content: center; flex: none; line-height: 0; }

h1, h2, h3, h4 {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 600;
  line-height: var(--leading-tight);
  color: var(--ink);
  letter-spacing: -0.025em;
  text-wrap: balance;
}
h3 { font-size: var(--text-lg); line-height: var(--leading-snug); letter-spacing: -0.01em; }
h1 em, h2 em, h3 em, .statement em {
  font-family: var(--font-serif);
  font-style: italic;
  font-weight: 400;
  letter-spacing: 0;
}
p { margin: 0 0 var(--space-3); text-wrap: pretty; }
p:last-child { margin-bottom: 0; }
ul, ol { margin: 0; padding: 0; }
li { list-style: none; }
figure { margin: 0; }
address { font-style: normal; }
code { font-family: var(--font-mono); font-size: 0.88em; background: var(--surface-2); padding: 0.1em 0.45em; border-radius: 6px; }

a { color: var(--ink); text-decoration-thickness: 1px; text-underline-offset: 0.2em; }
a:hover { text-decoration-thickness: 2px; }

button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
button:disabled { cursor: not-allowed; opacity: 0.55; }

:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; border-radius: 6px; }
/* Page headings receive focus on route change for screen readers; no ring is needed there. */
h1[tabindex='-1']:focus, h2[tabindex='-1']:focus { outline: none; }

[hidden] { display: none !important; }

/* ---------- utilities ---------- */

.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;
}
.muted { color: var(--muted); }
.small { font-size: var(--text-sm); }
.block { display: block; }
.optional { color: var(--muted); font-weight: 400; }

.skip-link {
  position: absolute; left: var(--space-4); top: -100px; z-index: 200;
  padding: var(--space-2) var(--space-4);
  background: var(--sun); color: var(--navy-950);
  border-radius: var(--radius-pill); font-weight: 700; text-decoration: none;
}
.skip-link:focus { top: var(--space-3); }

.container {
  width: 100%;
  max-width: calc(var(--container) + var(--gutter) * 2);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

/* ---------- sections & page structure ---------- */

main { display: block; outline: none; }

.section { padding-block: var(--section-y); }
.section--flush { padding-bottom: calc(var(--section-y) * 0.6); }
.section--flush-top { padding-top: 0; }
.section--tint { background: var(--surface-2); border-radius: var(--radius-xl); margin-inline: var(--frame); }
.section--ink {
  background: var(--band-bg);
  color: var(--band-text);
  border-radius: var(--radius-xl);
  margin-inline: var(--frame);
}
.section--ink h2, .section--ink h3 { color: var(--band-text); }
.section--ink .muted { color: var(--band-muted); }
.section--ink p, .section--ink .prose p { color: var(--band-text); }

.page-title { font-size: var(--text-3xl); margin-bottom: var(--space-4); }
.page-lead { max-width: 60ch; font-size: var(--text-lg); color: var(--muted); }
.page-head__actions { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-4); margin-top: var(--space-6); }

/* Section label: a short teal (or sun yellow on dark) rule, then small caps text. */
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-bottom: var(--space-4);
  font-size: var(--text-xs);
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}
.eyebrow::before { content: ''; width: 18px; height: 3px; border-radius: 2px; background: var(--logo-teal); }
.eyebrow--light { color: var(--band-muted); }
.eyebrow--light::before { background: var(--sun); }
:root[data-theme='dark'] .eyebrow::before { background: var(--sun); }

.section-title { font-size: var(--text-2xl); margin-bottom: var(--space-5); font-weight: 500; }
.section-title--sm { font-size: var(--text-xl); margin-bottom: var(--space-4); font-weight: 600; }
.section-head {
  display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between;
  gap: var(--space-3) var(--space-5);
  margin-bottom: var(--space-6);
}
.section-head .section-title { margin-bottom: 0; }
.section-head--split { align-items: flex-end; }
.section-head__side { display: flex; align-items: center; gap: var(--space-5); max-width: 460px; }
.section-head__side p { margin: 0; font-size: var(--text-sm); text-align: right; }
@media (max-width: 760px) {
  .section-head__side { max-width: none; width: 100%; justify-content: space-between; }
  .section-head__side p { text-align: left; }
}

.list-title {
  display: flex; align-items: center; gap: var(--space-2);
  margin: var(--space-6) 0 var(--space-3);
  font-family: var(--font-body);
  font-size: var(--text-sm); font-weight: 700; letter-spacing: 0.01em;
  color: var(--muted);
}

/* Asymmetric two-column: heading column on the left, content on the right. */
.split { display: grid; gap: var(--space-6); }
@media (min-width: 900px) {
  .split { grid-template-columns: minmax(240px, 4fr) 8fr; gap: var(--space-8); }
  .split__aside { position: sticky; top: calc(var(--nav-h) + 40px); align-self: start; }
}

.two-col { display: grid; gap: var(--space-6); }
.two-col--tight { margin-top: var(--space-4); }
@media (min-width: 760px) {
  .two-col { grid-template-columns: 1fr 1fr; gap: var(--space-7); }
  .two-col--wide { grid-template-columns: 1.15fr 1fr; align-items: start; }
}

.prose { max-width: 66ch; }
.prose h3 { display: flex; align-items: center; gap: var(--space-2); margin-bottom: var(--space-3); }

/* ---------- motion hooks ---------- */

.js [data-reveal] {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity var(--dur-slow) var(--ease-out), transform var(--dur-slow) var(--ease-out);
}
.js [data-reveal].is-visible { opacity: 1; transform: none; }

/* Page changes. Every page is its own HTML file; browsers with cross-document View Transitions fade the
 * new page in over the old one (below). The page section carries .is-entering in its HTML, so its
 * banner copy rises in from the very first paint and is never shown, hidden and shown again.
 * On the first page of a visit the preloader is up, so the entrance waits for it (--enter-delay). */
@view-transition { navigation: auto; }
:root { --enter-delay: 120ms; }
:root.js:not(.no-preload) { --enter-delay: 620ms; }

.page.is-entering .page-banner .container > *,
.page.is-entering .hero__copy > *,
.page.is-entering .hero__side {
  animation: rise-in 760ms var(--ease-out) both;
  animation-delay: calc(var(--enter-delay) + var(--stagger, 0) * 70ms);
}
.page.is-entering .page-banner .container > :nth-child(2),
.page.is-entering .hero__copy > :nth-child(2) { --stagger: 1; }
.page.is-entering .page-banner .container > :nth-child(3),
.page.is-entering .hero__copy > :nth-child(3) { --stagger: 2; }
.page.is-entering .page-banner .container > :nth-child(4),
.page.is-entering .hero__copy > :nth-child(4) { --stagger: 3; }
.page.is-entering .hero__copy > :nth-child(5) { --stagger: 4; }
.page.is-entering .hero__side { --stagger: 5; }
@keyframes rise-in { from { opacity: 0; transform: translateY(26px); } to { opacity: 1; transform: none; } }

/* The old page stays fully opaque underneath while the new one fades in on top. Fading both at once
 * lets the page background show through halfway, which reads as a flash between two dark banners. */
::view-transition-old(root), ::view-transition-new(root) { mix-blend-mode: normal; }
::view-transition-old(root) { animation: vt-hold 420ms linear both; }
::view-transition-new(root) { animation: vt-in 420ms var(--ease-out) both; }
@keyframes vt-hold { from { opacity: 1; } to { opacity: 1; } }
@keyframes vt-in { from { opacity: 0; } to { opacity: 1; } }

:root[data-motion='reduced'] *,
:root[data-motion='reduced'] *::before,
:root[data-motion='reduced'] *::after {
  animation-duration: 0.01ms !important;
  animation-iteration-count: 1 !important;
  transition-duration: 0.01ms !important;
  scroll-behavior: auto !important;
}
:root[data-motion='reduced'] [data-reveal] { opacity: 1 !important; transform: none !important; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  .js [data-reveal] { opacity: 1; transform: none; }
}

.noscript {
  position: fixed; inset: auto 0 0 0;
  margin: 0; padding: var(--space-3);
  background: var(--warn-soft); color: var(--text); text-align: center;
}
