/* ── Editorial design system — shared across all pages ── */

:root {
  --paper: #ece6d8;
  --paper-2: #e2dccb;
  --ink: #15110c;
  --ink-2: #2a241b;
  --ink-soft: rgba(21, 17, 12, 0.62);
  --ink-faint: rgba(21, 17, 12, 0.38);
  --rule: rgba(21, 17, 12, 0.22);
  --rule-soft: rgba(21, 17, 12, 0.10);
  --accent: #d23a1f;
  --accent-on: #ffffff;
  --halftone-dot: rgba(21, 17, 12, 0.85);

  --serif: "Fraunces", "Times New Roman", serif;
  --slab: "Roboto Slab", "Rockwell", serif;
  --mono: "JetBrains Mono", "SF Mono", ui-monospace, monospace;
  --sans: "Inter", -apple-system, system-ui, sans-serif;

  --headline: var(--serif);
  --headline-weight: 900;
  --headline-tracking: -0.035em;

  --tex: 0;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  line-height: 1.55;
  overflow-x: hidden;
  font-feature-settings: "ss01", "kern";
  position: relative;
}

/* Optional grain — set --tex on body to enable */
body[data-tex]::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 1;
  opacity: calc(var(--tex) * 0.55);
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 320 320'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 0.08  0 0 0 0 0.06  0 0 0 0 0.04  0 0 0 0.55 0'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
  background-size: 320px 320px;
  mix-blend-mode: multiply;
}

a { color: inherit; text-decoration: none; }
::selection { background: var(--accent); color: #fff; }

.wrap { position: relative; z-index: 2; }
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 36px;
}
.container-narrow {
  max-width: 760px;
  margin: 0 auto;
  padding: 0 36px;
}
@media (max-width: 720px) {
  .container, .container-narrow { padding: 0 20px; }
}

/* ── Nav ── */
nav.top {
  position: sticky;
  top: 0;
  z-index: 50;
  background: color-mix(in oklab, var(--paper) 86%, transparent);
  backdrop-filter: blur(8px) saturate(1.1);
  -webkit-backdrop-filter: blur(8px) saturate(1.1);
  border-bottom: 1px solid var(--rule);
}
nav.top .inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 56px;
  gap: 14px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--mono);
  font-size: 14px;
  letter-spacing: 0.02em;
  color: var(--ink);
}
.brand .mark {
  width: 26px; height: 26px;
  display: grid; place-items: center;
  color: var(--ink);
}
.brand .mark svg { width: 100%; height: 100%; display: block; }
.brand b { font-weight: 700; }
.brand i { font-style: italic; color: var(--accent); font-weight: 700; font-family: var(--serif); }

nav.top ul {
  display: flex; gap: 28px; list-style: none;
  font-size: 13px; color: var(--ink-soft);
  font-family: var(--mono);
}
nav.top ul a:hover { color: var(--ink); }
nav.top .cta-mini {
  font-family: var(--mono);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 8px 14px;
  border: 1px solid var(--ink);
  background: var(--ink);
  color: var(--paper);
  border-radius: 999px;
  transition: transform .15s, background .15s;
}
nav.top .cta-mini:hover { transform: translateY(-1px); }

nav.top .burger {
  display: none;
  background: transparent;
  border: 1px solid var(--ink);
  border-radius: 999px;
  padding: 6px 10px;
  font-family: var(--mono);
  font-size: 11px;
  color: var(--ink);
  cursor: pointer;
}
@media (max-width: 720px) {
  nav.top ul {
    display: none;
    position: absolute;
    top: 56px; left: 0; right: 0;
    flex-direction: column;
    background: var(--paper);
    border-bottom: 1px solid var(--rule);
    padding: 14px 24px;
    gap: 14px;
  }
  nav.top ul.open { display: flex; }
  nav.top .burger { display: inline-block; }
}

/* ── Buttons ── */
.btn {
  display: inline-flex; align-items: center; gap: 10px;
  padding: 14px 22px;
  border-radius: 999px;
  font-family: var(--mono);
  font-size: 13px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  cursor: pointer;
  border: 1px solid var(--ink);
  background: var(--ink);
  color: var(--paper);
  transition: transform .15s ease, box-shadow .2s ease, background .15s, color .15s;
  font-weight: 600;
  text-decoration: none;
}
.btn:hover {
  transform: translateY(-2px);
  box-shadow: 4px 4px 0 0 var(--accent);
}
.btn.ghost {
  background: transparent; color: var(--ink);
}
.btn.ghost:hover { box-shadow: 4px 4px 0 0 var(--ink); }
.btn .arrow { display: inline-block; transition: transform .2s; }
.btn:hover .arrow { transform: translateX(3px); }
.btn[disabled] { opacity: 0.55; cursor: progress; pointer-events: none; }

