/* =========================================================
   BASE.CSS — shared across every page
   Variables, reset, buttons, topbar, nav, footer,
   final CTA band, section headers, trust strip,
   "why us" icon-card grid, page-hero band, scroll-reveal,
   and small utilities. Page-specific styles (hero photo,
   services, calculator, team cards, etc.) live in their
   own files: home.css, estimator.css, about.css...
   ========================================================= */

:root {
  --espresso: #390405;
  --espresso-dark: #220203;
  --espresso-soft: #5a1012;
  --gold: #f4ce79;
  --gold-deep: #caa04f;
  --cream: #fbf3e6;
  --white: #ffffff;
  --ink: #2b1c1a;
  --ink-soft: #7a6a62;
  --font-display: 'Abril Fatface', serif;
  --font-serif: 'Bodoni Moda', serif;
  --font-sans: 'Jost', sans-serif;
  --maxw: 1180px;
  --radius: 10px;
}

* {
  box-sizing: border-box;
}
html {
  scroll-behavior: smooth;
}
body {
  margin: 0;
  font-family: var(--font-sans);
  color: var(--ink);
  background: var(--white);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
img {
  max-width: 100%;
  display: block;
}
a {
  color: inherit;
  text-decoration: none;
}
ul {
  list-style: none;
  margin: 0;
  padding: 0;
}
h1,
h2,
h3,
h4 {
  margin: 0;
  font-weight: 400;
}
p {
  margin: 0;
}
button {
  font-family: inherit;
  cursor: pointer;
  border: none;
  background: none;
}
.wrap {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 28px;
}
a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible {
  outline: 2px solid var(--gold-deep);
  outline-offset: 3px;
  border-radius: 4px;
}

/* ===== SVG safety net =====
   Every icon in this project already carries explicit
   width/height attributes in its markup. This is just a
   fallback so any svg that's missing one never renders at
   the browser's 300x150 default. */
svg {
  width: 1rem;
  height: 1rem;
  display: inline-block;
  vertical-align: middle;
  flex-shrink: 0;
}

/* ===== small utilities ===== */
.bg-cream {
  background: var(--cream);
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-sans);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--gold-deep);
}
.eyebrow::before {
  content: '';
  width: 14px;
  height: 1px;
  background: var(--gold-deep);
  display: inline-block;
}

/* ===== shared centered section header (used on every page) ===== */
.section-head {
  text-align: center;
  max-width: 620px;
  margin: 0 auto 52px;
}
.section-head .eyebrow {
  justify-content: center;
  margin-bottom: 14px;
}
.section-head h2 {
  font-family: var(--font-serif);
  font-weight: 600;
  font-size: clamp(28px, 3.6vw, 40px);
  color: var(--espresso);
  margin-bottom: 14px;
}
.section-head p {
  color: var(--ink-soft);
  font-size: 15.5px;
}

/* ===== shared interior-page header band (About, future pages) ===== */
.page-hero {
  background: var(--espresso);
  color: var(--white);
  padding: 64px 0;
  text-align: center;
}
.page-hero .wrap {
  max-width: 680px;
}
.page-hero .eyebrow {
  justify-content: center;
  color: var(--gold);
}
.page-hero .eyebrow::before {
  background: var(--gold);
}
.page-hero h1 {
  font-family: var(--font-display);
  font-size: clamp(32px, 4.5vw, 48px);
  margin: 16px 0 14px;
  line-height: 1.15;
}
.page-hero p {
  color: rgba(255, 255, 255, 0.78);
  font-size: 15px;
}

/* ===== shared trust strip (homepage + about page) ===== */
.trust-strip {
  background: var(--cream);
  border-bottom: 1px solid #f1e7d4;
}
.trust-strip .wrap {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  padding: 30px 28px;
}
.trust-item {
  text-align: center;
  border-left: 1px solid #e7dcc6;
  padding: 4px 10px;
}
.trust-item:first-child {
  border-left: none;
}
.trust-item .num {
  font-family: var(--font-serif);
  font-size: clamp(22px, 3vw, 30px);
  font-weight: 600;
  color: var(--espresso);
}
.trust-item .label {
  font-size: 11.5px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--ink-soft);
  margin-top: 4px;
}

