/* ============================================================
   Home Renovation Guides — Editorial Design System v2
   Spec: DESIGN.md. Serif display (Fraunces) + humanist sans
   (Public Sans). Warm paper, warm ink, brick accent, forest
   and gold supporting colour. Scroll reveals are JS-applied
   (progressive enhancement) and respect reduced motion.
   ============================================================ */

@font-face {
  font-family: 'Fraunces';
  src: url('/fonts/fraunces.woff2') format('woff2');
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Fraunces';
  src: url('/fonts/fraunces-italic.woff2') format('woff2');
  font-weight: 100 900;
  font-style: italic;
  font-display: swap;
}
@font-face {
  font-family: 'Public Sans';
  src: url('/fonts/public-sans.woff2') format('woff2');
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

:root {
  --paper: #faf7f2;
  --paper-deep: #f1ece3;
  --ink: #1c1a17;
  --ink-soft: #5c564d;
  --brick: #b04a2f;
  --brick-dark: #8f3a24;
  --forest: #2f4a3c;
  --forest-deep: #263d31;
  --line: #e2ddd4;
  --gold: #c89b3c;
  --footer-bg: #221f1b;
  --footer-text: #c9c2b6;
  --radius: 2px;
  --max-width: 1120px;
  --article-width: 720px;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

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

body {
  font-family: 'Public Sans', -apple-system, 'Segoe UI', sans-serif;
  font-size: 1.0625rem;
  line-height: 1.7;
  color: var(--ink);
  background: var(--paper);
  font-optical-sizing: auto;
}

.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 24px;
}

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

/* ---------- Top bar ---------- */
.top-bar {
  background: var(--ink);
  color: var(--footer-text);
  font-size: 0.78rem;
  letter-spacing: 0.04em;
}
.top-bar-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 7px;
  padding-bottom: 7px;
}
.top-bar .dot { color: var(--gold); }

/* ---------- Header ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--paper);
  border-bottom: 1px solid var(--line);
  transition: box-shadow 150ms ease;
}
.site-header.scrolled { box-shadow: 0 4px 14px rgba(28, 26, 23, 0.08); }

.nav-container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 14px;
  padding-bottom: 14px;
  position: relative;
}

.logo {
  font-family: 'Fraunces', serif;
  font-weight: 700;
  font-size: 1.2rem;
  color: var(--ink);
  text-decoration: none;
  letter-spacing: -0.01em;
}

.logo span { color: var(--brick); }

.nav-links {
  display: flex;
  align-items: center;
  gap: 24px;
}

.nav-links a {
  color: var(--ink-soft);
  text-decoration: none;
  font-size: 0.95rem;
  font-weight: 500;
  padding-bottom: 2px;
  border-bottom: 2px solid transparent;
  transition: color 150ms ease, border-color 150ms ease;
}

.nav-links a:hover { color: var(--brick); border-bottom-color: var(--brick); }

.nav-links a.nav-cta {
  background: var(--brick);
  color: var(--paper);
  padding: 9px 18px;
  border-radius: var(--radius);
  border-bottom: none;
  font-weight: 600;
  transition: background 150ms ease;
}
.nav-links a.nav-cta:hover { background: var(--brick-dark); color: var(--paper); }

.mobile-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
}
.mobile-toggle span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--ink);
  margin: 5px 0;
}

/* ---------- Kickers ---------- */
.kicker {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--brick);
}

/* ---------- Homepage hero (asymmetric split) ---------- */
.hero { border-bottom: 1px solid var(--line); }

.hero-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 24px;
  display: grid;
  grid-template-columns: 1.05fr 1fr;
  gap: 56px;
  align-items: stretch;
}

.hero-copy {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 64px 0;
}

.hero .kicker { margin-bottom: 18px; }

.hero h1 {
  font-family: 'Fraunces', serif;
  font-weight: 640;
  font-size: clamp(2.1rem, 4.2vw, 3.2rem);
  line-height: 1.12;
  letter-spacing: -0.01em;
  margin-bottom: 20px;
}

.hero p {
  color: var(--ink-soft);
  font-size: 1.1rem;
  max-width: 46ch;
  margin-bottom: 30px;
}

.hero-actions { display: flex; gap: 14px; flex-wrap: wrap; }

.hero-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
  margin-top: 44px;
  padding-top: 26px;
  border-top: 1px solid var(--line);
}

