/* Galley Electric — Heritage Craftsman, daylight rendition.
   Warm white ground, ink black, filament gold from the actual logo.
   One dark element: the panel-schedule plate, rendered as real hardware. */

:root {
  --ground: #f8f5ee;
  --ground-raised: #efeadd;
  --ink: #191610;
  --ink-soft: #57503f;
  --gold: #e3a92f;        /* filament gold: fills, rules, marks */
  --gold-deep: #8f6a10;   /* gold for text/links on light ground */
  --plate: #221f19;       /* the one dark surface */
  --plate-line: rgba(227, 169, 47, 0.35);
  --plate-text: #ece5d5;
  --plate-dim: #b3a98f;
  --rule: rgba(25, 22, 16, 0.16);
  --font-display: "Marcellus", serif;
  --font-body: "Source Sans 3", "Segoe UI", sans-serif;
}

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

html { scroll-behavior: smooth; }

body {
  background: var(--ground);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 1.0625rem;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

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

a { color: var(--gold-deep); text-decoration: none; }
a:hover { color: var(--ink); }
a:focus-visible, button:focus-visible, input:focus-visible, textarea:focus-visible {
  outline: 2px solid var(--gold-deep);
  outline-offset: 3px;
}

/* ---------- header ---------- */

.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 2rem;
  padding: 1.1rem clamp(1.25rem, 4vw, 3.5rem);
  border-bottom: 1px solid var(--rule);
  background: #fff;
}

.brand { display: flex; align-items: center; }
.brand img { height: 62px; width: auto; }

.site-nav { display: flex; gap: clamp(1rem, 2.5vw, 2.2rem); align-items: center; order: 2; margin-left: auto; }

.site-nav a {
  color: var(--ink-soft);
  font-size: 0.95rem;
  letter-spacing: 0.06em;
}
.site-nav a:hover, .site-nav a[aria-current="page"] { color: var(--ink); }

.nav-call {
  order: 3;
  margin-left: clamp(1rem, 2.5vw, 2.2rem);
  border: 1.5px solid var(--ink);
  padding: 0.55rem 1.15rem;
  color: var(--ink);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  transition: background-color 160ms ease-out, color 160ms ease-out;
}
.nav-call:hover { background: var(--ink); color: var(--gold); }

/* ---------- trust bar (sits under the nav, above the hero) ---------- */

.trust-bar {
  list-style: none;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  background: var(--rule);
  border-bottom: 1px solid var(--rule);
}
.trust-bar li { background: var(--ground-raised); }
.trust-bar a {
  display: block;
  padding: 0.6rem clamp(1.1rem, 3vw, 2.6rem);
  color: var(--ink);
  transition: background-color 160ms ease-out;
}
.trust-bar a:hover { background: #fff; }
.trust-bar strong {
  display: block;
  font-family: var(--font-display);
  font-weight: 400;
  font-size: 1.05rem;
  line-height: 1.25;
  font-variant-numeric: tabular-nums;
}
/* direct child only: the nested .tb-more spans must stay inline so the desktop
   copy reads as one sentence instead of stacking one word per line */
.trust-bar a > span {
  display: block;
  color: var(--ink-soft);
  font-size: 0.78rem;
  line-height: 1.4;
  letter-spacing: 0.05em;
}
.trust-bar a:hover span { color: var(--gold-deep); }

/* ---------- hero ---------- */

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr);
  min-height: min(88vh, 860px);
  background: var(--ground);
}

.hero-plate {
  padding: clamp(2.5rem, 6vw, 5.5rem) clamp(1.25rem, 4vw, 3.5rem);
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 2.1rem;
}

.est-line {
  color: var(--gold-deep);
  font-family: var(--font-display);
  font-size: 0.8rem;
  letter-spacing: 0.34em;
  text-transform: uppercase;
}

.hero h1 {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(2.5rem, 5.2vw, 4.3rem);
  line-height: 1.06;
  text-wrap: balance;
  max-width: 14ch;
}

.hero h1 .lit {
  display: inline-block;
  position: relative;
}
.hero h1 .lit::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 0.04em;
  height: 0.14em;
  width: 100%;
  background: var(--gold);
  z-index: -1;
  transform-origin: left;
  animation: energize 900ms 300ms cubic-bezier(0.19, 1, 0.22, 1) both;
}
@keyframes energize {
  from { transform: scaleX(0); }
  to { transform: scaleX(1); }
}

