/* ==========================================================================
   Smith Electrical & Control — Design System
   Palette derived from brand mark: black + white + signal orange,
   with a navy "storage" accent representing the day (solar) / night (battery)
   duality of the company's specialty.
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@500;600;700&family=Inter:wght@400;500;600;700&family=IBM+Plex+Mono:wght@500;600&display=swap');

:root {
  --black: #0b0b0b;
  --charcoal: #17171a;
  --charcoal-2: #202024;
  --off-white: #f6f4ef;
  --paper: #fbfaf7;
  --orange: #f6921e;
  --orange-dark: #d4750f;
  --navy: #10222f;
  --navy-2: #16303f;
  --slate: #6b7178;
  --slate-light: #9aa0a6;
  --line-dark: #2b2b2f;
  --line-light: #e3e0d8;
  --ok: #3fa860;

  --font-display: 'Space Grotesk', sans-serif;
  --font-body: 'Inter', sans-serif;
  --font-mono: 'IBM Plex Mono', monospace;

  --container: 1180px;
  --radius: 3px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  font-family: var(--font-body);
  background: var(--paper);
  color: var(--black);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

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

a { color: inherit; text-decoration: none; }

ul { list-style: none; }

.container {
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 28px;
}

h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 700;
  letter-spacing: -0.01em;
  line-height: 1.08;
}

h1 { font-size: clamp(2.4rem, 5vw, 4rem); }
h2 { font-size: clamp(1.9rem, 3.4vw, 2.7rem); }
h3 { font-size: 1.3rem; }

.eyebrow {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--orange);
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 16px;
}

.eyebrow::before {
  content: '';
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--orange);
  box-shadow: 0 0 0 3px rgba(246, 146, 30, 0.2);
}

p.lede {
  font-size: 1.1rem;
  color: var(--slate);
  max-width: 56ch;
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 0.95rem;
  padding: 14px 26px;
  border-radius: var(--radius);
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform 0.15s ease, background 0.15s ease, color 0.15s ease, border-color .15s ease;
  white-space: nowrap;
}
.btn:active { transform: translateY(1px); }

.btn-primary {
  background: var(--orange);
  color: var(--black);
}
.btn-primary:hover { background: #ffa53a; }

.btn-outline {
  background: transparent;
  border-color: rgba(255,255,255,0.25);
  color: var(--off-white);
}
.btn-outline:hover { border-color: var(--orange); color: var(--orange); }

.btn-dark {
  background: var(--black);
  color: var(--off-white);
  border-color: var(--black);
}
.btn-dark:hover { background: var(--orange); border-color: var(--orange); color: var(--black); }

.btn-block { width: 100%; justify-content: center; }

/* ---------- Header / Nav ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--black);
  border-bottom: 1px solid var(--line-dark);
}

.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 28px;
  max-width: var(--container);
  margin: 0 auto;
  gap: 20px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand img {
  height: 52px;
  width: 52px;
  border-radius: 6px;
}

.brand-text {
  display: flex;
  flex-direction: column;
  color: var(--off-white);
  font-family: var(--font-display);
  line-height: 1.15;
}
.brand-text strong { font-size: 1.05rem; letter-spacing: 0.01em; }
.brand-text span {
  font-family: var(--font-mono);
  font-size: 0.62rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--orange);
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 32px;
  font-size: 0.92rem;
  font-weight: 500;
  color: var(--slate-light);
}
.nav-links a { transition: color 0.15s ease; padding: 6px 0; position: relative; }
.nav-links a:hover, .nav-links a.active { color: var(--off-white); }
.nav-links a.active::after {
  content: '';
  position: absolute;
  left: 0; right: 0; bottom: -2px;
  height: 2px;
  background: var(--orange);
}

.nav-cta { display: flex; align-items: center; gap: 18px; }

/* ---------- Social links ---------- */
.social-links {
  display: flex;
  align-items: center;
  gap: 10px;
}
.social-links a {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border: 1px solid var(--line-dark);
  border-radius: 50%;
  color: var(--off-white);
  transition: border-color 0.15s ease, color 0.15s ease, background 0.15s ease;
}
.social-links a:hover {
  border-color: var(--orange);
  color: var(--orange);
  background: rgba(246,146,30,0.08);
}
.social-links svg { width: 16px; height: 16px; }

