/* ============================================================
   S O Campbell Electrical — concept preview
   Mobile-first · no libraries · motion gated behind
   prefers-reduced-motion
   ============================================================ */

/* ---------- Tokens ---------- */
:root {
  --ink: #1a2130;        /* deep navy charcoal */
  --ink-2: #222b3d;      /* raised navy (cards on dark) */
  --footer: #12161d;
  --paper: #fbf8f1;      /* warm off-white page */
  --sand: #f3ecdc;       /* warm band */
  --card: #ffffff;

  --amber: #ffb226;      /* trade amber (on dark / buttons) */
  --amber-2: #ffc255;    /* hover */
  --amber-deep: #d67f00; /* borders, icons, large numerals on light */
  --amber-ink: #8f5e00;  /* AA-safe amber text on light */

  --text: #2c3345;       /* body on light */
  --muted: #55607a;      /* secondary on light  (5.9:1 on white) */
  --off: #f6f4ee;        /* text on dark */
  --muted-dark: #b9c2d2; /* secondary on dark   (8.5:1 on ink) */

  --line: #e6dfd0;
  --line-dark: rgba(246, 244, 238, 0.13);

  --radius: 16px;
  --shadow: 0 14px 34px rgba(20, 26, 40, 0.1);

  --font: "Archivo", "Segoe UI", system-ui, -apple-system, sans-serif;
}

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

html {
  -webkit-text-size-adjust: 100%;
  scroll-padding-top: 24px;
}

@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }
}

body {
  margin: 0;
  font-family: var(--font);
  font-size: 1.03rem;
  line-height: 1.65;
  color: var(--text);
  background: var(--paper);
}

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

h1, h2, h3 {
  line-height: 1.15;
  letter-spacing: -0.01em;
  font-weight: 700;
  color: var(--ink);
  margin: 0;
}

h1 { font-size: clamp(1.9rem, 1.3rem + 3.4vw, 3.5rem); }
h2 { font-size: clamp(1.55rem, 1.2rem + 1.9vw, 2.3rem); }
h3 { font-size: 1.14rem; }

p { margin: 0; }

a { color: var(--amber-ink); }
.dark a { color: var(--amber); }

ul, ol { margin: 0; padding: 0; list-style: none; }

/* Grid items must be allowed to shrink below their content's
   intrinsic size (e.g. <select> option lists) — prevents overflow */
.grid-cards > *,
.steps > *,
.cred-grid > *,
.footer-grid > *,
.hero-grid > *,
.contact-grid > * { min-width: 0; }

.wrap {
  max-width: 1140px;
  margin-inline: auto;
  padding-inline: clamp(1rem, 4vw, 2rem);
}

/* Focus — visible everywhere, coloured per context */
:focus-visible {
  outline: 3px solid var(--amber-deep);
  outline-offset: 3px;
  border-radius: 4px;
}
.dark :focus-visible,
.site-footer :focus-visible,
.cta-bar :focus-visible {
  outline-color: var(--amber);
}

.skip {
  position: absolute;
  left: -100vw;
  top: 0;
  z-index: 100;
  background: var(--amber);
  color: #1a1d23;
  font-weight: 700;
  padding: 0.75rem 1.25rem;
  border-radius: 0 0 10px 0;
  text-decoration: none;
}
.skip:focus { left: 0; }

/* ---------- Icons ---------- */
.i {
  width: 1.3em;
  height: 1.3em;
  flex: none;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  min-height: 48px;
  padding: 0.7rem 1.4rem;
  border-radius: 12px;
  border: 2px solid transparent;
  font: inherit;
  font-weight: 700;
  font-size: 1rem;
  line-height: 1.2;
  text-decoration: none;
  cursor: pointer;
  transition:
    transform 0.25s ease,
    background-color 0.25s ease,
    border-color 0.25s ease,
    color 0.25s ease,
    box-shadow 0.25s ease;
}
.btn:hover { transform: translateY(-2px); }
.btn:active { transform: translateY(0); }

.btn-primary {
  background: var(--amber);
  color: #1a1d23;
  box-shadow: 0 6px 18px rgba(255, 178, 38, 0.25);
}
.btn-primary:hover {
  background: var(--amber-2);
  box-shadow: 0 10px 26px rgba(255, 178, 38, 0.35);
}

