:root {
  /* Egress: bright, safe, clear. White and warm gray, deep teal accent, daylight yellow highlights. */
  --ink: #1d2a2c;
  --muted: #5d6a6b;
  --line: #e2ddd4;
  --soft: #f6f3ee;
  --bg: #ffffff;
  --blue: #1d5e63;
  --blue-2: #164b4f;
  --tile: #e3efee;
  --sun: #f4d58d;
  --sun-soft: #fdf3d8;
  --radius: 14px;
  --font: "Figtree", system-ui, -apple-system, sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 400 16px/1.55 var(--font); -webkit-font-smoothing: antialiased; }
h1, h2, h3 { margin: 0; text-wrap: balance; }
h2 { font-size: 26px; font-weight: 800; line-height: 1.25; letter-spacing: -0.01em; margin-bottom: 16px; }
h3 { font-size: 16px; font-weight: 600; }
p { margin: 0 0 12px; }
a { color: inherit; }
button, input, select, textarea { font-family: inherit; }
[hidden] { display: none !important; }

.wrap { max-width: 1120px; margin: 0 auto; padding: 0 20px; }
.muted { color: var(--muted); }
.sec { padding: 48px 0; border-top: 1px solid var(--line); }
.sec-tint { background: var(--soft); border-top: 0; }
.sec-lede { color: var(--muted); max-width: 40em; margin-top: -6px; margin-bottom: 22px; }
.small { font-size: 14px; }
.link { color: var(--blue); font-weight: 600; text-decoration: none; }
.link:hover { text-decoration: underline; }

