/* Iowa Electrical Services — styles.css
   Palette: ink navy, copper (the wire), cool paper. Type: Archivo (variable width). */

:root {
  --ink: #15202e;
  --ink-2: #24344a;
  --copper: #a9561f;        /* text/buttons on light: passes WCAG AA */
  --copper-bright: #e08a4c; /* accents on dark */
  --paper: #f3f5f7;
  --white: #ffffff;
  --line: #d5dbe1;
  --muted: #566272;
  --ok: #2f6b3a;
  --err: #a12a2a;

  --font: "Archivo", "Helvetica Neue", Arial, system-ui, sans-serif;
  --measure: 68ch;
  --radius-s: 4px;
  --radius-m: 10px;
  --wrap: 1180px;
  --pad: clamp(1.25rem, 4vw, 2.5rem);
  --header-h: 72px;
}

*, *::before, *::after { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  scroll-padding-top: calc(var(--header-h) + 1rem);
}

body {
  margin: 0;
  font-family: var(--font);
  font-size: 1.0625rem;
  line-height: 1.6;
  color: var(--ink);
  background: var(--white);
  font-variation-settings: "wdth" 100;
  text-rendering: optimizeLegibility;
}

img, svg { max-width: 100%; height: auto; display: block; }

a { color: var(--copper); text-underline-offset: 0.18em; }
a:hover { color: var(--ink); }

:focus-visible {
  outline: 3px solid var(--copper-bright);
  outline-offset: 3px;
  border-radius: 2px;
}

h1, h2, h3 {
  line-height: 1.05;
  margin: 0 0 0.6em;
  font-weight: 800;
  font-variation-settings: "wdth" 72;
  letter-spacing: -0.01em;
}
h1 { font-size: clamp(2.6rem, 7vw, 5.2rem); }
h2 { font-size: clamp(2rem, 4.4vw, 3.2rem); }
h3 { font-size: 1.45rem; font-variation-settings: "wdth" 85; font-weight: 700; line-height: 1.2; }
p { margin: 0 0 1em; max-width: var(--measure); }

.wrap { width: min(100% - 2 * var(--pad), var(--wrap)); margin-inline: auto; }

.skip-link {
  position: absolute; left: 1rem; top: -100px; z-index: 100;
  background: var(--ink); color: var(--white); padding: .75rem 1rem; border-radius: var(--radius-s);
}
.skip-link:focus { top: 1rem; }

