:root {
  --bg: #070a12;
  --bg-2: #0c1120;
  --card: rgba(18, 25, 43, 0.72);
  --card-solid: #111829;
  --card-hover: rgba(26, 36, 61, 0.9);
  --line: rgba(148, 163, 184, 0.12);
  --line-2: rgba(148, 163, 184, 0.22);
  --text: #f6efe1; /* the light theme's cream background */
  --muted: #b4ab9a;
  --cyan: #22d3ee;
  --violet: #a78bfa;
  --pink: #f472b6;
  --lime: #a3e635;
  --amber: #fbbf24;
  --red: #f87171;
  /* Accent: a single solid colour instead of a gradient — cream in dark mode, navy-black in light mode */
  --accent: #f6efe1;
  --on-accent: #070a12;
  --grad: var(--accent);
  --radius: 16px;
  --font: 'Inter', system-ui, sans-serif;
  --display: 'Space Grotesk', 'Inter', sans-serif;
  --mono: 'JetBrains Mono', ui-monospace, monospace;
  /* Overlays and shadows (vary by theme) */
  --text-2: #e9e1d1;
  --tint: 255 255 255;
  --bg-rgb: 7 10 18;
  --card-rgb: 17 24 41;
  --shade: 0 0 0;
  --shade-k: 1;
  --grid-opacity: 0.5;
  --glow-opacity: 1;
  color-scheme: dark;
}

/* ☀️ Light mode — cream */
:root[data-theme='light'] {
  --bg: #f6efe1;
  --bg-2: #efe5d2;
  --card: rgba(255, 251, 242, 0.82);
  --card-solid: #fffaf0;
  --card-hover: #fffdf8;
  --line: rgba(110, 80, 40, 0.13);
  --line-2: rgba(110, 80, 40, 0.24);
  --text: #070a12; /* the dark theme's background */
  --text-2: #1a1f2b;
  --muted: #4e4a45;
  --cyan: #0b8ea5;
  --violet: #7454d4;
  --pink: #d33c86;
  --lime: #3f8a0e;
  --amber: #b87808;
  --red: #cf3f3f;
  --accent: #070a12;
  --on-accent: #f6efe1;
  --tint: 110 80 40;
  --bg-rgb: 246 239 225;
  --card-rgb: 255 250 240;
  --shade: 90 60 25;
  --shade-k: 0.35;
  --grid-opacity: 0.35;
  --glow-opacity: 0.55;
  color-scheme: light;
}