.social-links.on-light a {
  border-color: var(--line-light);
  color: var(--black);
}
.social-links.on-light a:hover {
  border-color: var(--orange);
  color: var(--orange-dark);
  background: rgba(246,146,30,0.08);
}

.footer-social {
  margin-top: 18px;
}
.footer-social p {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--slate-light);
  margin-bottom: 12px;
}

.nav-phone {
  display: flex;
  flex-direction: column;
  color: var(--off-white);
  font-size: 0.82rem;
  text-align: right;
}
.nav-phone strong {
  font-family: var(--font-mono);
  color: var(--orange);
  font-size: 0.98rem;
}

.nav-toggle {
  display: none;
  background: none;
  border: none;
  color: var(--off-white);
  font-size: 1.6rem;
  cursor: pointer;
}

/* ---------- Signature: power line ---------- */
.power-divider {
  position: relative;
  height: 46px;
  overflow: hidden;
}
.power-divider svg { width: 100%; height: 100%; display: block; }
.power-divider .flow {
  stroke: var(--orange);
  stroke-width: 2;
  fill: none;
  stroke-dasharray: 6 10;
  animation: flow 2.2s linear infinite;
  opacity: 0.55;
}
.power-divider .node {
  fill: var(--orange);
}
@keyframes flow {
  to { stroke-dashoffset: -32; }
}
@media (prefers-reduced-motion: reduce) {
  .power-divider .flow { animation: none; }
}

/* ---------- Hero ---------- */
.hero {
  background: var(--black);
  color: var(--off-white);
  position: relative;
  overflow: hidden;
}
.hero-grid {
  max-width: var(--container);
  margin: 0 auto;
  padding: 88px 28px 70px;
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  gap: 50px;
  align-items: center;
}
.hero h1 { color: var(--off-white); margin-bottom: 20px; }
.hero h1 em {
  font-style: normal;
  color: var(--orange);
}
.hero .lede { color: var(--slate-light); margin-bottom: 34px; }
.hero-actions { display: flex; gap: 14px; flex-wrap: wrap; margin-bottom: 40px; }

.hero-stats {
  display: flex;
  gap: 32px;
  border-top: 1px solid var(--line-dark);
  padding-top: 22px;
  flex-wrap: wrap;
}
.hero-stats div strong {
  display: block;
  font-family: var(--font-mono);
  font-size: 1.3rem;
  color: var(--orange);
}
.hero-stats div span {
  font-size: 0.78rem;
  color: var(--slate-light);
}

.hero-diagram {
  background: var(--charcoal);
  border: 1px solid var(--line-dark);
  border-radius: 6px;
  padding: 28px 24px;
}
.hero-diagram svg { width: 100%; height: auto; }
.diagram-caption {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  color: var(--slate-light);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  margin-top: 14px;
  display: flex;
  justify-content: space-between;
}

/* ---------- Sections ---------- */
section { padding: 88px 0; }
.section-light { background: var(--paper); }
.section-off { background: var(--off-white); }
.section-dark { background: var(--black); color: var(--off-white); }
.section-navy { background: var(--navy); color: var(--off-white); }

.section-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 30px;
  margin-bottom: 46px;
  flex-wrap: wrap;
}

/* ---------- Service / breaker cards ---------- */
.grid-4 {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1px;
  background: var(--line-light);
  border: 1px solid var(--line-light);
}
.grid-2 {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1px;
  background: var(--line-light);
  border: 1px solid var(--line-light);
}

.breaker-card {
  background: var(--paper);
  padding: 34px 26px;
  position: relative;
  transition: background 0.2s ease;
}
.breaker-card:hover { background: var(--off-white); }