/* Header */
.top { position: sticky; top: 0; z-index: 20; background: var(--bg); border-bottom: 1px solid #ebebeb; }
.top-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; height: 72px; }
.brand { display: flex; align-items: center; gap: 9px; text-decoration: none; color: var(--ink); font-weight: 800; font-size: 19px; letter-spacing: -0.02em; white-space: nowrap; }
.brand { flex: none; }
.brand .logo { display: block; height: 28px; width: auto; }
.foot .brand .logo { height: 24px; }
.top-links { display: flex; align-items: center; gap: 4px; }
.top-links a { text-decoration: none; font-size: 14px; font-weight: 600; padding: 10px 14px; border-radius: 999px; white-space: nowrap; }
.top-links a:hover { background: var(--soft); }
.top-links a.top-cta { background: var(--blue); color: #fff; margin-left: 6px; }
.top-links a.top-cta:hover { background: var(--blue-2); }
.top-links .nav-extra { display: none; }

/* Hero with the quote card */
.hero-band { background: linear-gradient(var(--soft), var(--soft)) top / 100% 100% no-repeat; }
.hero { display: grid; gap: 22px; padding-top: 28px; padding-bottom: 40px; align-items: start;
  grid-template-areas: "head" "card" "media"; }
.hero-head { grid-area: head; }
.hero > .card { grid-area: card; }
.hero-media { grid-area: media; display: grid; gap: 20px; }
.hero-media > .calc { margin-top: 0; }
.crumbs { font-size: 13px; color: var(--muted); margin-bottom: 14px; }
.crumbs a { text-decoration: none; }
.crumbs a:hover { text-decoration: underline; }
.kicker { font-size: 14px; font-weight: 600; color: var(--blue); margin-bottom: 12px; }
.hero h1 { font-size: clamp(32px, 4.6vw, 54px); font-weight: 800; letter-spacing: -0.025em; line-height: 1.04; }
.lede { font-size: 18px; color: var(--muted); max-width: 32em; margin: 14px 0 18px; }
.checks { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; font-size: 16px; font-weight: 500; }
.checks li { display: flex; align-items: center; gap: 12px; }
.checks svg { width: 22px; height: 22px; flex: none; }

/* Quote card */
.card { border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; background: var(--bg); box-shadow: 0 10px 30px rgba(29,42,44,.12); }
.card h2 { font-size: 22px; margin-bottom: 4px; }
.card .sub { color: var(--muted); font-size: 14px; margin-bottom: 18px; }
.fields { border: 1px solid #b0b0b0; border-radius: 8px; overflow: hidden; }
.fields .f { display: block; padding: 10px 12px; border-top: 1px solid #b0b0b0; font-size: 10px; font-weight: 800; letter-spacing: .04em; text-transform: uppercase; }
.fields .f:first-child { border-top: 0; }
.fields .pair { display: grid; grid-template-columns: 1fr 1fr; border-top: 1px solid #b0b0b0; }
.fields .pair:first-child { border-top: 0; }
.fields .pair .f { border-top: 0; }
.fields .pair .f + .f { border-left: 1px solid #b0b0b0; }
.fields input, .fields select, .fields textarea {
  display: block; width: 100%; border: 0; padding: 3px 0 0; background: transparent;
  font: 500 15px/1.4 var(--font); color: var(--ink); text-transform: none; letter-spacing: 0;
}
.fields textarea { resize: vertical; min-height: 44px; }
.fields .f:focus-within { outline: 2px solid var(--ink); outline-offset: -2px; border-radius: 8px; }
.fields input:focus, .fields select:focus, .fields textarea:focus { outline: none; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.btn {
  display: block; width: 100%; border: 0; cursor: pointer; text-align: center; text-decoration: none;
  background: var(--blue); color: #fff;
  font: 700 17px/1 var(--font); padding: 17px 20px; border-radius: 10px; margin-top: 16px;
}
.btn:hover { background: var(--blue-2); }
.btn:disabled { opacity: .6; cursor: default; }
.fine { font-size: 13px; color: var(--muted); text-align: center; margin: 12px 0 0; }
.err { color: #c13515; font-size: 14px; font-weight: 500; margin: 12px 0 0; }
.done { text-align: center; padding: 18px 4px 6px; }
.done svg { width: 48px; height: 48px; margin-bottom: 10px; }
.done h2 { margin-bottom: 8px; }
.done p { color: var(--muted); }

/* Cost calculator */
.calc { border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; margin-top: 24px; background: var(--bg); }
.calc h2 { font-size: 20px; margin-bottom: 14px; }
.calc .dims { display: grid; grid-template-columns: 1fr auto 1fr; align-items: end; gap: 10px; }
.calc .dims span { padding-bottom: 12px; color: var(--muted); }
.calc label.num { display: block; font-size: 10px; font-weight: 800; letter-spacing: .04em; text-transform: uppercase; border: 1px solid #b0b0b0; border-radius: 8px; padding: 10px 12px; }
.calc label.num:focus-within { outline: 2px solid var(--ink); outline-offset: -2px; }
.calc input[type=number] { display: block; width: 100%; border: 0; padding: 3px 0 0; font: 600 18px/1.3 var(--font); background: transparent; color: var(--ink); outline: none; }
.mats { display: flex; gap: 8px; margin-top: 12px; flex-wrap: wrap; }
.mats label { cursor: pointer; }
.mats input { position: absolute; opacity: 0; }
.mats span { display: inline-block; padding: 10px 16px; border: 1px solid var(--line); border-radius: 999px; font-size: 15px; font-weight: 600; }
.mats input:checked + span { border: 2px solid var(--ink); padding: 9px 15px; }
.mats input:focus-visible + span { outline: 2px solid var(--blue); outline-offset: 2px; }
.calc-out { margin-top: 18px; display: grid; gap: 2px; }
.calc-row { display: flex; justify-content: space-between; gap: 16px; padding: 10px 0; border-top: 1px solid #ebebeb; font-size: 15px; }
.calc-row b { white-space: nowrap; }
.calc-row.big b { font-size: 22px; letter-spacing: -0.01em; }
.calc-note { font-size: 13px; color: var(--muted); margin: 10px 0 0; }

/* Steps */
.steps { display: grid; gap: 22px; }
.step-n { display: inline-grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; background: var(--sun); color: var(--ink); font-size: 13px; font-weight: 700; margin-bottom: 10px; }
.step h3 { margin-bottom: 4px; }
.step p { color: var(--muted); font-size: 15px; margin: 0; }

/* Cards and tables */
.tiles { display: grid; gap: 14px; }
.tile { display: block; border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; text-decoration: none; }
a.tile:hover { border-color: var(--blue); }
.tile h3 { margin-bottom: 6px; }
.tile p { color: var(--muted); font-size: 15px; margin: 0; font-weight: 500; }
.tbl-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); }
table.tbl { width: 100%; border-collapse: collapse; font-size: 15px; min-width: 480px; }
.tbl th, .tbl td { text-align: left; padding: 12px 16px; border-top: 1px solid #ebebeb; }
.tbl thead th { border-top: 0; background: var(--soft); font-size: 13px; font-weight: 700; }
.tbl td:not(:first-child), .tbl th:not(:first-child) { white-space: nowrap; }
.note { background: var(--soft); border-radius: var(--radius); padding: 18px 20px; font-size: 15px; }
.note p:last-child { margin: 0; }
.prose { max-width: 44em; }
.prose h2 { margin-top: 34px; }
.prose h2:first-child { margin-top: 0; }
.prose ul { padding-left: 20px; margin: 0 0 14px; }
.prose li { margin-bottom: 6px; }
.sources { font-size: 13px; color: var(--muted); }
.sources a { color: var(--muted); }

/* City links */
.cities { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 8px; }
.cities a { display: block; padding: 10px 14px; border: 1px solid var(--line); border-radius: 999px; text-decoration: none; font-size: 15px; font-weight: 500; }
.cities a:hover { border-color: var(--blue); }

/* FAQ */
.faq { border-top: 1px solid var(--line); }
.faq details { border-bottom: 1px solid var(--line); padding: 16px 0; }
.faq summary { cursor: pointer; font-weight: 600; list-style: none; display: flex; justify-content: space-between; gap: 16px; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; font-weight: 400; font-size: 22px; line-height: 1; color: var(--muted); }
.faq details[open] summary::after { content: "\2212"; }
.faq details p { color: var(--muted); margin: 10px 0 0; max-width: 44em; }

/* Footer */
.foot { background: var(--soft); border-top: 1px solid #ebebeb; padding: 40px 0 110px; font-size: 14px; margin-top: 20px; }
.foot-grid { display: grid; gap: 28px; }
.foot h4 { margin: 0 0 10px; font-size: 14px; }
.foot ul { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
.foot a { color: var(--ink); text-decoration: none; }
.foot a:hover { text-decoration: underline; }
.foot .brand { margin-bottom: 10px; }
.foot p { color: var(--muted); margin: 0 0 8px; max-width: 26em; }
.legal { border-top: 1px solid var(--line); margin-top: 28px; padding-top: 18px; color: var(--muted); }

/* Mobile bottom bar */
.mbar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; background: var(--bg); border-top: 1px solid var(--line); padding: 12px 20px calc(12px + env(safe-area-inset-bottom)); display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.mbar b { display: block; font-size: 15px; }
.mbar span { font-size: 13px; color: var(--muted); }
.mbar a { flex: none; background: var(--blue); color: #fff; text-decoration: none; font-weight: 700; padding: 13px 20px; border-radius: 10px; }

@media (min-width: 760px) {
  .steps { grid-template-columns: repeat(3, 1fr); gap: 32px; }
  .tiles { grid-template-columns: repeat(3, 1fr); }
  .tiles.tiles-4 { grid-template-columns: repeat(2, 1fr); }
  .foot-grid { grid-template-columns: 2fr 1fr 1fr 1fr; }
  .foot { padding-bottom: 40px; }
}
@media (min-width: 960px) {
  .hero { grid-template-columns: minmax(0, 1fr) 420px; gap: 64px; padding-top: 56px; padding-bottom: 64px; }
  .hero { grid-template-columns: minmax(0, 1fr) 420px; grid-template-areas: "head card" "media card"; column-gap: 64px; row-gap: 26px; }
  .hero > .card { position: sticky; top: 96px; align-self: start; }
  .tiles.tiles-4 { grid-template-columns: repeat(4, 1fr); }
  .top-links .nav-extra, .top-links a.top-cta { display: inline-block; }
  .mbar { display: none; }
}
@media (max-width: 959px) {
  .top-links a.top-cta { display: inline-block; }
}
@media (max-width: 600px) {
  .top .brand .logo { height: 21px; }
  table.tbl { min-width: 0; font-size: 14px; }
  .tbl th, .tbl td { padding: 10px 12px; }
  .tbl td:not(:first-child), .tbl th:not(:first-child) { white-space: normal; }
}

/* Size checker results */
.calc-row b.ok { color: #1a7f37; }
.calc-row b.bad { color: #c13515; }
#check .calc-row b { white-space: normal; text-align: right; }

/* Photos (Pexels stock, no on-site credits) */
.photo { margin: 0; position: relative; }
.photo img { display: block; width: 100%; height: auto; aspect-ratio: 16 / 10; object-fit: cover; border-radius: var(--radius); background: var(--line); }
.photo-tag { position: absolute; top: 12px; left: 12px; z-index: 1; background: #fff; color: var(--ink); font-size: 13px; font-weight: 800; padding: 6px 12px; border-radius: 999px; box-shadow: 0 2px 8px rgba(0,0,0,.12); }
.ba .photo:last-child .photo-tag { background: var(--sun); }
.ba { display: grid; gap: 18px; }
.ba .photo img { aspect-ratio: 3 / 2; }

/* "Is your basement bedroom legal?" call to action and section */
.legal-cta { display: flex; align-items: center; justify-content: space-between; gap: 14px; max-width: 34em; text-decoration: none; color: var(--ink); background: var(--sun-soft); border: 1px solid var(--sun); border-radius: var(--radius); padding: 14px 16px; }
.legal-cta b { display: block; font-size: 17px; font-weight: 800; }
.legal-cta span span { display: block; font-size: 14px; color: var(--muted); font-weight: 500; }
.legal-cta svg { width: 22px; height: 22px; flex: none; color: var(--blue); }
.legal-cta:hover { border-color: #e6bf5c; }
.legal-grid { display: grid; gap: 32px; align-items: start; }
.legal-grid .calc { margin-top: 0; }

/* Cross-section diagram */
.xsec { margin: 0; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; }
.xsec svg { display: block; max-width: 460px; margin: 0 auto; }
.xsec figcaption { margin-top: 10px; }
.xsec-key { list-style: none; counter-reset: k; padding: 0; margin: 0 0 8px; display: grid; gap: 8px; font-size: 15px; }
.xsec-key li { counter-increment: k; display: grid; grid-template-columns: 26px 1fr; gap: 10px; align-items: start; }
.xsec-key li::before { content: counter(k); display: grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; background: var(--blue); color: #fff; font-size: 12px; font-weight: 800; }
.prose .xsec { margin: 18px 0; }

@media (min-width: 760px) {
  .ba { grid-template-columns: 1fr 1fr; }
}
@media (min-width: 960px) {
  .legal-grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 48px; }
}

/* Two-step quote form (quote.js adds .is-steps). Without the script every field shows. */
.q-next, .q-back { display: none; }
.q-step2 { margin-top: 12px; }
.is-steps .q-step2 { margin-top: 0; }
.is-steps.on-1 .q-step2, .is-steps.on-1 .q-submit, .is-steps.on-2 .q-step1, .is-steps.on-2 .q-next { display: none; }
.is-steps.on-1 .q-next { display: block; }
.is-steps.on-2 .q-back { display: block; margin: 10px auto 0; background: none; border: 0; color: var(--muted); font: 600 14px/1 var(--font); cursor: pointer; padding: 6px 10px; }
.is-steps.on-2 .q-back:hover { color: var(--ink); text-decoration: underline; }
.q-stepn { display: none; font-weight: 700; color: var(--blue); }
.is-steps .q-stepn { display: inline; }
.q-promise { margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--line); font-size: 14px; }
.q-promise b { display: block; font-size: 14px; margin-bottom: 6px; }
.q-promise ol { margin: 0; padding-left: 20px; color: var(--muted); display: grid; gap: 4px; }

/* Sticky phone bar slides away while the form is on screen */
.mbar { transition: transform .2s ease; }
.mbar.mbar-off { transform: translateY(110%); }

/* Phones: the first form step fits on the first screen. The legal check link moves below the form there. */
.cta-top { display: none; }
@media (max-width: 959px) {
  .hero { padding-top: 18px; gap: 18px; }
  .hero .kicker { margin-bottom: 8px; font-size: 13px; }
  .hero .lede { font-size: 17px; margin: 10px 0 0; }
  .hero > .card { padding: 18px; }
  .card h2 { font-size: 20px; }
  .card .sub { margin-bottom: 12px; }
}
@media (min-width: 960px) {
  .cta-top { display: block; }
  .cta-low { display: none; }
}

/* Keep the form heading clear of the sticky header when it scrolls into view */
#quote { scroll-margin-top: 84px; }

/* Directory: finder, installer cards, company pages */
.finder { margin-top: 6px; max-width: 34em; }
.finder-fields { display: grid; grid-template-columns: 1fr; background: #fff; }
.finder-fields .f + .f { border-top: 1px solid #b0b0b0; }
.finder .btn { margin-top: 10px; }
@media (min-width: 600px) {
  .finder-fields { grid-template-columns: 1.2fr 1fr; }
  .finder-fields .f + .f { border-top: 0; border-left: 1px solid #b0b0b0; }
}
.inst-grid { display: grid; gap: 14px; margin-top: 4px; }
.inst { position: relative; border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; background: #fff; display: flex; flex-direction: column; gap: 6px; }
.inst h3 { font-size: 18px; font-weight: 800; }
.inst h3 a { text-decoration: none; }
.inst h3 a:hover { text-decoration: underline; }
.inst-meta { color: var(--muted); font-size: 14px; margin: 0; }
.inst-does { font-size: 15px; margin: 0; font-weight: 500; }
.inst-lic { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--blue); font-weight: 600; margin: 2px 0 0; }
.inst-lic svg { width: 18px; height: 18px; flex: none; }
.inst-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; margin-top: auto; padding-top: 8px; }
.btn-sm { display: inline-block; background: var(--blue); color: #fff; text-decoration: none; font-weight: 700; font-size: 14px; padding: 9px 14px; border-radius: 9px; }
.btn-sm:hover { background: var(--blue-2); }
.btn-sm.ghost, .btn.ghost { background: #fff; color: var(--blue); border: 1px solid var(--blue); }
.btn-sm.ghost:hover, .btn.ghost:hover { background: var(--tile); }
.feat { align-self: flex-start; background: var(--sun); color: var(--ink); font-size: 12px; font-weight: 800; padding: 3px 10px; border-radius: 999px; }
.inst-sub { margin: 30px 0 6px; font-size: 18px; }
.list-note { margin-top: 16px; }
.filter-note { background: var(--sun-soft); border: 1px solid var(--sun); border-radius: 10px; padding: 10px 14px; font-size: 14px; font-weight: 600; }
.company { padding-top: 28px; padding-bottom: 40px; max-width: 760px; }
.company h1 { font-size: clamp(30px, 4vw, 44px); font-weight: 800; letter-spacing: -0.02em; line-height: 1.08; }
.company-actions { display: flex; flex-wrap: wrap; gap: 10px; margin: 4px 0 22px; }
.company-actions .btn { width: auto; margin: 0; padding: 14px 20px; }
.facts { margin: 0 0 18px; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); }
.fact { display: grid; grid-template-columns: 150px 1fr; gap: 12px; padding: 12px 16px; border-top: 1px solid var(--line); font-size: 15px; }
.fact:first-child { border-top: 0; }
.fact dt { font-weight: 700; }
.fact dd { margin: 0; }
.company-links { font-size: 14px; }
@media (max-width: 600px) { .fact { grid-template-columns: 1fr; gap: 2px; } }
@media (min-width: 760px) { .inst-grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1040px) { .inst-grid { grid-template-columns: repeat(3, 1fr); } }

/* Logo header on small phones: the wordmark is wide (1588 x 140), so the button gets a short label and, at 370px
   and below, the logo drops to 20px with 16px gutters. Checked at 360, 375, 390 and 414px. */
.cta-short { display: none; }
@media (max-width: 430px) {
  .top-links a.top-cta { padding: 9px 12px; font-size: 13px; }
  .cta-long { display: none; }
  .cta-short { display: inline; }
}
@media (max-width: 370px) {
  .top .wrap { padding: 0 16px; }
  .top .brand .logo { height: 20px; }
}
