/* ============================================================
   Quality First Home Improvements — modern design system
   Palette: cream #EDE8D2 · sage #9BAB86 · antique gold #9C9166
            charcoal #1A1A1A
   Type: Fraunces (display serif) · Inter (body/UI sans)
   ============================================================ */

:root {
  --cream: #EDE8D2;
  --cream-tint: #F7F4E9;
  --sage: #9BAB86;
  --sage-tint: rgba(155, 171, 134, 0.22);
  --gold: #9C9166;
  --gold-deep: #776E46;
  --gold-soft: rgba(156, 145, 102, 0.16);
  --charcoal: #1A1A1A;
  --charcoal-85: rgba(26, 26, 26, 0.85);
  --charcoal-70: rgba(26, 26, 26, 0.7);
  --charcoal-10: rgba(26, 26, 26, 0.1);
  --white: #ffffff;

  --font-display: "Fraunces", "Playfair Display", Georgia, serif;
  --font-body: "Inter", "Helvetica Neue", Helvetica, Arial, sans-serif;

  --container: 1280px;
  --radius: 14px;
  --shadow-sm: 0 2px 10px rgba(26, 26, 26, 0.07);
  --shadow-md: 0 14px 34px rgba(26, 26, 26, 0.12);
}

*,
*::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: 1.0625rem;
  line-height: 1.7;
  color: var(--charcoal);
  background: var(--white);
  -webkit-font-smoothing: antialiased;
}

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

a {
  color: inherit;
  text-decoration: none;
}

h1, h2, h3, h4, p, figure {
  margin-top: 0;
}

h1, h2 {
  font-family: var(--font-display);
  font-weight: 600;
  line-height: 1.08;
  letter-spacing: -0.01em;
  text-wrap: balance;
}

h1 { font-size: clamp(2.75rem, 5vw, 4.5rem); }
h2 { font-size: clamp(1.9rem, 3.2vw, 2.75rem); }
h3 { font-size: 1.125rem; font-weight: 600; line-height: 1.35; }

p { margin-bottom: 1.25em; }
p:last-child { margin-bottom: 0; }

/* ---------- layout primitives ---------- */

.container {
  max-width: var(--container);
  margin-left: auto;
  margin-right: auto;
  padding-left: clamp(20px, 4vw, 48px);
  padding-right: clamp(20px, 4vw, 48px);
}

.section {
  padding-top: clamp(72px, 9vw, 128px);
  padding-bottom: clamp(72px, 9vw, 128px);
}

.band--tint { background: var(--cream-tint); }
.band--sage { background: var(--sage-tint); }
.band--dark { background: var(--charcoal); color: var(--white); }
.band--dark p { color: rgba(255, 255, 255, 0.85); }

/* eyebrow label — sits above every section heading */
.eyebrow {
  display: block;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--gold-deep);
  margin-bottom: 14px;
}

.hero .eyebrow,
.page-hero .eyebrow,
.band--dark .eyebrow { color: var(--gold); }

.section-head {
  max-width: 660px;
  margin-bottom: 52px;
}

.about-intro { max-width: 720px; font-size: 1.2rem; }

.section-head h2 { margin-bottom: 12px; }
.section-head p.lede { font-size: 1.15rem; color: var(--charcoal-70); }

.band--dark .section-head p.lede { color: rgba(255, 255, 255, 0.75); }

/* ---------- buttons ---------- */

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 52px;
  padding: 15px 34px;
  border-radius: 999px;
  border: 1px solid transparent;
  background: var(--gold);
  color: #fff;
  font-size: 0.875rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  cursor: pointer;
  transition: transform 0.22s ease, box-shadow 0.22s ease, background 0.22s ease, color 0.22s ease;
  box-shadow: 0 8px 20px rgba(156, 145, 102, 0.35);
}

.button:hover {
  background: var(--charcoal);
  color: #fff;
  transform: translateY(-2px);
  box-shadow: 0 12px 26px rgba(26, 26, 26, 0.28);
}

