/* Decision Lab: shared styles for all three pages. */

/* ---------- 1. Tokens ---------- */
:root {
  --ink: #15171c;
  --ink-2: #3a3f4a;
  --muted: #646a76;
  --line: #e3e5e9;
  --line-2: #d3d6dc;
  --panel: #f6f7f8;
  --bg: #ffffff;

  --accent: #0d7680;
  --accent-ink: #075860;
  --accent-soft: #e7f4f5;

  --good: #17774a;
  --good-soft: #e8f5ee;
  --warn: #9a5b06;
  --warn-soft: #fcf3e3;
  --bad: #b3261e;
  --bad-soft: #fcecea;

  /* Chart series: Jev automated, fallback, stays on current model */
  --s-jev: #0d7680;
  --s-fallback: #7fb9be;
  --s-stay: #c9ccd2;

  --radius: 12px;
  --radius-sm: 8px;
  --max: 1160px;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

/* ---------- 2. Base ---------- */
* { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 16px/1.55 var(--font);
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3, h4 { margin: 0; line-height: 1.15; letter-spacing: -0.02em; font-weight: 650; }
h1 { font-size: clamp(34px, 5vw, 54px); letter-spacing: -0.035em; }
h2 { font-size: clamp(24px, 3vw, 32px); }
h3 { font-size: 18px; letter-spacing: -0.01em; }
p { margin: 0; }
a { color: var(--accent-ink); }
a:hover { color: var(--ink); }
code, pre { font-family: var(--mono); font-size: 13px; }
.num { font-variant-numeric: tabular-nums; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.wrap { max-width: var(--max); margin: 0 auto; padding: 0 24px; }
[hidden] { display: none !important; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* ---------- 3. Preview banner (only when no form endpoint is set) ---------- */
.preview-banner {
  background: var(--warn-soft); color: var(--warn);
  font-size: 13px; text-align: center; padding: 6px 16px;
  border-bottom: 1px solid #f0dfbf;
}

/* ---------- 4. Header and nav ---------- */
.site-header { position: sticky; top: 0; z-index: 20; background: rgba(255,255,255,.92); backdrop-filter: saturate(1.4) blur(10px); border-bottom: 1px solid var(--line); }
.site-header .wrap { display: flex; align-items: center; gap: 24px; height: 64px; }
.brand { display: inline-flex; align-items: center; gap: 10px; font-weight: 650; color: var(--ink); text-decoration: none; letter-spacing: -0.01em; }
.brand-mark { width: 26px; height: 26px; border-radius: 7px; background: var(--ink); display: grid; place-items: center; }
.brand-mark svg { width: 14px; height: 14px; }
.nav { display: flex; gap: 4px; margin-left: auto; align-items: center; }
.nav a { color: var(--ink-2); text-decoration: none; font-size: 15px; padding: 8px 12px; border-radius: 8px; }
.nav a:hover { background: var(--panel); color: var(--ink); }
.nav a[aria-current="page"] { color: var(--ink); font-weight: 600; }
.nav .btn { margin-left: 8px; }
.nav a.btn-primary, .nav a.btn-primary:hover { color: #fff; background: var(--ink); }

/* ---------- 5. Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font: 600 15px/1 var(--font); text-decoration: none; cursor: pointer;
  border-radius: 10px; padding: 12px 18px; border: 1px solid transparent;
  transition: background .15s, border-color .15s, color .15s;
}
.btn-primary { background: var(--ink); color: #fff; }
.btn-primary:hover { background: #2a2e37; color: #fff; }
.btn-accent { background: var(--accent); color: #fff; }
.btn-accent:hover { background: var(--accent-ink); color: #fff; }
.btn-ghost { background: #fff; color: var(--ink); border-color: var(--line-2); }
.btn-ghost:hover { border-color: var(--ink); color: var(--ink); }
.btn-sm { padding: 9px 14px; font-size: 14px; }
.btn[disabled] { opacity: .5; cursor: not-allowed; }
.link-btn { background: none; border: 0; padding: 0; font: inherit; color: var(--accent-ink); cursor: pointer; text-decoration: underline; text-underline-offset: 2px; }
.hero-link { display: inline-flex; align-items: center; gap: 12px; color: var(--ink); font-weight: 600; text-decoration: none; padding: 10px 0; border-bottom: 1px solid var(--line-2); }
.hero-link:hover { color: var(--accent-ink); border-color: var(--accent); }

/* ---------- 6. Hero ---------- */
.hero { padding: 64px 0 40px; }
.eyebrow { font-size: 13px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--accent-ink); margin-bottom: 16px; }
.lede { font-size: 19px; color: var(--ink-2); max-width: 620px; margin-top: 18px; }
.hero-actions { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 28px; }

/* Proof strip: three sourced facts */
.proof { display: grid; grid-template-columns: repeat(3, 1fr); border: 1px solid var(--line); border-radius: var(--radius); margin-top: 44px; }
.proof > div { padding: 18px 20px; }
.proof > div + div { border-left: 1px solid var(--line); }
.proof strong { display: block; font-size: 22px; letter-spacing: -0.02em; font-weight: 650; }
.proof span { font-size: 14px; color: var(--muted); }

/* ---------- 7. Sections ---------- */
.section { padding: 56px 0; }
.section-head { display: flex; justify-content: space-between; align-items: end; gap: 24px; margin-bottom: 24px; }
.section-head p { color: var(--muted); max-width: 520px; }
.band { background: var(--panel); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }

/* ---------- 8. Form controls ---------- */
label, .label { display: block; font-size: 14px; font-weight: 600; color: var(--ink); }
.hint { display: block; font-size: 13px; font-weight: 400; color: var(--muted); margin-top: 6px; }
input[type=text], input[type=email], input[type=number], input[type=url], select, textarea {
  width: 100%; margin-top: 8px; padding: 11px 12px;
  font: 16px/1.3 var(--font); color: var(--ink);
  background: #fff; border: 1px solid var(--line-2); border-radius: var(--radius-sm);
}
textarea { resize: vertical; min-height: 88px; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--accent); outline-offset: 0; border-color: var(--accent); }
input[aria-invalid=true] { border-color: var(--bad); }
input[type=range] { width: 100%; accent-color: var(--accent); margin-top: 12px; }
.field { margin-bottom: 18px; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.input-affix { position: relative; }
.input-affix span { position: absolute; right: 12px; top: 50%; transform: translateY(-20%); color: var(--muted); font-size: 14px; pointer-events: none; }
.input-affix input { padding-right: 64px; }

/* Segmented choice (radio pills) */
.seg { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.seg input { position: absolute; opacity: 0; pointer-events: none; }
.seg label {
  font-weight: 500; font-size: 14px; color: var(--ink-2);
  padding: 8px 12px; border: 1px solid var(--line-2); border-radius: 999px; cursor: pointer; background: #fff;
}
.seg label:hover { border-color: var(--ink); }
.seg input:checked + label { background: var(--ink); color: #fff; border-color: var(--ink); }
.seg input:focus-visible + label { outline: 2px solid var(--accent); outline-offset: 2px; }

/* Honeypot: hidden from people, visible to bots */
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

details > summary { cursor: pointer; list-style: none; font-weight: 600; font-size: 14px; color: var(--ink-2); }
details > summary::-webkit-details-marker { display: none; }
details > summary::after { content: " +"; color: var(--muted); }
details[open] > summary::after { content: " –"; }

/* ---------- 9. Status messages ---------- */
.status { font-size: 14px; margin-top: 10px; min-height: 1em; }
.status.ok { color: var(--good); }
.status.err { color: var(--bad); }

/* ---------- 10. Cards and tables ---------- */
.card { border: 1px solid var(--line); border-radius: var(--radius); padding: 24px; background: #fff; }
.grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.step-no { font: 600 13px/1 var(--mono); color: var(--accent-ink); background: var(--accent-soft); border-radius: 6px; padding: 5px 7px; display: inline-block; margin-bottom: 14px; }
table { width: 100%; border-collapse: collapse; font-size: 15px; }
th, td { text-align: left; padding: 12px 14px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font-size: 13px; font-weight: 600; color: var(--muted); }
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); }
.table-wrap table tr:last-child td { border-bottom: 0; }
pre { max-width: 100%; background: #111318; color: #e6e8ec; border-radius: var(--radius-sm); padding: 16px; overflow-x: auto; line-height: 1.5; margin: 0; }
pre .k { color: #7fd1d8; } pre .s { color: #d6e6a3; } pre .c { color: #8b919c; }

/* Tags */
.tag { display: inline-block; font-size: 12px; font-weight: 600; padding: 3px 8px; border-radius: 999px; }
.tag-good { background: var(--good-soft); color: var(--good); }
.tag-warn { background: var(--warn-soft); color: var(--warn); }
.tag-bad { background: var(--bad-soft); color: var(--bad); }
.tag-neutral { background: var(--panel); color: var(--ink-2); }

/* ---------- 11. Footer ---------- */
.site-footer { border-top: 1px solid var(--line); padding: 32px 0 48px; margin-top: 24px; font-size: 14px; color: var(--muted); }
.site-footer .wrap { display: grid; grid-template-columns: 1.4fr 1fr; gap: 24px; }
.site-footer nav { display: flex; gap: 18px; justify-content: flex-end; flex-wrap: wrap; }
.site-footer a { color: var(--ink-2); }

/* ---------- 12. Responsive ---------- */
@media (max-width: 860px) {
  .site-header .wrap { flex-wrap: wrap; gap: 10px; height: auto; min-height: 64px; padding-top: 14px; padding-bottom: 14px; }
  .nav { flex-wrap: wrap; }
  .nav a:not(.btn) { display: inline-block; }
  .nav .nav-keep { display: inline-block !important; }
  .proof { grid-template-columns: 1fr; }
  .proof > div + div { border-left: 0; border-top: 1px solid var(--line); }
  .grid-3, .grid-2 { grid-template-columns: minmax(0, 1fr); }
  .section-head { flex-direction: column; align-items: start; }
  .site-footer .wrap { grid-template-columns: 1fr; }
  .site-footer nav { justify-content: flex-start; }
}
@media (max-width: 560px) {
  .wrap { padding: 0 16px; }
  .hero { padding: 40px 0 28px; }
  .lede { font-size: 17px; }
  .field-row { grid-template-columns: 1fr; gap: 0; }
  .nav .btn { padding: 9px 12px; font-size: 14px; }
  .site-header .nav { width: 100%; justify-content: space-between; gap: 4px; }
  .site-header .nav a { font-size: 13px; padding: 8px 4px; }
  main section[id] { scroll-margin-top: 112px; }
}

/* ---------- 13. Print: only the brief prints ---------- */
@media print {
  body.printing > *:not(#brief-dialog) { display: none !important; }
  body.printing #brief-dialog { position: static; border: 0; padding: 0; max-width: none; box-shadow: none; }
  body.printing .dialog-actions { display: none !important; }
}