.stat strong {
  display: block;
  font-family: 'Fraunces', serif;
  font-weight: 600;
  font-size: 1.7rem;
  color: var(--ink);
  line-height: 1.2;
}
.stat span {
  font-size: 0.78rem;
  color: var(--ink-soft);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.hero-media {
  position: relative;
  min-height: 460px;
  background: var(--paper-deep);
}

.hero-media img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.hero-caption {
  position: absolute;
  left: -28px;
  bottom: 40px;
  max-width: 320px;
  background: var(--paper);
  border-left: 3px solid var(--brick);
  padding: 14px 20px;
  font-size: 0.85rem;
  line-height: 1.55;
  color: var(--ink-soft);
  box-shadow: 0 6px 14px rgba(28, 26, 23, 0.08);
}
.hero-caption strong {
  display: block;
  font-family: 'Fraunces', serif;
  color: var(--ink);
  font-size: 0.95rem;
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-block;
  background: var(--brick);
  color: var(--paper);
  text-decoration: none;
  font-weight: 600;
  font-size: 1rem;
  padding: 14px 30px;
  border-radius: var(--radius);
  border: none;
  cursor: pointer;
  font-family: 'Public Sans', sans-serif;
  transition: background 150ms ease;
}
.btn:hover { background: var(--brick-dark); }

.btn-secondary {
  background: transparent;
  color: var(--ink);
  border: 1px solid var(--ink);
  padding: 13px 28px;
}
.btn-secondary:hover { background: var(--ink); color: var(--paper); }

/* ---------- Value band (how it works) ---------- */
.value-band {
  background: var(--forest);
  color: var(--paper);
}
.value-band-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 60px 24px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 44px;
}
.value-step .num {
  font-family: 'Fraunces', serif;
  font-style: italic;
  font-weight: 500;
  font-size: 2.3rem;
  color: var(--gold);
  line-height: 1;
}
.value-step h3 {
  font-family: 'Fraunces', serif;
  font-weight: 600;
  font-size: 1.3rem;
  margin: 12px 0 8px;
  color: var(--paper);
}
.value-step p { color: #cfd8d0; font-size: 0.95rem; }

/* ---------- Section headers (editorial) ---------- */
.section-head {
  padding-top: 56px;
  margin-top: 8px;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  flex-wrap: wrap;
}

.section-head h2 {
  font-family: 'Fraunces', serif;
  font-weight: 600;
  font-size: 1.9rem;
  line-height: 1.2;
  margin-top: 10px;
}

.section-head .section-note {
  color: var(--ink-soft);
  font-size: 0.9rem;
  font-style: italic;
  margin-bottom: 6px;
}

/* ---------- Guide listings (asymmetric editorial rows) ---------- */
.guides-section { padding-bottom: 40px; }

.guide-row {
  display: grid;
  grid-template-columns: 380px 1fr;
  gap: 40px;
  padding: 44px 0;
  border-bottom: 1px solid var(--line);
  text-decoration: none;
  color: inherit;
  align-items: center;
}

.guide-row:first-of-type { padding-top: 30px; }

.guide-row .guide-media {
  aspect-ratio: 4 / 3;
  background: var(--paper-deep);
  overflow: hidden;
}
.guide-row .guide-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: opacity 150ms ease, transform 400ms ease;
}
.guide-row:hover .guide-media img { opacity: 0.94; transform: scale(1.015); }

.guide-index {
  font-family: 'Fraunces', serif;
  font-style: italic;
  font-weight: 500;
  font-size: 1.05rem;
  color: var(--gold);
  margin-bottom: 4px;
}

.guide-row h2 {
  font-family: 'Fraunces', serif;
  font-weight: 600;
  font-size: 1.55rem;
  line-height: 1.2;
  margin: 8px 0 10px;
}
.guide-row:hover h2 { text-decoration: underline; text-decoration-color: var(--brick); text-decoration-thickness: 2px; }

.guide-row p { color: var(--ink-soft); max-width: 58ch; }

.guide-foot {
  display: flex;
  align-items: baseline;
  gap: 26px;
  margin-top: 16px;
  flex-wrap: wrap;
}

.price-range {
  font-family: 'Fraunces', serif;
  font-weight: 560;
  font-size: 1.05rem;
  color: var(--brick);
}

