/* BuildCompared. Spec-sheet look: white paper, slate ink, one color per side of a comparison. */

@font-face {
  font-family: "Archivo";
  src: url("/assets/fonts/archivo.woff2") format("woff2-variations");
  font-weight: 100 900;
  font-stretch: 62% 125%;
  font-display: swap;
}
@font-face {
  font-family: "Source Serif";
  src: url("/assets/fonts/source-serif-4.woff2") format("woff2-variations");
  font-weight: 200 900;
  font-display: swap;
}
@font-face {
  font-family: "Source Serif";
  src: url("/assets/fonts/source-serif-4-italic.woff2") format("woff2-variations");
  font-weight: 200 900;
  font-style: italic;
  font-display: swap;
}

:root {
  color-scheme: light;
  --paper: #ffffff;
  --panel: #eef5f4;
  --ink: #13262b;
  --muted: #52646a;
  --rule: #d2dedc;
  --a: #0b6e79;
  --a-soft: #e2f1f1;
  --b: #c27c0e;
  --b-soft: #fbf0db;
  --b-ink: #8a5606;
  --link: #0b6e79;
  --sans: "Archivo", "Helvetica Neue", Arial, sans-serif;
  --serif: "Source Serif", Georgia, "Times New Roman", serif;
  --shell: 1120px;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: 24px; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--serif);
  font-size: 1.125rem;
  line-height: 1.7;
  font-optical-sizing: auto;
  text-rendering: optimizeLegibility;
}
img, svg { display: block; max-width: 100%; }
a { color: var(--link); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 3px solid var(--a); outline-offset: 2px; border-radius: 2px; }

