/* ============================================================
   ECOLOGIC SPRAY FOAM — Design System v1.0
   Direction: Technical Authority — Blueprint Steel (light)
   Precision-instrument aesthetic on drafting-paper light. Verified numbers as
   design elements. Everything visible without JS (CSS-first
   reveal per cloudflare-pages-deploy-pattern).
   ============================================================ */

/* ---------- Tokens ---------- */
:root {
  /* Base / surface */
  --bg: #F4F7FA;
  --surface: #FFFFFF;
  --surface-2: #FFFFFF;
  --alt: #E9EFF5;
  --border: #D6E0EB;
  --border-strong: #B7C6D8;

  /* Text */
  --text: #0F1D2E;
  --text-2: #425468;
  --muted: #5F7286;

  /* Primary — trust blue */
  --primary: #1C517F;
  --primary-2: #2C6CA6;
  --on-primary: #FFFFFF;

  /* Verified-value green (ONLY for verified numbers/marks) */
  --verify: #0C7A4C;

  /* Accent — CTAs and highlights */
  --accent: #E08A1E;
  --on-accent: #1B1304;

  /* Blueprint grid + shadow */
  --grid: rgba(28, 81, 127, 0.10);
  --shadow: 0 1px 2px rgba(15,29,46,.06), 0 8px 24px rgba(15,29,46,.06);

  /* Type */
  --font-display: "Archivo", "Helvetica Neue", Arial, sans-serif;
  --font-body: "Archivo", "Helvetica Neue", Arial, sans-serif;
  --font-mono: "IBM Plex Mono", ui-monospace, "SF Mono", Menlo, Consolas, monospace;

  /* Scale */
  --text-xs: 0.75rem;
  --text-sm: 0.875rem;
  --text-base: 1.0625rem;
  --text-lg: 1.1875rem;
  --text-xl: 1.375rem;
  --text-2xl: 1.75rem;
  --text-3xl: clamp(2rem, 4vw, 2.75rem);
  --text-4xl: clamp(2.5rem, 6vw, 4rem);
  --text-hero: clamp(2.75rem, 7.5vw, 5.25rem);

  --w-content: 72rem;
  --w-prose: 46rem;
  --r-sm: 4px;
  --r-md: 8px;
  --r-lg: 14px;
  --pad-section: clamp(4.5rem, 9vw, 8rem);
}

/* ---------- Reset / base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
  body.rv-ready .rv { opacity: 1 !important; transform: none !important; }
}
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: var(--text-base);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--primary-2); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: var(--primary); }

/* CSS-first reveal: everything starts visible. .rv elements only
   animate AFTER JS adds body.rv-ready. No JS => fully visible page. */
.rv { opacity: 1; transform: none; }
body.rv-ready .rv { opacity: 0; transform: translateY(14px); animation: rv-in 0.7s cubic-bezier(0.2, 0.7, 0.2, 1) forwards; }
body.rv-ready .rv-d1 { animation-delay: 0.08s; }
body.rv-ready .rv-d2 { animation-delay: 0.16s; }
body.rv-ready .rv-d3 { animation-delay: 0.24s; }
@keyframes rv-in { to { opacity: 1; transform: none; } }

/* ---------- Layout primitives ---------- */
.wrap { max-width: var(--w-content); margin-inline: auto; padding-inline: clamp(1.25rem, 4vw, 2.5rem); }
.prose { max-width: var(--w-prose); }
.section { padding-block: var(--pad-section); position: relative; }
.section-alt { background: var(--alt); }
.grid { display: grid; gap: 1.25rem; }
@media (min-width: 760px) {
  .grid-2 { grid-template-columns: repeat(2, 1fr); }
  .grid-3 { grid-template-columns: repeat(3, 1fr); }
  .grid-4 { grid-template-columns: repeat(4, 1fr); }
}

/* Blueprint texture — subtle, CSS-only */
.blueprint {
  background-image:
    linear-gradient(var(--grid) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid) 1px, transparent 1px);
  background-size: 44px 44px;
}