.button--ghost {
  background: transparent;
  border-color: rgba(255, 255, 255, 0.65);
  color: #fff;
  box-shadow: none;
}

.button--ghost:hover {
  background: rgba(255, 255, 255, 0.14);
  border-color: #fff;
  color: #fff;
  box-shadow: none;
}

.button--dark {
  background: var(--charcoal);
  box-shadow: 0 8px 20px rgba(26, 26, 26, 0.3);
}

.button--dark:hover { background: var(--gold); }

/* ---------- header ---------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 1000;
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--charcoal-10);
  transition: box-shadow 0.25s ease;
}

.site-header.scrolled {
  box-shadow: 0 6px 24px rgba(26, 26, 26, 0.1);
}

.site-header.scrolled .header-inner {
  padding-top: 10px;
  padding-bottom: 10px;
}

.header-inner {
  max-width: var(--container);
  margin: 0 auto;
  padding: 18px clamp(20px, 4vw, 48px);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  transition: padding 0.25s ease;
}

.logo {
  width: 150px;
  height: auto;
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 28px;
  font-size: 0.95rem;
  font-weight: 500;
}

.site-nav > a:not(.button):not(.phone) {
  position: relative;
  padding: 6px 0;
  color: var(--charcoal-85);
}

.site-nav > a:not(.button):not(.phone)::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 0;
  height: 2px;
  width: 0;
  background: var(--gold);
  transition: width 0.25s ease;
}

.site-nav > a:not(.button):not(.phone):hover::after { width: 100%; }
.site-nav > a:not(.button):not(.phone):hover { color: var(--charcoal); }

.phone {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
  white-space: nowrap;
}

.phone svg { width: 16px; height: 16px; stroke: var(--gold); }

.site-nav .button {
  min-height: 46px;
  padding: 12px 26px;
}

.menu-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 6px;
  background: none;
  border: none;
  padding: 12px;
  cursor: pointer;
  z-index: 1102;
}

.menu-toggle span {
  display: block;
  width: 26px;
  height: 2px;
  background: var(--charcoal);
  transition: transform 0.3s ease, opacity 0.3s ease;
}

/* ---------- heroes ---------- */

.hero {
  position: relative;
  min-height: 92vh;
  display: flex;
  align-items: flex-end;
  color: #fff;
  overflow: hidden;
  background: var(--charcoal);
}

.hero-bg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: saturate(0.94);
}

.hero::after,
.page-hero::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(26, 26, 26, 0.28) 0%, rgba(26, 26, 26, 0.62) 100%);
}

.hero-content {
  position: relative;
  z-index: 2;
  width: 100%;
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 clamp(20px, 4vw, 48px) clamp(88px, 10vh, 130px);
}

.hero-content .eyebrow { color: var(--cream); }

.hero h1 {
  color: #fff;
  max-width: 12ch;
  margin-bottom: 18px;
}

.hero .hero-sub {
  max-width: 620px;
  font-size: 1.15rem;
  line-height: 1.65;
  color: rgba(255, 255, 255, 0.88);
  margin-bottom: 34px;
}

.hero-ctas {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
}

.scroll-hint {
  position: absolute;
  z-index: 2;
  right: clamp(20px, 4vw, 48px);
  bottom: 34px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  font-size: 0.68rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.55);
}

.scroll-hint::after {
  content: "";
  width: 1px;
  height: 52px;
  background: linear-gradient(rgba(255, 255, 255, 0.6), transparent);
}

/* interior page hero */
.page-hero {
  position: relative;
  min-height: 50vh;
  display: flex;
  align-items: flex-end;
  color: #fff;
  overflow: hidden;
  background: var(--charcoal);
}

.page-hero .hero-content { padding-bottom: clamp(56px, 7vh, 84px); }
.page-hero h1 { margin-bottom: 8px; }
.page-hero .hero-sub { margin-bottom: 0; font-size: 1.05rem; }

/* ---------- service cards ---------- */

.services {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 28px;
}

