/* HVAC & Construction Calculator — shared styles
   Dark, high-contrast theme. All text/background pairs meet WCAG AA. */

:root {
  color-scheme: dark;
  --bg: #0b1220;
  --bg-elev: #111a2c;
  --card: #141f34;
  --card-border: #24324d;
  --text: #f4f6fa;
  --text-muted: #b4bfd2;   /* ~9:1 on --bg */
  --accent: #F5821F;       /* ~8.8:1 on --bg */
  --accent-strong: #ffb43d;
  --on-accent: #0b1220;
  --focus: #ffd27a;
  --radius: 14px;
  --radius-sm: 10px;
  --max: 760px;
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "SF Pro", Inter, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

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

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 1rem;           /* 16px */
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

@media (min-width: 640px) {
  body { font-size: 1.0625rem; } /* 17px */
}

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

a {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 0.18em;
  text-decoration-thickness: 1px;
}
a:hover { color: var(--accent-strong); }

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

.skip-link {
  position: absolute;
  left: 12px;
  top: -60px;
  background: var(--accent);
  color: var(--on-accent);
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  font-weight: 700;
  text-decoration: none;
  z-index: 100;
}
.skip-link:focus { top: 12px; }

.wrap {
  width: 100%;
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 20px;
}

/* ---------- Header ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(11, 18, 32, 0.94);
  border-bottom: 1px solid var(--card-border);
}
@supports ((-webkit-backdrop-filter: blur(8px)) or (backdrop-filter: blur(8px))) {
  .site-header {
    background: rgba(11, 18, 32, 0.82);
    -webkit-backdrop-filter: saturate(140%) blur(10px);
    backdrop-filter: saturate(140%) blur(10px);
  }
}
.site-header .wrap {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 6px 16px;
  padding-top: 10px;
  padding-bottom: 10px;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--text);
  font-weight: 700;
  letter-spacing: -0.01em;
  text-decoration: none;
  white-space: nowrap;
}
.brand:hover { color: var(--text); }
.brand-mark {
  width: 28px;
  height: 28px;
  flex: none;
}
.site-nav ul {
  display: flex;
  flex-wrap: wrap;
  gap: 2px 4px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.site-nav a {
  display: inline-block;
  padding: 6px 10px;
  border-radius: 8px;
  color: var(--text-muted);
  font-size: 0.9375rem;
  font-weight: 500;
  text-decoration: none;
}
.site-nav a:hover { color: var(--text); background: var(--bg-elev); }
.site-nav a[aria-current="page"] { color: var(--accent); }
@media (max-width: 479px) {
  .site-nav { width: 100%; margin-left: -8px; }
  .site-nav ul { gap: 0; justify-content: space-between; flex-wrap: nowrap; }
  .site-nav a { padding: 6px 8px; font-size: 0.875rem; }
}

/* ---------- Main ---------- */
main { padding: 32px 0 56px; }

h1, h2, h3 {
  line-height: 1.2;
  letter-spacing: -0.02em;
  margin: 0 0 0.5em;
}
h1 { font-size: clamp(2rem, 6vw, 2.75rem); font-weight: 800; }
h2 { font-size: clamp(1.375rem, 3.6vw, 1.75rem); font-weight: 750; margin-top: 2.2em; }
h3 { font-size: 1.125rem; font-weight: 700; margin-top: 1.6em; }
p, ul, ol { margin: 0 0 1em; }
ul, ol { padding-left: 1.3em; }
li { margin-bottom: 0.4em; }
strong { color: var(--text); font-weight: 650; }
code {
  font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  font-size: 0.92em;
  background: var(--bg-elev);
  border: 1px solid var(--card-border);
  border-radius: 6px;
  padding: 0.08em 0.4em;
}

.muted { color: var(--text-muted); }
.eyebrow {
  display: inline-block;
  color: var(--accent);
  font-size: 0.8125rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: 0.75em;
}

/* ---------- Hero ---------- */
.hero { padding: 24px 0 8px; }
.hero h1 { font-size: clamp(2.25rem, 8vw, 3.25rem); max-width: 14ch; }
.hero .lede {
  color: var(--text-muted);
  font-size: 1.125rem;
  max-width: 38em;
}
.cta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  margin-top: 24px;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 48px;
  padding: 12px 22px;
  border-radius: 12px;
  background: var(--accent);
  color: var(--on-accent);
  font-weight: 700;
  text-decoration: none;
  border: 0;
}
.button:hover { background: var(--accent-strong); color: var(--on-accent); }
.button svg { width: 20px; height: 20px; fill: currentColor; }
.button-ghost {
  background: transparent;
  color: var(--text);
  border: 1px solid var(--card-border);
}
.button-ghost:hover { background: var(--bg-elev); color: var(--text); }