.hero-sub { color: var(--ink-soft); max-width: 46ch; font-size: 1.125rem; }

.hero-actions { display: flex; flex-wrap: wrap; gap: 1.1rem; align-items: center; }

.btn-call {
  display: inline-flex;
  align-items: baseline;
  gap: 0.6rem;
  background: var(--ink);
  color: var(--gold);
  font-family: var(--font-display);
  font-size: 1.15rem;
  letter-spacing: 0.04em;
  padding: 0.95rem 1.6rem;
  font-variant-numeric: tabular-nums;
  box-shadow: 0 10px 24px -12px rgba(25, 22, 16, 0.5);
  transition: background-color 160ms ease-out, color 160ms ease-out;
}
.btn-call:hover { background: var(--gold); color: var(--ink); }
.btn-call span { font-family: var(--font-body); font-size: 0.8rem; letter-spacing: 0.18em; text-transform: uppercase; }

.btn-quiet {
  color: var(--ink-soft);
  border-bottom: 1.5px solid var(--gold);
  padding-bottom: 0.2rem;
  letter-spacing: 0.05em;
}
.btn-quiet:hover { color: var(--ink); }

.hero-meta {
  display: flex;
  gap: 2.5rem;
  color: var(--ink-soft);
  font-size: 0.9rem;
  border-top: 1px solid var(--rule);
  padding-top: 1.4rem;
}
.hero-meta strong { color: var(--ink); display: block; font-weight: 600; }

.hero-photo { position: relative; overflow: hidden; }
.hero-photo img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 30% center;
}
/* ---------- section scaffolding ---------- */

section { padding: clamp(3.5rem, 8vw, 6.5rem) clamp(1.25rem, 4vw, 3.5rem); }

.section-head { margin-bottom: 3rem; max-width: 68ch; }
.section-head h2 {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(1.8rem, 3.2vw, 2.6rem);
  line-height: 1.15;
  margin-bottom: 0.9rem;
  text-wrap: balance;
}
.section-head p { color: var(--ink-soft); max-width: 52ch; }

.gold-rule { width: 64px; height: 3px; background: var(--gold); border: none; margin-bottom: 1.6rem; }

/* ---------- label-maker tape: the section marking system ---------- */

.tape-label {
  display: inline-block;
  background: #1c1a15;
  color: #f8f5ee;
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 0.82rem;
  letter-spacing: 0.32em;
  text-transform: uppercase;
  padding: 0.5em 1.1em 0.5em 1.35em;
  margin-bottom: 1.4rem;
  transform: rotate(-1.4deg);
  border-radius: 2px;
  box-shadow: 0 3px 8px -3px rgba(25, 22, 16, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.14);
  text-shadow: 0 1px 0 rgba(0, 0, 0, 0.7), 0 -1px 0 rgba(255, 255, 255, 0.18);
}

/* ---------- the hero light switch ---------- */

.switch-station {
  display: flex;
  align-items: center;
  gap: 1.1rem;
  min-height: 3.5rem;
  flex-wrap: wrap;
}

.light-switch {
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
}

