/* ==========================================================================
   RGBTVs.com design system
   --------------------------------------------------------------------------
   One stylesheet, no framework, no build step. Every page is a combination of
   the components below; nothing is styled per-page.

   Two decisions worth stating up front, because they run through everything:

   1. NO WEB FONTS. The old site loaded three Google Fonts render-blocking
      (Bebas Neue, DM Sans, DM Serif Display) for a page whose largest text was
      a headline. That is two extra connections and a flash of invisible text
      on every visit, spent on decoration. The system stack below renders as
      SF Pro on Apple devices and Segoe UI on Windows — both excellent — and
      costs nothing. Hierarchy comes from scale, weight and space instead.

   2. ONE DARK THEME, COMMITTED TO. Brief §20 asks for a dark premium
      electronics aesthetic, so there is no light mode and no toggle: a second
      theme doubles the QA surface for something nobody asked for.
      ========================================================================= */

:root {
  /* ---- surfaces: near-black, slightly cool, never pure #000 ------------- */
  --bg:            #0b0d10;
  --surface:       #13161b;
  --surface-2:     #1a1e25;
  --surface-3:     #232830;
  --border:        #2a3038;
  --border-strong: #3a424d;

  /* ---- text ------------------------------------------------------------ */
  --text:          #e9ecf1;  /* 16.4:1 on --bg */
  --text-muted:    #9aa4b2;  /*  7.7:1 on --bg,  7.2:1 on --surface */
  /* Was #6b7482, which measured 4.12:1 on --bg and 3.84:1 on --surface — both
     under WCAG AA. This token carries the affiliate disclosure, the price
     capture date and the provenance chips, which are precisely the text a
     reader is entitled to be able to read. #828b99 clears 4.5:1 against every
     surface in the system, including --surface-2 at 4.86:1. */
  --text-faint:    #828b99;

  /* ---- accents --------------------------------------------------------- */
  /* Editorial blue for links and wayfinding. Deliberately calmer than the
     old #00b4ff, which read as gaming hardware rather than publication. */
  --accent:        #5b9cff;
  --accent-dim:    #2f4f80;

  /* Commerce amber, used ONLY for buy actions. Keeping the two roles on
     separate hues means a reader can tell at a glance which links cost money
     and which do not — which is an honesty feature, not just decoration. */
  --buy:           #f5a524;
  --buy-hover:     #ffb944;
  --buy-ink:       #1a1204;

  --positive:      #34d399;
  --caution:       #fbbf24;
  --negative:      #f87171;

  /* ---- type ------------------------------------------------------------ */
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;

  --step--1: clamp(0.79rem, 0.77rem + 0.10vw, 0.84rem);
  --step-0:  clamp(1.00rem, 0.96rem + 0.18vw, 1.09rem);
  --step-1:  clamp(1.25rem, 1.18rem + 0.34vw, 1.45rem);
  --step-2:  clamp(1.56rem, 1.44rem + 0.60vw, 1.94rem);
  --step-3:  clamp(1.95rem, 1.74rem + 1.00vw, 2.58rem);
  --step-4:  clamp(2.44rem, 2.09rem + 1.65vw, 3.44rem);

  /* ---- space & shape --------------------------------------------------- */
  --sp-1: 0.25rem; --sp-2: 0.5rem;  --sp-3: 0.75rem; --sp-4: 1rem;
  --sp-5: 1.5rem;  --sp-6: 2rem;    --sp-7: 3rem;    --sp-8: 4.5rem;
  --radius: 10px;
  --radius-sm: 6px;
  --shadow: 0 1px 2px rgb(0 0 0 / 0.4), 0 8px 24px rgb(0 0 0 / 0.25);
  --measure: 68ch;
}

*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; }

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

/* The header is sticky, so anything an in-page link jumps to must reserve its
   height or the heading lands underneath it. Applied to every element that can
   be an anchor target rather than to a hand-maintained list of ids. */
:target, [id] { scroll-margin-top: calc(60px + var(--sp-5)); }

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: var(--step-0);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

a { color: var(--accent); text-decoration-thickness: 1px; text-underline-offset: 2px; }
a:hover { color: #86b5ff; }

/* Focus is visible everywhere. Brief §33. */
:where(a, button, input, select, summary, [tabindex]):focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: var(--radius-sm);
}

img { max-width: 100%; height: auto; display: block; }

h1, h2, h3, h4 { line-height: 1.15; letter-spacing: -0.015em; font-weight: 640; text-wrap: balance; }
h1 { font-size: var(--step-4); }
h2 { font-size: var(--step-2); }
h3 { font-size: var(--step-1); }
p  { text-wrap: pretty; }

