/* =============================================================
   HOT SWAP — Shared brand stylesheet (v2)
   Used by index, homeowner, pricing, multifamily, case-studies,
   and admin pages.
   ============================================================= */

:root {
  /* Brand — official Hot Swap red per SEO intake */
  --hs-red:        #F90004;
  --hs-red-dark:   #C00003;
  --hs-red-deeper: #900002;
  --hs-soft:       #F2F2F4;   /* was #FDE8E9 — Apple-esque cool gray */
  --hs-black:      #0D0D0D;
  --hs-ink:        #1A1A1A;
  --hs-ink-soft:   #2A2A2A;

  /* Neutrals */
  --bg:            #F5F5F7;   /* Apple system bg */
  --panel:         #FFFFFF;
  --panel-2:       #FAFBFC;
  --border:        #E5E5EA;
  --border-strong: #D1D1D6;
  --muted:         #5B6068;
  --muted-soft:    #8E8E93;

  /* Status */
  --good:        #1F7A3F;
  --good-soft:   #E6F4EC;
  --warn:        #B3601A;
  --warn-soft:   #FDF1E3;
  --bad:         #B81418;
  --bad-soft:    #FDE8E9;

  /* Effects */
  --shadow-sm: 0 1px 2px rgba(0,0,0,0.04);
  --shadow:    0 1px 2px rgba(0,0,0,0.04), 0 4px 16px rgba(0,0,0,0.06);
  --shadow-lg: 0 4px 8px rgba(0,0,0,0.06), 0 16px 40px rgba(0,0,0,0.10);
  --radius:    12px;
  --radius-sm: 8px;
  --radius-pill: 999px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0; padding: 0;
  background: var(--bg);
  color: var(--hs-ink);
  font-family: -apple-system, BlinkMacSystemFont, "Inter", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 15px; line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--hs-red-dark); text-decoration: none; }
a:hover { color: var(--hs-red); text-decoration: none; }

/* hero / nav / button areas: never underline */
.hero-half a, .hero-half a:hover,
.btn, .btn:hover, .hs-nav a, .hs-nav a:hover,
.pill-card, .pill-card:hover { text-decoration: none; }

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

/* ---------- Header ---------- */
.hs-header {
  background: rgba(255,255,255,0.94);
  backdrop-filter: saturate(180%) blur(14px);
  -webkit-backdrop-filter: saturate(180%) blur(14px);
  border-bottom: 1px solid var(--border);
  position: sticky; top: 0; z-index: 50;
}
.hs-header-inner {
  max-width: 1400px; margin: 0 auto;
  padding: 14px 28px;
  display: flex; align-items: center; gap: 24px;
}
.hs-header img.logo { height: 78px; width: auto; }

.hs-nav { margin-left: auto; display: flex; gap: 22px; align-items: center; flex-wrap: wrap; }
.hs-nav a {
  color: var(--hs-ink); font-weight: 500; font-size: 14px; letter-spacing: 0.01em;
}
.hs-nav a:hover { color: var(--hs-red-dark); }
.hs-nav .phone { color: var(--hs-red-dark); font-weight: 700; }