.btn-outline {
  border-color: rgba(246, 244, 238, 0.45);
  color: var(--off);
  background: transparent;
}
.btn-outline:hover {
  border-color: var(--amber);
  color: var(--amber);
  background: rgba(255, 178, 38, 0.07);
}

.btn-sm { min-height: 44px; padding: 0.5rem 1rem; font-size: 0.95rem; border-radius: 10px; }
.btn-block { width: 100%; }

/* ---------- Eyebrow / section heads ---------- */
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--amber-ink);
  margin: 0 0 0.9rem;
}
.eyebrow::before {
  content: "";
  width: 1.7rem;
  height: 2px;
  background: var(--amber);
}
.dark .eyebrow { color: var(--amber); }

.section { padding-block: clamp(3.5rem, 9vw, 6.5rem); }

.section-head { max-width: 46rem; margin-bottom: clamp(2rem, 5vw, 3.25rem); }
.section-head h2 { max-width: 24ch; }
.section-lede { color: var(--muted); margin-top: 1rem; max-width: 60ch; }
.dark .section-lede { color: var(--muted-dark); }

/* ---------- Dark sections (blueprint grid) ---------- */
.dark {
  color: var(--muted-dark);
  background-color: var(--ink);
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.028) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.028) 1px, transparent 1px);
  background-size: 34px 34px;
}
.dark h2, .dark h3 { color: #fff; }

/* ---------- Concept banner ---------- */
.concept-banner {
  background: #14181f;
  color: #d9cdb2;
  font-size: 0.75rem;
  line-height: 1.45;
  letter-spacing: 0.02em;
  text-align: center;
  padding: 0.4rem 1rem;
  border-bottom: 1px solid rgba(255, 178, 38, 0.25);
}

/* ---------- Header ---------- */
.site-header {
  background: var(--ink);
  border-bottom: 1px solid rgba(255, 178, 38, 0.2);
  color: var(--off);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  min-height: 64px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  text-decoration: none;
  color: #fff;
  font-weight: 700;
  font-size: 1.02rem;
  letter-spacing: -0.01em;
}
.brand em { color: var(--amber); font-style: normal; }

.brand-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: 9px;
  background: rgba(255, 178, 38, 0.12);
  border: 1px solid rgba(255, 178, 38, 0.4);
  color: var(--amber);
}
.brand-mark .i { width: 18px; height: 18px; }

.site-nav { display: none; }
.header-call { flex: none; }

@media (max-width: 479px) {
  .header-call .call-num { display: none; }
  .header-call { padding-inline: 0.8rem; }
}

@media (min-width: 900px) {
  html { scroll-padding-top: 88px; }
  .site-header { position: sticky; top: 0; z-index: 40; }
  .site-nav { display: flex; gap: 1.5rem; }
  .site-nav a {
    color: #cfd5e2;
    font-weight: 600;
    font-size: 0.94rem;
    text-decoration: none;
    padding: 0.4rem 0.05rem;
    background-image: linear-gradient(var(--amber), var(--amber));
    background-repeat: no-repeat;
    background-size: 0% 2px;
    background-position: 0 100%;
    transition: color 0.2s ease, background-size 0.25s ease;
  }
  .site-nav a:hover,
  .site-nav a:focus-visible {
    color: #fff;
    background-size: 100% 2px;
  }
}

/* ---------- Hero ---------- */
.hero { position: relative; overflow: hidden; }
.hero::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: radial-gradient(640px 420px at 88% 0%, rgba(255, 178, 38, 0.14), transparent 62%);
}

.hero-grid {
  position: relative;
  z-index: 1;
  display: grid;
  gap: clamp(2.25rem, 6vw, 3.5rem);
  padding-block: clamp(1.75rem, 5vw, 5.5rem) clamp(2.5rem, 6vw, 5rem);
  align-items: center;
}

.hero-copy h1 { color: #fff; margin-bottom: 0.9rem; }
.hero .hl { color: var(--amber); }

.hero-sub {
  color: var(--muted-dark);
  font-size: 1.05rem;
  max-width: 56ch;
  margin-bottom: 1.6rem;
}

.hero-cta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.8rem;
  margin-bottom: 1.6rem;
}

@media (max-width: 479px) {
  .hero-cta { flex-direction: column; align-items: stretch; }
  .hero-cta .btn { width: 100%; }
}