.prose > * + * { margin-top: var(--sp-4); }
.prose { max-width: var(--measure); }
.prose h2 { margin-top: var(--sp-7); }
.prose h3 { margin-top: var(--sp-6); }
.prose ul, .prose ol { padding-left: 1.25em; }
.prose li + li { margin-top: var(--sp-2); }

.wrap { width: min(100% - 2.5rem, 1180px); margin-inline: auto; }
.wrap-narrow { width: min(100% - 2.5rem, 760px); margin-inline: auto; }
.section { padding-block: var(--sp-8); }
.stack > * + * { margin-top: var(--sp-4); }
.muted { color: var(--text-muted); }
.faint { color: var(--text-faint); font-size: var(--step--1); }

/* ============================================================ site header */

.site-header {
  position: sticky; top: 0; z-index: 50;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}
.site-header__bar {
  display: flex; align-items: center; gap: var(--sp-5);
  min-height: 60px;
}
.logo {
  font-weight: 720; letter-spacing: -0.02em; font-size: 1.15rem;
  color: var(--text); text-decoration: none; white-space: nowrap;
}
.logo b { color: var(--accent); font-weight: 720; }

/* The old header collapsed into itself at desktop width because the nav had
   no flex rules and the CTA had no min-width. Both are handled here. */
.site-nav { display: flex; gap: var(--sp-5); margin-left: auto; flex-wrap: wrap; }
.site-nav a {
  color: var(--text-muted); text-decoration: none; font-size: var(--step--1);
  font-weight: 560; letter-spacing: 0.01em; white-space: nowrap;
}
.site-nav a:hover, .site-nav a[aria-current="page"] { color: var(--text); }
.header-cta { flex-shrink: 0; }

@media (max-width: 860px) {
  .site-header__bar { flex-wrap: wrap; padding-block: var(--sp-3); }
  .site-nav { order: 3; width: 100%; margin-left: 0; gap: var(--sp-4); overflow-x: auto; }
  .header-cta { margin-left: auto; }
}

/* ================================================================ buttons */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--sp-2);
  /* 0.75rem vertical puts the button at 46px tall. It was 0.6rem / 42px,
     just under the 44px minimum tap target, measured on a live phone
     viewport rather than guessed at. */
  padding: 0.75rem 1rem; min-height: 44px; border-radius: var(--radius-sm);
  font-size: var(--step--1); font-weight: 620; letter-spacing: 0.01em;
  text-decoration: none; border: 1px solid transparent; cursor: pointer;
  transition: background-color .12s ease, border-color .12s ease;
}
.btn--buy { background: var(--buy); color: var(--buy-ink); }
.btn--buy:hover { background: var(--buy-hover); color: var(--buy-ink); }
.btn--ghost { border-color: var(--border-strong); color: var(--text); background: transparent; }
.btn--ghost:hover { border-color: var(--accent); color: var(--text); }
/* Not a link, because there is nothing to link to. */
.btn--unavailable { border-color: var(--border); color: var(--text-faint); cursor: default; }

/* ============================================================= breadcrumbs */

.breadcrumbs { font-size: var(--step--1); color: var(--text-faint); }
.breadcrumbs ol { list-style: none; padding: 0; display: flex; flex-wrap: wrap; gap: var(--sp-2); }
.breadcrumbs li:not(:last-child)::after { content: "/"; margin-left: var(--sp-2); color: var(--border-strong); }
.breadcrumbs a { color: var(--text-muted); text-decoration: none; }
.breadcrumbs a:hover { color: var(--text); text-decoration: underline; }

/* ================================================================= badges */

.badge {
  display: inline-flex; align-items: center; gap: 0.35em;
  padding: 0.2em 0.6em; border-radius: 999px;
  font-size: 0.72rem; font-weight: 620; letter-spacing: 0.03em;
  text-transform: uppercase; white-space: nowrap;
  border: 1px solid var(--border-strong); color: var(--text-muted);
}
/* RGB gets its own treatment — it is the site's whole reason for existing. */
.badge--rgb { border-color: var(--accent-dim); color: var(--accent); background: color-mix(in srgb, var(--accent) 10%, transparent); }
.badge--oled { border-color: #6d5bd0; color: #a99af0; }
.badge--lcd { border-color: var(--border-strong); color: var(--text-muted); }
.badge--buyable { border-color: color-mix(in srgb, var(--positive) 40%, transparent); color: var(--positive); }
.badge--unbuyable { border-color: color-mix(in srgb, var(--caution) 35%, transparent); color: var(--caution); }

.update-badge {
  display: inline-flex; align-items: center; gap: 0.4em;
  font-size: var(--step--1); color: var(--text-faint);
}
.update-badge time { color: var(--text-muted); }

/* =========================================================== product card */

.product-card {
  display: flex; flex-direction: column;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); overflow: hidden;
}
.product-card:hover { border-color: var(--border-strong); }