.breaker-toggle {
  width: 30px;
  height: 44px;
  border: 2px solid var(--black);
  border-radius: 4px;
  position: relative;
  margin-bottom: 22px;
}
.breaker-toggle::after {
  content: '';
  position: absolute;
  left: 50%;
  top: 6px;
  width: 3px;
  height: 16px;
  background: var(--orange);
  transform: translateX(-50%);
}

.breaker-card h3 { margin-bottom: 10px; }
.breaker-card p { color: var(--slate); font-size: 0.94rem; }
.breaker-card .tag {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--orange-dark);
  display: block;
  margin-bottom: 14px;
}

/* ---------- Nameplate / credentials strip ---------- */
.nameplate {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  border: 1px solid var(--line-dark);
  background: var(--charcoal);
}
.nameplate div {
  padding: 22px 24px;
  border-right: 1px solid var(--line-dark);
}
.nameplate div:last-child { border-right: none; }
.nameplate span {
  display: block;
  font-family: var(--font-mono);
  font-size: 0.65rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--slate-light);
  margin-bottom: 6px;
}
.nameplate strong {
  font-family: var(--font-mono);
  font-size: 1.05rem;
  color: var(--orange);
}

/* ---------- Two column content ---------- */
.split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 60px;
  align-items: center;
}
.split img, .split .art { border-radius: 6px; }

/* ---------- CTA band ---------- */
.cta-band {
  background: var(--orange);
  color: var(--black);
  text-align: center;
  padding: 70px 0;
}
.cta-band h2 { margin-bottom: 16px; }
.cta-band p { max-width: 50ch; margin: 0 auto 30px; color: rgba(0,0,0,0.7); font-size: 1.05rem; }
.cta-actions { display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; }
.cta-band .btn-outline { border-color: rgba(0,0,0,0.35); color: var(--black); }
.cta-band .btn-outline:hover { border-color: var(--black); background: var(--black); color: var(--orange); }

/* ---------- Footer ---------- */
.site-footer {
  background: var(--black);
  color: var(--slate-light);
  padding: 60px 0 26px;
}
.footer-grid {
  display: grid;
  grid-template-columns: 1.3fr 1fr 1fr 1fr;
  gap: 40px;
  padding-bottom: 40px;
}
.footer-brand { display: flex; gap: 14px; margin-bottom: 16px; }
.footer-brand img { height: 48px; width: 48px; border-radius: 6px; }
.footer-brand strong { color: var(--off-white); font-family: var(--font-display); display: block; }
.footer-brand span { font-family: var(--font-mono); font-size: 0.62rem; color: var(--orange); letter-spacing: 0.12em; text-transform: uppercase; }
.footer-col h4 {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--off-white);
  margin-bottom: 16px;
}
.footer-col ul li { margin-bottom: 10px; font-size: 0.9rem; }
.footer-col ul li a:hover { color: var(--orange); }
.footer-bottom {
  border-top: 1px solid var(--line-dark);
  padding-top: 22px;
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
  font-size: 0.78rem;
  font-family: var(--font-mono);
  color: var(--slate);
}

/* ---------- Forms ---------- */
.form-field { margin-bottom: 20px; }
.form-field label {
  display: block;
  font-size: 0.82rem;
  font-weight: 600;
  margin-bottom: 8px;
}
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.form-field input,
.form-field select,
.form-field textarea {
  width: 100%;
  padding: 13px 14px;
  border: 1px solid var(--line-light);
  border-radius: var(--radius);
  font-family: var(--font-body);
  font-size: 0.95rem;
  background: var(--paper);
  color: var(--black);
}
.form-field textarea { resize: vertical; min-height: 120px; }
.form-field input:focus,
.form-field select:focus,
.form-field textarea:focus {
  outline: none;
  border-color: var(--orange);
  box-shadow: 0 0 0 3px rgba(246,146,30,0.15);
}
.form-note { font-size: 0.8rem; color: var(--slate); margin-top: 14px; }

