/* ============================================================
   VORUS — article / research-note stylesheet
   Shared by every page under /articles. Reuses the homepage
   design tokens (see index.html) so notes read as the same
   publication. Aesthetic: annotated research note.
   ============================================================ */
:root {
  --paper:      #F4F1E8;
  --paper-alt:  #ECE7DA;
  --paper-deep: #E3DCCB;
  --stone:      #A1947C;
  --line:       #D6CDBA;
  --sage:       #586B4D;
  --sage-mid:   #7C8A6B;
  --ink:        #2A2823;
  --ink-soft:   #5C584E;

  --font-display: "Space Grotesk", system-ui, sans-serif;
  --font-body:    "Inter", system-ui, sans-serif;
  --font-mono:    "Space Mono", ui-monospace, monospace;

  --maxw: 1120px;
  --measure: 68ch;
  --gutter: clamp(1.25rem, 5vw, 4rem);
  --radius: 14px;
  --ease: cubic-bezier(0.22, 0.61, 0.36, 1);
}

/* ---------- reset / base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: clamp(1rem, 0.96rem + 0.2vw, 1.075rem);
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

/* Grain overlay — matches homepage texture */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  opacity: 0.4;
  mix-blend-mode: multiply;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.5'/%3E%3C/svg%3E");
}

img { max-width: 100%; display: block; }
a { color: inherit; }

h1, h2, h3 { font-family: var(--font-display); font-weight: 600; line-height: 1.1; letter-spacing: -0.02em; margin: 0; }

.wrap { width: 100%; max-width: var(--maxw); margin-inline: auto; padding-inline: var(--gutter); position: relative; z-index: 1; }

/* mono eyebrow — the recurring "field note" device */
.eyebrow {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--sage);
  margin: 0 0 1.1rem;
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
}
.eyebrow::before {
  content: "";
  width: 1.6rem;
  height: 1px;
  background: var(--sage);
  display: inline-block;
}

/* ---------- accessibility helpers ---------- */
.skip-link {
  position: absolute; left: 0.5rem; top: -3rem;
  background: var(--ink); color: var(--paper);
  padding: 0.6rem 1rem; border-radius: 8px; z-index: 100;
  font-family: var(--font-mono); font-size: 0.8rem;
  transition: top 0.2s var(--ease);
}
.skip-link:focus { top: 0.5rem; }
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
:focus-visible { outline: 2.5px solid var(--sage); outline-offset: 3px; border-radius: 4px; }

/* ============================================================
   HEADER / NAV — shared with homepage
   ============================================================ */
.site-header {
  position: sticky; top: 0; z-index: 40;
  backdrop-filter: blur(8px);
  background: color-mix(in srgb, var(--paper) 82%, transparent);
  border-bottom: 1px solid var(--line);
}
.nav {
  display: flex; align-items: center; justify-content: space-between;
  padding-block: 1.05rem;
}
.brand {
  font-family: var(--font-display); font-weight: 700; font-size: 1.3rem;
  letter-spacing: 0.02em; text-decoration: none; color: var(--ink);
  display: inline-flex; align-items: center; gap: 0.55rem;
}
.brand-mark {
  width: 26px; height: 26px; border-radius: 7px; background: var(--sage);
  display: grid; place-items: center; flex: none;
}
.brand-mark svg { width: 16px; height: 16px; }
.nav-links { display: flex; gap: 2rem; align-items: center; }
.nav-links a {
  font-family: var(--font-mono); font-size: 0.78rem; letter-spacing: 0.08em;
  text-transform: uppercase; text-decoration: none; color: var(--ink-soft);
  transition: color 0.2s var(--ease);
}
.nav-links a:hover, .nav-links a[aria-current="page"] { color: var(--sage); }
.nav-cta {
  font-family: var(--font-mono); font-size: 0.78rem; letter-spacing: 0.06em;
  text-transform: uppercase; text-decoration: none;
  color: var(--paper); background: var(--ink);
  padding: 0.55rem 1rem; border-radius: 50px;
  transition: background 0.2s var(--ease);
}
.nav-cta:hover { background: var(--sage); }
@media (max-width: 720px) {
  .nav-links a:not(.nav-cta) { display: none; }
}

/* ============================================================
   ARTICLE LISTING (/articles/index.html)
   ============================================================ */
