/* Maine Heat Rebates
   Design rules (adapted from Leonxlnx/taste-skill): flat grounds, one accent, one radius scale,
   one card style, one button pair, real type, quiet hover/press motion, hero enters once. */
:root {
  --bg: #f7f9f8;
  --surface: #ffffff;
  --ink: #18201c;
  --muted: #56615b;
  --line: #dce3df;
  --line-strong: #bfcac4;
  --pine: #173f33;       /* hero ground, headings accents */
  --pine-600: #1e5c48;   /* links, active states */
  --pine-50: #eaf3ee;
  --amber: #ffc53d;      /* the one accent: primary buttons, bonus */
  --amber-hover: #ffba18;
  --amber-ink: #4a3110;
  --amber-50: #fff8e6;
  --amber-line: #f1d48a;
  --r-sm: 8px;
  --r-md: 12px;
  --display: "Bricolage Grotesque", "Segoe UI", system-ui, sans-serif;
  --body: "Figtree", system-ui, -apple-system, "Segoe UI", sans-serif;
  --ease: cubic-bezier(.2, .7, .2, 1);
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: 16px; }
body { margin: 0; font: 400 17px/1.6 var(--body); color: var(--ink); background: var(--bg); }
body.has-bar { padding-bottom: 80px; }
h1, h2, h3, .h2, .h3 { font-family: var(--display); font-weight: 800; line-height: 1.12; letter-spacing: -.015em; margin: 0 0 .5em; }
h1 { font-size: clamp(2rem, 4.6vw, 3.4rem); }
h2, .h2 { font-size: clamp(1.45rem, 2.4vw, 1.9rem); }
h3, .h3 { font-size: 1.2rem; font-weight: 600; letter-spacing: -.005em; }
p { margin: 0 0 1em; }
a { color: var(--pine-600); text-decoration-thickness: 1px; text-underline-offset: 3px; transition: color .15s var(--ease), text-decoration-color .15s var(--ease); }
a:hover { color: var(--pine); text-decoration-thickness: 2px; }
:focus-visible { outline: 3px solid var(--amber); outline-offset: 2px; border-radius: 4px; }
.wrap { max-width: 1140px; margin: 0 auto; padding: 0 24px; }
.narrow { max-width: 800px; }
.section { padding-top: 56px; padding-bottom: 24px; }
.lead { font-size: 1.15rem; color: var(--muted); max-width: 44em; }
.muted { color: var(--muted); }
.small { font-size: .9rem; }
.skip { position: absolute; left: -9999px; top: 8px; z-index: 50; background: var(--surface); padding: 10px 14px; border-radius: var(--r-sm); }
.skip:focus { left: 12px; }

/* header / footer */
.top { background: var(--surface); border-bottom: 1px solid var(--line); }
.top__inner { display: flex; align-items: center; justify-content: space-between; gap: 12px 20px; min-height: 64px; flex-wrap: wrap; }
.logo { font-family: var(--display); font-weight: 800; font-size: 1.2rem; letter-spacing: -.02em; color: var(--pine); text-decoration: none; display: inline-flex; align-items: center; min-height: 44px; }
.logo:hover { color: var(--pine); }
.nav { display: flex; gap: 4px; flex-wrap: wrap; }
.nav a { color: var(--ink); text-decoration: none; font-weight: 600; font-size: .97rem; padding: 10px 12px; border-radius: var(--r-sm); min-height: 44px; display: inline-flex; align-items: center; transition: background .15s var(--ease); }
.nav a:hover { background: var(--pine-50); color: var(--pine); }
.foot { margin-top: 72px; padding: 32px 0 40px; background: var(--surface); border-top: 1px solid var(--line); font-size: .92rem; color: var(--muted); }
.foot a { color: var(--ink); }

