/* ============================================================
   Nesting Lab — Global Stylesheet
   Visual language: circa 1900–1920 official record-keeping
   (US Federal Census / England & Wales Census). Typed base
   grid + a distinct hand-annotation layer added by a later
   reader. Signature device: a double-rule frame, drawn directly
   from the concentric rings of the owl-head mark.
   ============================================================ */

/* ---- Fonts -------------------------------------------------
   Self-hosted, not loaded from a third-party CDN — consistent
   with the site's own "we don't track usage" privacy stance.
   Add the actual font files at the paths below; the stack
   degrades gracefully to system fonts until they're in place.
   ------------------------------------------------------------ */

/* 1. Core Typography Engine Registration */
@font-face {
  font-family: "Inter";
  src: url("/assets/fonts/inter-variable.woff2") format("woff2 supports variations"),
       url("/assets/fonts/inter-variable.woff2") format("woff2-variations");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "JetBrains Mono";
  src: url("/assets/fonts/jetbrains-mono-variable.woff2") format("woff2 supports variations"),
       url("/assets/fonts/jetbrains-mono-variable.woff2") format("woff2-variations");
  font-weight: 100 800;
  font-style: normal;
  font-display: swap;
}

/* 2. Structured Global Scopes (Drop the generic <uniquifier> classes) */
body {
  font-family: "Inter", sans-serif;
  font-optical-sizing: auto;
}

code, pre, .data-table {
  font-family: "JetBrains Mono", monospace;
  font-optical-sizing: auto;
}

:root {
  /* Color — derived from the tone statement, adjusted for contrast.
     #7E806B (base olive) is a UI/border tone, not a text color:
     on cream it measures ~4.05:1, which clears large text but
     fails WCAG AA (4.5:1) for body copy. */
  --paper:        #F4F1E9;   /* page background */
  --paper-raised: #FBF9F3;   /* slightly lighter, for framed/table surfaces */
  --ink:          #3C3D27;   /* primary text — same dark olive as the mark, ~11:1 on paper */
  --ink-muted:    #7E806B;   /* rules, borders, secondary chrome — not for body text */
  --rust:         #B7410E;   /* accent: links + the hand-annotation layer, ~5.5:1 on paper */
  --rust-dark:    #8F3309;   /* hover/active state for rust elements */

  --font-body: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;

  --measure: 42rem;
  --wrap: 64rem;
}

/* ---- Reset / base -------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 1rem;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; display: block; }
h1, h2, h3 { font-weight: 700; line-height: 1.15; margin: 0 0 0.6em; }
p { margin: 0 0 1em; }
ul { margin: 0; padding: 0; list-style: none; }

a {
  color: var(--rust);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.15em;
}
a:hover { color: var(--rust-dark); }
a:focus-visible,
button:focus-visible {
  outline: 2px solid var(--rust);
  outline-offset: 3px;
}

.wrap {
  max-width: var(--wrap);
  margin-inline: auto;
  padding-inline: 1.5rem;
}

.skip-link {
  position: absolute;
  left: -999px;
  top: 0;
  background: var(--ink);
  color: var(--paper);
  padding: 0.75rem 1.25rem;
  z-index: 100;
}
.skip-link:focus {
  left: 1rem;
  top: 1rem;
}

/* ---- Header ---------------------------------------------------------- */
.site-header {
  border-bottom: 1.5px solid var(--ink-muted);
  padding-block: 1rem;
}
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  flex-wrap: wrap;
}
.site-mark {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  text-decoration: none;
  color: var(--ink);
}
.site-mark img { width: 40px; height: 40px; }
.site-name {
  font-weight: 700;
  font-size: 1.1rem;
  letter-spacing: 0.02em;
}
.site-header nav ul {
  display: flex;
  gap: 1.5rem;
  flex-wrap: wrap;
}
.site-header nav a {
  color: var(--ink);
  text-decoration: none;
  font-size: 0.95rem;
  border-bottom: 1px solid transparent;
}
.site-header nav a:hover {
  color: var(--rust);
  border-bottom-color: var(--rust);
}
.nav-support {
  font-weight: 700;
}

/* ---- Signature device: the double-rule frame -------------------------
   Echoes the two concentric rings of the owl-head mark. Used to frame
   the positioning statement, and as a horizontal divider between
   major sections. */
.framed {
  border: 1.5px solid var(--ink-muted);
  outline: 1.5px solid var(--ink-muted);
  outline-offset: 6px;
  background: var(--paper-raised);
  padding: 2.25rem clamp(1.25rem, 4vw, 2.75rem);
  margin: 2rem 0.75rem;
}
.divider {
  height: 5px;
  border-top: 1.5px solid var(--ink-muted);
  border-bottom: 1.5px solid var(--ink-muted);
  max-width: var(--wrap);
  margin: 3rem auto;
}