.list-hero { padding-block: clamp(3rem, 8vh, 5.5rem) clamp(2rem, 5vh, 3rem); }
.list-hero h1 { font-size: clamp(2.4rem, 1.6rem + 3.4vw, 4rem); margin-bottom: 1.2rem; max-width: 18ch; }
.list-hero .lede { color: var(--ink-soft); font-size: clamp(1.05rem, 1rem + 0.5vw, 1.3rem); max-width: 52ch; margin: 0; }

.note-list { display: grid; gap: 0; border-top: 1px solid var(--line); margin-bottom: clamp(3rem, 8vh, 6rem); }
.note-card {
  display: grid; grid-template-columns: minmax(0, 0.32fr) minmax(0, 1fr);
  gap: clamp(1rem, 4vw, 3rem); align-items: baseline;
  padding-block: clamp(1.8rem, 4vw, 2.6rem);
  border-bottom: 1px solid var(--line);
  text-decoration: none; color: inherit;
  transition: background 0.25s var(--ease);
}
.note-card:hover { background: color-mix(in srgb, var(--sage) 6%, transparent); }
.note-meta { font-family: var(--font-mono); font-size: 0.72rem; letter-spacing: 0.08em; color: var(--stone); text-transform: uppercase; line-height: 1.8; }
.note-meta .tag { color: var(--sage); display: block; }
.note-body h2 { font-size: clamp(1.3rem, 1.1rem + 1vw, 1.85rem); margin-bottom: 0.6rem; transition: color 0.2s var(--ease); }
.note-card:hover .note-body h2 { color: var(--sage); }
.note-body p { margin: 0; color: var(--ink-soft); font-size: 1rem; max-width: 60ch; }
.note-arrow { font-family: var(--font-mono); color: var(--sage); margin-left: 0.4rem; }
@media (max-width: 640px) {
  .note-card { grid-template-columns: 1fr; gap: 0.7rem; }
}

/* ============================================================
   ARTICLE BODY (single research note)
   ============================================================ */
.article-head { padding-block: clamp(3rem, 8vh, 5rem) clamp(1.5rem, 4vh, 2.5rem); }
.article-head .kicker {
  font-family: var(--font-mono); font-size: 0.72rem; letter-spacing: 0.14em;
  text-transform: uppercase; color: var(--stone); margin: 0 0 1.4rem;
  display: flex; flex-wrap: wrap; gap: 0.4rem 1.2rem;
}
.article-head .kicker .tag { color: var(--sage); }
.article-head h1 {
  font-size: clamp(2.1rem, 1.4rem + 3.2vw, 3.6rem);
  max-width: 20ch; margin-bottom: 1.4rem;
}
.article-head .standfirst {
  font-family: var(--font-body); font-size: clamp(1.1rem, 1rem + 0.6vw, 1.4rem);
  color: var(--ink-soft); line-height: 1.5; max-width: 46ch; margin: 0;
  font-weight: 400;
}
.article-head .byline {
  margin-top: 1.8rem; padding-top: 1.4rem; border-top: 1px solid var(--line);
  font-family: var(--font-mono); font-size: 0.74rem; letter-spacing: 0.04em;
  color: var(--stone); display: flex; flex-wrap: wrap; gap: 0.4rem 1.4rem;
}

.prose { max-width: var(--measure); padding-bottom: clamp(3rem, 8vh, 5rem); }
.prose > * + * { margin-top: 1.4rem; }
.prose h2 {
  font-size: clamp(1.45rem, 1.2rem + 1.2vw, 2rem);
  margin-top: 3rem; margin-bottom: 0.2rem; scroll-margin-top: 5rem;
}
.prose h3 { font-size: 1.2rem; margin-top: 2.2rem; }
.prose p { color: var(--ink); }
.prose a:not(.btn) { color: var(--sage); text-underline-offset: 3px; text-decoration-thickness: 1px; }
.prose strong { font-weight: 600; }
.prose ul, .prose ol { padding-left: 1.3rem; margin-block: 1.4rem; }
.prose li { margin-bottom: 0.6rem; }
.prose li::marker { color: var(--sage); }

/* lede paragraph immediately after head */
.prose .lead { font-size: 1.12rem; color: var(--ink-soft); }

/* pull device — the "what we did with this" annotation */
.annot {
  border-left: 2px solid var(--sage); padding: 0.2rem 0 0.2rem 1.2rem;
  font-family: var(--font-mono); font-size: 0.86rem; line-height: 1.7;
  color: var(--ink);
}
.annot .label { color: var(--sage); text-transform: uppercase; letter-spacing: 0.1em; font-size: 0.7rem; display: block; margin-bottom: 0.4rem; }

