/* Summit Polygraph Idaho
   Colors come from the logo: the blue peak line and the red underline. */
:root {
  --ink: #141619;
  --text: #2b3138;
  --muted: #5d6773;
  --line: #dde3ea;
  --bg: #ffffff;
  --tint: #f2f5f9;
  --blue: #2f64a8;
  --blue-dark: #1f4b84;
  --red: #b8262e;
  --red-dark: #961e25;
  --navy: #0e1a2b;
  --navy-2: #16253a;
  --on-navy: #c3ccd8;
  --red-bright: #e0474f;
  --blue-bright: #6fa3e6;
  --display: "Archivo", "Helvetica Neue", Arial, sans-serif;
  --body: "Source Sans 3", "Segoe UI", Roboto, Arial, sans-serif;
  --wrap: 1120px;
  --radius: 6px;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body { margin: 0; background: var(--bg); color: var(--text); font-family: var(--body); font-size: 18px; line-height: 1.6; }
img { max-width: 100%; height: auto; display: block; }
a { color: var(--blue); }
a:hover { color: var(--blue-dark); }
:focus-visible { outline: 3px solid var(--blue); outline-offset: 2px; }
h1, h2, h3 { font-family: var(--display); color: var(--ink); line-height: 1.15; margin: 0; text-wrap: balance; }
h1 { font-size: clamp(2rem, 4.6vw, 3.1rem); font-weight: 800; letter-spacing: -0.015em; }
h2 { font-size: clamp(1.6rem, 3vw, 2.2rem); font-weight: 750; letter-spacing: -0.01em; }
h3 { font-size: 1.2rem; font-weight: 700; }
p { margin: 0; }

.wrap { max-width: var(--wrap); margin: 0 auto; padding-left: max(20px, env(safe-area-inset-left)); padding-right: max(20px, env(safe-area-inset-right)); }
.section { padding-block: 96px; }
.section.tint { background: var(--tint); }
.stack { display: grid; gap: 16px; }
.lead { font-size: 1.2rem; color: var(--muted); max-width: 62ch; }
.eyebrow { font-family: var(--display); font-size: 0.8rem; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase; color: var(--red); }
.section-head { display: grid; gap: 12px; margin-bottom: 36px; max-width: 70ch; }

.skip { position: absolute; left: -9999px; top: 0; background: var(--ink); color: #fff; padding: 10px 16px; z-index: 100; }
.skip:focus { left: 12px; top: 12px; }

/* Buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 10px; font-family: var(--display); font-weight: 700; font-size: 1rem; text-decoration: none; padding: 14px 22px; border-radius: var(--radius); border: 2px solid transparent; cursor: pointer; line-height: 1.2; }
.btn svg { width: 18px; height: 18px; flex: none; }
.btn-red { background: var(--red); color: #fff; }
.btn-red:hover { background: var(--red-dark); color: #fff; }
.btn-outline { border-color: var(--ink); color: var(--ink); background: transparent; }
.btn-outline:hover { background: var(--ink); color: #fff; }
.btn-ghost { border-color: rgba(255, 255, 255, 0.55); color: #fff; background: transparent; }
.btn-ghost:hover { background: #fff; color: var(--navy); }
.btn { transition: background-color 0.2s, color 0.2s, transform 0.2s; }
.btn:hover { transform: translateY(-1px); }
.btn-row { display: flex; flex-wrap: wrap; gap: 12px; }

/* Header */
.site-header { border-bottom: 1px solid rgba(20, 22, 25, 0.08); background: rgba(255, 255, 255, 0.86); -webkit-backdrop-filter: saturate(160%) blur(14px); backdrop-filter: saturate(160%) blur(14px); position: sticky; top: 0; z-index: 50; }
.header-inner { display: flex; align-items: center; justify-content: space-between; gap: 16px 28px; flex-wrap: wrap; padding-block: 12px; }
.brand img { width: 170px; }
.nav { display: flex; gap: 4px 24px; flex-wrap: wrap; align-items: center; }
.nav a { font-family: var(--display); font-weight: 600; font-size: 0.98rem; color: var(--ink); text-decoration: none; padding: 6px 0; border-bottom: 2px solid transparent; }
.nav a:hover { border-bottom-color: var(--blue); }
.nav a[aria-current="page"] { border-bottom-color: var(--red); }
.header-call { padding: 10px 16px; font-size: 0.95rem; }

/* Hero: dark chart paper with live polygraph tracks */
.hero-dark { position: relative; overflow: hidden; color: #fff; padding-block: 112px 56px;
  background-color: var(--navy);
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.09) 1px, transparent 1px);
  background-size: 100% 28px, 28px 100%, 140px 100%; }
