/* ==========================================================================
   Peak Systems — site styles
   One stylesheet for the whole site. Plain CSS, no build step, no frameworks.
   Colors are set once as variables in :root so the whole site can be
   re-themed from a single place.
   ========================================================================== */

:root {
  /* Brand palette (taken from the Peak Systems logo) */
  --brand:        #0f2c52;  /* deep navy */
  --brand-2:      #163e73;  /* lighter navy for gradients */
  --accent:       #135ac0;  /* solar blue — links & buttons (AA contrast on white) */
  --accent-ink:   #0f4a9c;  /* darker blue for hover */

  /* Neutrals */
  --ink:          #12233b;  /* primary text */
  --muted:        #4c5d72;  /* secondary text */
  --bg:           #ffffff;  /* page background */
  --surface:      #eef3f9;  /* tinted section background */
  --surface-2:    #e4edf7;  /* card / deeper tint */
  --line:         #d6e0ec;  /* borders & dividers */
  --white:        #ffffff;

  /* Shape & depth */
  --radius:       14px;
  --radius-lg:    22px;
  --shadow-sm:    0 1px 2px rgba(15, 44, 82, .06), 0 2px 6px rgba(15, 44, 82, .06);
  --shadow-md:    0 8px 24px rgba(15, 44, 82, .10);
  --shadow-lg:    0 20px 48px rgba(15, 44, 82, .16);

  /* Rhythm */
  --container:    1120px;
  --gap:          clamp(1rem, 2.5vw, 2rem);
  --section-y:    clamp(3.5rem, 8vw, 6rem);

  /* Type */
  --font: system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial,
          "Apple Color Emoji", "Segoe UI Emoji", sans-serif;
}

/* ---------- Base ---------------------------------------------------------- */

*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
  }
}

body {
  margin: 0;
  font-family: var(--font);
  font-size: clamp(1rem, 0.96rem + 0.2vw, 1.125rem);
  line-height: 1.65;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

img { max-width: 100%; height: auto; display: block; }

a { color: var(--accent); text-decoration-thickness: .08em; text-underline-offset: .15em; }
a:hover { color: var(--accent-ink); }

h1, h2, h3 { line-height: 1.15; color: var(--brand); margin: 0 0 .5em; letter-spacing: -.01em; text-wrap: balance; }
h1 { font-size: clamp(2rem, 1.4rem + 3vw, 3.25rem); font-weight: 800; }
h2 { font-size: clamp(1.6rem, 1.2rem + 2vw, 2.4rem); font-weight: 800; }
h3 { font-size: clamp(1.2rem, 1.05rem + .8vw, 1.45rem); font-weight: 700; }
p  { margin: 0 0 1rem; text-wrap: pretty; }

/* Visible keyboard focus everywhere */
:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 2px;
  border-radius: 4px;
}

/* ---------- Layout helpers ------------------------------------------------ */

.container { width: 100%; max-width: var(--container); margin-inline: auto; padding-inline: clamp(1.15rem, 4vw, 2rem); }
.section   { padding-block: var(--section-y); }
/* The header is sticky, so an in-page link (#why-clean) would otherwise drop
   its heading behind the bar. Keep the target clear of it. */
