/* One stylesheet, no framework, system fonts only: the page must paint before
   a network round trip could fetch anything else. */
:root {
  --bg: #ffffff;
  --ink: #131722;
  --muted: #666f80;
  --line: #e6e9ef;
  --panel: #14213d;
  --panel-ink: #c8d3ea;
  --panel-dim: #8fa0c4;
  --amber: #ffb703;
  --button: var(--panel);
}

/* The panel keeps its own dark blue in both schemes — it is the site's one
   fixed surface, and the answer must look the same wherever it is read. */
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0e1116;
    --ink: #e8eaee;
    --muted: #9aa3b2;
    --line: #232833;
    --button: #27407a;
  }
}

* { box-sizing: border-box; }

body {
  margin: 0;
  padding: 0 1.25rem 4rem;
  font: 1rem/1.55 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
  color: var(--ink);
  background: var(--bg);
}

.site-header,
.site-footer,
.tool {
  max-width: 41rem;
  margin: 0 auto;
}

.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 0;
}

.site-name {
  font-weight: 800;
  font-size: 1.19rem;
  letter-spacing: -.03em;
  text-decoration: none;
  color: var(--ink);
}

.lang-switch a {
  margin-left: .15rem;
  padding: .25rem .4rem;
  font-size: .81rem;
  font-weight: 600;
  color: var(--muted);
  text-decoration: none;
}
.lang-switch a[aria-current] { color: var(--ink); }

/* The answer panel: the whole reason the visitor is here, above everything. */
.answer-panel {
  background: var(--panel);
  color: #fff;
  border-radius: 20px;
  padding: 2.1rem 1.75rem 1.75rem;
  margin: .5rem 0 0;
}

.panel-label {
  margin: 0 0 .25rem;
  font-size: .81rem;
  font-weight: 600;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--panel-dim);
}

.figure {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: .5rem .85rem;
  margin: 0;
}
.figure-n {
  font-size: 6rem;
  line-height: .88;
  font-weight: 800;
  letter-spacing: -.05em;
  font-variant-numeric: tabular-nums;
}
.figure-unit { font-size: 1.35rem; font-weight: 600; color: var(--panel-ink); }

/* The heading carries the full sentence; the figure above it is the glance. */
h1.answer {
  margin: .85rem 0 0;
  font-size: 1.06rem;
  font-weight: 600;
  line-height: 1.45;
  color: #fff;
}

.bar { margin-top: 1.5rem; }
.bar .track {
  height: 8px;
  border-radius: 99px;
  background: rgba(255, 255, 255, .16);
  overflow: hidden;
}
.bar .fill { height: 100%; background: var(--amber); border-radius: 99px; }
.bar-label { margin: .55rem 0 0; font-size: .84rem; color: var(--panel-dim); }
.bar-label b { color: #fff; }

.facts {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin: 1.5rem 0 0;
  padding-top: 1.15rem;
  border-top: 1px solid rgba(255, 255, 255, .14);
}
.facts dt { font-size: .81rem; color: var(--panel-dim); }
.facts dd {
  margin: .2rem 0 0;
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: -.02em;
  font-variant-numeric: tabular-nums;
}

.tool-form { display: grid; gap: .5rem; max-width: 22rem; margin-top: 1.75rem; }
.tool-form label { color: var(--muted); font-size: .87rem; font-weight: 600; }
.tool-form input,
.tool-form button {
  font: inherit;
  padding: .8rem .85rem;
  border-radius: 12px;
  border: 1.5px solid var(--line);
  background: var(--bg);
  color: var(--ink);
}
.tool-form button {
  font-weight: 700;
  background: var(--button);
  color: #fff;
  border-color: transparent;
  cursor: pointer;
}

:focus-visible { outline: 2px solid var(--amber); outline-offset: 2px; }

/* Height is reserved so a late-loading ad cannot push the answer down. That
   jump costs both the ranking and the visitor. */
.ad-slot { margin: 1.75rem auto; max-width: 41rem; }
.ad-slot--result { min-height: 280px; }
.ad-slot--footer { min-height: 280px; }

/* The home page and the 404 page have no answer panel, so their own type does
   the work the panel does elsewhere. Scoped as a direct child so the panel's
   own h1 — which has equal specificity — is never caught by these rules. */
.tool > h1 {
  font-size: 1.9rem;
  line-height: 1.2;
  letter-spacing: -.03em;
  margin: 1.5rem 0 .35rem;
}
.tool > p { margin: 0 0 2rem; color: var(--muted); font-size: 1.05rem; }
.tool > p a { color: var(--ink); }

.family { margin: 0 0 1.75rem; }
.family h2 {
  margin: 0 0 .6rem;
  font-size: .81rem;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--muted);
}
.family ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow: hidden;
}
.family li { background: var(--bg); }
.family li a {
  display: block;
  padding: .85rem 1rem;
  font-weight: 500;
  color: var(--ink);
  text-decoration: none;
}
.family li a:hover { background: var(--line); }

.site-footer {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
  padding-top: 1rem;
  border-top: 1px solid var(--line);
  font-size: .87rem;
}
.site-footer a { color: var(--muted); }
.site-footer span { color: var(--muted); }

@media (max-width: 26rem) {
  .answer-panel { padding: 1.6rem 1.25rem 1.4rem; border-radius: 16px; }
  .figure-n { font-size: 4.75rem; }
}
