/* Tool Review Lab — data-dense review site. One file, system fonts, no external anything. */

:root {
  --ink: #0f172a;        /* Ink Slate — headings, body, table header */
  --cloud: #f8fafc;      /* page background */
  --mist: #e2e8f0;       /* borders, zebra tint, chips */
  --mist-soft: #eef2f6;  /* lighter zebra tint */
  --blue: #2563eb;       /* Lab Blue — links, buttons, top pick */
  --blue-tint: #e8f0fe;  /* top-pick row / tag backgrounds */
  --great: #16a34a;      /* rating triad — scores & verdicts only */
  --ok: #d97706;
  --poor: #dc2626;
  --great-deep: #15803d; /* darker triad shades for small colored text on light bg (AA) */
  --ok-deep: #92400e;
  --poor-deep: #991b1b;
  --muted: #475569;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, "Courier New", monospace;
  --max: 66rem;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; color-scheme: light; }
section[id] { scroll-margin-top: 1.25rem; }
::selection { background: #bfd3fa; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition: none !important; animation: none !important; }
}

body {
  margin: 0;
  font-family: var(--sans);
  font-size: 1rem;
  line-height: 1.6;
  color: var(--ink);
  background: var(--cloud);
  -webkit-text-size-adjust: 100%;
}

.wrap { max-width: var(--max); margin: 0 auto; padding: 0 1.25rem; }

h1, h2, h3, h4 { line-height: 1.2; margin: 0 0 0.6rem; letter-spacing: -0.01em; text-wrap: balance; }
h1 { font-size: clamp(1.9rem, 4.5vw, 2.7rem); }
h2 { font-size: clamp(1.35rem, 3vw, 1.7rem); }
h3 { font-size: 1.15rem; }
h4 { font-size: 1rem; }
p { margin: 0 0 1rem; }
p:last-child { margin-bottom: 0; }

a { color: var(--blue); text-underline-offset: 2px; }
a:hover { color: #1d4ed8; }

:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; border-radius: 2px; }

.mono { font-family: var(--mono); font-size: 0.85em; }
.muted { color: var(--muted); }

.skip-link {
  position: absolute; left: -999px; top: 0; z-index: 100;
  background: var(--ink); color: #fff; padding: 0.5rem 1rem; border-radius: 0 0 6px 0;
}
.skip-link:focus { left: 0; }

/* ---------- header ---------- */

