:root {
  --bg: #07100f;
  --panel: #0c1715;
  --panel-strong: #101f1c;
  --ink: #f1f5e9;
  --muted: #91a39b;
  --line: #243732;
  --line-bright: #3c554d;
  --signal: #d9ff57;
  --signal-soft: rgba(217, 255, 87, 0.12);
  --cyan: #58dfcf;
  --amber: #ffbd5c;
  --red: #ff6f61;
  --violet: #b799ff;
  --nvidia: #91d950;
  --amd: #ff6b5f;
  --intel: #5bb8ff;
  --apple: #d8dce1;
  --mono: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
  --sans: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  background: var(--bg);
  color: var(--ink);
}

body {
  min-height: 100vh;
  margin: 0;
  background:
    linear-gradient(rgba(88, 223, 207, 0.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(88, 223, 207, 0.025) 1px, transparent 1px),
    radial-gradient(circle at 70% -10%, rgba(88, 223, 207, 0.11), transparent 34rem),
    var(--bg);
  background-size: 28px 28px, 28px 28px, auto, auto;
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.45;
}

button,
input,
select {
  font: inherit;
}

a {
  color: inherit;
}

.masthead,
main,
footer {
  width: min(1560px, calc(100% - 32px));
  margin-inline: auto;
}

.masthead {
  padding: 22px 0 18px;
  border-bottom: 1px solid var(--line);
}

.back-link {
  display: inline-flex;
  align-items: center;
  min-height: 38px;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 0.82rem;
  text-decoration: none;
}

.back-link:hover {
  color: var(--signal);
}

.title-row {
  padding-top: 26px;
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--cyan);
  font-family: var(--mono);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

h1,
h2,
p {
  overflow-wrap: anywhere;
}

h1 {
  margin: 0;
  font-family: var(--mono);
  font-size: clamp(3.2rem, 8vw, 7.5rem);
  font-weight: 500;
  letter-spacing: -0.08em;
  line-height: 0.78;
  text-transform: uppercase;
}

h1 span {
  color: var(--signal);
}

h2 {
  margin: 0;
  font-size: clamp(1.55rem, 3vw, 2.3rem);
  font-weight: 600;
  letter-spacing: -0.04em;
  line-height: 1;
}

main {
  padding: 22px 0 72px;
}

.readout-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  border: 1px solid var(--line);
  background: rgba(6, 14, 12, 0.76);
}

.readout {
  min-width: 0;
  padding: 16px 18px 14px;
  border-left: 1px solid var(--line);
}

.readout:first-child {
  border-left: 0;
}

.readout-primary {
  background: var(--signal-soft);
}

.readout-label,
.readout-detail {
  display: block;
}

