/* ==========================================================================
   IKC — Base: reset, document, typography defaults, browser surfaces.
   ========================================================================== */

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

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-behavior: smooth;
  /* The header is fixed; anchored targets must clear it. */
  scroll-padding-top: calc(var(--header-h) + var(--s-6));
  /* Themed browser chrome: scrollbar, caret and selection are part of the
     design system, not the operating system's. */
  scrollbar-color: var(--line-strong) var(--paper);
  scrollbar-width: thin;
  caret-color: var(--signal-ink);
  accent-color: var(--signal-ink);
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
}

body {
  margin: 0;
  /* Reserves the header's uncompressed height; the header itself is fixed, so
     its scrolled compression never moves this. */
  padding-top: var(--header-h);
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-text);
  font-variation-settings: 'wdth' var(--wd-text);
  font-weight: var(--fw-text);
  font-size: var(--t-body);
  line-height: var(--lh-body);
  font-variant-numeric: oldstyle-nums proportional-nums;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

::selection {
  background: var(--signal-wash);
  color: var(--ink);
}

.on-ink ::selection,
.section--ink ::selection {
  background: var(--on-ink-soft);
  color: var(--ink);
}

.hero--signal ::selection,
.section--signal ::selection {
  background: var(--on-signal);
  color: var(--signal);
}

/* ---- Headings -----------------------------------------------------------
   Display voice is Archivo, set wide and tight. Headings never carry a
   kicker or an eyebrow; the heading does its own work.
   ------------------------------------------------------------------------ */

h1,
h2,
h3,
h4,
h5,
h6 {
  font-family: var(--font-display);
  font-variation-settings: 'wdth' var(--wd-display);
  font-weight: 600;
  line-height: var(--lh-heading);
  letter-spacing: var(--tr-heading);
  text-wrap: balance;
  margin: 0;
  color: var(--ink);
}

h1 {
  font-size: var(--t-h1);
  line-height: var(--lh-tight);
  letter-spacing: var(--tr-display);
}

h2 {
  font-size: var(--t-h2);
  line-height: var(--lh-tight);
}

h3 {
  font-size: var(--t-h3);
}

h4 {
  font-size: var(--t-h4);
  font-weight: 650;
}

p {
  margin: 0;
  text-wrap: pretty;
}

p + p {
  margin-top: var(--s-4);
}

/* ---- Links --------------------------------------------------------------
   Body links carry a real underline with a considered offset and thickness;
   the browser default belongs to no design system.
   ------------------------------------------------------------------------ */

a {
  color: inherit;
  text-decoration-color: var(--line-strong);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.18em;
  transition: color var(--d-fast) var(--ease-out),
    text-decoration-color var(--d-fast) var(--ease-out);
}

a:hover {
  color: var(--signal-ink);
  text-decoration-color: var(--signal);
}

/* ---- Focus --------------------------------------------------------------
   One visible ring everywhere, drawn in the palette, never removed.
   ------------------------------------------------------------------------ */

:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 3px;
  border-radius: var(--radius);
}

.section--ink :focus-visible {
  outline-color: var(--on-ink);
}

.hero--signal :focus-visible,
.section--signal :focus-visible {
  outline-color: var(--on-signal);
}

/* ---- Lists, rules, media ------------------------------------------------ */

ul,
ol {
  margin: 0;
  padding: 0;
}

hr {
  border: 0;
  border-top: var(--rule);
  margin: 0;
}

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

figure {
  margin: 0;
}

blockquote {
  margin: 0;
}

/* ---- Data ---------------------------------------------------------------
   Figures that sit in a column or are compared to one another are lining and
   tabular. Prose keeps oldstyle figures.
   ------------------------------------------------------------------------ */

table,
time,
.num,
[data-tabular] {
  font-variant-numeric: lining-nums tabular-nums;
  font-feature-settings: 'tnum' 1, 'lnum' 1;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-family: var(--font-ui);
  font-size: var(--t-small);
}

th,
td {
  text-align: start;
  padding: var(--s-3) var(--s-4) var(--s-3) 0;
  border-bottom: var(--rule-soft);
  vertical-align: top;
}

th {
  font-weight: 650;
  color: var(--ink);
}

/* ---- Form primitives ---------------------------------------------------- */

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

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

/* ---- Utilities ---------------------------------------------------------- */

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: fixed;
  top: var(--s-3);
  inset-inline-start: var(--s-3);
  z-index: var(--z-skip);
  transform: translateY(-200%);
  background: var(--ink);
  color: var(--paper);
  font-family: var(--font-ui);
  font-size: var(--t-small);
  font-weight: 600;
  padding: var(--s-3) var(--s-5);
  text-decoration: none;
  transition: transform var(--d-fast) var(--ease-out);
}

.skip-link:focus-visible {
  transform: translateY(0);
  color: var(--paper);
}

[hidden] {
  display: none !important;
}
