/* ==========================================================================
   ROOT VARIABLES — swap these to re-theme the entire site
   ========================================================================== */
:root {
  --color-bg: #14161a;
  --color-bg-alt: #1c1f24;
  --color-surface: #22262c;
  --color-surface-alt: #2a2f36;
  --color-border: #33373d;
  --color-text: #f2f2f2;
  --color-text-muted: #b0b4ba;
  --color-accent: #5D84C1;
  --color-accent-dark: #4A6FA5;
  --color-accent-text: #06131f;

  --font-heading: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --font-body: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;

  --radius: 4px;
  --container-width: 1200px;

  /* mobile breakpoint is 899px / 900px — see @media queries below.
     CSS custom properties cannot be used inside @media conditions,
     so the literal px value is repeated there; this variable exists
     purely as documentation of that value. */
  --bp-mobile: 899px;
}

/* ==========================================================================
   RESET / BASE
   ========================================================================== */
*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
}

body {
  background: var(--color-bg);
  color: var(--color-text);
  font-family: var(--font-body);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

h1,
h2,
h3,
h4 {
  font-family: var(--font-heading);
  line-height: 1.25;
  margin: 0 0 0.5em;
  font-weight: 700;
}

h1 { font-size: clamp(2rem, 4vw, 3rem); }
h2 { font-size: clamp(1.5rem, 3vw, 2.25rem); }
h3 { font-size: 1.25rem; }

p {
  margin: 0 0 1em;
  color: var(--color-text-muted);
}

a {
  color: var(--color-accent);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

ul {
  margin: 0 0 1em;
  padding-left: 1.25em;
  color: var(--color-text-muted);
}

ol {
  margin: 0;
  padding-left: 1.25em;
  color: var(--color-text-muted);
}

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

/* ==========================================================================
   LAYOUT UTILITIES
   ========================================================================== */
.container {
  width: 100%;
  max-width: var(--container-width);
  margin: 0 auto;
  padding: 0 1.5rem;
}

.section {
  padding: 4rem 0;
}

.section-alt {
  background: var(--color-bg-alt);
}

.section-header {
  max-width: 700px;
  margin: 0 0 2.5rem;
}

.section-header--center {
  margin-left: auto;
  margin-right: auto;
  text-align: center;
}

.grid-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.75rem;
}

.grid-2 {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.75rem;
}

.split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3rem;
  align-items: center;
}

/* ==========================================================================
   HEADER & NAV
   ========================================================================== */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--color-bg);
  border-bottom: 1px solid var(--color-border);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.85rem 1.5rem;
  max-width: var(--container-width);
  margin: 0 auto;
  gap: 1.5rem;
}

.logo {
  font-family: var(--font-heading);
  font-weight: 800;
  font-size: 1.15rem;
  letter-spacing: 0.03em;
  color: var(--color-text);
  text-decoration: none;
  white-space: nowrap;
}

.logo:hover {
  text-decoration: none;
}

.logo-mark {
  color: var(--color-accent);
}

.logo-img {
  display: block;
  height: 32px;
  width: auto;
}

.footer-logo-img {
  margin-bottom: 1rem;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 1.25rem;
}

.header-phone {
  color: var(--color-text);
  font-weight: 600;
  white-space: nowrap;
  font-size: 0.95rem;
}

.header-phone:hover {
  color: var(--color-accent);
}

/* Nav */
.site-nav {
  display: flex;
}

.nav-list {
  display: flex;
  list-style: none;
  margin: 0;
  padding: 0;
  gap: 0.25rem;
}

.nav-item {
  position: relative;
  display: flex;
  align-items: stretch;
}

.nav-link-row {
  display: flex;
  align-items: center;
}

.nav-link {
  display: flex;
  align-items: center;
  padding: 0.75rem 0.9rem;
  color: var(--color-text);
  font-weight: 600;
  font-size: 0.95rem;
  white-space: nowrap;
  border-radius: var(--radius);
}

.nav-link:hover {
  color: var(--color-accent);
  text-decoration: none;
}

.nav-item.nav-active > .nav-link-row > .nav-link,
.nav-item.nav-parent-active > .nav-link-row > .nav-link {
  color: var(--color-accent);
}

