:root {
  --bg: #0e1116;
  --deep: #0b0e12;
  --surface: #141820;
  --border: #2c3442;
  --line: #232a36;
  --text: #eef1f5;
  --muted: #b7bfcb;
  --faint: #9aa3b2;
  --volt: #c9f042;
  --volt-light: #e4ff7a;
  --on-volt: #0e1116;
  --display: "Big Shoulders Display", "Arial Narrow", Impact, sans-serif;
  --mono: "IBM Plex Mono", Consolas, Menlo, monospace;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

body {
  margin: 0;
  font-family: "IBM Plex Sans", "Segoe UI", system-ui, sans-serif;
  font-size: 16px;
  line-height: 1.55;
  color: var(--text);
  background: var(--bg);
}

.wrap {
  max-width: 900px;
  margin: 0 auto;
  padding: 0 1.25rem;
}

/* Header */
.site-header {
  background: var(--deep);
  border-bottom: 1px solid var(--line);
}
.site-header .wrap {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.6rem 1.25rem;
  padding-top: 0.9rem;
  padding-bottom: 0.9rem;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  font-family: var(--display);
  font-weight: 900;
  font-size: 1.85rem;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: var(--text);
  text-decoration: none;
}
.site-header nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}
.site-header nav a {
  padding: 0.45rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: 4px;
  color: #d6dbe3;
  text-decoration: none;
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.site-header nav a:hover { border-color: var(--volt); color: var(--volt); }
.site-header nav a.active { background: var(--volt); border-color: var(--volt); color: var(--on-volt); }

main { padding: 2.4rem 1.25rem 3.5rem; }

h1, h2, h3 {
  font-family: var(--display);
  font-weight: 900;
  text-transform: uppercase;
  line-height: 0.95;
  margin: 0;
}
h1 { font-size: 4.6rem; letter-spacing: 0.005em; margin: 0.6rem 0 0.9rem; }
h1 .hl { color: var(--volt); }
h2 { font-size: 2.1rem; letter-spacing: 0.01em; margin: 2.6rem 0 0.7rem; }
h3 { font-size: 1.4rem; margin: 1.6rem 0 0.4rem; }

p { margin: 0 0 0.9rem; }
.lede { color: var(--muted); font-size: 1.25rem; max-width: 46rem; margin-top: 0; }

.eyebrow {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--volt);
  margin: 0.4rem 0 0;
}

a { color: var(--volt); }
a:hover { color: var(--volt-light); }

.mono, .num { font-family: var(--mono); font-variant-numeric: tabular-nums; }

/* Tool card */
.tool {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  margin: 2.2rem 0;
  overflow: hidden;
}
.tool::before {
  content: "";
  display: block;
  height: 10px;
  background: repeating-linear-gradient(90deg, var(--volt) 0 28px, transparent 28px 44px);
}
.tool-body { padding: 1.7rem 1.7rem 1.8rem; }
.tool h2 { font-size: 1.5rem; margin: 1.6rem 0 0.8rem; }
.tool h2:first-child { margin-top: 0; }