[id] { scroll-margin-top: 5rem; }
.section--tint { background: var(--surface); }
.section--brand {
  background: linear-gradient(160deg, var(--brand), var(--brand-2));
  color: #eaf1fb;
}
.section--brand h2, .section--brand h3 { color: #fff; }

.center { text-align: center; }
.measure { max-width: 62ch; }
.center .measure { margin-inline: auto; }

.eyebrow {
  display: inline-block;
  font-size: .8rem;
  font-weight: 700;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: .6rem;
}
.section--brand .eyebrow { color: #8fc0ff; }

.lead { font-size: 1.15em; color: var(--muted); }
.section--brand .lead { color: #cfe0f7; }

/* Skip link — first focusable element on every page */
.skip-link {
  position: absolute;
  left: 1rem;
  top: -100px;
  z-index: 200;
  background: var(--brand);
  color: #fff;
  padding: .7rem 1.1rem;
  border-radius: 0 0 var(--radius) var(--radius);
  font-weight: 600;
  transition: top .15s ease;
}
.skip-link:focus { top: 0; color: #fff; }

/* ---------- Buttons ------------------------------------------------------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .55rem;
  min-height: 48px;           /* comfortable, accessible tap target */
  padding: .8rem 1.5rem;
  border-radius: 999px;
  font: inherit;
  font-weight: 700;
  line-height: 1.1;
  text-decoration: none;
  border: 2px solid transparent;
  cursor: pointer;
  transition: transform .12s ease, background .15s ease, box-shadow .15s ease, color .15s ease;
}
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(0); }

.btn--primary { background: var(--accent); color: #fff; box-shadow: var(--shadow-sm); }
.btn--primary:hover { background: var(--accent-ink); color: #fff; box-shadow: var(--shadow-md); }

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

.btn--on-dark { background: #fff; color: var(--brand); }
.btn--on-dark:hover { background: #eaf1fb; color: var(--brand); }

.btn--lg { min-height: 54px; padding: 1rem 1.9rem; font-size: 1.05rem; }

.btn .ico { width: 1.15em; height: 1.15em; flex: none; }

.btn-row { display: flex; flex-wrap: wrap; gap: .8rem; }
.center .btn-row { justify-content: center; }

/* ---------- Header / navigation ------------------------------------------ */

.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--white);
  border-bottom: 1px solid var(--line);
}
.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  min-height: 68px;
}

/* Logo mark + wordmark, built in HTML/SVG so it stays crisp at any size */
.brand-logo { display: inline-flex; align-items: center; flex: none; }
.brand-logo .logo-img { height: 40px; width: auto; display: block; }

.nav-links { display: flex; align-items: center; gap: .25rem; list-style: none; margin: 0; padding: 0; }
/* Regular text links in the nav. Buttons (.btn) keep their own colors, so we
   scope these rules to non-button links — otherwise this would override the
   white text on the "Text for a free estimate" button. */
.nav-links a:not(.btn) {
  display: inline-block;
  padding: .55rem .7rem;
  border-radius: 8px;
  color: var(--ink);
  text-decoration: none;
  font-weight: 600;
}
/* Keep every nav item on one line — the bar squeezes items before it wraps
   to the hamburger, and a half-wrapped "Why / Clean?" reads as broken. */
.nav-links > li { flex: none; }
.nav-links a { white-space: nowrap; }
.nav-links a:not(.btn):hover { background: var(--surface); color: var(--brand); }
.nav-links a[aria-current="page"]:not(.btn) { color: var(--accent); }
.nav-links a[aria-current="page"]:not(.btn)::after {
  content: ""; display: block; height: 2px; border-radius: 2px;
  background: var(--accent); margin-top: 2px;
}
.nav-cta { margin-left: .4rem; }

/* Hamburger button — hidden on desktop */
.nav-toggle {
  display: none;
  align-items: center;
  gap: .5rem;
  min-height: 44px;
  padding: .4rem .7rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 10px;
  color: var(--brand);
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}
.nav-toggle .bars { width: 20px; height: 14px; position: relative; }
.nav-toggle .bars span,
.nav-toggle .bars::before,
.nav-toggle .bars::after {
  content: ""; position: absolute; left: 0; height: 2px; width: 100%;
  background: currentColor; border-radius: 2px; transition: transform .2s ease, opacity .2s ease;
}
.nav-toggle .bars::before { top: 0; }
.nav-toggle .bars span   { top: 6px; }
.nav-toggle .bars::after { top: 12px; }
.nav-toggle[aria-expanded="true"] .bars::before { transform: translateY(6px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] .bars span    { opacity: 0; }
.nav-toggle[aria-expanded="true"] .bars::after  { transform: translateY(-6px) rotate(-45deg); }

@media (max-width: 900px) {
  .nav-toggle { display: inline-flex; }
  .nav-links {
    position: absolute;
    left: 0; right: 0; top: 100%;
    flex-direction: column;
    align-items: stretch;
    gap: .2rem;
    background: #fff;
    border-bottom: 1px solid var(--line);
    box-shadow: var(--shadow-md);
    padding: .8rem clamp(1rem, 4vw, 2rem) 1.2rem;
    display: none;
  }
  .nav-links.is-open { display: flex; }
  .nav-links a { padding: .8rem .6rem; font-size: 1.05rem; }
  .nav-links a[aria-current="page"]::after { display: none; }
  .nav-cta { margin: .4rem 0 0; }
  .nav-cta .btn { width: 100%; }
}

/* ---------- Hero ---------------------------------------------------------- */

.hero { position: relative; color: #fff; isolation: isolate; background-color: #0a1930; }
.hero::before {
  content: ""; position: absolute; inset: 0; z-index: -2;
  background-image: url("../images/hero-solar-clean.webp");
  background-size: cover; background-position: center;
}
.hero::after {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background: linear-gradient(120deg, rgba(9, 25, 48, .90) 0%, rgba(9, 25, 48, .78) 55%, rgba(9, 25, 48, .60) 100%);
}
/* The hero is a .container, so it keeps the container's width and padding —
   that puts its left edge on the same line as the logo and nav above it.
   Capping the children instead of the container is what holds the copy to a
   readable measure without pulling the whole block into the middle. */
.hero-inner { padding-block: clamp(3.5rem, 9vw, 7rem); }
.hero-inner > * { max-width: 42rem; }
.hero h1 { color: #fff; }
.hero p { color: #e6eefb; font-size: 1.2rem; }
.hero .btn-row { margin-top: 1.6rem; }
.hero .fineprint { margin-top: 1rem; font-size: .95rem; color: #c7d6ee; }

/* ---------- Local ownership bar ------------------------------------------- */

.local-bar {
  background: linear-gradient(160deg, var(--brand-2), var(--brand));
  border-top: 3px solid var(--accent);
  color: #dbe8fa;
  text-align: center;
  padding-block: 1.15rem;
}
.local-bar__title {
  color: #fff; font-weight: 800;
  font-size: 1rem; letter-spacing: .12em; text-transform: uppercase;
}
/* Lone-star ornaments — it's a Central Texas bar */
.local-bar__title::before,
.local-bar__title::after {
  content: "\2605";
  color: #8fc0ff;
  font-size: .8em;
  vertical-align: .1em;
}
.local-bar__title::before { margin-right: .7em; }
.local-bar__title::after  { margin-left: .7em; }
.local-bar__sub { font-size: .95rem; margin-top: .25rem; }

/* ---------- Trust / feature badges --------------------------------------- */

.badges {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 1rem;
  list-style: none; margin: 0; padding: 0;
}
.badge {
  display: flex; align-items: center; gap: .8rem;
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius);
  padding: 1rem 1.1rem; box-shadow: var(--shadow-sm);
}
.badge .ico {
  flex: none; width: 40px; height: 40px; padding: 8px; border-radius: 10px;
  background: var(--surface-2); color: var(--accent);
}
.badge b { display: block; color: var(--brand); font-size: 1.02rem; }
.badge span { font-size: .9rem; color: var(--muted); }

/* ---------- Section heading block ---------------------------------------- */

.section-head { margin-bottom: clamp(1.8rem, 4vw, 2.8rem); }
.section-head.center { margin-inline: auto; }

/* ---------- Services grid ------------------------------------------------- */

.grid {
  display: grid;
  gap: clamp(1rem, 2.5vw, 1.6rem);
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
}

.grid--2 { grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }

.card {
  display: flex; flex-direction: column;
  background: #fff; border: 1px solid var(--line);
  border-radius: var(--radius-lg); overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: transform .15s ease, box-shadow .15s ease;
}
.card:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); }
/* 16:9 fits the wide before/after composites; a narrower crop slices their
   BEFORE and AFTER labels off the ends. */
.card img { aspect-ratio: 16 / 9; object-fit: cover; width: 100%; }
/* Composites carry their labels along the top edge — when the crop is
   vertical (image taller than 16:9), keep the top so the labels survive. */
.card img.crop-top, .shot img.crop-top { object-position: top; }
.card-body { padding: 1.2rem 1.3rem 1.4rem; display: flex; flex-direction: column; gap: .4rem; flex: 1; }
.card-body h3 { margin: 0; display: flex; align-items: center; gap: .55rem; }
.card-body h3 .ico { width: 1.35rem; height: 1.35rem; color: var(--accent); flex: none; }
.card-body p { margin: 0; color: var(--muted); }

/* Simple service list (no photos) used on the services detail page */
.service {
  display: grid;
  grid-template-columns: 3rem 1fr;
  gap: 1rem;
  align-items: start;
  padding: 1.4rem 0;
  border-top: 1px solid var(--line);
}
.service:first-child { border-top: 0; }
.service .ico {
  width: 3rem; height: 3rem; padding: .7rem; border-radius: 12px;
  background: var(--surface-2); color: var(--accent); flex: none;
}
.service h3 { margin: .1rem 0 .35rem; }
.service p { margin: 0; color: var(--muted); }

/* ---------- Gallery ------------------------------------------------------- */

/* Uniform thumbnails; click one to open it full size in the lightbox. One
   column on phones, then two and three. Stopping at three keeps each thumbnail
   around 340px from tablet width up — the container caps at 1120px, so adding
   a fourth or fifth column made them smaller, not larger. */
.gallery {
  display: grid; gap: clamp(.6rem, 1.6vw, 1rem);
  grid-template-columns: 1fr;
}
@media (min-width: 620px)  { .gallery { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1000px) { .gallery { grid-template-columns: repeat(3, 1fr); } }

.shot {
  display: block; width: 100%; min-width: 0; padding: 0; margin: 0; text-align: left;
  font: inherit; color: inherit; text-decoration: none; cursor: zoom-in; background: #fff;
  border: 1px solid var(--line); border-radius: var(--radius);
  overflow: hidden; box-shadow: var(--shadow-sm);
  transition: transform .15s ease, box-shadow .15s ease;
}
.shot:hover, .shot:focus-visible { transform: translateY(-2px); box-shadow: var(--shadow-md); }
/* 16:9 matches the solar composites almost exactly; taller composites get
   .crop-top so their BEFORE and AFTER labels survive. Other shots lose their
   top and bottom here — the lightbox shows every photo uncropped. */
.shot img { display: block; width: 100%; aspect-ratio: 16 / 9; object-fit: cover; }
.shot .cap {
  display: block; padding: .55rem .75rem; font-size: .85rem; line-height: 1.4;
  color: var(--muted); border-top: 1px solid var(--line);
}

/* ---------- Lightbox ------------------------------------------------------ */

.lightbox {
  padding: 0; border: 0; background: transparent;
  max-width: min(96vw, 1400px); max-height: 94vh;
}
.lightbox::backdrop { background: rgba(15, 44, 82, .82); }
.lightbox img {
  display: block; max-width: 100%; max-height: 82vh;
  width: auto; margin: 0 auto; border-radius: var(--radius);
  background: #fff;
}
/* The caption carries its own dark chip so it stays readable over any photo,
   without depending on the backdrop showing through behind it. */
.lightbox .cap {
  display: table; margin: .7rem auto 0; padding: .35rem .9rem;
  color: var(--white); font-size: .95rem; text-align: center;
  background: rgba(15, 44, 82, .9); border-radius: 999px;
}
.lightbox-close {
  position: absolute; top: .4rem; right: .4rem;
  width: 2.4rem; height: 2.4rem; padding: 0; cursor: pointer;
  font: inherit; font-size: 1.4rem; line-height: 1;
  color: var(--ink); background: var(--white);
  border: 0; border-radius: 999px; box-shadow: var(--shadow-md);
}

/* ---------- Contact ------------------------------------------------------- */

.contact-grid {
  display: grid; gap: clamp(1rem, 3vw, 2rem);
  grid-template-columns: 1fr;
}
@media (min-width: 780px) {
  .contact-grid { grid-template-columns: 1.1fr .9fr; }
}
.contact-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 1rem; }
.contact-list li {
  display: flex; gap: .9rem; align-items: flex-start;
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius);
  padding: 1.1rem 1.2rem;
}
.contact-list .ico {
  flex: none; width: 42px; height: 42px; padding: 9px; border-radius: 10px;
  background: var(--surface-2); color: var(--accent);
}
.contact-list .label { font-size: .82rem; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); font-weight: 700; }
.contact-list a, .contact-list b { font-size: 1.15rem; color: var(--brand); text-decoration: none; font-weight: 700; }
.contact-list a:hover { color: var(--accent); }

.contact-card {
  background: linear-gradient(160deg, var(--brand), var(--brand-2));
  color: #eaf1fb; border-radius: var(--radius-lg); padding: clamp(1.4rem, 4vw, 2.2rem);
  align-self: start;
}
.contact-card h2 { color: #fff; }
.contact-card p { color: #cfe0f7; }

/* ---------- Call-to-action band ------------------------------------------ */

.cta-band { text-align: center; }
.cta-band h2 { color: #fff; }
.cta-band p { color: #cfe0f7; max-width: 52ch; margin-inline: auto; }

/* ---------- Footer -------------------------------------------------------- */

.site-footer { background: var(--brand); color: #c7d6ee; padding-block: clamp(2.5rem, 6vw, 4rem) 1.5rem; }
.footer-grid {
  display: grid; gap: 2rem;
  grid-template-columns: 1fr;
}
@media (min-width: 720px) {
  .footer-grid { grid-template-columns: 1.4fr 1fr 1fr; }
}
.site-footer h2 { color: #fff; font-size: 1.05rem; letter-spacing: .04em; text-transform: uppercase; margin-bottom: 1rem; }
.site-footer a { color: #d7e6fb; text-decoration: none; }
.site-footer a:hover { color: #fff; text-decoration: underline; }
.footer-logo { display: block; width: 240px; max-width: 70%; background: #fff; padding: .75rem 1rem; border-radius: 12px; margin-bottom: 1rem; }
.footer-links { list-style: none; margin: 0; padding: 0; display: grid; gap: .55rem; }
.footer-note { color: #9fb6d6; }
.footer-bottom {
  margin-top: 2.5rem; padding-top: 1.5rem; border-top: 1px solid rgba(255,255,255,.15);
  display: flex; flex-wrap: wrap; gap: .5rem 1.5rem; justify-content: space-between;
  font-size: .9rem; color: #9fb6d6;
}

/* ---------- Utility ------------------------------------------------------- */

.stack > * + * { margin-top: 1rem; }
.mt-2 { margin-top: 1.4rem; }
.mt-lg { margin-top: 1.4rem; }
.narrow { max-width: 820px; margin-inline: auto; }
.eyebrow--light { color: #8fc0ff; }
.btn-row.center { justify-content: center; }
.btn--outline-light { background: transparent; color: #fff; border-color: rgba(255,255,255,.5); }
.btn--outline-light:hover { background: rgba(255,255,255,.12); color: #fff; }
.img-card { border-radius: var(--radius-lg); box-shadow: var(--shadow-md); }
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

/* ---------- Reason list --------------------------------------------------- */
/* Three benefit statements that were previously plain paragraphs. They are a
   list, so they're marked up as one — and the left rule plus a label on its
   own line makes them scannable instead of a wall of text on a phone. */
.reasons { list-style: none; margin: 1.25rem 0 0; padding: 0; display: grid; gap: 1.1rem; }
.reasons li { padding-left: 1rem; border-left: 3px solid var(--surface-2); }
.reasons b { display: block; color: var(--brand); }

/* ---------- Evidence callout & source links ------------------------------- */
/* On the research page every claim is followed by its citation. The callout
   separates "what the study found" from the surrounding explanation, and the
   source line is sized down so a long paper title doesn't read as a heading. */
.evidence {
  border-left: 3px solid var(--accent);
  padding-left: 1rem;
  margin-bottom: .6rem;
}
.source { font-size: .92rem; line-height: 1.5; color: var(--muted); }
.source a { color: var(--accent-ink); }

/* ---------- Small-screen refinements -------------------------------------- */
/* Everything below tunes the phone layout. The goal above the fold is that the
   headline, one line of explanation and the "Text for a free estimate" button
   all fit on screen without scrolling. */
@media (max-width: 600px) {

  /* Header: a shorter bar leaves more of the screen for the hero. */
  .nav { min-height: 58px; }
  .brand-logo .logo-img { height: 32px; }
  .nav-toggle { padding: .35rem .6rem; font-size: .95rem; }

  /* Hero: tighter type and padding so the call to action stays above the fold. */
  .hero-inner { padding-block: 2.25rem 2.5rem; }
  .hero .eyebrow { font-size: .7rem; letter-spacing: .08em; margin-bottom: .45rem; }
  .hero h1 { line-height: 1.08; }
  .hero p { font-size: 1.05rem; line-height: 1.5; }
  .hero .btn-row { margin-top: 1.35rem; }
  .hero .fineprint { margin-top: .9rem; font-size: .88rem; }

  /* Stacked buttons share one width — ragged edges read as a mistake. */
  .btn-row { flex-direction: column; align-items: stretch; }
  .btn-row .btn,
  .center > .btn { width: 100%; }

  /* Centred body copy is hard to read in a narrow column: every line starts in
     a different place. Headings and their supporting text go flush left. */
  .section-head.center { text-align: left; }
  .section-head.center .measure { margin-inline: 0; }
  .lead { font-size: 1.08em; }

  /* Trust badges become one bordered list rather than four floating cards. */
  .badges { gap: 0; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-sm); }
  .badge { border: 0; border-top: 1px solid var(--line); border-radius: 0; box-shadow: none; padding: .85rem 1rem; }
  .badge:first-child { border-top: 0; }
  .badge .ico { width: 34px; height: 34px; padding: 7px; }

  /* Photos that repeat one already shown a screen earlier. */
  .hide-sm { display: none; }

  /* The trust line reads as two tidy lines rather than wrapping mid-phrase
     and stranding a separator at the end of the first one. */
  .fineprint .sep { display: none; }
  .fineprint .tel-line { display: block; }

  /* Sections sit closer together — there is less to separate once the
     copy is flush left and the repeated photo is gone. */
  .section { padding-block: 2.75rem; }
}

/* Keeps a phone number from breaking across two lines mid-number. */
.nowrap, .tel-line { white-space: nowrap; }
