/* ---------- Tokens ---------- */
:root {
  --navy: #13233b;
  --night: #0c1728;
  --teal: #429e9d;
  --teal-dark: #2f7f7e;
  --teal-soft: #e8f4f4;
  --gold: #ffdc8f;
  --ink: #13233b;
  --muted: #5d6a7c;
  --line: #dde3ea;
  --field: #f4f6f9;
  --error: #c5302a;
  --ease-out: cubic-bezier(.22, 1, .36, 1);
  --ease-spring: cubic-bezier(.34, 1.56, .64, 1);
  --radius: 16px;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: Poppins, ui-sans-serif, system-ui, sans-serif;
  font-size: 16px; line-height: 1.5; color: var(--ink);
  background: var(--night);
  min-height: 100vh; display: flex; flex-direction: column;
}
h1, h2 { font-family: "League Spartan", ui-sans-serif, system-ui, sans-serif; font-weight: 800; line-height: 1.04; margin: 0; letter-spacing: -.01em; }
button, input { font: inherit; color: inherit; }
button { -webkit-tap-highlight-color: transparent; }
:focus-visible { outline: 3px solid var(--teal); outline-offset: 3px; }
[hidden] { display: none !important; }

/* ---------- Header / footer ---------- */
.site-header { background: #fff; border-bottom: 1px solid var(--line); }
.header-inner { max-width: 1180px; margin: 0 auto; padding: 10px 16px; display: flex; align-items: center; justify-content: space-between; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--navy); min-height: 48px;
  font-family: "League Spartan", sans-serif; font-weight: 800; font-size: 18px; line-height: 1; }
.call { display: inline-flex; align-items: center; gap: 8px; min-height: 48px; padding: 0 20px; border-radius: 999px;
  border: 2px solid var(--teal); color: var(--navy); font-weight: 600; text-decoration: none;
  transition: background .2s var(--ease-out), color .2s var(--ease-out), transform .12s var(--ease-out); }
.call:hover { background: var(--teal); }
.call:active { transform: scale(.96); }
.call-long { display: none; }
.site-footer { background: var(--night); color: rgba(255,255,255,.7); text-align: center; padding: 22px 16px; font-size: 14px; border-top: 1px solid rgba(255,255,255,.08); }
.site-footer p { margin: 0; }