/* ── Section primitives ── */
section { padding: 96px 0; position: relative; }
.section-num {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.18em;
  color: var(--ink-soft);
  text-transform: uppercase;
  display: flex; align-items: center; gap: 12px;
  margin-bottom: 14px;
}
.section-num::before {
  content: ""; width: 28px; height: 1px; background: var(--ink);
}
h2.section-title {
  font-family: var(--headline);
  font-weight: var(--headline-weight);
  font-size: clamp(40px, 6.4vw, 84px);
  line-height: 0.95;
  letter-spacing: var(--headline-tracking);
  margin-bottom: 16px;
  text-wrap: balance;
}
h2.section-title em { font-style: italic; color: var(--accent); }
.section-lede {
  font-family: var(--serif);
  font-size: 19px;
  color: var(--ink-2);
  max-width: 56ch;
  margin-bottom: 56px;
  line-height: 1.45;
}

/* ── Footer ── */
footer.bottom {
  border-top: 1px solid var(--ink);
  padding: 56px 0 36px;
  margin-top: 48px;
}
.footer-headline {
  font-family: var(--headline);
  font-weight: var(--headline-weight);
  font-size: clamp(60px, 11vw, 180px);
  line-height: 0.85;
  letter-spacing: var(--headline-tracking);
  text-align: left;
  color: var(--ink);
  margin-bottom: 36px;
  text-wrap: balance;
}
.footer-headline em { color: var(--accent); font-style: italic; }
.footer-cols {
  display: grid; grid-template-columns: repeat(4, 1fr);
  gap: 28px;
  padding-top: 36px;
  border-top: 1px solid var(--rule);
  font-family: var(--mono);
  font-size: 12px;
  color: var(--ink-soft);
}
.footer-cols h5 {
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ink);
  margin-bottom: 12px;
  font-weight: 700;
}
.footer-cols ul { list-style: none; display: flex; flex-direction: column; gap: 8px; }
.footer-cols a:hover { color: var(--ink); }
.footer-base {
  margin-top: 36px; padding-top: 22px;
  border-top: 1px solid var(--rule);
  display: flex; justify-content: space-between; align-items: center;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-soft);
  flex-wrap: wrap; gap: 12px;
}
@media (max-width: 720px) {
  .footer-cols { grid-template-columns: repeat(2, 1fr); }
}

/* ── Editorial article body (used by subpages) ── */
.article-hero {
  padding: 96px 0 48px;
  border-bottom: 1px solid var(--rule);
}
.article-hero .breadcrumb {
  font-family: var(--mono);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  color: var(--ink-soft);
  margin-bottom: 18px;
}
.article-hero .breadcrumb a:hover { color: var(--ink); }
.article-hero h1 {
  font-family: var(--headline);
  font-weight: var(--headline-weight);
  font-size: clamp(44px, 7.2vw, 96px);
  line-height: 0.95;
  letter-spacing: var(--headline-tracking);
  text-wrap: balance;
  margin-bottom: 22px;
}
.article-hero h1 em { font-style: italic; color: var(--accent); }
.article-hero .lede {
  font-family: var(--serif);
  font-size: clamp(17px, 1.55vw, 21px);
  color: var(--ink-2);
  max-width: 60ch;
  line-height: 1.5;
  margin-bottom: 28px;
}
.article-hero .article-meta {
  font-family: var(--mono);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--ink-soft);
  margin-top: 28px;
}

.article-body { padding: 56px 0 72px; }
.article-body h2 {
  font-family: var(--headline);
  font-weight: 800;
  font-size: clamp(28px, 3vw, 40px);
  letter-spacing: -0.02em;
  line-height: 1.1;
  margin: 56px 0 18px;
}
.article-body h2 em { color: var(--accent); font-style: italic; }
.article-body h3 {
  font-family: var(--headline);
  font-weight: 700;
  font-size: 22px;
  letter-spacing: -0.01em;
  margin: 36px 0 12px;
}
.article-body p {
  font-family: var(--serif);
  font-size: 18px;
  line-height: 1.65;
  color: var(--ink-2);
  margin-bottom: 18px;
}
.article-body ul, .article-body ol {
  margin: 12px 0 24px 0;
  padding-left: 0;
  list-style: none;
}
.article-body li {
  font-family: var(--serif);
  font-size: 17px;
  line-height: 1.6;
  color: var(--ink-2);
  padding: 8px 0 8px 26px;
  border-bottom: 1px solid var(--rule-soft);
  position: relative;
}
.article-body ul li::before {
  content: "→";
  position: absolute; left: 0; top: 8px;
  color: var(--accent);
  font-style: italic; font-weight: 700;
  font-family: var(--serif);
}
.article-body ol { counter-reset: ol; }
.article-body ol li::before {
  counter-increment: ol;
  content: counter(ol, decimal-leading-zero);
  position: absolute; left: 0; top: 8px;
  color: var(--accent);
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 700;
}
.article-body strong { color: var(--ink); font-weight: 700; }
.article-body code {
  font-family: var(--mono);
  font-size: 0.92em;
  background: var(--paper-2);
  padding: 1px 6px;
  border-radius: 3px;
  color: var(--ink);
}
.article-body a {
  color: var(--accent);
  border-bottom: 1px solid color-mix(in oklab, var(--accent) 50%, transparent);
}
.article-body a:hover { border-bottom-color: var(--accent); }