.readout-label {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.readout strong {
  display: block;
  margin: 4px 0 2px;
  color: var(--signal);
  font-family: var(--mono);
  font-size: clamp(1.6rem, 3vw, 2.45rem);
  font-weight: 500;
  letter-spacing: -0.06em;
  line-height: 1;
}

.readout-detail {
  overflow: hidden;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 0.74rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.workbench {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(9.5rem, 1fr));
  gap: 12px;
  align-items: end;
  margin: 16px 0;
  padding: 16px;
  border: 1px solid var(--line);
  background: rgba(12, 23, 21, 0.9);
}

.search-control,
.vendor-filter {
  grid-column: span 2;
}

.search-control label,
.select-control label,
.year-control > label,
.catalog-tools label {
  display: block;
  margin-bottom: 6px;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
}

input,
select,
.reset-button,
.vendor-button,
.pagination button,
.plot-presets button {
  min-height: 44px;
  border: 1px solid var(--line-bright);
  border-radius: 0;
  background: #081210;
  color: var(--ink);
}

input,
select {
  width: 100%;
  padding: 0 12px;
}

input::placeholder {
  color: #63756d;
}

input:focus-visible,
select:focus-visible,
button:focus-visible,
a:focus-visible {
  outline: 2px solid var(--signal);
  outline-offset: 2px;
}

.vendor-filter {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 5px;
}

.vendor-button {
  position: relative;
  min-width: 0;
  padding: 0 8px;
  color: var(--muted);
  cursor: pointer;
  font-family: var(--mono);
  font-size: 0.76rem;
}

.vendor-button::before {
  display: inline-block;
  width: 7px;
  height: 7px;
  margin-right: 6px;
  border-radius: 50%;
  background: var(--vendor-color, var(--muted));
  content: "";
}

.vendor-button[aria-pressed="true"] {
  border-color: var(--vendor-color, var(--signal));
  background: color-mix(in srgb, var(--vendor-color, var(--signal)) 13%, #081210);
  color: var(--ink);
}

.year-control > div {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 7px;
  align-items: center;
}

.year-control span {
  color: var(--muted);
  font-family: var(--mono);
  font-size: 0.75rem;
}

.year-control input {
  min-width: 0;
  padding-inline: 7px;
}

.check-control {
  display: flex;
  align-items: center;
  gap: 9px;
  min-height: 44px;
  color: #b8c5bf;
  font-size: 0.84rem;
  cursor: pointer;
}

.check-control input {
  width: 18px;
  min-height: 18px;
  accent-color: var(--signal);
}

.reset-button,
.pagination button,
.plot-presets button {
  padding: 0 13px;
  cursor: pointer;
  font-family: var(--mono);
  font-size: 0.78rem;
}

.reset-button:hover,
.pagination button:hover:not(:disabled),
.plot-presets button:hover,
.plot-presets button[aria-pressed="true"] {
  border-color: var(--signal);
  color: var(--signal);
}

.plot-panel,
.catalog-panel,
.notes {
  margin-top: 16px;
  border: 1px solid var(--line);
  background: rgba(12, 23, 21, 0.92);
}

.panel-heading {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: end;
  padding: 18px;
  border-bottom: 1px solid var(--line);
}

.plot-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: flex-end;
}

.plot-controls {
  display: grid;
  grid-template-columns: minmax(17rem, 1.5fr) repeat(5, minmax(8rem, 1fr));
  gap: 10px;
  align-items: end;
  padding: 14px 18px;
  border-bottom: 1px solid var(--line);
  background: rgba(5, 14, 12, 0.7);
}

.plot-controls > label > span,
.plot-presets legend {
  display: block;
  margin-bottom: 6px;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
}

.plot-presets {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 5px;
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
}

.plot-presets legend {
  grid-column: 1 / -1;
}

.plot-presets button {
  padding: 0 10px;
  color: var(--muted);
  cursor: pointer;
  font-family: var(--mono);
  font-size: 0.74rem;
}

.plot-presets button[aria-pressed="true"] {
  background: var(--signal-soft);
}

.legend-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 0.75rem;
}

.legend-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--vendor-color);
}

.plot-wrap {
  position: relative;
  min-height: 280px;
  padding: 8px 10px 0;
  overflow: hidden;
}

#metricPlot {
  display: block;
  width: 100%;
  min-width: 700px;
  height: auto;
  overflow: visible;
}

.plot-wrap:has(#metricPlot) {
  overflow-x: auto;
}

.plot-grid-line {
  stroke: #263a34;
  stroke-width: 1;
  vector-effect: non-scaling-stroke;
}

.plot-axis-label,
.plot-tick {
  fill: #82968d;
  font-family: var(--mono);
  font-size: 12px;
}

.plot-axis-label {
  fill: #b7c6bf;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.plot-point {
  cursor: crosshair;
  fill: var(--point-color);
  fill-opacity: 0.42;
  stroke: var(--point-color);
  stroke-opacity: 0.72;
  stroke-width: 1;
  transition: fill-opacity 100ms ease, stroke-width 100ms ease;
}

.plot-point:hover,
.plot-point:focus {
  fill-opacity: 0.92;
  stroke: #fff;
  stroke-width: 2;
}

.plot-point.system-price {
  stroke-dasharray: 2 2;
  stroke-width: 2;
}

.plot-tooltip {
  position: absolute;
  z-index: 4;
  width: max-content;
  max-width: 270px;
  padding: 10px 12px;
  border: 1px solid var(--line-bright);
  background: #020908;
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.4);
  color: var(--muted);
  pointer-events: none;
  font-family: var(--mono);
  font-size: 0.75rem;
}

.plot-tooltip strong {
  display: block;
  margin-bottom: 3px;
  color: var(--ink);
  font-size: 0.8rem;
}

