:root {
  --bg: #07090f;
  --bg-soft: #0d1018;
  --panel: #11141d;
  --line: #1e2432;
  --line-soft: #171b26;
  --text: #e6e9f0;
  --text-dim: #8b93a7;
  --text-faint: #5d6577;
  --accent: #6d8bff;
  --accent-soft: rgba(109, 139, 255, 0.12);
  --good: #3ddc97;
  --warn: #ffb86b;
  --bad: #ff6b6b;
  --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  --sans: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  --radius: 14px;
  --wrap: 1080px;
}

* { box-sizing: border-box; }

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

body {
  margin: 0;
  background:
    radial-gradient(900px 480px at 12% -8%, rgba(109, 139, 255, 0.16), transparent 60%),
    radial-gradient(760px 420px at 92% 0%, rgba(61, 220, 151, 0.09), transparent 62%),
    var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

.wrap {
  width: min(var(--wrap), calc(100% - 2.5rem));
  margin-inline: auto;
}

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

.skip {
  position: absolute; left: -9999px; top: 0; background: var(--accent);
  color: #06080d; padding: 0.7rem 1.1rem; border-radius: 0 0 10px 0; z-index: 20;
  font-weight: 600; text-decoration: none;
}
.skip:focus { left: 0; }

/* ---------- masthead ---------- */

.masthead { padding: 5.5rem 0 2.5rem; }

.eyebrow {
  font-family: var(--mono);
  font-size: 0.78rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--accent);
  margin: 0 0 1.1rem;
}

h1 {
  font-size: clamp(2.6rem, 7vw, 4.1rem);
  line-height: 1.02;
  letter-spacing: -0.035em;
  font-weight: 700;
  margin: 0 0 1.4rem;
}

.lede {
  max-width: 62ch;
  font-size: 1.12rem;
  color: var(--text-dim);
  margin: 0 0 1rem;
}

.lede em { color: var(--text); font-style: normal; font-weight: 600; }
.lede.sub { font-size: 1rem; color: var(--text-faint); }

/* ---------- status ---------- */

.status {
  border: 1px solid var(--line);
  background: linear-gradient(180deg, var(--panel), rgba(17, 20, 29, 0.5));
  border-radius: var(--radius);
  padding: 1.1rem 1.3rem;
  margin: 0 0 2.5rem;
}

.status-row { display: flex; align-items: center; gap: 0.75rem; }

.status p { margin: 0; font-size: 0.95rem; }

.status-note {
  margin-top: 0.5rem !important;
  color: var(--text-faint);
  font-size: 0.86rem !important;
  padding-left: 1.6rem;
}

.dot {
  width: 9px; height: 9px; border-radius: 50%;
  background: var(--text-faint); flex: none;
  box-shadow: 0 0 0 4px rgba(255, 255, 255, 0.04);
}
.dot.ok { background: var(--good); box-shadow: 0 0 0 4px rgba(61, 220, 151, 0.14); }
.dot.bad { background: var(--bad); box-shadow: 0 0 0 4px rgba(255, 107, 107, 0.14); }
.dot.warn { background: var(--warn); box-shadow: 0 0 0 4px rgba(255, 184, 107, 0.14); }

/* ---------- cta ---------- */

.cta {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background:
    linear-gradient(135deg, rgba(109, 139, 255, 0.09), transparent 55%),
    var(--panel);
  padding: 1.6rem 1.7rem;
  margin-bottom: 3.2rem;
}

.cta h2 { margin: 0 0 0.6rem; font-size: 1.22rem; letter-spacing: -0.01em; }
.cta p { margin: 0 0 0.9rem; color: var(--text-dim); font-size: 0.95rem; max-width: 68ch; }

.cta pre {
  margin: 0 0 0.9rem;
  background: #06080d;
  border: 1px solid var(--line-soft);
  border-radius: 10px;
  padding: 0.85rem 1rem;
  overflow-x: auto;
}
.cta pre code { font-family: var(--mono); font-size: 0.84rem; color: var(--good); }

.cta-links { font-size: 0.88rem !important; }
.cta-links a { color: var(--accent); }
.cta-links span { color: var(--text-faint); margin: 0 0.4rem; }

/* ---------- sections ---------- */

section { margin-bottom: 3.4rem; }

h2 {
  font-size: 1.5rem;
  letter-spacing: -0.02em;
  font-weight: 650;
  margin: 0 0 0.9rem;
}

.section-head {
  display: flex; align-items: baseline; justify-content: space-between;
  gap: 1rem; flex-wrap: wrap; margin-bottom: 0.4rem;
}
.section-head h2 { margin: 0; }

.section-note { color: var(--text-faint); font-size: 0.9rem; max-width: 70ch; margin: 0 0 1.4rem; }

.search input {
  background: var(--bg-soft);
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--text);
  font-family: var(--sans);
  font-size: 0.9rem;
  padding: 0.55rem 1rem;
  min-width: min(320px, 60vw);
}
.search input:focus { outline: 2px solid var(--accent-soft); border-color: var(--accent); }

/* ---------- tables ---------- */

.table-wrap {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow-x: auto;
  background: var(--panel);
}

table { border-collapse: collapse; width: 100%; font-size: 0.9rem; }

th {
  text-align: left;
  font-size: 0.72rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-faint);
  font-weight: 600;
  padding: 0.85rem 1rem;
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}

