/* ==========================================================================
   Companion Pathways — theme layer (on top of base.css)
   Palette (DS-2, exactly four):
     #0F1117  Void Ink   — page background, deepest surface
     #C9A96E  Warm Amber — accent, headlines, interactive hover
     #E8E2D9  Parchment  — body text, primary readable copy
     #2A2D38  Slate Dusk — card / nav surfaces, dividers, secondary bg
   Type pairing (DS-6): Fraunces (humanist serif display) + Spectral fallback
   for headlines; Public Sans is not used — body uses a distinctive grotesque.
   ========================================================================== */

@import url("https://fonts.googleapis.com/css2?family=Fraunces:opsz,wght@9..144,400;9..144,500;9..144,600;9..144,700&family=Spline+Sans:wght@400;500;600&display=swap");

:root {
  --ink:       #0F1117;
  --amber:     #C9A96E;
  --parchment: #E8E2D9;
  --slate:     #2A2D38;

  --font-serif: "Fraunces", Georgia, "Times New Roman", serif;
  --font-sans:  "Spline Sans", "Segoe UI", Helvetica, sans-serif;
}

/* --- Base surfaces ------------------------------------------------------ */
html {
  background-color: var(--ink);
}

body {
  background-color: var(--ink);
  color: var(--parchment);
  font-family: var(--font-sans);
  /* CSS-only grain: faint repeating hairline texture, palette colors only */
  background-image:
    radial-gradient(var(--slate) 1px, transparent 1px);
  background-size: 3px 3px;
  background-attachment: fixed;
}

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-serif);
  color: var(--parchment);
  font-weight: 600;
  letter-spacing: -0.01em;
}

a {
  color: var(--amber);
}

a:hover,
a:focus-visible {
  color: var(--parchment);
}

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

::selection {
  background-color: var(--amber);
  color: var(--ink);
}

hr {
  border: none;
  border-top: var(--border-width) solid var(--slate);
  margin-block: var(--space-xl);
}

/* --- Skip link ---------------------------------------------------------- */
.skip-link {
  position: absolute;
  left: var(--space-sm);
  top: -4rem;
  z-index: 20;
  background-color: var(--slate);
  color: var(--parchment);
  padding: var(--space-2xs) var(--space-sm);
  border: var(--border-width) solid var(--amber);
  border-radius: var(--radius-sm);
  transition: top 160ms ease;
}
.skip-link:focus {
  top: var(--space-sm);
}

/* --- Masthead / nav ----------------------------------------------------- */
.masthead {
  border-bottom: var(--border-width) solid var(--slate);
  background-color: var(--ink);
}

.masthead__inner {
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
  padding-block: var(--space-md);
}

@media (min-width: 768px) {
  .masthead__inner {
    flex-direction: row;
    align-items: baseline;
    justify-content: space-between;
  }
}

.brand {
  font-family: var(--font-serif);
  color: var(--parchment);
  font-size: var(--text-xl);
  font-weight: 600;
  letter-spacing: 0.01em;
  text-decoration: none;
  line-height: 1;
}
.brand:hover,
.brand:focus-visible {
  color: var(--amber);
}
.brand small {
  display: block;
  font-family: var(--font-sans);
  font-size: var(--text-xs);
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--amber);
  margin-top: var(--space-3xs);
  font-weight: 500;
}

.nav__list {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-md);
  list-style: none;
  padding: 0;
  margin: 0;
}

.nav__list a {
  font-family: var(--font-sans);
  font-size: var(--text-sm);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  text-decoration: none;
  color: var(--parchment);
  padding-block: var(--space-2xs);
  border-bottom: var(--border-width) solid transparent;
  transition: color 160ms ease, border-color 160ms ease;
}
.nav__list a:hover,
.nav__list a:focus-visible {
  color: var(--amber);
  border-bottom-color: var(--amber);
}
.nav__list a[aria-current="page"] {
  color: var(--amber);
  border-bottom-color: var(--amber);
}

/* --- Footer ------------------------------------------------------------- */
.site-footer {
  border-top: var(--border-width) solid var(--slate);
  margin-top: var(--space-3xl);
  padding-block: var(--space-xl);
  color: var(--parchment);
}
.site-footer p {
  font-size: var(--text-sm);
  color: var(--parchment);
}
.site-footer .footer__mark {
  font-family: var(--font-serif);
  color: var(--amber);
  font-size: var(--text-lg);
}

