/* ============================================================
   base.css — reset + global typography (DESIGN.md §3, §7)
   ============================================================ */

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-height) + 24px);
}

body {
  background: var(--color-bg);
  color: var(--color-text);
  font-family: var(--font-sans);
  font-size: var(--type-body);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

img,
video {
  display: block;
  max-width: 100%;
  height: auto;
  /* Media treatment (DESIGN.md §5.7) */
  filter: grayscale(1) contrast(1.08);
}

h1,
h2,
h3 {
  font-weight: 700;
  line-height: 1.15;
}

p {
  max-width: 62ch;
}

a {
  color: inherit;
  text-decoration: none;
}

/* Inline links inside body copy (DESIGN.md §5.5) */
p a,
.text-link {
  text-decoration: underline;
  text-underline-offset: 4px;
  text-decoration-thickness: 1px;
  transition: color var(--dur-fast) var(--ease);
}

p a:hover,
.text-link:hover {
  color: var(--color-accent);
}

ul {
  list-style: none;
}

button {
  font: inherit;
  cursor: pointer;
  border: none;
  background: none;
  color: inherit;
}

/* Mono label utility (DESIGN.md §3 — --type-label) */
.label {
  font-family: var(--font-mono);
  font-size: var(--type-label);
  letter-spacing: var(--tracking-label);
  text-transform: uppercase;
  line-height: 1;
}

.label--sm {
  font-size: var(--type-label-sm);
  letter-spacing: var(--tracking-label-sm);
}

.muted {
  color: var(--color-muted);
}

/* Hidden visually but still read by screen readers / search engines */
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

/* Focus & accessibility (DESIGN.md §7) */
:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 4px;
}

.skip-link {
  position: absolute;
  top: -100%;
  left: var(--space-4);
  z-index: 100;
  padding: var(--space-3) var(--space-4);
  background: var(--color-accent);
  color: var(--color-accent-ink);
  font-family: var(--font-mono);
  font-size: var(--type-label);
  text-transform: uppercase;
  letter-spacing: var(--tracking-label);
}

.skip-link:focus {
  top: var(--space-4);
}

/* Reduced motion kills transforms/reveals, keeps color fades (DESIGN.md §6) */
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation: none !important;
    transition-property: color, background-color, border-color, opacity !important;
  }
}