/* Thermal rule — the amber→cryo gradient line */
.thermal-rule {
  height: 2px; border: 0; margin: 0;
  background: linear-gradient(90deg, var(--accent), var(--primary-2));
}

/* ---------- Typography ---------- */
h1, h2, h3, h4 { font-family: var(--font-display); line-height: 1.08; margin: 0 0 0.6em; letter-spacing: -0.015em; }
h1 { font-size: var(--text-hero); font-weight: 800; }
h2 { font-size: var(--text-3xl); font-weight: 800; }
h3 { font-size: var(--text-xl); font-weight: 700; }
h4 { font-size: var(--text-lg); font-weight: 700; }
p { margin: 0 0 1.1em; }
.lede { font-size: var(--text-lg); color: var(--text-2); }
.muted { color: var(--muted); }
.mono { font-family: var(--font-mono); }

/* Mono kicker label above headings */
.kicker {
  display: flex; align-items: center; gap: 0.6rem;
  font-family: var(--font-mono); font-size: var(--text-xs);
  letter-spacing: 0.18em; text-transform: uppercase;
  color: var(--accent); margin-bottom: 1rem;
}
.kicker::before { content: ""; width: 2rem; height: 1px; background: var(--accent); }
.kicker .knum { color: var(--muted); }

/* ---------- Header / nav ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(244, 247, 250, 0.9);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}
.nav-bar { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding-block: 0.9rem; flex-wrap: nowrap; }
.brand { display: flex; align-items: baseline; gap: 0.55rem; text-decoration: none; flex-shrink: 0; }
.brand-name { font-family: var(--font-display); font-weight: 800; font-size: 1.35rem; color: var(--text); letter-spacing: -0.02em; }
.brand-tag { font-family: var(--font-mono); font-size: 0.66rem; letter-spacing: 0.14em; text-transform: uppercase; color: var(--accent); white-space: nowrap; }
.nav-links { display: flex; align-items: center; gap: clamp(0.5rem, 1.2vw, 1.1rem); list-style: none; margin: 0; padding: 0; flex-wrap: nowrap; }
.nav-links li { flex-shrink: 0; }
.nav-links a { font-size: var(--text-sm); font-weight: 500; color: var(--text-2); text-decoration: none; white-space: nowrap; }
.nav-links a:hover { color: var(--text); }
.nav-phone {
  font-family: var(--font-mono); font-size: var(--text-sm); font-weight: 600;
  color: var(--on-accent) !important; background: var(--accent);
  padding: 0.5rem 0.9rem; border-radius: var(--r-sm); text-decoration: none;
  white-space: nowrap; flex-shrink: 0;
}
.nav-phone:hover { background: var(--accent); }
/* Mobile nav: <details> based — works without JS */
.nav-mobile { display: none; }
@media (max-width: 1280px) {
  .nav-links { display: none; }
  .nav-mobile { display: block; position: relative; }
  .nav-mobile summary { list-style: none; cursor: pointer; padding: 0.4rem 0.6rem; border: 1px solid var(--border-strong); border-radius: var(--r-sm); font-family: var(--font-mono); font-size: var(--text-xs); letter-spacing: 0.12em; text-transform: uppercase; color: var(--text-2); }
  .nav-mobile summary::-webkit-details-marker { display: none; }
  .nav-mobile[open] summary { border-color: var(--accent); color: var(--accent); }
  .nav-mobile-panel {
    position: absolute; right: 0; top: calc(100% + 0.6rem); min-width: 15rem;
    background: var(--surface); border: 1px solid var(--border-strong); border-radius: var(--r-md);
    padding: 0.75rem; display: grid; gap: 0.25rem; box-shadow: var(--shadow);
  }
  .nav-mobile-panel a { display: block; padding: 0.55rem 0.7rem; border-radius: var(--r-sm); color: var(--text-2); text-decoration: none; font-size: var(--text-sm); }
  .nav-mobile-panel a:hover { background: var(--alt); color: var(--text); }
}

