/* Solarpex — Tesla-style theme: white space, #171A20 ink, green reserved for buttons/links */
:root {
  --ink: #171A20;
  --gray: #5C5E62;
  --gray-light: #F4F4F4;
  --line: rgba(23, 26, 32, 0.1);
  --green: #128030;          /* primary actions — deep enough for white text */
  --green-dark: #0D6123;
  --brand-green: #31C948;    /* logo only */
  --head: "Montserrat", sans-serif;
  --body: "Inter", sans-serif;
  --container: 1200px;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  font-family: var(--body);
  color: var(--ink);
  background: #fff;
  line-height: 1.6;
  font-size: 15px;
}

img, svg, video { max-width: 100%; display: block; }

.container { max-width: var(--container); margin-inline: auto; padding-inline: 24px; }

h1, h2, h3, h4 { font-family: var(--head); font-weight: 500; line-height: 1.2; }
h1 { font-size: clamp(2rem, 4.5vw, 3.4rem); letter-spacing: 0.01em; }
h2 { font-size: clamp(1.5rem, 2.8vw, 2.2rem); }
h3 { font-size: 1.05rem; margin-bottom: 0.4rem; font-weight: 600; }

p { color: var(--gray); }

a { color: inherit; }
a:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible {
  outline: 3px solid var(--green);
  outline-offset: 2px;
}

.section { padding-block: clamp(56px, 8vw, 96px); }
.section-head { text-align: center; max-width: 620px; margin: 0 auto clamp(32px, 5vw, 56px); }
.section-head p { margin-top: 0.6rem; font-size: 0.95rem; }

