/* MSA Electrical — shared styles
 * Used across index, about, commercial, residential, contact.
 * Page-specific rules (hero, page-hero, split-section, channels, etc.)
 * remain inline on each page.
 */

:root {
  --bolt: #00D4FF;
  --bolt-soft: #4DDDFF;
  --bolt-deep: #0099CC;
  --bolt-glow: rgba(0, 212, 255, 0.45);
  --jet: #000000;
  --carbon: #0A0D12;
  --ink: #15191F;
  --steel: #2A2F38;
  --slate: #6B7280;
  --paper: #FFFFFF;
  --bone: #F6F7F9;
  --wire: #E5E7EB;
  --f-display: 'Montserrat', system-ui, sans-serif;
  --f-body: 'Inter', system-ui, sans-serif;
  --f-mono: 'JetBrains Mono', ui-monospace, monospace;
  --container: 1240px;
  --pad: 96px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; overflow-x: clip; }
body { font-family: var(--f-body); color: var(--carbon); background: var(--paper); -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; line-height: 1.6; overflow-x: clip; }
img, iframe, svg { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }

.is-hidden { display: none !important; }
.wrap { max-width: var(--container); margin: 0 auto; padding: 0 var(--pad); }

h1, h2, h3, h4 { font-family: var(--f-display); letter-spacing: -0.02em; line-height: 1.05; }
h2 { font-size: 56px; font-weight: 800; margin-bottom: 24px; text-wrap: balance; }
h3 { font-size: 22px; font-weight: 700; letter-spacing: -0.01em; margin-bottom: 12px; }
p { font-size: 17px; max-width: 62ch; line-height: 1.65; }
p.lead { font-size: 20px; line-height: 1.6; max-width: 62ch; }

.eyebrow {
  font-family: var(--f-mono); font-size: 12px; letter-spacing: 0.22em;
  text-transform: uppercase; color: var(--bolt-deep);
  display: inline-flex; align-items: center; gap: 12px;
  margin-bottom: 28px;
}
.eyebrow::before { content: ''; width: 28px; height: 1px; background: var(--bolt-deep); }
.dark .eyebrow, .jet .eyebrow { color: var(--bolt); }
.dark .eyebrow::before, .jet .eyebrow::before { background: var(--bolt); }

/* NAV */
nav.site {
  position: sticky; top: 0; z-index: 50;
  background: rgba(15, 18, 24, 0.88);
  backdrop-filter: saturate(120%) blur(14px);
  -webkit-backdrop-filter: saturate(120%) blur(14px);
  border-bottom: 1px solid rgba(255,255,255,0.06);
  color: var(--paper);
}
.nav-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 18px 0; }
.brand-link { display: flex; align-items: center; gap: 12px; flex-shrink: 0; min-width: 0; }
.brand-link img { display: block; }
.brand-lockup { height: clamp(48px, 5vw, 72px); width: auto; }
.nav-links { display: flex; gap: 36px; align-items: center; }
.nav-links a {
  font-family: var(--f-mono); font-size: 11px; letter-spacing: 0.18em;
  text-transform: uppercase; color: #C8CDD5; transition: color .15s;
}
.nav-links a:hover, .nav-links a.active { color: var(--bolt); }
.nav-cta {
  background: var(--bolt); color: #000 !important;
  padding: 14px 26px; border-radius: 999px;
  font-family: var(--f-mono); font-weight: 800;
  font-size: 13px; letter-spacing: 0.10em; text-transform: uppercase;
  box-shadow: 0 0 28px rgba(0,212,255,0.4);
  transition: background .15s, box-shadow .15s, transform .15s;
  min-height: 46px; display: inline-flex; align-items: center;
  text-decoration: none;
}
.nav-cta:hover { background: var(--bolt-soft); box-shadow: 0 0 40px var(--bolt-glow); transform: translateY(-1px); }
.nav-email {
  display: inline-flex; align-items: center; justify-content: center;
  width: 44px; height: 44px; border-radius: 999px;
  color: var(--paper); border: 1px solid rgba(255,255,255,0.22);
  background: rgba(255,255,255,0.04);
  transition: color .15s, border-color .15s, background .15s, transform .15s;
}
.nav-email svg { width: 18px; height: 18px; display: block; }
.nav-email:hover { color: var(--bolt); border-color: var(--bolt); background: rgba(0,212,255,0.08); transform: translateY(-1px); }

