@import url('https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@500;600;700&family=IBM+Plex+Sans:wght@400;500;600&family=IBM+Plex+Mono:wght@400;500;600;700&display=swap');

/* ---------------------------------------------------------------
   Bench-diagnostic direction: the site viewed as if through a
   piece of benchtop test equipment (oscilloscope / PSU tester) —
   the gear this exact audience already owns to validate builds.
   Dark phosphor-green panels, amber readouts, and the signature
   element: every numeric spec renders as an animated meter bar
   instead of a plain table cell, scaled so the winning part's bar
   sits at full width. Brand colors (AMD/Intel/NVIDIA only — see
   the compound-selector note below) are the industry-standard
   red/blue/green, brightened for a dark background and checked
   against 4.5:1 on every background they actually sit on.
   --------------------------------------------------------------- */
:root {
  --void: #0b120f;
  --panel: #121a16;
  --panel-2: #1a2420;
  --line: #243029;
  --line-bright: #3a4a41;
  --fg: #e8ede8;
  --fg-dim: #93a399;
  --fg-faint: #5c6b62;
  --amber: #e8a33d;
  --amber-bright: #f4b95e;
  --amber-dim: #5c4823;
  --amd: #ef5b3f;
  --intel: #5fa8e8;
  --nvidia: #76c964;
  --mono: 'IBM Plex Mono', ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --sans: 'IBM Plex Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --display: 'Space Grotesk', var(--sans);
  --content-max: 1500px;
  --sidebar-w: 196px;
  --r: 10px;
  --r-sm: 5px;
}

* { box-sizing: border-box; }
html { background: var(--void); }
body {
  margin: 0;
  color: var(--fg);
  background:
    radial-gradient(circle at 15% 8%, rgba(232,163,61,.05), transparent 45%),
    var(--void);
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
}
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; }
button:focus-visible, input:focus-visible, select:focus-visible { outline: 2px solid var(--amber); outline-offset: 2px; }
::selection { background: var(--amber-dim); color: var(--fg); }

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

/* Contact-edge: the recurring gold "connector finger" tick pattern.
   Bookends the page — under the header, and above the footer. */
.contact-edge {
  height: 3px;
  background-image: repeating-linear-gradient(90deg, var(--amber) 0 3px, transparent 3px 9px);
  opacity: .85;
}

/* Faint scanline + trace-line texture, evoking an instrument's dark
   display rather than a flat rectangle. */