.guide-link {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--ink);
}
.guide-link .arrow {
  display: inline-block;
  color: var(--brick);
  transition: transform 150ms ease;
}
.guide-row:hover .guide-link .arrow { transform: translateX(5px); }

.guide-row:nth-of-type(even) { grid-template-columns: 1fr 380px; }
.guide-row:nth-of-type(even) .guide-media { order: 2; }

/* ---------- Compare band ---------- */
.compare-band {
  background: var(--paper-deep);
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  padding: 64px 0 72px;
}
.compare-band .section-head { padding-top: 0; margin-top: 0; }

table.cost-table {
  width: 100%;
  border-collapse: collapse;
  margin: 30px 0 0;
  font-size: 0.95rem;
  background: var(--paper);
}
table.cost-table th {
  background: var(--ink);
  color: var(--paper);
  text-align: left;
  padding: 12px 16px;
  font-weight: 600;
  font-size: 0.8125rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
table.cost-table td {
  padding: 13px 16px;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
}
table.cost-table td:first-child { font-weight: 600; }
table.cost-table td strong {
  font-family: 'Fraunces', serif;
  font-weight: 560;
  font-size: 1.02em;
}
table.cost-table a {
  color: var(--ink);
  text-decoration: underline;
  text-decoration-color: var(--brick);
  text-decoration-thickness: 2px;
  text-underline-offset: 3px;
  transition: color 150ms ease;
}
table.cost-table a:hover { color: var(--brick); }
table.cost-table tr:hover td { background: var(--paper-deep); }

/* ---------- CTA band ---------- */
.cta-band {
  background: var(--footer-bg);
  color: var(--paper);
  padding: 72px 0;
}
.cta-band .kicker { color: var(--gold); }
.cta-band h2 {
  font-family: 'Fraunces', serif;
  font-weight: 600;
  font-size: clamp(1.7rem, 3vw, 2.2rem);
  margin: 12px 0 12px;
  max-width: 24ch;
}
.cta-band > .container > p { color: var(--footer-text); max-width: 58ch; }

.cta-links {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 30px;
}
.cta-links a {
  color: var(--paper);
  text-decoration: none;
  border: 1px solid #4a453d;
  border-radius: var(--radius);
  padding: 10px 18px;
  font-size: 0.92rem;
  font-weight: 500;
  transition: background 150ms ease, border-color 150ms ease;
}
.cta-links a:hover { background: var(--brick); border-color: var(--brick); }

/* ---------- Article pages ---------- */
.article {
  max-width: var(--article-width);
  margin: 0 auto;
  padding: 56px 24px 80px;
}

.article .article-kicker {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--brick);
  margin-bottom: 14px;
}

.article h1 {
  font-family: 'Fraunces', serif;
  font-weight: 640;
  font-size: clamp(2rem, 5vw, 2.9rem);
  line-height: 1.15;
  letter-spacing: -0.01em;
  margin-bottom: 14px;
}

.article .meta {
  color: var(--ink-soft);
  font-style: italic;
  font-size: 0.95rem;
  padding-bottom: 26px;
  margin-bottom: 30px;
  border-bottom: 1px solid var(--line);
}

.article-media {
  margin: 0 0 34px;
}
.article-media img {
  width: 100%;
  height: auto;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  display: block;
  border-radius: var(--radius);
}

.article h2 {
  font-family: 'Fraunces', serif;
  font-weight: 600;
  font-size: 1.55rem;
  line-height: 1.3;
  margin: 48px 0 14px;
  scroll-margin-top: 110px;
}
.article h2::before {
  content: '';
  display: block;
  width: 36px;
  height: 3px;
  background: var(--brick);
  margin-bottom: 14px;
}

.article h3 {
  font-family: 'Fraunces', serif;
  font-weight: 600;
  font-size: 1.2rem;
  margin: 30px 0 10px;
}

.article p { margin-bottom: 18px; }

.article ul, .article ol { margin: 0 0 18px 24px; }
.article li { margin-bottom: 8px; }

.article a {
  color: var(--ink);
  text-decoration: underline;
  text-decoration-color: var(--brick);
  text-decoration-thickness: 2px;
  text-underline-offset: 3px;
  transition: color 150ms ease, background 150ms ease;
}
.article a:hover { color: var(--brick); }