/* Trust strip under header */
.trust-strip { border-bottom: 1px solid var(--border); background: var(--alt); }
.trust-strip-inner { display: flex; flex-wrap: wrap; gap: 0.4rem 1.8rem; padding-block: 0.5rem; font-family: var(--font-mono); font-size: 0.7rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); }
.trust-strip-inner span b { color: var(--text-2); font-weight: 600; }

/* ---------- Hero ---------- */
.hero { padding-block: clamp(4rem, 9vw, 7.5rem) clamp(3rem, 6vw, 5rem); position: relative; overflow: hidden; }
.hero::after {
  content: ""; position: absolute; inset: auto 0 0 0; height: 40%;
  background: radial-gradient(60% 100% at 70% 100%, rgba(28, 81, 127, 0.06), transparent 70%);
  pointer-events: none;
}
.hero h1 { max-width: 17ch; }
.hero h1 .accent { color: var(--accent); }
.hero .lede { max-width: 54ch; }
.hero-cta { display: flex; flex-wrap: wrap; gap: 0.9rem; margin-top: 2rem; }

.btn {
  display: inline-flex; align-items: center; gap: 0.5rem;
  font-family: var(--font-display); font-weight: 700; font-size: var(--text-base);
  padding: 0.85rem 1.5rem; border-radius: var(--r-sm); text-decoration: none;
  border: 1px solid transparent; cursor: pointer;
}
.btn-primary { background: var(--accent); color: var(--on-accent); }
.btn-primary:hover { background: var(--accent); color: var(--on-accent); }
.btn-ghost { border-color: var(--border-strong); color: var(--text); }
.btn-ghost:hover { border-color: var(--primary-2); color: var(--primary-2); }

/* ---------- The data strip (signature component) ----------
   Verified numbers as design objects. Each cell: giant figure,
   mono unit, one-line meaning, cited source. */
.data-strip {
  display: grid; gap: 1px; background: var(--border);
  border-block: 1px solid var(--border);
}
@media (min-width: 760px) { .data-strip { grid-template-columns: repeat(4, 1fr); } }
.data-cell { background: var(--alt); padding: 1.6rem 1.5rem 1.4rem; position: relative; }
.data-cell .fig {
  font-family: var(--font-display); font-weight: 800;
  font-size: clamp(2.4rem, 4.5vw, 3.4rem); line-height: 1; letter-spacing: -0.03em;
  color: var(--text);
}
.data-cell .fig sub, .data-cell .fig .unit { font-size: 0.38em; font-weight: 600; color: var(--accent); letter-spacing: 0; vertical-align: baseline; font-family: var(--font-mono); }
.data-cell .what { margin: 0.5rem 0 0.75rem; font-size: var(--text-sm); color: var(--text-2); }
.data-cell .src {
  font-family: var(--font-mono); font-size: 0.68rem; letter-spacing: 0.06em;
  color: var(--muted); display: flex; align-items: center; gap: 0.4rem;
}
.data-cell .src::before { content: "✓"; color: var(--verify); font-weight: 700; }

/* ---------- Spec card (bordered instrument card) ---------- */
.spec-card {
  background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow);
  border-radius: var(--r-lg); padding: 1.75rem;
  display: flex; flex-direction: column; gap: 0.35rem;
}
.spec-card:hover { border-color: var(--border-strong); }
.spec-card .spec-label { font-family: var(--font-mono); font-size: var(--text-xs); letter-spacing: 0.16em; text-transform: uppercase; color: var(--accent); margin-bottom: 0.5rem; }
.spec-card h3 a { color: var(--text); text-decoration: none; }
.spec-card h3 a:hover { color: var(--primary-2); }
.spec-card p { color: var(--text-2); font-size: var(--text-sm); margin: 0; }
.spec-card .spec-more { margin-top: auto; padding-top: 1rem; font-family: var(--font-mono); font-size: var(--text-xs); letter-spacing: 0.1em; text-transform: uppercase; }