/* trust chips */
.chips { display: flex; flex-wrap: wrap; gap: 0.55rem; }
.chips li {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.45rem 0.9rem;
  border: 1px solid rgba(255, 178, 38, 0.38);
  border-radius: 999px;
  background: rgba(255, 178, 38, 0.08);
  font-size: 0.86rem;
  font-weight: 600;
  color: var(--off);
}
.chips .i { width: 15px; height: 15px; color: var(--amber); }

/* hero image */
.hero-fig {
  position: relative;
  margin: 0;
  border-radius: 18px;
  overflow: hidden;
  border: 1px solid rgba(246, 244, 238, 0.16);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.45);
}
.hero-fig img { width: 100%; height: auto; }

.fig-chip {
  position: absolute;
  left: 0.9rem;
  bottom: 0.9rem;
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.45rem 0.85rem;
  border-radius: 999px;
  background: rgba(18, 22, 29, 0.85);
  border: 1px solid rgba(255, 178, 38, 0.4);
  color: var(--off);
  font-size: 0.82rem;
  font-weight: 600;
}
.fig-chip .i { width: 14px; height: 14px; color: var(--amber); }

@media (min-width: 960px) {
  .hero-grid { grid-template-columns: 1.12fr 0.88fr; }
}

/* ---------- Cred band ---------- */
.cred {
  background: var(--sand);
  border-bottom: 1px solid var(--line);
}
.cred-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(200px, 100%), 1fr));
  gap: 1rem 2rem;
  padding-block: 1.6rem;
}
.cred-item {
  display: flex;
  align-items: baseline;
  gap: 0.7rem;
}
.cred-num {
  font-size: clamp(1.7rem, 3vw, 2.2rem);
  font-weight: 700;
  color: var(--amber-ink);
  line-height: 1;
}
.cred-label { color: var(--muted); font-size: 0.95rem; font-weight: 600; }

/* ---------- Cards / grids ---------- */
.grid-cards {
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(auto-fit, minmax(min(250px, 100%), 1fr));
}
/* 9 service cards and 3 area cards look best capped at 3 columns */
@media (min-width: 880px) {
  .grid-cards { grid-template-columns: repeat(3, 1fr); }
  .footer-grid { grid-template-columns: repeat(3, 1fr); }
}
/* why-us: 4 cards read as a clean 2×2 */
#why-us .grid-cards {
  grid-template-columns: repeat(auto-fit, minmax(min(270px, 100%), 1fr));
}
/* area cards are compact — 3 fit from tablet up */
.areas-grid {
  grid-template-columns: repeat(auto-fit, minmax(min(200px, 100%), 1fr));
}
@media (min-width: 760px) {
  #why-us .grid-cards { grid-template-columns: repeat(2, 1fr); }
  .steps { grid-template-columns: repeat(3, 1fr); }
  .cred-grid { grid-template-columns: repeat(3, 1fr); }
}

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.5rem;
  transition:
    transform 0.25s ease,
    border-color 0.25s ease,
    box-shadow 0.25s ease;
}
.card:hover {
  transform: translateY(-4px);
  border-color: rgba(214, 127, 0, 0.55);
  box-shadow: var(--shadow);
}
.card p { color: var(--muted); margin-top: 0.5rem; font-size: 0.97rem; }

.card-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: 12px;
  margin-bottom: 1rem;
  background: #fff3d6;
  border: 1px solid rgba(214, 127, 0, 0.35);
  color: var(--amber-deep);
}
.card-icon .i { width: 22px; height: 22px; }

/* photo cards */
.card-photo { padding: 0; position: relative; overflow: hidden; }
.card-photo img {
  width: 100%;
  height: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  transition: transform 0.3s ease;
}
.card-photo:hover img { transform: scale(1.03); }
.photo-tag {
  position: absolute;
  left: 0.9rem;
  bottom: 0.9rem;
  padding: 0.4rem 0.8rem;
  border-radius: 999px;
  background: rgba(18, 22, 29, 0.85);
  border: 1px solid rgba(255, 178, 38, 0.4);
  color: var(--off);
  font-size: 0.8rem;
  font-weight: 600;
}

/* dark cards */
.card-dark {
  background: var(--ink-2);
  border-color: rgba(246, 244, 238, 0.1);
}
.card-dark:hover { border-color: rgba(255, 178, 38, 0.55); box-shadow: 0 16px 36px rgba(0, 0, 0, 0.35); }
.card-dark .card-icon {
  background: rgba(255, 178, 38, 0.1);
  border-color: rgba(255, 178, 38, 0.35);
  color: var(--amber);
}
.card-dark p { color: var(--muted-dark); }