.switch-plate {
  display: block;
  width: 46px;
  height: 72px;
  background: linear-gradient(160deg, #ffffff, #ebe6d9);
  border: 1px solid var(--rule);
  border-radius: 5px;
  box-shadow: 0 4px 12px -4px rgba(25, 22, 16, 0.35), inset 0 1px 0 #fff;
  position: relative;
}
.switch-plate::before, .switch-plate::after {
  content: "";
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: #cfc8b8;
  box-shadow: inset 0 1px 1px rgba(25, 22, 16, 0.4);
}
.switch-plate::before { top: 6px; }
.switch-plate::after { bottom: 6px; }

.switch-rocker {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: 16px;
  height: 34px;
  background: linear-gradient(180deg, #fdfcf8 0%, #d8d2c2 45%, #f2eee3 100%);
  border: 1px solid #b8b1a0;
  border-radius: 3px;
  transition: background 200ms ease-out;
}
.light-switch[aria-pressed="false"] .switch-rocker {
  background: linear-gradient(0deg, #fdfcf8 0%, #d8d2c2 45%, #f2eee3 100%);
}

.switch-hint {
  color: var(--ink-soft);
  font-size: 0.88rem;
  font-style: italic;
}

.blackout-msg { display: none; font-size: 0.95rem; }
.blackout-msg a { color: var(--gold); border-bottom: 1px solid var(--gold); }

/* blackout state: hero only, page below stays lit */
.hero, .hero-plate, .hero-photo img { transition: background-color 450ms ease-out, filter 450ms ease-out, color 450ms ease-out; }
.hero.blackout { background: #16130e; }
.hero.blackout .hero-plate { background: #16130e; }
.hero.blackout h1, .hero.blackout .hero-meta strong { color: #f8f5ee; }
.hero.blackout .hero-sub, .hero.blackout .hero-meta, .hero.blackout .btn-quiet, .hero.blackout .switch-hint { color: #9a9077; }
.hero.blackout .est-line { color: var(--gold); }
.hero.blackout .hero-photo img { filter: brightness(0.25) saturate(0.6); }
.hero.blackout .hero-meta { border-top-color: rgba(248, 245, 238, 0.15); }
.hero.blackout .btn-call {
  background: var(--gold);
  color: var(--ink);
  box-shadow: 0 0 34px rgba(227, 169, 47, 0.55);
}
.hero.blackout .switch-hint { display: none; }
.hero.blackout .blackout-msg { display: block; color: #d9d0ba; }

/* ---------- breaker toggles on circuit rows ---------- */

.breaker {
  width: 40px;
  height: 20px;
  border: 2px solid var(--plate-dim);
  border-radius: 11px;
  display: inline-flex;
  align-items: center;
  padding: 2px;
  transition: border-color 180ms ease-out;
}
.breaker-nub {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--plate-dim);
  transition: transform 180ms cubic-bezier(0.19, 1, 0.22, 1), background-color 180ms ease-out;
}
.circuit:hover .breaker { border-color: var(--gold); }
.circuit:hover .breaker-nub { transform: translateX(20px); background: var(--gold); box-shadow: 0 0 8px rgba(227, 169, 47, 0.8); }

.circuit-spare { cursor: default; }
.circuit-spare .circuit-name, .circuit-spare .circuit-no { color: var(--plate-dim); }
.circuit-spare .circuit-desc a { color: var(--gold); border-bottom: 1px solid var(--plate-line); }
.circuit-spare .circuit-desc a:hover { color: var(--plate-text); }
.circuit-spare:hover { background: none; }
.circuit-spare:hover .breaker { border-color: var(--plate-dim); }
.circuit-spare:hover .breaker-nub { transform: none; background: var(--plate-dim); box-shadow: none; }

/* ---------- panel directory: the one dark element ---------- */

.panel-directory { background: var(--ground-raised); border-block: 1px solid var(--rule); }

.directory-plate {
  border: 1px solid #3a352b;
  background: linear-gradient(175deg, #2a2620, var(--plate) 40%);
  color: var(--plate-text);
  box-shadow: 0 24px 48px -20px rgba(25, 22, 16, 0.5), inset 0 1px 0 rgba(236, 229, 213, 0.08);
}

.directory-title {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 1rem;
  padding: 1.1rem 1.6rem;
  border-bottom: 1px solid var(--plate-line);
  font-family: var(--font-display);
  letter-spacing: 0.22em;
  font-size: 0.85rem;
  text-transform: uppercase;
  color: var(--gold);
}
.directory-title span { color: var(--plate-dim); font-family: var(--font-body); letter-spacing: 0.12em; font-size: 0.72rem; }

.circuit {
  display: grid;
  grid-template-columns: 4.5rem minmax(0, 13rem) minmax(0, 1fr) auto;
  align-items: center;
  gap: 1.5rem;
  padding: 1.35rem 1.6rem;
  border-bottom: 1px solid rgba(236, 229, 213, 0.12);
  color: var(--plate-text);
  transition: background-color 160ms ease-out;
}
.circuit:last-child { border-bottom: none; }
.circuit:hover { background: rgba(227, 169, 47, 0.09); color: var(--plate-text); }

.circuit-no {
  font-family: var(--font-display);
  color: var(--gold);
  font-size: 1.05rem;
  letter-spacing: 0.1em;
  font-variant-numeric: tabular-nums;
}

.circuit-name { font-family: var(--font-display); font-size: 1.3rem; letter-spacing: 0.03em; }

.circuit-desc { color: var(--plate-dim); font-size: 0.98rem; max-width: 52ch; }


/* ---------- historical feature ---------- */

.historical {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: clamp(2rem, 5vw, 4.5rem);
  align-items: center;
}

.historical-copy h2 {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(1.9rem, 3.4vw, 2.7rem);
  line-height: 1.12;
  margin-bottom: 1.2rem;
  text-wrap: balance;
}
.historical-copy > p { color: var(--ink-soft); max-width: 52ch; margin-bottom: 1.1rem; }

.historical-list { list-style: none; margin: 1.6rem 0 2rem; }
.historical-list li {
  padding: 0.7rem 0;
  border-bottom: 1px solid var(--rule);
  display: flex;
  gap: 0.9rem;
  align-items: baseline;
}
.historical-list li::before { content: "—"; color: var(--gold-deep); }

/* survey plate: the panel device, reused as an old-house findings tag */
.survey-plate {
  border: 1px solid #3a352b;
  background: linear-gradient(175deg, #2a2620, var(--plate) 40%);
  color: var(--plate-text);
  box-shadow: 0 24px 48px -20px rgba(25, 22, 16, 0.5), inset 0 1px 0 rgba(236, 229, 213, 0.08);
}
.survey-rows > div {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 1.5rem;
  padding: 1rem 1.6rem;
  border-bottom: 1px solid rgba(236, 229, 213, 0.12);
}
.survey-rows dt {
  color: var(--plate-dim);
  font-size: 0.78rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  flex-shrink: 0;
}
.survey-rows dd { font-family: var(--font-display); font-size: 1.05rem; text-align: right; }
.survey-after { background: rgba(227, 169, 47, 0.1); }
.survey-after dt { color: var(--gold); }
.survey-after dd { color: var(--gold); }
.survey-note { padding: 1.1rem 1.6rem; color: var(--plate-dim); font-size: 0.85rem; }

.plate-caption { margin-top: 0.8rem; color: var(--ink-soft); font-size: 0.85rem; letter-spacing: 0.06em; }
.plate-caption em { color: var(--gold-deep); font-style: normal; }

/* ---------- proof / jobs ---------- */

.proof { background: #fff; border-block: 1px solid var(--rule); }

.jobs {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: clamp(1.5rem, 4vw, 3rem);
  margin-bottom: 4rem;
}
.job img {
  border: 1px solid var(--rule);
  aspect-ratio: 16 / 10;
  object-fit: cover;
  width: 100%;
  box-shadow: 0 18px 40px -22px rgba(25, 22, 16, 0.4);
}

.testimonial { max-width: 56ch; margin: 0 auto; text-align: center; }
.testimonial blockquote {
  font-family: var(--font-display);
  font-size: clamp(1.3rem, 2.4vw, 1.75rem);
  line-height: 1.45;
  text-wrap: balance;
}
.testimonial blockquote::before { content: "“"; color: var(--gold); }
.testimonial blockquote::after { content: "”"; color: var(--gold); }
.testimonial cite {
  display: block;
  margin-top: 1.3rem;
  font-style: normal;
  color: var(--gold-deep);
  letter-spacing: 0.2em;
  text-transform: uppercase;
  font-size: 0.8rem;
}

/* set beside the ratings plate rather than centred under a section head */
.testimonial-left { margin: 0; text-align: left; max-width: none; }
.testimonial-left blockquote { font-size: clamp(1.15rem, 1.9vw, 1.4rem); }

/* ---------- service area ---------- */

.service-area .cities {
  display: flex;
  flex-wrap: wrap;
  gap: 0.8rem 0;
  list-style: none;
  border-top: 1px solid var(--rule);
}
.cities li { border-bottom: 1px solid var(--rule); flex: 1 1 33%; min-width: 220px; }
.cities .city {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding: 1.1rem 1rem 1.1rem 0;
  color: var(--ink);
  font-family: var(--font-display);
  font-size: 1.15rem;
  letter-spacing: 0.03em;
}
.cities .city small { color: var(--ink-soft); font-family: var(--font-body); font-size: 0.8rem; letter-spacing: 0.14em; text-transform: uppercase; margin-right: 1.5rem; }

.area-note { margin-top: 1.6rem; color: var(--ink-soft); }

/* ---------- contact close ---------- */

.contact-close {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: clamp(2rem, 5vw, 4.5rem);
  background: var(--ground-raised);
  border-top: 1px solid var(--rule);
}

.contact-info h2 {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(1.9rem, 3.4vw, 2.7rem);
  line-height: 1.12;
  margin-bottom: 1.2rem;
  text-wrap: balance;
}
.contact-info > p { color: var(--ink-soft); max-width: 46ch; margin-bottom: 2rem; }

.contact-lines { list-style: none; }
.contact-lines li {
  display: flex;
  gap: 1.2rem;
  padding: 0.85rem 0;
  border-bottom: 1px solid var(--rule);
  align-items: baseline;
}
.contact-lines .label {
  flex: 0 0 6.5rem;
  color: var(--gold-deep);
  font-size: 0.78rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
}
.contact-lines a { color: var(--ink); font-variant-numeric: tabular-nums; }
.contact-lines a:hover { color: var(--gold-deep); }

.quote-form {
  background: #fff;
  border: 1px solid var(--rule);
  padding: clamp(1.5rem, 3vw, 2.5rem);
  box-shadow: 0 24px 48px -24px rgba(25, 22, 16, 0.35);
}
.quote-form h3 { font-family: var(--font-display); font-weight: 400; font-size: 1.4rem; margin-bottom: 0.4rem; }
.quote-form > p { color: var(--ink-soft); font-size: 0.95rem; margin-bottom: 1.6rem; }

.field { margin-bottom: 1.2rem; }
.field label {
  display: block;
  font-size: 0.78rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ink-soft);
  margin-bottom: 0.45rem;
}
.field input, .field textarea {
  width: 100%;
  background: var(--ground);
  border: 1px solid var(--rule);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 1rem;
  padding: 0.75rem 0.9rem;
  transition: border-color 160ms ease-out;
}
.field input::placeholder, .field textarea::placeholder { color: #6e6553; }
.field input:focus, .field textarea:focus { border-color: var(--gold-deep); }
.field textarea { min-height: 110px; resize: vertical; }

.form-submit {
  width: 100%;
  background: var(--ink);
  border: none;
  color: var(--gold);
  font-family: var(--font-display);
  font-size: 1.1rem;
  letter-spacing: 0.06em;
  padding: 0.95rem;
  cursor: pointer;
  transition: background-color 160ms ease-out, color 160ms ease-out;
}
.form-submit:hover { background: var(--gold); color: var(--ink); }
.form-note { margin-top: 0.9rem; font-size: 0.85rem; color: var(--ink-soft); text-align: center; }
.form-confirm { color: var(--gold-deep); text-align: center; padding: 2rem 0; font-family: var(--font-display); font-size: 1.2rem; display: none; }

/* ---------- interior pages ---------- */

.page-hero {
  background: var(--ground-raised);
  border-bottom: 1px solid var(--rule);
  padding: clamp(2.8rem, 6vw, 4.8rem) clamp(1.25rem, 4vw, 3.5rem);
}
.page-hero h1 {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(2.1rem, 4.6vw, 3.4rem);
  line-height: 1.08;
  text-wrap: balance;
  max-width: 18ch;
  margin-bottom: 1.1rem;
}
.page-hero p { color: var(--ink-soft); max-width: 54ch; font-size: 1.1rem; }
.page-hero .hero-actions { margin-top: 2rem; }

.crumbs { font-size: 0.85rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--ink-soft); margin-bottom: 1.4rem; }
.crumbs a { color: var(--ink-soft); }
.crumbs a:hover { color: var(--gold-deep); }

.page-photo img {
  width: 100%;
  max-height: 460px;
  object-fit: cover;
  border: 1px solid var(--rule);
  box-shadow: 0 20px 44px -24px rgba(25, 22, 16, 0.45);
}

.two-col {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: clamp(2rem, 5vw, 4.5rem);
  align-items: start;
}
/* h2 and h3 share one appearance: the level is chosen by the section's outline
   (h2 when the section has no section-head, h3 when it sits under one), not by size */
.prose h2, .prose h3 {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: 1.5rem;
  margin: 2rem 0 0.7rem;
}
.prose h2:first-child, .prose h3:first-child { margin-top: 0; }
.prose p { color: var(--ink-soft); max-width: 60ch; margin-bottom: 1rem; }

.checklist { list-style: none; }
.checklist li {
  padding: 0.85rem 0;
  border-bottom: 1px solid var(--rule);
  display: flex;
  gap: 0.9rem;
  align-items: baseline;
}
.checklist li::before { content: "—"; color: var(--gold-deep); }
.check-body { display: block; }
.checklist strong { display: block; font-weight: 600; }
.checklist span { display: block; color: var(--ink-soft); font-size: 0.95rem; font-weight: 400; }

.cta-band {
  background: var(--plate);
  color: var(--plate-text);
  text-align: center;
  padding: clamp(3rem, 7vw, 4.5rem) clamp(1.25rem, 4vw, 3.5rem);
}
.cta-band h2 {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(1.7rem, 3.4vw, 2.4rem);
  margin-bottom: 0.9rem;
  text-wrap: balance;
}
.cta-band p { color: var(--plate-dim); max-width: 50ch; margin: 0 auto 2rem; }
.cta-band .btn-call { background: var(--gold); color: var(--ink); }
.cta-band .btn-call:hover { background: var(--plate-text); }

.related {
  display: flex;
  flex-wrap: wrap;
  gap: 0.9rem;
  list-style: none;
  margin-top: 1rem;
}
.related a {
  display: inline-block;
  border: 1px solid var(--rule);
  background: #fff;
  padding: 0.7rem 1.1rem;
  color: var(--ink);
  font-family: var(--font-display);
  transition: border-color 160ms ease-out, background-color 160ms ease-out;
}
.related a:hover { border-color: var(--gold); background: var(--ground); }

/* ---------- footer ---------- */

.site-footer {
  background: var(--plate);
  color: var(--plate-dim);
  padding: 2.2rem clamp(1.25rem, 4vw, 3.5rem) 5.5rem;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 1.5rem;
  font-size: 0.9rem;
}
.site-footer a { color: var(--plate-dim); }
.site-footer a:hover { color: var(--gold); }

/* ---------- sticky mobile call bar ---------- */

.call-bar {
  display: none;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 50;
  background: var(--ink);
  color: var(--gold);
  text-align: center;
  padding: 0.95rem;
  font-family: var(--font-display);
  font-size: 1.1rem;
  letter-spacing: 0.05em;
  box-shadow: 0 -6px 24px rgba(25, 22, 16, 0.35);
}
.call-bar:hover { color: var(--gold); }

/* ---------- responsive ---------- */

@media (max-width: 900px) {
  body { font-size: 1rem; }

  /* header: brand + call on row one, real nav on row two */
  .site-header { flex-wrap: wrap; padding: 0.85rem 1.1rem 0; row-gap: 0; gap: 0.75rem; }
  .brand img { height: 46px; }
  .brand { margin-right: auto; }
  .nav-call { padding: 0.65rem 1rem; order: 1; margin-left: 0; }
  /* five items will not fit one row on any phone under 430px, and a scroll strip
     hid Contact with no affordance. Wrapping keeps every item visible and tappable. */
  .site-nav {
    order: 2;
    margin-left: 0;
    flex: 1 0 100%;
    flex-wrap: wrap;
    justify-content: center;
    column-gap: 1.15rem;
    row-gap: 0;
    margin: 0 -1.1rem;
    padding: 0 1.1rem;
    border-top: 1px solid var(--rule);
  }
  /* 0.7rem block padding keeps each wrapped nav link a 46px touch target */
  .site-nav a:not(.nav-call) {
    padding: 0.7rem 0;
    font-size: 0.88rem;
    white-space: nowrap;
    border-bottom: 2px solid transparent;
  }
  .site-nav a[aria-current="page"] { border-bottom-color: var(--gold); }

  .hero { grid-template-columns: 1fr; min-height: 0; }
  .hero-photo { min-height: 260px; order: -1; }
  .hero-plate { gap: 1.6rem; padding-block: 2.2rem 2.6rem; }
  .hero h1 { font-size: clamp(2.2rem, 9vw, 2.9rem); max-width: none; }
  .hero-sub { font-size: 1.05rem; }

  .hero-actions { flex-direction: column; align-items: stretch; gap: 1.2rem; }
  .btn-call { justify-content: center; padding: 1.05rem 1.4rem; }
  .btn-quiet { align-self: center; }

  .hero-meta { flex-wrap: wrap; gap: 1rem 1.8rem; font-size: 0.85rem; }

  /* the approved light switch moves above the meta strip so it lands in reach */
  .switch-station { order: 1; margin-top: 0.4rem; flex-wrap: wrap; }
  .hero-meta { order: 2; }

  section { padding: 3rem 1.1rem; }
  .section-head { margin-bottom: 2rem; }
  .tape-label { font-size: 0.74rem; letter-spacing: 0.22em; }

  .directory-title { flex-wrap: wrap; gap: 0.3rem 1rem; padding: 1rem 1.1rem; }
  .circuit { grid-template-columns: 3.4rem 1fr auto; gap: 0.4rem 0.9rem; padding: 1.1rem; }
  .circuit-no { font-size: 0.92rem; }
  .circuit-name { font-size: 1.15rem; }
  .circuit-desc { grid-column: 1 / 4; font-size: 0.92rem; }
  .breaker { width: 34px; height: 18px; }
  .circuit:hover .breaker-nub { transform: translateX(14px); }

  .historical, .contact-close, .jobs { grid-template-columns: 1fr; }
  .jobs { margin-bottom: 2.8rem; }
  /* cells wrap to different line counts on narrow screens: centre them so the
     row reads as one bar instead of three misaligned blocks */
  .trust-bar li { display: flex; }
  .trust-bar a {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 0.55rem 0.7rem;
    text-align: center;
  }
  .trust-bar strong { font-size: 0.92rem; }
  .trust-bar a > span { font-size: 0.68rem; letter-spacing: 0.03em; line-height: 1.3; }
  /* touch: inline text links inside body copy get a real tap area */
  .btn-quiet { padding-block: 0.6rem 0.5rem; }
  .contact-lines a, .area-note a, .circuit-spare .circuit-desc a,
  .crumbs a, .survey-note a, .prose a { padding-block: 0.5rem; }
  .site-footer a { display: inline-block; padding-block: 0.55rem; }
  .site-footer span { line-height: 1.4; }

  .two-col { grid-template-columns: 1fr; }
  .page-hero h1 { max-width: none; }
  .page-photo img { max-height: 260px; }
  .cities li { flex: 1 1 100%; min-width: 0; }
  .cities .city { padding-block: 0.95rem; }

  .quote-form { padding: 1.4rem 1.2rem; }
  .field input, .field textarea { font-size: 16px; } /* prevents iOS zoom-on-focus */

  .site-footer {
    flex-direction: column;
    gap: 0.7rem;
    text-align: center;
    padding-bottom: calc(6.2rem + env(safe-area-inset-bottom));
  }
  /* clears the iPhone home indicator instead of sitting under it */
  .call-bar {
    display: block;
    padding: 1.05rem 1.05rem calc(1.05rem + env(safe-area-inset-bottom));
  }
}

/* phones: the first viewport has to earn the call, so header, trust bar, and
   hero photo all give up height to lift the call button up the page */
@media (max-width: 700px) {
  /* long-form trust copy is written for desktop; below this width each cell is
     ~113px and the full strings wrapped to four ragged lines.
     Needs .trust-bar to outrank the `.trust-bar span { display: block }` above. */
  .trust-bar .tb-more { display: none; }

  .site-header { padding-top: 0.7rem; }
  .brand img { height: 40px; }

  .trust-bar a { padding: 0.5rem 0.35rem; }
  .trust-bar strong { font-size: 0.88rem; }
  .trust-bar a > span { font-size: 0.66rem; }

  .hero-photo { min-height: 150px; }
  .hero-plate { padding-block: 1.8rem 2.2rem; gap: 1.35rem; }

  /* three facts read as a tidy block instead of a 184px ragged stack */
  .hero-meta {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.9rem 1.2rem;
    padding-top: 1.2rem;
  }
  .hero-meta div:first-child { grid-column: 1 / -1; }
}

/* small phones */
@media (max-width: 380px) {
  .hero-photo { min-height: 140px; }
  .directory-title span { display: none; }
  .hero-meta { gap: 0.8rem 1.1rem; }
  .site-nav { column-gap: 0.85rem; }
  .site-nav a:not(.nav-call) { font-size: 0.82rem; }

  /* a 6.5rem label beside a 193px email is 316px of min-content and forced the
     whole contact grid wider than a 320px screen: stack the pair instead */
  .contact-lines li { flex-direction: column; align-items: flex-start; gap: 0.1rem; }
  .contact-lines .label { flex: none; }
}

/* touch devices: breakers flip on tap-highlight instead of hover */
@media (hover: none) {
  .circuit:active .breaker { border-color: var(--gold); }
  .circuit:active .breaker-nub { transform: translateX(14px); background: var(--gold); }
}

@media (prefers-reduced-motion: reduce) {
  .hero h1 .lit::after { animation: none; }
  html { scroll-behavior: auto; }
}
