/* base.css: the floor every kit page stands on. Link after brand/tokens.css.
   Values come from custom properties (tokens.css), never hard-coded here. */

*, *::before, *::after { box-sizing: border-box; }

html {
  color-scheme: var(--color-scheme, light);
  background-color: var(--color-bg);
  color: var(--color-ink);
  /* No double-tap zoom delay; pinch zoom still works. */
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

@media (pointer: fine) {
  html { overscroll-behavior: none; }
}

body {
  margin: 0;
  min-height: 100svh;
  font-family: var(--font-ui);
  font-size: var(--size-body);
  line-height: 1.55;
  font-kerning: normal;
  background-color: var(--color-bg);
  color: var(--color-ink);
}

img, picture, video, canvas, svg { display: block; max-width: 100%; }
img, video { height: auto; }

h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 400;
  line-height: 1.02;
  letter-spacing: -0.01em;
  margin: 0 0 var(--space-4);
  text-wrap: balance;
}
h1 { font-size: var(--size-title); }
h2 { font-size: clamp(1.75rem, 1rem + 2.4vw, 3rem); }
h3 { font-size: 1.5rem; }
p { margin: 0 0 var(--space-4); max-width: 62ch; text-wrap: pretty; }

/* Anchored targets land below the sticky header, not under it. */
:target, h1, h2, h3, h4, [id] { scroll-margin-top: calc(var(--header-h) + var(--space-4)); }

a { color: inherit; text-decoration-thickness: 1px; text-underline-offset: 0.2em; }
a:hover { color: var(--color-accent); }

button, input, select, textarea { font: inherit; color: inherit; }
/* iOS zooms into inputs under 16px. */
input, select, textarea { font-size: max(16px, 1em); }
select { background-color: var(--color-surface); color: var(--color-ink); }
button { cursor: pointer; }

/* Focus: always visible for keyboard users, never removed without a replacement. */
:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 3px;
}
:focus:not(:focus-visible) { outline: none; }

/* Skip link: first focusable element on every page. */
.skip-link {
  position: fixed;
  top: var(--space-3);
  left: var(--space-3);
  z-index: 1000;
  padding: var(--space-3) var(--space-4);
  background: var(--color-ink);
  color: var(--color-bg);
  text-decoration: none;
  transform: translateY(-200%);
}
.skip-link:focus-visible, .skip-link:focus { transform: none; }

.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  margin: -1px; padding: 0; border: 0;
  overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%);
  white-space: nowrap;
}

/* Site header: thin, quiet, transparent over the hero. It scrolls away with the page rather than
   floating over the copy (and it can never cover a focused element). */
.site-header {
  position: absolute;
  inset: 0 0 auto 0;
  z-index: 50;
  height: var(--header-h);
  padding: 0 max(var(--space-5), env(safe-area-inset-right)) 0 max(var(--space-5), env(safe-area-inset-left));
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-5);
  font-size: var(--size-small);
  pointer-events: none;
}
.site-header > * { pointer-events: auto; }
.wordmark {
  font-family: var(--font-ui);
  font-stretch: 112%;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  min-height: 44px;
}
.site-header nav a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  min-width: 44px;
  padding: 0 var(--space-2);
  text-decoration: none;
}

/* Footer slot: privacy and terms are required on every page (tells #26, #27). */
.site-footer {
  border-top: 1px solid var(--color-line);
  padding: var(--space-7) max(var(--space-5), env(safe-area-inset-left)) calc(var(--space-7) + env(safe-area-inset-bottom));
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-4) var(--space-6);
  justify-content: space-between;
  align-items: baseline;
  font-size: var(--size-small);
  color: var(--color-muted);
}
.site-footer p { margin: 0; }
.site-footer .legal { display: flex; gap: var(--space-2) var(--space-5); flex-wrap: wrap; }
.site-footer .legal a { display: inline-flex; align-items: center; justify-content: center; min-height: 44px; min-width: 44px; padding: 0 var(--space-2); }

/* Plain prose block for the quiet sections between signature moments. */
.prose {
  padding: var(--space-9) max(var(--space-5), env(safe-area-inset-left));
  max-width: 1200px;
  margin: 0 auto;
}
.prose .lead { font-size: var(--size-lead); color: var(--color-ink); }
.muted { color: var(--color-muted); }
.italic { font-style: italic; }

/* The PLACEHOLDER tag used on every demo asset caption. */
.placeholder-tag {
  font-family: var(--font-ui);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: var(--color-accent);
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
  }
}
