/* Light by default for every visitor; dark only when the visitor picks it with the header toggle.
   Layout: contractor's spec sheet — graph-paper hero with a dimension-line rule,
   one quote card, plain reading columns below. */
:root {
  --paper: #f2f4f1;
  --surface: #ffffff;
  --ink: #1b2427;
  --muted: #55636a;
  --line: #d3d9d5;
  --spruce: #2e5c4f;
  --spruce-ink: #ffffff;
  --spruce-soft: #e3ece8;
  --lumber: #b8894a;
  --grid: rgba(46, 92, 79, 0.08);
  --focus: #1f6fd1;

  --font-display: "Archivo", "Arial Narrow", "Helvetica Neue", Arial, sans-serif;
  --font-body: "Public Sans", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-mono: "IBM Plex Mono", ui-monospace, "SFMono-Regular", Menlo, monospace;

  --step--1: 0.875rem;
  --step-0: 1.0625rem;
  --step-1: 1.25rem;
  --step-2: 1.6rem;
  --step-3: clamp(2rem, 5vw, 3.1rem);
  --radius: 10px;
  --wrap: 72rem;
  color-scheme: light;
}
:root[data-theme="dark"] {
  --paper: #111719;
  --surface: #182024;
  --ink: #e7ece9;
  --muted: #9eaba7;
  --line: #2b363a;
  --spruce: #7db7a3;
  --spruce-ink: #0d1513;
  --spruce-soft: #1f2f2b;
  --lumber: #d2a868;
  --grid: rgba(125, 183, 163, 0.07);
  --focus: #79b0ff;
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: var(--step-0);
  line-height: 1.6;
}
img { max-width: 100%; height: auto; }
a { color: var(--spruce); text-underline-offset: 3px; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; border-radius: 4px; }
h1, h2, h3 {
  font-family: var(--font-display);
  font-stretch: 88%;
  line-height: 1.12;
  text-wrap: balance;
  margin: 0;
  letter-spacing: -0.01em;
}
h1 { font-size: var(--step-3); font-weight: 750; }
h2 { font-size: var(--step-2); font-weight: 700; }
h3 { font-size: var(--step-1); font-weight: 650; }
p { margin: 0; }

.wrap {
  max-width: var(--wrap);
  margin-inline: auto;
  padding-left: max(16px, env(safe-area-inset-left, 0px));
  padding-right: max(16px, env(safe-area-inset-right, 0px));
}
.label {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

/* Header */
.site-header { border-bottom: 1px solid var(--line); background: var(--surface); }
.site-header .wrap {
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px; flex-wrap: wrap; padding-block: 14px;
}
.brand {
  display: flex; align-items: center; gap: 10px;
  color: var(--ink); text-decoration: none;
  font-family: var(--font-display); font-weight: 750; font-stretch: 85%;
  font-size: 1.15rem; line-height: 1.1;
}
.brand-mark {
  width: 34px; height: 34px; flex: none; border-radius: 7px;
  background: var(--spruce); color: var(--spruce-ink);
  display: grid; place-items: center;
}
.brand small { display: block; font-family: var(--font-mono); font-weight: 400; font-size: 0.68rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); font-stretch: 100%; }
.header-actions { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.nav { display: flex; gap: 18px; flex-wrap: wrap; font-size: var(--step--1); }
.nav a { color: var(--ink); text-decoration: none; }
.nav a:hover, .nav a[aria-current="page"] { color: var(--spruce); text-decoration: underline; }
.phone-link {
  font-family: var(--font-mono); font-size: 0.95rem; font-weight: 500;
  color: var(--ink); text-decoration: none; white-space: nowrap;
  border: 1px solid var(--line); border-radius: 999px; padding: 6px 14px;
}
.phone-link:hover { border-color: var(--spruce); color: var(--spruce); }

/* Hero */
.hero {
  background-color: var(--paper);
  background-image:
    linear-gradient(var(--grid) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid) 1px, transparent 1px);
  background-size: 24px 24px;
  border-bottom: 1px solid var(--line);
}
.hero .wrap {
  display: grid; gap: 32px; padding-block: 48px 56px;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr);
  align-items: start;
}
.hero-copy { display: grid; gap: 18px; min-width: 0; }
.hero-copy .lede { font-size: var(--step-1); color: var(--muted); max-width: 36rem; }