/* ---------- Steps ---------- */
.steps {
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(auto-fit, minmax(min(250px, 100%), 1fr));
  counter-reset: step;
}
.step { position: relative; }
.step-num {
  display: block;
  font-size: 2.3rem;
  font-weight: 700;
  color: var(--amber-ink);
  line-height: 1;
  margin-bottom: 0.8rem;
}
.step a { text-decoration: underline; text-underline-offset: 3px; }

/* ---------- Areas ---------- */
.section-sand { background: var(--sand); border-block: 1px solid var(--line); }
.section-narrow .faq { max-width: 46rem; }

.area-card {
  display: flex;
  align-items: center;
  gap: 0.9rem;
  padding-block: 1.35rem;
}
.area-pin {
  width: 26px;
  height: 26px;
  color: var(--amber-deep);
  margin: 0;
}
.area-card h3 { margin: 0; }

/* ---------- FAQ ---------- */
.faq { display: grid; gap: 0.8rem; }

.faq details {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 14px;
  transition: border-color 0.25s ease, box-shadow 0.25s ease;
}
.faq details:hover { border-color: rgba(214, 127, 0, 0.55); }
.faq details[open] { box-shadow: var(--shadow); }

.faq summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.05rem 1.25rem;
  min-height: 48px;
  cursor: pointer;
  font-weight: 700;
  color: var(--ink);
  list-style: none;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary .i { color: var(--amber-deep); transition: transform 0.2s ease; }
.faq details[open] summary .i { transform: rotate(45deg); }
.faq details[open] summary { border-bottom: 1px solid var(--line); }
.faq .a { padding: 1rem 1.25rem 1.25rem; color: var(--muted); }
.faq .a a { text-decoration: underline; text-underline-offset: 3px; }

/* ---------- Contact ---------- */
.contact-grid {
  display: grid;
  gap: clamp(2.25rem, 6vw, 3.5rem);
  padding-block: clamp(3.5rem, 9vw, 6.5rem);
}
.contact-info h2 { margin-bottom: 1rem; max-width: 20ch; }
.contact-lede { margin-bottom: 1.9rem; max-width: 46ch; }

.contact-phone {
  display: inline-flex;
  align-items: center;
  gap: 0.7rem;
  font-size: clamp(1.5rem, 4.5vw, 2.2rem);
  font-weight: 700;
  color: var(--amber);
  text-decoration: none;
  transition: color 0.2s ease;
}
.contact-phone:hover { color: var(--amber-2); }

.contact-mail {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  margin-top: 0.7rem;
  color: var(--off);
  font-weight: 600;
  text-decoration: none;
  border-bottom: 2px solid rgba(255, 178, 38, 0.5);
  transition: color 0.2s ease, border-color 0.2s ease;
}
.contact-mail:hover { color: var(--amber); border-color: var(--amber); }

.ticks { margin-top: 1.75rem; display: grid; gap: 0.7rem; }
.ticks li {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  color: var(--muted-dark);
  font-size: 0.97rem;
}
.ticks .i { color: var(--amber); width: 18px; height: 18px; }

@media (min-width: 960px) {
  .contact-grid { grid-template-columns: 0.95fr 1.05fr; align-items: start; }
}

/* ---------- Form ---------- */
.form-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: clamp(1.4rem, 3.5vw, 2.1rem);
  box-shadow: var(--shadow);
  color: var(--text);
}
.form-card h3 { font-size: 1.35rem; margin-bottom: 1.4rem; }

.field { margin-bottom: 1.1rem; }
.field-row { display: grid; gap: 0 1.1rem; }
@media (min-width: 560px) { .field-row { grid-template-columns: 1fr 1fr; } }

.field label {
  display: block;
  font-weight: 700;
  font-size: 0.93rem;
  color: var(--ink);
  margin-bottom: 0.45rem;
}
.req { color: var(--amber-deep); }
.opt { color: var(--muted); font-weight: 500; }