.shell { width: 100%; max-width: var(--shell); margin: 0 auto; padding: 0 24px; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: -999px; top: 8px; background: var(--ink); color: #fff; padding: 8px 12px; z-index: 10; }
.skip:focus { left: 8px; }

h1, h2, h3, .sans { font-family: var(--sans); color: var(--ink); }
h1 {
  font-size: clamp(2.3rem, 5.2vw, 3.6rem);
  font-weight: 760;
  font-stretch: 82%;
  line-height: 1.02;
  letter-spacing: -0.015em;
  margin: 0 0 18px;
}
h2 {
  font-size: 1.55rem;
  font-weight: 700;
  font-stretch: 88%;
  line-height: 1.2;
  margin: 2.4em 0 0.6em;
}
h3 { font-size: 1.15rem; font-weight: 650; margin: 1.6em 0 0.4em; }
p { margin: 0 0 1em; }

/* Header */
.site-header { border-bottom: 1px solid var(--rule); background: var(--paper); }
.header-row { display: flex; align-items: center; justify-content: space-between; gap: 12px 28px; flex-wrap: wrap; min-height: 68px; }
.brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); font-family: var(--sans); font-size: 1.3rem; font-stretch: 85%; font-weight: 500; letter-spacing: -0.01em; }
.brand b { font-weight: 800; }
.brand-mark { width: 34px; height: 34px; }
.brand-mark .m-a { fill: var(--a); }
.brand-mark .m-b { fill: var(--b); }
.brand-mark .m-a-roof { fill: #07505a; }
.brand-mark .m-b-roof { fill: #8f5a06; }
.brand-mark .m-win { fill: #fff; }
.site-nav { display: flex; gap: 4px 22px; flex-wrap: wrap; font-family: var(--sans); font-size: 0.98rem; }
.site-nav a { color: var(--ink); text-decoration: none; padding: 6px 0; border-bottom: 2px solid transparent; }
.site-nav a:hover, .site-nav a[aria-current="page"] { border-bottom-color: var(--ink); }

/* Comparison head */
.cmp-head { padding: 36px 0 30px; }
.crumbs { font-family: var(--sans); font-size: 0.92rem; color: var(--muted); margin-bottom: 18px; display: flex; gap: 8px; }
.crumbs a { color: var(--muted); }
.lede { font-size: 1.3rem; line-height: 1.55; max-width: 44em; margin-bottom: 18px; }
.meta { font-family: var(--sans); font-size: 0.92rem; color: var(--muted); display: flex; flex-wrap: wrap; gap: 4px 22px; margin: 0; }
.meta a { color: var(--muted); }

/* Versus panels: the signature element */
.versus { display: grid; grid-template-columns: 1fr auto 1fr; align-items: stretch; gap: 0; margin-bottom: 8px; }
.side { padding: 26px 28px 24px; background: var(--panel); border-top: 6px solid; }
.side-a { border-color: var(--a); }
.side-b { border-color: var(--b); }
.side-name { margin: 0 0 6px; font-size: 1.6rem; font-stretch: 80%; font-weight: 760; }
.side-a .side-name { color: var(--a); }
.side-b .side-name { color: var(--b-ink); }
.side-figure { margin: 6px 0 16px; }
.side-figure svg { width: 100%; max-width: 300px; height: auto; margin: 0 auto; }
.side-figure figcaption { font-family: var(--sans); font-size: 0.86rem; color: var(--muted); text-align: center; margin-top: 4px; }
.side-pick { font-size: 1.02rem; line-height: 1.6; margin: 0; }
.side-pick strong { font-family: var(--sans); font-weight: 700; }
.vs { align-self: center; font-family: var(--sans); font-stretch: 75%; font-weight: 800; font-size: 1.1rem; color: var(--muted); padding: 0 14px; }

/* Diagram strokes */
.diagram { --c: var(--a); --c-soft: var(--a-soft); }
.diagram.side-b { --c: var(--b); --c-soft: var(--b-soft); }
.d-wall { fill: #fff; stroke: var(--ink); stroke-width: 2; stroke-linejoin: round; }
.d-detail { fill: var(--panel); stroke: var(--ink); stroke-width: 1.5; }
.d-ground { stroke: var(--ink); stroke-width: 2; }
.d-board { stroke: var(--c); stroke-width: 1.2; opacity: .55; }
.d-roof { fill: var(--c-soft); stroke: none; }
.d-course { stroke: var(--c); stroke-width: 1.4; opacity: .7; }
.d-roof-edge { fill: none; stroke: var(--c); stroke-width: 5; stroke-linejoin: round; stroke-linecap: round; }

/* Body grid with table of contents */
.cmp-body { display: grid; grid-template-columns: 210px minmax(0, 1fr); gap: 56px; padding-top: 30px; padding-bottom: 64px; }
.toc { position: sticky; top: 24px; align-self: start; font-family: var(--sans); font-size: 0.92rem; padding-top: 2.2em; }
.toc-title { font-weight: 700; margin-bottom: 8px; }
.toc ol { list-style: none; margin: 0; padding: 0; border-left: 2px solid var(--rule); }
.toc li a { display: block; padding: 5px 0 5px 14px; margin-left: -2px; border-left: 2px solid transparent; color: var(--muted); text-decoration: none; line-height: 1.35; }
.toc li a:hover { color: var(--ink); border-left-color: var(--ink); }
.cmp-main > h2:first-child { margin-top: 1.2em; }
.prose { max-width: 40em; }

/* Comparison table */
table.compare { width: 100%; border-collapse: collapse; font-family: var(--sans); font-size: 0.98rem; line-height: 1.45; }
table.compare th, table.compare td { padding: 13px 14px; text-align: left; vertical-align: top; border-bottom: 1px solid var(--rule); }
table.compare thead th { font-size: 1.02rem; font-weight: 750; font-stretch: 85%; border-bottom: 0; padding-top: 10px; padding-bottom: 10px; }
table.compare thead th.col-a { color: #fff; background: var(--a); }
table.compare thead th.col-b { color: var(--ink); background: var(--b); }
table.compare thead th.col-src { color: var(--muted); font-weight: 500; font-size: 0.86rem; }
table.compare tbody th { width: 24%; font-weight: 650; }
table.compare td.col-a { background: var(--a-soft); }
table.compare td.col-b { background: var(--b-soft); }
table.compare td.col-src { width: 1%; white-space: nowrap; font-size: 0.86rem; }
table.compare tbody tr:hover th { color: var(--a); }

sup.ref { font-family: var(--sans); font-size: 0.68em; line-height: 0; margin-left: 1px; }
sup.ref a { text-decoration: none; padding: 0 1px; }
sup.ref a:hover { text-decoration: underline; }

/* Permit callout, FAQ, sources */
.permit { margin: 2.6em 0 0; padding: 4px 24px 8px; border-left: 4px solid var(--ink); background: var(--panel); }
.permit h2 { margin-top: 0.8em; font-size: 1.25rem; }
.faq details { border-top: 1px solid var(--rule); }
.faq details:last-child { border-bottom: 1px solid var(--rule); }
.faq summary { cursor: pointer; list-style: none; font-family: var(--sans); font-weight: 650; font-size: 1.08rem; padding: 16px 36px 16px 0; position: relative; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; position: absolute; right: 6px; top: 12px; font-size: 1.5rem; font-weight: 400; color: var(--muted); transition: transform .2s ease; }
.faq details[open] summary::after { transform: rotate(45deg); }
.faq details p { margin: 0 0 18px; }
ol.sources { font-size: 0.98rem; line-height: 1.55; padding-left: 1.4em; }
ol.sources li { margin-bottom: 10px; padding-left: 4px; }
ol.sources li:target { background: var(--a-soft); }
.src-pub { color: var(--muted); }
.disclaimer { font-family: var(--sans); font-size: 0.9rem; color: var(--muted); border-top: 1px solid var(--rule); padding-top: 16px; margin-top: 28px; }

/* Home and hubs */
.home-hero { padding-block: 64px 44px; border-bottom: 1px solid var(--rule); }
.home-hero h1 { max-width: 13em; font-size: clamp(2.5rem, 6vw, 4.4rem); }
.home-hero p { font-size: 1.3rem; line-height: 1.55; max-width: 36em; }
.page-intro { padding-block: 40px 10px; }
.page-intro p { font-size: 1.2rem; max-width: 38em; }
.cat-block { padding-block: 40px 56px; }
.cat-block h2 { margin-top: 0; }
.cmp-list { list-style: none; margin: 0; padding: 0; border-top: 2px solid var(--ink); }
.cmp-list li { border-bottom: 1px solid var(--rule); }
.cmp-list a { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 16px; align-items: baseline; padding: 18px 4px; text-decoration: none; color: var(--ink); }
.cmp-list .cmp-title { font-family: var(--sans); font-size: 1.25rem; font-weight: 700; font-stretch: 85%; }
.cmp-list .cmp-title .pair-a { color: var(--a); }
.cmp-list .cmp-title .pair-b { color: var(--b-ink); }
.cmp-list .cmp-date { font-family: var(--sans); font-size: 0.88rem; color: var(--muted); }
.cmp-list a:hover .cmp-title { text-decoration: underline; text-underline-offset: 4px; }
.principles { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 32px; padding-block: 8px 64px; }
.principles h3 { margin-top: 0; font-size: 1.15rem; }
.principles p { font-size: 1rem; color: var(--muted); margin: 0; }
.principles > div { border-top: 2px solid var(--rule); padding-top: 16px; }

/* Static pages */
.static { padding-block: 40px 64px; }
.static .prose { max-width: 40em; }
.static h1 { margin-bottom: 28px; }
.static li { margin-bottom: 6px; }

/* Footer */
.site-footer { background: var(--panel); border-top: 1px solid var(--rule); font-family: var(--sans); font-size: 0.95rem; color: var(--muted); }
.footer-grid { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); gap: 32px; padding-top: 36px; padding-bottom: 24px; }
.footer-grid p { max-width: 34em; margin-top: 12px; line-height: 1.55; }
.footer-grid nav { display: flex; flex-direction: column; gap: 8px; }
.footer-grid nav a { color: var(--ink); text-decoration: none; }
.footer-grid nav a:hover { text-decoration: underline; }
.brand-small { font-size: 1.1rem; }
.footer-base { padding-top: 14px; padding-bottom: 28px; border-top: 1px solid var(--rule); font-size: 0.85rem; }

/* Responsive */
@media (max-width: 960px) {
  .cmp-body { grid-template-columns: minmax(0, 1fr); gap: 0; }
  .toc { display: none; }
}
@media (max-width: 760px) {
  body { font-size: 1.06rem; }
  .shell { padding: 0 18px; }
  .versus { grid-template-columns: 1fr; gap: 0; }
  .vs { justify-self: center; padding: 8px 0; }
  .side { padding: 20px 20px 18px; }
  .side-figure svg { max-width: 240px; }
  .principles, .footer-grid { grid-template-columns: 1fr; gap: 20px; }

  table.compare thead { display: none; }
  table.compare, table.compare tbody, table.compare tr, table.compare th, table.compare td { display: block; width: auto; }
  table.compare tr { border-top: 2px solid var(--ink); padding: 12px 0 14px; position: relative; }
  table.compare tbody th { width: auto; border: 0; padding: 0 40px 8px 0; font-size: 1.05rem; }
  table.compare td { border: 0; padding: 8px 12px; margin-top: 4px; }
  table.compare td.col-a { border-left: 4px solid var(--a); }
  table.compare td.col-b { border-left: 4px solid var(--b); }
  table.compare td.col-a::before, table.compare td.col-b::before { content: attr(data-label); display: block; font-weight: 700; font-size: 0.85rem; }
  table.compare td.col-a::before { color: var(--a); }
  table.compare td.col-b::before { color: var(--b-ink); }
  table.compare td.col-src { position: absolute; top: 12px; right: 0; padding: 0; margin: 0; width: auto; }
  .cmp-list a { grid-template-columns: 1fr; gap: 2px; }
}
@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; scroll-behavior: auto !important; }
}

/* More color (v3) */
.site-header::before { content: ""; display: block; height: 5px; background: linear-gradient(90deg, var(--a) 0 50%, var(--b) 50% 100%); }
.cmp-head { background: linear-gradient(180deg, var(--panel), var(--paper)); }
.home-hero { background: transparent; }
.home-band { background: var(--panel); border-bottom: 1px solid var(--rule); }
.home-band .home-hero { border-bottom: 0; }
.home-hero h1 { color: var(--ink); }
.home-hero .hl-a { color: var(--a); }
.home-hero .hl-b { color: var(--b); }
.site-footer { background: var(--ink); color: #b7c8cb; border-top: 0; }
.site-footer .brand, .footer-grid nav a { color: #fff; }
.footer-base { border-top-color: rgba(255,255,255,.14); color: #93a7ab; }
.site-footer .brand-mark .m-a { fill: #3fb0b9; }
.site-footer .brand-mark .m-a-roof { fill: #8fd3d8; }
.site-footer .brand-mark .m-b { fill: #f0a933; }
.site-footer .brand-mark .m-b-roof { fill: #f7cf86; }
.site-footer .brand-mark .m-win { fill: var(--ink); }