/* ---------- Verified claim chip ---------- */
.claim-chip {
  display: inline-flex; align-items: center; gap: 0.5rem;
  font-family: var(--font-mono); font-size: 0.72rem; letter-spacing: 0.05em;
  color: var(--text-2); background: var(--alt);
  border: 1px solid var(--border); border-radius: 999px; padding: 0.3rem 0.8rem;
  text-decoration: none;
}
a.claim-chip:hover { background: var(--border); }
.claim-chip::before { content: "✓"; color: var(--verify); font-weight: 700; }
.chip-row { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-block: 1.25rem; }

/* ---------- Direct answer block (AEO signature) ----------
   The extraction-survivable answer, styled as a readout. */
.answer-block {
  border-left: 3px solid var(--accent);
  background: linear-gradient(90deg, rgba(224, 138, 30, 0.08), transparent 60%);
  padding: 1.4rem 1.6rem; margin-block: 1.5rem; border-radius: 0 var(--r-md) var(--r-md) 0;
}
.answer-block .answer-label { font-family: var(--font-mono); font-size: var(--text-xs); letter-spacing: 0.16em; text-transform: uppercase; color: var(--accent); margin-bottom: 0.5rem; }
.answer-block p { margin: 0; color: var(--text); font-size: var(--text-lg); line-height: 1.6; }
.answer-block .answer-src { margin-top: 0.7rem; font-family: var(--font-mono); font-size: 0.7rem; color: var(--muted); }

/* ---------- Comparison table ---------- */
.spec-table-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: var(--r-lg); }
table.spec-table { width: 100%; border-collapse: collapse; font-size: var(--text-sm); min-width: 560px; }
.spec-table th, .spec-table td { padding: 0.85rem 1.1rem; text-align: left; border-bottom: 1px solid var(--border); }
.spec-table thead th { background: var(--alt); font-family: var(--font-mono); font-size: var(--text-xs); letter-spacing: 0.12em; text-transform: uppercase; color: var(--text-2); }
.spec-table tbody tr:last-child td { border-bottom: 0; }
.spec-table td.good { color: var(--verify); }
.spec-table td.num { font-family: var(--font-mono); }
.spec-table .rowlabel { color: var(--text-2); font-weight: 600; }

/* ---------- FAQ accordion (details/summary — zero JS) ---------- */
.faq { display: grid; gap: 0.6rem; }
.faq details { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-md); }
.faq details[open] { border-color: var(--border-strong); }
.faq summary {
  cursor: pointer; list-style: none; padding: 1.1rem 3rem 1.1rem 1.3rem;
  font-family: var(--font-display); font-weight: 700; font-size: var(--text-base);
  position: relative; color: var(--text);
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: "+"; position: absolute; right: 1.2rem; top: 50%; transform: translateY(-50%);
  font-family: var(--font-mono); color: var(--accent); font-size: 1.2rem;
}
.faq details[open] summary::after { content: "–"; }
.faq .faq-body { padding: 0 1.3rem 1.2rem; color: var(--text-2); }
.faq .faq-body p:last-child { margin-bottom: 0; }
.faq .faq-src { font-family: var(--font-mono); font-size: 0.7rem; color: var(--muted); }

/* ---------- Process / numbered steps ---------- */
.steps { display: grid; gap: 1.25rem; counter-reset: step; }
@media (min-width: 760px) { .steps { grid-template-columns: repeat(2, 1fr); } }
.step { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); padding: 1.5rem; counter-increment: step; }
.step::before {
  content: "0" counter(step); display: block;
  font-family: var(--font-mono); font-size: var(--text-xs); letter-spacing: 0.16em;
  color: var(--accent); margin-bottom: 0.6rem;
}
.step h4 { margin-bottom: 0.35rem; }
.step p { color: var(--text-2); font-size: var(--text-sm); margin: 0; }