/* Buttons — Tesla style: 4px radius, 14px medium, generous width */
.btn {
  display: inline-block;
  font-family: var(--body);
  font-weight: 500;
  font-size: 14px;
  text-align: center;
  text-decoration: none;
  border: none;
  border-radius: 4px;
  padding: 12px 24px;
  min-width: 200px;
  cursor: pointer;
  transition: background-color 0.2s ease, color 0.2s ease, opacity 0.2s ease;
}
.btn-primary { background: var(--green); color: #fff; }
.btn-primary:hover { background: var(--green-dark); }
.btn-secondary { background: rgba(255, 255, 255, 0.65); color: #26282d; backdrop-filter: blur(8px); }
.btn-secondary:hover { background: rgba(255, 255, 255, 0.85); }
.btn-outline { background: transparent; color: var(--ink); box-shadow: inset 0 0 0 2px var(--ink); }
.btn-outline:hover { background: var(--ink); color: #fff; }

.text-link { color: var(--green); font-weight: 500; text-decoration: none; }
.text-link:hover { text-decoration: underline; text-underline-offset: 4px; }

/* Header — slim Tesla nav */
.site-header {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 50;
  transition: background-color 0.25s ease, box-shadow 0.25s ease;
}
.site-header.solid, .site-header.subpage {
  position: sticky;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(12px);
}
.site-header.scrolled { background: rgba(255, 255, 255, 0.95); backdrop-filter: blur(12px); box-shadow: 0 1px 0 var(--line); }
.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  height: 56px;
}
.brand {
  font-family: var(--head);
  font-weight: 600;
  font-size: 1.1rem;
  letter-spacing: 0.02em;
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 8px;
}
.brand-mark { width: 26px; height: 26px; }
.nav-links {
  display: flex;
  align-items: center;
  gap: 6px;
  list-style: none;
  margin-inline: auto;
}
.nav-links a {
  text-decoration: none;
  font-weight: 500;
  font-size: 14px;
  padding: 6px 12px;
  border-radius: 4px;
}
.nav-links a:hover { background: rgba(23, 26, 32, 0.06); }
.nav-cta {
  font-size: 14px;
  font-weight: 500;
  text-decoration: none;
  padding: 6px 14px;
  border-radius: 4px;
  background: rgba(23, 26, 32, 0.06);
}
.nav-cta:hover { background: rgba(23, 26, 32, 0.12); }
/* over hero video the nav text is white until scroll */
.site-header.overlay:not(.scrolled) { color: #fff; }
.site-header.overlay:not(.scrolled) .nav-links a:hover,
.site-header.overlay:not(.scrolled) .nav-cta { background: rgba(255, 255, 255, 0.14); }
.nav-toggle {
  display: none;
  font-family: var(--body);
  font-weight: 500;
  font-size: 14px;
  color: inherit;
  background: rgba(23, 26, 32, 0.06);
  border: none;
  border-radius: 4px;
  padding: 7px 14px;
  cursor: pointer;
}
.site-header.overlay:not(.scrolled) .nav-toggle { background: rgba(255, 255, 255, 0.14); }

/* Full-bleed panels (hero + product sections) — the Tesla stack */
.panel {
  position: relative;
  min-height: 100vh;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  text-align: center;
  overflow: hidden;
  color: #fff;
  padding: 0;
}
.panel-media, .panel-video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: -2;
}

/* Ken Burns — slow alternating zoom on still imagery (not the hero video) */
img.panel-media {
  animation: kenburns 26s ease-in-out infinite alternate;
  will-change: transform;
}
.panel:nth-of-type(odd) img.panel-media { animation-duration: 32s; animation-direction: alternate-reverse; }
@keyframes kenburns {
  from { transform: scale(1); }
  to { transform: scale(1.1); }
}

/* Scroll reveal — JS adds .reveal, IntersectionObserver adds .in-view */
.reveal {
  opacity: 0;
  transform: translateY(26px);
  transition: opacity 0.9s ease, transform 0.9s ease;
}
.reveal.in-view { opacity: 1; transform: none; }
.panel-scrim {
  position: absolute;
  inset: 0;
  z-index: -1;
  background: linear-gradient(180deg, rgba(23, 26, 32, 0.62) 0%, rgba(23, 26, 32, 0.28) 45%, rgba(23, 26, 32, 0.55) 100%);
}
.panel-top { padding-top: clamp(96px, 16vh, 150px); padding-inline: 24px; }
.panel-top h1, .panel-top h2 { font-weight: 500; text-shadow: 0 1px 14px rgba(0, 0, 0, 0.45); }
.panel-top .panel-sub, .panel-top .panel-eyebrow { text-shadow: 0 1px 10px rgba(0, 0, 0, 0.55); }
.panel-sub {
  color: rgba(255, 255, 255, 0.92);
  font-size: 15px;
  max-width: 560px;
  margin: 0.7rem auto 0;
}
.panel-sub a { color: #fff; }
.panel-bottom {
  padding-bottom: clamp(40px, 8vh, 72px);
  padding-inline: 24px;
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  justify-content: center;
  width: 100%;
}
.panel-eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.2em;
  font-size: 11px;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.85);
  margin-bottom: 0.8rem;
}

/* Feature strip — quiet stats under hero */
.feature-strip { border-bottom: 1px solid var(--line); }
.feature-strip-inner {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
  padding-block: 28px;
  text-align: center;
}
.feature-strip-inner div strong {
  font-family: var(--head);
  font-weight: 600;
  font-size: 1.25rem;
  display: block;
  color: var(--ink);
}
.feature-strip-inner div span { font-size: 12.5px; color: var(--gray); }

/* Why / about columns */
.why-cols {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: clamp(24px, 4vw, 48px);
}
.why-col h3 { font-size: 0.95rem; }
.why-col p { font-size: 13.5px; }

/* Process — minimal rows */
.steps { list-style: none; max-width: 760px; margin-inline: auto; }
.step-row {
  display: grid;
  grid-template-columns: 56px 200px 1fr;
  align-items: baseline;
  gap: 18px;
  padding-block: 20px;
  border-bottom: 1px solid var(--line);
}
.step-row:first-child { border-top: 1px solid var(--line); }
.step-num { font-family: var(--head); font-weight: 600; font-size: 13px; color: var(--gray); }
.step-row h3 { font-size: 1rem; margin: 0; }
.step-row p { font-size: 13.5px; }

/* Estimator */
.estimator { background: var(--gray-light); }
.estimator-panel {
  background: #fff;
  border-radius: 8px;
  padding: clamp(24px, 4vw, 40px);
  max-width: 640px;
  margin-inline: auto;
}
.slider-label { display: block; font-weight: 500; font-size: 14px; margin-bottom: 0.8rem; }
.slider-label output { font-family: var(--head); font-weight: 600; font-size: 1.4rem; color: var(--ink); margin-left: 8px; }
input[type="range"] { width: 100%; accent-color: var(--green); height: 32px; cursor: pointer; }
.est-results {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-block: 1.3rem;
}
.est-card { background: var(--gray-light); border-radius: 6px; padding: 14px 10px; text-align: center; }
.est-value { display: block; font-family: var(--head); font-weight: 600; font-size: 1.2rem; }
.est-label { font-size: 11.5px; color: var(--gray); }
.est-cta { width: 100%; }
.fine-print { font-size: 12px; color: var(--gray); text-align: center; max-width: 560px; margin: 14px auto 0; }

/* Reviews — quiet quotes */
.review-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 20px;
  max-width: 1000px;
  margin-inline: auto;
}
.review { border-top: 2px solid var(--ink); padding-top: 18px; font-size: 14px; }
.review footer { margin-top: 0.8rem; font-weight: 500; font-size: 13px; color: var(--ink); }

