/* =========================================================================
   KAIRO — Base / Reset / Root layout
   ========================================================================= */

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

html {
  -webkit-text-size-adjust: 100%;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  scroll-behavior: smooth;
  font-feature-settings: "ss01", "cv11", "kern";
  scroll-padding-top: 96px;
}

body {
  min-height: 100dvh;
  background: var(--bone);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: var(--t-body);
  line-height: var(--lh-body);
  letter-spacing: var(--tr-body);
  font-weight: var(--fw-regular);
  -webkit-tap-highlight-color: transparent;
}

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

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

button { background: none; border: 0; padding: 0; cursor: pointer; }

a {
  color: inherit;
  text-decoration: none;
  text-underline-offset: 0.22em;
  text-decoration-thickness: 1px;
  transition: color var(--d-hover) var(--ease-out);
}

p { max-width: var(--content-max); line-height: var(--lh-body); }

/* Headings — editorial defaults */
h1, h2, h3, h4, h5 {
  font-weight: var(--fw-semi);
  letter-spacing: var(--tr-head);
  line-height: var(--lh-snug);
  color: var(--ink);
}
h1 { font-size: var(--t-display); line-height: var(--lh-tight); letter-spacing: var(--tr-display); }
h2 { font-size: var(--t-h1); }
h3 { font-size: var(--t-h2); }
h4 { font-size: var(--t-h3); }

/* Selection */
::selection { background: var(--terra); color: var(--bone); }

/* Focus */
:focus { outline: none; }
:focus-visible {
  outline: 2px solid var(--terra);
  outline-offset: 3px;
  border-radius: 2px;
}

/* Utility: visually hidden */
.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;
}

/* --- Page shell ---------------------------------------------------------- */

.page {
  position: relative;
  isolation: isolate;
}

.wrap {
  max-width: var(--page-max);
  margin-inline: auto;
  padding-inline: var(--page-pad-x);
}

.wrap--narrow { max-width: 880px; }
.wrap--prose  { max-width: 720px; }

section { padding-block: var(--section-pad); }
section + section { border-top: 1px solid var(--rule); }

/* Rail — for editorial side annotations */
.rail {
  font-family: var(--font-mono);
  font-size: var(--t-micro);
  letter-spacing: var(--tr-micro);
  text-transform: uppercase;
  color: var(--ink-quiet);
  font-feature-settings: "tnum", "zero";
}

/* Eyebrow — small label before section heading */
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-mono);
  font-size: var(--t-micro);
  letter-spacing: var(--tr-micro);
  text-transform: uppercase;
  color: var(--ink-muted);
  margin-bottom: var(--s-6);
  font-feature-settings: "tnum";
}
.eyebrow::before {
  content: "";
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--terra);
}

/* Lede — opening paragraph after a section heading */
.lede {
  font-size: var(--t-lede);
  line-height: 1.5;
  color: var(--ink-soft);
  max-width: 56ch;
}

/* Fine caps label (tabular numbers) */
.mono  { font-family: var(--font-mono); font-feature-settings: "tnum", "zero"; }
.caps  { text-transform: uppercase; letter-spacing: var(--tr-micro); font-size: var(--t-micro); font-family: var(--font-mono); color: var(--ink-muted); }

/* Editorial accent — used sparingly on hero */
.editorial { font-family: var(--font-editorial); font-style: italic; font-weight: 400; letter-spacing: -0.01em; }

/* Reduced motion — keep opacity/color; drop movement */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
}