.tldr {
  background: var(--paper-2);
  border-left: 3px solid var(--accent);
  padding: 20px 24px;
  margin: 0 0 40px;
}
.tldr-label {
  display: inline-block;
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 8px;
}
.tldr p {
  font-family: var(--serif);
  color: var(--ink);
  margin: 0;
  line-height: 1.6;
  font-size: 16px;
}
.tldr p + p { margin-top: 10px; }

.article-body .faq-section {
  margin-top: 56px;
  padding-top: 40px;
  border-top: 1px solid var(--rule);
}
.article-body .faq-section h2 { margin-top: 0; }
.article-body details {
  border-bottom: 1px solid var(--rule);
  padding: 0;
}
.article-body details summary {
  cursor: pointer;
  padding: 18px 0;
  font-family: var(--headline);
  font-weight: 700;
  font-size: 19px;
  color: var(--ink);
  list-style: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}
.article-body details summary::-webkit-details-marker { display: none; }
.article-body details summary::after {
  content: "+";
  color: var(--accent);
  font-family: var(--serif);
  font-size: 22px;
  font-style: italic;
  font-weight: 400;
}
.article-body details[open] summary::after { content: "−"; }
.article-body details p {
  padding: 0 0 18px;
  margin: 0;
  font-size: 17px;
}

.compare-table {
  width: 100%;
  border-collapse: collapse;
  margin: 16px 0 32px;
  font-family: var(--mono);
  font-size: 13px;
  border: 1px solid var(--ink);
}
.compare-table th, .compare-table td {
  padding: 12px 14px;
  text-align: left;
  border-bottom: 1px solid var(--rule);
}
.compare-table thead th {
  background: var(--ink); color: var(--paper);
  font-family: var(--mono);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-size: 11px;
  font-weight: 700;
}
.compare-table tbody th {
  font-family: var(--serif);
  font-size: 14px;
  color: var(--ink);
  font-weight: 700;
  background: var(--paper-2);
}
.compare-table tbody td { color: var(--ink-2); }
.compare-table tr:last-child td, .compare-table tr:last-child th { border-bottom: none; }
.compare-table .yes { color: var(--accent); font-weight: 700; }
.compare-table .no { color: var(--ink-faint); }
.compare-table .partial { color: #b5851b; }

.related-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 0;
  margin-top: 24px;
  border: 1px solid var(--ink);
}
.related-grid a {
  display: block;
  padding: 22px 22px;
  background: var(--paper);
  border-right: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
  color: var(--ink);
  transition: background .15s;
  border-bottom-style: none;
}
.related-grid a:hover { background: var(--paper-2); }
.related-grid a strong {
  display: block;
  font-family: var(--headline);
  font-weight: 700;
  font-size: 18px;
  letter-spacing: -0.01em;
  margin-bottom: 4px;
  color: var(--ink);
}
.related-grid a span {
  font-family: var(--serif);
  color: var(--ink-2);
  font-size: 14px;
}

.article-cta {
  background: var(--paper-2);
  border: 1px solid var(--ink);
  padding: 36px 32px;
  margin: 56px 0 0;
  text-align: left;
}
.article-cta h3 {
  font-family: var(--headline);
  font-weight: 800;
  font-size: clamp(26px, 3vw, 36px);
  letter-spacing: -0.02em;
  margin-bottom: 10px;
}
.article-cta h3 em { color: var(--accent); font-style: italic; }
.article-cta p {
  font-family: var(--serif);
  color: var(--ink-2);
  margin-bottom: 20px;
  font-size: 17px;
}

/* ── Halftone helper ── */
.halftone-bg {
  background-image:
    radial-gradient(var(--halftone-dot) 1.2px, transparent 1.6px),
    radial-gradient(var(--halftone-dot) 0.8px, transparent 1.2px);
  background-size: 8px 8px, 14px 14px;
  background-position: 0 0, 4px 7px;
  opacity: 0.8;
}

/* Marquee divider */
.marquee {
  background: var(--ink);
  color: var(--paper);
  padding: 14px 0;
  overflow: hidden;
  border-top: 1px solid var(--ink);
  border-bottom: 1px solid var(--ink);
  position: relative;
}
.marquee-track {
  display: inline-flex; gap: 40px;
  font-family: var(--headline);
  font-weight: 800;
  font-style: italic;
  font-size: 28px;
  letter-spacing: -0.02em;
  white-space: nowrap;
  animation: ticker 40s linear infinite;
}
.marquee-track > span { display: inline-flex; align-items: center; gap: 40px; }
.marquee-track > span::after {
  content: "✸"; color: var(--accent); font-size: 22px; font-style: normal;
}
@keyframes ticker {
  from { transform: translateX(0); }
  to { transform: translateX(-50%); }
}