.hero-dark::after { content: ""; position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(90deg, var(--navy) 0%, rgba(14, 26, 43, 0.92) 34%, rgba(14, 26, 43, 0.25) 72%, rgba(14, 26, 43, 0.55) 100%); }
.chart { position: absolute; inset: 40px 0 auto; width: 100%; height: 340px; }
.chart path { fill: none; stroke-width: 2.2; stroke-linejoin: round; stroke-linecap: round; }
.chart .track { animation: drift 48s linear infinite; }
.chart .draw { stroke-dasharray: 1; stroke-dashoffset: 1; animation: draw 2.8s cubic-bezier(.4, 0, .2, 1) forwards; }
@keyframes draw { to { stroke-dashoffset: 0; } }
@keyframes drift { to { transform: translateX(-1200px); } }
.hero-inner { position: relative; z-index: 1; display: grid; gap: 72px; }
.hero-text { display: grid; gap: 24px; max-width: 640px; }
.hero-dark h1 { color: #fff; font-size: clamp(2.4rem, 5.6vw, 4rem); }
.hero-dark .eyebrow { color: var(--red-bright); }
.hero-dark .lead { color: var(--on-navy); }

/* Credentials, along the bottom of the hero */
.creds { list-style: none; margin: 0; padding: 28px 0 0; display: grid; grid-template-columns: repeat(4, 1fr); gap: 24px; border-top: 1px solid rgba(255, 255, 255, 0.14); }
.creds li { display: grid; gap: 4px; align-content: start; }
.creds strong { font-family: var(--display); font-size: 1.35rem; font-weight: 750; color: #fff; }
.creds span { font-size: 0.95rem; color: var(--on-navy); line-height: 1.4; }

/* Services */
.services { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 20px; }
.service { position: relative; background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: 28px; display: grid; gap: 10px; align-content: start; transition: transform 0.25s, box-shadow 0.25s, border-color 0.25s; }
.service::before { content: ""; position: absolute; left: 28px; right: 28px; top: -1px; height: 3px; background: var(--red); transform: scaleX(0); transform-origin: left; transition: transform 0.3s; }
.service:hover { transform: translateY(-4px); box-shadow: 0 18px 40px -18px rgba(14, 26, 43, 0.35); border-color: transparent; }
.service:hover::before { transform: scaleX(1); }
.service p { color: var(--muted); }
.service a { font-family: var(--display); font-weight: 650; font-size: 0.95rem; text-decoration: none; }
.service a::after { content: ""; position: absolute; inset: 0; border-radius: 10px; }
.service a span { display: inline-block; transition: transform 0.2s; }
.service:hover a span { transform: translateX(4px); }

.service-detail { display: grid; grid-template-columns: 280px 1fr; gap: 32px; padding-block: 32px; border-top: 1px solid var(--line); }
.service-detail:first-of-type { border-top: none; padding-top: 0; }
.service-detail > div { display: grid; gap: 12px; min-width: 0; }
.service-detail ul { margin: 0; padding-left: 1.2em; display: grid; gap: 4px; }

/* Steps */
.steps { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(4, 1fr); gap: 24px; counter-reset: step; }
.steps li { counter-increment: step; display: grid; gap: 8px; align-content: start; }
.steps li::before { content: counter(step); font-family: var(--display); font-weight: 800; font-size: 1rem; color: #fff; background: var(--blue); width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; }
.steps p { color: var(--muted); font-size: 1rem; }

/* About */
.about-grid { display: grid; grid-template-columns: 0.8fr 1.2fr; gap: 56px; align-items: start; }
.about-grid img { border-radius: 10px; }
.portrait { margin: 0; max-width: 400px; position: relative; }
.portrait img { box-shadow: 16px 16px 0 -2px #fff, 16px 16px 0 0 var(--red); }
.portrait figcaption { margin-top: 30px; font-size: 0.95rem; color: var(--muted); }
.portrait figcaption strong { color: var(--ink); font-family: var(--display); }
.checklist { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.checklist li { padding-left: 30px; position: relative; }
.checklist li::before { content: ""; position: absolute; left: 0; top: 0.42em; width: 16px; height: 9px; border-left: 3px solid var(--red); border-bottom: 3px solid var(--red); transform: rotate(-45deg); }

.members { display: flex; flex-wrap: wrap; gap: 28px 40px; align-items: center; }
.members figure { margin: 0; display: grid; gap: 8px; justify-items: center; text-align: center; width: 150px; }
.members img { width: 110px; height: 110px; object-fit: contain; }
.members figcaption { font-size: 0.85rem; color: var(--muted); line-height: 1.35; }

/* Office */
.office-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 48px; align-items: center; }
.office-grid img { border-radius: var(--radius); aspect-ratio: 4 / 3; object-fit: cover; width: 100%; }
.address { font-style: normal; font-size: 1.15rem; line-height: 1.5; }

/* FAQ */
.faq { display: grid; gap: 12px; max-width: 820px; }
.faq details { border: 1px solid var(--line); border-radius: var(--radius); background: #fff; }
.faq summary { cursor: pointer; padding: 18px 22px; font-family: var(--display); font-weight: 700; font-size: 1.08rem; color: var(--ink); list-style: none; display: flex; justify-content: space-between; gap: 16px; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; font-size: 1.4rem; line-height: 1; color: var(--blue); }
.faq details[open] summary::after { content: "–"; }
.faq details > p { padding: 0 22px 20px; color: var(--muted); }

/* Contact */
.contact-grid { display: grid; grid-template-columns: 0.9fr 1.1fr; gap: 56px; align-items: start; }
.call-card { background: var(--navy); color: #fff; border-radius: var(--radius); padding: 28px; display: grid; gap: 14px; }
.call-card h3 { color: #fff; }
.call-card .phone { font-family: var(--display); font-size: 1.9rem; font-weight: 800; color: #fff; text-decoration: none; letter-spacing: -0.01em; }
.call-card p { color: var(--on-navy); }
.call-card a:not(.phone) { color: #fff; }
form { display: grid; gap: 16px; }
.field { display: grid; gap: 6px; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
label { font-family: var(--display); font-weight: 600; font-size: 0.95rem; color: var(--ink); }
input, select, textarea { font: inherit; font-size: 1rem; color: var(--ink); background: #fff; border: 1px solid #b9c3ce; border-radius: var(--radius); padding: 12px 14px; width: 100%; }
input:focus, select:focus, textarea:focus { outline: 3px solid rgba(47, 100, 168, 0.35); border-color: var(--blue); }
textarea { min-height: 130px; resize: vertical; }
.hp { position: absolute; left: -9999px; }
.form-note { font-size: 0.9rem; color: var(--muted); }
.form-status { font-weight: 600; }
.form-status.ok { color: #1f6b3d; }
.form-status.err { color: var(--red); }

/* Page header (inner pages) */
.page-head { color: #fff; padding-block: 80px 72px;
  background-color: var(--navy);
  background-image: linear-gradient(rgba(255, 255, 255, 0.045) 1px, transparent 1px), linear-gradient(90deg, rgba(255, 255, 255, 0.045) 1px, transparent 1px);
  background-size: 100% 28px, 28px 100%; }
.page-head .stack { max-width: 70ch; }
.page-head h1 { color: #fff; }
.page-head .eyebrow { color: var(--red-bright); }
.page-head .lead { color: var(--on-navy); }
.page-head a { color: #fff; }

/* Gentle fade-in for sections below the fold (added by main.js) */
.reveal { opacity: 0; transform: translateY(18px); transition: opacity 0.7s ease, transform 0.7s ease; }
.reveal.in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; transition: none; }
  .chart .track { animation: none; }
  .chart .draw { animation: none; stroke-dashoffset: 0; }
  .btn:hover, .service:hover { transform: none; }
}

/* Footer */
.site-footer { background: var(--navy); color: var(--on-navy); padding-block: 48px 32px; font-size: 0.95rem; }
.footer-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 32px; }
.site-footer h3 { color: #fff; font-size: 1rem; margin-bottom: 10px; }
.site-footer a { color: #fff; }
.site-footer ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.footer-logo { background: #fff; border-radius: var(--radius); padding: 10px 14px; width: 190px; margin-bottom: 14px; }
.footer-bottom { border-top: 1px solid rgba(255, 255, 255, 0.12); margin-top: 36px; padding-top: 20px; display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px; font-size: 0.88rem; }

/* Home page: the header call button waits until the banner's call button scrolls away */
.page-home .header-call { transition: opacity 0.3s, transform 0.3s, visibility 0.3s; }
.page-home.call-watch:not(.show-call) .header-call { opacity: 0; visibility: hidden; transform: translateY(-6px); }

/* Mobile call bar */
.call-bar { display: none; }

@media (max-width: 900px) {
  .about-grid, .office-grid, .contact-grid { grid-template-columns: 1fr; gap: 36px; }
  .creds { grid-template-columns: 1fr 1fr; }
  .hero-dark::after { background: linear-gradient(180deg, rgba(14, 26, 43, 0.75), rgba(14, 26, 43, 0.95)); }
  .steps { grid-template-columns: 1fr 1fr; }
  .service-detail { grid-template-columns: 1fr; gap: 12px; }
  .footer-grid { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  body { font-size: 17px; padding-bottom: calc(64px + env(safe-area-inset-bottom)); }
  .section { padding-block: 52px; }
  .hero-dark { padding-block: 72px 40px; }
  .hero-inner { gap: 48px; }
  .header-call { display: none; }
  .site-header { position: static; }
  .about-grid > img { max-width: 320px; }
  .brand img { width: 150px; }
  .nav { width: 100%; justify-content: space-between; }
  .steps { grid-template-columns: 1fr; }
  .creds { gap: 20px 16px; }
  .creds strong { font-size: 1.15rem; }
  .page-head { padding-block: 56px 48px; }
  .field-row { grid-template-columns: 1fr; }
  .call-bar { display: flex; position: fixed; left: 0; right: 0; bottom: 0; z-index: 60; background: var(--red); padding: 10px max(16px, env(safe-area-inset-right)) calc(10px + env(safe-area-inset-bottom)) max(16px, env(safe-area-inset-left)); }
  .call-bar a { flex: 1; color: #fff; text-decoration: none; font-family: var(--display); font-weight: 750; font-size: 1.1rem; display: flex; align-items: center; justify-content: center; gap: 10px; min-height: 44px; }
  .call-bar svg { width: 20px; height: 20px; }
  .page-home .call-bar { transition: transform 0.3s; }
  .page-home.call-watch:not(.show-call) .call-bar { transform: translateY(110%); }
}