/* Amazon product images are shot on white. On a dark page an untreated one is
   a glaring white rectangle, so every image sits on its own light plate — it
   reads as a product photo rather than a hole in the layout. */
.product-card__media {
  /* Pure white, not an off-white. Amazon product shots are on #fff, so any
     other value draws a visible rectangle around the photo inside the plate. */
  background: #fff;
  aspect-ratio: 4 / 3;
  display: grid; place-items: center;
  padding: var(--sp-4);
  position: relative;
}
/* No mix-blend-mode here. It was `multiply`, on the theory that it would melt
   the image's white background into the plate — but Amazon images are already
   on white, so it bought nothing, and it rendered the product invisible in
   some compositors. The plate alone does the job. */
.product-card__media img { max-height: 100%; width: auto; object-fit: contain; }
.product-card__media--empty { background: var(--surface-2); color: var(--text-faint); font-size: var(--step--1); }
.product-card__rank {
  position: absolute; top: var(--sp-3); left: var(--sp-3);
  background: var(--bg); color: var(--text); border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm); padding: 0.15em 0.55em;
  font-size: 0.72rem; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase;
}
.product-card__body { padding: var(--sp-4); display: flex; flex-direction: column; gap: var(--sp-3); flex: 1; }
.product-card__brand { font-size: var(--step--1); color: var(--text-faint); letter-spacing: 0.06em; text-transform: uppercase; }
.product-card__name { font-size: var(--step-1); }
.product-card__name a { color: inherit; text-decoration: none; }
.product-card__name a:hover { color: var(--accent); }
.product-card__verdict { color: var(--text-muted); font-size: 0.95rem; }
.product-card__points { list-style: none; padding: 0; display: grid; gap: var(--sp-2); font-size: 0.92rem; }
.product-card__points li { display: flex; gap: var(--sp-2); color: var(--text-muted); }
.product-card__points li::before { content: "+"; color: var(--positive); font-weight: 700; flex-shrink: 0; }
.product-card__points li.is-limit::before { content: "−"; color: var(--negative); }
.product-card__foot { margin-top: auto; padding-top: var(--sp-3); border-top: 1px solid var(--border); display: grid; gap: var(--sp-2); }

.price { font-size: var(--step-1); font-weight: 680; color: var(--text); letter-spacing: -0.01em; }
.price--none { font-size: var(--step-0); color: var(--text-muted); font-weight: 500; }
.price-meta { font-size: 0.75rem; color: var(--text-faint); }

.card-grid { display: grid; gap: var(--sp-5); grid-template-columns: repeat(auto-fill, minmax(min(100%, 280px), 1fr)); }

/* ============================================================ verdict box */

.verdict {
  border: 1px solid var(--border); border-left: 3px solid var(--accent);
  background: var(--surface); border-radius: var(--radius);
  padding: var(--sp-5); display: grid; gap: var(--sp-3);
}
.verdict__label { font-size: var(--step--1); text-transform: uppercase; letter-spacing: 0.08em; color: var(--accent); font-weight: 640; }
.verdict__answer { font-size: var(--step-1); line-height: 1.45; }

/* The direct-answer block from brief §22: a question-led heading followed
   immediately by a short factual answer, in a container an extraction model
   can find. Same markup wherever it appears, which is the point. */
.answer { border: 1px solid var(--border); background: var(--surface); border-radius: var(--radius); padding: var(--sp-5); }
.answer h2, .answer h3 { font-size: var(--step-1); margin-bottom: var(--sp-3); }
.answer > p:first-of-type { font-size: 1.05rem; color: var(--text); }

/* ============================================================== pros/cons */

.proscons { display: grid; gap: var(--sp-4); grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr)); }
.proscons__col { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: var(--sp-4); }
.proscons__title { font-size: var(--step--1); text-transform: uppercase; letter-spacing: 0.08em; font-weight: 640; margin-bottom: var(--sp-3); }
.proscons__col--pro .proscons__title { color: var(--positive); }
.proscons__col--con .proscons__title { color: var(--negative); }
.proscons ul { list-style: none; padding: 0; display: grid; gap: var(--sp-2); }
.proscons li { display: flex; gap: var(--sp-2); color: var(--text-muted); font-size: 0.95rem; }
.proscons__col--pro li::before { content: "+"; color: var(--positive); font-weight: 700; }
.proscons__col--con li::before { content: "−"; color: var(--negative); font-weight: 700; }