/* Hamburger toggle (mobile) — real <button> with aria-expanded */
.nav-burger { display: none; position: relative; z-index: 60; width: 44px; min-width: 44px; height: 44px; flex-shrink: 0; align-items: center; justify-content: center; background: rgba(255,255,255,0.06); border: 1px solid rgba(255,255,255,0.32); border-radius: 6px; cursor: pointer; padding: 0; color: inherit; transition: border-color .15s, background .15s; }
.nav-burger:hover { border-color: var(--bolt); }
.nav-burger span { display: block; width: 20px; height: 2px; background: var(--paper); position: relative; transition: transform .2s, opacity .2s, background-color .2s; }
.nav-burger span::before, .nav-burger span::after { content: ''; position: absolute; left: 0; width: 20px; height: 2px; background: var(--paper); transition: transform .2s, top .2s; }
.nav-burger span::before { top: -7px; }
.nav-burger span::after { top: 7px; }
.nav-burger[aria-expanded="true"] span { background: transparent; }
.nav-burger[aria-expanded="true"] span::before { top: 0; transform: rotate(45deg); }
.nav-burger[aria-expanded="true"] span::after { top: 0; transform: rotate(-45deg); }

/* BUTTONS */
.btn {
  display: inline-flex; align-items: center; gap: 10px;
  padding: 14px 24px; border-radius: 4px;
  font-family: var(--f-mono); font-weight: 600;
  font-size: 11px; letter-spacing: 0.15em; text-transform: uppercase;
  transition: background .15s, box-shadow .15s, color .15s, border-color .15s;
}
.btn-primary { background: var(--bolt); color: var(--jet); border: 1px solid var(--bolt); }
.btn-primary:hover { background: var(--bolt-soft); box-shadow: 0 0 40px var(--bolt-glow); }
.btn-secondary-dark { background: transparent; color: var(--paper); border: 1px solid rgba(255,255,255,0.22); }
.btn-secondary-dark:hover { border-color: var(--bolt); color: var(--bolt); }
.btn-secondary-light { background: transparent; color: var(--carbon); border: 1px solid var(--wire); }
.btn-secondary-light:hover { border-color: var(--carbon); }