.site-header {
  background:
    repeating-linear-gradient(180deg, rgba(232,237,232,.02) 0 1px, transparent 1px 3px),
    repeating-linear-gradient(90deg, rgba(232,237,232,.028) 0 1px, transparent 1px 64px),
    linear-gradient(180deg, #101d17, var(--void));
  border-bottom: 1px solid var(--line);
}
.header-inner { max-width: var(--content-max); margin: 0 auto; padding: 26px 28px 24px; display: flex; align-items: center; gap: 14px; }
.brand-mark { width: 38px; height: 38px; border-radius: 8px; flex: none; background: var(--panel); border: 1px solid var(--line-bright); display: flex; align-items: center; justify-content: center; }
.brand-mark svg { width: 21px; height: 21px; color: var(--amber); }
h1 { margin: 0; font-family: var(--display); font-size: 24px; line-height: 1; font-weight: 700; letter-spacing: -.02em; color: var(--fg); }
.header-inner p { margin: 8px 0 0; color: var(--fg-dim); font-size: 13px; }

.footer-inner { max-width: var(--content-max); margin: 0 auto; padding: 20px 28px 30px; display: flex; justify-content: space-between; align-items: baseline; gap: 24px; flex-wrap: wrap; }
.footer-stat { font-family: var(--mono); font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: var(--fg-dim); white-space: nowrap; }
.footer-note { max-width: 560px; font-size: 12px; line-height: 1.6; color: var(--fg-faint); }
.footer-note strong { color: var(--fg-dim); font-weight: 600; }

.layout { max-width: var(--content-max); margin: 0 auto; padding: 0 28px 60px; display: grid; grid-template-columns: var(--sidebar-w) minmax(0, 1fr); gap: 30px; }
.sidebar { padding-top: 22px; min-height: calc(100vh - 100px); position: sticky; top: 0; align-self: start; }
.tab { position: relative; width: calc(100% - 6px); display: flex; justify-content: space-between; align-items: center; gap: 10px; border: 1px solid transparent; background: transparent; border-radius: var(--r-sm); padding: 9px 12px; margin: 1px 0; color: var(--fg-dim); text-align: left; transition: background .12s ease, color .12s ease, border-color .12s ease; }
.tab-label { display: flex; align-items: center; gap: 10px; min-width: 0; }
.tab-icon { width: 18px; height: 18px; flex: none; color: var(--fg-faint); transition: color .12s ease; }
.tab-icon svg { width: 100%; height: 100%; display: block; }
.tab::before { content: ''; position: absolute; left: 0; top: 4px; bottom: 4px; width: 3px; border-radius: 2px; background: transparent; }
.tab:hover { color: var(--fg); background: var(--panel); }
.tab:hover .tab-icon { color: var(--fg-dim); }
.tab.active { color: var(--fg); font-weight: 600; background: var(--panel); border-color: var(--line-bright); }
.tab.active .tab-icon { color: var(--amber); }
.tab.active::before { background-image: repeating-linear-gradient(180deg, var(--amber) 0 3px, transparent 3px 6px); }
.tab-count { font-family: var(--mono); font-size: 11px; color: var(--amber); background: rgba(232,163,61,.12); border-radius: 3px; padding: 1px 6px; }

.main { min-width: 0; padding-top: 24px; }
.category-head { display: flex; justify-content: space-between; align-items: end; gap: 20px; padding-bottom: 16px; border-bottom: 1px solid var(--line); }
.category-name { font-family: var(--display); font-size: 32px; font-weight: 700; letter-spacing: -.02em; line-height: 1; }
.category-copy { color: var(--fg-dim); margin-top: 7px; max-width: 62ch; }
.selection-limit { font-family: var(--mono); font-size: 11px; text-transform: uppercase; letter-spacing: .08em; color: var(--fg-faint); white-space: nowrap; }

/* ---------- brand accent (AMD / Intel / NVIDIA only) ----------
   Compound selectors so these reliably beat the base color rule
   regardless of source order. */
.slot-brand.brand-amd, .col-brand.brand-amd, .slot-option-brand.brand-amd { color: var(--amd); }
.slot-brand.brand-intel, .col-brand.brand-intel, .slot-option-brand.brand-intel { color: var(--intel); }
.slot-brand.brand-nvidia, .col-brand.brand-nvidia, .slot-option-brand.brand-nvidia { color: var(--nvidia); }

/* ---------- compare slots ---------- */

.slots-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; padding: 20px 0; }
.slot { position: relative; border-radius: var(--r); min-height: 96px; }

.slot-filled { background: linear-gradient(180deg, var(--panel-2), var(--panel)); border: 1px solid var(--amber-dim); padding: 13px 16px; animation: slotIn .38s cubic-bezier(.2,.9,.3,1.1); }
@keyframes slotIn { from { opacity: 0; transform: translateY(3px) scale(.985); } to { opacity: 1; transform: none; } }
.slot-remove { position: absolute; top: 10px; right: 10px; width: 24px; height: 24px; border: 0; background: none; color: var(--fg-faint); font-size: 17px; line-height: 1; border-radius: var(--r-sm); }
.slot-remove:hover { color: var(--fg); background: var(--panel-2); }
.slot-brand { font-family: var(--mono); font-size: 11px; text-transform: uppercase; letter-spacing: .03em; color: var(--fg-dim); padding-right: 26px; }
.slot-name { font-family: var(--display); font-size: 17px; font-weight: 600; letter-spacing: -.01em; margin-top: 2px; padding-right: 26px; color: var(--fg); }
.slot-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-top: 12px; }
.slot-stat { min-width: 0; }