.contact-card {
  background: var(--navy);
  color: var(--off-white);
  border-radius: 6px;
  padding: 36px 30px;
}
.contact-card h3 { color: var(--off-white); margin-bottom: 22px; }
.contact-row {
  display: flex;
  gap: 14px;
  padding: 16px 0;
  border-top: 1px solid rgba(255,255,255,0.08);
}
.contact-row:first-of-type { border-top: none; }
.contact-row .ico {
  width: 34px; height: 34px;
  border: 1px solid var(--orange);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  color: var(--orange);
  flex-shrink: 0;
  font-family: var(--font-mono);
  font-size: 0.75rem;
}
.contact-row strong { display: block; font-size: 0.92rem; }
.contact-row span { font-size: 0.85rem; color: var(--slate-light); }

/* ---------- Page hero (inner pages) ---------- */
.page-hero {
  background: var(--black);
  color: var(--off-white);
  padding: 64px 0 54px;
}
.page-hero h1 { color: var(--off-white); margin-bottom: 14px; }
.breadcrumb {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--slate-light);
  margin-bottom: 18px;
}
.breadcrumb span { color: var(--orange); }

/* ---------- Service detail rows ---------- */
.service-detail {
  display: grid;
  grid-template-columns: 0.9fr 1.1fr;
  gap: 50px;
  padding: 60px 0;
  border-bottom: 1px solid var(--line-light);
  align-items: start;
}
.service-detail:last-child { border-bottom: none; }
.service-detail .num {
  font-family: var(--font-mono);
  color: var(--orange-dark);
  font-size: 0.78rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin-bottom: 14px;
  display: block;
}
.service-detail ul { margin-top: 18px; }
.service-detail ul li {
  padding: 10px 0 10px 22px;
  border-top: 1px solid var(--line-light);
  position: relative;
  font-size: 0.95rem;
  color: var(--slate);
}
.service-detail ul li:first-child { border-top: none; }
.service-detail ul li::before {
  content: '';
  position: absolute;
  left: 0; top: 19px;
  width: 8px; height: 2px;
  background: var(--orange);
}

/* ---------- Values / about ---------- */
.value-list { display: grid; grid-template-columns: repeat(3, 1fr); gap: 30px; }
.value-item { padding: 26px 0; border-top: 2px solid var(--black); }
.value-item h3 { margin-bottom: 10px; }
.value-item p { color: var(--slate); font-size: 0.93rem; }

/* ---------- Timeline (about) ---------- */
.process-list { counter-reset: step; }
.process-item {
  display: flex;
  gap: 26px;
  padding: 26px 0;
  border-top: 1px solid var(--line-dark);
}
.process-item:first-child { border-top: none; }
.process-item .step-num {
  font-family: var(--font-mono);
  color: var(--orange);
  font-size: 1.4rem;
  min-width: 46px;
}
.process-item h3 { color: var(--off-white); margin-bottom: 6px; }
.process-item p { color: var(--slate-light); font-size: 0.93rem; }

/* ---------- Map / area ---------- */
.area-block { display: grid; grid-template-columns: 1fr 1fr; gap: 50px; align-items: center; }
.area-tags { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 20px; }
.area-tags span {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  padding: 8px 14px;
  border: 1px solid var(--line-light);
  border-radius: 20px;
  color: var(--slate);
}

/* ---------- Gallery / Our Work ---------- */
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  grid-auto-rows: 200px;
  gap: 10px;
}
.gallery-item {
  position: relative;
  overflow: hidden;
  border-radius: 4px;
  cursor: pointer;
  background: var(--charcoal);
}
.gallery-item.tall { grid-row: span 2; }
.gallery-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.4s ease;
}
.gallery-item:hover img { transform: scale(1.06); }
.gallery-item .cap {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  padding: 16px 16px 14px;
  background: linear-gradient(to top, rgba(11,11,11,0.88), rgba(11,11,11,0));
  color: var(--off-white);
  opacity: 0;
  transform: translateY(6px);
  transition: opacity 0.25s ease, transform 0.25s ease;
}
.gallery-item:hover .cap { opacity: 1; transform: translateY(0); }
.gallery-item .cap span {
  display: block;
  font-family: var(--font-mono);
  font-size: 0.66rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--orange);
  margin-bottom: 3px;
}
.gallery-item .cap strong { font-size: 0.92rem; font-weight: 600; }

