/* =========================================================
   Ontario Furnace Rebates — design system
   Tokens (primitive -> semantic) + components
   ========================================================= */
:root {
  /* Brand / palette */
  --ink:        #0c1a2b;   /* primary text (near-navy) */
  --ink-soft:   #28384c;
  --muted:      #586a80;   /* secondary text (>=4.5:1 on white) */
  --bg:         #ffffff;
  --bg-alt:     #f3f7fc;   /* cool light section */
  --line:       #e2e8f0;
  --line-soft:  #eef2f7;

  --brand:      #0f5fcd;   /* trustworthy blue (links / secondary) */
  --brand-700:  #0c4ba6;
  --brand-050:  #eaf2ff;

  --heat:       #f97316;   /* energetic orange — decorative accents */
  --heat-700:   #c2410c;   /* fills with white text (>=5:1) */
  --heat-800:   #9a3412;
  --heat-050:   #fff2e8;

  --cool:       #0ea5b7;   /* teal — cooling accent */
  --cool-050:   #e6f7f9;

  --ok:         #16a34a;
  --err:        #d12c2c;

  /* Type */
  --font-head: "Plus Jakarta Sans", system-ui, sans-serif;
  --font-body: "Inter", system-ui, -apple-system, Segoe UI, Roboto, sans-serif;

  /* Radius / shadow */
  --r-sm: 8px;
  --r:    14px;
  --r-lg: 22px;
  --shadow-sm: 0 1px 2px rgba(12,26,43,.06), 0 2px 6px rgba(12,26,43,.05);
  --shadow:    0 10px 30px rgba(12,26,43,.10);
  --shadow-lg: 0 24px 60px rgba(12,26,43,.16);

  /* Spacing rhythm (8pt) */
  --container: 1180px;
  --gap: clamp(2.5rem, 6vw, 5rem);

  /* z-scale */
  --z-header: 100;
  --z-mobilebar: 90;
}

/* ---------- Reset / base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.65;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3 { font-family: var(--font-head); line-height: 1.15; color: var(--ink); margin: 0 0 .5em; letter-spacing: -.01em; }
h1 { font-size: clamp(2rem, 4.6vw, 3.25rem); font-weight: 800; }
h2 { font-size: clamp(1.6rem, 3.2vw, 2.4rem); font-weight: 700; }
h3 { font-size: 1.18rem; font-weight: 700; }
p  { margin: 0 0 1rem; }
img { max-width: 100%; height: auto; display: block; }
a  { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }

:focus-visible {
  outline: 3px solid var(--brand);
  outline-offset: 2px;
  border-radius: 4px;
}

.container { width: 100%; max-width: var(--container); margin-inline: auto; padding-inline: clamp(1rem, 4vw, 2rem); }

.skip-link {
  position: absolute; left: -999px; top: 0; z-index: 200;
  background: var(--ink); color: #fff; padding: .7rem 1rem; border-radius: 0 0 var(--r-sm) 0;
}
.skip-link:focus { left: 0; }

.eyebrow {
  font-family: var(--font-head); font-weight: 700; font-size: .8rem;
  letter-spacing: .08em; text-transform: uppercase; color: var(--heat-700);
  margin: 0 0 .6rem;
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
  font-family: var(--font-head); font-weight: 700; font-size: 1rem;
  padding: .8rem 1.4rem; border-radius: 999px; border: 2px solid transparent;
  cursor: pointer; transition: transform .15s ease, background-color .15s ease, box-shadow .15s ease, color .15s ease;
  min-height: 48px; text-decoration: none; line-height: 1;
}
.btn:hover { text-decoration: none; transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn-lg { padding: 1rem 1.7rem; font-size: 1.05rem; }
.btn-block { width: 100%; }

.btn-primary { background: var(--heat-700); color: #fff; box-shadow: var(--shadow-sm); }
.btn-primary:hover { background: var(--heat-800); color: #fff; }

.btn-accent { background: #fff; color: var(--heat-800); }
.btn-accent:hover { background: var(--heat-050); color: var(--heat-800); }

.btn-ghost { background: transparent; color: var(--brand-700); border-color: var(--line); }
.btn-ghost:hover { background: var(--brand-050); border-color: var(--brand); color: var(--brand-700); }

.btn-ghost-light { background: transparent; color: #fff; border-color: rgba(255,255,255,.5); }
.btn-ghost-light:hover { background: rgba(255,255,255,.12); color: #fff; }

/* ---------- Header ---------- */
.site-header {
  position: sticky; top: 0; z-index: var(--z-header);
  background: rgba(255,255,255,.92);
  backdrop-filter: saturate(140%) blur(10px);
  border-bottom: 1px solid var(--line);
}
.header-inner { display: flex; align-items: center; gap: 1rem; min-height: 72px; }
.brand { display: inline-flex; align-items: center; gap: .6rem; color: var(--ink); }
.brand:hover { text-decoration: none; }
.brand-mark {
  display: grid; place-items: center; width: 42px; height: 42px; border-radius: 12px;
  background: linear-gradient(135deg, var(--heat) 0%, var(--heat-700) 100%);
  color: #fff; flex: none; box-shadow: var(--shadow-sm);
}
.brand-text { display: flex; flex-direction: column; line-height: 1.1; }
.brand-text strong { font-family: var(--font-head); font-size: 1.05rem; font-weight: 800; }
.brand-text small { color: var(--muted); font-size: .72rem; }