/* empty, active slot: a typeahead search box + browsable quick-chips */
.slot-search { background: var(--panel); border: 1px solid var(--line); padding: 12px 16px; display: flex; flex-direction: column; justify-content: center; gap: 8px; }
.slot-search-wrap { position: relative; display: flex; align-items: center; }
.slot-search .search-icon { position: absolute; left: 0; color: var(--fg-faint); pointer-events: none; }
.slot-search-input { width: 100%; border: 0; background: transparent; padding: 4px 4px 4px 22px; color: var(--fg); font-size: 15px; }
.slot-search-input:focus { outline: 0; }
.slot-search-input::placeholder { color: var(--fg-faint); }
.quick-chips { display: flex; flex-wrap: wrap; gap: 6px; padding-left: 22px; }
.quick-chip { border: 1px solid var(--line-bright); background: var(--panel-2); color: var(--fg-dim); border-radius: 20px; padding: 3px 10px; font-size: 11px; font-family: var(--mono); transition: border-color .12s ease, color .12s ease; }
.quick-chip:hover { border-color: var(--amber); color: var(--fg); }

.slot-dropdown { position: absolute; left: 0; right: 0; top: calc(100% + 6px); z-index: 30; max-height: 280px; overflow-y: auto; background: var(--panel-2); border: 1px solid var(--line-bright); border-radius: var(--r-sm); box-shadow: 0 18px 34px rgba(0,0,0,.45); }
.slot-dropdown:empty { display: none; border: 0; box-shadow: none; }
.slot-option { display: flex; flex-direction: column; align-items: flex-start; gap: 1px; width: 100%; border: 0; border-bottom: 1px solid var(--line); background: transparent; padding: 8px 12px; text-align: left; }
.slot-option:last-of-type { border-bottom: 0; }
.slot-option:hover, .slot-option.is-active { background: rgba(232,163,61,.08); }
.slot-option-brand { font-family: var(--mono); font-size: 10px; text-transform: uppercase; color: var(--fg-faint); }
.slot-option-name { font-size: 14px; color: var(--fg); }
.slot-dropdown-empty, .slot-dropdown-more { padding: 10px 12px; font-size: 12px; color: var(--fg-faint); }

/* inactive slot: "+ Add another" placeholder */
.slot-add { border: 1px dashed var(--line-bright); background: transparent; color: var(--fg-faint); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; font-size: 13px; transition: border-color .12s ease, color .12s ease, background .12s ease; }
.slot-add:hover { border-color: var(--amber); color: var(--fg); background: var(--panel); }
.slot-add-icon { font-family: var(--display); font-size: 20px; line-height: 1; color: var(--amber-dim); }
.slot-add:hover .slot-add-icon { color: var(--amber); }

.has-hint { cursor: help; border-bottom: 1px dotted var(--line-bright); }
.has-hint:hover { border-bottom-color: var(--amber); color: var(--fg); }
.spec-label { display: block; font-family: var(--mono); font-size: 10px; color: var(--fg-faint); text-transform: uppercase; letter-spacing: .04em; margin-bottom: 3px; }
.spec-value { display: block; font-family: var(--mono); font-size: 14px; font-weight: 600; color: var(--fg); font-variant-numeric: tabular-nums; }

/* ---------- inline comparison ---------- */

