/* ============================================================================
   Threadmaze design system — shared across Threadmaze Health, HVAC, and future
   product pages. Clinical teal, teal-biased neutrals, semantic status colors.
   Light by default; dark via prefers-color-scheme AND a data-theme override so a
   header toggle wins in both directions.

   USE: either <link rel="stylesheet" href="threadmaze_theme.css"> for a page your
   own server hosts, OR paste the :root token blocks + the component rules inline
   when the page must be self-contained (Cloudflare Pages, an Artifact, or a route
   that returns an HTML string). The token names never change, so a page written
   against them restyles for free if the palette is retuned.
   ============================================================================ */

:root {
  --accent: #0d9488; --accent-ink: #0f766e; --accent-soft: #ccfbf1;
  --bg: #f5f7f7; --surface: #ffffff; --surface-2: #eef2f2;
  --ink: #14201f; --ink-2: #48605d; --ink-3: #7c918e; --line: #dbe3e2;
  --good: #059669; --good-soft: #d1fae5; --warn: #b45309; --crit: #be123c;
  --mono: ui-monospace, "SF Mono", "JetBrains Mono", Menlo, Consolas, monospace;
  --sans: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --shadow: 0 1px 2px rgba(16,40,38,.06), 0 4px 16px rgba(16,40,38,.05);
  --shadow-lg: 0 6px 24px rgba(16,40,38,.10), 0 2px 6px rgba(16,40,38,.06);
  --glow: radial-gradient(60% 80% at 50% -10%, rgba(13,148,136,.14), transparent 70%);
}
@media (prefers-color-scheme: dark) { :root {
  --accent: #2dd4bf; --accent-ink: #5eead4; --accent-soft: #134e4a;
  --bg: #0b1211; --surface: #121b1a; --surface-2: #182524;
  --ink: #e6efee; --ink-2: #a3b6b3; --ink-3: #6f8582; --line: #24312f;
  --good: #34d399; --good-soft: #06341f; --warn: #fbbf24; --crit: #fb7185;
  --shadow: 0 1px 2px rgba(0,0,0,.3), 0 6px 20px rgba(0,0,0,.28);
  --shadow-lg: 0 10px 30px rgba(0,0,0,.4), 0 3px 8px rgba(0,0,0,.3);
  --glow: radial-gradient(60% 80% at 50% -10%, rgba(45,212,191,.16), transparent 70%);
}}
:root[data-theme="light"] {
  --accent: #0d9488; --accent-ink: #0f766e; --accent-soft: #ccfbf1;
  --bg: #f5f7f7; --surface: #ffffff; --surface-2: #eef2f2; --ink: #14201f;
  --ink-2: #48605d; --ink-3: #7c918e; --line: #dbe3e2; --good: #059669;
  --good-soft: #d1fae5; --warn: #b45309; --crit: #be123c;
  --shadow: 0 1px 2px rgba(16,40,38,.06), 0 4px 16px rgba(16,40,38,.05);
  --shadow-lg: 0 6px 24px rgba(16,40,38,.10), 0 2px 6px rgba(16,40,38,.06);
  --glow: radial-gradient(60% 80% at 50% -10%, rgba(13,148,136,.14), transparent 70%);
}
:root[data-theme="dark"] {
  --accent: #2dd4bf; --accent-ink: #5eead4; --accent-soft: #134e4a;
  --bg: #0b1211; --surface: #121b1a; --surface-2: #182524; --ink: #e6efee;
  --ink-2: #a3b6b3; --ink-3: #6f8582; --line: #24312f; --good: #34d399;
  --good-soft: #06341f; --warn: #fbbf24; --crit: #fb7185;
  --shadow: 0 1px 2px rgba(0,0,0,.3), 0 6px 20px rgba(0,0,0,.28);
  --shadow-lg: 0 10px 30px rgba(0,0,0,.4), 0 3px 8px rgba(0,0,0,.3);
  --glow: radial-gradient(60% 80% at 50% -10%, rgba(45,212,191,.16), transparent 70%);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; background: var(--bg); color: var(--ink); font-family: var(--sans);
       font-size: 16px; line-height: 1.55; -webkit-font-smoothing: antialiased; }