/* Dimension line: the subject's own drafting convention */
.dim {
  display: flex; align-items: center; gap: 10px; color: var(--lumber);
  font-family: var(--font-mono); font-size: 0.78rem; letter-spacing: 0.06em;
  text-transform: uppercase; max-width: 34rem;
}
.dim::before, .dim::after {
  content: ""; flex: 1; height: 0; border-top: 1.5px solid currentColor;
}
.dim span { color: var(--muted); min-width: 0; text-align: center; }
.dim::before, .dim::after { min-width: 16px; }
.dim-end { width: 1.5px; height: 14px; background: currentColor; flex: none; }

.checks { list-style: none; padding: 0; margin: 4px 0 0; display: grid; gap: 10px; }
.checks li { display: flex; gap: 10px; align-items: flex-start; }
.checks svg { flex: none; margin-top: 4px; color: var(--spruce); }

/* Quote card */
.quote-card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: 0 10px 30px rgba(20, 30, 28, 0.08);
  padding: 22px; display: grid; gap: 16px; min-width: 0;
}
.quote-card h2 { font-size: 1.35rem; }
.quote-card .sub { color: var(--muted); font-size: var(--step--1); }
form { display: grid; gap: 14px; }
.field { display: grid; gap: 6px; min-width: 0; }
.field-row { display: grid; gap: 14px; grid-template-columns: 1fr 1fr; }
label, legend { font-size: 0.9rem; font-weight: 600; }
.hint { font-weight: 400; color: var(--muted); }
input[type="text"], input[type="tel"], input[type="email"], select, textarea {
  width: 100%; font: inherit; font-size: 1rem; color: var(--ink);
  background: var(--paper); border: 1px solid var(--line); border-radius: 8px;
  padding: 10px 12px; min-height: 44px;
}
textarea { min-height: 88px; resize: vertical; }
input:focus, select:focus, textarea:focus { border-color: var(--spruce); outline: 2px solid var(--spruce); outline-offset: 0; }
fieldset { border: 0; padding: 0; margin: 0; display: grid; gap: 8px; min-width: 0; }
.choices { display: flex; flex-wrap: wrap; gap: 8px; }
.choice { position: relative; }
.choice input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.choice span {
  display: inline-block; padding: 8px 12px; border: 1px solid var(--line);
  border-radius: 999px; font-size: 0.9rem; background: var(--paper); cursor: pointer;
}
.choice input:checked + span { background: var(--spruce); border-color: var(--spruce); color: var(--spruce-ink); }
.choice input:focus-visible + span { outline: 3px solid var(--focus); outline-offset: 2px; }
.consent { display: flex; gap: 10px; align-items: flex-start; font-size: 0.85rem; color: var(--muted); }
.consent input { margin-top: 4px; width: 18px; height: 18px; flex: none; accent-color: var(--spruce); }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font: inherit; font-weight: 650; font-size: 1.02rem;
  background: var(--spruce); color: var(--spruce-ink); border: 0; border-radius: 8px;
  padding: 13px 20px; min-height: 48px; cursor: pointer; text-decoration: none;
}
.btn:hover { filter: brightness(1.08); }
.btn-ghost { background: transparent; color: var(--spruce); border: 1.5px solid var(--spruce); }
.form-note { font-size: 0.8rem; color: var(--muted); }
.form-status { font-size: 0.9rem; color: var(--spruce); font-weight: 600; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

/* Sections */
.section { padding-block: 56px; border-bottom: 1px solid var(--line); }
.section:last-of-type { border-bottom: 0; }
.section-head { display: grid; gap: 10px; margin-bottom: 28px; max-width: 44rem; }
.section-head p { color: var(--muted); }
.prose { max-width: 44rem; display: grid; gap: 16px; }
.prose ul { margin: 0; padding-left: 1.2em; display: grid; gap: 6px; }

.scope { display: grid; gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; grid-template-columns: repeat(3, minmax(0, 1fr)); }
.scope > div { background: var(--surface); padding: 20px; display: grid; gap: 6px; align-content: start; }
.scope p { color: var(--muted); font-size: 0.95rem; }

.steps { list-style: none; margin: 0; padding: 0; display: grid; gap: 24px; grid-template-columns: repeat(3, minmax(0, 1fr)); counter-reset: step; }
.steps li { display: grid; gap: 8px; align-content: start; padding-top: 16px; border-top: 2px solid var(--spruce); counter-increment: step; }
.steps li::before { content: "Step " counter(step); font-family: var(--font-mono); font-size: 0.78rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--spruce); }
.steps p { color: var(--muted); }

.split { display: grid; gap: 32px; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); align-items: start; }

.figure-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; display: grid; gap: 14px; }
.figure-row { display: flex; justify-content: space-between; gap: 16px; align-items: baseline; border-bottom: 1px dashed var(--line); padding-bottom: 12px; flex-wrap: wrap; }
.figure-row:last-child { border-bottom: 0; padding-bottom: 0; }
.figure-row strong { font-family: var(--font-mono); font-variant-numeric: tabular-nums; font-size: 1.05rem; font-weight: 600; white-space: nowrap; }