.service-card {
  background: var(--cream-tint);
  border: 1px solid var(--charcoal-10);
  border-radius: var(--radius);
  padding: 40px 34px;
  transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
}

.service-card:hover {
  transform: translateY(-6px);
  box-shadow: var(--shadow-md);
  border-color: var(--sage);
}

.service-number {
  display: block;
  font-family: var(--font-display);
  font-size: 2.6rem;
  font-weight: 600;
  color: var(--gold);
  line-height: 1;
  margin-bottom: 18px;
}

.service-card h2,
.service-card h3 {
  font-size: 1.45rem;
  margin-bottom: 12px;
}

.service-card p { color: var(--charcoal-70); font-size: 1rem; }

/* ---------- testimonial ---------- */

.testimonial {
  max-width: 860px;
  margin: 0 auto;
  text-align: center;
  position: relative;
}

.testimonial::before {
  content: "\201C";
  display: block;
  font-family: var(--font-display);
  font-size: 5rem;
  line-height: 0.6;
  color: var(--sage);
  margin-bottom: 22px;
}

.testimonial blockquote {
  margin: 0 0 22px;
  font-family: var(--font-display);
  font-style: italic;
  font-weight: 500;
  font-size: clamp(1.25rem, 2.4vw, 1.6rem);
  line-height: 1.5;
  color: var(--charcoal);
}

.testimonial cite {
  font-style: normal;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--charcoal-70);
}

/* ---------- feature split (image / text) ---------- */

.split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(36px, 5vw, 80px);
  align-items: center;
}

.split--flip > img { order: 2; }
.split--flip > div { order: 1; }

.split img {
  border-radius: var(--radius);
  box-shadow: var(--shadow-md);
  filter: saturate(0.94);
  width: 100%;
  height: 100%;
  min-height: 340px;
  object-fit: cover;
}

/* ---------- project groups (gallery detail pages) ---------- */

.project-group {
  padding-top: clamp(56px, 7vw, 88px);
  margin-top: clamp(56px, 7vw, 88px);
  border-top: 1px solid var(--charcoal-10);
}

.project-group:first-of-type {
  margin-top: 0;
  padding-top: 0;
  border-top: none;
}

.project-head {
  max-width: 720px;
  margin-bottom: clamp(18px, 2vw, 28px);
}

.project-head h2 {
  margin-bottom: 0;
  padding-bottom: 16px;
  border-bottom: 2px solid var(--gold);
  display: inline-block;
}

.project-group > p:not(.compare-caption) { max-width: 70ch; }

/* ---------- before / after comparison slider ---------- */

.compare {
  --pos: 50%;
  position: relative;
  aspect-ratio: 4 / 3;
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-md);
  margin-bottom: 28px;
  background: var(--charcoal);
  touch-action: pan-y;
}

.compare img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: saturate(0.94);
  pointer-events: none;
  user-select: none;
  -webkit-user-select: none;
}

.compare-before {
  position: absolute;
  inset: 0;
  clip-path: inset(0 calc(100% - var(--pos)) 0 0);
}

.compare-handle {
  position: absolute;
  top: 0;
  bottom: 0;
  left: var(--pos);
  width: 2px;
  background: #fff;
  box-shadow: 0 0 12px rgba(0, 0, 0, 0.45);
  transform: translateX(-1px);
  pointer-events: none;
}

.compare-knob {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: #fff;
  color: var(--charcoal);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  font-weight: 700;
  letter-spacing: 2px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.35);
}

.compare input[type="range"] {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: ew-resize;
  margin: 0;
}

.compare:focus-within .compare-knob {
  outline: 3px solid var(--gold);
  outline-offset: 3px;
}

.compare-label {
  position: absolute;
  top: 14px;
  z-index: 3;
  padding: 7px 16px;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  pointer-events: none;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
}