/* ---------- Calculator (progressive enhancement) ---------- */
.calc {
  background: var(--surface); border: 1px solid var(--border-strong); box-shadow: var(--shadow);
  border-radius: var(--r-lg); padding: 1.75rem;
}
.calc .calc-title { font-family: var(--font-mono); font-size: var(--text-xs); letter-spacing: 0.16em; text-transform: uppercase; color: var(--accent); margin-bottom: 1rem; }
.calc label { display: block; font-size: var(--text-sm); color: var(--text-2); margin-bottom: 0.35rem; font-weight: 600; }
.calc input, .calc select {
  width: 100%; background: var(--bg); color: var(--text);
  border: 1px solid var(--border-strong); border-radius: var(--r-sm);
  padding: 0.65rem 0.8rem; font-family: var(--font-mono); font-size: var(--text-base);
}
.calc input:focus, .calc select:focus { outline: 2px solid var(--accent); outline-offset: 1px; border-color: var(--accent); }
.calc .calc-grid { display: grid; gap: 1rem; margin-bottom: 1.25rem; }
@media (min-width: 640px) { .calc .calc-grid { grid-template-columns: repeat(3, 1fr); } }
.calc output { display: block; }
.calc .calc-result { font-family: var(--font-display); font-weight: 800; font-size: var(--text-3xl); color: var(--accent); line-height: 1.1; }
.calc .calc-note { font-size: var(--text-xs); color: var(--muted); margin-top: 0.75rem; font-family: var(--font-mono); }

/* ---------- Jump nav / ToC ---------- */
.jump-nav { border: 1px solid var(--border); border-radius: var(--r-md); padding: 1.1rem 1.3rem; background: var(--alt); margin-block: 2rem; }
.jump-nav .jn-label { font-family: var(--font-mono); font-size: var(--text-xs); letter-spacing: 0.16em; text-transform: uppercase; color: var(--muted); margin-bottom: 0.6rem; }
.jump-nav ol { margin: 0; padding-left: 1.2rem; columns: 2; column-gap: 2rem; font-size: var(--text-sm); }
.jump-nav a { color: var(--text-2); text-decoration: none; }
.jump-nav a:hover { color: var(--primary-2); }
@media (max-width: 640px) { .jump-nav ol { columns: 1; } }

/* ---------- Page hero (interior pages) ---------- */
.page-hero { padding-block: clamp(3.5rem, 7vw, 5.5rem) clamp(2rem, 4vw, 3rem); }
.page-hero h1 { max-width: 20ch; font-size: var(--text-4xl); }
.breadcrumbs { font-family: var(--font-mono); font-size: var(--text-xs); letter-spacing: 0.08em; color: var(--muted); margin-bottom: 1.4rem; }
.breadcrumbs a { color: var(--muted); text-decoration: none; }
.breadcrumbs a:hover { color: var(--primary-2); }

/* ---------- Byline (E-E-A-T) ---------- */
.byline { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem 1rem; font-size: var(--text-sm); color: var(--muted); font-family: var(--font-mono); margin-block: 1rem 0; }
.byline b { color: var(--text-2); font-weight: 600; }

/* ---------- CTA band ---------- */
.cta-band { background: linear-gradient(120deg, var(--surface), var(--alt)); border-block: 1px solid var(--border); }
.cta-band-inner { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 1.5rem; padding-block: 3rem; }
.cta-band h2 { margin: 0; font-size: var(--text-2xl); }
.cta-band .muted { margin: 0.3rem 0 0; }