/* ===== shared icon-card grid ("Why Us" pattern — homepage + about) ===== */
.why-us {
  padding: 90px 0;
}
.why-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 26px;
}
.why-card {
  padding: 32px 28px;
  border: 1px solid #f1e7d4;
  border-radius: 14px;
  background: var(--white);
  transition:
    transform 0.2s ease,
    box-shadow 0.2s ease;
}
.why-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 18px 36px rgba(57, 4, 5, 0.08);
}
.why-card .icon {
  width: 48px;
  height: 48px;
  border-radius: 10px;
  background: var(--espresso);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 20px;
}
.why-card .icon svg {
  width: 22px;
  height: 22px;
  color: var(--gold);
}
.why-card h3 {
  font-family: var(--font-serif);
  font-size: 18.5px;
  font-weight: 600;
  color: var(--espresso);
  margin-bottom: 10px;
}
.why-card p {
  font-size: 14px;
  color: var(--ink-soft);
}

/* ===== shared scroll-reveal animation primitive =====
   partials.js calls initScrollReveal() automatically on every
   page — any element with class="reveal" fades up into view. */
.reveal {
  opacity: 0;
  transform: translateY(16px);
  transition:
    opacity 0.6s ease,
    transform 0.6s ease;
}
.reveal.in {
  opacity: 1;
  transform: translateY(0);
}
@media (prefers-reduced-motion: reduce) {
  .reveal {
    opacity: 1;
    transform: none;
    transition: none;
  }
}

/* ===== shared form fields (estimator + contact pages) ===== */
.field-label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--espresso);
  margin-bottom: 7px;
}
.field-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 18px;
}
.field-group {
  margin-bottom: 18px;
}
input[type='text'],
input[type='email'],
input[type='tel'],
select,
textarea {
  width: 100%;
  padding: 12px 14px;
  border: 1.5px solid #e7dcc6;
  border-radius: 8px;
  font-family: var(--font-sans);
  font-size: 14px;
  color: var(--ink);
  background: var(--white);
}
input:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: var(--espresso);
}
textarea {
  resize: vertical;
  min-height: 80px;
}
.consent-row {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 13px;
  color: var(--ink-soft);
  margin-bottom: 8px;
}
.consent-row input {
  width: auto;
  margin-top: 3px;
}
.error-text {
  color: #b3261e;
  font-size: 12.5px;
  margin-top: 8px;
  display: none;
}
.error-text.show {
  display: block;
}