.main-nav { display: none; margin-inline: auto; gap: 1.6rem; }
.main-nav a { color: var(--ink-soft); font-weight: 500; font-size: .98rem; }
.main-nav a:hover { color: var(--brand-700); text-decoration: none; }

.header-cta { display: none; align-items: center; gap: 1rem; margin-left: auto; }

/* nav toggle (mobile) */
.nav-toggle {
  margin-left: auto; width: 46px; height: 46px; border: 1px solid var(--line);
  background: #fff; border-radius: 12px; display: grid; place-items: center; gap: 4px; cursor: pointer;
}
.nav-toggle span { display: block; width: 20px; height: 2px; background: var(--ink); border-radius: 2px; transition: transform .2s, opacity .2s; }
.nav-toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(6px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.nav-toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }

.mobile-menu { border-top: 1px solid var(--line); background: #fff; }
.mobile-menu nav { display: flex; flex-direction: column; padding: .5rem 1rem 1.2rem; gap: .25rem; }
.mobile-menu a { padding: .85rem .5rem; color: var(--ink-soft); font-weight: 600; border-bottom: 1px solid var(--line-soft); }
.mobile-menu a:hover { text-decoration: none; color: var(--brand-700); }
.mobile-menu .btn { margin-top: .8rem; }

/* ---------- Hero ---------- */
.hero {
  position: relative;
  background:
    radial-gradient(1200px 500px at 110% -10%, var(--cool-050), transparent 60%),
    linear-gradient(180deg, var(--brand-050) 0%, #fff 55%);
  padding: clamp(2.5rem, 6vw, 4.5rem) 0 clamp(2.5rem, 6vw, 4rem);
  overflow: hidden;
}
.hero::before {
  content: ""; position: absolute; inset: 0;
  background: url("../assets/img/hero.webp") center/cover no-repeat;
  opacity: .10; mix-blend-mode: multiply; pointer-events: none;
}
.hero-grid { position: relative; display: grid; gap: var(--gap); align-items: center; grid-template-columns: 1fr; }
.hero-copy .lead { font-size: 1.12rem; color: var(--ink-soft); max-width: 56ch; }

.hero-badges { list-style: none; padding: 0; margin: 1.5rem 0; display: flex; flex-wrap: wrap; gap: .6rem 1.4rem; }
.hero-badges li { display: inline-flex; align-items: center; gap: .5rem; font-weight: 600; color: var(--ink-soft); font-size: .96rem; }
.hero-badges svg { color: var(--ok); flex: none; }

.hero-actions { display: flex; flex-wrap: wrap; gap: .8rem; }

/* Quote card */
.quote-card {
  background: #fff; border: 1px solid var(--line); border-radius: var(--r-lg);
  box-shadow: var(--shadow-lg); padding: clamp(1.3rem, 3vw, 2rem);
  scroll-margin-top: 90px;
}
.quote-card h2 { font-size: 1.4rem; margin-bottom: .25rem; }
.quote-sub { color: var(--muted); font-size: .92rem; margin-bottom: 1.1rem; }

.field { margin-bottom: .9rem; }
.field-row { display: grid; gap: .9rem; grid-template-columns: 1fr 1fr; }
.field label { display: block; font-weight: 600; font-size: .88rem; margin-bottom: .35rem; color: var(--ink-soft); }
.field label span { color: var(--heat-700); }
.field input, .field textarea {
  width: 100%; font: inherit; color: var(--ink);
  padding: .7rem .85rem; border: 1.5px solid var(--line); border-radius: var(--r-sm);
  background: #fff; transition: border-color .15s, box-shadow .15s; min-height: 46px;
}
.field textarea { min-height: auto; resize: vertical; }
.field input::placeholder, .field textarea::placeholder { color: #97a4b5; }
.field input:focus, .field textarea:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-050); }
.field input[aria-invalid="true"], .field textarea[aria-invalid="true"] { border-color: var(--err); }
.error { color: var(--err); font-size: .8rem; margin: .3rem 0 0; min-height: 0; }
.error:empty { display: none; }

.form-status { font-weight: 600; margin: .8rem 0 0; }
.form-status.is-ok { color: var(--ok); }
.form-status.is-err { color: var(--err); }
.form-fineprint { color: var(--muted); font-size: .78rem; margin: .7rem 0 0; }

/* ---------- Trust bar ---------- */
.trust-bar { background: var(--ink); color: #fff; }
.trust-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1rem 1.5rem; padding: 1.4rem 0; }
.trust-grid div { display: flex; flex-direction: column; }
.trust-grid strong { font-family: var(--font-head); font-size: 1.05rem; }
.trust-grid span { color: #b8c6d8; font-size: .85rem; }

/* ---------- Sections ---------- */
.section { padding: var(--gap) 0; }
.section-alt { background: var(--bg-alt); }
.section-head { max-width: 720px; margin: 0 auto clamp(1.8rem, 4vw, 2.8rem); text-align: center; }
.section-head-left { text-align: left; margin-inline: 0; }
.section-intro { color: var(--muted); font-size: 1.05rem; }

/* Cards grid */
.cards-3 { display: grid; gap: 1.2rem; grid-template-columns: 1fr; }
.card {
  background: #fff; border: 1px solid var(--line); border-radius: var(--r);
  padding: 1.6rem; box-shadow: var(--shadow-sm);
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}
.card:hover { transform: translateY(-4px); box-shadow: var(--shadow); border-color: #d6e0ee; }
.card p { color: var(--muted); margin: 0; font-size: .96rem; }
.card-icon { width: 52px; height: 52px; border-radius: 14px; display: grid; place-items: center; margin-bottom: 1rem; }
.icon-cool { background: var(--cool-050); color: var(--cool); }
.icon-heat { background: var(--heat-050); color: var(--heat-700); }
.icon-air  { background: var(--brand-050); color: var(--brand); }

.service-chips { list-style: none; padding: 0; margin: 1.8rem 0 0; display: flex; flex-wrap: wrap; gap: .6rem; justify-content: center; }
.service-chips li {
  background: #fff; border: 1px solid var(--line); border-radius: 999px;
  padding: .5rem 1rem; font-size: .88rem; font-weight: 600; color: var(--ink-soft);
}

/* Steps */
.steps { list-style: none; counter-reset: none; padding: 0; margin: 0; display: grid; gap: 1.2rem; grid-template-columns: 1fr; }
.step { position: relative; background: #fff; border: 1px solid var(--line); border-radius: var(--r); padding: 1.6rem 1.6rem 1.6rem 1.6rem; box-shadow: var(--shadow-sm); }
.step-num {
  display: grid; place-items: center; width: 40px; height: 40px; border-radius: 12px;
  background: linear-gradient(135deg, var(--heat) 0%, var(--heat-700) 100%); color: #fff;
  font-family: var(--font-head); font-weight: 800; margin-bottom: .9rem;
}
.step p { color: var(--muted); margin: 0; font-size: .96rem; }

/* About */
.about-grid { display: grid; gap: var(--gap); grid-template-columns: 1fr; align-items: center; }
.about-media { position: relative; }
.about-media > img { border-radius: var(--r-lg); box-shadow: var(--shadow); width: 100%; object-fit: cover; aspect-ratio: 4 / 3; }
.about-badge {
  position: absolute; right: -8px; bottom: -16px; display: flex; align-items: center; gap: .6rem;
  background: #fff; border: 1px solid var(--line); border-radius: var(--r);
  padding: .7rem .9rem; box-shadow: var(--shadow); font-family: var(--font-head); font-weight: 700; font-size: .82rem; line-height: 1.2;
}
.about-badge img { width: 44px; height: 44px; }
.about-copy p { color: var(--ink-soft); }

/* Reviews */
.review { background: #fff; border: 1px solid var(--line); border-radius: var(--r); padding: 1.6rem; box-shadow: var(--shadow-sm); margin: 0; }
.stars { color: #f59e0b; letter-spacing: 2px; margin-bottom: .6rem; font-size: 1.05rem; }
.review blockquote { margin: 0 0 1rem; font-size: 1.02rem; color: var(--ink-soft); }
.review figcaption { display: flex; align-items: center; gap: .6rem; font-weight: 600; color: var(--ink); font-size: .92rem; }
.avatar {
  display: grid; place-items: center; width: 38px; height: 38px; border-radius: 50%;
  background: var(--brand-050); color: var(--brand-700); font-family: var(--font-head); font-weight: 800; font-size: .82rem;
}

/* FAQ */
.faq-grid { display: grid; gap: var(--gap); grid-template-columns: 1fr; align-items: start; }
.faq-list { display: grid; gap: .7rem; }
.faq-item { background: #fff; border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; }
.faq-item summary {
  cursor: pointer; list-style: none; padding: 1.05rem 1.2rem; font-family: var(--font-head); font-weight: 700;
  color: var(--ink); display: flex; justify-content: space-between; align-items: center; gap: 1rem;
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after {
  content: "+"; font-size: 1.4rem; color: var(--heat-700); font-weight: 700; line-height: 1; transition: transform .2s ease; flex: none;
}
.faq-item[open] summary::after { content: "−"; }
.faq-item summary:hover { color: var(--brand-700); }
.faq-body { padding: 0 1.2rem 1.1rem; }
.faq-body p { color: var(--muted); margin: 0; }

/* CTA band */
.cta-band {
  background: linear-gradient(135deg, var(--ink) 0%, #15324f 60%, var(--brand-700) 130%);
  color: #fff;
}
.cta-inner { display: grid; gap: 1.6rem; padding: clamp(2.5rem, 6vw, 4rem) 0; align-items: center; grid-template-columns: 1fr; }
.cta-inner h2 { color: #fff; }
.cta-inner p { color: #cdd9e8; max-width: 60ch; margin: 0; }
.cta-actions { display: flex; flex-wrap: wrap; gap: .8rem; }

/* Footer */
.site-footer { background: #0a1626; color: #c2cedd; padding: clamp(2.5rem, 5vw, 3.5rem) 0 1.5rem; }
.footer-grid { display: grid; gap: 2rem; grid-template-columns: 1fr; }
.footer-brand .brand { color: #fff; margin-bottom: .8rem; }
.footer-brand .brand strong { font-size: 1.05rem; }
.footer-brand p { color: #93a4b8; font-size: .92rem; max-width: 42ch; }
.footer-col h3 { color: #fff; font-size: .95rem; margin-bottom: .9rem; }
.footer-col ul { list-style: none; padding: 0; margin: 0; display: grid; gap: .5rem; }
.footer-col a, address a { color: #c2cedd; }
.footer-col a:hover, address a:hover { color: #fff; }
address { font-style: normal; line-height: 1.9; font-size: .92rem; }
.areas { grid-template-columns: 1fr 1fr; display: grid; }
.footer-bottom {
  display: flex; flex-wrap: wrap; gap: .5rem; justify-content: space-between;
  border-top: 1px solid rgba(255,255,255,.1); margin-top: 2.2rem; padding-top: 1.2rem; font-size: .85rem; color: #8294aa;
}
.footer-bottom a { color: #8294aa; }
.footer-bottom a:hover { color: #fff; }

/* Sticky mobile bar */
.mobile-bar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: var(--z-mobilebar);
  display: none; gap: .6rem; padding: .6rem .8rem calc(.6rem + env(safe-area-inset-bottom));
  background: rgba(255,255,255,.96); backdrop-filter: blur(8px); border-top: 1px solid var(--line);
  transform: translateY(120%); transition: transform .25s ease;
}
.mobile-bar.show { transform: translateY(0); }
.mobile-bar a { flex: 1; display: inline-flex; align-items: center; justify-content: center; gap: .4rem; min-height: 50px; border-radius: 12px; font-family: var(--font-head); font-weight: 700; }
.mb-quote { background: var(--heat-700); color: #fff; }
.mb-quote:hover { text-decoration: none; }

/* ---------- Reveal animation ---------- */
.reveal { opacity: 0; transform: translateY(16px); transition: opacity .6s ease, transform .6s ease; }
.reveal.in { opacity: 1; transform: none; }

/* anchor offset for sticky header */
section[id], [id]#quote { scroll-margin-top: 84px; }

/* ---------- Responsive ---------- */
@media (min-width: 600px) {
  .trust-grid { grid-template-columns: repeat(4, 1fr); }
  .cards-3 { grid-template-columns: repeat(2, 1fr); }
  .steps { grid-template-columns: repeat(3, 1fr); }
}
@media (min-width: 720px) {
  .footer-grid { grid-template-columns: 2fr 1.4fr 1fr 1fr; }
  .cta-inner { grid-template-columns: 1.5fr 1fr; }
  .cta-actions { justify-content: flex-end; }
}
@media (min-width: 880px) {
  .cards-3 { grid-template-columns: repeat(3, 1fr); }
  .hero-grid { grid-template-columns: 1.1fr .9fr; }
  .about-grid { grid-template-columns: 1fr 1fr; }
  .faq-grid { grid-template-columns: .9fr 1.1fr; }
}
@media (min-width: 980px) {
  .main-nav { display: flex; }
  .header-cta { display: flex; }
  .nav-toggle { display: none; }
}
@media (max-width: 979px) {
  .mobile-bar { display: flex; }
  .site-footer { padding-bottom: 5.5rem; }
}

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .001ms !important; transition-duration: .001ms !important; }
  .reveal { opacity: 1; transform: none; }
}
