/* ============================================================
   base.css — the only place these values are defined.
   Load on every page. Page-specific CSS goes in its own file.
   ============================================================ */

/* ---- 1. Tokens ------------------------------------------- */

:root {
  /* Surfaces + ink */
  --bg:         #f4f4f0;
  --bg-raised:  #ffffff;
  --ink:        #111111;
  --ink-soft:   #555555;
  --ink-faint:  #8a8a84;
  --line:       #111111;
  --line-soft:  #cfcfc7;
  --accent:     #ff8200;
  --accent-ink: #111111;   /* text laid on top of accent */
  --shadow:     #111111;   /* hard offset shadow color */

  /* Type */
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", "Helvetica Neue", Arial, sans-serif;
  --mono: "SFMono-Regular", ui-monospace, Consolas, "Liberation Mono", Menlo, monospace;

  --text-xs:   0.75rem;
  --text-sm:   0.8125rem;
  --text-base: 1rem;
  --text-lg:   1.125rem;
  --text-xl:   clamp(1.25rem, 1rem + 1vw, 1.5rem);
  --text-2xl:  clamp(1.75rem, 1.2rem + 2.5vw, 2.5rem);
  --text-3xl:  clamp(2.75rem, 1.5rem + 6vw, 5rem);

  /* Rhythm — one scale, used everywhere */
  --s1: 0.25rem;
  --s2: 0.5rem;
  --s3: 0.75rem;
  --s4: 1rem;
  --s5: 1.5rem;
  --s6: 2rem;
  --s7: 3rem;
  --s8: 4rem;

  /* Structure */
  --shell:   920px;
  --border:  2px;
  --border-thick: 3px;
}

/* ---- 2. Reset -------------------------------------------- */

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

* { margin: 0; padding: 0; }

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  background-color: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: var(--text-base);
  line-height: 1.6;
  padding: var(--s5) var(--s4) var(--s8);
  max-width: var(--shell);
  margin: 0 auto;
  min-height: 100vh;
}

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

/* The engineering grid. */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background-image:
    linear-gradient(var(--line-soft) 1px, transparent 1px),
    linear-gradient(90deg, var(--line-soft) 1px, transparent 1px);
  background-size: 20px 20px;
  opacity: 0.55;
}

/* ---- 3. Type --------------------------------------------- */

h1, h2, h3 {
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.05;
  text-transform: uppercase;
  text-wrap: balance;
}

h1 { font-size: var(--text-3xl); }
h2 { font-size: var(--text-2xl); }
h3 { font-size: var(--text-xl); letter-spacing: -0.02em; }

a { color: inherit; }

/* Mono uppercase label. Dates, section headers, counts. */
.eyebrow {
  font-family: var(--mono);
  font-size: var(--text-xs);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--ink-soft);
}

/* Short accent bar. Anchors a heading. */
.rule {
  width: 72px;
  height: 6px;
  background: var(--accent);
  border: 0;
}

/* ---- 4. Focus + skip link -------------------------------- */

:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 3px;
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: var(--s2);
  background: var(--ink);
  color: var(--bg);
  padding: var(--s2) var(--s4);
  font-family: var(--mono);
  font-size: var(--text-sm);
  text-decoration: none;
  z-index: 100;
}
.skip-link:focus { left: var(--s4); }

/* ---- 5. Top bar + nav (every page) ----------------------- */

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--s4);
  flex-wrap: wrap;
  padding-bottom: var(--s4);
  margin-bottom: var(--s6);
  border-bottom: var(--border) solid var(--line);
}

.brand {
  display: flex;
  align-items: center;
  gap: var(--s3);
  text-decoration: none;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: -0.02em;
  font-size: var(--text-lg);
}
.brand img { width: 34px; }
.brand:hover { color: var(--accent); }

/* Primary nav. On every page, so both halves of the site are always
   one click away — that's what tells people what this site is. */
.nav {
  display: flex;
  gap: var(--s5);
  font-family: var(--mono);
  font-size: var(--text-sm);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.nav a {
  text-decoration: none;
  padding-bottom: 3px;
  border-bottom: var(--border) solid transparent;
}
.nav a:hover { color: var(--accent); border-bottom-color: var(--accent); }
.nav a[aria-current="page"] { border-bottom-color: var(--ink); }

/* ---- 6. Buttons ------------------------------------------ */

.btn {
  font-family: var(--mono);
  font-size: var(--text-sm);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  text-decoration: none;
  display: inline-block;
  padding: var(--s3) var(--s5);
  border: var(--border) solid var(--line);
  background: transparent;
  color: var(--ink);
  cursor: pointer;
  transition: transform 0.15s, box-shadow 0.15s, background-color 0.15s;
}

.btn--solid { background: var(--ink); color: var(--bg); }

.btn:hover {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--accent-ink);
  transform: translate(-2px, -2px);
  box-shadow: 4px 4px 0 var(--shadow);
}

.btn-row {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s3);
}

/* ---- 7. Tags --------------------------------------------- */

.tag {
  font-family: var(--mono);
  font-size: var(--text-xs);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--ink-soft);
  border: 1px solid var(--line-soft);
  padding: 2px var(--s2);
  white-space: nowrap;
}

.tag-row {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s2);
}

/* ---- 8. Panel — the bordered, hard-shadowed box ----------- */

.panel {
  background: var(--bg-raised);
  border: var(--border-thick) solid var(--line);
  box-shadow: 6px 6px 0 var(--shadow);
  padding: var(--s6);
}

@media (max-width: 600px) {
  .panel { padding: var(--s5); box-shadow: 4px 4px 0 var(--shadow); }
}

/* ---- 9. Footer ------------------------------------------- */

.site-footer {
  margin-top: var(--s8);
  padding-top: var(--s5);
  border-top: var(--border) solid var(--line-soft);
  display: flex;
  flex-wrap: wrap;
  gap: var(--s4);
  justify-content: space-between;
  font-family: var(--mono);
  font-size: var(--text-xs);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--ink-soft);
}

.site-footer a { text-decoration: none; border-bottom: 1px solid var(--line-soft); }
.site-footer a:hover { color: var(--accent); border-bottom-color: var(--accent); }

/* ---- 10. Motion + print ---------------------------------- */

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}

@media print {
  body::before { display: none; }
  body { max-width: none; }
}