/* ===== buttons (shared by every page) ===== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 14px 26px;
  border: none;
  border-radius: 6px;
  font-size: 14.5px;
  font-weight: 600;
  letter-spacing: 0.02em;
  transition:
    transform 0.15s ease,
    box-shadow 0.15s ease,
    background 0.15s ease;
}
.btn svg {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}
.btn-gold {
  background: var(--gold);
  color: var(--espresso);
}
.btn-gold:hover {
  background: var(--gold-deep);
  transform: translateY(-1px);
}
.btn-outline-light {
  border: 1.5px solid rgba(255, 255, 255, 0.55);
  color: var(--white);
}
.btn-outline-light:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: var(--white);
}
.btn-outline-dark {
  border: 1.5px solid var(--espresso);
  color: var(--espresso);
  background: none;
}
.btn-outline-dark:hover {
  background: var(--espresso);
  color: var(--white);
}
.btn-ghost {
  color: var(--ink-soft);
  font-weight: 500;
  background: none;
  border: none;
  padding: 14px 10px;
}
.btn-ghost:hover {
  color: var(--espresso);
}
.btn-small {
  padding: 10px 18px;
  font-size: 13px;
  width: 100%;
}
.btn[disabled] {
  opacity: 0.4;
  cursor: not-allowed;
  pointer-events: none;
}

/* ===== topbar ===== */
.topbar {
  background: var(--espresso-dark);
  color: rgba(255, 255, 255, 0.85);
  font-size: 12.5px;
}
.topbar .wrap {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 9px 28px;
  flex-wrap: wrap;
  gap: 6px;
}
.topbar-left {
  display: flex;
  gap: 22px;
  flex-wrap: wrap;
}
.topbar-left span,
.topbar-left a {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.topbar-left svg,
.topbar-right svg {
  width: 13px;
  height: 13px;
}
.topbar-right {
  display: flex;
  gap: 14px;
  align-items: center;
}
.topbar-right a {
  opacity: 0.85;
}
.topbar-right a:hover {
  opacity: 1;
  color: var(--gold);
}

/* ===== nav ===== */
header.nav {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--white);
  border-bottom: 1px solid #eee2cf;
}
.nav .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 28px;
}
.logo {
  display: flex;
  align-items: center;
  gap: 10px;
}
.logo-text {
  font-family: var(--font-display);
  font-size: 22px;
  color: var(--espresso);
  line-height: 1;
}
.logo-sub {
  display: block;
  font-family: var(--font-sans);
  font-size: 10px;
  letter-spacing: 0.32em;
  color: var(--gold-deep);
  margin-top: 2px;
}
.nav-links {
  display: flex;
  align-items: center;
  gap: 6px;
}
.nav-links > li {
  position: relative;
}
.nav-links > li > a {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 10px 14px;
  font-size: 13.5px;
  font-weight: 500;
  letter-spacing: 0.03em;
  color: var(--ink);
  border-radius: 6px;
}
.nav-links > li > a:hover,
.nav-links > li.open > a {
  color: var(--espresso);
  background: var(--cream);
}
.nav-links > li > a.current {
  color: var(--espresso);
  font-weight: 700;
  background: var(--cream);
}
.nav-links .chev {
  width: 10px;
  height: 10px;
  transition: transform 0.15s ease;
}
.nav-links > li.open .chev {
  transform: rotate(180deg);
}
.dropdown {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  min-width: 230px;
  background: var(--white);
  border: 1px solid #eee2cf;
  border-radius: 8px;
  box-shadow: 0 14px 30px rgba(57, 4, 5, 0.12);
  padding: 10px;
  opacity: 0;
  visibility: hidden;
  transform: translateY(6px);
  transition:
    opacity 0.15s ease,
    transform 0.15s ease,
    visibility 0.15s;
}
.nav-links > li:hover .dropdown,
.nav-links > li.open .dropdown {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}
.dropdown a {
  display: block;
  padding: 9px 12px;
  font-size: 13.5px;
  color: var(--ink);
  border-radius: 6px;
}
.dropdown a:hover {
  background: var(--cream);
  color: var(--espresso);
}
.dropdown .dd-primary {
  font-weight: 600;
  color: var(--espresso);
  border-bottom: 1px solid #f1e7d4;
  margin-bottom: 4px;
  padding-bottom: 11px;
}
.nav-cta {
  display: flex;
  align-items: center;
  gap: 14px;
}
.burger {
  display: none;
  width: 26px;
  height: 20px;
  position: relative;
  flex-direction: column;
  justify-content: space-between;
  background: none;
  border: none;
  padding: 0;
}
.burger span {
  display: block;
  height: 2px;
  width: 100%;
  background: var(--espresso);
  border-radius: 2px;
}

/* ===== shared final CTA band (used on homepage + every interior page) ===== */
.final-cta {
  background: radial-gradient(
    circle at 30% 20%,
    var(--espresso-soft),
    var(--espresso) 60%
  );
  color: var(--white);
  padding: 80px 0;
  text-align: center;
}
.final-cta .eyebrow {
  justify-content: center;
  color: var(--gold);
}
.final-cta .eyebrow::before {
  background: var(--gold);
}
.final-cta h2 {
  font-family: var(--font-display);
  font-size: clamp(28px, 4vw, 44px);
  margin: 18px 0 14px;
}
.final-cta h2 em {
  color: var(--gold);
  font-style: normal;
}
.final-cta p {
  max-width: 560px;
  margin: 0 auto 32px;
  color: rgba(255, 255, 255, 0.78);
  font-size: 15.5px;
}
.final-actions {
  display: flex;
  justify-content: center;
  gap: 14px;
  flex-wrap: wrap;
  margin-bottom: 34px;
}
.final-contact {
  display: flex;
  justify-content: center;
  gap: 30px;
  flex-wrap: wrap;
  font-size: 13px;
  color: rgba(255, 255, 255, 0.7);
  border-top: 1px solid rgba(255, 255, 255, 0.15);
  padding-top: 26px;
  max-width: 640px;
  margin: 0 auto;
}
.final-contact span {
  display: inline-flex;
  align-items: center;
  gap: 7px;
}
.final-contact svg {
  width: 14px;
  height: 14px;
  color: var(--gold);
}