.spec { font-family: var(--font-mono); font-size: 0.9rem; background: var(--spruce-soft); border-left: 3px solid var(--lumber); padding: 12px 14px; border-radius: 0 8px 8px 0; }

.chips { display: flex; flex-wrap: wrap; gap: 8px; list-style: none; padding: 0; margin: 0; }
.chips li { border: 1px solid var(--line); background: var(--surface); border-radius: 999px; padding: 6px 12px; font-size: 0.9rem; }

.table-scroll { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
table { border-collapse: collapse; width: 100%; min-width: 560px; font-size: 0.95rem; }
th, td { text-align: left; padding: 12px 14px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); font-weight: 600; }
td.num { font-family: var(--font-mono); font-variant-numeric: tabular-nums; white-space: nowrap; }
tr:last-child td { border-bottom: 0; }

.faq { display: grid; gap: 10px; max-width: 48rem; }
.faq details { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 0 18px; }
.faq summary { cursor: pointer; font-weight: 650; padding: 16px 0; list-style: none; display: flex; justify-content: space-between; gap: 12px; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; font-family: var(--font-mono); color: var(--spruce); font-size: 1.2rem; line-height: 1; }
.faq details[open] summary::after { content: "−"; }
.faq details p { padding-bottom: 16px; color: var(--muted); }

.cta-band { background: var(--spruce); color: var(--spruce-ink); }
.cta-band .wrap { display: flex; flex-wrap: wrap; gap: 20px; align-items: center; justify-content: space-between; padding-block: 36px; }
.cta-band h2 { color: inherit; }
.cta-band p { opacity: 0.9; }
.cta-band .btn { background: var(--spruce-ink); color: var(--spruce); }

/* Footer */
.site-footer { background: var(--surface); border-top: 1px solid var(--line); font-size: 0.9rem; color: var(--muted); }
.site-footer .wrap { display: grid; gap: 18px; padding-block: 32px 96px; }
.footer-grid { display: grid; gap: 24px; grid-template-columns: 2fr 1fr 1fr; }
.footer-grid h3 { font-size: 0.95rem; color: var(--ink); margin-bottom: 8px; }
.footer-grid ul { list-style: none; padding: 0; margin: 0; display: grid; gap: 6px; }
.disclosure { max-width: 46rem; }

/* Mobile call bar */
.mobile-bar {
  display: none; position: fixed; left: 0; right: 0; bottom: 0; z-index: 20;
  background: var(--surface); border-top: 1px solid var(--line);
  padding: 10px max(16px, env(safe-area-inset-right, 0px)) calc(10px + env(safe-area-inset-bottom, 0px)) max(16px, env(safe-area-inset-left, 0px));
  gap: 10px;
}
.mobile-bar .btn { flex: 1; min-height: 46px; padding: 10px; }

.page-hero .wrap { padding-block: 40px 44px; display: grid; gap: 14px; }
.page-hero .lede { font-size: var(--step-1); color: var(--muted); max-width: 40rem; }
.crumbs { font-size: var(--step--1); color: var(--muted); }
.crumbs a { color: var(--muted); }

@media (max-width: 900px) {
  .hero .wrap, .split { grid-template-columns: minmax(0, 1fr); }
  .scope { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .steps { grid-template-columns: minmax(0, 1fr); }
  .footer-grid { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 640px) {
  .nav { display: none; }
  .phone-link[href="#quote"] { display: none; }
  .site-header .wrap { flex-wrap: nowrap; }
  .scope { grid-template-columns: minmax(0, 1fr); }
  .field-row { grid-template-columns: minmax(0, 1fr); }
  .hero .wrap { padding-block: 32px 40px; }
  .mobile-bar { display: flex; }
  .section { padding-block: 44px; }
}
@media (prefers-reduced-motion: reduce) {
  * { scroll-behavior: auto !important; transition: none !important; animation: none !important; }
}

/* Theme toggle */
.theme-toggle {
  width: 38px; height: 38px; border-radius: 999px; border: 1px solid var(--line);
  background: transparent; color: var(--ink); display: inline-grid; place-items: center; cursor: pointer; padding: 0;
}
.theme-toggle:hover { border-color: var(--spruce); color: var(--spruce); }
.theme-toggle .icon-sun { display: none; }
:root[data-theme="dark"] .theme-toggle .icon-moon { display: none; }
:root[data-theme="dark"] .theme-toggle .icon-sun { display: block; }