a { color: var(--accent-ink); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { margin: 0; text-wrap: balance; letter-spacing: -.025em; line-height: 1.08; }

/* header */
header.top { position: sticky; top: 0; z-index: 10; display: flex; align-items: center;
  gap: 14px; padding: 13px 24px; background: color-mix(in srgb, var(--surface) 86%, transparent);
  backdrop-filter: saturate(1.4) blur(8px); border-bottom: 1px solid var(--line); }
.brand { display: flex; align-items: baseline; gap: 9px; font-weight: 800; letter-spacing: -.02em;
  font-size: 18px; color: var(--ink); }
.brand .mark { color: var(--accent); }
.brand .sub { font-size: 10.5px; font-weight: 700; color: var(--ink-3);
  text-transform: uppercase; letter-spacing: .12em; }
.spacer { flex: 1; }
.navlink { font-size: 13.5px; font-weight: 600; color: var(--ink-2); }
.navlink:hover { color: var(--accent-ink); text-decoration: none; }
.themebtn { display: inline-flex; align-items: center; justify-content: center; width: 36px;
  height: 36px; border-radius: 9px; border: 1px solid var(--line); background: var(--surface-2);
  color: var(--ink); cursor: pointer; font-size: 15px; line-height: 1; }
.themebtn:hover { border-color: var(--accent); }

main { max-width: 1080px; margin: 0 auto; padding: 0 24px 96px; }

/* hero */
.hero { position: relative; padding: 84px 0 44px; text-align: center; }
.hero::before { content: ""; position: absolute; inset: -40px -40px auto -40px; height: 460px;
  background: var(--glow); pointer-events: none; z-index: -1; }
.eyebrow { display: inline-flex; align-items: center; gap: 8px; font-size: 12px; font-weight: 700;
  text-transform: uppercase; letter-spacing: .14em; color: var(--accent-ink);
  background: var(--accent-soft); padding: 6px 13px; border-radius: 999px; margin-bottom: 22px; }
.hero h1 { font-size: clamp(33px, 5.8vw, 58px); font-weight: 800; }
.hero h1 .em { color: var(--accent); }
.hero p.lede { max-width: 660px; margin: 22px auto 0; font-size: clamp(16px, 2.2vw, 20px);
  color: var(--ink-2); line-height: 1.5; }

/* buttons */
.cta-row { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; margin-top: 32px; }
.btn { font-family: var(--sans); font-size: 15px; font-weight: 700; cursor: pointer;
  padding: 12px 22px; border-radius: 10px; border: 1px solid transparent; display: inline-flex;
  align-items: center; gap: 9px; transition: transform .08s ease, box-shadow .12s ease; }
.btn:hover { text-decoration: none; transform: translateY(-1px); }
.btn-primary { background: var(--accent); color: #fff; box-shadow: var(--shadow-lg); }
:root[data-theme="dark"] .btn-primary { color: #04211d; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .btn-primary { color: #04211d; } }
.btn-primary:hover { box-shadow: 0 8px 26px rgba(13,148,136,.35); }
.btn-ghost { background: var(--surface); color: var(--ink); border-color: var(--line); }
.btn-ghost:hover { border-color: var(--accent); }

/* trust band (3 stat cells) */
.trust { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px; margin: 46px 0 8px;
  background: var(--line); border: 1px solid var(--line); border-radius: 16px; overflow: hidden;
  box-shadow: var(--shadow); }
.trust .cell { background: var(--surface); padding: 22px 20px; text-align: center; }
.trust .num { font-family: var(--mono); font-variant-numeric: tabular-nums; font-size: 28px;
  font-weight: 800; color: var(--accent); letter-spacing: -.02em; }
.trust .num.good { color: var(--good); }
.trust .cap { font-size: 12.5px; color: var(--ink-2); margin-top: 6px; }
@media (max-width: 640px) { .trust { grid-template-columns: 1fr; } }

/* section heads */
.sec { margin-top: 72px; }
.sec-head { display: flex; align-items: baseline; justify-content: space-between; gap: 16px;
  margin-bottom: 22px; }
.sec-head h2 { font-size: 26px; font-weight: 800; }
.sec-head .note { font-size: 13.5px; color: var(--ink-3); }

/* product / feature cards (use <a class="prod"> for a clickable card) */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 18px; }
.prod { position: relative; display: flex; flex-direction: column; background: var(--surface);
  border: 1px solid var(--line); border-radius: 16px; padding: 24px; box-shadow: var(--shadow);
  transition: transform .1s ease, box-shadow .14s ease, border-color .14s ease; }
a.prod:hover { text-decoration: none; transform: translateY(-3px); box-shadow: var(--shadow-lg);
  border-color: color-mix(in srgb, var(--accent) 40%, var(--line)); }
.prod .top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.prod .icon { width: 42px; height: 42px; border-radius: 11px; background: var(--accent-soft);
  color: var(--accent-ink); display: flex; align-items: center; justify-content: center; font-size: 21px; }
.prod h3 { font-size: 19px; font-weight: 800; color: var(--ink); letter-spacing: -.02em; }
.prod .kind { font-size: 11.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .09em;
  color: var(--ink-3); margin-top: 3px; }
.prod p { font-size: 14.5px; color: var(--ink-2); margin: 4px 0 0; line-height: 1.5; flex: 1; }
.prod .foot { margin-top: 18px; font-size: 14px; font-weight: 700; color: var(--accent-ink); }
.prod.soon { opacity: .92; }
.prod.soon .icon { background: var(--surface-2); color: var(--ink-3); }

/* pills / status badges */
.pill { display: inline-flex; align-items: center; gap: 6px; font-size: 11.5px; font-weight: 700;
  padding: 4px 10px; border-radius: 999px; white-space: nowrap; }
.pill.live { background: var(--good-soft); color: var(--good); }
.pill.soon { background: var(--surface-2); color: var(--ink-3); border: 1px solid var(--line); }
.dot { width: 7px; height: 7px; border-radius: 50%; background: currentColor; }

/* numbered rails (explainer steps) */
.rails { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 20px; }
.rail h3 { font-size: 16px; font-weight: 800; color: var(--ink); margin-bottom: 8px;
  display: flex; align-items: center; gap: 9px; }
.rail .rn { font-family: var(--mono); color: var(--accent); font-size: 14px; }
.rail p { font-size: 14px; color: var(--ink-2); margin: 0; line-height: 1.55; }

/* a plain content card (for forms, code blocks, prose panels) */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: 16px;
  padding: 24px; box-shadow: var(--shadow); }
code, .code { font-family: var(--mono); font-size: 13px; }
.codebox { font-family: var(--mono); font-size: 13px; background: var(--surface-2);
  border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; overflow-x: auto;
  color: var(--ink); word-break: break-all; }

footer { border-top: 1px solid var(--line); margin-top: 84px; padding: 28px 24px; }
footer .wrap { max-width: 1080px; margin: 0 auto; display: flex; flex-wrap: wrap; gap: 14px;
  align-items: center; justify-content: space-between; font-size: 13px; color: var(--ink-3); }
.banner { display: inline-flex; align-items: center; gap: 8px; font-size: 12.5px; font-weight: 600;
  color: var(--warn); }