/* ---------- Magazine spread (pillar articles) ----------
   Applied via .article-spread. Masthead band + overlapping image,
   wide body column + sticky right rail (key numbers + contents). */
.article-spread {
  max-width: 1160px;
  padding-top: 0;
}

.article-spread .article-head {
  background: var(--paper-deep);
  border-bottom: 1px solid var(--line);
  padding: 48px 44px 110px;
  margin-bottom: 0;
}

.article-spread .article-head h1 { margin-bottom: 14px; }

.article-spread .article-head .meta {
  border-bottom: none;
  padding-bottom: 0;
  margin-bottom: 0;
  max-width: 62ch;
}

.article-spread .article-media {
  margin: 30px -44px -170px;
}
.article-spread .article-media img {
  border-radius: var(--radius);
  box-shadow: 0 10px 24px rgba(28, 26, 23, 0.12);
}

.article-spread .article-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 290px;
  gap: 46px;
  padding-top: 118px;
  align-items: start;
}

.article-rail {
  position: sticky;
  top: 128px;
  align-self: start;
  display: grid;
  gap: 30px;
}

/* Key numbers card */
.keybox {
  background: var(--footer-bg);
  border-top: 3px solid var(--gold);
  padding: 24px 24px 12px;
}
.keybox h3 {
  font-family: 'Fraunces', serif;
  font-weight: 600;
  color: var(--paper);
  font-size: 1.02rem;
  margin-bottom: 6px;
}
.keybox dl div {
  padding: 12px 0 10px;
  border-top: 1px solid #3a362f;
}
.keybox dt {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.09em;
  color: var(--footer-text);
}
.keybox dd {
  font-family: 'Fraunces', serif;
  font-weight: 560;
  font-size: 1.2rem;
  color: var(--gold);
  margin: 2px 0 0;
}

/* Rail contents: quiet list, no panel */
.article-rail .toc {
  background: transparent;
  border: none;
  border-top: 2px solid var(--ink);
  padding: 16px 0 0;
  margin: 0;
}
.article-rail .toc ol { columns: 1; }

/* Numbered gold section markers */
.article-spread .article-body { counter-reset: sec; }
.article-spread .article-body > h2 {
  margin-top: 54px;
}
.article-spread .article-body > h2::before {
  content: counter(sec, decimal-leading-zero);
  counter-increment: sec;
  display: block;
  width: auto;
  height: auto;
  background: none;
  font-family: 'Fraunces', serif;
  font-style: italic;
  font-weight: 500;
  font-size: 1rem;
  color: var(--gold);
  margin: 0 0 8px;
}

/* Lede paragraph: drop cap + gold rule */
.article-spread .article-body > p:first-of-type {
  font-size: 1.15rem;
  line-height: 1.65;
  border-left: 3px solid var(--gold);
  padding-left: 20px;
  margin: 8px 0 30px;
}
.article-spread .article-body > p:first-of-type::first-letter {
  font-family: 'Fraunces', serif;
  font-weight: 640;
  font-size: 3.1em;
  line-height: 0.85;
  float: left;
  color: var(--brick);
  padding: 5px 12px 0 0;
}

/* Reading measure for text; wider canvas for tables and tools */
.article-spread .article-body > p,
.article-spread .article-body > ul,
.article-spread .article-body > ol,
.article-spread .article-body > h2,
.article-spread .article-body > h3 {
  max-width: 700px;
}
.article-spread .article-body > table,
.article-spread .article-body > .tool-block,
.article-spread .article-body > .lead-form,
.article-spread .article-body > .faq {
  margin-left: -28px;
  margin-right: -28px;
}
.article-spread .article-body > .notice { max-width: 700px; }

/* ---------- "In this guide" TOC (JS-injected) ---------- */
.toc {
  background: var(--paper-deep);
  border: 1px solid var(--line);
  border-left: 3px solid var(--gold);
  padding: 22px 26px;
  margin: 0 0 36px;
}
.toc-title {
  font-family: 'Fraunces', serif;
  font-weight: 600;
  font-size: 1.05rem;
  margin-bottom: 10px;
}
.toc ol {
  columns: 2;
  column-gap: 36px;
  list-style: none;
  margin: 0;
  counter-reset: toc;
}
.toc li {
  margin-bottom: 7px;
  break-inside: avoid;
  counter-increment: toc;
  font-size: 0.9rem;
  line-height: 1.45;
}
.toc li::before {
  content: counter(toc, decimal-leading-zero);
  font-family: 'Fraunces', serif;
  font-style: italic;
  color: var(--gold);
  margin-right: 9px;
  font-size: 0.85rem;
}
.toc a {
  color: var(--ink-soft);
  text-decoration: none;
  transition: color 150ms ease;
}
.toc a:hover { color: var(--brick); }