/* ---- Hero -------------------------------------------------------------- */
.hero {
  padding-block: 3.5rem 2.5rem;
  max-width: var(--measure);
}
.eyebrow {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-muted);
  margin-bottom: 0.9em;
}
.hero h1 {
  font-size: clamp(2rem, 4.5vw, 2.75rem);
}
.lede {
  font-size: 1.15rem;
  color: var(--ink);
  max-width: 38rem;
}

/* ---- Positioning statement ---------------------------------------------- */
.positioning .framed { max-width: var(--measure); margin-inline: auto; }
.positioning h2 { font-size: 1.4rem; }
.positioning h3 {
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--ink-muted);
  margin-top: 1.75em;
}
.disclaimer-list {
  font-family: var(--font-mono);
  font-size: 0.95rem;
  border-left: 2px solid var(--rust);
  padding-left: 1rem;
  margin-bottom: 1.25em;
}
.disclaimer-list li { margin-bottom: 0.35em; }
.stark {
  font-style: italic;
  color: var(--ink-muted);
}
.more { margin-top: 1.5em; margin-bottom: 0; }
.more a { text-decoration: none; border-bottom: 1px solid var(--rust); }

/* ---- Field records table ---------------------------------------------- */
.field-log { padding-block: 1rem 2rem; }
.field-log h2 { font-size: 1.4rem; }
table {
  width: 100%;
  border-collapse: collapse;
  font-family: var(--font-mono);
  font-size: 0.9rem;
  margin-top: 1rem;
}
caption {
  text-align: left;
  font-family: var(--font-body);
  font-size: 0.85rem;
  color: var(--ink-muted);
  margin-bottom: 0.6em;
}
th, td {
  text-align: left;
  padding: 0.65rem 0.9rem;
  border-bottom: 1px solid var(--ink-muted);
}
th {
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  border-bottom: 1.5px solid var(--ink);
}
td a { text-decoration: none; border-bottom: 1px solid var(--rust); }
.annotation {
  color: var(--rust);
  font-style: italic;
}

/* ---- Channel / empty state ---------------------------------------------- */
.channel { padding-block: 1rem 3.5rem; }
.channel h2 { font-size: 1.4rem; }
.empty-state {
  font-family: var(--font-mono);
  color: var(--ink-muted);
  border: 1px dashed var(--ink-muted);
  padding: 1.25rem 1.5rem;
  max-width: var(--measure);
}

/* ---- Footer ------------------------------------------------------------- */
.site-footer {
  border-top: 1.5px solid var(--ink-muted);
  padding-block: 2rem;
  margin-top: 1rem;
}
.footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  flex-wrap: wrap;
  font-size: 0.9rem;
}
.footer-mark { font-weight: 700; margin: 0; }
.footer-inner nav ul { display: flex; gap: 1.25rem; }
.footer-inner nav a { color: var(--ink); text-decoration: none; }
.footer-inner nav a:hover { color: var(--rust); }
.footer-copy { color: var(--ink-muted); margin: 0; width: 100%; text-align: center; font-size: 0.8rem; }

/* ---- Responsive ----------------------------------------------------------- */
@media (max-width: 40rem) {
  .header-inner { flex-direction: column; align-items: flex-start; }
  .site-header nav ul { gap: 1rem; }
  .footer-inner { flex-direction: column; align-items: flex-start; }
  .footer-copy { text-align: left; }
  table, thead, tbody, th, td, tr { display: block; }
  thead { display: none; }
  td {
    border-bottom: none;
    padding: 0.2rem 0.9rem;
  }
  tr {
    border-bottom: 1px solid var(--ink-muted);
    padding: 0.75rem 0;
  }
  td::before {
    content: attr(data-label);
    display: block;
    font-family: var(--font-body);
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--ink-muted);
  }
}

/* ---- Motion ----------------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  * { scroll-behavior: auto !important; }
}

.manifest-output {
  background-color: var(--paper-raised);
  border: 1px solid var(--ink-muted);
  padding: 1rem 1.25rem;
  margin: 1.5rem 0;
  max-width: var(--measure);
  font-family: var(--font-mono);
  font-size: 0.88rem;
  line-height: 1.5;
  overflow-x: auto;
  white-space: pre;
}

.back-navigation {
    font-family: "JetBrains Mono", monospace;
    font-size: 0.85rem;
    margin-bottom: 1rem;
}

