/* The GRID — shared stylesheet
   Handles: reset, hover states (converted from source's style-hover), services dropdown,
   mobile hamburger nav, FAQ accordion, scroll-reveal, lead form validation states,
   Reviews stat bars. Page-specific visual design (colors, section layout, hero SVGs,
   per-page @keyframes) stays inline / in each page's own <style> block, per the build
   brief's "preserve inline styles exactly" rule. */

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; }
img { max-width: 100%; }
a { -webkit-tap-highlight-color: rgba(153,99,33,0.15); }

/* ================= Hover utilities (source used style-hover, a design-tool-only
   attribute; these are the real CSS equivalents, one definition reused everywhere) ===== */
.hover-navlink:hover { color: #996321; }
.hover-dropdown-item:hover { background: #efece4; }
.btn-gold-solid:hover { background: #82541c; border-color: #82541c; }
.btn-gold-bright:hover { background: #dc9c4c; border-color: #dc9c4c; }
.btn-gold-bright-arrow:hover { background: #dc9c4c; border-color: #dc9c4c; transform: translateX(2px); }
.hover-paincard:hover { background: #e8e3d8; box-shadow: inset 0 -2px 0 #996321; }
.hover-paincard:hover .arrow-icon { transform: translateX(4px); }
.arrow-icon { transition: transform .15s; }
.hover-democard:hover { transform: translateY(-4px); box-shadow: 0 12px 28px rgba(28,43,58,0.16); }
.hover-crosslink:hover { background: #e8e3d8; }

/* ================= Header / services dropdown ================= */
.logo-link { display: flex; align-items: center; text-decoration: none; }
.nav-panel { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }

.services-dropdown { position: relative; }
.services-toggle {
  display: flex; align-items: center; gap: 6px;
  font-family: 'IBM Plex Sans', sans-serif; font-weight: 600; font-size: 13px; color: #1c2b3a;
  background: none; border: 1px solid rgba(28,43,58,0.2); padding: 8px 14px; cursor: pointer;
}
.services-chevron { transition: transform .2s; }
.services-dropdown.open .services-chevron { transform: rotate(180deg); }
.services-panel {
  position: absolute; top: calc(100% + 8px); right: 0; min-width: 220px;
  background: #f7f5f0; border: 1px solid rgba(28,43,58,0.16);
  box-shadow: 0 12px 28px rgba(28,43,58,0.18); z-index: 50;
  transform-origin: top right;
  opacity: 0; transform: scale(0.96); pointer-events: none;
  transition: opacity .15s, transform .15s;
}
.services-dropdown.open .services-panel { opacity: 1; transform: scale(1); pointer-events: auto; }
.services-panel a:last-child { border-bottom: none; }

.nav-toggle {
  display: none; align-items: center; justify-content: center;
  background: none; border: 1px solid rgba(28,43,58,0.2); padding: 8px 10px; cursor: pointer;
}
.nav-toggle svg { display: block; width: 22px; height: 22px; color: #1c2b3a; }
.nav-toggle .icon-close { display: none; }
.nav-toggle.open .icon-menu { display: none; }
.nav-toggle.open .icon-close { display: block; }

@media (max-width: 768px) {
  .nav-toggle { display: flex; }
  .nav-panel {
    display: none !important; position: absolute; top: 100%; left: 0; right: 0;
    flex-direction: column; align-items: stretch; gap: 0;
    background: #f7f5f0; border-bottom: 1px solid rgba(28,43,58,0.16);
    box-shadow: 0 12px 20px rgba(28,43,58,0.12);
    padding: 6px clamp(20px,5vw,64px) 20px; max-height: calc(100vh - 78px); overflow-y: auto;
  }
  .nav-panel.open { display: flex !important; }
  .nav-link-story { display: block; padding: 14px 0; }
  .services-dropdown { width: 100%; }
  .services-toggle { width: 100%; justify-content: space-between; }
  .services-panel {
    position: static; box-shadow: none; border: none; min-width: 0;
    border-top: 1px solid rgba(28,43,58,0.12);
    opacity: 1; transform: none; pointer-events: auto;
    max-height: 0; overflow: hidden; transition: max-height .25s ease;
  }
  .services-dropdown.open .services-panel { max-height: 420px; }
  .nav-cta { margin-top: 12px; justify-content: center; text-align: center; }

  /* Founder section (Home page): the 180px/1fr side-by-side grid crushes the text
     column on narrow screens. Stack instead, text first then photo below. */
  .founder-grid { grid-template-columns: 1fr !important; }
  .founder-text { order: 1; }
  .founder-photo { order: 2; }
}

/* ================= FAQ accordion ================= */
.faq-item { border-bottom: 1px solid rgba(28,43,58,0.16); }
.faq-q {
  width: 100%; display: flex; align-items: center; justify-content: space-between; gap: 16px;
  background: none; border: none; padding: 20px 0; text-align: left;
  font-family: 'IBM Plex Sans', sans-serif; font-weight: 600; font-size: 17px; color: #1c2b3a; cursor: pointer;
}
.faq-chevron { flex: none; transition: transform .2s; }
.faq-item.open .faq-chevron { transform: rotate(180deg); }
.faq-answer-wrap { overflow: hidden; max-height: 0; opacity: 0; transition: max-height .35s ease, opacity .3s ease; }
.faq-item.open .faq-answer-wrap { max-height: 200px; opacity: 1; }
.faq-answer { font-size: 15px; opacity: 0.8; margin: 0 0 22px; max-width: 640px; }

/* ================= Scroll reveal ================= */
[data-reveal] > * {
  opacity: 0; transform: translateY(12px);
  transition: opacity .5s ease, transform .5s ease;
  transition-delay: calc(var(--i, 0) * 100ms);
}
[data-reveal].is-revealed > * { opacity: 1; transform: translateY(0); }
@media (prefers-reduced-motion: reduce) {
  [data-reveal] > * { transition: none !important; }
}

/* ================= Lead form ================= */
.field-error { font-size: 12px; color: #996321; margin-top: 4px; min-height: 1px; }
.field-error-consent { margin-top: -6px; }
.field-invalid { border-color: #996321 !important; }
.form-error-banner {
  display: none; border: 1px solid #996321; background: rgba(153,99,33,0.08); color: #1c2b3a;
  font-family: 'IBM Plex Sans', sans-serif; font-size: 14px; padding: 14px 16px; margin: 0 0 24px;
  text-align: center;
}
.form-error-banner.show { display: block; }

/* ================= Reviews page stat bars ================= */
.stat-bar-track { height: 6px; background: rgba(28,43,58,0.12); }
.stat-bar-fill { height: 100%; background: #647268; transition: width 1s ease; width: 0%; }

/* ================= Home page: before/after leak diagram =================
   Each node starts "leaking"/"pending" and is sealed/resolved one at a time by
   assets/js/site.js toggling a data-state attribute; the small token dot flows
   down the column's connector line to each node/final box as it resolves. */
.diag-col { position: relative; display: flex; flex-direction: column; align-items: center; flex: 1 1 260px; max-width: 320px; }

.diag-token {
  position: absolute; left: 50%; top: 0; width: 14px; height: 14px; border-radius: 50%;
  background: #1c2b3a; box-shadow: 0 0 0 3px #f7f5f0, 0 0 0 4px #1c2b3a;
  transform: translate(-50%, -50%); opacity: 0; pointer-events: none; z-index: 5;
  transition: top .75s cubic-bezier(.4,0,.2,1), opacity .3s;
}

.diag-circle {
  position: relative; width: 56px; height: 56px;
  border-width: 1.5px; display: flex; align-items: center; justify-content: center; flex: none;
  transition: background .4s, border-color .4s, color .4s;
}
.diag-icon { display: none; align-items: center; justify-content: center; }
.diag-state { display: none; }
.diag-state--leak, .diag-state--pending { display: block; }

/* After column (left) — starts "leaking" (dashed amber, drip icon), seals on trigger */
.diag-circle--after { border-style: dashed; border-color: #996321; background: transparent; }
.diag-circle--after .diag-icon--leak { display: flex; }
.diag-drip {
  position: absolute; bottom: -8px; left: 50%; width: 4px; height: 4px; border-radius: 50%;
  background: #996321; transform: translateX(-50%); animation: dripPulse 1.5s ease-in-out infinite;
}
.diag-state--leak { color: #996321; }
.diag-state--seal { color: #647268; }

.diag-node[data-state="seal"] .diag-circle--after {
  border-style: solid; border-color: #7a8b7f; background: #7a8b7f; animation: sealPulse .6s ease-out;
}
.diag-node[data-state="seal"] .diag-icon--leak { display: none; }
.diag-node[data-state="seal"] .diag-icon--seal { display: flex; }
.diag-node[data-state="seal"] .diag-drip { display: none; }
.diag-node[data-state="seal"] .diag-state--leak { display: none; }
.diag-node[data-state="seal"] .diag-state--seal { display: block; }

/* Before column (right) — starts "pending" (dashed gray, blank), resolves to ok/lost */
.diag-circle--before { border-style: dashed; border-color: #c7c2b8; background: transparent; color: #9a958a; }
.diag-state--pending { color: #c7c2b8; }
.diag-state--ok { color: #c7c2b8; }
.diag-state--lost { color: #996321; }

.diag-node[data-state="ok"] .diag-circle--before {
  border-style: solid; border-color: #c7c2b8; background: rgba(143,139,130,0.14); color: #c7c2b8;
  animation: sealPulse .6s ease-out;
}
.diag-node[data-state="ok"] .diag-icon--check { display: flex; }
.diag-node[data-state="ok"] .diag-state--pending { display: none; }
.diag-node[data-state="ok"] .diag-state--ok { display: block; }

.diag-node[data-state="lost"] .diag-circle--before {
  border-style: solid; border-color: #996321; background: rgba(153,99,33,0.14); color: #996321;
  animation: sealPulse .6s ease-out;
}
.diag-node[data-state="lost"] .diag-icon--x { display: flex; }
.diag-node[data-state="lost"] .diag-state--pending { display: none; }
.diag-node[data-state="lost"] .diag-state--lost { display: block; }

/* Final boxes */
.diag-final { transition: background .5s, color .5s, border-color .5s; }
.diag-final--after { background: #f7f5f0; color: #1c2b3a; }
.diag-final--after[data-state="done"] { background: #647268; color: #f7f5f0; }
.diag-dollar { transition: transform .4s cubic-bezier(.34,1.56,.64,1), opacity .3s; transform: scale(0); opacity: 0; }
.diag-final--after[data-state="done"] .diag-dollar { transform: scale(1); opacity: 1; }

.diag-final--before { border: 1px dashed #c7c2b8; background: #f7f5f0; color: #1c2b3a; }
.diag-final--before[data-state="done"] { border-style: solid; border-color: #996321; background: #996321; color: #f7f5f0; }
.diag-final-reason { display: none; }
.diag-final--before[data-state="done"] .diag-final-reason { display: block; }

@media (prefers-reduced-motion: reduce) {
  .diag-circle, .diag-token, .diag-final, .diag-dollar, .diag-drip { transition: none !important; animation: none !important; }
}

/* ================= Home page: service line carousel =================
   4 equal-weight slide cards, only one visible/in-flow at a time; auto-rotated by
   assets/js/site.js, paused on hover/touch. Dots reflect/control the active slide. */
.carousel-slide { position: absolute; inset: 0; opacity: 0; pointer-events: none; transition: opacity .5s ease; }
.carousel-slide.is-active { position: relative; opacity: 1; pointer-events: auto; }
.carousel-dot { width: 8px; height: 8px; border-radius: 50%; border: 1px solid #996321; background: transparent; padding: 0; cursor: pointer; transition: background .2s; }
.carousel-dot.is-active { background: #996321; }
@media (prefers-reduced-motion: reduce) {
  .carousel-slide { transition: none !important; }
}

/* ================= No-Leak Guarantee modal ================= */
.guarantee-modal { position: fixed; inset: 0; z-index: 100; display: none; align-items: center; justify-content: center; padding: 20px; }
.guarantee-modal.open { display: flex; }
.guarantee-modal-overlay { position: absolute; inset: 0; background: rgba(28,43,58,0.6); }
.guarantee-modal-panel {
  position: relative; max-width: 560px; width: 100%; max-height: 85vh; overflow-y: auto;
  background: #f7f5f0; border: 1px solid rgba(28,43,58,0.16); padding: 40px 32px 32px;
  box-shadow: 0 20px 48px rgba(28,43,58,0.28);
}
.guarantee-modal-close {
  position: absolute; top: 14px; right: 14px; background: none; border: none; cursor: pointer;
  color: #1c2b3a; padding: 6px; display: flex; align-items: center; justify-content: center;
}
.guarantee-modal-close:hover { color: #996321; }