.dropdown-toggle {
  display: none;
  align-items: center;
  justify-content: center;
  background: none;
  border: none;
  color: var(--color-text);
  cursor: pointer;
  padding: 0 0.6rem;
}

.dropdown-toggle .chevron {
  width: 10px;
  height: 10px;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: rotate(45deg);
  transition: transform 0.15s ease;
}

.dropdown-menu {
  display: none;
  list-style: none;
  margin: 0;
  padding: 0.5rem 0;
}

.dropdown-menu a {
  display: block;
  padding: 0.55rem 1rem;
  color: var(--color-text);
  font-size: 0.92rem;
  white-space: nowrap;
}

.dropdown-menu a:hover {
  color: var(--color-accent);
  text-decoration: none;
  background: var(--color-surface-alt);
}

.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 40px;
  height: 40px;
  background: none;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  cursor: pointer;
}

.nav-toggle span {
  display: block;
  height: 2px;
  background: var(--color-text);
  border-radius: 1px;
}

/* Desktop dropdown behavior (hover + keyboard focus) */
@media (min-width: 900px) {
  .nav-item.has-dropdown:hover > .dropdown-menu,
  .nav-item.has-dropdown:focus-within > .dropdown-menu {
    display: block;
    position: absolute;
    top: 100%;
    left: 0;
    min-width: 240px;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.35);
  }
}

/* ==========================================================================
   BUTTONS / CTA
   ========================================================================== */
.btn {
  display: inline-block;
  padding: 0.8rem 1.6rem;
  border-radius: var(--radius);
  font-weight: 700;
  font-size: 0.95rem;
  border: 2px solid transparent;
  cursor: pointer;
  white-space: nowrap;
}

.btn:hover {
  text-decoration: none;
}

.btn-primary {
  background: var(--color-accent);
  color: var(--color-accent-text);
}

.btn-primary:hover {
  background: var(--color-accent-dark);
}

.btn-outline {
  background: transparent;
  color: var(--color-text);
  border-color: var(--color-border);
}

.btn-outline:hover {
  border-color: var(--color-accent);
  color: var(--color-accent);
}

/* ==========================================================================
   HERO
   ========================================================================== */
.hero {
  position: relative;
  overflow: hidden;
  isolation: isolate;
  display: flex;
  align-items: center;
  min-height: clamp(480px, 70vh, 680px);
  padding: 5rem 0;
}

.hero-slideshow {
  position: absolute;
  inset: 0;
  z-index: 0;
}

/* Crossfade cycle = 3 slides × (5s hold + 1s dissolve) = 18s.
   delay(i) = i × 6s keeps each slide's own 18s period locked in phase forever. */
:root {
  --hero-slide-step: 6s;
}

.hero-slide {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  animation: hero-slideshow 18s infinite;
}

.hero-slide:nth-child(1) { animation-delay: 0s; }
.hero-slide:nth-child(2) { animation-delay: var(--hero-slide-step); }
.hero-slide:nth-child(3) { animation-delay: calc(var(--hero-slide-step) * 2); }

@keyframes hero-slideshow {
  0%     { opacity: 0; }
  5.56%  { opacity: 1; }
  33.33% { opacity: 1; }
  38.89% { opacity: 0; }
  100%   { opacity: 0; }
}

@media (prefers-reduced-motion: reduce) {
  .hero-slide { animation: none; opacity: 0; }
  .hero-slide:first-child { opacity: 1; }
}

.hero-overlay {
  position: absolute;
  inset: 0;
  z-index: 1;
  background: linear-gradient(90deg,
    rgba(20, 22, 26, 0.94) 0%,
    rgba(20, 22, 26, 0.88) 42%,
    rgba(20, 22, 26, 0.45) 62%,
    rgba(20, 22, 26, 0) 88%);
}

.hero-content {
  position: relative;
  z-index: 2;
  max-width: 560px;
}

.hero-divider {
  width: 56px;
  height: 3px;
  background: var(--color-accent);
  margin: 1rem 0 1.5rem;
}

.hero-badges {
  display: flex;
  gap: 1.75rem;
  flex-wrap: wrap;
  margin: 1.5rem 0;
}