.field input,
.field select,
.field textarea {
  width: 100%;
  min-height: 48px;
  padding: 0.75rem 0.9rem;
  border: 1.5px solid #d8d2c4;
  border-radius: 10px;
  background: #fdfcf9;
  font: inherit;
  color: var(--ink);
  transition: border-color 0.2s ease;
}
.field textarea { resize: vertical; min-height: 120px; }
.field input:focus-visible,
.field select:focus-visible,
.field textarea:focus-visible {
  border-color: var(--amber-deep);
}

.form-hint {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.55rem;
  align-items: start;
  margin-top: 1rem;
  padding: 0.85rem 1rem;
  background: #fdf6e5;
  border: 1px solid rgba(214, 127, 0, 0.3);
  border-radius: 10px;
  font-size: 0.9rem;
  color: var(--muted);
}
.form-hint .i { color: var(--amber-deep); margin-top: 0.2em; }
.form-hint a { text-decoration: underline; text-underline-offset: 3px; }

.form-note {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.55rem;
  align-items: start;
  margin-top: 1rem;
  padding: 1rem 1.1rem;
  background: #eef4ea;
  border: 1px solid rgba(74, 124, 54, 0.4);
  border-radius: 10px;
  font-size: 0.95rem;
  color: #33422b;
}
/* the hidden attribute must win over display: grid above */
.form-note[hidden] { display: none; }
.form-note a,
.form-hint a,
.contact-mail,
.footer-col a { overflow-wrap: anywhere; }
.form-note::before {
  content: "✓";
  font-weight: 700;
  color: #4a7c36;
  line-height: 1.4;
}
.form-note a { color: #3c6428; text-decoration: underline; text-underline-offset: 3px; }

/* ---------- Footer ---------- */
.site-footer { background: var(--footer); color: var(--muted-dark); }

.footer-grid {
  display: grid;
  gap: 2rem;
  grid-template-columns: repeat(auto-fit, minmax(min(230px, 100%), 1fr));
  padding-block: 3rem 2rem;
}

.footer-brand-name { font-size: 1.05rem; margin: 0 0 0.75rem; }
.footer-tag { font-size: 0.95rem; max-width: 34ch; }

.foot-label {
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--amber);
  margin-bottom: 0.9rem;
}

.footer-col ul { display: grid; gap: 0.55rem; }
.footer-col a {
  color: #d6dbe6;
  text-decoration: none;
  transition: color 0.2s ease;
}
.footer-col a:hover { color: var(--amber); }

.footer-bottom {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem 1.5rem;
  justify-content: space-between;
  padding-block: 1.15rem;
  border-top: 1px solid rgba(246, 244, 238, 0.09);
  font-size: 0.85rem;
  color: #8d96a8;
}

/* ---------- Sticky mobile CTA ---------- */
.cta-bar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 50;
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 0.6rem;
  padding: 0.65rem 0.75rem calc(0.65rem + env(safe-area-inset-bottom, 0px));
  background: rgba(18, 22, 29, 0.96);
  backdrop-filter: blur(8px);
  border-top: 1px solid rgba(255, 178, 38, 0.35);
}
.cta-bar .btn {
  min-height: 48px;
  padding-inline: clamp(0.4rem, 2.5vw, 0.9rem);
  font-size: clamp(0.88rem, 2.6vw, 0.96rem);
  white-space: nowrap;
}
@media (max-width: 359px) {
  .cta-bar .call-word { display: none; }
}

@media (max-width: 767px) {
  body { padding-bottom: calc(74px + env(safe-area-inset-bottom, 0px)); }
  html { scroll-padding-bottom: 96px; }
}
@media (min-width: 768px) {
  .cta-bar { display: none; }
}

/* ---------- Motion ----------
   Hidden states only ever apply under html.js (set by inline script
   when motion is allowed AND IntersectionObserver exists). */
.js .hero-i {
  animation: hero-rise 0.7s cubic-bezier(0.16, 0.7, 0.3, 1) both;
  animation-delay: calc(var(--i, 0) * 0.1s);
}
@keyframes hero-rise {
  from { opacity: 0; transform: translateY(16px); }
  to { opacity: 1; transform: none; }
}

.js .reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}
.js .reveal.in {
  opacity: 1;
  transform: none;
}

@media (prefers-reduced-motion: reduce) {
  .js .hero-i { animation: none; }
  .js .reveal { opacity: 1; transform: none; transition: none; }
  .card:hover, .btn:hover, .btn:active, .card-photo:hover img { transform: none; }
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