/* --- Eyebrow / labels --------------------------------------------------- */
.eyebrow {
  font-family: var(--font-sans);
  font-size: var(--text-xs);
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--amber);
  font-weight: 500;
}

/* --- Home hero ---------------------------------------------------------- */
.hero {
  padding-block: var(--space-2xl) var(--space-xl);
  border-bottom: var(--border-width) solid var(--slate);
}
.hero__title {
  font-size: var(--text-4xl);
  line-height: var(--leading-tight);
  max-width: 18ch;
  font-weight: 600;
}
.hero__title em {
  font-style: italic;
  color: var(--amber);
}
.hero__lede {
  max-width: 52ch;
  font-size: var(--text-lg);
  color: var(--parchment);
  line-height: var(--leading-normal);
}

.statement {
  border-left: 2px solid var(--amber);
  padding-left: var(--space-md);
  max-width: var(--measure);
  font-family: var(--font-serif);
  font-style: italic;
  font-size: var(--text-xl);
  line-height: var(--leading-snug);
  color: var(--parchment);
}

/* --- Section heads ------------------------------------------------------ */
.section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--space-md);
  border-bottom: var(--border-width) solid var(--slate);
  padding-bottom: var(--space-sm);
  margin-bottom: var(--space-lg);
}
.section-head h2 {
  font-size: var(--text-2xl);
}

/* --- Editorial index (home + articles list) ----------------------------- */
.index-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
}
.entry {
  border-top: var(--border-width) solid var(--slate);
  padding-block: var(--space-lg);
  display: grid;
  gap: var(--space-xs);
}
.entry:last-child {
  border-bottom: var(--border-width) solid var(--slate);
}
@media (min-width: 768px) {
  .entry {
    grid-template-columns: 4rem 1fr;
    column-gap: var(--space-lg);
    align-items: start;
  }
}
.entry__num {
  font-family: var(--font-serif);
  font-size: var(--text-xl);
  color: var(--amber);
  font-style: italic;
}
.entry__title {
  font-size: var(--text-xl);
  line-height: var(--leading-snug);
}
.entry__title a {
  color: var(--parchment);
  text-decoration: none;
  transition: color 160ms ease;
}
.entry__title a:hover,
.entry__title a:focus-visible {
  color: var(--amber);
}
.entry__desc {
  color: var(--parchment);
  max-width: 60ch;
}
.entry__meta {
  font-family: var(--font-sans);
  font-size: var(--text-xs);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--amber);
}

/* --- Featured block on home --------------------------------------------- */
.feature {
  border: var(--border-width) solid var(--slate);
  background-color: var(--slate);
  padding: var(--space-lg);
  border-radius: var(--radius-md);
}
.feature .eyebrow {
  margin-bottom: var(--space-sm);
  display: block;
}
.feature__title {
  font-size: var(--text-3xl);
  line-height: var(--leading-tight);
}
.feature__title a {
  color: var(--parchment);
  text-decoration: none;
  transition: color 160ms ease;
}
.feature__title a:hover,
.feature__title a:focus-visible {
  color: var(--amber);
}

/* --- Article page ------------------------------------------------------- */
.article-head {
  padding-block: var(--space-2xl) var(--space-lg);
  border-bottom: var(--border-width) solid var(--slate);
}
.article-head .eyebrow {
  display: block;
  margin-bottom: var(--space-sm);
}
.article-body {
  padding-block: var(--space-xl);
}
.article-body :is(h2, h3) {
  color: var(--parchment);
}
.article-body h2 {
  font-size: var(--text-2xl);
}
.article-body h3 {
  font-size: var(--text-xl);
  color: var(--amber);
}
.article-body h4 {
  font-size: var(--text-lg);
  color: var(--amber);
}
.article-body h5 {
  font-size: var(--text-base);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  font-family: var(--font-sans);
  color: var(--amber);
}
.article-body p {
  color: var(--parchment);
}
.article-body p:first-of-type {
  font-size: var(--text-lg);
  line-height: var(--leading-normal);
}