.hero-badge {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.hero-badge-icon {
  width: 34px;
  height: 34px;
  flex-shrink: 0;
}

.hero-badge-label {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  line-height: 1.3;
  color: var(--color-text-muted);
}

.hero-eyebrow {
  color: var(--color-accent);
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-size: 0.85rem;
  margin-bottom: 0.75rem;
  display: block;
}

.hero-actions {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  margin-top: 2rem;
  flex-wrap: wrap;
}

.hero-phone {
  font-weight: 700;
  color: var(--color-text);
  font-size: 1.05rem;
}

/* Page hero (used on all interior/detail pages) */
.page-hero {
  padding: 3.5rem 0;
  border-bottom: 1px solid var(--color-border);
}

.breadcrumb {
  color: var(--color-text-muted);
  font-size: 0.85rem;
  margin-bottom: 1rem;
}

.breadcrumb a {
  color: var(--color-text-muted);
}

.breadcrumb a:hover {
  color: var(--color-accent);
}

.page-hero-lede {
  max-width: 720px;
  font-size: 1.1rem;
}

/* ==========================================================================
   CARDS
   ========================================================================== */
.card-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.75rem;
}

.card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.card-body {
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  flex: 1;
}

.card-body h3 {
  margin-bottom: 0.5rem;
}

.card-body p {
  flex: 1;
}

.card-link {
  font-weight: 700;
  font-size: 0.9rem;
}

.mini-card-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
}

.mini-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 1.5rem;
  text-align: center;
}

/* ==========================================================================
   IMAGE PLACEHOLDER
   ========================================================================== */
.img-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  background: var(--color-surface);
  border: 2px dashed var(--color-border);
  border-radius: var(--radius);
  color: var(--color-text-muted);
  font-size: 0.85rem;
  font-weight: 600;
  padding: 1rem;
  width: 100%;
}

.img-placeholder::before {
  content: "🖼";
  display: block;
  font-size: 1.6rem;
  margin-bottom: 0.5rem;
  opacity: 0.6;
}

.img-placeholder::after {
  content: attr(data-placeholder);
}

.img-placeholder--card {
  aspect-ratio: 4 / 3;
}

.img-placeholder--square {
  aspect-ratio: 1 / 1;
}

.img-placeholder--wide {
  aspect-ratio: 16 / 9;
}

img.img-placeholder--card,
img.img-placeholder--square,
img.img-placeholder--wide {
  display: block;
  width: 100%;
  object-fit: cover;
  border-radius: var(--radius);
}

/* ==========================================================================
   CONTENT SECTIONS (detail pages)
   ========================================================================== */
.content-block {
  max-width: 800px;
  margin: 0 0 3rem;
}

.content-block:last-child {
  margin-bottom: 0;
}

.process-steps {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1.5rem;
}

.process-step {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 1.25rem;
}

.process-step-number {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--color-accent);
  color: var(--color-accent-text);
  font-weight: 800;
  margin-bottom: 0.75rem;
}

/* CTA band */
.cta-band {
  padding: 4rem 0;
  text-align: center;
  background: var(--color-bg-alt);
  border-top: 1px solid var(--color-border);
  border-bottom: 1px solid var(--color-border);
}

.cta-band .btn {
  margin: 0 0.5rem;
}

.cta-band-phone {
  display: block;
  margin-top: 1rem;
  font-weight: 700;
  color: var(--color-text);
}

/* ==========================================================================
   LOCATIONS MAP
   ========================================================================== */
.us-map-wrap {
  position: relative;
  max-width: 900px;
  margin: 0 auto;
}

.us-map {
  width: 100%;
  height: auto;
  display: block;
}

.us-map .state {
  fill: var(--color-surface-alt);
  stroke: var(--color-bg);
  stroke-width: 1.5;
  cursor: pointer;
  transition: fill 0.15s ease;
}

.us-map .state:hover,
.us-map .state:focus,
.us-map .state.is-hovered {
  fill: var(--color-accent);
  outline: none;
}

.us-map .map-lines {
  fill: none;
  stroke: var(--color-border);
  stroke-width: 2;
}

.map-tooltip {
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 0.4rem 0.9rem;
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--color-text);
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.15s ease;
}

.map-tooltip.is-visible {
  opacity: 1;
}

/* ==========================================================================
   QUOTE FORM
   ========================================================================== */