.compare-section:empty { display: none; }
.compare-hint { margin-top: 6px; padding: 40px 20px; text-align: center; color: var(--fg-dim); background: var(--panel); border: 1px dashed var(--line-bright); border-radius: var(--r); }
.compare-header { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin-top: 10px; padding: 4px 2px; }
.compare-title { font-family: var(--display); font-size: 21px; font-weight: 700; letter-spacing: -.02em; }
.compare-subtitle { margin-top: 4px; color: var(--fg-dim); font-size: 12px; font-family: var(--mono); }
.compare-controls { display: flex; align-items: center; justify-content: space-between; gap: 12px 16px; flex-wrap: wrap; padding: 10px 2px; border-bottom: 1px solid var(--line); font-size: 12px; color: var(--fg-dim); }
.diff-toggle { display: inline-flex; align-items: center; gap: 7px; cursor: pointer; }
.legend-best { display: inline-flex; align-items: center; gap: 6px; color: var(--fg-dim); }
.legend-dot { display: inline-block; width: 6px; height: 6px; border-radius: 50%; background: var(--amber); }
.btn-copy-link { border: 1px solid var(--line-bright); border-radius: var(--r-sm); background: transparent; color: var(--fg); padding: 5px 10px; font-size: 12px; }
.btn-copy-link:hover { border-color: var(--amber); background: var(--panel-2); }
.compare-body { overflow: auto; border: 1px solid var(--line); border-top: 0; border-radius: 0 0 var(--r) var(--r); background: var(--panel); }
.compare-table { width: 100%; border-collapse: collapse; }
.compare-table th, .compare-table td { padding: 12px 16px; text-align: left; border-bottom: 1px solid var(--line); }
.compare-table th:first-child, .compare-table td:first-child { width: 170px; }
.col-head { vertical-align: bottom; border-bottom: 2px solid var(--amber-dim) !important; min-width: 190px; }
.col-brand { font-family: var(--mono); font-size: 10px; text-transform: uppercase; color: var(--fg-dim); }
.col-name { font-family: var(--display); font-size: 15px; font-weight: 600; line-height: 1.25; margin-top: 2px; color: var(--fg); }
.row-label { font-family: var(--mono); font-size: 11px; font-weight: 400; text-align: left; color: var(--fg-dim); text-transform: uppercase; letter-spacing: .04em; white-space: nowrap; }
.row-diff { background: rgba(232,163,61,.035); }
.row-diff .row-label { color: var(--fg); font-weight: 600; }
.diff-empty { text-align: center !important; color: var(--fg-dim); padding: 30px !important; }

/* the signature element: a numeric spec rendered as a level-meter
   reading instead of plain text. Winner's bar sits at full scale. */
.meter-cell { min-width: 0; }
.meter-value { font-family: var(--mono); font-size: 14px; font-weight: 600; color: var(--fg-dim); font-variant-numeric: tabular-nums; margin-bottom: 5px; }
.meter-track { height: 5px; border-radius: 3px; background: var(--panel-2); overflow: hidden; border: 1px solid var(--line); }
.meter-fill { height: 100%; border-radius: 3px; background: var(--fg-faint); width: 0%; transition: width .55s cubic-bezier(.2,.85,.25,1); }
.meter-cell.is-best .meter-value { color: var(--amber-bright); }
.meter-cell.is-best .meter-fill { background: linear-gradient(90deg, var(--amber-dim), var(--amber)); box-shadow: 0 0 8px rgba(232,163,61,.35); }
.meter-cell-text { font-size: 13px; color: var(--fg-dim); padding: 5px 10px; background: var(--panel-2); border: 1px solid var(--line); border-radius: 20px; display: inline-block; }

@media (max-width: 900px) {
  .header-inner { padding: 22px 18px 20px; }
  .footer-inner { flex-direction: column; align-items: flex-start; padding: 18px 18px 24px; }
  .layout { display: block; padding: 0 18px 40px; }
  .sidebar { min-height: auto; position: static; display: flex; overflow-x: auto; padding: 10px 0; gap: 2px; }
  .tab { width: auto; flex: 0 0 auto; padding: 9px 14px; }
  .tab::before { top: auto; bottom: 0; left: 8px; right: 8px; width: auto; height: 3px; }
  .tab.active::before { background-image: repeating-linear-gradient(90deg, var(--amber) 0 3px, transparent 3px 6px); }
  .main { padding-top: 6px; }
  .slots-grid { grid-template-columns: 1fr; }
  .slot-stats { grid-template-columns: repeat(3, 1fr); }
}

@media (max-width: 560px) {
  .header-inner { padding: 20px 18px; gap: 12px; }
  h1 { font-size: 20px; }
  .category-head { align-items: flex-start; flex-direction: column; }
  .category-name { font-size: 27px; }
  .compare-table th, .compare-table td { padding: 10px; }
  .compare-table th:first-child, .compare-table td:first-child { width: 130px; }
  .col-head, .compare-table td:not(:first-child) { min-width: 160px; }
}