.backlink {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2xs);
  font-family: var(--font-sans);
  font-size: var(--text-sm);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  text-decoration: none;
  color: var(--amber);
}
.backlink::before {
  content: "\2190";
}
.backlink:hover,
.backlink:focus-visible {
  color: var(--parchment);
}

.article-foot {
  border-top: var(--border-width) solid var(--slate);
  padding-top: var(--space-lg);
  margin-top: var(--space-xl);
}

/* --- Thematic page ------------------------------------------------------ */
.manifesto .article-body p:first-of-type::first-letter {
  font-family: var(--font-serif);
  float: left;
  font-size: 3.6em;
  line-height: 0.8;
  padding-right: var(--space-2xs);
  padding-top: var(--space-3xs);
  color: var(--amber);
  font-weight: 600;
}

/* --- Micro-interaction: slow reveal of entries on the index ------------- */
@media (prefers-reduced-motion: no-preference) {
  .reveal {
    opacity: 0;
    transform: translateY(0.75rem);
    animation: rise 700ms ease forwards;
  }
  .reveal:nth-child(2) { animation-delay: 80ms; }
  .reveal:nth-child(3) { animation-delay: 160ms; }
  .reveal:nth-child(4) { animation-delay: 240ms; }
  .reveal:nth-child(5) { animation-delay: 320ms; }
  .reveal:nth-child(6) { animation-delay: 400ms; }

  @keyframes rise {
    to { opacity: 1; transform: translateY(0); }
  }
}

/* ===== Tester fixes — CSS-only burger nav + 320px hardening (no JS) ===== */
.nav-toggle { position:absolute; width:1px; height:1px; opacity:0; pointer-events:none; }
.nav-burger {
  display:none; flex-direction:column; align-items:center; justify-content:center; gap:5px;
  width:2.75rem; height:2.75rem; flex:0 0 auto;
  border-radius:var(--radius-sm); color:var(--parchment);
  transition:color 160ms ease;
}
.nav-burger span { display:block; width:22px; height:2px; background:currentColor; border-radius:2px; transition:transform 200ms ease, opacity 160ms ease; }
.nav-burger:hover { color:var(--amber); }
.nav-toggle:focus-visible ~ .nav-burger { outline:2px solid var(--amber); outline-offset:3px; }
@media (max-width:767px) {
  /* brand + burger share ONE row; the nav drops full-width beneath it */
  .masthead__inner {
    flex-direction:row;
    flex-wrap:wrap;
    align-items:center;
    justify-content:space-between;
    gap:var(--space-xs);
  }
  /* compact brand on mobile so the masthead row stays tight;
     flex-basis 0 lets the brand shrink/wrap its own text instead of
     shoving the burger onto a second line at very narrow widths (~320px) */
  .brand { font-size:var(--text-lg); flex:1 1 0; min-width:0; }
  .brand small { font-size:0.625rem; letter-spacing:0.16em; margin-top:0.15rem; }
  .nav-burger { display:flex; flex:0 0 auto; }
  .site-nav { flex-basis:100%; width:100%; display:none; }
  .nav-toggle:checked ~ .site-nav {
    display:block;
    border-top:var(--border-width) solid var(--slate);
    margin-top:var(--space-3xs);
  }
  .site-nav ul {
    flex-direction:column;
    align-items:stretch;
    gap:0;
    padding-block:var(--space-2xs);
  }
  .nav__list a {
    display:block;
    width:100%;
    padding-block:var(--space-xs);
    border-bottom:var(--border-width) solid transparent;
  }
  .nav-toggle:checked ~ .nav-burger span:nth-child(1){ transform:translateY(7px) rotate(45deg); }
  .nav-toggle:checked ~ .nav-burger span:nth-child(2){ opacity:0; }
  .nav-toggle:checked ~ .nav-burger span:nth-child(3){ transform:translateY(-7px) rotate(-45deg); }
}
@media (max-width:30rem) {
  :root {
    --text-4xl: clamp(1.85rem, 1.2rem + 4.5vw, 2.75rem);
    --text-3xl: clamp(1.55rem, 1.1rem + 3.2vw, 2.25rem);
    --text-2xl: clamp(1.35rem, 1rem + 2.2vw, 1.95rem);
  }
  h1, h2, h3 { hyphens:auto; -webkit-hyphens:auto; }
}