/* ---------- Cards & grids ---------- */
.grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
  margin: 20px 0 0;
  padding: 0;
  list-style: none;
}
@media (min-width: 600px) {
  .grid { grid-template-columns: 1fr 1fr; }
}
.card {
  background: var(--card);
  border: 1px solid var(--card-border);
  border-radius: var(--radius);
  padding: 20px;
  margin: 0;
}
.card h3 { margin-top: 0; font-size: 1.0625rem; }
.card p:last-child, .card ul:last-child { margin-bottom: 0; }
.card .icon {
  display: inline-flex;
  width: 36px;
  height: 36px;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  background: rgba(245,130,31, 0.14);
  margin-bottom: 12px;
}
.card .icon svg { width: 20px; height: 20px; stroke: var(--accent); fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

.callout {
  background: var(--card);
  border: 1px solid var(--card-border);
  border-left: 4px solid var(--accent);
  border-radius: var(--radius-sm);
  padding: 18px 20px;
  margin: 24px 0;
}
.callout p:last-child, .callout ul:last-child { margin-bottom: 0; }
.callout h2, .callout h3 { margin-top: 0; }

.checklist { list-style: none; padding-left: 0; }
.checklist li { position: relative; padding-left: 1.8em; }
.checklist li::before {
  content: "";
  position: absolute;
  left: 0.15em;
  top: 0.45em;
  width: 0.9em;
  height: 0.5em;
  border-left: 2.5px solid var(--accent);
  border-bottom: 2.5px solid var(--accent);
  transform: rotate(-45deg);
}

.tiers { display: grid; gap: 14px; grid-template-columns: 1fr; margin-top: 20px; }
@media (min-width: 600px) { .tiers { grid-template-columns: 1fr 1fr; } }
.tier-pro { border-color: rgba(245,130,31, 0.55); }
.badge {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 3px 8px;
  border-radius: 999px;
  background: rgba(245,130,31, 0.16);
  color: var(--accent);
  margin-bottom: 10px;
}

/* ---------- Legal pages ---------- */
.doc-meta { color: var(--text-muted); font-size: 0.9375rem; margin-bottom: 1.5em; }
.toc {
  background: var(--bg-elev);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-sm);
  padding: 16px 20px;
  margin: 20px 0 8px;
}
.toc h2 { font-size: 1rem; margin: 0 0 0.6em; }
.toc ol { margin: 0; columns: 1; }
@media (min-width: 600px) { .toc ol { columns: 2; column-gap: 28px; } }
.toc li { margin-bottom: 0.25em; break-inside: avoid; font-size: 0.9375rem; }
.legal h2 { scroll-margin-top: 110px; }
.formula {
  display: block;
  overflow-x: auto;
  padding: 12px 14px;
  margin: 0 0 1em;
  white-space: nowrap;
}

/* ---------- Support / FAQ ---------- */
.contact-card {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.contact-card h2 { margin: 0; }
.contact-card .email {
  font-size: 1.125rem;
  font-weight: 650;
  word-break: break-all;
}
.faq details {
  background: var(--card);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-sm);
  margin: 0 0 10px;
}
.faq summary {
  cursor: pointer;
  list-style: none;
  padding: 16px 48px 16px 18px;
  font-weight: 650;
  position: relative;
  min-height: 48px;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: "";
  position: absolute;
  right: 20px;
  top: 50%;
  width: 9px;
  height: 9px;
  border-right: 2.5px solid var(--accent);
  border-bottom: 2.5px solid var(--accent);
  transform: translateY(-70%) rotate(45deg);
  transition: transform 0.18s ease;
}
.faq details[open] summary::after { transform: translateY(-30%) rotate(-135deg); }
.faq .answer { padding: 0 18px 16px; color: var(--text-muted); }
.faq .answer strong { color: var(--text); }
.faq .answer p:last-child, .faq .answer ol:last-child, .faq .answer ul:last-child { margin-bottom: 0; }

/* ---------- Footer ---------- */
.site-footer {
  border-top: 1px solid var(--card-border);
  background: var(--bg-elev);
  padding: 28px 0 36px;
  color: var(--text-muted);
  font-size: 0.9375rem;
}
.site-footer ul {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 18px;
  list-style: none;
  margin: 0 0 14px;
  padding: 0;
}
.site-footer a { color: var(--text-muted); }
.site-footer a:hover { color: var(--text); }
.site-footer p { margin: 0 0 6px; }

/* ---------- Motion ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
  }
}
@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }
}

/* ---------- Print ---------- */
@media print {
  :root { --bg: #fff; --text: #000; --text-muted: #333; --card: #fff; --bg-elev: #fff; --card-border: #999; --accent: #8a4b00; }
  .site-header, .skip-link, .cta-row { display: none; }
  body { background: #fff; color: #000; }
}