.menu-toggle {
  display: none; background: none; border: 0; cursor: pointer;
  padding: 8px; margin-left: auto;
}
.menu-toggle svg { width: 28px; height: 28px; stroke: var(--hs-ink); }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 12px 22px; border-radius: var(--radius-pill);
  font-weight: 600; font-size: 14px; letter-spacing: 0.01em;
  border: 1px solid transparent; cursor: pointer;
  transition: transform .08s ease, background .15s, border-color .15s, color .15s, box-shadow .15s;
  white-space: nowrap;
}
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--hs-red); color: #fff; }
.btn-primary:hover { background: var(--hs-red-dark); color: #fff; box-shadow: 0 4px 14px rgba(227,30,36,0.25); }
.btn-dark { background: var(--hs-black); color: #fff; }
.btn-dark:hover { background: var(--hs-ink); color: #fff; }
.btn-ghost { background: transparent; color: var(--hs-ink); border-color: var(--border-strong); }
.btn-ghost:hover { background: var(--panel-2); color: var(--hs-red-dark); border-color: var(--hs-red); }
.btn-light {
  background: rgba(255,255,255,0.12); color: #fff;
  border-color: rgba(255,255,255,0.35); backdrop-filter: blur(10px);
}
.btn-light:hover { background: rgba(255,255,255,0.22); color: #fff; }
.btn-lg { padding: 16px 28px; font-size: 15px; }

/* ---------- Layout helpers ---------- */
.container { max-width: 1200px; margin: 0 auto; padding: 0 28px; }
.section { padding: 52px 0; }
.section-tight { padding: 28px 0; }
.eyebrow { color: var(--hs-red-dark); font-size: 12px; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase; margin: 0 0 12px; }
h1, h2, h3, h4 { color: var(--hs-black); margin: 0; font-weight: 700; letter-spacing: -0.018em; }
h1 { font-size: 48px; line-height: 1.05; }
h2 { font-size: 36px; line-height: 1.1; }
h3 { font-size: 22px; line-height: 1.2; }
p.lead { font-size: 18px; color: var(--muted); }

/* ---------- Cards / panels ---------- */
.card {
  background: var(--panel); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 24px; box-shadow: var(--shadow-sm);
}
.card-accent { border-top: 4px solid var(--hs-red); }
.kpi {
  background: var(--panel); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 20px;
}
.kpi .num { font-size: 28px; font-weight: 700; color: var(--hs-black); letter-spacing: -0.02em; }
.kpi .lbl { font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.06em; font-weight: 600; }

/* ---------- Footer ---------- */
.hs-footer {
  background: var(--hs-black); color: #cfd1d6;
  padding: 56px 0 24px; margin-top: 60px;
}
.hs-footer img.logo-white {
  /* logo-white.png is white-on-transparent — renders crisp on the dark footer with no filter */
}
.hs-footer .container { display: grid; grid-template-columns: 1.4fr 1fr 1fr 1fr; gap: 32px; }
.hs-footer h4 { color: #fff; font-size: 13px; letter-spacing: 0.08em; text-transform: uppercase; margin: 0 0 14px; font-weight: 700; }
.hs-footer a { color: #cfd1d6; text-decoration: none; }
.hs-footer a:hover { color: #fff; }
.hs-footer .legal { border-top: 1px solid #222; padding-top: 18px; margin-top: 36px; font-size: 12px; color: #8a8f98; display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; }

/* ---------- Forms ---------- */
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 16px; }
.field label { font-size: 13px; font-weight: 600; color: var(--hs-ink); letter-spacing: 0.01em; }
.field input, .field select, .field textarea {
  width: 100%; padding: 12px 14px; font-size: 15px;
  border: 1px solid var(--border-strong); border-radius: var(--radius-sm);
  background: #fff; color: var(--hs-ink); font-family: inherit;
  transition: border-color .15s, box-shadow .15s;
}
.field input:focus, .field select:focus, .field textarea:focus {
  outline: none; border-color: var(--hs-red);
  box-shadow: 0 0 0 4px rgba(227,30,36,0.12);
}
.field .hint { font-size: 12px; color: var(--muted); }

.option-grid { display: grid; gap: 12px; grid-template-columns: 1fr 1fr; }
.option {
  border: 1.5px solid var(--border-strong); border-radius: var(--radius-sm);
  padding: 18px; cursor: pointer; background: #fff;
  display: flex; flex-direction: column; gap: 6px;
  transition: all .15s; user-select: none;
}
.option:hover { border-color: var(--hs-red); background: var(--hs-soft); }
.option.selected { border-color: var(--hs-red); background: var(--hs-soft); box-shadow: 0 0 0 3px rgba(227,30,36,0.08); }
.option .opt-title { font-weight: 700; color: var(--hs-black); }
.option .opt-desc { font-size: 13px; color: var(--muted); }
.option .opt-icon { font-size: 28px; }

/* ---------- Pill cards (pricing categories) ---------- */
.pill-card {
  background: #fff; border: 1px solid var(--border);
  border-radius: 24px; padding: 32px; cursor: pointer;
  transition: all .2s ease;
  display: flex; flex-direction: column; gap: 14px;
  color: var(--hs-ink);
}
.pill-card:hover {
  border-color: var(--hs-red); transform: translateY(-3px);
  box-shadow: 0 8px 32px rgba(0,0,0,0.08);
  color: var(--hs-ink);
}

/* ---------- Mobile / Tablet ---------- */
@media (max-width: 1024px) {
  .container { max-width: 920px; }
  h1 { font-size: 40px; }
  h2 { font-size: 30px; }
  .section { padding: 44px 0; }
  .hs-footer .container { grid-template-columns: 1.2fr 1fr 1fr 1fr; }
}

@media (max-width: 768px) {
  h1 { font-size: 34px; }
  h2 { font-size: 26px; }
  .section { padding: 32px 0; }
  .container { padding: 0 18px; }
  .hs-header-inner { padding: 12px 18px; gap: 14px; }
  .hs-header img.logo { height: 52px; }
  .menu-toggle { display: inline-flex; }
  .hs-nav {
    display: none; position: absolute; top: 100%; left: 0; right: 0;
    background: #fff; flex-direction: column; align-items: stretch;
    padding: 14px 18px; gap: 14px; border-bottom: 1px solid var(--border);
    box-shadow: var(--shadow);
  }
  .hs-nav.open { display: flex; }
  .hs-nav a { font-size: 16px; padding: 4px 0; }
  .hs-footer .container { grid-template-columns: 1fr 1fr; }
  .option-grid { grid-template-columns: 1fr; }
}

/* Footer logo — used on financing, referrals, and blog pages */
.footer-logo {
  height: 36px;
  width: auto;
  margin-bottom: 16px;
  display: block;
}

/* =================================================================
   ACCESSIBILITY (WCAG 2.1 AA)
   ================================================================= */

/* Skip-to-main-content link — visible on focus only */
.skip-link {
  position: absolute; top: -40px; left: 8px; z-index: 99999;
  padding: 10px 16px; background: var(--hs-ink); color: #fff;
  font-weight: 700; font-size: 14px; border-radius: 6px;
  text-decoration: none;
  transition: top .15s;
}
.skip-link:focus, .skip-link:focus-visible {
  top: 8px; outline: 3px solid var(--hs-red); outline-offset: 2px;
}

/* Visible focus rings — keyboard users only (won't show on mouse click) */
*:focus-visible {
  outline: 3px solid var(--hs-red);
  outline-offset: 2px;
  border-radius: 2px;
}
.btn:focus-visible,
.btn-phone-pill:focus-visible {
  outline-offset: 3px;
}
a:focus-visible {
  outline-offset: 3px;
}

/* Visually hidden — for screen-reader-only content */
.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;
}

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

/* Improve contrast on muted-soft text in copyright/legal */
.hs-footer .legal { color: #bcbec3; }