.site-header { background: var(--ink); color: #fff; }
.header-inner {
  display: flex; align-items: center; justify-content: space-between;
  flex-wrap: wrap; gap: 0.5rem 1.5rem; padding-top: 0.8rem; padding-bottom: 0.8rem;
}
.brand { display: flex; align-items: center; gap: 0.6rem; color: #fff; text-decoration: none; }
.brand:hover { color: #fff; }
.brand-mark { flex: none; display: block; }
.brand-name { font-weight: 700; font-size: 1.05rem; letter-spacing: -0.01em; }
.brand-name .lab { color: #93b8f8; }
.site-nav { display: flex; flex-wrap: wrap; gap: 0.15rem 1.1rem; }
.site-nav a {
  color: var(--mist); text-decoration: none; font-size: 0.92rem; font-weight: 500;
  padding: 0.25rem 0; border-bottom: 2px solid transparent;
}
.site-nav a:hover { color: #fff; }
.site-nav a[aria-current="page"] { color: #fff; border-bottom-color: var(--blue); }

/* ---------- hero ---------- */

.hero {
  padding: 3rem 0 2.2rem;
  display: grid; grid-template-columns: minmax(0, 1fr) auto;
  gap: 0 3.5rem; align-items: center;
}
.hero h1 { max-width: 22ch; }
.hero .lede { font-size: 1.1rem; color: var(--muted); max-width: 56ch; text-wrap: pretty; }

.hero-scale {
  border: 1px solid var(--mist); background: #fff; border-radius: 8px;
  padding: 1.15rem 1.3rem; display: grid; gap: 0.6rem; min-width: 15rem;
}
.hero-scale-title {
  font-family: var(--mono); font-size: 0.72rem; font-weight: 700;
  letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted); margin: 0;
}
.hero-scale-row { display: flex; align-items: center; gap: 0.75rem; font-size: 0.92rem; }
.hero-scale-row .score { min-width: 4.8rem; text-align: center; }
.hero-scale-note { margin: 0.3rem 0 0; font-family: var(--mono); font-size: 0.72rem; color: var(--muted); }
.eyebrow {
  font-family: var(--mono); font-size: 0.75rem; letter-spacing: 0.12em;
  text-transform: uppercase; color: var(--blue); margin: 0 0 0.75rem; font-weight: 600;
}
.hero-actions { display: flex; flex-wrap: wrap; gap: 0.75rem; margin-top: 1.4rem; }
.hero-facts {
  grid-column: 1 / -1;
  display: flex; flex-wrap: wrap; gap: 0.4rem 1.75rem; margin-top: 1.75rem;
  padding-top: 1rem; border-top: 1px solid var(--mist);
  font-family: var(--mono); font-size: 0.8rem; color: var(--muted);
}

.btn {
  display: inline-block; background: var(--blue); color: #fff; text-decoration: none;
  font-weight: 600; font-size: 0.95rem; padding: 0.6rem 1.2rem; border-radius: 6px;
  border: 1px solid var(--blue); transition: background 0.15s ease;
}
.btn:hover { background: #1d4ed8; color: #fff; }
.btn--ghost { background: transparent; color: var(--blue); border-color: var(--blue); }
.btn--ghost:hover { background: var(--blue-tint); color: #1d4ed8; }

/* ruler-tick divider — the measurement motif */
.ruler {
  height: 12px; margin: 0 0 0.25rem;
  background-image:
    repeating-linear-gradient(90deg, var(--ink) 0 2px, transparent 2px 80px),
    repeating-linear-gradient(90deg, var(--mist) 0 1px, transparent 1px 8px);
  background-size: 100% 12px, 100% 7px;
  background-repeat: no-repeat;
  background-position: bottom left, bottom left;
  opacity: 0.8;
}

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

.section { padding: 2.4rem 0; }
.section + .section { border-top: 1px solid var(--mist); }
.section-head {
  display: flex; align-items: baseline; justify-content: space-between;
  flex-wrap: wrap; gap: 0.25rem 1rem; margin-bottom: 1.1rem;
}
.section-head h2 { margin-bottom: 0.15rem; }
.section-head .more { font-size: 0.9rem; font-weight: 600; white-space: nowrap; }
.section-intro { max-width: 62ch; color: var(--muted); text-wrap: pretty; }

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

.table-wrap {
  overflow: auto;
  max-height: min(80vh, 42rem);
  border: 1px solid var(--mist);
  border-radius: 8px;
  background: #fff;
}
.spec-table {
  border-collapse: collapse; width: 100%; min-width: 640px;
  font-size: 0.92rem;
}
.spec-table caption {
  caption-side: top; text-align: left; padding: 0.7rem 0.9rem;
  font-family: var(--mono); font-size: 0.75rem; color: var(--muted);
  border-bottom: 1px solid var(--mist); background: #fff;
}
.spec-table thead th {
  position: sticky; top: 0; z-index: 2;
  background: var(--ink); color: #fff; text-align: left;
  font-size: 0.78rem; letter-spacing: 0.06em; text-transform: uppercase;
  padding: 0.6rem 0.9rem; white-space: nowrap;
}
.spec-table thead th button {
  all: unset; cursor: pointer; display: inline-block;
  font: inherit; color: inherit; letter-spacing: inherit; text-transform: inherit;
}
.spec-table thead th button::after { content: " ↕"; opacity: 0.45; }
.spec-table thead th[aria-sort="ascending"] button::after { content: " ↑"; opacity: 1; }
.spec-table thead th[aria-sort="descending"] button::after { content: " ↓"; opacity: 1; }
.spec-table thead th button:focus-visible { outline: 2px solid #93b8f8; outline-offset: 2px; }
.spec-table td, .spec-table tbody th {
  padding: 0.65rem 0.9rem; border-top: 1px solid var(--mist);
  text-align: left; vertical-align: top; font-weight: 400;
}
.spec-table tbody th { font-weight: 600; min-width: 14rem; }
.spec-table tbody tr:nth-child(even) { background: var(--mist-soft); }
.spec-table tbody tr:hover { background: #e5ebf3; }
.spec-table td.spec { font-family: var(--mono); font-size: 0.82rem; white-space: nowrap; }
.spec-table tr.top-pick { background: var(--blue-tint) !important; box-shadow: inset 3px 0 0 var(--blue); }
.table-foot {
  font-family: var(--mono); font-size: 0.75rem; color: var(--muted);
  margin-top: 0.6rem;
}

/* ---------- ratings ---------- */

.stars {
  display: inline-block; font-size: 1.05rem; letter-spacing: 0.1em; line-height: 1;
  background: linear-gradient(90deg, var(--blue) calc(var(--r, 5) / 5 * 100%), var(--mist) 0);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
@supports not ((-webkit-background-clip: text) or (background-clip: text)) {
  .stars { background: none; color: var(--blue); }
}

.score {
  display: inline-block; font-family: var(--mono); font-weight: 700; font-size: 0.85rem;
  line-height: 1; padding: 0.4em 0.7em; border-radius: 999px; white-space: nowrap;
}
.score .max { font-weight: 400; opacity: 0.75; font-size: 0.85em; }
.score--great { background: var(--great); color: var(--ink); }
.score--ok    { background: var(--ok);    color: var(--ink); }
.score--poor  { background: var(--poor);  color: #fff; }
.score--lg { font-size: 1.05rem; }

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

.picks { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem; }
.pick-card {
  background: #fff; border: 1px solid var(--mist); border-radius: 8px;
  padding: 1.25rem; display: flex; flex-direction: column; gap: 0.6rem;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease;
}
.pick-card:hover {
  border-color: #c7d5ea; box-shadow: 0 4px 14px rgba(15, 23, 42, 0.07);
  transform: translateY(-2px);
}
.pick-card .icon { color: var(--blue); }
.pick-card h3 { margin: 0; }
.pick-card .rating-row { display: flex; align-items: center; gap: 0.7rem; flex-wrap: wrap; }
.pick-card p { font-size: 0.93rem; color: var(--muted); }
.pick-card .more { font-size: 0.9rem; font-weight: 600; margin-top: auto; }

.tag {
  display: inline-block; align-self: flex-start;
  font-family: var(--mono); font-size: 0.68rem; font-weight: 700;
  letter-spacing: 0.1em; text-transform: uppercase;
  background: var(--blue-tint); color: #1d4ed8;
  padding: 0.35em 0.7em; border-radius: 4px;
}
.tag--pick { background: var(--blue); color: #fff; margin-left: 0.4rem; vertical-align: middle; }

.chip {
  display: inline-block; background: var(--mist); color: var(--ink);
  font-family: var(--mono); font-size: 0.78rem;
  padding: 0.25em 0.75em; border-radius: 999px; white-space: nowrap;
}
a.chip {
  text-decoration: none;
  transition: background 0.15s ease, color 0.15s ease;
}
a.chip:hover { background: var(--blue-tint); color: #1d4ed8; }
.chip-row { display: flex; flex-wrap: wrap; gap: 0.45rem; margin: 0.75rem 0; padding: 0; list-style: none; }

/* ---------- review blocks ---------- */

.review { padding: 1.6rem 0; }
.review + .review { border-top: 1px dashed var(--mist); }
.review-head { display: flex; align-items: center; gap: 0.8rem; flex-wrap: wrap; margin-bottom: 0.3rem; }
.review-head h3 { margin: 0; }
.review .rating-row { display: flex; align-items: center; gap: 0.7rem; flex-wrap: wrap; margin: 0.3rem 0 0.9rem; }

.pros-cons {
  display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; margin: 1.1rem 0;
}
.pros-cons > div { background: #fff; border: 1px solid var(--mist); border-radius: 8px; padding: 1rem 1.1rem; }
.pros-cons h4 {
  font-family: var(--mono); font-size: 0.72rem; letter-spacing: 0.12em;
  text-transform: uppercase; margin-bottom: 0.6rem;
}
.pros h4 { color: var(--great-deep); }
.cons h4 { color: var(--poor-deep); }
.pros-cons ul { margin: 0; padding: 0; list-style: none; font-size: 0.92rem; }
.pros-cons li { padding-left: 1.4rem; position: relative; margin-bottom: 0.45rem; }
.pros-cons li:last-child { margin-bottom: 0; }
.pros-cons li::before {
  position: absolute; left: 0; top: 0; font-weight: 700; font-family: var(--mono);
}
.pros li::before { content: "\2713"; color: var(--great-deep); } /* ✓ */
.cons li::before { content: "\2715"; color: var(--poor-deep); } /* ✕ */

.verdict {
  background: #fff; border: 1px solid var(--mist); border-left: 4px solid var(--mist);
  border-radius: 0 8px 8px 0; padding: 0.9rem 1.1rem; margin: 1.1rem 0 0;
}
.verdict-label {
  font-family: var(--mono); font-size: 0.72rem; font-weight: 700;
  letter-spacing: 0.12em; text-transform: uppercase; margin-bottom: 0.3rem;
}
.verdict p:last-child { margin: 0; font-size: 0.95rem; }
.verdict--great { border-left-color: var(--great); } .verdict--great .verdict-label { color: var(--great-deep); }
.verdict--ok    { border-left-color: var(--ok); }    .verdict--ok .verdict-label    { color: var(--ok-deep); }
.verdict--poor  { border-left-color: var(--poor); }  .verdict--poor .verdict-label  { color: var(--poor-deep); }

/* ---------- generic content blocks ---------- */

.cols-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 1.25rem; }
.card {
  background: #fff; border: 1px solid var(--mist); border-radius: 8px; padding: 1.25rem;
}
.card h3 { margin-top: 0; }
.card p { font-size: 0.95rem; }

.rules { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1rem; margin: 0; padding: 0; list-style: none; }
.rules li { background: #fff; border: 1px solid var(--mist); border-radius: 8px; padding: 1.1rem 1.2rem; }
.rules b { display: block; margin-bottom: 0.25rem; }
.rules li p { font-size: 0.92rem; color: var(--muted); margin: 0; }

.steps { counter-reset: step; margin: 1rem 0 0; padding: 0; list-style: none; }
.steps li {
  counter-increment: step; position: relative; padding: 0 0 1.1rem 3rem;
  border-left: 1px solid var(--mist); margin-left: 0.9rem;
}
.steps li:last-child { padding-bottom: 0; border-left-color: transparent; }
.steps li::before {
  content: counter(step);
  position: absolute; left: -0.95rem; top: -0.1rem;
  width: 1.8rem; height: 1.8rem; border-radius: 50%;
  background: var(--ink); color: #fff; font-family: var(--mono); font-weight: 700;
  font-size: 0.85rem; display: flex; align-items: center; justify-content: center;
}
.steps b { display: block; }
.steps p { font-size: 0.93rem; color: var(--muted); margin: 0.15rem 0 0; }

.scale { margin: 1rem 0 0; padding: 0; list-style: none; display: grid; gap: 0.6rem; }
.scale li {
  display: flex; align-items: baseline; gap: 0.9rem; flex-wrap: wrap;
  background: #fff; border: 1px solid var(--mist); border-radius: 8px; padding: 0.8rem 1rem;
}
.scale .score { flex: none; }
.scale p { margin: 0; font-size: 0.93rem; flex: 1 1 18rem; }

dl.decoder { margin: 0; }
dl.decoder dt {
  font-family: var(--mono); font-weight: 700; font-size: 0.85rem; margin-top: 0.9rem;
}
dl.decoder dd { margin: 0.1rem 0 0; font-size: 0.93rem; color: var(--muted); }

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

.site-footer { background: var(--ink); color: var(--mist); margin-top: 3rem; }
.footer-grid {
  display: grid; grid-template-columns: 2fr 1fr 2fr; gap: 2rem;
  padding-top: 2.2rem; padding-bottom: 1.6rem;
}
.site-footer h4 {
  color: #fff; font-family: var(--mono); font-size: 0.72rem;
  letter-spacing: 0.12em; text-transform: uppercase; margin-bottom: 0.6rem;
}
.site-footer p { font-size: 0.88rem; }
.site-footer a { color: #cbd5e1; }
.site-footer a:hover { color: #fff; }
.footer-nav ul { margin: 0; padding: 0; list-style: none; }
.footer-nav li { margin-bottom: 0.35rem; }
.footer-nav a { text-decoration: none; font-size: 0.9rem; }
.footer-bottom {
  display: flex; justify-content: space-between; flex-wrap: wrap; gap: 0.3rem 1.5rem;
  border-top: 1px solid #27334d;
  padding-top: 1rem; padding-bottom: 1.4rem;
  font-family: var(--mono); font-size: 0.75rem; color: #94a3b8;
}
.footer-bottom p { margin: 0; font-size: inherit; }

/* ---------- page intro band ---------- */

.page-head { padding: 2.4rem 0 1.8rem; border-bottom: 1px solid var(--mist); }
.page-head h1 { max-width: 26ch; }
.page-head .lede { color: var(--muted); max-width: 58ch; font-size: 1.05rem; margin: 0; }

/* ---------- responsive ---------- */

@media (max-width: 900px) {
  .hero { display: block; }
  .hero-scale { display: none; }
}
@media (max-width: 860px) {
  .picks { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr; gap: 1.4rem; }
}
@media (max-width: 680px) {
  .cols-2, .pros-cons, .rules { grid-template-columns: 1fr; }
  .hero { padding-top: 2.2rem; }
  .section { padding: 1.8rem 0; }
}