/* hero: flat pine ground, enters once */
.hero { background: var(--pine); color: #fff; padding: 72px 0 64px; }
.hero__inner { max-width: 1140px; }
.hero h1 { color: #fff; max-width: 17em; }
.hero .lead { color: #cfe3d9; max-width: 40em; }
.eyebrow { display: inline-block; font-size: .85rem; font-weight: 600; letter-spacing: .02em; color: #e7f1ec; border: 1px solid rgba(255,255,255,.28); border-radius: 999px; padding: 4px 12px; margin-bottom: 20px; }
.hero__note { color: #b9d4c7; font-size: .95rem; margin: 14px 0 0; }
.enter > * { animation: enter .7s var(--ease) both; }
.enter > *:nth-child(2) { animation-delay: .06s; }
.enter > *:nth-child(3) { animation-delay: .12s; }
.enter > *:nth-child(4) { animation-delay: .18s; }
.enter > *:nth-child(n+5) { animation-delay: .24s; }
@keyframes enter { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }

/* bonus strip */
.bonus-wrap { margin-top: -24px; position: relative; }
.bonus { background: var(--amber-50); border: 1px solid var(--amber-line); border-radius: var(--r-md); padding: 16px 20px; margin: 20px 0; color: var(--amber-ink); }
.bonus p { margin: 0; }
.bonus a { color: var(--amber-ink); font-weight: 600; }

/* search form */
.search { display: flex; gap: 12px; align-items: flex-end; flex-wrap: wrap; background: var(--surface); color: var(--ink); padding: 18px; border-radius: var(--r-md); border: 1px solid var(--line); margin: 24px 0 0; max-width: 900px; }
.hero .search { border-color: transparent; }
.search__field { display: flex; flex-direction: column; gap: 6px; font-weight: 600; font-size: .9rem; min-width: 200px; }
.search__field--grow { flex: 1; }
.search select, .search input, .filters select, .form input, .form select, .form textarea {
  font: inherit; font-size: 1rem; padding: 11px 12px; min-height: 48px; border: 1px solid var(--line-strong); border-radius: var(--r-sm); background: var(--surface); color: var(--ink); width: 100%; transition: border-color .15s var(--ease); }
.search :is(input, select):hover, .form :is(input, select, textarea):hover { border-color: var(--muted); }
.search :is(input, select):focus, .form :is(input, select, textarea):focus { outline: 3px solid rgba(255,197,61,.55); outline-offset: 0; border-color: #c99400; }

/* buttons: one pair (primary amber, secondary outline) + the add toggle */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; font: inherit; font-weight: 700; font-size: .97rem; min-height: 48px; padding: 10px 18px; border-radius: var(--r-sm); border: 1px solid transparent; cursor: pointer; text-decoration: none; white-space: nowrap;
  transition: transform .12s var(--ease), background .15s var(--ease), border-color .15s var(--ease), color .15s var(--ease); }
.btn:hover { transform: translateY(-1px); text-decoration: none; }
.btn:active { transform: translateY(1px); }
.btn--primary { background: var(--amber); color: var(--amber-ink); }
.btn--primary:hover { background: var(--amber-hover); color: var(--amber-ink); }
.btn--ghost { background: var(--surface); border-color: var(--line-strong); color: var(--ink); font-weight: 600; }
.btn--ghost:hover { border-color: var(--pine-600); color: var(--pine); }
.btn--add { background: var(--surface); border-color: var(--pine-600); color: var(--pine-600); font-weight: 600; }
.btn--add:hover { background: var(--pine-50); color: var(--pine); }
.btn--add.is-on { background: var(--pine-600); color: #fff; }
.btn--add:disabled { opacity: .45; cursor: not-allowed; transform: none; }
.btn--big { width: 100%; font-size: 1.05rem; min-height: 54px; }
.link { background: none; border: 0; color: var(--pine-600); cursor: pointer; text-decoration: underline; text-underline-offset: 3px; font: inherit; font-size: .92rem; min-height: 44px; }
.arrow-link { font-weight: 700; text-decoration: none; display: inline-flex; align-items: center; gap: 6px; min-height: 44px; }
.arrow-link::after { content: "→"; transition: transform .15s var(--ease); }
.arrow-link:hover::after { transform: translateX(3px); }

/* rebate estimator */
.est { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); gap: 20px; align-items: start; margin-top: 24px; }
.est__form fieldset { border: 1px solid var(--line); border-radius: var(--r-md); background: var(--surface); padding: 16px 18px 14px; margin: 0 0 12px; }
.est__form legend { font-family: var(--display); font-weight: 600; font-size: 1.05rem; padding: 0 6px; }
.opts { display: flex; flex-wrap: wrap; gap: 8px; }
.opts--stack { flex-direction: column; }
.opt { position: relative; display: inline-flex; }
.opt input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.opt span { display: inline-flex; align-items: center; min-height: 44px; padding: 9px 16px; border: 1px solid var(--line-strong); border-radius: 999px; background: var(--surface); font-weight: 500; cursor: pointer;
  transition: background .15s var(--ease), border-color .15s var(--ease), color .15s var(--ease); }
.opts--stack .opt span { border-radius: var(--r-sm); width: 100%; }
.opt:hover span { border-color: var(--pine-600); }
.opt input:checked + span { background: var(--pine-600); border-color: var(--pine-600); color: #fff; }
.opt input:focus-visible + span { outline: 3px solid var(--amber); outline-offset: 2px; }
.est__units { display: inline-flex; align-items: center; gap: 10px; margin-top: 12px; font-weight: 600; }
.est__units select { font: inherit; min-height: 44px; padding: 6px 10px; border: 1px solid var(--line-strong); border-radius: var(--r-sm); background: var(--surface); }
.est__result { position: sticky; top: 16px; background: var(--pine); color: #fff; border-radius: var(--r-md); padding: 24px; display: flex; flex-direction: column; gap: 12px; }
.est__result p { margin: 0; }
.est__label { font-weight: 600; color: #cfe3d9; }
.est__total { font-family: var(--display); font-weight: 800; font-size: clamp(2.2rem, 4.4vw, 3.2rem); line-height: 1.05; letter-spacing: -.02em; }
.est__lines { list-style: none; margin: 0; padding: 0; border-top: 1px solid rgba(255,255,255,.18); }
.est__lines li { display: flex; justify-content: space-between; gap: 12px; padding: 9px 0; border-bottom: 1px solid rgba(255,255,255,.12); font-size: .95rem; color: #e3efe9; }
.est__lines strong { white-space: nowrap; color: #fff; font-variant-numeric: tabular-nums; }
.est__result .small { color: #b9d4c7; }
.est__result a { color: #fff; }

/* rebates at a glance: the type moment */
.glance { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin: 24px 0 8px; }
.glance__item { display: flex; flex-direction: column; gap: 4px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md); padding: 22px 22px 20px; text-decoration: none; color: var(--ink);
  transition: transform .18s var(--ease), border-color .18s var(--ease); }
.glance__item:hover { transform: translateY(-2px); border-color: var(--pine-600); color: var(--ink); }
.glance__amt { font-family: var(--display); font-weight: 800; font-size: clamp(1.8rem, 3.4vw, 2.6rem); line-height: 1.05; color: var(--pine); letter-spacing: -.02em; }
.glance__what { font-weight: 600; color: var(--muted); }

/* steps, links, callouts */
.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; padding: 0; margin: 20px 0 0; list-style: none; counter-reset: s; }
.steps li { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md); padding: 20px; counter-increment: s; }
.steps li::before { content: counter(s); display: block; font-family: var(--display); font-weight: 800; font-size: 1.6rem; color: var(--pine-600); margin-bottom: 6px; }
.townlinks { display: flex; flex-wrap: wrap; gap: 8px; margin: 12px 0 24px; }
.townlinks a { background: var(--surface); border: 1px solid var(--line); padding: 8px 14px; min-height: 44px; display: inline-flex; align-items: center; border-radius: 999px; text-decoration: none; font-weight: 500; font-size: .95rem; color: var(--ink);
  transition: border-color .15s var(--ease), transform .15s var(--ease); }
.townlinks a:hover { border-color: var(--pine-600); color: var(--pine); transform: translateY(-1px); }
.callout { background: var(--pine-50); border-radius: var(--r-md); padding: 32px; }
.callout p { max-width: 44em; }
.info--top { margin-top: 0; }
.info { background: var(--pine-50); border-radius: var(--r-md); padding: 14px 18px; margin: 20px 0; }
.crumbs { font-size: .92rem; color: var(--muted); }
.crumbs a { color: var(--muted); }
.cta-row { display: flex; gap: 10px; flex-wrap: wrap; margin: 16px 0 24px; }
details.county { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md); padding: 4px 16px; margin-bottom: 8px; }
details.county summary { cursor: pointer; font-weight: 700; min-height: 44px; display: flex; align-items: center; }
.prose h2 { margin-top: 1.6em; }

/* rebate tables */
.rebate { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md); padding: 22px; margin: 20px 0; }
.table-wrap { overflow-x: auto; margin: 12px 0 16px; }
.rtable { width: 100%; border-collapse: collapse; font-size: .97rem; min-width: 520px; background: var(--surface); }
.rtable th, .rtable td { text-align: left; padding: 11px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
.rtable thead th { font-size: .82rem; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); font-weight: 700; border-bottom: 2px solid var(--line-strong); }
.rtable tbody th { font-weight: 600; }
.rtable td { font-variant-numeric: tabular-nums; white-space: nowrap; }
.notes { padding-left: 1.2em; color: var(--ink); }
.notes li { margin-bottom: 4px; }
.rv { border-left: 3px solid var(--line-strong); padding: 4px 0 4px 12px; }
.rv--yes { border-color: var(--pine-600); }
.guide { padding-top: 12px; }
.guide .rebate { margin-top: 8px; }
.tiers-dl dt { font-weight: 700; margin-top: 12px; }
.tiers-dl dd { margin: 2px 0 0; color: var(--muted); }

/* installer cards: one style */
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(330px, 1fr)); gap: 12px; margin: 16px 0; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md); padding: 18px; position: relative; display: flex; flex-direction: column; gap: 8px;
  transition: transform .18s var(--ease), border-color .18s var(--ease); }
.card:hover { transform: translateY(-2px); border-color: var(--line-strong); }
.card--sponsored { border-color: var(--amber-line); background: #fffdf6; }
.sponsored-tag { position: absolute; top: 14px; right: 14px; font-size: .74rem; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; background: var(--amber-50); color: var(--amber-ink); border: 1px solid var(--amber-line); padding: 2px 8px; border-radius: 999px; }
.card__name { margin: 0; font-family: var(--display); font-size: 1.12rem; font-weight: 600; padding-right: 96px; }
.card__name a { color: var(--ink); text-decoration: none; }
.card__name a:hover { color: var(--pine-600); text-decoration: underline; }
.card__where { margin: 0; color: var(--muted); font-size: .95rem; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { font-size: .78rem; font-weight: 500; background: #eef2f0; color: #45504a; padding: 2px 9px; border-radius: 999px; }
.chip--on { background: var(--pine-600); color: #fff; }
.card__actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: auto; padding-top: 8px; }
.card__actions .btn { min-height: 44px; padding: 8px 12px; font-size: .9rem; }

/* search page */
.filters { display: flex; flex-wrap: wrap; gap: 12px 20px; align-items: center; margin: 16px 0 8px; font-size: .97rem; }
.filters select { width: auto; min-height: 44px; padding: 8px 10px; }
.check { display: inline-flex; gap: 8px; align-items: center; min-height: 44px; }
.check input { width: 20px; height: 20px; accent-color: var(--pine-600); }
.summary { font-size: 1.05rem; margin-top: 8px; }
.map { height: 400px; border-radius: var(--r-md); border: 1px solid var(--line); margin: 12px 0; }

/* vendor page */
.badge { display: inline-block; background: var(--pine-50); color: var(--pine); font-weight: 700; padding: 5px 12px; border-radius: 999px; font-size: .9rem; }
.vendor__grid { display: grid; grid-template-columns: 1fr 360px; gap: 28px; margin-top: 24px; }
.panel { background: var(--surface); border: 1px solid var(--line); padding: 22px; border-radius: var(--r-md); align-self: start; display: flex; flex-direction: column; gap: 10px; }
.panel p { margin: 0; }
.list { padding-left: 1.2em; }
.list li { margin-bottom: 4px; }

/* forms */
.form fieldset { border: 1px solid var(--line); border-radius: var(--r-md); background: var(--surface); padding: 18px 20px 6px; margin: 0 0 16px; }
.form legend { font-family: var(--display); font-weight: 600; font-size: 1.05rem; padding: 0 6px; }
.form label { display: block; font-weight: 600; margin-bottom: 14px; font-size: .97rem; }
.form label input, .form label select, .form label textarea { margin-top: 6px; font-weight: 400; }
.form .check { display: flex; align-items: flex-start; font-weight: 400; }
.form .check input { flex: none; margin-top: 3px; }
.consent { font-size: .93rem; color: var(--muted); margin: 8px 0 16px; }
.hp { position: absolute !important; left: -9999px !important; }
.picked { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 6px 0; border-bottom: 1px solid var(--line); }
.error { background: #fdeceb; color: #84160f; padding: 12px 16px; border-radius: var(--r-sm); }
.done { background: var(--surface); border: 1px solid var(--line); padding: 28px; border-radius: var(--r-md); }
.tiers { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; margin: 24px 0 32px; }
.tier { background: var(--surface); border: 1px solid var(--line); padding: 20px; border-radius: var(--r-md); }
.tier--hi { border-color: var(--amber-line); background: #fffdf6; }
.tier p { margin: 0; font-size: .97rem; }

/* sticky quote bar */
.quote-bar { position: fixed; left: 0; right: 0; bottom: 0; background: var(--pine); color: #fff; z-index: 40; border-top: 1px solid rgba(255,255,255,.12); }
.quote-bar__inner { display: flex; justify-content: space-between; align-items: center; gap: 12px; min-height: 72px; }

@media (max-width: 900px) {
  .est { grid-template-columns: 1fr; }
  .est__result { position: static; }
  .glance { grid-template-columns: repeat(2, 1fr); }
  .steps { grid-template-columns: 1fr; }
}
@media (max-width: 760px) {
  body { font-size: 16px; }
  .wrap { padding: 0 18px; }
  .hero { padding: 44px 0 40px; }
  .section { padding-top: 40px; }
  .search { flex-direction: column; align-items: stretch; padding: 14px; }
  .search__field { min-width: 0; }
  .search .btn { width: 100%; }
  .vendor__grid, .tiers { grid-template-columns: 1fr; }
  .cards { grid-template-columns: 1fr; }
  .callout { padding: 24px; }
  .bonus-wrap { margin-top: 0; }
  .top__inner { padding-top: 6px; padding-bottom: 4px; }
  .nav { flex-wrap: nowrap; overflow-x: auto; width: calc(100% + 18px); margin-right: -18px; scrollbar-width: none; }
  .nav::-webkit-scrollbar { display: none; }
  .nav a { padding: 8px 10px; font-size: .93rem; white-space: nowrap; }
  .nav a:first-child { padding-left: 0; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
