/* Fonts are loaded non-blocking via <link> in each page <head> (not @import) for faster first paint. */

/* ==========================================================================
   Arizona Electrical Solutions — stylesheet
   Premium design-build aesthetic (Turner-inspired): full-bleed photography,
   large tight headlines, generous whitespace, hairline detail, navy + amber.
   ========================================================================== */

:root {
  --navy:       #0a1f33;
  --navy-2:     #102c44;
  --steel:      #294b68;
  --accent:     #a8610f;   /* warm equipment-orange accent (darkened to 4.8:1 on white for WCAG AA) */
  --accent-2:   #ec9a35;
  --ink:        #14222e;
  --body:       #4a5560;
  --muted:      #7a8893;
  --line:       #e4e8ec;
  --line-dark:  rgba(255,255,255,0.16);
  --bg:         #ffffff;
  --bg-alt:     #f4f6f8;
  --bg-dark:    #0a1f33;
  --max:        1240px;
  --pad:        clamp(1.25rem, 5vw, 3rem);
  --header-h:   72px;
  --font:       "Inter", "Helvetica Neue", Arial, system-ui, sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
[id] { scroll-margin-top: 96px; }

body {
  margin: 0;
  font-family: var(--font);
  color: var(--body);
  background: var(--bg);
  line-height: 1.65;
  font-size: 17px;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

h1, h2, h3, h4 {
  color: var(--ink);
  line-height: 1.05;
  font-weight: 800;
  letter-spacing: -0.025em;
  margin: 0 0 0.5em;
}
h1 { font-size: clamp(2.5rem, 6.2vw, 5rem); font-weight: 900; }
h2 { font-size: clamp(1.85rem, 3.8vw, 3.1rem); }
h3 { font-size: 1.25rem; letter-spacing: -0.015em; }
p { margin: 0 0 1rem; }

a { color: var(--steel); text-decoration: none; transition: color 0.15s ease; }
a:hover { color: var(--accent); }

.wrap { max-width: var(--max); margin: 0 auto; padding-left: var(--pad); padding-right: var(--pad); }

.eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.22em;
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--accent);
  margin: 0 0 1.1rem;
}
.eyebrow.light { color: var(--accent-2); }

/* ---------- Header / nav (transparent over hero, solid on scroll) ---------- */
.site-header {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  background: transparent;
  transition: background 0.35s ease, box-shadow 0.35s ease, border-color 0.35s ease;
  border-bottom: 1px solid transparent;
}
.site-header::before {   /* subtle top scrim so white nav reads over any photo */
  content: "";
  position: absolute; inset: 0; bottom: auto; height: 160px;
  background: linear-gradient(to bottom, rgba(8,22,36,0.55), transparent);
  pointer-events: none;
  opacity: 1;
  transition: opacity 0.35s ease;
}
.site-header.scrolled {
  background: var(--navy);
  box-shadow: 0 10px 30px -16px rgba(0,0,0,0.6);
  border-bottom-color: var(--accent);
}
.site-header.scrolled::before { opacity: 0; }