.visually-hidden {
  position: absolute !important; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap;
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .55rem;
  min-height: 48px; padding: .75rem 1.35rem;
  border-radius: var(--radius-s); border: 2px solid transparent;
  font: inherit; font-weight: 700; font-variation-settings: "wdth" 90;
  text-decoration: none; cursor: pointer; line-height: 1.1;
}
.btn svg { width: 1.15em; height: 1.15em; flex: none; }
.btn-copper { background: var(--copper); color: var(--white); }
.btn-copper:hover { background: #8e4618; color: var(--white); }
.btn-outline { border-color: currentColor; color: var(--ink); background: transparent; }
.btn-outline:hover { background: var(--ink); color: var(--white); border-color: var(--ink); }
.on-dark .btn-outline { color: var(--white); }
.on-dark .btn-outline:hover { background: var(--white); color: var(--ink); border-color: var(--white); }

/* ---------- Header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(255, 255, 255, 0.97);
  border-bottom: 1px solid var(--line);
}
.header-inner {
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  min-height: var(--header-h);
}
.brand { display: flex; align-items: center; gap: .75rem; text-decoration: none; color: var(--ink); }
.brand img { width: 52px; height: 52px; border-radius: 50%; object-fit: cover; }
.brand-name {
  font-weight: 800; font-size: 1.15rem; line-height: 1;
  font-variation-settings: "wdth" 75;
}
.brand-name small { display: block; font-weight: 500; font-size: .8rem; color: var(--muted); margin-top: .25rem; font-variation-settings: "wdth" 100; }

.nav-toggle {
  display: none; background: none; border: 2px solid var(--ink); border-radius: var(--radius-s);
  min-height: 44px; padding: 0 .9rem; font: inherit; font-weight: 700; color: var(--ink); cursor: pointer;
}
.site-nav ul { list-style: none; margin: 0; padding: 0; display: flex; align-items: center; gap: .25rem; }
.site-nav a {
  display: block; padding: .6rem .8rem; text-decoration: none; color: var(--ink); font-weight: 600;
  border-radius: var(--radius-s);
}
.site-nav a:hover { background: var(--paper); }
.site-nav a[aria-current="page"] { box-shadow: inset 0 -3px 0 var(--copper); border-radius: 0; }
.site-nav .nav-call { margin-left: .5rem; }
.site-nav .nav-call a { background: var(--ink); color: var(--white); border-radius: var(--radius-s); }
.site-nav .nav-call a:hover { background: var(--copper); }

@media (max-width: 900px) {
  .nav-toggle { display: inline-flex; align-items: center; }
  .site-nav {
    position: absolute; left: 0; right: 0; top: 100%;
    background: var(--white); border-bottom: 1px solid var(--line);
    display: none;
  }
  .site-nav.is-open { display: block; }
  .site-nav ul { flex-direction: column; align-items: stretch; padding: .5rem var(--pad) 1rem; gap: 0; }
  .site-nav a { padding: .9rem .25rem; border-bottom: 1px solid var(--line); border-radius: 0; }
  .site-nav .nav-call { margin: .75rem 0 0; }
  .site-nav .nav-call a { text-align: center; padding: .9rem; border-radius: var(--radius-s); }
  .js .site-nav:not(.is-open) { display: none; }
  .no-js .site-nav { position: static; display: block; }
}

/* ---------- Hero ---------- */
.hero {
  position: relative; overflow: hidden;
  background: var(--ink); color: var(--white);
  padding: clamp(3.5rem, 9vw, 7rem) 0 clamp(4rem, 10vw, 8rem);
}
.hero-grid { position: relative; z-index: 1; display: grid; grid-template-columns: minmax(0, 1fr); }
.hero h1 { max-width: 14ch; margin-bottom: .35em; }
.hero-lede { font-size: clamp(1.1rem, 2vw, 1.3rem); color: #d9e0e8; max-width: 46ch; }
.hero-actions { display: flex; flex-wrap: wrap; gap: .75rem; margin-top: 1.75rem; }
.hero-facts {
  display: flex; flex-wrap: wrap; gap: .5rem 1.75rem; margin: 2.5rem 0 0; padding: 0; list-style: none;
  color: #c3ccd7; font-weight: 600;
}
.hero-facts li { display: flex; align-items: center; gap: .5rem; }
.hero-facts svg { width: 1.1rem; height: 1.1rem; color: var(--copper-bright); }

/* The wire: one copper conductor drawn once on load */
.hero-wire {
  position: absolute; inset: 0; z-index: 0; pointer-events: none;
  width: 100%; height: 100%;
}
.hero-wire .conductor {
  fill: none; stroke: var(--copper-bright); stroke-width: 5; stroke-linecap: round; stroke-linejoin: round;
  stroke-dasharray: 2600; stroke-dashoffset: 2600;
  animation: draw 2.2s 0.25s cubic-bezier(.6, .1, .2, 1) forwards;
}
.hero-wire .conduit { fill: none; stroke: #2c3e55; stroke-width: 22; stroke-linecap: round; stroke-linejoin: round; }
.hero-wire .terminal { fill: var(--copper-bright); opacity: 0; animation: glow .4s 2.3s forwards; }
@keyframes draw { to { stroke-dashoffset: 0; } }
@keyframes glow { to { opacity: 1; } }
@media (max-width: 700px) { .hero-wire { display: none; } }

/* Page hero (interior pages) */
.page-hero { background: var(--ink); color: var(--white); padding: clamp(2.5rem, 6vw, 4.5rem) 0; position: relative; overflow: hidden; }
.page-hero h1 { font-size: clamp(2.4rem, 6vw, 4.2rem); max-width: 18ch; }
.page-hero p { color: #d9e0e8; font-size: 1.15rem; }
.page-hero::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 5px;
  background: var(--copper-bright);
}

/* ---------- Sections ---------- */
.section { padding: clamp(3.5rem, 8vw, 6rem) 0; }
.section-paper { background: var(--paper); }
.section-head { margin-bottom: 2.5rem; }
.section-head p { color: var(--muted); font-size: 1.15rem; }

/* Wire-and-terminal marker before section headings */
.wire-mark { display: flex; align-items: center; gap: 0; margin-bottom: 1rem; }
.wire-mark::before { content: ""; width: 56px; height: 4px; background: var(--copper); border-radius: 2px; }
.wire-mark::after { content: ""; width: 12px; height: 12px; border: 3px solid var(--copper); border-radius: 50%; margin-left: -2px; }
.on-dark .wire-mark::before { background: var(--copper-bright); }
.on-dark .wire-mark::after { border-color: var(--copper-bright); }

/* ---------- Panel directory (services on home) ---------- */
.panel {
  background: #e4e8ec; border: 2px solid #b9c2cc; border-radius: var(--radius-m);
  padding: clamp(.75rem, 2vw, 1.25rem);
  display: grid; grid-template-columns: 1fr 1fr; gap: 0;
}
.panel-slot {
  display: grid; grid-template-columns: auto 1fr; gap: 1rem; align-items: start;
  background: var(--white); padding: 1.15rem 1.25rem; border: 1px solid #c9d0d8;
  text-decoration: none; color: var(--ink);
}
.panel-slot:hover { background: #fffaf5; }
.panel-slot:hover .breaker::after { transform: translateX(14px); background: var(--copper); }
.panel-slot h3 { margin: 0 0 .2rem; font-size: 1.2rem; }
.panel-slot p { margin: 0; color: var(--muted); font-size: .98rem; }
.breaker {
  position: relative; width: 34px; height: 18px; margin-top: .3rem;
  border: 2px solid var(--ink-2); border-radius: 3px; background: var(--paper);
}
.breaker::after {
  content: ""; position: absolute; top: 2px; left: 2px; width: 12px; height: 10px;
  background: var(--ink-2); border-radius: 1px; transition: transform .2s ease, background .2s ease;
}
.panel-foot { grid-column: 1 / -1; display: flex; justify-content: flex-end; padding-top: 1rem; }
@media (max-width: 720px) { .panel { grid-template-columns: 1fr; } }

/* ---------- Split / about ---------- */
.split { display: grid; grid-template-columns: 1.1fr .9fr; gap: clamp(2rem, 6vw, 5rem); align-items: start; }
@media (max-width: 860px) { .split { grid-template-columns: 1fr; } }

.checklist { list-style: none; margin: 0; padding: 0; }
.checklist li {
  position: relative; padding: .9rem 0 .9rem 2.25rem; border-top: 1px solid var(--line);
}
.checklist li:last-child { border-bottom: 1px solid var(--line); }
.checklist li::before {
  content: ""; position: absolute; left: 0; top: 1.2rem; width: 1.1rem; height: .55rem;
  border-left: 3px solid var(--copper); border-bottom: 3px solid var(--copper); transform: rotate(-45deg);
}
.checklist strong { display: block; }

.callout {
  background: var(--ink); color: var(--white); border-radius: var(--radius-m);
  padding: clamp(1.5rem, 4vw, 2.5rem);
}
.callout h3 { color: var(--white); }
.callout p { color: #d9e0e8; }

/* Steps (a real sequence) */
.steps { list-style: none; counter-reset: step; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 2rem; }
.steps li { counter-increment: step; position: relative; padding-top: 3.5rem; }
.steps li::before {
  content: counter(step); position: absolute; top: 0; left: 0;
  width: 2.5rem; height: 2.5rem; display: grid; place-items: center;
  border: 3px solid var(--copper); border-radius: 50%; font-weight: 800; color: var(--copper);
}
.steps li:not(:last-child)::after {
  content: ""; position: absolute; top: 1.2rem; left: 3rem; right: -1.5rem; height: 3px; background: var(--copper);
}
@media (max-width: 760px) {
  .steps { grid-template-columns: 1fr; }
  .steps li:not(:last-child)::after { display: none; }
}

/* ---------- Service detail (services page) ---------- */
.service-detail {
  display: grid; grid-template-columns: 16rem 1fr; gap: 2rem;
  padding: 2.25rem 0; border-top: 1px solid var(--line);
}
.service-detail:last-of-type { border-bottom: 1px solid var(--line); }
.service-detail h2 { font-size: clamp(1.6rem, 3vw, 2.1rem); }
.service-detail ul { margin: 0; padding-left: 1.2rem; columns: 2; column-gap: 2rem; }
.service-detail li { margin-bottom: .4rem; break-inside: avoid; }
@media (max-width: 760px) {
  .service-detail { grid-template-columns: 1fr; gap: .5rem; }
  .service-detail ul { columns: 1; }
}

/* ---------- Service area ---------- */
.towns { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: .5rem; }
.towns li {
  padding: .45rem .9rem; border: 1.5px solid var(--line); border-radius: 999px; background: var(--white); font-weight: 600;
}
.towns li.home { border-color: var(--copper); color: var(--copper); }

/* ---------- FAQ ---------- */
.faq details { border-top: 1px solid var(--line); padding: 1rem 0; }
.faq details:last-child { border-bottom: 1px solid var(--line); }
.faq summary {
  cursor: pointer; font-weight: 700; font-size: 1.1rem; list-style: none;
  display: flex; justify-content: space-between; gap: 1rem; align-items: center;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; font-size: 1.6rem; line-height: 1; color: var(--copper); flex: none; }
.faq details[open] summary::after { content: "\2212"; }
.faq details p { margin: .75rem 0 0; color: var(--ink-2); }

/* ---------- CTA band ---------- */
.cta-band { background: var(--copper); color: var(--white); padding: clamp(2.5rem, 6vw, 4rem) 0; }
.cta-band .wrap { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 1.5rem; }
.cta-band h2 { margin: 0; max-width: 20ch; }
.cta-band .btn-light { background: var(--white); color: var(--ink); }
.cta-band .btn-light:hover { background: var(--ink); color: var(--white); }
.cta-band .btn-outline { color: var(--white); }
.cta-band .btn-outline:hover { background: var(--white); color: var(--copper); border-color: var(--white); }
.cta-actions { display: flex; flex-wrap: wrap; gap: .75rem; }

/* ---------- Contact ---------- */
.contact-grid { display: grid; grid-template-columns: .8fr 1.2fr; gap: clamp(2rem, 6vw, 4.5rem); }
@media (max-width: 900px) { .contact-grid { grid-template-columns: 1fr; } }
.contact-card { background: var(--paper); border-radius: var(--radius-m); padding: 1.75rem; }
.contact-card dl { margin: 0; }
.contact-card dt { font-weight: 700; margin-top: 1.1rem; }
.contact-card dt:first-child { margin-top: 0; }
.contact-card dd { margin: .2rem 0 0; }
.big-phone {
  display: inline-block; font-size: clamp(1.8rem, 4vw, 2.4rem); font-weight: 800;
  font-variation-settings: "wdth" 75; text-decoration: none; color: var(--ink);
}
.big-phone:hover { color: var(--copper); }
.emergency-note {
  margin-top: 1.5rem; padding: 1rem 1.15rem; border-left: 4px solid var(--err); background: #fbeeee; font-size: .95rem;
}
.emergency-note p { margin: 0; }

.form { display: grid; grid-template-columns: 1fr 1fr; gap: 1.1rem 1.25rem; }
.form .full { grid-column: 1 / -1; }
@media (max-width: 600px) { .form { grid-template-columns: 1fr; } }
.field label, .field legend { display: block; font-weight: 700; margin-bottom: .35rem; }
.field .hint { font-weight: 400; color: var(--muted); font-size: .9rem; }
.field input, .field select, .field textarea {
  width: 100%; min-height: 48px; padding: .7rem .85rem;
  font: inherit; font-size: 1rem; color: var(--ink);
  background: var(--white); border: 1.5px solid #9aa6b3; border-radius: var(--radius-s);
}
.field textarea { min-height: 150px; resize: vertical; }
.field input:focus, .field select:focus, .field textarea:focus {
  outline: none; border-color: var(--copper); box-shadow: 0 0 0 3px rgba(169, 86, 31, .25);
}
.field input:user-invalid, .field textarea:user-invalid, .field select:user-invalid { border-color: var(--err); }
fieldset.field { border: 0; padding: 0; margin: 0; }
.radio-row { display: flex; flex-wrap: wrap; gap: .5rem 1.5rem; }
.radio-row label { display: inline-flex; align-items: center; gap: .45rem; font-weight: 500; margin: 0; min-height: 44px; }
.radio-row input { width: 1.2rem; height: 1.2rem; min-height: 0; accent-color: var(--copper); }
.hp { position: absolute !important; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.form-status { grid-column: 1 / -1; margin: 0; font-weight: 600; min-height: 1.6em; }
.form-status.is-error { color: var(--err); }
.form-status.is-sending { color: var(--muted); }
.form-legal { grid-column: 1 / -1; font-size: .9rem; color: var(--muted); margin: 0; }
.form button[disabled] { opacity: .65; cursor: progress; }

/* ---------- Simple / legal pages ---------- */
.prose h2 { font-size: 1.7rem; margin-top: 2.2rem; }
.prose ul { max-width: var(--measure); padding-left: 1.2rem; }
.prose li { margin-bottom: .4rem; }

.center-page { min-height: 60vh; display: grid; align-items: center; }
.center-page .big { font-size: clamp(5rem, 18vw, 11rem); line-height: .9; font-weight: 800; font-variation-settings: "wdth" 62; color: var(--copper); margin: 0 0 1rem; }
.link-list { display: flex; flex-wrap: wrap; gap: .75rem; margin-top: 1.5rem; }

/* ---------- Footer ---------- */
.site-footer { background: var(--ink); color: #c3ccd7; padding: 3.5rem 0 2rem; font-size: .98rem; }
.site-footer a { color: var(--white); }
.site-footer a:hover { color: var(--copper-bright); }
.footer-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr 1fr; gap: 2rem; }
@media (max-width: 860px) { .footer-grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 520px) { .footer-grid { grid-template-columns: 1fr; } }
.site-footer h2 { font-size: 1.1rem; color: var(--white); font-variation-settings: "wdth" 90; margin-bottom: .8rem; }
.site-footer ul { list-style: none; margin: 0; padding: 0; }
.site-footer li { margin-bottom: .45rem; }
.footer-brand img { width: 72px; height: 72px; border-radius: 50%; margin-bottom: 1rem; }
.social { display: flex; gap: .6rem; margin-top: 1rem; }
.social a {
  display: grid; place-items: center; width: 44px; height: 44px; border-radius: 50%;
  border: 1.5px solid #3b4d64; color: var(--white);
}
.social a:hover { border-color: var(--copper-bright); background: #22324a; }
.social svg { width: 20px; height: 20px; }
.footer-bottom {
  margin-top: 2.5rem; padding-top: 1.5rem; border-top: 1px solid #2c3e55;
  display: flex; flex-wrap: wrap; justify-content: space-between; gap: 1rem; font-size: .9rem;
}

/* ---------- Mobile call bar ---------- */
.call-bar { display: none; }
@media (max-width: 720px) {
  body { padding-bottom: calc(64px + env(safe-area-inset-bottom, 0px)); }
  .call-bar {
    display: grid; grid-template-columns: 1fr 1fr; position: fixed; left: 0; right: 0; bottom: 0; z-index: 60;
    background: var(--ink); padding-bottom: env(safe-area-inset-bottom, 0px);
    border-top: 3px solid var(--copper-bright);
  }
  .call-bar a {
    display: flex; align-items: center; justify-content: center; gap: .5rem;
    min-height: 60px; color: var(--white); text-decoration: none; font-weight: 700;
  }
  .call-bar a + a { background: var(--copper); }
  .call-bar svg { width: 1.2rem; height: 1.2rem; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
  .hero-wire .conductor { stroke-dashoffset: 0; }
  .hero-wire .terminal { opacity: 1; }
}

@media print {
  .site-header, .call-bar, .site-footer .social, .cta-band, .hero-wire { display: none !important; }
  .hero, .page-hero { background: none; color: #000; }
}