/* verdict / bottom-line box */
.verdict {
  background: var(--paper-deep); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 1.6rem 1.7rem; margin-top: 2.2rem;
}
.verdict .eyebrow { margin-bottom: 0.7rem; }
.verdict p { margin: 0; }

/* inline reference superscripts */
.ref { font-family: var(--font-mono); font-size: 0.7em; color: var(--sage); font-weight: 700; vertical-align: super; line-height: 0; text-decoration: none; }
.ref:hover { text-decoration: underline; }

/* confidence chip */
.confidence {
  display: inline-flex; align-items: center; gap: 0.5rem;
  font-family: var(--font-mono); font-size: 0.68rem; letter-spacing: 0.1em;
  text-transform: uppercase; color: var(--ink-soft);
}
.confidence .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--sage); }
.confidence.low .dot   { background: var(--stone); }
.confidence.med .dot   { background: var(--sage-mid); }
.confidence.high .dot  { background: var(--sage); }

/* references list */
.references { max-width: var(--measure); margin-top: clamp(2.5rem, 6vh, 4rem); padding-top: 2rem; border-top: 1px solid var(--line); }
.references h2 { font-size: 1.1rem; font-family: var(--font-mono); letter-spacing: 0.06em; text-transform: uppercase; color: var(--sage); margin-bottom: 1.4rem; }
.references ol { list-style: none; counter-reset: ref; padding: 0; margin: 0; }
.references li {
  counter-increment: ref; position: relative; padding-left: 2.4rem;
  font-size: 0.88rem; color: var(--ink-soft); line-height: 1.6; margin-bottom: 1rem;
}
.references li::before {
  content: counter(ref); position: absolute; left: 0; top: 0;
  font-family: var(--font-mono); font-size: 0.74rem; font-weight: 700; color: var(--sage);
}
.references a { color: var(--sage); word-break: break-word; }

/* back / next nav at foot of an article */
.article-foot { max-width: var(--measure); margin-top: clamp(2.5rem, 6vh, 4rem); }
.article-foot .btn-back {
  font-family: var(--font-mono); font-size: 0.76rem; letter-spacing: 0.06em;
  text-transform: uppercase; text-decoration: none; color: var(--sage);
  display: inline-flex; align-items: center; gap: 0.5rem;
}
.article-foot .btn-back:hover { color: var(--ink); }

/* shared button (CTA reuse) */
.btn {
  font-family: var(--font-mono); font-size: 0.78rem; letter-spacing: 0.06em;
  text-transform: uppercase; white-space: nowrap; cursor: pointer;
  border: 0; border-radius: 50px; color: var(--paper); background: var(--sage);
  padding: 0.7rem 1.3rem; transition: background 0.2s var(--ease);
  text-decoration: none; display: inline-block;
}
.btn:hover { background: var(--ink); }

/* ============================================================
   FOOTER — shared with homepage
   ============================================================ */
.site-footer { padding-block: clamp(3rem, 7vw, 5rem) 2.5rem; margin-top: clamp(3rem, 8vh, 6rem); border-top: 1px solid var(--line); }
.footer-top { display: flex; flex-wrap: wrap; gap: 2rem; justify-content: space-between; align-items: flex-start; }
.footer-word {
  font-family: var(--font-display); font-weight: 700;
  font-size: clamp(2.5rem, 9vw, 5rem); letter-spacing: -0.03em;
  line-height: 0.9; color: var(--ink); margin: 0;
}
.footer-word .dot { color: var(--sage); }
.footer-links { display: flex; flex-wrap: wrap; gap: 1.4rem; }
.footer-links a {
  font-family: var(--font-mono); font-size: 0.74rem; letter-spacing: 0.08em;
  text-transform: uppercase; text-decoration: none; color: var(--ink-soft);
  transition: color 0.2s var(--ease);
}
.footer-links a:hover { color: var(--sage); }
.footer-base {
  margin-top: 2.5rem; padding-top: 1.5rem; border-top: 1px solid var(--line);
  display: flex; flex-wrap: wrap; gap: 0.6rem 1.5rem; justify-content: space-between;
  font-family: var(--font-mono); font-size: 0.72rem; color: var(--stone);
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}