.gallery-lightbox {
  position: fixed;
  inset: 0;
  background: rgba(11,11,11,0.94);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 40px;
}
.gallery-lightbox.open { display: flex; }
.gallery-lightbox figure {
  max-width: min(1100px, 92vw);
  max-height: 88vh;
  display: flex;
  flex-direction: column;
  align-items: center;
}
.gallery-lightbox img {
  max-width: 100%;
  max-height: 76vh;
  border-radius: 4px;
  object-fit: contain;
}
.gallery-lightbox figcaption {
  color: var(--off-white);
  margin-top: 16px;
  text-align: center;
}
.gallery-lightbox figcaption span {
  display: block;
  font-family: var(--font-mono);
  font-size: 0.68rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--orange);
  margin-bottom: 6px;
}
.lightbox-close, .lightbox-prev, .lightbox-next {
  position: absolute;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.18);
  color: var(--off-white);
  border-radius: 50%;
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 1.2rem;
  transition: background 0.15s ease, border-color 0.15s ease;
}
.lightbox-close:hover, .lightbox-prev:hover, .lightbox-next:hover {
  border-color: var(--orange);
  color: var(--orange);
}
.lightbox-close { top: 24px; right: 24px; }
.lightbox-prev { left: 24px; top: 50%; transform: translateY(-50%); }
.lightbox-next { right: 24px; top: 50%; transform: translateY(-50%); }

@media (max-width: 980px) {
  .gallery-grid { grid-template-columns: repeat(2, 1fr); grid-auto-rows: 190px; }
  .lightbox-prev, .lightbox-next { width: 38px; height: 38px; }
}
@media (max-width: 560px) {
  .gallery-grid { grid-template-columns: 1fr; grid-auto-rows: 240px; }
  .gallery-item.tall { grid-row: span 1; }
  .gallery-lightbox { padding: 20px; }
  .lightbox-prev { left: 8px; }
  .lightbox-next { right: 8px; }
  .lightbox-close { top: 12px; right: 12px; }
}

/* ---------- Utility ---------- */
.mt-0 { margin-top: 0; }
.center { text-align: center; }
.max-w { max-width: 640px; margin: 0 auto; }

/* ---------- Responsive ---------- */
@media (max-width: 980px) {
  .hero-grid { grid-template-columns: 1fr; padding-top: 60px; }
  .split, .area-block { grid-template-columns: 1fr; }
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
  .nameplate { grid-template-columns: repeat(2, 1fr); }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .value-list { grid-template-columns: 1fr; }
  .service-detail { grid-template-columns: 1fr; }
}

@media (max-width: 720px) {
  .nav-links { display: none; }
  .nav-toggle { display: block; }
  .nav-phone { display: none; }
  .grid-4, .grid-2, .nameplate { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr; }
  .form-row { grid-template-columns: 1fr; }
  section { padding: 60px 0; }
  .hero-grid { padding-bottom: 50px; }
  .nav { padding: 10px 16px; gap: 10px; }
  .brand img { height: 42px; width: 42px; }
  .brand-text strong { font-size: 0.88rem; }
  .brand-text span { font-size: 0.55rem; }
  .nav-cta .btn { padding: 11px 16px; font-size: 0.85rem; }
  .container { padding: 0 20px; }
  .nav-cta .social-links { display: none; }
}

@media (max-width: 380px) {
  .brand-text { display: none; }
}

/* Mobile nav drawer */
.nav-links.open {
  display: flex;
  flex-direction: column;
  position: absolute;
  top: 76px;
  left: 0; right: 0;
  background: var(--black);
  padding: 20px 28px 26px;
  border-bottom: 1px solid var(--line-dark);
  gap: 18px;
}