/* ---------- Footer ---------- */
.site-footer { border-top: 1px solid var(--border); background: var(--alt); padding-block: 3.5rem 2rem; font-size: var(--text-sm); }
.footer-grid { display: grid; gap: 2.5rem; }
@media (min-width: 760px) { .footer-grid { grid-template-columns: 2fr 1fr 1fr 1.4fr; } }
@media (min-width: 980px) { .footer-grid-wide { grid-template-columns: 1.6fr 1fr 1fr 1fr 1.3fr; } }
@media (min-width: 760px) and (max-width: 979px) { .footer-grid-wide { grid-template-columns: repeat(2, 1fr); } }
.site-footer h4 { font-family: var(--font-mono); font-size: var(--text-xs); letter-spacing: 0.16em; text-transform: uppercase; color: var(--muted); margin-bottom: 0.9rem; }
.site-footer ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.45rem; }
.site-footer a { color: var(--text-2); text-decoration: none; }
.site-footer a:hover { color: var(--text); }
.footer-legal { margin-top: 2.5rem; padding-top: 1.5rem; border-top: 1px solid var(--border); display: flex; flex-wrap: wrap; gap: 0.5rem 2rem; justify-content: space-between; font-family: var(--font-mono); font-size: 0.7rem; color: var(--muted); }

/* ---------- Job-site photography ---------- */
figure.jobsite { margin: 0; border: 1px solid var(--border); border-radius: var(--r-lg); overflow: hidden; background: var(--surface); box-shadow: var(--shadow); }
figure.jobsite img { width: 100%; height: auto; display: block; }
figure.jobsite figcaption { padding: 0.7rem 1rem; font-family: var(--font-mono); font-size: 0.7rem; letter-spacing: 0.06em; color: var(--muted); border-top: 1px solid var(--border); }
figure.jobsite figcaption::before { content: "⌖ "; color: var(--accent); }
.photo-band { display: grid; gap: 1.25rem; }
@media (min-width: 760px) { .photo-band { grid-template-columns: repeat(3, 1fr); } .photo-band-2 { grid-template-columns: repeat(2, 1fr); } }
.figure-pair { display: grid; gap: 1.25rem; }
@media (min-width: 640px) { .figure-pair { grid-template-columns: repeat(2, 1fr); } }
.hero-media { margin-top: 2.5rem; }

/* ---------- Video facade (deploy-safe: works as a plain link without JS) ---------- */
.video-embed { border: 1px solid var(--border); border-radius: var(--r-lg); overflow: hidden; background: var(--surface); box-shadow: var(--shadow); }
.yt-facade { position: relative; display: block; text-decoration: none; }
.yt-facade img { width: 100%; height: auto; display: block; aspect-ratio: 16 / 9; object-fit: cover; }
.yt-facade .yt-play {
  position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%);
  width: 4.2rem; height: 4.2rem; border-radius: 999px;
  background: rgba(10, 15, 22, 0.82); border: 2px solid var(--accent);
  display: flex; align-items: center; justify-content: center;
  color: var(--accent); font-size: 1.4rem; padding-left: 0.3rem;
}
.yt-facade:hover .yt-play { background: var(--accent); color: var(--on-accent); }
.yt-facade .yt-title {
  position: absolute; inset: auto 0 0 0; padding: 2rem 1rem 0.85rem;
  background: linear-gradient(transparent, rgba(10, 15, 22, 0.92));
  color: var(--text); font-family: var(--font-mono); font-size: var(--text-xs); letter-spacing: 0.08em;
}
.video-embed iframe { width: 100%; aspect-ratio: 16 / 9; border: 0; display: block; }
.video-note { font-family: var(--font-mono); font-size: 0.7rem; color: var(--muted); padding: 0.7rem 1rem; border-top: 1px solid var(--border); }

/* ---------- Utilities ---------- */
.center { text-align: center; }
.mt-0 { margin-top: 0; } .mb-0 { margin-bottom: 0; }
.section-head { max-width: 44rem; margin-bottom: 2.75rem; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip-link { position: absolute; left: -9999px; top: 0; background: var(--accent); color: var(--on-accent); padding: 0.6rem 1rem; z-index: 100; font-weight: 700; }
.skip-link:focus { left: 0.5rem; top: 0.5rem; }

/* Focus visibility */
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* Print */
@media print {
  body { background: #fff; color: #111; }
  .site-header, .site-footer, .cta-band, .hero-cta { display: none; }
}