/* Quote form */
.quote { background: var(--gray-light); }
.quote-form {
  background: #fff;
  border-radius: 8px;
  padding: clamp(24px, 4vw, 40px);
  max-width: 640px;
  margin-inline: auto;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}
.field { display: flex; flex-direction: column; gap: 5px; }
.field-wide { grid-column: 1 / -1; }
.field label { font-weight: 500; font-size: 13px; }
.label-note { font-weight: 400; color: var(--gray); font-size: 11.5px; }
.field input, .field select, .field textarea {
  font: inherit;
  font-size: 14px;
  padding: 10px 12px;
  border: 1px solid rgba(23, 26, 32, 0.25);
  border-radius: 4px;
  background: #fff;
  resize: vertical;
}
.field input:hover, .field select:hover, .field textarea:hover { border-color: var(--ink); }
.contact-line { text-align: center; font-size: 14px; margin-top: 18px; }
.contact-line a { color: var(--green); font-weight: 500; text-decoration: none; }
.form-note { font-size: 11.5px; color: var(--gray); text-align: center; }

/* Subpage layout */
.page-hero {
  position: relative;
  min-height: 46vh;
  display: flex;
  align-items: flex-end;
  color: #fff;
  overflow: hidden;
}
.page-hero .panel-media { z-index: -2; }
.page-hero-scrim {
  position: absolute; inset: 0; z-index: -1;
  background: linear-gradient(180deg, rgba(23,26,32,0.25) 0%, rgba(23,26,32,0.55) 100%);
}
.page-hero-inner { padding-block: 40px; }
.page-hero p { color: rgba(255,255,255,0.9); max-width: 560px; margin-top: 0.5rem; }
.prose { max-width: 720px; margin-inline: auto; }
.prose h2 { margin-bottom: 0.8rem; }
.prose p { margin-bottom: 1rem; font-size: 15px; }
.prose ul { margin: 0 0 1rem 1.2rem; color: var(--gray); }
.prose li { margin-bottom: 0.4rem; }

/* Brand grid (suppliers we install) */
.brand-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 18px;
}
.brand-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 22px 22px 20px;
}
.brand-card h3 { font-size: 1rem; }
.brand-card p { font-size: 13.5px; margin-bottom: 0.8rem; }
.brand-card .text-link { font-size: 13px; }

/* CTA band */
.cta-band { background: var(--gray-light); text-align: center; }
.cta-band .btn { margin-top: 1.2rem; }
.cta-band p { max-width: 560px; margin: 0.5rem auto 0; }

/* Footer — Tesla minimal */
.site-footer { padding-block: 32px; }
.footer-inner {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px 22px;
  font-size: 12.5px;
  color: var(--gray);
}
.footer-inner a { color: var(--gray); text-decoration: none; }
.footer-inner a:hover { color: var(--ink); }

/* Responsive */
@media (max-width: 880px) {
  .feature-strip-inner { grid-template-columns: repeat(2, 1fr); gap: 20px 14px; }
  .feature-strip-inner div span { display: block; line-height: 1.45; }
  .step-row { grid-template-columns: 44px 1fr; }
  .step-row p { grid-column: 2; }
}

@media (max-width: 720px) {
  .nav-toggle { display: block; }
  .nav-links {
    display: none;
    position: absolute;
    top: 56px;
    left: 0; right: 0;
    background: #fff;
    color: var(--ink);
    border-bottom: 1px solid var(--line);
    flex-direction: column;
    align-items: stretch;
    text-align: center;
    padding: 12px 24px 18px;
    gap: 4px;
  }
  .nav-links.open { display: flex; }
  .nav-cta { display: none; }
  .quote-form, .est-results { grid-template-columns: 1fr; }
  .panel { min-height: 92vh; min-height: 92svh; }
  .panel-top { padding-top: 84px; }
  .panel-bottom { flex-direction: column; align-items: center; gap: 12px; }
  .panel-bottom .btn { width: 100%; max-width: 380px; padding-block: 14px; }
  .section-head-split { flex-direction: column; align-items: flex-start; }
  .cta-band .btn, .est-cta { width: 100%; max-width: 380px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .panel-video { display: none; }
  .hero-panel { background: url("https://images.unsplash.com/photo-1583345237708-add35a664d77?auto=format&fit=crop&w=1600&q=60") center / cover no-repeat; }
  .btn, .site-header { transition: none; }
  img.panel-media { animation: none; }
  .reveal { opacity: 1; transform: none; transition: none; }
}