.compare-label--before { left: 14px; background: var(--charcoal); color: #fff; }
.compare-label--after { right: 14px; background: var(--sage); color: var(--charcoal); }

.compare-caption {
  font-size: 0.85rem;
  color: var(--charcoal-70);
  margin: -14px 0 28px;
}

/* ---------- photo grid + stage badges ---------- */

.image-gallery {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 20px;
}

.image-gallery .photo,
.image-gallery > img {
  border-radius: 10px;
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.image-gallery .photo:hover,
.image-gallery > img:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
}

.image-gallery img {
  width: 100%;
  height: 280px;
  object-fit: cover;
  filter: saturate(0.92);
}

.photo { position: relative; margin: 0; }

.stage {
  position: absolute;
  top: 12px;
  left: 12px;
  padding: 5px 14px;
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  border-radius: 999px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.22);
}

.stage-before { background: rgba(26, 26, 26, 0.92); color: #fff; }
.stage-during { background: rgba(119, 110, 70, 0.95); color: #fff; }
.stage-after { background: rgba(155, 171, 134, 0.95); color: var(--charcoal); }
.stage-both {
  background: linear-gradient(90deg, rgba(26,26,26,0.92) 50%, rgba(155,171,134,0.95) 50%);
  color: #fff;
}

/* ---------- gallery index cards ---------- */

.gallery-links {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 28px;
}

.gallery-card {
  position: relative;
  display: block;
  aspect-ratio: 16 / 10;
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: transform 0.28s ease, box-shadow 0.28s ease;
}

.gallery-card:hover {
  transform: translateY(-6px);
  box-shadow: var(--shadow-md);
}

.gallery-card img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: saturate(0.94);
  transition: transform 0.5s ease;
}

.gallery-card:hover img { transform: scale(1.04); }

.gallery-card::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(26,26,26,0) 40%, rgba(26,26,26,0.72) 100%);
}

.gallery-card-title {
  position: absolute;
  z-index: 2;
  left: 28px;
  bottom: 24px;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.6rem;
  color: #fff;
  padding-bottom: 10px;
}

.gallery-card-title::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 0;
  height: 2px;
  width: 44px;
  background: var(--gold);
  transition: width 0.3s ease;
}

.gallery-card:hover .gallery-card-title::after { width: 100%; }

/* ---------- dark CTA band ---------- */

.cta-band { text-align: center; }

.cta-band .section-head {
  margin-left: auto;
  margin-right: auto;
  text-align: center;
  margin-bottom: 36px;
}

.cta-band h2 { color: #fff; }

.cta-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  justify-content: center;
}

/* ---------- contact ---------- */

.contact-grid {
  display: grid;
  grid-template-columns: 5fr 7fr;
  gap: clamp(32px, 5vw, 72px);
  align-items: start;
}

.contact-card {
  background: var(--cream-tint);
  border: 1px solid var(--charcoal-10);
  border-radius: var(--radius);
  padding: clamp(22px, 4vw, 40px) clamp(20px, 3vw, 36px);
}

.contact-card h2 { font-size: 1.6rem; margin-bottom: 18px; }

.contact-row {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  padding: 14px 0;
  border-top: 1px solid var(--charcoal-10);
  font-size: 1rem;
}

.contact-row:first-of-type { border-top: none; }

.contact-row strong {
  display: block;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--charcoal-70);
  margin-bottom: 4px;
}

.contact-row a[href^="tel:"],
.contact-row a[href^="mailto:"] {
  font-weight: 600;
  border-bottom: 2px solid var(--gold);
}

.footer-contact a,
.contact-row a { overflow-wrap: anywhere; }

.contact-form { max-width: 640px; }

.form-field { margin-bottom: 22px; }

.contact-form label {
  display: block;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--charcoal-70);
  margin-bottom: 8px;
}