/* ================================================================= tables */

.table-scroll { overflow-x: auto; border: 1px solid var(--border); border-radius: var(--radius); }
table { border-collapse: collapse; width: 100%; font-size: 0.95rem; }
caption { text-align: left; padding: var(--sp-3) var(--sp-4); color: var(--text-muted); font-size: var(--step--1); }
th, td { padding: 0.7rem var(--sp-4); text-align: left; border-bottom: 1px solid var(--border); vertical-align: top; }
thead th {
  background: var(--surface-2); color: var(--text);
  font-size: 0.72rem; letter-spacing: 0.07em; text-transform: uppercase; font-weight: 640;
  position: sticky; top: 0;
}
tbody tr:last-child td { border-bottom: 0; }
tbody th { color: var(--text-muted); font-weight: 500; }
td.is-better { color: var(--positive); font-weight: 600; }
td.is-numeric { font-variant-numeric: tabular-nums; }

/* "Not enough data" is a first-class state, styled to look deliberate rather
   than broken. Brief §36: display it instead of guessing. */
.no-data { color: var(--text-faint); font-style: italic; font-size: 0.9rem; }

/* Provenance marker. Every spec value that came from somewhere shows where. */
.src {
  font-size: 0.68rem; letter-spacing: 0.04em; text-transform: uppercase;
  color: var(--text-faint); border: 1px solid var(--border); border-radius: 3px;
  padding: 0.05em 0.35em; margin-left: 0.5em; white-space: nowrap;
  text-decoration: none;
}
a.src:hover { border-color: var(--accent-dim); color: var(--accent); }

/* ================================================================= scores */

.scores { display: grid; gap: var(--sp-3); }
.score { display: grid; grid-template-columns: 11rem 1fr auto; gap: var(--sp-4); align-items: center; }
.score__label { font-size: 0.9rem; color: var(--text-muted); }
.score__track { height: 6px; background: var(--surface-3); border-radius: 999px; overflow: hidden; }
.score__fill { height: 100%; background: var(--accent); border-radius: 999px; }
.score__value { font-variant-numeric: tabular-nums; font-weight: 640; font-size: 0.9rem; min-width: 3.5ch; text-align: right; }
.score--nodata .score__track { background: repeating-linear-gradient(90deg, var(--surface-3) 0 6px, transparent 6px 12px); }
@media (max-width: 560px) { .score { grid-template-columns: 1fr auto; } .score__track { grid-column: 1 / -1; } }

/* =========================================================== source panel */

.sources { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: var(--sp-5); }
.sources h2, .sources h3 { font-size: var(--step-0); margin-bottom: var(--sp-3); }
.sources ol { list-style: none; padding: 0; display: grid; gap: var(--sp-4); counter-reset: src; }
.sources li { display: grid; gap: var(--sp-1); font-size: 0.92rem; counter-increment: src; }
.sources li::before { content: counter(src) "."; color: var(--text-faint); font-variant-numeric: tabular-nums; }
.sources__claim { color: var(--text); }
.sources__meta { color: var(--text-faint); font-size: 0.8rem; }

/* ========================================================== affiliate CTA */

.buybox {
  background: var(--surface); border: 1px solid var(--border-strong);
  border-radius: var(--radius); padding: var(--sp-5);
  display: grid; gap: var(--sp-3);
}
.buybox__row { display: flex; align-items: baseline; justify-content: space-between; gap: var(--sp-4); flex-wrap: wrap; }
.buybox .btn--buy { width: 100%; }
.disclosure { font-size: 0.78rem; color: var(--text-faint); line-height: 1.5; }
.disclosure a { color: var(--text-muted); }

/* ============================================================== utilities */

.hr { border: 0; border-top: 1px solid var(--border); }
.eyebrow { font-size: var(--step--1); text-transform: uppercase; letter-spacing: 0.1em; color: var(--accent); font-weight: 640; }
.section-head { display: grid; gap: var(--sp-2); margin-bottom: var(--sp-6); max-width: var(--measure); }

.skip-link {
  position: absolute; left: -9999px;
  background: var(--accent); color: var(--bg); padding: var(--sp-3) var(--sp-4); border-radius: var(--radius-sm);
}
.skip-link:focus { left: var(--sp-4); top: var(--sp-4); z-index: 100; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
