/* styles.css — theme_10 "Nordic Ice Decision Matrix"
   Tokens: bg #f0f4f8, surface #ffffff, ink #102a43, accent #0284c7, muted #486581 */

:root {
  --bg: #f0f4f8;
  --surface: #ffffff;
  --ink: #102a43;
  --accent: #0284c7;
  --muted: #486581;
  --line: #d9e2ec;
  --ok: #047857;
  --bad: #b91c1c;
  --radius: 10px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
  line-height: 1.55;
}

.wrap { max-width: 1080px; margin: 0 auto; padding: 0 20px; }

a { color: var(--accent); }
a:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 2px;
}

/* Header */
.site-header {
  background: var(--surface);
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  z-index: 10;
}
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding-top: 12px;
  padding-bottom: 12px;
  flex-wrap: wrap;
}
.brand {
  font-weight: 800;
  font-size: 1.25rem;
  color: var(--ink);
  text-decoration: none;
  letter-spacing: -0.02em;
}
.brand span { color: var(--accent); }
.site-header nav { display: flex; gap: 14px; flex-wrap: wrap; }
.site-header nav a { color: var(--muted); text-decoration: none; font-size: 0.92rem; }
.site-header nav a:hover { color: var(--accent); }

/* Above-fold disclosure */
.disclosure-banner {
  background: #e8f4fb;
  border: 1px solid #b7ddf2;
  border-left: 4px solid var(--accent);
  border-radius: var(--radius);
  padding: 12px 16px;
  margin: 18px 0 0;
  font-size: 0.9rem;
  color: var(--ink);
}

/* Hero */
.hero { padding: 28px 0 8px; }
.hero h1 { font-size: clamp(1.8rem, 4vw, 2.6rem); margin: 0 0 10px; letter-spacing: -0.02em; }
.lede { font-size: 1.08rem; color: var(--muted); max-width: 62ch; margin: 0 0 18px; }
.hero-facts {
  display: flex;
  gap: 22px;
  flex-wrap: wrap;
  list-style: none;
  padding: 0;
  margin: 0;
}
.hero-facts li {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 10px 16px;
  font-size: 0.9rem;
  color: var(--muted);
}
.hero-facts strong { color: var(--ink); font-size: 1.05rem; display: block; }

/* Sections */
section { margin: 40px 0; }
h2 { font-size: 1.45rem; margin: 0 0 8px; }
h3 { font-size: 1.1rem; margin: 20px 0 8px; }
.section-note { color: var(--muted); max-width: 70ch; margin: 0 0 16px; }

.panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px;
}

/* Forms */
.grid-form {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 14px;
}
label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--muted);
}
input, select {
  font: inherit;
  padding: 9px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfdff;
  color: var(--ink);
}
input[type="range"] { padding: 0; }

/* Results */
.results {
  margin-top: 16px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px;
}
.kv-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 10px;
}
.kv {
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 12px;
}
.kv .k { font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.05em; color: var(--muted); }
.kv .v { font-size: 1.15rem; font-weight: 700; color: var(--ink); }

/* Rubric sliders */
.rubric-form {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 18px;
  align-items: end;
}
.weight-block { display: flex; flex-direction: column; gap: 6px; }
.weight-block .w-label { display: flex; justify-content: space-between; font-size: 0.85rem; color: var(--muted); font-weight: 600; }
.weight-block .w-label output { color: var(--accent); font-variant-numeric: tabular-nums; }

/* Tables */
.table-wrap {
  overflow-x: auto;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}
table { border-collapse: collapse; width: 100%; font-size: 0.88rem; }
th, td {
  text-align: left;
  padding: 9px 12px;
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}
th { background: #eef4fa; color: var(--ink); font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.04em; }
tr:last-child td { border-bottom: none; }
td.num { font-variant-numeric: tabular-nums; text-align: right; }
.score-cell { font-weight: 700; color: var(--accent); }
.score-bar {
  display: inline-block;
  height: 8px;
  background: var(--accent);
  border-radius: 4px;
  vertical-align: middle;
  margin-right: 8px;
  min-width: 2px;
}
.badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 700;
}
.badge.pass { background: #dcfce7; color: var(--ok); }
.badge.fail { background: #fee2e2; color: var(--bad); }

/* Chart */
.chart-panel { padding: 12px; }
#tradeoff-svg { width: 100%; height: auto; display: block; }
.legend {
  display: flex;
  gap: 18px;
  flex-wrap: wrap;
  list-style: none;
  padding: 10px 4px 0;
  margin: 0;
  font-size: 0.82rem;
  color: var(--muted);
}
.legend .dot {
  display: inline-block;
  width: 12px; height: 12px;
  border-radius: 50%;
  margin-right: 6px;
  vertical-align: -1px;
}

/* Checklist */
.check-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
.check-item {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 12px;
  font-size: 0.9rem;
}
.check-item .mark { font-weight: 800; width: 1.2em; }
.check-item.pass .mark { color: var(--ok); }
.check-item.fail .mark { color: var(--bad); }
.check-item .detail { color: var(--muted); font-size: 0.82rem; display: block; }

/* Export */
.export-row { display: flex; gap: 10px; margin-top: 14px; flex-wrap: wrap; }
button {
  font: inherit;
  font-weight: 600;
  font-size: 0.9rem;
  padding: 9px 16px;
  border-radius: 8px;
  border: 1px solid var(--accent);
  background: var(--accent);
  color: #fff;
  cursor: pointer;
}
button.secondary { background: var(--surface); color: var(--accent); }
button:hover { filter: brightness(1.06); }

/* Irradiance */
.irradiance {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(90px, 1fr));
  gap: 8px;
  padding: 0;
  list-style: none;
  counter-reset: m;
}
.irradiance li {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px 10px;
  font-size: 0.82rem;
  color: var(--muted);
}
.irradiance li::before {
  counter-increment: m;
  content: "M" counter(m) " · ";
  color: var(--accent);
  font-weight: 700;
}
.irradiance li strong { color: var(--ink); }

/* Footer */
.site-footer {
  border-top: 1px solid var(--line);
  background: var(--surface);
  margin-top: 48px;
  padding: 24px 0;
  font-size: 0.85rem;
  color: var(--muted);
}
.site-footer nav { display: flex; gap: 16px; margin: 10px 0; flex-wrap: wrap; }
.site-footer nav a { color: var(--muted); }
.fine { font-size: 0.78rem; }

/* Legal pages reuse the same tokens */
.legal-body { max-width: 72ch; }
.legal-body h2 { font-size: 1.15rem; margin-top: 26px; }
.legal-body p, .legal-body li { color: var(--ink); }

@media (max-width: 640px) {
  .header-inner { flex-direction: column; align-items: flex-start; }
  .kv-grid { grid-template-columns: 1fr 1fr; }
}