.plot-note {
  margin: 0;
  padding: 8px 18px 14px;
  color: var(--muted);
  font-size: 0.78rem;
}

.catalog-heading {
  align-items: center;
}

.catalog-tools {
  display: flex;
  gap: 8px;
  align-items: center;
}

.catalog-tools label {
  margin: 0;
}

.catalog-tools select {
  width: auto;
  min-height: 38px;
}

.result-line {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 9px 18px;
  border-bottom: 1px solid var(--line);
  color: var(--muted);
  font-family: var(--mono);
  font-size: 0.76rem;
}

.result-line p {
  margin: 0;
}

.table-wrap {
  overflow-x: auto;
}

table {
  width: 100%;
  min-width: 1560px;
  border-collapse: collapse;
  table-layout: fixed;
}

th,
td {
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: middle;
}

th {
  position: sticky;
  top: 0;
  z-index: 2;
  background: #0a1513;
}

th:nth-child(1) { width: 20%; }
th:nth-child(2) { width: 9%; }
th:nth-child(3) { width: 8%; }
th:nth-child(4) { width: 8%; }
th:nth-child(5) { width: 9%; }
th:nth-child(6) { width: 8%; }
th:nth-child(7) { width: 10%; }
th:nth-child(8) { width: 9%; }
th:nth-child(9) { width: 7%; }
th:nth-child(10) { width: 12%; }

.sort-button {
  display: flex;
  width: 100%;
  min-height: 48px;
  gap: 5px;
  align-items: center;
  border: 0;
  padding: 0 13px;
  background: transparent;
  color: #bdcbc4;
  cursor: pointer;
  font-family: var(--mono);
  font-size: 0.75rem;
  font-weight: 700;
  text-align: left;
  text-transform: uppercase;
}

.sort-button:hover,
.sort-button[data-active="true"] {
  color: var(--signal);
}

.sort-button small {
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 400;
  text-transform: none;
}

.sort-button span {
  margin-left: auto;
}

td {
  height: 68px;
  padding: 9px 13px;
  color: #bac7c1;
  font-size: 0.82rem;
}

tbody tr {
  background: transparent;
  transition: background 100ms ease;
}

tbody tr:hover {
  background: rgba(88, 223, 207, 0.045);
}

.model-cell a {
  color: var(--ink);
  font-weight: 650;
  text-decoration: none;
}

.model-cell a:hover {
  color: var(--signal);
}

.model-cell small,
.date-cell small {
  display: block;
  margin-top: 3px;
  overflow: hidden;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 0.7rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.vendor-cell {
  color: var(--vendor-color, var(--ink));
  font-family: var(--mono);
  font-size: 0.76rem;
  font-weight: 700;
  text-transform: uppercase;
}

.market-chip {
  display: block;
  width: fit-content;
  margin-top: 4px;
  padding: 2px 5px;
  border: 1px solid var(--line);
  color: var(--muted);
  font-family: var(--mono);
  font-size: 0.64rem;
  font-weight: 400;
  text-transform: none;
}

.date-cell {
  color: #b7c4be;
  font-family: var(--mono);
  font-variant-numeric: tabular-nums;
}

.interface-cell,
.status-cell {
  color: #aebdb6;
  font-family: var(--mono);
  font-size: 0.72rem;
}

.status-cell span {
  display: inline-block;
  padding: 3px 6px;
  border: 1px solid var(--line-bright);
  color: var(--muted);
  white-space: nowrap;
}

.status-cell span[data-status="active"] {
  border-color: rgba(217, 255, 87, 0.42);
  color: var(--signal);
}

.status-cell span[data-status="announced"],
.status-cell span[data-status="unreleased"] {
  border-color: rgba(88, 223, 207, 0.42);
  color: var(--cyan);
}

.metric-cell {
  position: relative;
  overflow: hidden;
  font-family: var(--mono);
  font-size: 0.9rem;
  font-variant-numeric: tabular-nums;
}

.metric-cell a {
  color: inherit;
  text-decoration: none;
}

.metric-cell a:hover {
  color: var(--signal);
}

.metric-cell .price-note {
  display: block;
  max-width: 15ch;
  margin-top: 3px;
  overflow: hidden;
  color: var(--muted);
  font-size: 0.62rem;
  line-height: 1.2;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.metric-cell::before {
  position: absolute;
  inset: 11px auto 11px 0;
  width: var(--bar-width, 0%);
  max-width: 100%;
  background: linear-gradient(90deg, rgba(217, 255, 87, 0.18), rgba(217, 255, 87, 0.035));
  content: "";
}

.metric-cell span {
  position: relative;
  z-index: 1;
}

.metric-cell small {
  color: var(--muted);
  font-size: 0.68rem;
}

.missing {
  color: #63746d;
}

.empty-row td {
  height: 160px;
  color: var(--muted);
  text-align: center;
}

.pagination {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  align-items: center;
  padding: 14px 18px;
}

.pagination button:disabled {
  opacity: 0.36;
  cursor: not-allowed;
}

#pageStatus {
  min-width: 9rem;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 0.76rem;
  text-align: center;
}

.notes {
  display: grid;
  grid-template-columns: minmax(12rem, 0.65fr) minmax(0, 2fr);
  gap: 28px;
  padding: 24px;
}

.notes-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 22px;
}