/* ===== footer ===== */
footer {
  background: var(--espresso-dark);
  color: rgba(255, 255, 255, 0.65);
  padding: 64px 0 0;
}
.footer-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr 1.2fr;
  gap: 40px;
  padding-bottom: 50px;
}
.footer-brand .logo-text {
  color: var(--white);
}
.footer-brand p {
  font-size: 13.5px;
  margin: 16px 0 20px;
  color: rgba(255, 255, 255, 0.55);
  max-width: 280px;
}
.social-row {
  display: flex;
  gap: 10px;
}
.social-row a {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.2);
  display: flex;
  align-items: center;
  justify-content: center;
}
.social-row a svg {
  width: 15px;
  height: 15px;
}
.social-row a:hover {
  background: var(--gold);
  border-color: var(--gold);
  color: var(--espresso);
}
footer h4 {
  font-family: var(--font-sans);
  font-size: 13px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 20px;
}
footer .flinks {
  display: flex;
  flex-direction: column;
  gap: 11px;
  font-size: 13.5px;
}
footer .flinks a:hover {
  color: var(--gold);
}
.footer-contact li {
  display: flex;
  gap: 10px;
  font-size: 13.5px;
  margin-bottom: 14px;
  align-items: flex-start;
}
.footer-contact svg {
  width: 15px;
  height: 15px;
  color: var(--gold);
  margin-top: 2px;
  flex-shrink: 0;
}
.footer-bottom {
  border-top: 1px solid rgba(255, 255, 255, 0.12);
  padding: 22px 0;
  text-align: center;
  font-size: 12.5px;
  color: rgba(255, 255, 255, 0.45);
}

/* ===== shared responsive ===== */
@media (max-width: 980px) {
  .nav-links {
    display: none;
  }
  .burger {
    display: flex;
  }
  .nav-links.mobile-open {
    display: flex;
    flex-direction: column;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--white);
    border-bottom: 1px solid #eee2cf;
    padding: 10px 20px 18px;
    box-shadow: 0 14px 24px rgba(0, 0, 0, 0.08);
  }
  .nav-links.mobile-open > li {
    width: 100%;
  }
  .nav-links.mobile-open > li > a {
    justify-content: space-between;
  }
  .nav-links.mobile-open .dropdown {
    position: static;
    opacity: 1;
    visibility: visible;
    transform: none;
    display: none;
    box-shadow: none;
    border: none;
    padding: 0 0 0 14px;
    margin-top: 4px;
  }
  .nav-links.mobile-open > li.open .dropdown {
    display: block;
  }
  .nav-cta .btn span {
    display: none;
  }
  .footer-grid {
    grid-template-columns: 1fr 1fr;
  }
  .why-grid {
    grid-template-columns: 1fr 1fr;
  }
}
@media (max-width: 640px) {
  .topbar-left span:nth-child(3) {
    display: none;
  }
  .footer-grid {
    grid-template-columns: 1fr;
    gap: 36px;
  }
  .final-contact {
    flex-direction: column;
    gap: 12px;
  }
  .why-grid {
    grid-template-columns: 1fr;
  }
  .trust-strip .wrap {
    grid-template-columns: 1fr 1fr;
    gap: 20px 0;
  }
  .trust-item {
    border-left: none;
    border-top: 1px solid #e7dcc6;
    padding-top: 14px;
  }
  .trust-item:nth-child(1),
  .trust-item:nth-child(2) {
    border-top: none;
  }
  .field-row {
    grid-template-columns: 1fr;
  }
}
