/* ============================================================
   ESSI — shared design system
   One palette + one set of components for the marketing site,
   the code reference tool, and the client portal. The inspection
   app (app/) keeps its own embedded CSS but uses the SAME tokens,
   so the whole product reads as one thing.
   Palette: deep navy + brass — certificate-plate colors.
   ============================================================ */
:root {
  --navy: #0e2a47;      /* primary — headers, headings, footer   */
  --navy2: #173f6b;     /* lighter navy — links, hovers          */
  --brass: #c8a04b;     /* accent — rules, CTAs, wordmark        */
  --brass2: #e0bc6a;    /* light brass — text on navy            */
  --paper: #f7f9fb;     /* section background                    */
  --ink: #22303e;       /* body text                             */
  --faint: #5b6b7c;     /* secondary text                        */
  --line: #dfe6ee;      /* borders                               */
  --panel: #ffffff;     /* cards                                 */
  --ok: #1e7f43; --warn: #b07a12; --bad: #b3261e; --na: #8a9199;
  --brass-ink: #8a6d2f;  /* AA-contrast brass for small text on light bg */
  --max: 1080px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
/* anchor targets land below the sticky header, not under it */
[id] { scroll-margin-top: 72px; }
/* visible keyboard focus everywhere; mouse users see no change */
a:focus-visible, button:focus-visible, summary:focus-visible,
input:focus-visible, select:focus-visible, textarea:focus-visible {
  outline: 3px solid var(--navy2); outline-offset: 2px;
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { transition: none !important; }
}
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  color: var(--ink); background: #fff; line-height: 1.6; font-size: 17px;
}
h1, h2, h3 { font-family: Georgia, "Times New Roman", serif; color: var(--navy); line-height: 1.25; }
h2 { font-size: 1.75rem; margin-bottom: .75rem; }
h3 { font-size: 1.2rem; margin: 1.4rem 0 .4rem; }
p { margin-bottom: 1rem; }
a { color: var(--navy2); }
.mono { font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace; }
.wrap { max-width: var(--max); margin: 0 auto; padding: 0 20px; }
.skip { position: absolute; left: -9999px; top: 0; background: var(--navy); color: #fff; padding: .6rem 1rem; z-index: 99; }
.skip:focus { left: 0; }

/* ---------- header / nav ---------- */
header.site {
  background: var(--navy); color: #fff; position: sticky; top: 0; z-index: 50;
  border-bottom: 4px solid var(--brass); box-shadow: 0 1px 4px rgba(0,0,0,.25);
}
header.site .nav {
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  padding: .7rem 20px; max-width: var(--max); margin: 0 auto; flex-wrap: wrap;
}
.wordmark { color: #fff; text-decoration: none; line-height: 1.15; }
.wordmark .l1 { font-family: Georgia, serif; font-weight: 700; font-size: 1.15rem; letter-spacing: .14em; }
.wordmark .l2 { display: block; font-size: .62rem; letter-spacing: .24em; color: var(--brass2); text-transform: uppercase; font-weight: 700; }
header.site nav ul { display: flex; gap: 1.1rem; list-style: none; flex-wrap: wrap; align-items: center; }
header.site nav a { color: #d5e2ef; text-decoration: none; font-size: .95rem; }
header.site nav a:hover, header.site nav a:focus { color: #fff; text-decoration: underline; }
header.site nav a[aria-current="page"] { color: var(--brass2); font-weight: 700; }
.call-btn {
  background: var(--brass); color: var(--navy) !important; padding: .45rem .9rem;
  border-radius: 6px; font-weight: 700; text-decoration: none; white-space: nowrap;
}
.call-btn:hover, .call-btn:focus { background: var(--brass2); text-decoration: none; }

/* ---------- hero ---------- */
.hero { background: linear-gradient(160deg, var(--navy) 0%, #081c31 100%); color: #fff; padding: 4rem 0 3.2rem; }
.hero h1 { color: #fff; font-size: clamp(1.7rem, 4.5vw, 2.6rem); max-width: 24ch; margin-bottom: 1rem; }
.hero p.sub { color: #d4dce5; font-size: 1.15rem; max-width: 56ch; margin-bottom: 1.6rem; }
.hero .cta-row { display: flex; gap: .9rem; flex-wrap: wrap; margin-bottom: 2rem; }
.trust { display: flex; gap: 1.6rem; flex-wrap: wrap; border-top: 1px solid rgba(255,255,255,.18); padding-top: 1.2rem; list-style: none; }
.trust li { color: #e5eaf0; font-size: .95rem; display: flex; align-items: center; gap: .45rem; }
.trust .dot { width: 9px; height: 9px; border-radius: 50%; background: var(--brass); flex: none; }

/* Hero: copy left, mark right. The right half used to be empty, and the
   mark is the one thing on this page nobody else could put there.
   Specificity note (the 2026-09-08 field-app lesson, same class of bug):
   .hero-grid shares its element with .wrap, so these rules are written
   .hero .hero-grid (0-2-0) to beat .wrap (0-1-0) rather than tie it. */
.hero .hero-grid { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 2.4rem; align-items: center; }
.hero .hero-copy { min-width: 0; }
/* The two-item trust list used to sit under the buttons and absorb this
   margin; without it the hero grew a band of dead navy. */
.hero .hero-copy .cta-row { margin-bottom: 0; }
/* --brass-ink is the AA colour for small text on LIGHT backgrounds and is
   nearly invisible on navy; --brass2 is the token this palette already
   documents as "light brass — text on navy" (8.0:1 on #0e2a47). */
.hero .kicker { color: var(--brass2); }
.hero-mark { flex: none; line-height: 0; }
.hero-mark img { display: block; width: clamp(150px, 20vw, 260px); height: auto; }

/* ---------- proof band ---------- */
.proofband { background: var(--paper); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); padding: 1rem 0; }
/* 2x2, not a wrapping flex row: four items in a flex row leave the fourth
   alone on its own line at every width from 1024px up, and go ragged
   (1-1-2) around 600px. A two-column grid pairs them at every width and
   collapses to one column on a phone. Measured 2026-09-15. */
.proofband ul { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .55rem 1.6rem; list-style: none; }
.proofband li { color: var(--ink); font-size: .95rem; display: flex; align-items: center; gap: .5rem; }
.proofband li::before { content: ""; width: 9px; height: 9px; border-radius: 50%; background: var(--brass-ink); flex: none; }

/* ---------- buttons ---------- */
.btn { display: inline-block; padding: .85rem 1.5rem; border-radius: 8px; font-weight: 700; text-decoration: none; font-size: 1.05rem; border: none; cursor: pointer; font-family: inherit; }
.btn-primary { background: var(--brass); color: var(--navy); }
.btn-primary:hover, .btn-primary:focus { background: var(--brass2); }
.btn-ghost { border: 2px solid #7a8ca0; color: #fff; background: transparent; }
.btn-ghost:hover, .btn-ghost:focus { border-color: #fff; }
.btn-navy { background: var(--navy); color: #fff; }
.btn-navy:hover, .btn-navy:focus { background: var(--navy2); }

/* ---------- sections ---------- */
section { padding: 3.2rem 0; }
.alt { background: var(--paper); }
/* brass-ink: darker brass for SMALL text on light backgrounds — #c8a04b is ~2.5:1
   on white (fails WCAG AA); #8a6d2f passes at 4.9:1. Full brass stays on navy. */
.kicker { color: var(--brass-ink, #8a6d2f); font-weight: 700; text-transform: uppercase; font-size: .8rem; letter-spacing: .12em; margin-bottom: .4rem; font-family: inherit; }

/* ---------- cards ---------- */
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 1.3rem; margin-top: 1.4rem; }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 1.5rem; box-shadow: 0 1px 3px rgba(14,42,71,.06); }
.card h3 { margin-top: 0; }
.badge { display: inline-block; background: #f6ecd7; color: #8a6a24; font-size: .75rem; font-weight: 700; padding: .15rem .55rem; border-radius: 99px; margin-bottom: .6rem; text-transform: uppercase; letter-spacing: .05em; }

/* ---------- service area ---------- */
.area-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 1rem; margin-top: 1.2rem; }
.area { background: var(--panel); border: 1px solid var(--line); border-left: 4px solid var(--brass); border-radius: 6px; padding: 1rem 1.2rem; }
.area strong { color: var(--navy); }
.area small { color: var(--faint); }

/* ---------- credentials ---------- */
.creds { list-style: none; margin: 1.2rem 0; }
.creds li { padding: .55rem 0 .55rem 1.8rem; position: relative; border-bottom: 1px solid var(--line); }
.creds li::before { content: "✓"; position: absolute; left: 0; color: var(--brass-ink); font-weight: 800; }

/* ---------- FAQ ---------- */
details { border: 1px solid var(--line); border-radius: 8px; margin-bottom: .7rem; background: var(--panel); }
summary { cursor: pointer; font-weight: 700; color: var(--navy); padding: .9rem 1.1rem; list-style-position: inside; }
summary:hover { background: var(--paper); }
details[open] summary { border-bottom: 1px solid var(--line); }
details .a { padding: .9rem 1.1rem; }
details .a p:last-child { margin-bottom: 0; }

/* ---------- forms ---------- */
form .field { margin-bottom: 1rem; }
label { display: block; font-weight: 600; color: var(--navy); margin-bottom: .3rem; font-size: .95rem; }
input, textarea, select { width: 100%; padding: .7rem .8rem; border: 1px solid #9aa7b5; border-radius: 6px; font: inherit; background: #fff; }
input:focus, textarea:focus, select:focus { outline: 3px solid var(--brass); outline-offset: 1px; border-color: var(--navy); }
/* a field the visitor touched and left invalid flags red (never on pristine fields) */
input:user-invalid, textarea:user-invalid { border-color: var(--bad); }
.req { color: var(--bad); }
/* quote-form status line — set by the submit script */
.form-status { min-height: 1.4em; font-size: .95rem; margin-top: .6rem; }
.form-status.ok { color: var(--ok); font-weight: 700; }
.form-status.err { color: var(--bad); font-weight: 700; }
.contact-grid { display: grid; grid-template-columns: 1.4fr 1fr; gap: 2.2rem; margin-top: 1.4rem; }
@media (max-width: 760px) { .contact-grid { grid-template-columns: 1fr; } }
.side { background: var(--navy); color: #e5eaf0; border-radius: 10px; padding: 1.6rem; height: fit-content; }
.side h3 { color: #fff; margin-top: 0; }
.side a { color: var(--brass2); font-weight: 700; text-decoration: none; font-size: 1.1rem; }
.side a:hover, .side a:focus { text-decoration: underline; }
.side p { margin-bottom: .9rem; }
.promise { background: rgba(200,160,75,.16); border-left: 3px solid var(--brass); padding: .7rem .9rem; border-radius: 4px; font-size: .95rem; }

/* ---------- tables (portal & tools) ---------- */
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: 8px; overflow: hidden; margin-bottom: 22px; }
.panel h2 { font-size: 1.05rem; padding: 16px 20px; border-bottom: 1px solid var(--line); margin: 0; }
table { width: 100%; border-collapse: collapse; font-size: .88rem; }
th { text-align: left; font-size: .7rem; text-transform: uppercase; letter-spacing: 1px; color: var(--faint); padding: 10px 20px; background: var(--paper); border-bottom: 1px solid var(--line); }
td { padding: 12px 20px; border-bottom: 1px solid var(--paper); vertical-align: top; }
tr:last-child td { border-bottom: none; }
tbody tr.clickable { cursor: pointer; }
tbody tr.clickable:hover { background: #f2f6fa; }
.chip { display: inline-block; border-radius: 100px; padding: 3px 12px; font-weight: 700; font-size: .72rem; letter-spacing: .3px; }
.chip.ok { background: #e5f3ea; color: var(--ok); }
.chip.warn { background: #faf0d8; color: var(--warn); }
.chip.bad { background: #fae5e3; color: var(--bad); }
.chip.info { background: #e8eef5; color: var(--navy2); }

/* ---------- legal / footer ---------- */
.legal h3 { font-size: 1.05rem; }
.legal p { font-size: .92rem; color: #425062; }
footer.site { background: #081c31; color: #b9c4d0; padding: 2rem 0; font-size: .9rem; border-top: 4px solid var(--brass); }
footer.site a { color: #d4dce5; }
.foot { display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap; max-width: var(--max); margin: 0 auto; padding: 0 20px; }

@media (max-width: 860px) {
  /* One column before the mark starts squeezing the headline. */
  .hero .hero-grid { grid-template-columns: 1fr; gap: 1.6rem; justify-items: center; }
  .hero .hero-copy { justify-self: stretch; }
  .hero-mark img { width: 128px; }
}

@media (max-width: 640px) {
  .proofband ul { grid-template-columns: 1fr; }
  body { font-size: 16px; }
  .hero { padding: 2.6rem 0 2.4rem; }
  header.site nav ul { gap: .8rem; }
  section { padding: 2.4rem 0; }
}

/* ---------- Instant quote helper ---------- */
.qhelper {
  background: var(--panel); border: 1px solid var(--line);
  border-left: 4px solid var(--brass); border-radius: 10px;
  padding: 1.4rem 1.5rem; margin: 1.4rem 0 2rem;
  box-shadow: 0 1px 3px rgba(14,42,71,.06);
}
.qhelper h3 { margin: 0 0 .2rem; }
.qh-sub { color: var(--faint); margin: 0 0 1rem; }
.qh-fields { display: flex; flex-wrap: wrap; gap: 1rem; margin-bottom: 1rem; }
.qh-fields label { display: flex; flex-direction: column; font-weight: 700; color: var(--navy); font-size: .9rem; gap: .3rem; flex: 1 1 160px; }
.qh-fields select, .qh-fields input {
  font: inherit; padding: .6rem .7rem; border: 1px solid var(--line);
  border-radius: 6px; background: #fff; color: var(--ink); font-weight: 400;
}
.qh-result { margin-top: 1.2rem; padding-top: 1rem; border-top: 1px dashed var(--line); }
.qh-result ul { margin: .6rem 0; padding-left: 1.1rem; }
.qh-result li { margin-bottom: .35rem; }
.qh-cta-line { margin: 1rem 0 .6rem; }
.qh-note { color: var(--faint); font-size: .82rem; margin: .6rem 0 0; }
.calendly-btn { display: inline-block; margin: .2rem 0 .6rem; }