* { box-sizing: border-box; }
body { transition: background-color 0.3s, color 0.3s; }
[hidden] { display: none !important; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 15px/1.6 var(--font);
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  overflow-x: hidden;
}
a { color: inherit; text-decoration: none; }
img { max-width: 100%; }
button, input, select { font: inherit; color: inherit; }
h1, h2, h3, h4 { font-family: var(--display); letter-spacing: -0.02em; line-height: 1.15; margin: 0; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.mono { font-family: var(--mono); }
.grad-text { color: var(--accent); }

.bg-grid {
  position: fixed; inset: 0; z-index: -2; pointer-events: none;
  background-image: linear-gradient(var(--line) 1px, transparent 1px), linear-gradient(90deg, var(--line) 1px, transparent 1px);
  background-size: 56px 56px;
  mask-image: radial-gradient(ellipse at 50% 0%, #000 10%, transparent 70%);
  opacity: var(--grid-opacity);
}
.bg-glow { display: none;
  position: fixed; z-index: -1; pointer-events: none; top: -300px; left: 50%; width: 1100px; height: 700px; transform: translateX(-50%);
  background: radial-gradient(closest-side, rgba(34, 211, 238, 0.16), transparent), radial-gradient(closest-side at 70% 60%, rgba(167, 139, 250, 0.16), transparent);
  filter: blur(20px);
  opacity: var(--glow-opacity);
}

.container { width: min(1240px, 100% - 32px); margin-inline: auto; }
main.container { padding: 28px 0 80px; min-height: 70vh; }

/* ---------- Nav ---------- */
.nav { position: sticky; top: 0; z-index: 50; backdrop-filter: blur(16px) saturate(140%); background: rgb(var(--bg-rgb) / 0.72); border-bottom: 1px solid var(--line); }
.nav-inner { width: min(1240px, 100% - 32px); margin: auto; display: flex; align-items: center; gap: 24px; height: 64px; }
.logo { display: flex; align-items: center; gap: 10px; font-family: var(--display); font-size: 20px; font-weight: 700; }
.logo-mark { width: 32px; height: 32px; display: grid; place-items: center; border-radius: 9px; background: var(--accent); color: var(--on-accent); font-weight: 800; }
.logo-text b { color: inherit; }
.nav-links { display: flex; gap: 4px; }
.nav-links a { padding: 8px 12px; border-radius: 10px; color: var(--muted); font-weight: 500; font-size: 14px; transition: 0.2s; }
.nav-links a:hover { color: var(--text); background: rgb(var(--tint) / 0.05); }
.nav-links a.active { color: var(--text); background: rgb(var(--tint) / 0.08); box-shadow: inset 0 0 0 1px var(--line-2); }
.nav-news::after { content: ''; display: inline-block; width: 6px; height: 6px; margin-left: 6px; border-radius: 50%; background: var(--pink); box-shadow: 0 0 8px var(--pink); vertical-align: 2px; }
.nav-search { position: relative; margin-left: auto; width: 280px; }
.nav-search input { width: 100%; padding: 9px 12px 9px 36px; border-radius: 12px; border: 1px solid var(--line-2); background: rgb(var(--tint) / 0.04); outline: none; transition: 0.2s; }
.nav-search input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgb(var(--tint) / 0.08); }
.nav-search .ico { position: absolute; left: 11px; top: 50%; transform: translateY(-50%); width: 16px; height: 16px; }
.ico { fill: none; stroke: var(--muted); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.search-results { position: absolute; top: calc(100% + 8px); right: 0; width: 380px; max-height: 70vh; overflow: auto; background: var(--card-solid); border: 1px solid var(--line-2); border-radius: 14px; padding: 6px; box-shadow: 0 20px 60px rgb(var(--shade) / calc(0.6 * var(--shade-k))); }
.search-results a { display: flex; align-items: center; gap: 12px; padding: 8px 10px; border-radius: 10px; }
.search-results a:hover, .search-results a.hl { background: rgb(var(--tint) / 0.06); }
.search-results img { width: 38px; height: 38px; object-fit: contain; background: #fff1; border-radius: 8px; }
.search-results .tag { margin-left: auto; }
.menu-btn { display: none; background: none; border: 0; padding: 8px; cursor: pointer; }
.menu-btn span { display: block; width: 22px; height: 2px; margin: 5px 0; background: var(--text); border-radius: 2px; }

/* ---------- Common ---------- */
.tag { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 99px; font-size: 12px; font-weight: 500; background: rgb(var(--tint) / 0.06); border: 1px solid var(--line); color: var(--muted); white-space: nowrap; }
.tag.cyan { color: var(--cyan); border-color: rgba(34, 211, 238, 0.35); background: rgba(34, 211, 238, 0.08); }
.tag.violet { color: var(--violet); border-color: rgba(167, 139, 250, 0.35); background: rgba(167, 139, 250, 0.08); }
.tag.pink { color: var(--pink); border-color: rgba(244, 114, 182, 0.35); background: rgba(244, 114, 182, 0.08); }
.btn { display: inline-flex; align-items: center; gap: 8px; padding: 10px 18px; border-radius: 12px; border: 1px solid var(--line-2); background: rgb(var(--tint) / 0.04); font-weight: 600; font-size: 14px; cursor: pointer; transition: 0.2s; }
.btn:hover { border-color: var(--accent); background: rgb(var(--tint) / 0.06); }
.btn.primary { background: var(--accent); color: var(--on-accent); border: 0; }
.btn.primary:hover { opacity: 0.88; transform: translateY(-1px); }
.btn.sm { padding: 6px 12px; font-size: 13px; border-radius: 10px; }
.section { margin-top: 56px; }
.section-head { display: flex; align-items: end; justify-content: space-between; gap: 16px; margin-bottom: 20px; }
.section-head h2 { font-size: 26px; }
.section-head a { color: var(--accent); font-weight: 600; font-size: 14px; }
.eyebrow { font-family: var(--mono); font-size: 12px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--accent); opacity: 0.75; }
.empty { padding: 60px 20px; text-align: center; color: var(--muted); border: 1px dashed var(--line-2); border-radius: var(--radius); }
.crumbs { display: flex; gap: 8px; color: var(--muted); font-size: 13px; margin-bottom: 18px; }
.crumbs a:hover { color: var(--accent); }

/* ---------- Hero ---------- */
.hero { padding: 48px 0 12px; display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); gap: 40px; align-items: center; }
.hero h1 { font-size: clamp(38px, 5.4vw, 64px); font-weight: 700; margin: 14px 0 18px; }
.hero p { font-size: 17px; color: var(--muted); max-width: 540px; margin: 0 0 26px; }
.hero-actions { display: flex; gap: 12px; flex-wrap: wrap; }
.hero-stats { display: flex; gap: 28px; margin-top: 34px; flex-wrap: wrap; }
.hero-stats div b { display: block; font-family: var(--display); font-size: 28px; }
.hero-stats div span { font-size: 13px; color: var(--muted); }
.hero-visual { position: relative; height: 420px; }
.hero-visual .float { position: absolute; background: var(--card); border: 1px solid var(--line-2); border-radius: 20px; padding: 14px; backdrop-filter: blur(10px); box-shadow: 0 20px 60px rgb(var(--shade) / calc(0.45 * var(--shade-k))); animation: float 6s ease-in-out infinite; }
.hero-visual .float img { height: 170px; width: 130px; object-fit: contain; display: block; margin: auto; }
.hero-visual .float small { display: block; text-align: center; margin-top: 8px; font-weight: 600; font-size: 13px; max-width: 150px; }
.hero-visual .f1 { left: 4%; top: 30px; }
.hero-visual .f2 { left: 36%; top: 110px; animation-delay: -2s; z-index: 2; border-color: var(--line-2); }
.hero-visual .f3 { right: 2%; top: 10px; animation-delay: -4s; }
.hero-visual .chip { position: absolute; bottom: -10px; left: 6%; z-index: 3; padding: 12px 16px; font-family: var(--mono); font-size: 12px; animation: float 7s ease-in-out infinite; }
.hero-visual .chip b { color: var(--lime); font-size: 20px; display: block; }
@keyframes float { 50% { transform: translateY(-14px); } }

/* ---------- Category tiles ---------- */
.cats { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 14px; margin-top: 40px; }
.cat { position: relative; padding: 20px 18px; border-radius: var(--radius); background: var(--card); border: 1px solid var(--line); overflow: hidden; transition: 0.25s; }
.cat::before { content: none; }
.cat:hover { transform: translateY(-4px); border-color: var(--accent); }
.cat:hover::before { opacity: 0.18; }
.cat svg { width: 30px; height: 30px; stroke: var(--accent); fill: none; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.cat h3 { font-size: 17px; margin-top: 14px; }
.cat span { font-size: 13px; color: var(--muted); }

/* ---------- Device cards ---------- */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 16px; }
.card { position: relative; display: flex; flex-direction: column; border-radius: var(--radius); background: var(--card); border: 1px solid var(--line); padding: 16px; transition: 0.25s; overflow: hidden; }
.card:hover { transform: translateY(-4px); border-color: var(--line-2); background: var(--card-hover); box-shadow: 0 16px 40px rgb(var(--shade) / calc(0.35 * var(--shade-k))); }
.card-img { height: 170px; display: grid; place-items: center; margin: 4px 0 14px; border-radius: 12px; background: none; }
.card-img img { max-height: 160px; max-width: 90%; object-fit: contain; filter: drop-shadow(0 10px 18px rgb(var(--shade) / calc(0.5 * var(--shade-k)))); transition: 0.3s; }
.card:hover .card-img img { transform: scale(1.05); }
.card-img.wide { position: relative; margin: -16px -16px 14px; height: 186px; border-radius: 16px 16px 0 0; overflow: hidden; background: #000; }
/* Show the whole photo (contain) over a blurred copy of itself — cinematic look */
.card-img.wide::before { content: ''; position: absolute; inset: -20px; background: var(--bg) center / cover; filter: blur(18px) brightness(0.55); }
.card-img.wide img { position: relative; width: 100%; height: 100%; max-width: none; max-height: none; object-fit: contain; filter: none; }
.detail-img.wide { align-self: center; min-height: 0; background: none; }
.detail-img.wide img { width: 100%; height: auto; max-height: 380px; object-fit: cover; border-radius: 16px; box-shadow: 0 20px 50px rgb(var(--shade) / calc(0.5 * var(--shade-k))); filter: none; }
.icon-fallback svg, .card-img.icon-fallback svg { width: 64px; height: 64px; stroke: var(--violet); fill: none; stroke-width: 1.3; }
.card .brand { font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.08em; font-weight: 600; }
.card h3 { font-size: 16px; margin: 4px 0 10px; }
.card ul { list-style: none; padding: 0; margin: 0 0 12px; font-size: 13px; color: var(--muted); display: grid; grid-template-columns: minmax(0, 1fr); gap: 4px; }
.card ul li { display: flex; gap: 8px; }
.card ul li b { color: var(--text); font-weight: 500; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.card ul li span { flex: 0 0 74px; }
.card-foot { margin-top: auto; display: flex; align-items: center; justify-content: space-between; gap: 8px; min-width: 0; }
.card-foot .tag { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.cmp-toggle { flex-shrink: 0; white-space: nowrap; display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 600; color: var(--muted); padding: 5px 10px; border-radius: 99px; border: 1px solid var(--line-2); background: transparent; cursor: pointer; transition: 0.2s; }
.cmp-toggle:hover { color: var(--accent); border-color: var(--accent); }
.cmp-toggle.on { color: var(--on-accent); background: var(--accent); border-color: var(--accent); }
.score-badge { position: absolute; top: 12px; right: 12px; z-index: 2; }

/* Score ring */
.ring { --v: 50; --c: var(--cyan); position: relative; width: 46px; height: 46px; border-radius: 50%; display: grid; place-items: center; background: conic-gradient(var(--c) calc(var(--v) * 1%), rgb(var(--tint) / 0.08) 0); }
.ring::before { content: ''; position: absolute; inset: 4px; border-radius: 50%; background: var(--card-solid); }
.ring b { position: relative; font-family: var(--display); font-size: 14px; }
.ring.lg { width: 92px; height: 92px; }
.ring.lg::before { inset: 7px; }
.ring.lg b { font-size: 28px; }
.ring small { position: relative; display: block; font-size: 10px; color: var(--muted); text-align: center; margin-top: -4px; }

/* ---------- List page ---------- */
.page-head { display: flex; justify-content: space-between; align-items: end; gap: 20px; flex-wrap: wrap; margin: 12px 0 24px; }
.page-head h1 { font-size: clamp(30px, 4vw, 44px); }
.page-head p { margin: 8px 0 0; color: var(--muted); }
.toolbar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-bottom: 18px; padding: 12px; border-radius: var(--radius); background: var(--card); border: 1px solid var(--line); position: sticky; top: 74px; z-index: 10; backdrop-filter: blur(14px); }
.toolbar input, .toolbar select { padding: 9px 12px; border-radius: 10px; border: 1px solid var(--line-2); background: var(--bg-2); outline: none; }
.toolbar input { flex: 1; min-width: 180px; }
.toolbar input:focus, .toolbar select:focus { border-color: var(--accent); }
.tabs { display: flex; gap: 6px; flex-wrap: wrap; }
.tabs button { padding: 8px 14px; border-radius: 10px; border: 1px solid var(--line-2); background: transparent; cursor: pointer; font-size: 13px; font-weight: 600; color: var(--muted); transition: 0.2s; }
.tabs button:hover { color: var(--text); }
.tabs button.on { background: rgba(167, 139, 250, 0.14); color: var(--violet); border-color: rgba(167, 139, 250, 0.45); }
.brand-chips { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 20px; }
.brand-chips button { padding: 5px 12px; border-radius: 99px; border: 1px solid var(--line-2); background: transparent; color: var(--muted); font-size: 13px; cursor: pointer; transition: 0.2s; }
.brand-chips button.on, .brand-chips button:hover { color: var(--cyan); border-color: var(--cyan); background: rgba(34, 211, 238, 0.07); }
.load-more { display: flex; justify-content: center; margin-top: 28px; }

/* Leaderboard (processors / gpus) */
.board { border-radius: var(--radius); border: 1px solid var(--line); background: var(--card); overflow: hidden; }
.board-row { display: grid; grid-template-columns: 44px 56px 1fr 200px 110px 92px; align-items: center; gap: 14px; padding: 12px 16px; border-bottom: 1px solid var(--line); transition: 0.2s; }
.board-row:last-child { border-bottom: 0; }
.board-row:hover { background: rgb(var(--tint) / 0.04); }
.board-row .rank { font-family: var(--mono); color: var(--muted); font-size: 13px; }
.board-row .thumb { width: 46px; height: 46px; border-radius: 10px; object-fit: contain; background: #fff; padding: 3px; }
.board-row h3 { font-size: 15px; }
.board-row .sub { font-size: 12px; color: var(--muted); }
.bar { height: 8px; border-radius: 9px; background: rgb(var(--tint) / 0.07); overflow: hidden; }
.bar i { display: block; height: 100%; border-radius: 9px; background: var(--accent); }
.board-row .num { font-family: var(--mono); font-size: 13px; text-align: right; }

/* ---------- Detail ---------- */
.detail-hero { display: grid; grid-template-columns: 360px 1fr; gap: 36px; padding: 28px; border-radius: 22px; background: var(--card); border: 1px solid var(--line); position: relative; overflow: hidden; }
.detail-hero::after { display: none; content: ''; position: absolute; width: 400px; height: 400px; right: -120px; top: -160px; background: radial-gradient(closest-side, rgba(167, 139, 250, 0.2), transparent); pointer-events: none; }
.detail-img { display: grid; place-items: center; min-height: 340px; border-radius: 18px; background: none; }
.detail-img img { height: 300px; max-width: 100%; object-fit: contain; filter: drop-shadow(0 20px 30px rgb(var(--shade) / calc(0.55 * var(--shade-k)))); }
.detail-img.light img { background: #fff; border-radius: 14px; padding: 16px; height: auto; max-height: 260px; }
.detail-info h1 { font-size: clamp(28px, 3.6vw, 42px); margin: 10px 0 6px; }
.detail-meta { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 20px; }
.hl-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 10px; }
.hl { padding: 12px 14px; border-radius: 12px; background: rgb(var(--tint) / 0.035); border: 1px solid var(--line); }
.hl span { display: block; font-size: 11px; text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); font-weight: 600; }
.hl b { display: block; margin-top: 3px; font-weight: 600; font-size: 14px; }
.detail-actions { display: flex; gap: 10px; margin-top: 22px; flex-wrap: wrap; }
.scores { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 12px; }
.score { padding: 14px 16px; border-radius: 14px; background: var(--card); border: 1px solid var(--line); }
.score span { font-size: 12px; color: var(--muted); }
.score b { display: block; font-family: var(--mono); font-size: 20px; margin: 4px 0 8px; }
.linked { display: flex; align-items: center; gap: 16px; padding: 16px 18px; border-radius: 16px; border: 1px solid var(--line-2); background: var(--card); }
.linked:hover { border-color: var(--accent); }
.linked .grow { flex: 1; }
.specs { display: grid; gap: 14px; }
.spec-sec { border-radius: var(--radius); background: var(--card); border: 1px solid var(--line); overflow: hidden; }
.spec-sec h3 { font-size: 15px; padding: 12px 18px; background: rgb(var(--tint) / 0.03); border-bottom: 1px solid var(--line); display: flex; align-items: center; gap: 10px; }
.spec-sec h3::before { content: ''; width: 8px; height: 8px; border-radius: 2px; background: var(--accent); }
.spec-row { display: grid; grid-template-columns: 220px 1fr; gap: 16px; padding: 10px 18px; border-bottom: 1px solid var(--line); font-size: 14px; }
.spec-row:last-child { border-bottom: 0; }
.spec-row span { color: var(--muted); }
.source-note { margin-top: 26px; font-size: 13px; color: var(--muted); }
.source-note a { color: var(--accent); text-decoration: underline; }

/* ---------- Compare ---------- */
.cmp-pickers { display: grid; gap: 14px; grid-template-columns: repeat(3, 1fr); margin-bottom: 18px; }
/* z-index: keep the dropdown above the compare table (its fade-in creates a new stacking context) */
.cmp-pickers { position: relative; z-index: 30; }
.picker { position: relative; z-index: 30; }
.picker input { width: 100%; padding: 12px 14px; border-radius: 12px; border: 1px dashed var(--line-2); background: var(--card); outline: none; }
.picker input:focus { border-color: var(--accent); border-style: solid; }
.cmp-table { border-radius: var(--radius); border: 1px solid var(--line); background: var(--card); overflow: auto; }
.cmp-row { display: grid; grid-template-columns: 200px repeat(var(--n), minmax(180px, 1fr)); border-bottom: 1px solid var(--line); font-size: 14px; }
.cmp-row > div { padding: 10px 16px; border-left: 1px solid var(--line); }
.cmp-row > div:first-child { border-left: 0; color: var(--muted); }
.cmp-row.head > div { text-align: center; padding: 18px 12px; }
.cmp-row.head > div:first-child { text-align: left; }
.cmp-row.head img { height: 150px; object-fit: contain; display: block; margin: 0 auto 10px; }
.cmp-row.head .light img { background: #fff; border-radius: 12px; padding: 8px; height: 110px; }
.cmp-row.head h3 { font-size: 15px; }
.cmp-row.head .rm { margin-top: 8px; font-size: 12px; color: var(--muted); background: none; border: 0; cursor: pointer; }
.cmp-row.head .rm:hover { color: var(--red); }
.cmp-sec { padding: 10px 16px; font-family: var(--display); font-weight: 600; background: rgb(var(--tint) / 0.035); border-bottom: 1px solid var(--line); position: sticky; left: 0; }
.cmp-row .win { color: var(--lime); font-weight: 600; }
.cmp-row .win::after { content: ' ▲'; font-size: 10px; }
.cmp-row.diff > div:first-child { color: var(--text); }
.cmp-opts { display: flex; gap: 16px; align-items: center; margin-bottom: 14px; font-size: 14px; color: var(--muted); }
.cmp-opts label { display: flex; gap: 8px; align-items: center; cursor: pointer; }
.compare-tray { position: fixed; left: 50%; bottom: 18px; transform: translateX(-50%); z-index: 60; display: flex; gap: 12px; align-items: center; padding: 10px 12px 10px 16px; border-radius: 16px; background: rgb(var(--card-rgb) / 0.92); border: 1px solid var(--line-2); backdrop-filter: blur(16px); box-shadow: 0 20px 60px rgb(var(--shade) / calc(0.6 * var(--shade-k))); max-width: calc(100% - 24px); }
.compare-tray .items { display: flex; gap: 8px; overflow: auto; }
.compare-tray .it { display: flex; align-items: center; gap: 6px; padding: 4px 8px; border-radius: 10px; background: rgb(var(--tint) / 0.06); font-size: 13px; white-space: nowrap; }
.compare-tray .it img { width: 26px; height: 26px; object-fit: contain; }
.compare-tray .it button { background: none; border: 0; color: var(--muted); cursor: pointer; }

/* ---------- News ---------- */
.news-feature { display: grid; grid-template-columns: 1.4fr 1fr; gap: 16px; margin-bottom: 16px; }
.news-card { position: relative; display: flex; flex-direction: column; border-radius: var(--radius); background: var(--card); border: 1px solid var(--line); overflow: hidden; transition: 0.25s; }
.news-card:hover { transform: translateY(-4px); border-color: rgba(244, 114, 182, 0.4); }
.news-card .thumb { aspect-ratio: 16 / 9; overflow: hidden; background: var(--bg-2); }
.news-card .thumb img { width: 100%; height: 100%; object-fit: cover; transition: 0.4s; }
.news-card:hover .thumb img { transform: scale(1.05); }
.news-card .body { padding: 16px 18px 18px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.news-card h3 { font-size: 17px; }
.news-card p { margin: 0; color: var(--muted); font-size: 14px; }
.news-card .meta { display: flex; gap: 8px; align-items: center; font-size: 12px; color: var(--muted); margin-top: auto; padding-top: 6px; }
.news-card.big { grid-row: span 2; }
.news-card.big .thumb { aspect-ratio: 16 / 10; }
.news-card.big h3 { font-size: 26px; }
.news-side { display: grid; gap: 16px; }
.news-side .news-card { flex-direction: row; }
.news-side .news-card .thumb { width: 42%; aspect-ratio: auto; flex: 0 0 42%; }
.news-side .news-card h3 { font-size: 15px; }
.article { max-width: 780px; margin: 0 auto; }
.article h1 { font-size: clamp(30px, 4.4vw, 46px); margin: 14px 0; }
.article .lead { font-size: 19px; color: var(--muted); margin: 0 0 20px; }
.article .cover { border-radius: 20px; overflow: hidden; border: 1px solid var(--line); margin: 20px 0 28px; }
.article .cover img { width: 100%; display: block; }
.article .content p { font-size: 17px; line-height: 1.8; margin: 0 0 20px; color: var(--text-2); }
.article .content p:first-child::first-letter { font-family: var(--display); font-size: 3.2em; float: left; line-height: 0.9; margin: 6px 10px 0 0; color: var(--accent); }
.source-box { margin-top: 30px; padding: 16px 18px; border-radius: 14px; border: 1px solid var(--line-2); background: var(--card); display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; }

/* skeleton */
.skel { border-radius: var(--radius); height: 300px; background: linear-gradient(100deg, var(--card) 40%, rgb(var(--tint) / 0.06) 50%, var(--card) 60%) 0 0 / 200% 100%; animation: shimmer 1.3s infinite; }
@keyframes shimmer { to { background-position: -200% 0; } }
.fade-in { animation: fade 0.35s ease both; }
@keyframes fade { from { opacity: 0; transform: translateY(8px); } }

/* ---------- Footer ---------- */
.footer { border-top: 1px solid var(--line); padding: 36px 0; background: rgb(var(--tint) / 0.03); }
.footer-inner { display: flex; justify-content: space-between; gap: 30px; flex-wrap: wrap; }
.footer-inner > p { max-width: 560px; margin: 0; }

/* ---------- Responsive ---------- */
@media (max-width: 1080px) {
  .cats { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .hero { grid-template-columns: minmax(0, 1fr); }
  .hero-visual { display: none; }
  .nav-search { width: 200px; }
  .board-row { grid-template-columns: 34px 48px 1fr 90px 70px; }
  .board-row .bar-cell { display: none; }
}
@media (max-width: 900px) {
  .menu-btn { display: block; }
  .nav-links { display: none; position: absolute; top: 64px; left: 0; right: 0; flex-direction: column; padding: 12px 16px; background: rgb(var(--bg-rgb) / 0.97); border-bottom: 1px solid var(--line); }
  .nav-links.open { display: flex; }
  .nav-search { width: auto; flex: 1; }
  /* Span the screen below the nav instead of hanging off the narrow input */
  .search-results { position: fixed; top: 64px; left: 16px; right: 16px; width: auto; }
  .detail-hero { grid-template-columns: 1fr; padding: 18px; }
  .detail-img { min-height: 240px; }
  .news-feature { grid-template-columns: 1fr; }
  .cmp-pickers { grid-template-columns: 1fr; }
  .spec-row { grid-template-columns: 130px 1fr; }
  .cmp-row { grid-template-columns: 120px repeat(var(--n), minmax(150px, 1fr)); }
}
@media (max-width: 560px) {
  .cats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; gap: 10px; }
  .hero h1 { font-size: 34px; }
  .card h3 { font-size: 14px; overflow-wrap: anywhere; }
  .card-foot { flex-wrap: wrap; }
  .cmp-row.head img { height: 100px; }
  .card { padding: 12px; }
  .card-img { height: 130px; }
  .card-img.wide { margin: -12px -12px 12px; height: 140px; }
  .card-img img { max-height: 120px; }
  .card ul { display: none; }
  .logo-text { display: none; }
  .board-row { grid-template-columns: 26px 40px 1fr 60px; gap: 10px; }
  .board-row .num { display: none; }
  .news-side .news-card { flex-direction: column; }
  .news-side .news-card .thumb { width: 100%; }
  .toolbar { position: static; }
}

/* Give landscape official photos more room in the hero */
@media (min-width: 901px) {
  .detail-hero:has(.detail-img.wide) { grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); }
}

/* ---------- Theme toggle ---------- */
.theme-btn { flex-shrink: 0; width: 40px; height: 40px; display: grid; place-items: center; border-radius: 12px; border: 1px solid var(--line-2); background: rgb(var(--tint) / 0.04); cursor: pointer; transition: 0.2s; }
.theme-btn:hover { border-color: var(--accent); }
.theme-btn svg { width: 19px; height: 19px; fill: none; stroke: var(--text); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.theme-btn .sun { display: none; }
:root[data-theme='light'] .theme-btn .sun { display: block; }
:root[data-theme='light'] .theme-btn .moon { display: none; }

/* Light mode: adjustments for elements designed for a dark background */
:root[data-theme='light'] .card-img img,
:root[data-theme='light'] .detail-img img { filter: drop-shadow(0 10px 16px rgb(90 60 25 / 0.22)); }
:root[data-theme='light'] .card-img.wide img,
:root[data-theme='light'] .detail-img.wide img { filter: none; }
:root[data-theme='light'] .board-row .thumb,
:root[data-theme='light'] .detail-img.light img { box-shadow: 0 0 0 1px var(--line); }


/* Logo — place your logo at public/images/logo.png */
.logo-fallback { display: flex; align-items: center; gap: 10px; }
.logo-img { height: 34px; width: auto; display: block; }

/* ---------- Flask version: tabs/chips are links (not buttons), pagination, status ---------- */
.tabs .tab { padding: 8px 14px; border-radius: 10px; border: 1px solid var(--line-2); font-size: 13px; font-weight: 600; color: var(--muted); transition: 0.2s; }
.tabs .tab:hover { color: var(--text); }
.tabs .tab.on { background: rgba(167, 139, 250, 0.14); color: var(--violet); border-color: rgba(167, 139, 250, 0.45); }
.brand-chips .chip { padding: 5px 12px; border-radius: 99px; border: 1px solid var(--line-2); color: var(--muted); font-size: 13px; transition: 0.2s; }
.brand-chips .chip.on, .brand-chips .chip:hover { color: var(--cyan); border-color: var(--cyan); background: rgba(34, 211, 238, 0.07); }
.toolbar select { max-width: 220px; }
.pager { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; align-items: center; margin-top: 28px; }
.pager .pg { min-width: 38px; padding: 6px 10px; text-align: center; border-radius: 10px; border: 1px solid var(--line-2); font-size: 13px; font-weight: 600; color: var(--muted); }
.pager .pg:hover { color: var(--text); border-color: var(--accent); }
.pager .pg.on { background: var(--accent); color: var(--on-accent); border-color: var(--accent); }
.cmp-row.head a.rm { display: inline-block; margin-top: 8px; font-size: 12px; color: var(--muted); }
.cmp-row.head a.rm:hover { color: var(--red); }
.status-box { max-width: 680px; margin: 30px auto; padding: 28px; border-radius: 20px; background: var(--card); border: 1px solid var(--line); }
.status-big { font-size: 46px; font-weight: 700; margin: 18px 0 4px; font-variant-numeric: tabular-nums; font-family: var(--display); }
.status-big small { font-size: 20px; color: var(--muted); font-weight: 500; }
.status-note { margin: 6px 0 4px; padding: 10px 14px; border-radius: 12px; border: 1px solid rgba(244, 114, 182, 0.4); background: rgba(244, 114, 182, 0.08); font-size: 14px; }
.status-note b { color: var(--pink); }
/* Laptop configuration shown under the name (e.g. "14th Gen Core i7 · 16GB · 1TB SSD") */
.config-line { margin: -6px 0 10px; font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.config-line.lg { margin: 8px 0 0; font-size: 15px; white-space: normal; }