.fields {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 1.1rem 1.1rem;
  margin-bottom: 1.3rem;
}
.field { display: flex; flex-direction: column; gap: 0.5rem; }
.field label, .group-label {
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--faint);
}
.field .hint { text-transform: none; letter-spacing: 0; font-weight: 400; color: var(--faint); }
input, select {
  width: 100%;
  height: 48px;
  padding: 0 0.85rem;
  font: inherit;
  font-size: 1.1rem;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--deep);
  color: var(--text);
  color-scheme: dark;
}
input.mono, input[inputmode="numeric"] { font-family: var(--mono); font-variant-numeric: tabular-nums; }
input::placeholder { color: #5f6875; }
input:focus, select:focus {
  outline: 2px solid var(--volt);
  outline-offset: 1px;
}
.field-unit { position: relative; }
.field-unit input { padding-right: 4.2rem; }
.field-unit .unit {
  position: absolute;
  right: 0.85rem;
  bottom: 0;
  height: 48px;
  display: flex;
  align-items: center;
  font-size: 0.8rem;
  color: var(--faint);
  pointer-events: none;
}

/* Pill radio groups */
.pill-group { margin-bottom: 1.3rem; }
.pills { display: flex; flex-wrap: wrap; gap: 0.4rem; margin-top: 0.5rem; }
.pill { position: relative; cursor: pointer; }
.pill input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.pill span {
  display: inline-block;
  padding: 0.5rem 0.9rem;
  border: 1px solid var(--border);
  border-radius: 4px;
  font-weight: 600;
  font-size: 0.85rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  line-height: 1.2;
  color: #d6dbe3;
}
.pill input:checked + span { background: var(--volt); border-color: var(--volt); color: var(--on-volt); }
.pill input:focus-visible + span { outline: 2px solid var(--volt); outline-offset: 1px; }

/* Results */
.results { margin-top: 0.4rem; }
.panel {
  background: var(--deep);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 1.4rem 1.5rem;
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr);
  gap: 1.2rem 1.5rem;
  align-items: center;
}
.panel.single { grid-template-columns: minmax(0, 1fr); }
.panel-label {
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--faint);
}
.big-result {
  font-family: var(--display);
  font-weight: 900;
  font-size: 6.4rem;
  line-height: 0.9;
  letter-spacing: 0.01em;
  color: var(--volt);
  font-variant-numeric: tabular-nums;
  margin: 0.3rem 0 0;
}
.big-unit { font-size: 0.4em; color: var(--muted); margin-left: 0.15em; }
.panel-sub { display: flex; flex-wrap: wrap; gap: 0.4rem 1.1rem; margin: 0.7rem 0 0; color: var(--muted); font-size: 0.95rem; }
.panel-sub .num { color: var(--text); }
.panel-side { display: flex; flex-direction: column; gap: 0.6rem; }
.panel-side .caption { font-size: 0.85rem; color: var(--faint); }
.range { width: 100%; height: auto; display: block; }
.range-track { stroke: var(--border); stroke-width: 2; }
.range-band { fill: var(--volt); opacity: 0.25; }
.range-tick { stroke: var(--muted); stroke-width: 2; }
.range-avg { fill: var(--volt); stroke: var(--deep); stroke-width: 2; }
.range-text { fill: var(--faint); font-family: var(--mono); font-size: 11px; }
.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 0.75rem;
}
.stat {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 0.8rem 0.9rem;
}
.stat .panel-label { font-size: 0.7rem; }
.stat strong { display: block; font-family: var(--mono); font-weight: 600; font-size: 1.5rem; line-height: 1.2; margin-top: 0.15rem; }
.stat .muted { font-family: var(--mono); font-size: 0.85rem; }
.results .note { margin: 1.2rem 0 0; }
ul { padding-left: 1.3rem; }
li { margin-bottom: 0.5rem; }
.results table { margin-top: 1.2rem; }
.muted { color: var(--faint); }
.footnote { color: var(--faint); font-size: 0.88rem; margin-bottom: 0; }
.note {
  border: 1px dashed var(--border);
  border-radius: 6px;
  padding: 0.8rem 1rem;
  color: var(--muted);
  font-size: 0.95rem;
}
.formula {
  display: inline-block;
  font-family: var(--mono);
  font-size: 1.3rem;
  padding: 0.9rem 1.3rem;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--surface);
  margin: 0.4rem 0 1rem;
}
.formula sub, .formula sup { font-size: 0.7em; }

/* Tables */
table {
  width: 100%;
  border-collapse: collapse;
  margin: 0.75rem 0;
}
th, td {
  text-align: left;
  vertical-align: top;
  padding: 0.65rem 0.6rem;
  border-bottom: 1px solid var(--line);
  font-size: 0.95rem;
}
th { font-weight: 600; }
thead th {
  font-size: 0.72rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--faint);
}
td.num, th.num { text-align: right; white-space: nowrap; }
tr.hit td, tr.hit th { background: #1b2130; color: var(--volt); }
.table-wrap { overflow-x: auto; }

@media (max-width: 480px) {
  th, td { padding: 0.5rem 0.4rem; font-size: 0.9rem; }
}

/* Tool cards on the homepage */
.tool-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1rem;
  margin: 2rem 0 2.2rem;
  padding: 0;
  list-style: none;
}
.tool-grid a {
  display: block;
  height: 100%;
  background: var(--surface);
  border: 1px solid var(--border);
  border-top: 4px solid var(--volt);
  border-radius: 8px;
  padding: 1.2rem 1.3rem;
  color: inherit;
  text-decoration: none;
}
.tool-grid a:hover { border-color: var(--volt); }
.tool-grid h2 { margin: 0 0 0.4rem; font-size: 1.5rem; }
.tool-grid p { margin: 0; font-size: 0.95rem; color: var(--muted); }

/* Footer */
.site-footer {
  background: var(--deep);
  border-top: 1px solid var(--line);
  color: var(--faint);
  padding: 1.4rem 0 1.8rem;
  font-size: 0.9rem;
}
.site-footer .wrap { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 0.6rem 1.5rem; }
.site-footer nav { display: flex; gap: 1.25rem; }
.site-footer a { color: #d6dbe3; text-decoration: none; font-weight: 600; }
.site-footer a:hover { color: var(--volt); }
.site-footer p { margin: 0; }

@media (max-width: 640px) {
  h1 { font-size: 3rem; }
  h2 { font-size: 1.7rem; }
  .lede { font-size: 1.08rem; }
  .tool-body { padding: 1.1rem 1rem 1.2rem; }
  .panel { grid-template-columns: minmax(0, 1fr); padding: 1.1rem 1.1rem; }
  .big-result { font-size: 4.2rem; }
  .brand { font-size: 1.5rem; }
}
