:root {
  --bg0: #12110f;
  --bg1: #1c1a16;
  --bg2: #26231d;
  --line: #3a342b;
  --ink: #f2ebe0;
  --muted: #a89a86;
  --accent: #d4a017;
  --accent-dim: #9a7412;
  --full: #c45c26;
  --mid: #2f6f6a;
  --font: "Outfit", sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, monospace;
}

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

html {
  color-scheme: dark;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font);
  color: var(--ink);
  background:
    radial-gradient(ellipse 90% 50% at 10% -10%, #3a2a12 0%, transparent 55%),
    radial-gradient(ellipse 70% 40% at 100% 0%, #1a2a28 0%, transparent 50%),
    linear-gradient(180deg, var(--bg0), #0c0b09 100%);
}

.page {
  width: min(1280px, calc(100% - 2rem));
  margin: 0 auto;
  padding: 2.5rem 0 4rem;
}

.hero {
  margin-bottom: 2rem;
}

.brand {
  margin: 0 0 0.35rem;
  font-size: clamp(2.4rem, 6vw, 4rem);
  font-weight: 700;
  letter-spacing: -0.04em;
  line-height: 1;
  color: var(--accent);
}

.hero h1 {
  margin: 0;
  font-size: clamp(1.1rem, 2.4vw, 1.45rem);
  font-weight: 600;
  color: var(--ink);
}

.lede {
  margin: 0.75rem 0 0;
  max-width: 40rem;
  color: var(--muted);
  line-height: 1.45;
}

.toolbar {
  display: grid;
  gap: 0.85rem;
  margin-bottom: 1.25rem;
  padding: 1rem;
  background: color-mix(in srgb, var(--bg1) 88%, transparent);
  border: 1px solid var(--line);
}

.search input,
.filters select {
  width: 100%;
  padding: 0.7rem 0.85rem;
  border: 1px solid var(--line);
  border-radius: 0;
  background: var(--bg2);
  color: var(--ink);
  font: inherit;
}

.search input:focus,
.filters select:focus {
  outline: 2px solid var(--accent-dim);
  outline-offset: 1px;
}

.filters {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.75rem;
}

.profile-select {
  grid-column: span 2;
}

.profile-panel {
  padding: 0.85rem 1rem;
  border: 1px solid color-mix(in srgb, var(--accent) 35%, var(--line));
  background: color-mix(in srgb, var(--bg2) 80%, transparent);
}

.profile-head h2 {
  margin: 0;
  font-size: 1rem;
  font-weight: 600;
}

.profile-head p {
  margin: 0.25rem 0 0;
  color: var(--muted);
  font-size: 0.85rem;
}

.profile-notes {
  margin: 0.75rem 0;
  padding-left: 1.1rem;
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.45;
}

.profile-targets {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.78rem;
}

.profile-targets th,
.profile-targets td {
  padding: 0.35rem 0.5rem;
  border-top: 1px solid var(--line);
  text-align: left;
  white-space: normal;
}

.profile-targets th {
  position: static;
  background: transparent;
  color: var(--muted);
  font-weight: 600;
}

.match-score {
  display: inline-block;
  min-width: 2.8rem;
  padding: 0.15rem 0.35rem;
  font-family: var(--mono);
  font-size: 0.78rem;
  font-weight: 600;
  text-align: center;
}

.match-score.match-high {
  background: color-mix(in srgb, #3d7a4a 40%, transparent);
  color: #b8e6c0;
}

.match-score.match-mid {
  background: color-mix(in srgb, var(--accent) 30%, transparent);
  color: #f0dfa8;
}

.match-score.match-low {
  background: color-mix(in srgb, #6b4a3a 35%, transparent);
  color: #d4b8a8;
}

#matchHeader {
  width: 4rem;
}

.match {
  width: 4rem;
}

.filters label {
  display: grid;
  gap: 0.35rem;
  font-size: 0.75rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
}

.count {
  margin: 0;
  font-family: var(--mono);
  font-size: 0.85rem;
  color: var(--muted);
}

.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--line);
  background: color-mix(in srgb, var(--bg1) 92%, transparent);
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}

th,
td {
  padding: 0.7rem 0.65rem;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
  white-space: nowrap;
}

th {
  position: sticky;
  top: 0;
  background: var(--bg2);
  font-size: 0.7rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 600;
}

tbody tr:hover {
  background: color-mix(in srgb, var(--accent) 8%, transparent);
}

.model {
  white-space: normal;
  min-width: 14rem;
}

.model strong {
  display: block;
  font-weight: 600;
}

.model span {
  color: var(--muted);
  font-size: 0.82rem;
}

.specs {
  white-space: normal;
  max-width: 12rem;
  font-family: var(--mono);
  font-size: 0.75rem;
  line-height: 1.35;
  color: var(--muted);
}

.num {
  font-family: var(--mono);
  font-variant-numeric: tabular-nums;
}

.null {
  color: #5c5348;
}

.badge {
  display: inline-block;
  padding: 0.15rem 0.45rem;
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.badge.full {
  background: color-mix(in srgb, var(--full) 28%, transparent);
  color: #f0c3a4;
}

.badge.mid {
  background: color-mix(in srgb, var(--mid) 35%, transparent);
  color: #b7e0db;
}

.source a {
  color: var(--accent);
  text-decoration: none;
  font-family: var(--mono);
  font-size: 0.75rem;
}

.source a:hover {
  text-decoration: underline;
}

.foot {
  margin-top: 1.5rem;
  color: var(--muted);
  font-size: 0.85rem;
  line-height: 1.45;
}

.foot p {
  margin: 0 0 0.4rem;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

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

  .profile-select {
    grid-column: span 2;
  }
}

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

  .profile-select {
    grid-column: span 1;
  }
}