/* ---------- Tables (the trust engine) ---------- */
.article table {
  width: 100%;
  border-collapse: collapse;
  margin: 22px 0 28px;
  font-size: 0.95rem;
}

.article th {
  background: var(--ink);
  color: var(--paper);
  text-align: left;
  padding: 12px 14px;
  font-weight: 600;
  font-size: 0.8125rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.article td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
}

.article tr:nth-child(even) td { background: var(--paper-deep); }

.article td:first-child { font-weight: 600; }

/* Prices in serif read as designed, not spreadsheet */
.article td strong {
  font-family: 'Fraunces', serif;
  font-weight: 560;
  font-size: 1.02em;
}

/* ---------- Calculator ("The tool") ---------- */
.tool-block {
  background: var(--paper-deep);
  border: 1px solid var(--line);
  border-top: 3px solid var(--forest);
  border-radius: var(--radius);
  padding: 34px;
  margin: 34px 0;
}

.tool-block h2 { margin-top: 0; }
.tool-block h2::before { display: none; }

.tool-block > p { color: var(--ink-soft); margin-bottom: 8px; }

/* Enhanced layout (applied by script.js): inputs left, result right */
.tool-block.tool-enhanced {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px;
  grid-template-areas:
    "chip   chip"
    "intro  intro"
    "inputs result";
  column-gap: 32px;
}
.tool-enhanced .tool-chip { grid-area: chip; }
.tool-enhanced > p { grid-area: intro; }
.tool-enhanced .tool-inputs { grid-area: inputs; }
.tool-enhanced .tool-result { grid-area: result; }

.tool-chip { margin-bottom: 14px; }
.tool-chip span {
  display: inline-block;
  background: var(--forest);
  color: var(--paper);
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.09em;
  padding: 5px 12px;
  border-radius: var(--radius);
}

.tool-inputs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px 18px;
  margin-top: 16px;
  align-content: start;
}

.tool-field label,
.tool-block label {
  display: block;
  font-weight: 700;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--ink-soft);
  margin: 0 0 7px;
}
.tool-block:not(.tool-enhanced) label { margin-top: 18px; }

.tool-block select {
  width: 100%;
  appearance: none;
  -webkit-appearance: none;
  padding: 12px 38px 12px 14px;
  border: 1px solid #d5cec1;
  border-radius: var(--radius);
  font-size: 0.95rem;
  font-weight: 500;
  font-family: 'Public Sans', sans-serif;
  background-color: var(--paper);
  background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' fill='none' stroke='%23b04a2f' stroke-width='2'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  color: var(--ink);
  cursor: pointer;
  transition: border-color 150ms ease, box-shadow 150ms ease;
}
.tool-block select:hover { border-color: var(--brick); }
.tool-block select:focus {
  outline: none;
  border-color: var(--brick);
  box-shadow: 0 0 0 3px rgba(176, 74, 47, 0.14);
}
.tool-block option { background: var(--paper); color: var(--ink); }

.tool-result {
  margin-top: 24px;
  padding: 22px 24px;
  background: var(--forest);
  border-top: 3px solid var(--gold);
  color: var(--paper);
  border-radius: var(--radius);
  font-size: 0.95rem;
  line-height: 1.6;
  transition: opacity 150ms ease;
}
.tool-enhanced .tool-result { margin-top: 16px; align-self: start; }

.tool-enhanced .tool-result::before {
  content: 'Your 2026 estimate';
  display: block;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--gold);
  padding-bottom: 10px;
  margin-bottom: 12px;
  border-bottom: 1px solid rgba(250, 247, 242, 0.18);
}

.tool-result strong {
  font-family: 'Fraunces', serif;
  font-weight: 560;
  font-size: 1.4rem;
  color: #e6c069;
}
.tool-enhanced .tool-result strong {
  display: block;
  font-size: 1.55rem;
  line-height: 1.3;
  margin: 4px 0 2px;
}