.contact-form input,
.contact-form textarea {
  width: 100%;
  padding: 16px;
  border: 1px solid rgba(26, 26, 26, 0.22);
  border-radius: 10px;
  font-family: var(--font-body);
  font-size: 16px;
  color: var(--charcoal);
  background: #fff;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.contact-form textarea { min-height: 170px; resize: vertical; }

.contact-form input:focus,
.contact-form textarea:focus {
  outline: none;
  border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(156, 145, 102, 0.18);
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

/* ---------- footer ---------- */

.site-footer {
  background: var(--charcoal);
  color: rgba(255, 255, 255, 0.85);
  padding: clamp(56px, 7vw, 84px) 20px 40px;
  text-align: center;
}

.site-footer .logo {
  margin: 0 auto 22px;
  width: 170px;
  border-radius: 14px;
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.35);
}

.footer-name {
  font-family: var(--font-display);
  font-size: 1.35rem;
  color: #fff;
  margin-bottom: 6px;
}

.footer-tag {
  font-size: 0.75rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 24px;
}

.footer-contact {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 32px;
  justify-content: center;
  margin-bottom: 30px;
  font-size: 1.02rem;
}

.footer-contact a {
  font-weight: 600;
  color: #fff;
  border-bottom: 2px solid var(--gold);
}

.footer-legal {
  font-size: 0.8rem;
  color: rgba(255, 255, 255, 0.5);
  border-top: 1px solid rgba(255, 255, 255, 0.12);
  padding-top: 24px;
  max-width: var(--container);
  margin: 0 auto;
}

/* ---------- sticky mobile call bar ---------- */

.call-bar { display: none; }

/* ---------- responsive ---------- */

@media (max-width: 1024px) {
  .services { grid-template-columns: 1fr 1fr; }
  .contact-grid { grid-template-columns: 1fr; }
}

@media (max-width: 900px) {
  .split { grid-template-columns: 1fr; }
  .split--flip > img { order: 0; }
  .split img { min-height: 260px; }
  .gallery-links { grid-template-columns: 1fr; }
}

@media (max-width: 960px) {
  .site-header { backdrop-filter: none; -webkit-backdrop-filter: none; z-index: 1001; }
  .hero { min-height: 78vh; }
  .scroll-hint { display: none; }

  .site-nav .phone { display: none; }
  .site-nav .button { display: none; }

  .menu-toggle { display: flex; }
  .site-header.nav-open .menu-toggle span { background: #fff; }
  .site-header.nav-open .menu-toggle span:nth-child(1) { transform: translateY(8px) rotate(45deg); }
  .site-header.nav-open .menu-toggle span:nth-child(2) { opacity: 0; }
  .site-header.nav-open .menu-toggle span:nth-child(3) { transform: translateY(-8px) rotate(-45deg); }

  .site-nav {
    position: fixed;
    inset: 0;
    z-index: 1101;
    background: var(--charcoal);
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 8px;
    overflow-y: auto;
    padding: 76px 16px 24px;
    justify-content: safe center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
  }

  .site-header.nav-open .site-nav {
    opacity: 1;
    visibility: visible;
  }

  .site-nav > a:not(.button):not(.phone) {
    font-family: var(--font-display);
    font-size: 2rem;
    color: #fff;
    padding: 10px;
  }

  .site-nav > a:not(.button):not(.phone)::after { display: none; }

  .site-header.nav-open .site-nav .phone {
    display: inline-flex;
    color: #fff;
    font-size: 1.1rem;
    margin-top: 18px;
  }

  .site-header.nav-open .site-nav .button {
    display: inline-flex;
    margin-top: 12px;
  }

  .site-header.nav-open .logo { position: relative; z-index: 1102; }

}

@media (max-width: 768px) {
  .call-bar {
    display: flex;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.18);
  }

  .call-bar a {
    flex: 1;
    text-align: center;
    padding: 16px 8px calc(16px + env(safe-area-inset-bottom));
    font-size: 0.82rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
  }

  .call-bar a:first-child { background: var(--charcoal); color: #fff; }
  .call-bar a:last-child { background: var(--gold); color: #fff; }

  body.has-callbar { padding-bottom: calc(80px + env(safe-area-inset-bottom)); }

  .services { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition-duration: 0.01ms !important; }
}