.notes-grid p {
  margin: 0;
  color: var(--muted);
  font-size: 0.87rem;
  line-height: 1.55;
}

.notes-grid strong {
  color: var(--ink);
}

.sources {
  grid-column: 2;
  display: flex;
  flex-wrap: wrap;
  gap: 8px 14px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
  font-family: var(--mono);
  font-size: 0.72rem;
}

.sources span {
  color: var(--signal);
  font-weight: 700;
  text-transform: uppercase;
}

.sources a {
  color: var(--muted);
}

.sources a:hover {
  color: var(--ink);
}

footer {
  display: flex;
  justify-content: flex-end;
  gap: 18px;
  padding: 18px 0 30px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-family: var(--mono);
  font-size: 0.72rem;
  text-transform: uppercase;
}

@media (max-width: 1240px) {
  .workbench {
    grid-template-columns: repeat(4, 1fr);
  }

  .plot-controls {
    grid-template-columns: repeat(3, 1fr);
  }

  .plot-presets {
    grid-column: 1 / -1;
  }

  .check-control,
  .reset-button {
    align-self: stretch;
  }
}

@media (max-width: 900px) {
  .readout-grid {
    grid-template-columns: 1fr 1fr;
  }

  .readout:nth-child(3) {
    border-left: 0;
  }

  .readout:nth-child(n + 3) {
    border-top: 1px solid var(--line);
  }

  .workbench {
    grid-template-columns: 1fr 1fr;
  }

  .plot-controls {
    grid-template-columns: 1fr 1fr;
  }

  .search-control,
  .vendor-filter {
    grid-column: 1 / -1;
  }

  .notes {
    grid-template-columns: 1fr;
  }

  .notes-grid {
    grid-template-columns: 1fr;
  }

  .sources {
    grid-column: 1;
  }
}

@media (max-width: 600px) {
  .masthead,
  main,
  footer {
    width: min(100% - 20px, 1560px);
  }

  .masthead {
    padding-top: 10px;
  }

  .title-row {
    padding-top: 18px;
  }

  h1 {
    font-size: clamp(3rem, 20vw, 5.3rem);
  }

  .readout-grid,
  .workbench,
  .plot-controls {
    grid-template-columns: 1fr;
  }

  .readout,
  .readout:nth-child(3) {
    border-top: 1px solid var(--line);
    border-left: 0;
  }

  .readout:first-child {
    border-top: 0;
  }

  .search-control,
  .vendor-filter {
    grid-column: auto;
  }

  .plot-presets {
    grid-column: auto;
  }

  .vendor-filter {
    grid-template-columns: repeat(2, 1fr);
  }

  .vendor-button:first-child {
    grid-column: 1 / -1;
  }

  .panel-heading {
    align-items: flex-start;
    flex-direction: column;
  }

  .plot-legend {
    justify-content: flex-start;
  }

  .result-line {
    flex-direction: column;
    gap: 4px;
  }

  .pagination {
    justify-content: space-between;
    gap: 6px;
  }

  .pagination button {
    padding-inline: 8px;
  }

  #pageStatus {
    min-width: auto;
  }

  .notes {
    padding: 18px;
  }

  footer {
    flex-direction: column;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
  }
}