.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  height: var(--header-h);
}
.brand { display: flex; align-items: center; line-height: 1.05; position: relative; }
.brand a { color: #fff; display: inline-flex; align-items: center; }
.brand-logo { height: 58px; width: auto; display: block; }
.brand .name {
  font-size: 1.16rem;
  font-weight: 800;
  letter-spacing: -0.01em;
  color: #fff;
}
.brand .tag {
  font-size: 0.56rem;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  color: var(--accent-2);
  margin-top: 3px;
  font-weight: 600;
  white-space: nowrap;
}
/* desktop horizontal nav needs the width — hide the decorative tagline there
   (it still appears in the mobile menu) */
@media (min-width: 1241px) { .brand .tag { display: none; } }
.nav-toggle {
  display: none;
  background: transparent;
  border: 1px solid rgba(255,255,255,0.4);
  color: #fff;
  padding: 0.4rem 0.55rem;
  border-radius: 4px;
  cursor: pointer;
  font-size: 0;          /* hide the "Menu" text — show a hamburger icon instead */
  line-height: 0;
}
.nav-toggle::before {
  content: "\2630";      /* ☰ hamburger */
  font-size: 1.35rem;
  line-height: 1;
}
/* click-to-call button (header) */
.nav-call {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  margin-left: auto;            /* brand stays left; call + nav group right */
  background: var(--accent);
  color: #fff;
  font-weight: 700;
  font-size: 0.78rem;
  letter-spacing: 0.01em;
  padding: 0.5rem 0.85rem;
  border-radius: 999px;
  white-space: nowrap;
  transition: background 0.15s ease, transform 0.15s ease;
}
.nav-call:hover { background: var(--accent-2); color: #fff; }
.nav-call:active { transform: scale(0.97); }
.nav-call svg { width: 15px; height: 15px; flex: none; }

.nav-links {
  display: flex;
  align-items: center;
  gap: 0.1rem;
  list-style: none;
  margin: 0;
  padding: 0;
  flex-wrap: wrap;
}
.nav-links a {
  display: block;
  color: rgba(255,255,255,0.82);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  padding: 0.5rem 0.55rem;
  text-transform: uppercase;
  white-space: nowrap;
  position: relative;
}
.nav-links a::after {
  content: "";
  position: absolute;
  left: 0.55rem; right: 0.55rem; bottom: 0.15rem;
  height: 2px;
  background: var(--accent);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.2s ease;
}
.nav-links a:hover { color: #fff; }
.nav-links a:hover::after, .nav-links a.active::after { transform: scaleX(1); }
.nav-links a.active { color: #fff; }
.nav-links a.cta {
  background: var(--accent);
  color: #fff;
  border-radius: 2px;
  margin-left: 0.5rem;
}
.nav-links a.cta::after { display: none; }
.nav-links a.cta:hover { background: var(--accent-2); color: #fff; }

/* Services dropdown */
.nav-links .has-sub { position: relative; }
.nav-links .caret { font-size: 0.7em; opacity: 0.85; }
.nav-links .subnav {
  display: none;
  position: absolute;
  top: 100%; left: 0;
  min-width: 250px;
  margin: 0; padding: 0.35rem 0;
  list-style: none;
  background: var(--navy);
  border-top: 2px solid var(--accent);
  box-shadow: 0 20px 45px -18px rgba(0,0,0,0.65);
}
.nav-links .has-sub:hover .subnav,
.nav-links .has-sub:focus-within .subnav { display: block; }
.nav-links .subnav li { display: block; }
.nav-links .subnav a {
  display: block;
  padding: 0.6rem 1.1rem;
  text-transform: none;
  letter-spacing: 0.01em;
  font-size: 0.82rem;
  color: rgba(255,255,255,0.85);
  white-space: nowrap;
}
.nav-links .subnav a::after { display: none; }
.nav-links .subnav a:hover, .nav-links .subnav a.active { background: var(--steel); color: #fff; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  font-weight: 700;
  font-size: 0.82rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 0.95rem 1.7rem;
  border-radius: 2px;
  border: 1px solid transparent;
  cursor: pointer;
  transition: all 0.18s ease;
}
.btn::after { content: "\2192"; font-size: 1.05em; transition: transform 0.18s ease; }
.btn:hover::after { transform: translateX(4px); }
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-2); color: #fff; }
.btn-ghost { border-color: rgba(255,255,255,0.55); color: #fff; }
.btn-ghost:hover { border-color: #fff; background: rgba(255,255,255,0.1); color: #fff; }
.btn-dark { background: var(--navy); color: #fff; }
.btn-dark:hover { background: var(--steel); color: #fff; }

/* ---------- Hero ---------- */
.hero {
  position: relative;
  min-height: 92vh;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: calc(var(--header-h) + 2rem) 0 clamp(3.5rem, 8vh, 6rem);
  background: var(--navy);
  color: #eef3f7;
}
.hero .wrap { width: 100%; }
.hero .eyebrow, .hero h1, .hero .lead { text-shadow: 0 1px 24px rgba(6,16,28,0.45); }
.hero h1 { color: #fff; max-width: 18ch; }
.hero .lead {
  font-size: clamp(1.1rem, 1.7vw, 1.4rem);
  color: rgba(255,255,255,0.82);
  max-width: 56ch;
  margin: 1.5rem 0 2.25rem;
  font-weight: 400;
}
.hero-actions { display: flex; flex-wrap: wrap; gap: 1rem; }
.hero::after {   /* scroll cue */
  content: "";
  position: absolute;
  left: 50%; bottom: 1.6rem;
  z-index: 2;
  width: 1px; height: 46px;
  background: linear-gradient(to bottom, transparent, rgba(255,255,255,0.7));
  animation: heroCue 2s ease-in-out infinite;
}
@keyframes heroCue { 0%,100% { opacity: 0.3; transform: translateY(0); } 50% { opacity: 1; transform: translateY(6px); } }

/* interior page header */
.page-head {
  position: relative;
  background: var(--navy);
  color: #fff;
  padding: calc(var(--header-h) + clamp(3rem, 8vw, 6rem)) 0 clamp(3rem, 7vw, 5rem);
}
.page-head h1 { color: #fff; }
.page-head p { color: rgba(255,255,255,0.82); max-width: 62ch; margin-bottom: 0; font-size: 1.08rem; }

/* ---------- Sections ---------- */
section { padding: clamp(3.75rem, 8vw, 7rem) 0; }
.section-alt { background: var(--bg-alt); }
.section-dark { background: var(--bg-dark); color: rgba(255,255,255,0.8); }
.section-dark h2, .section-dark h3 { color: #fff; }
.section-head { max-width: 70ch; margin-bottom: 3rem; }
.section-head.center { margin-left: auto; margin-right: auto; text-align: center; }
.section-head p { font-size: 1.08rem; }

/* ---------- Grid + cards ---------- */
.grid { display: grid; gap: 1.5rem; }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }

.card {
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 3px;
  padding: 2rem 1.85rem;
  transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
}
.card:hover { transform: translateY(-4px); box-shadow: 0 22px 45px -28px rgba(10,31,51,0.45); border-color: #d4dae0; }
.card h3 { margin-bottom: 0.5rem; }
.card p { color: var(--body); font-size: 0.97rem; margin-bottom: 0; }
.card .kicker {
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  color: var(--accent);
  font-weight: 700;
  display: block;
  margin-bottom: 0.7rem;
}
.card.accent-top { border-top: 3px solid var(--accent); }
.section-alt .card { background: #fff; }

/* clickable cards (markets) */
a.card { text-decoration: none; color: inherit; display: block; }
a.card h3 { color: var(--ink); transition: color 0.15s ease; }
a.card:hover h3 { color: var(--accent); }
a.card h3 .arr { color: var(--accent); font-weight: 400; margin-left: 0.25rem; display: inline-block; transition: transform 0.15s ease; }
a.card:hover h3 .arr { transform: translateX(3px); }

/* feature list */
.flist { list-style: none; margin: 0; padding: 0; }
.flist li {
  position: relative;
  padding: 0.5rem 0 0.5rem 1.7rem;
  color: var(--body);
  border-bottom: 1px solid var(--line);
}
.flist li:last-child { border-bottom: none; }
.flist li::before {
  content: "";
  position: absolute;
  left: 0; top: 1.05rem;
  width: 10px; height: 2px;
  background: var(--accent);
}
.section-dark .flist li { color: rgba(255,255,255,0.8); border-bottom-color: var(--line-dark); }

/* split */
.split { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(2.5rem, 6vw, 5rem); align-items: center; }

/* stats */
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 2rem; }
.stat { text-align: left; padding-top: 1.5rem; border-top: 2px solid var(--accent); }
.stat .num { font-size: clamp(2.4rem, 5vw, 3.6rem); font-weight: 900; color: #fff; line-height: 0.95; letter-spacing: -0.03em; }
.section-dark .stat .num { color: #fff; }
.stat .lbl { font-size: 0.76rem; text-transform: uppercase; letter-spacing: 0.14em; color: var(--muted); margin-top: 0.85rem; font-weight: 600; }
.section-dark .stat .lbl { color: rgba(255,255,255,0.6); }

/* capability rows */
.cap {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 3rem;
  padding: 2.75rem 0;
  border-top: 1px solid var(--line);
}
.cap:last-child { border-bottom: 1px solid var(--line); }
.cap h3 { color: var(--ink); font-size: 1.5rem; margin: 0; }
.cap-link {
  display: inline-flex;
  align-items: center;
  gap: 0.7rem;
  color: var(--ink);
  text-decoration: underline;
  text-decoration-thickness: 2px;
  text-underline-offset: 6px;
  text-decoration-color: rgba(212, 128, 27, 0.32);
  transition: color 0.18s ease, text-decoration-color 0.18s ease;
}
.cap-link::after {
  content: "\2192";
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: rgba(212, 128, 27, 0.12);
  color: var(--accent);
  font-size: 1.05rem;
  font-weight: 700;
  line-height: 1;
  flex: none;
  transition: background 0.18s ease, color 0.18s ease, transform 0.18s ease;
}
.cap-link:hover { color: var(--accent); text-decoration-color: var(--accent); }
.cap-link:hover::after { background: var(--accent); color: #fff; transform: translateX(4px); }
.cap .cap-label { color: var(--accent); font-weight: 800; font-size: 0.8rem; letter-spacing: 0.14em; display: block; margin-bottom: 0.4rem; }

/* spec table */
.spec-table { width: 100%; border-collapse: collapse; margin-top: 1rem; }
.spec-table th, .spec-table td {
  text-align: left;
  padding: 1rem 1rem;
  border-bottom: 1px solid var(--line-dark);
  font-size: 0.95rem;
}
.section-dark .spec-table th { background: transparent; color: #fff; font-weight: 700; border-bottom-color: var(--accent); }
.section-dark .spec-table td { color: rgba(255,255,255,0.82); }
.spec-table tr:hover td { color: #fff; }
/* light-context spec table (credentials surety) */
section:not(.section-dark) .spec-table th { background: var(--bg-alt); color: var(--ink); font-weight: 700; border-bottom: 1px solid var(--line); }
section:not(.section-dark) .spec-table td { border-bottom: 1px solid var(--line); }

/* portfolio cases */
.case-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1.75rem; }
.case {
  border: 1px solid var(--line);
  border-radius: 3px;
  overflow: hidden;
  background: #fff;
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}
.case:hover { transform: translateY(-4px); box-shadow: 0 24px 50px -30px rgba(10,31,51,0.5); }
.case .ph {
  height: 230px;
  background: repeating-linear-gradient(135deg, #e6ebf0 0 18px, #eef2f5 18px 36px);
  display: flex; align-items: center; justify-content: center;
  color: var(--muted); font-size: 0.74rem; letter-spacing: 0.18em; text-transform: uppercase;
}
.case .case-img { width: 100%; height: 230px; object-fit: cover; display: block; transition: transform 0.6s ease; }
.case:hover .case-img { transform: scale(1.05); }
.case .case-body { padding: 1.75rem; }
.case .case-body h3 { margin-bottom: 0.4rem; }
.case .meta { font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.14em; color: var(--accent); font-weight: 700; margin-bottom: 0.7rem; }
.case .meta span { color: var(--muted); }
.section-dark .case-body h3 { color: var(--ink); }  /* keep titles dark on white cards */

/* credentials */
.cred-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1.5rem; }
.cred {
  border-left: 3px solid var(--accent);
  background: var(--bg-alt);
  padding: 1.75rem 2rem;
  border-radius: 0 3px 3px 0;
}
.cred h3 { margin-bottom: 0.35rem; font-size: 1.05rem; }
.cred .val { font-weight: 800; color: var(--ink); font-size: 1.1rem; letter-spacing: -0.01em; }
.cred p { font-size: 0.93rem; margin-bottom: 0; color: var(--body); }

/* ---------- Forms ---------- */
.form-card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 3px;
  padding: clamp(1.85rem, 4vw, 3rem);
  border-top: 3px solid var(--accent);
}
.field { margin-bottom: 1.35rem; }
.field label {
  display: block;
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink);
  margin-bottom: 0.5rem;
}
.field input, .field select, .field textarea {
  width: 100%;
  padding: 0.8rem 0.9rem;
  border: 1px solid var(--line);
  border-radius: 2px;
  font-family: var(--font);
  font-size: 0.97rem;
  color: var(--ink);
  background: #fff;
}
.field input:focus, .field select:focus, .field textarea:focus {
  outline: none; border-color: var(--steel);
  box-shadow: 0 0 0 3px rgba(41,75,104,0.12);
}
.field textarea { resize: vertical; min-height: 140px; }
.field .req { color: var(--accent); }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 1.35rem; }
.form-note { font-size: 0.82rem; color: var(--muted); margin-top: 0.5rem; }
.form-note-inline { font-weight: 400; font-size: 0.8rem; color: var(--muted); }
.field input[type="file"] { padding: 0.6rem; border-style: dashed; background: var(--bg-alt); cursor: pointer; }

/* ---------- Tools: Voltage Drop Calculator ---------- */
.calc {
  display: grid;
  grid-template-columns: 1.25fr 1fr;
  gap: 2.5rem;
  align-items: start;
  margin-top: 2.5rem;
}
.calc-form {
  background: var(--bg-alt);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 2rem 2rem 0.75rem;
}
.calc-form .field input, .calc-form .field select { background: #fff; }
.calc-sub { font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.1em; color: var(--muted); font-weight: 700; margin: 0 0 1.1rem; }
.hp-field { display: none !important; }
/* collapsible form sections (residential calc) */
.calc-toggle { cursor: pointer; display: flex; align-items: center; justify-content: space-between; gap: 0.6rem; user-select: none; padding: 0.4rem 0; border-bottom: 1px solid var(--line); }
.calc-toggle::after { content: "\2212"; color: var(--accent); font-weight: 800; font-size: 1.1rem; line-height: 1; }
.calc-toggle.collapsed::after { content: "\002B"; }
.calc-toggle:hover { color: var(--ink); }
.calc-toggle:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.calc-check { display: flex; align-items: center; gap: 0.6rem; font-size: 0.92rem; color: var(--ink); margin-bottom: 1.35rem; cursor: pointer; }
.calc-check input { width: auto; accent-color: var(--accent); }
/* appliance rows: item + quantity (or item + size + quantity) */
.appl-row { display: grid; grid-template-columns: 1fr 92px; gap: 1rem; }
.appl-row--3 { grid-template-columns: 1fr 1fr 92px; }
.appl-row .field.qty { min-width: 0; }
@media (max-width: 540px) {
  .appl-row, .appl-row--3 { grid-template-columns: 1fr 1fr; }
}
/* dynamic "additional loads" rows */
.rlc-head { display: grid; grid-template-columns: 1fr 92px 60px 34px; gap: 0.55rem; font-size: 0.68rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); font-weight: 700; margin-bottom: 0.45rem; }
.rlc-row, .grc-row { display: grid; grid-template-columns: 1fr 92px 60px 34px; gap: 0.55rem; margin-bottom: 0.55rem; align-items: center; }
.rlc-row input, .grc-row input { width: 100%; padding: 0.7rem 0.75rem; border: 1px solid var(--line); border-radius: 2px; font-family: var(--font); font-size: 0.95rem; color: var(--ink); background: #fff; }
.rlc-row input:focus, .grc-row input:focus { outline: none; border-color: var(--steel); box-shadow: 0 0 0 3px rgba(41, 75, 104, 0.12); }
.rlc-del { background: none; border: 1px solid var(--line); border-radius: 4px; color: var(--muted); font-size: 1.1rem; line-height: 1; cursor: pointer; padding: 0.35rem 0; }
.rlc-del:hover { border-color: #c8463a; color: #c8463a; }
.btn-add { background: transparent; border: 1px dashed var(--accent); color: var(--accent); border-radius: 4px; font-family: var(--font); font-weight: 700; font-size: 0.85rem; padding: 0.6rem 1.1rem; cursor: pointer; margin: 0.2rem 0 0.5rem; }
.btn-add:hover { background: rgba(212, 128, 27, 0.08); }
@media (max-width: 540px) { .rlc-head { display: none; } .rlc-row, .grc-row { grid-template-columns: 1fr 70px 50px 30px; } }

/* worked calculation block */
.calc-math-wrap { margin-top: 2.5rem; }
.calc-math-head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-bottom: 0.85rem; }
.calc-math-head h3 { margin: 0; font-size: 1.15rem; }
.btn-copy {
  background: var(--accent); color: #fff; border: 0; border-radius: 4px;
  font-family: var(--font); font-weight: 700; font-size: 0.8rem; letter-spacing: 0.04em;
  padding: 0.55rem 1.1rem; cursor: pointer; white-space: nowrap; transition: background 0.18s ease;
}
.btn-copy:hover { background: var(--accent-2); }
.calc-math {
  background: #0d2030; color: #e7eef4; border-radius: 6px; margin: 0;
  padding: 1.5rem 1.6rem; overflow-x: auto;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
  font-size: 0.82rem; line-height: 1.65; white-space: pre; tab-size: 2;
}

/* panel schedule */
.ps-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin: 2.5rem 0 1rem; flex-wrap: wrap; }
.ps-toolbar h3 { margin: 0; font-size: 1.15rem; }
.ps-actions { display: flex; gap: 0.6rem; }
.ps-copy { background: var(--navy); }
.ps-copy:hover { background: #16314a; }
.ps-tablewrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 6px; }
.ps-table { width: 100%; border-collapse: collapse; font-size: 0.82rem; min-width: 760px; }
.ps-table th { background: var(--navy); color: #fff; font-size: 0.64rem; text-transform: uppercase; letter-spacing: 0.07em; padding: 0.55rem 0.4rem; font-weight: 700; }
.ps-table td { border-bottom: 1px solid var(--line); padding: 0.25rem 0.35rem; }
.ps-table tbody tr:nth-child(even) td { background: var(--bg-alt); }
.ps-ckt { text-align: center; font-weight: 800; color: var(--navy); width: 34px; }
.ps-ph { text-align: center; font-weight: 700; color: var(--accent); width: 24px; }
.ps-div, th.ps-div { width: 8px; background: var(--navy) !important; padding: 0 !important; border: 0; }
.ps-table select, .ps-table input { width: 100%; border: 1px solid var(--line); border-radius: 3px; padding: 0.4rem; font-family: var(--font); font-size: 0.82rem; color: var(--ink); background: #fff; }
.ps-table select.ps-bkr { width: 112px; }
.ps-table select.ps-pole { width: 48px; }
.ps-table input.ps-va { width: 66px; }
.ps-desccell { min-width: 180px; }
.ps-table tr.ps-tandem-sep td { background: var(--navy); color: #fff; font-size: 0.62rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.08em; text-align: center; padding: 0.35rem 0.5rem; }
.ps-table tr.ps-tandem-row .ps-ckt { color: var(--accent); }
/* tandem: stacked 2nd circuit box on the same space line */
.ps-table td input.ps-va, .ps-table td input.ps-desc { display: block; }
.ps-table td input.ps-tan2 { margin-top: 3px; border-top: 1px dashed var(--accent); }
.ps-ckt .ps-n1, .ps-ckt .ps-n2 { display: block; line-height: 1.35; }
.ps-ckt.is-tandem .ps-n2 { color: var(--accent); }
/* spaces consumed by a multi-pole (2P/3P) breaker above */
.ps-ckt.is-consumed .ps-n1 { color: var(--muted); opacity: 0.5; }
.ps-table select:disabled, .ps-table input:disabled { background: #eef1f3; color: #aab2ba; cursor: not-allowed; }
/* multi-pole breaker: its cells merge across the spaces it occupies */
.ps-table td.ps-span { vertical-align: middle; background: rgba(212,128,27,0.06); border-left: 2px solid var(--accent); }
.ps-table td.ps-span.ps-desccell { border-left: 0; border-right: 2px solid var(--accent); }
.ps-printhead { display: none; }
.ps-printfoot { display: none; }
.ps-text-wrap { margin-top: 1.5rem; }
.ps-text-wrap summary { cursor: pointer; font-weight: 700; color: var(--steel); font-size: 0.9rem; margin-bottom: 0.75rem; }
.ps-hint { font-size: 0.8rem; color: var(--muted); font-weight: 400; }
.ps-ckt[draggable="true"] { cursor: grab; }
.ps-ckt[draggable="true"]:active { cursor: grabbing; }
.ps-import { display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap; background: rgba(212, 128, 27, 0.12); border: 1px solid var(--accent); border-radius: 6px; padding: 0.85rem 1.1rem; margin: 1.5rem 0 0; font-size: 0.92rem; color: var(--ink); }
.ps-import[hidden] { display: none; }
.ps-import-btns { display: flex; gap: 0.6rem; }
/* subpanel blocks in the load calculator */
.rl-subpanel { border: 1px solid var(--line); border-radius: 6px; padding: 1.25rem 1.25rem 0.4rem; margin-bottom: 1.25rem; background: #fff; }
.rl-subpanel[hidden] { display: none; }
.rl-sub-actions { display: flex; gap: 0.6rem; flex-wrap: wrap; margin: 0.3rem 0 0.85rem; }

/* ---------- Code Assistant ---------- */
.code-bar { display: flex; align-items: center; gap: 1rem; flex-wrap: wrap; margin-bottom: 1rem; }
.code-edition { font-size: 0.8rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; color: var(--ink); display: inline-flex; align-items: center; gap: 0.5rem; }
.code-edition select { padding: 0.45rem 0.6rem; border: 1px solid var(--line); border-radius: 4px; font-family: var(--font); font-size: 0.9rem; background: #fff; color: var(--ink); }
.code-bar-note { font-size: 0.82rem; color: var(--muted); }
.code-chat { border: 1px solid var(--line); border-radius: 8px; overflow: hidden; background: #fff; }
.code-log { padding: 1.25rem; max-height: 460px; overflow-y: auto; display: flex; flex-direction: column; gap: 1rem; background: var(--bg-alt); }
.code-msg { max-width: 88%; }
.code-msg--user { align-self: flex-end; text-align: right; }
.code-msg--assistant { align-self: flex-start; }
.code-msg-who { display: block; font-size: 0.66rem; text-transform: uppercase; letter-spacing: 0.12em; font-weight: 700; color: var(--muted); margin-bottom: 0.3rem; }
.code-msg-body { display: inline-block; text-align: left; padding: 0.8rem 1rem; border-radius: 10px; font-size: 0.95rem; line-height: 1.6; white-space: pre-wrap; }
.code-msg--assistant .code-msg-body { background: #fff; border: 1px solid var(--line); color: var(--ink); }
.code-msg--user .code-msg-body { background: var(--navy); color: #fff; }
.code-msg--error .code-msg-body { background: rgba(206, 70, 58, 0.12); border-color: #c8463a; color: #8a2f25; }
.code-typing .code-msg-body { color: var(--muted); }
.code-input-row { display: flex; gap: 0.6rem; padding: 0.85rem; border-top: 1px solid var(--line); background: #fff; }
.code-input-row textarea { flex: 1; resize: vertical; min-height: 48px; max-height: 200px; padding: 0.7rem 0.85rem; border: 1px solid var(--line); border-radius: 6px; font-family: var(--font); font-size: 0.97rem; color: var(--ink); }
.code-input-row textarea:focus { outline: none; border-color: var(--steel); box-shadow: 0 0 0 3px rgba(41, 75, 104, 0.12); }
.code-input-row .btn { align-self: stretch; padding: 0 1.4rem; }
.code-examples { display: flex; align-items: center; flex-wrap: wrap; gap: 0.5rem; padding: 0.85rem; border-top: 1px solid var(--line); }
.code-ex-label { font-size: 0.78rem; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: 0.08em; }
.code-chip { background: rgba(212, 128, 27, 0.1); border: 1px solid rgba(212, 128, 27, 0.4); color: var(--accent); border-radius: 999px; padding: 0.4rem 0.85rem; font-family: var(--font); font-size: 0.82rem; font-weight: 600; cursor: pointer; transition: background 0.15s ease; }
.code-chip:hover { background: rgba(212, 128, 27, 0.2); }

/* skip-to-content link (visually hidden until focused) */
.skip-link { position: absolute; left: -9999px; top: 0; z-index: 2000; background: var(--accent); color: #fff; padding: 0.65rem 1.1rem; font-weight: 700; border-radius: 0 0 4px 0; text-decoration: none; }
.skip-link:focus { left: 0; }

@page { size: letter portrait; margin: 0.5in; }
@media print {
  .site-header, .site-footer, .aes-chat-launcher, .page-head, .section-dark,
  .calc-note, .cta-band, .calc-form, .calc-out, .ps-toolbar, .ps-text-wrap,
  .ps-import, .section-head, .skip-link { display: none !important; }
  body { background: #fff; color: #111; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  section { padding: 0 !important; }
  .wrap { max-width: none; padding: 0; }

  /* ---- Document title block / letterhead ---- */
  .ps-printhead { display: block; margin: 0 0 0.16in; }
  .ps-doc-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 1rem;
    border-bottom: 2.5px solid #111; padding-bottom: 7px; margin-bottom: 10px; }
  .ps-doc-co-name { font-size: 15px; font-weight: 800; letter-spacing: 0.02em; color: #111; text-transform: uppercase; line-height: 1.1; }
  .ps-doc-co-sub { font-size: 8px; color: #444; margin-top: 2px; letter-spacing: 0.02em; }
  .ps-doc-title { text-align: right; white-space: nowrap; }
  .ps-doc-title-label { font-size: 8px; text-transform: uppercase; letter-spacing: 0.16em; color: #666; }
  .ps-doc-title-id { font-size: 22px; font-weight: 800; color: #111; line-height: 1.05; }

  /* ---- Panel info grid ---- */
  .ps-ph-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0; border: 1px solid #111; margin-bottom: 11px; }
  .ps-ph-grid > div { padding: 4px 9px; border-right: 1px solid #cfcfcf; border-bottom: 1px solid #cfcfcf; }
  .ps-ph-grid > div:nth-child(3n) { border-right: 0; }
  .ps-ph-grid > div:nth-last-child(-n+3) { border-bottom: 0; }
  .ps-ph-grid span { display: block; font-size: 7px; text-transform: uppercase; letter-spacing: 0.07em; color: #777; }
  .ps-ph-grid strong { font-size: 11px; color: #111; font-weight: 700; }

  /* ---- Circuit schedule table ---- */
  .ps-tablewrap { border: 0; overflow: visible; }
  .ps-table { min-width: 0; width: 100%; font-size: 8.5px; border: 1px solid #111; border-collapse: collapse; }
  .ps-table th { background: #1b1b1b !important; color: #fff !important; font-size: 7px; letter-spacing: 0.04em;
    padding: 3px 2px; border-right: 1px solid #555; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .ps-table td { border-bottom: 1px solid #c4c4c4; border-right: 1px solid #e0e0e0; padding: 1.5px 3px; color: #111; height: 13px; }
  .ps-table tbody tr:nth-child(even) td { background: #f3f3f3 !important; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .ps-table tr.ps-tandem-sep td { background: #2a2a2a !important; color: #fff !important; font-size: 6.5px; font-weight: 700;
    text-transform: uppercase; letter-spacing: 0.08em; text-align: center; padding: 2px; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .ps-table tr.ps-tandem-row .ps-ckt { background: #e3e3e3 !important; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .ps-ckt { font-weight: 800; color: #111 !important; text-align: center; }
  .ps-ph { font-weight: 700; color: #111 !important; text-align: center; background: #e9e9e9 !important;
    -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .ps-div, th.ps-div { width: 5px; min-width: 5px; background: #111 !important; padding: 0 !important; border: 0 !important;
    -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .ps-table select, .ps-table input { border: 0; background: transparent; font-size: 8.5px; padding: 0; color: #111;
    font-family: var(--font); -webkit-appearance: none; appearance: none; }
  .ps-table input::placeholder { color: transparent !important; }
  .ps-table td input.ps-va, .ps-table td input.ps-desc { display: block; }
  .ps-table td input.ps-tan2 { border-top: 0.5px dashed #999; }
  .ps-ckt .ps-n1, .ps-ckt .ps-n2 { display: block; line-height: 1.25; }
  .ps-ckt.is-consumed .ps-n1 { color: #b0b0b0; }
  .ps-table select:disabled, .ps-table input:disabled { background: #f4f4f4 !important; color: #b8b8b8; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .ps-table td.ps-span { vertical-align: middle; background: #f4ece0 !important; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .ps-desccell { min-width: 0; }

  /* ---- Totals + disclaimer footer ---- */
  .ps-printfoot { display: block; margin-top: 11px; }
  .ps-foot-loads { display: flex; flex-wrap: wrap; gap: 3px 18px; border-top: 1.5px solid #111; padding-top: 6px;
    font-size: 9px; color: #111; }
  .ps-foot-loads span { text-transform: uppercase; letter-spacing: 0.03em; color: #666; font-size: 7.5px; }
  .ps-foot-loads strong { font-weight: 800; color: #111; font-size: 9.5px; margin-left: 3px; }
  .ps-foot-meta { margin-top: 8px; font-size: 7px; color: #777; font-style: italic; line-height: 1.45; }
}
.calc-out {
  background: var(--navy);
  color: #fff;
  border-radius: 6px;
  padding: 2rem 1.9rem;
  border-top: 4px solid var(--accent);
}
.calc-pct {
  text-align: center;
  padding-bottom: 1.35rem;
  margin-bottom: 1.35rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.14);
}
.calc-pct span {
  display: block;
  font-size: clamp(2.9rem, 7vw, 4.1rem);
  font-weight: 900;
  line-height: 0.95;
  letter-spacing: -0.03em;
  color: #fff;
  transition: color 0.25s ease;
}
.calc-pct small {
  display: block;
  margin-top: 0.6rem;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  font-size: 0.7rem;
  font-weight: 700;
  color: rgba(255, 255, 255, 0.6);
}
.calc-pct.good span { color: #6fd79b; }
.calc-pct.warn span { color: var(--accent-2); }
.calc-pct.bad  span { color: #f0998e; }
.calc-stats { list-style: none; margin: 0; padding: 0; }
.calc-stats li {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 1rem;
  padding: 0.7rem 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  font-size: 0.95rem;
}
.calc-stats li:last-child { border-bottom: 0; }
.calc-stats .k { color: rgba(255, 255, 255, 0.62); }
.calc-stats .v { font-weight: 700; color: #fff; text-align: right; }
.calc-flag {
  margin: 1.3rem 0 0;
  font-size: 0.85rem;
  line-height: 1.55;
  padding: 0.8rem 1rem;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.06);
  color: rgba(255, 255, 255, 0.8);
}
.calc-flag.good { background: rgba(70, 170, 110, 0.18); color: #c4ecd3; }
.calc-flag.warn { background: rgba(212, 128, 27, 0.2); color: #f3d2a6; }
.calc-flag.bad  { background: rgba(206, 70, 58, 0.22); color: #f4bdb4; }
.calc-note {
  margin-top: 2rem;
  background: var(--bg-alt);
  border-left: 3px solid var(--accent);
  border-radius: 0 4px 4px 0;
  padding: 1.4rem 1.6rem;
  font-size: 0.88rem;
  line-height: 1.7;
  color: var(--body);
}
.calc-note p { margin: 0 0 0.85rem; }
.calc-note p:last-child { margin-bottom: 0; }
.calc-note code {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 3px;
  padding: 0.15rem 0.45rem;
  font-size: 0.92em;
  color: var(--ink);
  white-space: nowrap;
}
@media (max-width: 820px) {
  .calc { grid-template-columns: 1fr; gap: 1.75rem; }
}

/* ---------- FAQ ---------- */
.faq-list { max-width: 80ch; }
.faq-item { border-top: 1px solid var(--line); padding: 1.85rem 0; }
.faq-item:last-child { border-bottom: 1px solid var(--line); }
.faq-item h3 { margin-bottom: 0.6rem; font-size: 1.2rem; }
.faq-item p { color: var(--body); margin-bottom: 0; }
.faq-item p + p { margin-top: 0.75rem; }

/* ---------- Tabs (Careers) ---------- */
.tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.15rem;
  border-bottom: 1px solid var(--line);
  margin-bottom: 3rem;
}
.tab {
  background: transparent;
  border: none;
  border-bottom: 3px solid transparent;
  margin-bottom: -1px;
  padding: 0.95rem 1.15rem;
  font-family: var(--font);
  font-weight: 700;
  font-size: 0.8rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--muted);
  cursor: pointer;
  white-space: nowrap;
  transition: color 0.15s ease, border-color 0.15s ease;
}
.tab:hover { color: var(--ink); }
.tab.active { color: var(--ink); border-bottom-color: var(--accent); }
.tab-panel { display: none; }
.tab-panel.active { display: block; animation: fadeUp 0.4s ease both; }
.role-intro { font-size: 1.12rem; color: var(--body); max-width: 70ch; margin-bottom: 2.25rem; }
.role-intro strong { color: var(--ink); }
.apply-line {
  margin-top: 2.25rem;
  padding-top: 1.75rem;
  border-top: 1px solid var(--line);
  font-size: 0.95rem;
  color: var(--muted);
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
}
@media (max-width: 700px) {
  .tabs { flex-wrap: nowrap; overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .tab { flex: 0 0 auto; }
}

/* trade checkbox grid (subcontractor form) */
.check-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.6rem 1.5rem;
  margin-top: 0.25rem;
}
.check-grid label {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  font-size: 0.92rem;
  font-weight: 500;
  color: var(--body);
  text-transform: none;
  letter-spacing: 0;
  margin: 0;
  cursor: pointer;
}
.check-grid input[type="checkbox"] { width: auto; margin: 0; accent-color: var(--accent); }
@media (max-width: 700px) { .check-grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 480px) { .check-grid { grid-template-columns: 1fr; } }

/* contact */
.contact-grid { display: grid; grid-template-columns: 1.4fr 1fr; gap: clamp(2rem, 5vw, 4rem); align-items: start; }
.info-block { margin-bottom: 1.75rem; }
.info-block .lbl { text-transform: uppercase; letter-spacing: 0.14em; font-size: 0.7rem; font-weight: 700; color: var(--accent); margin-bottom: 0.3rem; }
.info-block .val { color: var(--ink); font-weight: 600; }

/* CTA band */
.cta-band { background: var(--navy); color: #fff; text-align: center; }
.cta-band::before { content: ""; display: block; width: 60px; height: 3px; background: var(--accent); margin: 0 auto 2rem; }
.cta-band h2 { color: #fff; }
.cta-band p { color: rgba(255,255,255,0.8); max-width: 60ch; margin: 0 auto 2rem; }
.cta-band .btn-dark { background: var(--accent); }
.cta-band .btn-dark:hover { background: var(--accent-2); }

/* ---------- Footer ---------- */
.site-footer { background: #07182780; background: #061321; color: rgba(255,255,255,0.6); padding: 4rem 0 1.75rem; font-size: 0.9rem; }
.footer-grid { display: grid; grid-template-columns: 1.5fr 1fr 1fr 1fr; gap: 2.5rem; margin-bottom: 2.5rem; }
.site-footer h3 { color: #fff; font-size: 0.74rem; text-transform: uppercase; letter-spacing: 0.16em; margin-bottom: 1.1rem; font-weight: 700; }
.site-footer a { color: rgba(255,255,255,0.6); }
.site-footer a:hover { color: var(--accent-2); }
.site-footer ul { list-style: none; margin: 0; padding: 0; }
.site-footer li { margin-bottom: 0.55rem; }
.footer-brand .name { color: #fff; font-weight: 800; font-size: 1.1rem; }
.footer-brand p { font-size: 0.88rem; margin-top: 0.75rem; max-width: 34ch; line-height: 1.7; }
.footer-bottom {
  border-top: 1px solid rgba(255,255,255,0.12);
  padding-top: 1.5rem;
  display: flex; justify-content: space-between; flex-wrap: wrap; gap: 0.5rem;
  font-size: 0.78rem;
  letter-spacing: 0.02em;
}

/* utility */
.mt0 { margin-top: 0; }
.mb0 { margin-bottom: 0; }
.center { text-align: center; }
.lead { font-size: 1.1rem; }

/* ==========================================================================
   Photo treatments
   ========================================================================== */
:root {
  /* bottom-weighted scrim: photo shows up top, text reads at bottom */
  --hero-overlay: linear-gradient(to bottom, rgba(8,22,36,0.20) 0%, rgba(8,22,36,0.28) 28%, rgba(8,22,36,0.62) 58%, rgba(8,22,36,0.92) 100%);
  --head-overlay: linear-gradient(105deg, rgba(8,22,36,0.86) 0%, rgba(8,22,36,0.55) 60%, rgba(10,31,51,0.40) 100%);
}
/* Photo heroes/headers: the image lives on a ::before layer. It (a) slowly
   pans for ambient life and (b) parallax-scrolls via --py set by JS, while the
   text and overlay stay readable. The scale gives margin so neither reveals an
   edge. */
.hero.has-photo, .page-head.has-photo { overflow: hidden; }
.hero.has-photo > .wrap, .page-head.has-photo > .wrap { position: relative; z-index: 2; }
.hero.has-photo::before, .page-head.has-photo::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
  background-size: cover, cover;
  background-position: center, center;
  background-repeat: no-repeat, no-repeat;
  transform: translate3d(0, var(--py, 0px), 0) scale(1.18);
  animation: kbpan 34s ease-in-out infinite alternate;
  will-change: transform, background-position;
}
.hero.has-photo::before  { background-image: var(--hero-overlay), var(--photo); }
.page-head.has-photo::before { background-image: var(--head-overlay), var(--photo); }
/* pan only the photo layer (2nd value); the overlay (1st) stays put */
@keyframes kbpan {
  from { background-position: center, 47% 44%; }
  to   { background-position: center, 53% 56%; }
}
.photo-band {
  height: clamp(260px, 36vw, 440px);
  background-size: cover; background-position: center; background-repeat: no-repeat;
  position: relative;
}
.photo-band::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(10,31,51,0.1), rgba(10,31,51,0.4)); }

.media-card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 3px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}
.media-card:hover { transform: translateY(-5px); box-shadow: 0 26px 55px -32px rgba(10,31,51,0.55); }
.media-card .media { height: 220px; overflow: hidden; }
.media-card .media img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform 0.6s ease; }
.media-card:hover .media img { transform: scale(1.07); }
.media-card .body { padding: 1.85rem; border-top: 3px solid var(--accent); flex: 1; }
.media-card .body h3 { margin-bottom: 0.5rem; }
.media-card .body p { color: var(--body); font-size: 0.97rem; }
.media-card .kicker { font-size: 0.68rem; text-transform: uppercase; letter-spacing: 0.16em; color: var(--accent); font-weight: 700; display: block; margin-bottom: 0.6rem; }
.section-alt .media-card { background: #fff; }

.split-img { width: 100%; border-radius: 3px; display: block; object-fit: cover; box-shadow: 0 26px 55px -32px rgba(10,31,51,0.55); }

@keyframes fadeUp { from { opacity: 0; transform: translateY(22px); } to { opacity: 1; transform: none; } }
/* hero text slides in but stays fully visible (opacity:1) so it never delays LCP */
@keyframes heroIn { from { transform: translateY(14px); } to { transform: none; } }
.hero .eyebrow { animation: heroIn 0.6s ease both; }
.hero h1       { animation: heroIn 0.6s ease 0.07s both; }
.hero .lead    { animation: heroIn 0.6s ease 0.14s both; }
.hero-actions  { animation: heroIn 0.6s ease 0.2s both; }

/* ===== Scroll reveal (JS adds .reveal, then .in when in view) ===== */
.reveal { opacity: 0; transform: translateY(28px); transition: opacity 0.7s ease, transform 0.7s cubic-bezier(0.22, 0.7, 0.2, 1); }
.reveal.in { opacity: 1; transform: none; }

/* count-up stat pop */
.stat .num.counting { color: var(--accent); }
.stat.in .num { transition: color 0.4s ease; }

/* button lift */
.btn:hover { transform: translateY(-2px); box-shadow: 0 16px 32px -18px rgba(10, 31, 51, 0.6); }

/* 3D tilt cards — JS sets the transform on mousemove; this just smooths it */
.tilt { transform-style: preserve-3d; will-change: transform; }

/* Cursor-follow spotlight on dark sections (JS sets --mx/--my) */
.section-dark { position: relative; overflow: hidden; }
.section-dark > .wrap { position: relative; z-index: 1; }
.section-dark::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background: radial-gradient(550px circle at var(--mx, 50%) var(--my, 50%), rgba(212, 128, 27, 0.18), rgba(212, 128, 27, 0) 60%);
  opacity: 0;
  transition: opacity 0.45s ease;
}
.section-dark:hover::before { opacity: 1; }

@media (prefers-reduced-motion: reduce) {
  .hero .eyebrow, .hero h1, .hero .lead, .hero-actions { animation: none; }
  .hero::after { animation: none; }
  .hero.has-photo::before, .page-head.has-photo::before { animation: none; transform: none; }
  .media-card:hover .media img, .case:hover .case-img { transform: none; }
  .reveal { opacity: 1 !important; transform: none !important; transition: none !important; }
  .section-dark:hover::before { opacity: 0; }
  .btn:hover { transform: none; }
}

/* ==========================================================================
   AI chat widget
   ========================================================================== */
.aes-chat-launcher {
  position: fixed; right: 22px; bottom: 22px; z-index: 200;
  background: var(--accent); color: #fff; border: none;
  font-family: var(--font); font-weight: 700; font-size: 0.82rem;
  letter-spacing: 0.08em; text-transform: uppercase;
  padding: 0.9rem 1.4rem; border-radius: 999px;
  box-shadow: 0 12px 30px -8px rgba(10,31,51,0.6); cursor: pointer;
  transition: transform 0.15s ease, background 0.15s ease;
}
.aes-chat-launcher:hover { background: var(--accent-2); transform: translateY(-2px); }
.aes-chat-nudge {
  position: fixed; right: 22px; bottom: 74px; z-index: 200;
  max-width: 260px; display: none; align-items: flex-start; gap: 0.4rem;
  background: #fff; color: var(--ink); border: 1px solid var(--line);
  border-left: 3px solid var(--accent); border-radius: 8px;
  padding: 0.7rem 0.6rem 0.7rem 0.8rem; cursor: pointer;
  box-shadow: 0 12px 30px -10px rgba(10,31,51,0.5);
  font-size: 0.86rem; line-height: 1.4;
}
.aes-chat-nudge.show { display: flex; animation: aesNudgeIn 0.25s ease both; }
.aes-nudge-text { flex: 1; }
.aes-nudge-close { background: transparent; border: none; color: var(--muted); font-size: 1.1rem; line-height: 1; cursor: pointer; padding: 0 0.15rem; }
.aes-nudge-close:hover { color: var(--accent); }
@keyframes aesNudgeIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }
.aes-chat-panel {
  position: fixed; right: 22px; bottom: 22px; z-index: 201;
  width: min(380px, calc(100vw - 32px));
  height: min(560px, calc(100vh - 100px));
  background: #fff; border: 1px solid var(--line); border-radius: 6px;
  box-shadow: 0 28px 70px -20px rgba(10,31,51,0.6);
  display: none; flex-direction: column; overflow: hidden;
}
.aes-chat-panel.open { display: flex; }
.aes-chat-head {
  background: var(--navy); color: #fff; padding: 1rem 1.1rem;
  display: flex; align-items: center; justify-content: space-between;
  border-bottom: 3px solid var(--accent);
}
.aes-chat-title { display: block; font-weight: 800; font-size: 1rem; }
.aes-chat-sub { display: block; font-size: 0.7rem; color: var(--accent-2); letter-spacing: 0.06em; text-transform: uppercase; }
.aes-chat-close { background: transparent; border: none; color: #fff; font-size: 1.5rem; line-height: 1; cursor: pointer; padding: 0 0.25rem; }
.aes-chat-close:hover { color: var(--accent-2); }
.aes-chat-log { flex: 1; overflow-y: auto; padding: 1rem; background: var(--bg-alt); display: flex; flex-direction: column; gap: 0.6rem; }
.aes-bubble { max-width: 85%; padding: 0.65rem 0.9rem; border-radius: 12px; font-size: 0.92rem; line-height: 1.5; white-space: pre-wrap; word-wrap: break-word; }
.aes-assistant { align-self: flex-start; background: #fff; color: var(--ink); border: 1px solid var(--line); border-bottom-left-radius: 3px; }
.aes-user { align-self: flex-end; background: var(--steel); color: #fff; border-bottom-right-radius: 3px; }
.aes-bubble-img { display: block; max-width: 100%; border-radius: 8px; margin-bottom: 0.35rem; }
.aes-bubble-img:last-child { margin-bottom: 0; }
.aes-inquiry { background: transparent; border: none; padding: 0; align-self: stretch; max-width: 100%; }
.aes-inquiry-btn { width: 100%; background: var(--accent); color: #fff; border: none; font-family: var(--font); font-weight: 700; font-size: 0.85rem; letter-spacing: 0.04em; padding: 0.7rem 1rem; border-radius: 6px; cursor: pointer; }
.aes-inquiry-btn:hover { background: var(--accent-2); }
.aes-prefill-note { background: #eef6ee; border: 1px solid #cfe6cf; color: #1f5130; border-radius: 6px; padding: 0.7rem 0.9rem; font-weight: 600; font-size: 0.92rem; margin: 0 0 1rem; }
.aes-typing { display: flex; gap: 4px; align-items: center; }
.aes-typing span { width: 7px; height: 7px; border-radius: 50%; background: var(--muted); animation: aesBlink 1.2s infinite ease-in-out both; }
.aes-typing span:nth-child(2) { animation-delay: 0.2s; }
.aes-typing span:nth-child(3) { animation-delay: 0.4s; }
@keyframes aesBlink { 0%, 80%, 100% { opacity: 0.25; } 40% { opacity: 1; } }
.aes-chat-preview { display: flex; align-items: center; gap: 0.5rem; padding: 0.5rem 0.75rem; border-top: 1px solid var(--line); background: var(--bg-alt); }
.aes-chat-preview-img { width: 40px; height: 40px; object-fit: cover; border-radius: 4px; border: 1px solid var(--line); }
.aes-chat-preview-label { flex: 1; font-size: 0.78rem; color: var(--muted); }
.aes-chat-preview-remove { background: transparent; border: none; color: var(--muted); font-size: 1.2rem; line-height: 1; cursor: pointer; padding: 0 0.25rem; }
.aes-chat-preview-remove:hover { color: var(--accent); }
.aes-chat-form { display: flex; gap: 0.5rem; padding: 0.75rem; border-top: 1px solid var(--line); background: #fff; }
.aes-chat-input { flex: 1; padding: 0.65rem 0.8rem; border: 1px solid var(--line); border-radius: 4px; font-family: var(--font); font-size: 0.92rem; color: var(--ink); min-width: 0; }
.aes-chat-input:focus { outline: none; border-color: var(--steel); box-shadow: 0 0 0 3px rgba(41,75,104,0.12); }
.aes-chat-photo { flex: 0 0 auto; width: 2.5rem; background: var(--bg-alt); color: var(--ink); border: 1px solid var(--line); border-radius: 4px; font-size: 1.05rem; line-height: 1; cursor: pointer; display: flex; align-items: center; justify-content: center; }
.aes-chat-photo:hover { border-color: var(--steel); }
.aes-chat-send { background: var(--accent); color: #fff; border: none; font-weight: 700; font-size: 0.82rem; text-transform: uppercase; letter-spacing: 0.06em; padding: 0 1rem; border-radius: 4px; cursor: pointer; }
.aes-chat-send:hover { background: var(--accent-2); }
.aes-chat-send:disabled, .aes-chat-input:disabled, .aes-chat-photo:disabled { opacity: 0.6; cursor: default; }
.aes-chat-disclaimer { margin: 0; padding: 0 0.75rem 0.6rem; font-size: 0.66rem; color: var(--muted); background: #fff; text-align: center; }
@media (prefers-reduced-motion: reduce) { .aes-chat-launcher:hover { transform: none; } .aes-typing span { animation: none; } .aes-chat-nudge.show { animation: none; } }

/* ==========================================================================
   Responsive
   ========================================================================== */
@media (max-width: 1240px) {
  .nav-toggle { display: block; margin-left: 0.6rem; }
  .nav-links {
    display: none;
    position: absolute;
    top: 100%; left: 0; right: 0;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    background: var(--navy);
    padding: 0.5rem var(--pad) 1.25rem;
    border-bottom: 3px solid var(--accent);
  }
  .nav-links.open { display: flex; }
  .nav-links a { padding: 0.8rem 0.25rem; font-size: 0.85rem; }
  .nav-links a::after { display: none; }
  .nav-links a.cta { margin: 0.5rem 0 0; text-align: center; padding: 0.8rem; }
  .nav-links .has-sub > a { display: flex; align-items: center; justify-content: space-between; }
  .nav-links .caret { display: inline-block; font-size: 0.9em; opacity: 0.9; transition: transform 0.2s ease; }
  .nav-links .has-sub.open > a .caret { transform: rotate(180deg); }
  .nav-links .subnav {
    display: none; position: static;
    background: rgba(0,0,0,0.18); border-top: none; box-shadow: none;
    min-width: 0; padding: 0.15rem 0 0.35rem; margin-top: 0.15rem; border-radius: 6px;
  }
  .nav-links .has-sub.open .subnav { display: block; }
  .nav-links .subnav a { padding: 0.6rem 0.5rem 0.6rem 1.25rem; color: rgba(255,255,255,0.78); font-size: 0.85rem; }
  .grid-3, .grid-4 { grid-template-columns: 1fr 1fr; }
  .split, .contact-grid { grid-template-columns: 1fr; }
  .stats { grid-template-columns: 1fr 1fr; }
  .cap { grid-template-columns: 1fr; gap: 0.75rem; }
  .case-grid, .cred-grid, .grid-2 { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .hero { min-height: 88vh; }
}
@media (max-width: 560px) {
  .brand-logo { height: 44px; }
  .nav-call { padding: 0.45rem 0.7rem; font-size: 0.74rem; }
}
@media (max-width: 330px) {
  .nav-call .num { display: none; }   /* icon-only tap-to-call on the smallest phones */
  .nav-call { padding: 0.5rem 0.6rem; }
}
@media (max-width: 540px) {
  .grid-3, .grid-4, .stats { grid-template-columns: 1fr; }
  .form-row { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr; }
  .hero::after { display: none; }
}

/* ---------- Legal pages (Privacy / Terms) ---------- */
.legal { max-width: 75ch; }
.legal .updated { color: var(--muted); font-size: 0.95rem; margin: 0 0 2rem; }
.legal h2 { color: var(--ink); font-size: 1.3rem; margin: 2.4rem 0 0.6rem; }
.legal h3 { color: var(--ink); font-size: 1.06rem; margin: 1.5rem 0 0.4rem; }
.legal p, .legal li { color: var(--body); line-height: 1.75; }
.legal ul { margin: 0.4rem 0 1.1rem 1.25rem; }
.legal li { margin-bottom: 0.4rem; }
.legal a { color: var(--steel); text-decoration: underline; }

/* ---------- Our Work photo gallery ---------- */
.work-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem; }
.work-tile { position: relative; margin: 0; border-radius: 14px; overflow: hidden; box-shadow: 0 18px 40px -28px rgba(10,31,51,0.5); }
.work-tile img { width: 100%; height: 300px; object-fit: cover; display: block; transition: transform 0.5s ease; }
.work-tile:hover img { transform: scale(1.05); }
.work-tile figcaption { position: absolute; left: 0; right: 0; bottom: 0; padding: 1.4rem 1rem 0.85rem; color: #fff; font-size: 0.95rem; font-weight: 600; letter-spacing: 0.01em; background: linear-gradient(to top, rgba(8,22,36,0.88), rgba(8,22,36,0)); }
@media (max-width: 760px) { .work-grid { grid-template-columns: 1fr 1fr; gap: 0.75rem; } .work-tile img { height: 220px; } }
@media (max-width: 460px) { .work-grid { grid-template-columns: 1fr; } .work-tile img { height: 240px; } }

/* ---------- Feature photo (single real photo inside a section) ---------- */
.feature-photo { margin: 0 0 1.75rem; border-radius: 14px; overflow: hidden; box-shadow: 0 24px 55px -30px rgba(0,0,0,0.55); }
.feature-photo img { width: 100%; height: auto; display: block; }
.feature-photo figcaption { font-size: 0.86rem; color: var(--muted); padding: 0.7rem 0.2rem 0; }
.section-dark .feature-photo figcaption { color: #9fb0bf; }