td {
  padding: 0.8rem 1rem;
  border-bottom: 1px solid var(--line-soft);
  vertical-align: top;
}

tbody tr:last-child td { border-bottom: none; }
tbody tr:hover { background: rgba(255, 255, 255, 0.018); }

.matrix td:first-child { font-weight: 600; white-space: nowrap; }
.matrix td:nth-child(2) { color: var(--text-dim); }

.tag {
  display: inline-block;
  font-family: var(--mono);
  font-size: 0.72rem;
  padding: 0.12rem 0.5rem;
  border-radius: 6px;
  border: 1px solid var(--line);
  color: var(--text-dim);
  white-space: nowrap;
}
.tag.yes { color: var(--good); border-color: rgba(61, 220, 151, 0.3); }
.tag.no { color: var(--text-faint); }
.tag.warn { color: var(--warn); border-color: rgba(255, 184, 107, 0.3); }

/* ---------- limit groups ---------- */

.group {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  margin-bottom: 1rem;
  overflow: hidden;
}

.group > summary {
  cursor: pointer;
  padding: 1rem 1.2rem;
  display: flex; align-items: center; gap: 0.8rem;
  list-style: none;
  font-weight: 600;
  font-size: 0.98rem;
}
.group > summary::-webkit-details-marker { display: none; }
.group > summary::before {
  content: "▸"; color: var(--text-faint); font-size: 0.85rem; transition: transform 0.18s;
}
.group[open] > summary::before { transform: rotate(90deg); }
.group > summary:hover { background: rgba(255, 255, 255, 0.02); }

.group .src {
  margin-left: auto;
  font-family: var(--mono);
  font-size: 0.72rem;
  color: var(--text-faint);
  text-decoration: none;
  border-bottom: 1px dotted var(--line);
}
.group .src:hover { color: var(--accent); }

.group .inner { border-top: 1px solid var(--line-soft); }

.limit-row { padding: 0.85rem 1.2rem; border-bottom: 1px solid var(--line-soft); }
.limit-row:last-child { border-bottom: none; }
.limit-row.hidden { display: none; }

.limit-key {
  font-family: var(--mono);
  font-size: 0.78rem;
  color: var(--text-faint);
  display: block;
  margin-bottom: 0.15rem;
}

.limit-value {
  font-family: var(--mono);
  font-size: 0.9rem;
  color: var(--accent);
  font-weight: 500;
}

.limit-note { color: var(--text-dim); font-size: 0.86rem; margin-top: 0.3rem; }

/* ---------- calculator ---------- */

.calc {
  display: grid;
  grid-template-columns: minmax(240px, 320px) 1fr;
  gap: 1.4rem;
  align-items: start;
}

.calc-form {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  padding: 1.2rem;
  display: grid;
  gap: 0.95rem;
}

.calc-form label { display: grid; gap: 0.35rem; }
.calc-form span {
  font-size: 0.78rem; letter-spacing: 0.06em; text-transform: uppercase;
  color: var(--text-faint); font-weight: 600;
}
.calc-form input, .calc-form select {
  background: var(--bg-soft);
  border: 1px solid var(--line);
  border-radius: 9px;
  color: var(--text);
  font-family: var(--mono);
  font-size: 0.9rem;
  padding: 0.55rem 0.7rem;
  width: 100%;
}
.calc-form input:focus, .calc-form select:focus {
  outline: 2px solid var(--accent-soft); border-color: var(--accent);
}

.calc-out { display: grid; gap: 0.8rem; }

.verdict {
  border: 1px solid var(--line);
  border-left-width: 3px;
  border-radius: 10px;
  background: var(--panel);
  padding: 0.9rem 1.1rem;
}
.verdict.pass { border-left-color: var(--good); }
.verdict.fail { border-left-color: var(--bad); }
.verdict h4 { margin: 0 0 0.3rem; font-size: 0.98rem; }
.verdict p { margin: 0; font-size: 0.88rem; color: var(--text-dim); }
.verdict .why { font-family: var(--mono); font-size: 0.8rem; color: var(--text-faint); margin-top: 0.35rem; }

/* ---------- cards ---------- */

.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(270px, 1fr)); gap: 1rem; }

.card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  padding: 1.2rem 1.3rem;
}
.card h3 { margin: 0 0 0.5rem; font-size: 1rem; letter-spacing: -0.01em; }
.card p { margin: 0; font-size: 0.9rem; color: var(--text-dim); }
.card .card-fix { margin-top: 0.6rem; color: var(--good); font-size: 0.88rem; font-weight: 500; }

code {
  font-family: var(--mono);
  font-size: 0.86em;
  background: var(--bg-soft);
  border: 1px solid var(--line-soft);
  border-radius: 5px;
  padding: 0.05em 0.35em;
}

/* ---------- footer ---------- */

.foot {
  border-top: 1px solid var(--line);
  padding: 2rem 0 3.5rem;
  color: var(--text-dim);
  font-size: 0.9rem;
}
.foot p { margin: 0 0 0.4rem; }
.foot a { color: var(--accent); }
.foot-note { color: var(--text-faint); font-size: 0.82rem; }

a { color: var(--accent); }

@media (max-width: 720px) {
  .calc { grid-template-columns: 1fr; }
  .masthead { padding-top: 3.5rem; }
  th, td { padding: 0.7rem 0.8rem; }
}