/* ---------- Stage (night sky) ---------- */
.stage { flex: 1; position: relative; overflow: hidden;
  background:
    radial-gradient(900px 520px at 78% -8%, rgba(66,158,157,.28), transparent 62%),
    radial-gradient(700px 480px at 0% 0%, rgba(60,96,160,.35), transparent 60%),
    linear-gradient(#0c1728, #13233b 55%, #1a2f4d);
}
.stage::before { /* stars */
  content: ""; position: absolute; inset: 0; pointer-events: none; opacity: .75;
  background-image:
    radial-gradient(1.2px 1.2px at 22px 34px, #fff 50%, transparent 51%),
    radial-gradient(1px 1px at 140px 90px, #fff 50%, transparent 51%),
    radial-gradient(1.4px 1.4px at 230px 30px, #ffe9b5 50%, transparent 51%),
    radial-gradient(1px 1px at 300px 150px, #fff 50%, transparent 51%),
    radial-gradient(1.2px 1.2px at 80px 190px, #fff 50%, transparent 51%),
    radial-gradient(1px 1px at 190px 240px, #cfe4ff 50%, transparent 51%);
  background-size: 340px 280px;
  -webkit-mask-image: linear-gradient(#000, transparent 85%); mask-image: linear-gradient(#000, transparent 85%);
}
.stage-inner { position: relative; max-width: 1180px; margin: 0 auto; padding: 28px 16px 40px;
  display: grid; gap: 22px; grid-template-areas: "pitch" "card" "trust"; }
.pitch { grid-area: pitch; color: #fff; text-align: center; }
.card  { grid-area: card; }
.trust { grid-area: trust; }

.badge { display: inline-flex; align-items: center; gap: 8px; background: rgba(255,220,143,.14); color: var(--gold);
  border: 1px solid rgba(255,220,143,.35); font-weight: 600; font-size: 13px; padding: 6px 14px; border-radius: 999px; }
.badge::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--gold); box-shadow: 0 0 10px 2px rgba(255,220,143,.8); animation: twinkle 2.4s ease-in-out infinite; }
.pitch h1 { font-size: clamp(30px, 7.4vw, 40px); margin: 14px auto 0; max-width: 15em; text-wrap: balance; }
.lede { display: none; color: rgba(255,255,255,.78); font-size: 17px; margin: 14px auto 0; max-width: 30em; }
.scene { display: none; }

.trust { list-style: none; margin: 0 auto; padding: 0; display: grid; gap: 10px; color: rgba(255,255,255,.88); font-size: 14.5px; width: 100%; max-width: 620px; }
.trust li { display: flex; align-items: center; gap: 10px; }
.tick { flex: none; width: 22px; height: 22px; border-radius: 50%; background: var(--teal) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M6.5 12.5l3.5 3.5 7.5-8' fill='none' stroke='%230c1728' stroke-width='2.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center/16px no-repeat; }

/* ---------- Card ---------- */
.card { width: 100%; max-width: 620px; margin: 0 auto; background: #fff; border-radius: 24px; padding: 18px 16px 22px;
  box-shadow: 0 30px 70px -20px rgba(0,0,0,.55), 0 2px 0 rgba(255,255,255,.4) inset; }
.card-top { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; min-height: 44px; }
.card-top.is-done { display: none; }
.icon-btn { flex: none; width: 44px; height: 44px; margin-left: -8px; border: 0; border-radius: 50%; background: transparent; color: var(--navy);
  display: grid; place-items: center; cursor: pointer; transition: background .15s, transform .12s var(--ease-out), opacity .2s; }
.icon-btn:hover { background: var(--field); }
.icon-btn:active { transform: scale(.9) translateX(-2px); }
.icon-btn[disabled] { opacity: 0; pointer-events: none; }
.segments { flex: 1; display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.segments i { height: 6px; border-radius: 999px; background: var(--line); position: relative; overflow: hidden; }
.segments i::after { content: ""; position: absolute; inset: 0; border-radius: inherit; background: var(--teal); transform: scaleX(0); transform-origin: left; transition: transform .5s var(--ease-out); }
.segments i.on::after { transform: scaleX(1); }
.segments i.half::after { transform: scaleX(.45); }
.step-label { flex: none; font-size: 13px; font-weight: 600; color: var(--muted); min-width: 4.2em; text-align: right; font-variant-numeric: tabular-nums; }

#step h2 { font-size: clamp(26px, 6.4vw, 32px); }
#step h2:focus { outline: none; }
.sub { color: var(--muted); margin: 8px 0 0; font-size: 15.5px; }
.group-title { font-size: 15px; font-weight: 600; margin: 22px 0 10px; }

/* Step entrance: each block rises in, slightly staggered */
#step > * { animation: rise .5s var(--ease-out) both; animation-delay: calc(var(--i, 0) * 55ms); }
#step.from-back > * { animation-name: slide-back; }
@keyframes rise { from { opacity: 0; transform: translateY(14px); } }
@keyframes slide-back { from { opacity: 0; transform: translateX(-16px); } }

/* ---------- Buttons ---------- */
.btn-primary { width: 100%; min-height: 58px; margin-top: 22px; border: 0; border-radius: 999px; cursor: pointer;
  display: flex; align-items: center; justify-content: center; gap: 10px;
  background: var(--teal); color: var(--night); font-weight: 700; font-size: 17px;
  box-shadow: 0 10px 22px -10px rgba(47,127,126,.9);
  transition: background .2s var(--ease-out), transform .14s var(--ease-out), box-shadow .2s; }
.btn-primary svg { transition: transform .25s var(--ease-out); }
.btn-primary:hover { background: #4fb0af; }
.btn-primary:hover svg { transform: translateX(4px); }
.btn-primary:active { transform: scale(.97, .95); box-shadow: 0 4px 10px -6px rgba(47,127,126,.9); }
.btn-primary[disabled] { opacity: .7; cursor: progress; }
.btn-link { display: inline-flex; align-items: center; justify-content: center; min-height: 52px; padding: 0 26px; border-radius: 999px; background: var(--teal); color: var(--night); font-weight: 700; text-decoration: none; transition: transform .14s var(--ease-out), background .2s; }
.btn-link:hover { background: #4fb0af; }
.btn-link:active { transform: scale(.97); }
.fine { text-align: center; color: var(--muted); font-size: 13.5px; margin: 12px 0 0; }

/* ---------- Fields ---------- */
.field { display: block; margin-top: 14px; }
.field > span { display: block; font-weight: 600; font-size: 14px; margin-bottom: 6px; }
.input { display: block; width: 100%; min-height: 56px; padding: 0 16px; font-size: 16px;
  border: 2px solid transparent; border-radius: 14px; background: var(--field);
  transition: border-color .15s, background .15s, box-shadow .15s; }
.input::placeholder { color: #98a2b0; }
.input:hover { border-color: var(--line); }
.input:focus { outline: none; background: #fff; border-color: var(--teal); box-shadow: 0 0 0 4px var(--teal-soft); }
.input[aria-invalid="true"] { border-color: var(--error); background: #fff; animation: shake .36s var(--ease-out); }
.field-err { color: var(--error); font-size: 13.5px; margin: 6px 0 0; min-height: 0; }
.field-err:empty { display: none; }
@keyframes shake { 20% { transform: translateX(-6px); } 50% { transform: translateX(5px); } 80% { transform: translateX(-2px); } }

/* Address combobox */
.combo { position: relative; margin-top: 20px; }
.combo .pin { position: absolute; left: 16px; top: 18px; color: var(--teal-dark); pointer-events: none; }
.combo .input { padding-left: 46px; min-height: 60px; font-size: 17px; }
.suggest { position: absolute; z-index: 5; left: 0; right: 0; top: calc(100% + 6px); margin: 0; padding: 6px; list-style: none;
  background: #fff; border: 1px solid var(--line); border-radius: 14px; box-shadow: 0 18px 40px -12px rgba(12,23,40,.35);
  animation: drop .22s var(--ease-out); transform-origin: top; }
@keyframes drop { from { opacity: 0; transform: translateY(-6px) scaleY(.96); } }
.suggest li[role="option"] { display: flex; flex-direction: column; justify-content: center; min-height: 52px; padding: 6px 12px; border-radius: 10px; cursor: pointer; }
.suggest li[role="option"] b { font-weight: 600; font-size: 15px; }
.suggest li[role="option"] small { color: var(--muted); font-size: 13px; }
.suggest li[aria-selected="true"], .suggest li[role="option"]:hover { background: var(--teal-soft); }
.suggest .attrib { text-align: right; font-size: 11px; color: var(--muted); padding: 4px 10px 2px; }

/* ---------- Choices ---------- */
.choice { position: relative; display: block; width: 100%; cursor: pointer; text-align: left;
  background: #fff; border: 2px solid var(--line); border-radius: var(--radius); padding: 12px;
  transition: border-color .18s, background .18s, box-shadow .18s, transform .14s var(--ease-out); }
.choice:hover { border-color: #b9c6d3; transform: translateY(-2px); box-shadow: 0 10px 22px -14px rgba(12,23,40,.45); }
.choice:active { transform: scale(.975); }
.choice[aria-pressed="true"] { border-color: var(--teal); background: var(--teal-soft); box-shadow: 0 0 0 1px var(--teal); }
.choice::after { /* check badge */
  content: ""; position: absolute; top: -9px; right: -9px; width: 26px; height: 26px; border-radius: 50%;
  background: var(--teal) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M6.5 12.5l3.5 3.5 7.5-8' fill='none' stroke='%23fff' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center/17px no-repeat;
  border: 2px solid #fff; transform: scale(0); transition: transform .12s; }
.choice[aria-pressed="true"]::after { transform: scale(1); animation: pop .42s var(--ease-spring); }
@keyframes pop { 0% { transform: scale(0); } 60% { transform: scale(1.22); } 100% { transform: scale(1); } }
.choice strong { display: block; font-weight: 600; font-size: 16px; line-height: 1.25; }
.choice small { display: block; color: var(--muted); font-size: 13.5px; line-height: 1.35; margin-top: 3px; }

.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

/* Segmented control (one story / two stories) */
.seg { position: relative; display: grid; grid-template-columns: 1fr 1fr; background: var(--field); border-radius: 16px; padding: 5px; margin-top: 18px; }
.seg::before { content: ""; position: absolute; top: 5px; bottom: 5px; left: 5px; width: calc(50% - 5px); border-radius: 12px; background: #fff;
  box-shadow: 0 4px 12px -4px rgba(12,23,40,.3); transition: transform .38s var(--ease-spring); }
.seg[data-pos="2"]::before { transform: translateX(100%); }
.seg button { position: relative; min-height: 50px; border: 0; background: none; border-radius: 12px; font-weight: 600; cursor: pointer; color: var(--muted); transition: color .2s; }
.seg button[aria-pressed="true"] { color: var(--navy); }

/* House cards */
.art { display: block; width: 100%; height: auto; border-radius: 12px; background: linear-gradient(#0d1a2e, #1d3558); }
.house-list { display: grid; gap: 12px; margin-top: 14px; }
.house-list .choice { display: grid; grid-template-columns: 46% 1fr; align-items: center; gap: 14px; padding: 8px; animation: rise .45s var(--ease-out) both; animation-delay: calc(var(--k) * 60ms); }
.house-list .choice strong { font-size: 18px; }

/* Roof / access option icons */
.opt { text-align: center; padding: 14px 10px; }
.opt svg { display: block; width: 100%; max-width: 132px; height: auto; margin: 0 auto 10px; border-radius: 10px; }

/* Color cards */
.preview { margin-top: 16px; }
.color-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 14px; }
.color-grid .choice { padding: 8px 8px 12px; text-align: center; }
.strand { display: block; width: 100%; height: auto; border-radius: 10px; background: linear-gradient(#0d1a2e, #1b3152); margin-bottom: 10px; }
.tag { display: inline-block; background: var(--gold); color: #5a4100; font-size: 11px; font-weight: 700; padding: 2px 8px; border-radius: 999px; margin-top: 5px; }

/* Bulbs: switch on in sequence, then a few keep twinkling */
.bulb { animation: light-on .5s var(--ease-out) both; animation-delay: calc(var(--n) * 14ms + 120ms); }
.bulb.tw { animation: light-on .5s var(--ease-out) calc(var(--n) * 14ms + 120ms) both, twinkle 2.8s ease-in-out calc(var(--n) * 173ms + 1.2s) infinite; }
@keyframes light-on { from { opacity: 0; } }
@keyframes twinkle { 50% { opacity: .45; } }

/* ---------- Price ---------- */
.price-hero { margin-top: 16px; border-radius: 18px; overflow: hidden; color: #fff; text-align: center; padding-top: 6px;
  background: radial-gradient(420px 220px at 50% 100%, rgba(255,220,143,.16), transparent 70%), linear-gradient(#0d1a2e, #1d3558); }
.price-hero .art { background: none; border-radius: 0; margin-top: -18px; }
.price-label { margin: 14px 0 0; font-size: 13px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--gold); }
.price { font-family: "League Spartan", sans-serif; font-weight: 800; font-size: clamp(58px, 17vw, 76px); line-height: 1; margin: 6px 0 4px; font-variant-numeric: tabular-nums; }
.price .num { display: inline-block; }
.price .num.pop { animation: price-pop .5s var(--ease-spring); }
@keyframes price-pop { 40% { transform: scale(1.09); text-shadow: 0 0 28px rgba(255,220,143,.7); } }
.price .per { font-size: 20px; font-weight: 700; opacity: .8; }
.price-math { margin: 0; font-size: 14px; color: rgba(255,255,255,.8); padding: 0 14px; }
.estimate { font-size: 13.5px; color: var(--muted); text-align: center; margin: 12px 0 0; }

.plans { display: grid; gap: 10px; }
.plan { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 64px; padding: 10px 16px; }
.plan .amt { font-weight: 700; font-size: 18px; white-space: nowrap; text-align: right; font-variant-numeric: tabular-nums; }
.plan .amt small { display: inline; font-weight: 400; }
.plan small.save { color: var(--teal-dark); font-weight: 600; }

.chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 16px 0 0; padding: 0; list-style: none; }
.chips li { background: var(--field); border-radius: 999px; padding: 4px 12px; font-size: 13px; color: var(--muted); }

.form-head { margin-top: 26px; padding-top: 22px; border-top: 1px solid var(--line); }
.form-head h3 { font-family: "League Spartan", sans-serif; font-weight: 800; font-size: 24px; line-height: 1.1; margin: 0; }
.form-head p { margin: 6px 0 0; color: var(--muted); font-size: 14.5px; }

/* ---------- Done ---------- */
.done { text-align: center; padding: 18px 0 8px; }
.done-check { width: 84px; height: 84px; margin: 0 auto 18px; display: block; }
.done-check circle { fill: var(--teal); transform-origin: center; animation: pop .6s var(--ease-spring) both; }
.done-check path { fill: none; stroke: #fff; stroke-width: 5; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 40; stroke-dashoffset: 40; animation: draw .45s var(--ease-out) .35s forwards; }
@keyframes draw { to { stroke-dashoffset: 0; } }
.done p { margin: 12px auto 0; max-width: 26em; }
.done .btn-link { margin-top: 22px; }
.done a:not(.btn-link) { color: var(--teal-dark); font-weight: 600; }
.demo-note { background: #fff7df; border: 1px solid #f0d98c; border-radius: 12px; padding: 10px 14px; font-size: 13px; margin-top: 22px !important; text-align: left; }

/* ---------- Large phones / tablets ---------- */
@media (min-width: 600px) {
  .header-inner { padding: 12px 28px; }
  .call-short { display: none; } .call-long { display: inline; }
  .stage-inner { padding: 44px 28px 56px; gap: 28px; }
  .pitch h1 { font-size: 46px; }
  .lede { display: block; }
  .card { padding: 26px 30px 32px; }
  .house-list { grid-template-columns: repeat(3, 1fr); }
  .house-list .choice { grid-template-columns: 1fr; text-align: center; gap: 10px; padding: 8px 8px 14px; }
  .color-grid { grid-template-columns: repeat(4, 1fr); }
  .trust { grid-template-columns: repeat(3, auto); justify-content: center; gap: 22px; max-width: none; }
  .form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
}

/* ---------- Laptop / desktop: two columns ---------- */
@media (min-width: 1000px) {
  .stage-inner { grid-template-columns: minmax(0, 1fr) minmax(0, 580px); grid-template-areas: "pitch card" "trust card"; grid-template-rows: auto 1fr;
    column-gap: clamp(40px, 6vw, 88px); align-items: start; padding-top: 64px; padding-bottom: 80px; }
  .pitch { text-align: left; position: sticky; top: 32px; }
  .pitch h1 { font-size: clamp(44px, 4.4vw, 60px); margin-left: 0; }
  .lede { margin-left: 0; font-size: 18px; }
  .scene { display: block; margin-top: 30px; border-radius: 22px; overflow: hidden; border: 1px solid rgba(255,255,255,.1);
    background: linear-gradient(rgba(13,26,46,.4), rgba(29,53,88,.85)); box-shadow: 0 30px 60px -30px rgba(0,0,0,.6); }
  .scene .art { background: none; border-radius: 0; }
  .trust { grid-template-columns: 1fr; justify-content: start; gap: 12px; margin: 0; font-size: 15.5px; }
  .card { margin: 0; max-width: none; }
  .stack-only { display: none; }
  .color-grid { grid-template-columns: 1fr 1fr; }
  .price-hero { padding: 10px 0 24px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-delay: 0s !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}

/* Keep the address suggestions above everything that follows them */
#step > form { position: relative; z-index: 3; }
.color-grid .choice { display: flex; flex-direction: column; align-items: center; justify-content: flex-start; }
.color-grid .choice .strand { flex: none; }

/* Scene details: chimney smoke and falling snow */
.smoke { opacity: 0; transform-box: fill-box; transform-origin: center; animation: smoke 4.2s ease-out infinite; animation-delay: calc(var(--s) * 1.4s); }
@keyframes smoke { 0% { opacity: 0; transform: translate(0, 0) scale(.5); } 25% { opacity: .45; } 100% { opacity: 0; transform: translate(9px, -24px) scale(1.5); } }
.flake { animation: fall var(--t) linear var(--d) infinite; }
@keyframes fall { to { transform: translate(var(--x), 200px); } }
.roof-grid { margin-top: 20px; }

/* Price shown as an estimate range */
.price { font-size: clamp(38px, 10.5vw, 58px); display: flex; align-items: baseline; justify-content: center; gap: .18em; flex-wrap: wrap; }
.price .dash { opacity: .6; font-weight: 700; }
.price-per { margin: 0 0 4px; font-size: 15px; font-weight: 600; color: rgba(255,255,255,.8); }
.plan .amt { font-size: 16px; line-height: 1.2; }
.plan .amt small { display: block; font-size: 12.5px; color: var(--muted); }

.site-footer a { color: var(--gold); }

/* Small spinner while address suggestions load */
.combo.searching::after { content: ""; position: absolute; right: 18px; top: 20px; width: 20px; height: 20px; border-radius: 50%; border: 2.5px solid var(--line); border-top-color: var(--teal); animation: spin .7s linear infinite; }
.combo.searching .input { padding-right: 50px; }
@keyframes spin { to { transform: rotate(360deg); } }

/* Three roof choices side by side */
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.grid-3 .opt { padding: 10px 8px 12px; }
@media (max-width: 420px) { .grid-3 .opt strong { font-size: 15px; } .grid-3 .opt small { font-size: 12px; } }
.grid-3 .opt { display: flex; flex-direction: column; align-items: center; justify-content: flex-start; }
.grid-3 .opt svg { flex: none; }