.quote-form {
  max-width: 720px;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 2rem;
}

.form-row {
  margin-bottom: 1.25rem;
}

.form-row label {
  display: block;
  font-weight: 700;
  font-size: 0.9rem;
  margin-bottom: 0.4rem;
}

.form-row input,
.form-row select,
.form-row textarea {
  width: 100%;
  background: var(--color-bg-alt);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  color: var(--color-text);
  font-family: var(--font-body);
  font-size: 1rem;
  padding: 0.7rem 0.9rem;
}

.form-row input:focus,
.form-row select:focus,
.form-row textarea:focus {
  outline: 2px solid var(--color-accent);
  outline-offset: 1px;
}

.form-row textarea {
  resize: vertical;
  min-height: 120px;
}

.checkbox-group legend {
  font-weight: 700;
  font-size: 0.9rem;
  margin-bottom: 0.4rem;
  padding: 0;
}

.checkbox-option {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 400;
  margin-bottom: 0.5rem;
}

.checkbox-option input[type="checkbox"] {
  width: auto;
  accent-color: var(--color-accent);
}

/* ==========================================================================
   FOOTER
   ========================================================================== */
.site-footer {
  background: var(--color-bg-alt);
  border-top: 1px solid var(--color-border);
  padding: 3.5rem 0 1.5rem;
}

.footer-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr 1fr;
  gap: 2rem;
  padding-bottom: 2.5rem;
}

.footer-col h4 {
  color: var(--color-text);
  font-size: 0.95rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 1rem;
}

.footer-col ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.footer-col li {
  margin-bottom: 0.6rem;
}

.footer-col a {
  color: var(--color-text-muted);
  font-size: 0.9rem;
}

.footer-col a:hover {
  color: var(--color-accent);
}

.footer-about p {
  font-size: 0.9rem;
  max-width: 320px;
}

.footer-social {
  display: flex;
  gap: 0.75rem;
  margin-top: 1rem;
}

.footer-social a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border: 1px solid var(--color-border);
  border-radius: 50%;
  color: var(--color-text-muted);
  font-size: 0.8rem;
}

.footer-social a:hover {
  color: var(--color-accent);
  border-color: var(--color-accent);
  text-decoration: none;
}

.footer-bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--color-border);
  font-size: 0.8rem;
  color: var(--color-text-muted);
}

.footer-bottom a {
  color: var(--color-text-muted);
}

.footer-bottom a:hover {
  color: var(--color-accent);
}

/* ==========================================================================
   RESPONSIVE OVERRIDES
   ========================================================================== */
@media (max-width: 899px) {
  .nav-toggle {
    display: flex;
  }

  .site-nav {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--color-bg);
    border-bottom: 1px solid var(--color-border);
    max-height: calc(100vh - 64px);
    overflow-y: auto;
  }

  .site-nav.is-open {
    display: block;
  }

  .nav-list {
    flex-direction: column;
    gap: 0;
    padding: 0.5rem 0;
  }

  .nav-item {
    flex-direction: column;
    align-items: stretch;
  }

  .nav-link-row {
    justify-content: space-between;
  }

  .nav-link {
    flex: 1;
    padding: 0.9rem 1.5rem;
  }

  .dropdown-toggle {
    display: flex;
  }

  .dropdown-toggle[aria-expanded="true"] .chevron {
    transform: rotate(225deg);
  }

  .dropdown-menu {
    position: static;
    background: var(--color-bg-alt);
    border: none;
    box-shadow: none;
    padding-left: 0.5rem;
  }

  .dropdown-menu.is-open {
    display: block;
  }

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

  .split > *:first-child {
    order: 1;
  }

  .hero {
    min-height: 420px;
    padding: 3rem 0;
    align-items: flex-end;
  }

  .hero-overlay {
    background: rgba(20, 22, 26, 0.88);
  }

  .hero-content {
    max-width: none;
  }

  .grid-3,
  .card-grid,
  .mini-card-grid {
    grid-template-columns: 1fr;
  }

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

  .process-steps {
    grid-template-columns: 1fr 1fr;
  }

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

  .footer-bottom {
    flex-direction: column;
    align-items: flex-start;
  }
}

@media (max-width: 520px) {
  .process-steps {
    grid-template-columns: 1fr;
  }

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