/* CTA band (used on home/about/commercial/residential) */
.cta-band {
  background:
    radial-gradient(700px 400px at 80% 30%, rgba(0,212,255,0.12), transparent 65%),
    #15191F;
  color: var(--paper); padding: 72px 0;
  position: relative; overflow: hidden;
  border-top: 1px solid rgba(255,255,255,0.06);
}
.cta-band-row { display: grid; grid-template-columns: 1.4fr 1fr; gap: 80px; align-items: center; }
.cta-band h2 { color: var(--paper); margin-bottom: 16px; }
.cta-band p { color: #BFC4CC; font-size: 18px; max-width: 50ch; }

/* Contact stack (phone/email cards on dark background) */
.contact-stack { display: flex; flex-direction: column; gap: 18px; }
.contact-row {
  display: flex; align-items: center; gap: 20px;
  padding: 22px 24px; border: 1px solid rgba(255,255,255,0.10);
  border-radius: 6px; background: rgba(0,0,0,0.32);
  transition: border-color .2s, background .2s;
}
.contact-row:hover { border-color: var(--bolt); background: rgba(0,0,0,0.5); }
.contact-row .icon {
  width: 44px; height: 44px; flex-shrink: 0;
  border-radius: 50%; background: rgba(0,212,255,0.10);
  color: var(--bolt); display: grid; place-items: center;
}
.contact-row .icon svg { width: 20px; height: 20px; }
.contact-row .meta-label { font-family: var(--f-mono); font-size: 10px; letter-spacing: 0.22em; text-transform: uppercase; color: #8A93A1; margin-bottom: 4px; }
.contact-row .meta-value { font-family: var(--f-display); font-weight: 700; font-size: 22px; color: var(--paper); letter-spacing: -0.01em; }

/* FOOTER */
footer.site {
  background: #0F1218; color: #8A93A1;
  padding: 80px 0 40px;
  border-top: 1px solid rgba(255,255,255,0.06);
}
.footer-grid { display: grid; grid-template-columns: 2fr 1fr 1fr 1.2fr; gap: 48px; margin-bottom: 64px; }
.footer-brand img { display: block; margin-bottom: 20px; }
.footer-lockup { height: 80px; width: auto; }
.footer-brand .tag {
  font-family: var(--f-mono); font-size: 11px; letter-spacing: 0.18em;
  text-transform: uppercase; color: var(--bolt); margin-bottom: 18px;
}
.footer-brand p { font-size: 13px; color: #8A93A1; max-width: 36ch; line-height: 1.65; }
.footer-col h4 {
  font-family: var(--f-mono); font-size: 10px; letter-spacing: 0.22em;
  text-transform: uppercase; color: var(--paper); margin-bottom: 18px;
}
.footer-col ul { list-style: none; display: flex; flex-direction: column; gap: 10px; }
.footer-col ul a { font-size: 14px; color: #8A93A1; transition: color .15s; font-family: var(--f-body); }
.footer-col ul a:hover { color: var(--bolt); }
.footer-bar {
  display: flex; justify-content: space-between; align-items: center;
  gap: 24px; flex-wrap: wrap;
  padding-top: 32px; border-top: 1px solid rgba(255,255,255,0.06);
  font-family: var(--f-mono); font-size: 10px; letter-spacing: 0.18em;
  text-transform: uppercase; color: #6E7785;
}
.footer-bar .creds { color: var(--bolt); }
.footer-bar .built-by { color: #6E7785; }
.footer-bar .built-by a { color: var(--paper); transition: color .15s; }
.footer-bar .built-by a:hover { color: var(--bolt); }

/* Skip link */
.skip-link {
  position: absolute; left: -9999px; top: 0; background: var(--bolt); color: var(--jet);
  padding: 12px 18px; z-index: 100;
  font-family: var(--f-mono); font-weight: 600; font-size: 11px;
  letter-spacing: 0.15em; text-transform: uppercase; border-radius: 0 0 4px 0;
}
.skip-link:focus { left: 0; outline: 3px solid var(--paper); outline-offset: -3px; }

/* Focus visible — WCAG AA contrast */
:where(button, a, input, textarea, select, [tabindex]):focus-visible {
  outline: 3px solid var(--bolt-deep);
  outline-offset: 2px;
  border-radius: 4px;
}

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

/* Mobile nav + footer collapse */
@media (max-width: 960px) {
  :root { --pad: 32px; }
  .footer-grid { grid-template-columns: 1fr 1fr; gap: 32px; }
  .footer-brand { grid-column: 1 / -1; }
  .footer-bar { flex-direction: column; align-items: flex-start; gap: 14px; }
  h2 { font-size: 36px; }

  .nav-burger { display: inline-flex; }
  .nav-row { position: relative; }
  .nav-links {
    position: absolute; top: 100%; left: 0; right: 0;
    flex-direction: column !important; gap: 0 !important;
    background: rgba(0,0,0,0.96);
    backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
    border-top: 1px solid rgba(255,255,255,0.08);
    border-bottom: 1px solid rgba(255,255,255,0.08);
    padding: 8px 32px 24px; max-height: 0; overflow: hidden; opacity: 0;
    visibility: hidden;
    transition: max-height .25s ease, opacity .2s ease, padding .25s ease, visibility 0s .25s;
    pointer-events: none; display: flex !important;
  }
  .nav-links a { padding: 18px 0; font-size: 13px; border-bottom: 1px solid rgba(255,255,255,0.06); display: block; width: 100%; }
  .nav-links a:last-child { border-bottom: 0; }
  .nav-links a.nav-cta { margin-top: 16px; padding: 16px 22px; border-bottom: 0; text-align: center; width: 100%; }
  .nav-burger[aria-expanded="true"] ~ .nav-links {
    max-height: 600px; opacity: 1; padding: 8px 32px 24px;
    pointer-events: auto; visibility: visible;
    transition: max-height .25s ease, opacity .2s ease, padding .25s ease, visibility 0s 0s;
  }
  .nav-email {
    width: 100%; height: auto; padding: 14px 0; border-radius: 0;
    border-color: rgba(255,255,255,0.06); background: transparent;
    justify-content: flex-start;
  }
  .nav-email::after {
    content: ' Email Us'; font-family: var(--f-mono); font-size: 13px;
    letter-spacing: 0.18em; text-transform: uppercase;
    margin-left: 12px; color: inherit;
  }
  .nav-email svg { width: 16px; height: 16px; }
  .nav-cta { width: 100%; min-height: 48px; justify-content: center; }

  .cta-band-row { grid-template-columns: 1fr !important; gap: 48px; }
}

/* Tablet/small contact-row tuning (used by cta-band on all pages with it) */
@media (max-width: 720px) {
  .cta-band { padding-left: 0; padding-right: 0; }
  .cta-band-row { gap: 32px !important; }
  .contact-stack { width: 100%; }
  .contact-row {
    padding: 18px 18px !important;
    gap: 14px !important;
    flex-wrap: nowrap;
    max-width: 100%;
    box-sizing: border-box;
  }
  .contact-row > div { min-width: 0; flex: 1 1 0; }
  .contact-row .meta-value {
    font-size: clamp(15px, 4.4vw, 19px) !important;
    word-break: break-all;
    overflow-wrap: anywhere;
    line-height: 1.2;
  }
  .contact-row .icon { width: 40px !important; height: 40px !important; }
  .cta-band h2 { font-size: clamp(28px, 7vw, 36px) !important; }
  .cta-band p { font-size: 15px !important; max-width: 100%; }
}

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