.tool-result small {
  display: block;
  margin-top: 10px;
  color: #cfd8d0;
  font-size: 0.8125rem;
  line-height: 1.55;
}

/* ---------- Callout ---------- */
.notice {
  background: var(--paper-deep);
  border-left: 3px solid var(--gold);
  padding: 16px 20px;
  margin: 22px 0;
  font-size: 0.95rem;
}

/* ---------- FAQ ---------- */
.faq { margin: 20px 0; }

.faq details {
  border-top: 1px solid var(--line);
  padding: 16px 0;
}
.faq details:last-child { border-bottom: 1px solid var(--line); }

.faq summary {
  font-family: 'Fraunces', serif;
  font-weight: 600;
  font-size: 1.125rem;
  cursor: pointer;
  list-style: none;
  position: relative;
  padding-right: 40px;
  transition: color 150ms ease;
}
.faq summary:hover { color: var(--brick); }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: '+';
  position: absolute;
  right: 4px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--brick);
  font-family: 'Public Sans', sans-serif;
  font-size: 1.4rem;
  font-weight: 400;
}
.faq details[open] summary::after { content: '−'; }

.faq details p {
  margin-top: 12px;
  color: var(--ink-soft);
}

/* ---------- Lead form ---------- */
.lead-form {
  background: var(--footer-bg);
  color: var(--paper);
  border-radius: var(--radius);
  border-top: 3px solid var(--brick);
  padding: 40px;
  margin: 44px 0 0;
  scroll-margin-top: 110px;
}

.lead-form h2 {
  font-family: 'Fraunces', serif;
  color: var(--paper);
  margin: 0 0 10px;
}
.lead-form h2::before { display: none; }

.lead-form p { color: var(--footer-text); max-width: 56ch; }

/* ---------- Footer ---------- */
.site-footer {
  background: var(--footer-bg);
  color: var(--footer-text);
  padding: 60px 0 28px;
  font-size: 0.9rem;
}
.article + .site-footer, main + .site-footer { margin-top: 0; }

.footer-top {
  display: grid;
  grid-template-columns: 2.2fr 1fr 1fr 1.4fr;
  gap: 44px;
  padding-bottom: 40px;
  margin-bottom: 26px;
  border-bottom: 1px solid #3a362f;
}

.footer-brand .logo { color: var(--paper); font-size: 1.15rem; }
.footer-brand p {
  margin-top: 14px;
  font-size: 0.9rem;
  max-width: 38ch;
}
.footer-badge {
  display: inline-block;
  margin-top: 16px;
  border: 1px solid #4a453d;
  color: var(--gold);
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.09em;
  padding: 6px 12px;
  border-radius: var(--radius);
}

.site-footer h3 {
  color: var(--paper);
  font-family: 'Fraunces', serif;
  font-weight: 600;
  font-size: 1rem;
  margin-bottom: 14px;
}

.site-footer .footer-top a:not(.logo) {
  color: var(--footer-text);
  text-decoration: none;
  display: block;
  margin-bottom: 9px;
  transition: color 150ms ease;
}
.site-footer .footer-top a:not(.logo):hover { color: var(--gold); }

.footer-note { font-size: 0.85rem; line-height: 1.65; }

.footer-legal {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  color: #8f887b;
  font-size: 0.8125rem;
}

/* ---------- Scroll reveal (classes applied by script.js) ---------- */
.reveal {
  opacity: 0;
  transform: translateY(22px);
  transition: opacity 550ms ease, transform 550ms ease;
}
.reveal.in-view { opacity: 1; transform: none; }
.value-step:nth-child(2).reveal, .stat:nth-child(2).reveal { transition-delay: 90ms; }
.value-step:nth-child(3).reveal, .stat:nth-child(3).reveal { transition-delay: 180ms; }

