/* ==========================================
   BASE — reset, typography, shared layout
   ========================================== */

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

html {
  background: var(--bg);
  color: var(--text);
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

@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;
    scroll-behavior: auto !important;
  }
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: var(--step-0);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}

h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 600;
  line-height: 1.15;
  letter-spacing: -0.01em;
  color: var(--text);
}

h1 { font-size: var(--step-4); }
h2 { font-size: var(--step-3); }
h3 { font-size: var(--step-2); }
h4 { font-size: var(--step-1); font-family: var(--font-body); font-weight: 600; }

p {
  color: var(--text-dim);
  margin-bottom: 1rem;
}

p:last-child { margin-bottom: 0; }

a {
  color: var(--accent);
  text-decoration: none;
}
a:hover { color: var(--text); }

ul, ol { list-style: none; }

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

code, pre, kbd {
  font-family: var(--font-mono);
  font-size: 0.9em;
}

button, input, textarea {
  font-family: inherit;
  color: inherit;
}

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

/* ---- Shared layout primitives ---- */
.wrap {
  max-width: var(--content-w);
  margin: 0 auto;
  padding: 0 var(--gutter);
}

.prose {
  max-width: var(--text-w);
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.5em;
  font-family: var(--font-mono);
  font-size: var(--step--1);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
}

.eyebrow::before {
  content: '';
  width: 16px;
  height: 1px;
  background: var(--accent);
}

.hairline {
  border: none;
  border-top: 1px solid var(--line);
}

.section {
  padding-block: clamp(3.5rem, 8vw, 7rem);
  border-top: 1px solid var(--line);
}

.section:first-of-type { border-top: none; }

.section-head {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-bottom: clamp(2rem, 5vw, 3.5rem);
}

.section-head__meta {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 1rem;
}

.section-head p {
  max-width: 60ch;
}

/* ---- Buttons ---- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5em;
  font-family: var(--font-mono);
  font-size: var(--step--1);
  letter-spacing: 0.02em;
  padding: 0.7em 1.3em;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--text);
  cursor: pointer;
  transition: border-color var(--dur-fast) var(--ease), background var(--dur-fast) var(--ease), color var(--dur-fast) var(--ease);
}

.btn:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.btn--primary {
  background: var(--accent);
  border-color: var(--accent);
  color: #0a0d12;
  font-weight: 600;
}

.btn--primary:hover {
  background: var(--text);
  border-color: var(--text);
  color: #0a0d12;
}

/* ---- Tags / pills ---- */
.tag {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.03em;
  padding: 0.3em 0.6em;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  color: var(--text-dim);
}

/* ---- Skip link ---- */
.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--accent);
  color: #0a0d12;
  padding: 0.75rem 1.25rem;
  z-index: 2000;
  font-family: var(--font-mono);
  font-size: var(--step--1);
}
.skip-link:focus {
  left: 1rem;
  top: 1rem;
}

/* ---- Footer ---- */
.site-footer {
  border-top: 1px solid var(--line);
  padding-block: 2.5rem;
}

.site-footer .wrap {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
}

.site-footer small {
  font-family: var(--font-mono);
  font-size: var(--step--1);
  color: var(--text-faint);
}

.footer-links {
  display: flex;
  gap: 1.5rem;
  font-family: var(--font-mono);
  font-size: var(--step--1);
}

.footer-links a { margin-left: 1.5rem; }
.footer-links a:first-child { margin-left: 0; }

.footer-links a { color: var(--text-dim); }
.footer-links a:hover { color: var(--accent); }