/* ---------- Responsive ---------- */
@media (max-width: 960px) {
  .hero-inner { grid-template-columns: 1fr; gap: 0; }
  .hero-copy { padding: 44px 0 40px; }
  .hero-media { min-height: 320px; order: -1; margin: 0 -24px; }
  .hero-caption { left: 16px; bottom: 16px; }

  .value-band-inner { grid-template-columns: 1fr; gap: 30px; padding: 44px 24px; }

  .guide-row,
  .guide-row:nth-of-type(even) { grid-template-columns: 1fr; gap: 18px; padding: 32px 0; }
  .guide-row:nth-of-type(even) .guide-media { order: -1; }

  .footer-top { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 1000px) {
  .article-spread .article-layout {
    grid-template-columns: 1fr;
    padding-top: 34px;
  }
  .article-rail {
    position: static;
    order: -1;
  }
  .article-spread .article-head {
    padding: 40px 24px 90px;
  }
  .article-spread .article-media { margin: 24px -24px -130px; }
  .article-spread .article-body > table,
  .article-spread .article-body > .tool-block,
  .article-spread .article-body > .lead-form,
  .article-spread .article-body > .faq {
    margin-left: 0;
    margin-right: 0;
  }
}

@media (max-width: 860px) {
  .top-bar-inner { justify-content: center; }
  .top-bar .top-bar-right { display: none; }

  .nav-links {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--paper);
    border-bottom: 1px solid var(--line);
    flex-direction: column;
    align-items: flex-start;
    padding: 18px 24px;
    gap: 16px;
  }
  .nav-links.open { display: flex; }
  .mobile-toggle { display: block; }
}

@media (max-width: 860px) {
  .tool-block.tool-enhanced {
    grid-template-columns: 1fr;
    grid-template-areas:
      "chip"
      "intro"
      "inputs"
      "result";
  }
}

@media (max-width: 720px) {
  .article { padding: 40px 20px 64px; }

  .tool-block { padding: 24px 20px; }
  .tool-inputs { grid-template-columns: 1fr; }

  .hero-stats { grid-template-columns: 1fr 1fr; gap: 18px; }
  .toc ol { columns: 1; }
  .footer-top { grid-template-columns: 1fr; gap: 30px; }

  /* Tables become stacked key-value cards */
  .article table, .article tbody, .article tr, .article td { display: block; }
  .article thead { display: none; }
  .article tr { border-bottom: 1px solid var(--line); padding: 12px 0; }
  .article tr:nth-child(even) td { background: transparent; }
  .article td { border: none; padding: 4px 0; }

  table.cost-table, table.cost-table tbody, table.cost-table tr, table.cost-table td { display: block; }
  table.cost-table thead { display: none; }
  table.cost-table tr { border-bottom: 1px solid var(--line); padding: 12px 16px; }
  table.cost-table td { border: none; padding: 3px 0; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { transition: none !important; }
  .reveal { opacity: 1 !important; transform: none !important; }
}

/* ---------- Contact form ---------- */
.contact-form h2 { margin-top: 0; }
.contact-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; margin-top: 18px; }
.contact-field { display: flex; flex-direction: column; }
.contact-field:has(textarea) { grid-column: 1 / -1; }
.contact-field label { font-size: 0.78rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.07em; color: var(--ink-soft); margin-bottom: 7px; }
.contact-field input, .contact-field textarea, .contact-field select {
  font-family: 'Public Sans', sans-serif; font-size: 0.95rem; color: var(--ink);
  background: var(--paper); border: 1px solid #d5cec1; border-radius: var(--radius);
  padding: 12px 14px; width: 100%;
}
.contact-field textarea { resize: vertical; min-height: 120px; }
.contact-field input:focus, .contact-field textarea:focus { outline: none; border-color: var(--brick); box-shadow: 0 0 0 3px rgba(176, 74, 47, 0.14); }
.contact-form .btn { margin-top: 18px; }
.contact-smallprint { font-size: 0.8rem; color: var(--ink-soft); margin: 12px 0 0; }
.contact-note { font-size: 0.85rem; color: var(--ink-soft); line-height: 1.6; }
@media (max-width: 720px) { .contact-grid { grid-template-columns: 1fr; } }

/* ---------- Lead capture form ---------- */
.lead-fields { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 18px; }
.lead-fields input {
  font-family: 'Public Sans', sans-serif; font-size: 0.95rem; color: var(--ink);
  background: var(--paper); border: 1px solid #d5cec1; border-radius: var(--radius);
  padding: 12px 14px; flex: 1 1 200px; min-width: 0;
}
.lead-fields input:focus { outline: none; border-color: var(--brick); box-shadow: 0 0 0 3px rgba(176, 74, 47, 0.14); }
.lead-fields .btn { flex: 0 0 auto; }
.lead-form small { display: block; margin-top: 10px; color: var(--footer-text); font-size: 0.8rem; }
