:root {
  --bg: #15161e;
  --bg-2: #1d1f2a;
  --bg-3: #262938;
  --ink: #f1e6ce;
  --ink-2: #c9bfa8;
  --muted: #9a927f;
  --red: #e23d2d;
  --orange: #f08526;
  --yellow: #f6c434;
  --green: #58b25c;
  --blue: #3284c4;
  --destructive: #ff8a7a;
  --radius-control: 0;
  --mono: "Space Mono", ui-monospace, Menlo, Consolas, monospace;
  --pixel: "VT323", ui-monospace, monospace;
  --sans: "IBM Plex Sans", system-ui, -apple-system, Segoe UI, sans-serif;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.6;
}
a { color: var(--yellow); }
a:hover { color: var(--ink); }
img { max-width: 100%; display: block; }
button { font: inherit; }
:focus-visible { outline: 3px solid var(--yellow); outline-offset: 2px; }

.stripes { display: flex; height: 6px; }
.stripes span { flex: 1; }
.stripes span:nth-child(1) { background: var(--red); }
.stripes span:nth-child(2) { background: var(--orange); }
.stripes span:nth-child(3) { background: var(--yellow); }
.stripes span:nth-child(4) { background: var(--green); }
.stripes span:nth-child(5) { background: var(--blue); }

/* header */
.site-header {
  position: sticky; top: 0; z-index: 20;
  background: rgba(21, 22, 30, 0.94);
  backdrop-filter: blur(6px);
  border-bottom: 1px solid var(--bg-3);
}
.site-header .row {
  display: flex; align-items: center; justify-content: space-between;
  gap: 24px; padding: 14px clamp(20px, 5vw, 64px);
}
.brand {
  font-family: var(--pixel); font-size: 30px; line-height: 1; color: var(--ink);
  text-decoration: none; letter-spacing: 1px;
}
.brand b { color: var(--yellow); font-weight: normal; }
.nav { display: flex; align-items: center; gap: clamp(14px, 3vw, 32px); }
.nav a { white-space: nowrap; color: var(--ink-2); text-decoration: none; font-family: var(--mono); font-size: 14px; text-transform: uppercase; letter-spacing: 1px; }
.nav a:hover, .nav a[aria-current="page"] { color: var(--yellow); }
.cart-btn {
  display: inline-flex; align-items: center; gap: 8px;
  background: none; border: 1px solid var(--ink-2); color: var(--ink);
  padding: 6px 12px; cursor: pointer; border-radius: var(--radius-control);
  font-family: var(--mono); font-size: 14px; text-transform: uppercase;
}
.cart-btn:hover { border-color: var(--yellow); color: var(--yellow); }
.cart-count:not(:empty) {
  background: var(--yellow); color: var(--bg); padding: 0 6px; font-weight: 700;
}

/* buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  border: 0; cursor: pointer; text-decoration: none;
  border-radius: var(--radius-control);
  font-family: var(--mono); font-weight: 700; font-size: 16px;
  padding: 16px 28px;
}
.btn-primary { background: var(--yellow); color: var(--bg); box-shadow: 5px 5px 0 var(--red); }
.btn-primary:hover { color: var(--bg); transform: translate(-1px, -1px); box-shadow: 6px 6px 0 var(--red); }
.btn-primary:disabled { background: var(--bg-3); color: var(--muted); box-shadow: none; cursor: not-allowed; transform: none; }
.btn-text {
  background: none; border: 0; color: var(--yellow); cursor: pointer; padding: 4px 0;
  font-family: var(--mono); font-size: 14px; text-decoration: underline;
}
.btn-text:hover { color: var(--ink); }

/* hero / buy */
.hero {
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: clamp(32px, 6vw, 96px); align-items: center;
  padding: clamp(40px, 7vw, 96px) clamp(20px, 5vw, 64px);
  position: relative; overflow: hidden;
}
.hero::after {
  content: ""; position: absolute; right: -10%; bottom: -30%; width: 70%; height: 70%;
  background: repeating-linear-gradient(-52deg, transparent 0 40px, rgba(246, 196, 52, 0.04) 40px 80px);
  pointer-events: none;
}
.kicker { font-family: var(--pixel); font-size: 24px; color: var(--yellow); margin: 0 0 10px; letter-spacing: 1px; }
h1, h2, h3 { font-family: var(--mono); line-height: 1.12; margin: 0; }
h1 { font-size: clamp(36px, 5.2vw, 68px); letter-spacing: -1px; }
h2 { font-size: clamp(28px, 3.4vw, 44px); letter-spacing: -0.5px; }
h3 { font-size: 20px; }
.lede { font-size: clamp(18px, 1.6vw, 21px); color: var(--ink-2); max-width: 36em; margin: 20px 0 0; }

.cover-wrap { position: relative; justify-self: center; width: min(100%, 440px); }
.cover-wrap img {
  width: 100%; aspect-ratio: 3 / 4; object-fit: cover;
  box-shadow: 14px 14px 0 var(--bg-3), 0 30px 60px rgba(0, 0, 0, 0.5);
}
.cover-placeholder { width: 100%; aspect-ratio: 3 / 4; background: var(--bg-2); }

.buy { margin-top: 32px; max-width: 520px; }
.price-row { display: flex; align-items: baseline; gap: 14px; margin-bottom: 18px; }
.price { font-family: var(--mono); font-size: 34px; font-weight: 700; color: var(--ink); }
.compare { color: var(--muted); text-decoration: line-through; }
.ribbon { font-family: var(--pixel); font-size: 20px; background: var(--red); color: var(--ink); padding: 0 8px; }
fieldset { border: 0; padding: 0; margin: 0 0 18px; }
legend { font-family: var(--mono); font-size: 13px; text-transform: uppercase; letter-spacing: 1px; color: var(--muted); margin-bottom: 8px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  border: 1px solid var(--bg-3); background: var(--bg-2); color: var(--ink);
  padding: 10px 16px; cursor: pointer; border-radius: var(--radius-control);
  font-family: var(--mono); font-size: 14px;
}
.chip:hover { border-color: var(--ink-2); }
.chip[aria-pressed="true"] { border-color: var(--yellow); background: var(--yellow); color: var(--bg); font-weight: 700; }
.chip:disabled { opacity: 0.4; cursor: not-allowed; text-decoration: line-through; }
.qty { display: inline-flex; align-items: center; border: 1px solid var(--bg-3); }
.qty button { background: var(--bg-2); color: var(--ink); border: 0; width: 40px; height: 44px; cursor: pointer; border-radius: var(--radius-control); }
.qty button:hover { color: var(--yellow); }
.qty button:disabled { opacity: 0.4; cursor: not-allowed; }
.qty span { min-width: 44px; text-align: center; font-family: var(--mono); }
.buy-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 18px; margin-top: 8px; }
.hint { color: var(--muted); font-size: 15px; margin: 12px 0 0; }
.error { color: var(--destructive); }

/* sections */
.section { padding: clamp(48px, 7vw, 96px) clamp(20px, 5vw, 64px); }
.section.alt { background: var(--bg-2); }
.section-head { display: flex; flex-wrap: wrap; align-items: end; justify-content: space-between; gap: 16px; margin-bottom: 36px; }
.section-head p { color: var(--ink-2); margin: 10px 0 0; max-width: 40em; }

.details { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 32px; }
.details article { border-top: 3px solid var(--yellow); padding-top: 16px; }
.details article:nth-child(2) { border-color: var(--green); }
.details article:nth-child(3) { border-color: var(--blue); }
.details .rich { color: var(--ink-2); }
.details .rich p { margin: 8px 0 0; }
.description { color: var(--ink-2); max-width: 46em; }
.description p { margin: 0 0 14px; }

/* entry cards */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 20px; }
.card {
  display: flex; flex-direction: column; gap: 10px;
  background: var(--bg); border: 1px solid var(--bg-3); padding: 24px;
  color: var(--ink); text-decoration: none; min-height: 210px;
  transition: border-color 0.15s, transform 0.15s;
  position: relative;
}
.section:not(.alt) .card { background: var(--bg-2); }
.card:hover { border-color: var(--yellow); transform: translateY(-3px); color: var(--ink); }
.card .meta { display: flex; justify-content: space-between; font-family: var(--pixel); font-size: 20px; color: var(--muted); }
.card .cat { color: var(--yellow); }
.card[data-cat="Computers"] .cat { color: var(--red); }
.card[data-cat="Consoles"] .cat { color: var(--orange); }
.card[data-cat="Games"] .cat { color: var(--yellow); }
.card[data-cat="Software"] .cat { color: var(--green); }
.card[data-cat="Pioneers"] .cat { color: var(--blue); }
.card p { margin: 0; color: var(--ink-2); font-size: 16px; }
.card .more { margin-top: auto; font-family: var(--mono); font-size: 13px; color: var(--yellow); text-transform: uppercase; }
.skeleton { background: var(--bg-2); border: 1px solid var(--bg-3); min-height: 210px; animation: pulse 1.4s infinite; }
@keyframes pulse { 50% { opacity: 0.5; } }
.dim { opacity: 0.5; transition: opacity 0.2s; }
.state { color: var(--ink-2); padding: 24px 0; }

.filters { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 28px; }
.load-more { margin-top: 32px; }
.count { font-family: var(--pixel); font-size: 22px; color: var(--muted); }

/* entry page */
.entry { padding: clamp(40px, 6vw, 80px) clamp(20px, 5vw, 64px); display: grid; grid-template-columns: minmax(0, 2fr) minmax(260px, 1fr); gap: clamp(32px, 6vw, 80px); align-items: start; }
.crumbs { font-family: var(--mono); font-size: 13px; text-transform: uppercase; letter-spacing: 1px; color: var(--muted); margin-bottom: 18px; }
.crumbs a { color: var(--muted); }
.entry .year { font-family: var(--pixel); font-size: 28px; color: var(--yellow); margin-top: 8px; }
.entry .summary { font-size: 21px; color: var(--ink); margin: 20px 0 0; }
.entry .body { color: var(--ink-2); font-size: 18px; margin-top: 18px; max-width: 40em; }
.entry .body p { margin: 0 0 16px; }
.aside { background: var(--bg-2); border: 1px solid var(--bg-3); padding: 24px; position: sticky; top: 96px; }
.aside img { width: 120px; aspect-ratio: 3 / 4; object-fit: cover; margin-bottom: 16px; }
.aside p { color: var(--ink-2); margin: 10px 0 20px; font-size: 16px; }

/* cart drawer */
.cart-backdrop { position: fixed; inset: 0; background: rgba(0, 0, 0, 0.6); z-index: 50; display: flex; justify-content: flex-end; }
.cart-backdrop[hidden] { display: none; }
.cart-panel {
  width: min(440px, 100%); height: 100%; background: var(--bg-2); border-left: 1px solid var(--bg-3);
  display: flex; flex-direction: column; padding: 24px;
}
.cart-panel header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 18px; }
.cart-close { background: none; border: 0; color: var(--ink); font-size: 28px; cursor: pointer; line-height: 1; }
.cart-close:hover { color: var(--yellow); }
.cart-lines { flex: 1; overflow: auto; }
.line { display: grid; grid-template-columns: 64px 1fr auto; gap: 14px; padding: 14px 0; border-bottom: 1px solid var(--bg-3); }
.line img { width: 64px; aspect-ratio: 3 / 4; object-fit: cover; }
.line .name { font-weight: 600; }
.line .desc { color: var(--muted); font-size: 14px; }
.line .status { color: var(--destructive); font-size: 14px; }
.line .right { text-align: right; font-family: var(--mono); }
.line .qty button { width: 32px; height: 32px; }
.line .qty span { min-width: 32px; font-size: 14px; }
.totals { border-top: 1px solid var(--bg-3); padding-top: 16px; margin-top: 8px; }
.totals .row { display: flex; justify-content: space-between; margin: 4px 0; color: var(--ink-2); }
.totals .row.total { color: var(--ink); font-weight: 700; font-family: var(--mono); font-size: 20px; }
.totals .note { color: var(--muted); font-size: 14px; margin: 8px 0 16px; }
.cart-panel .btn { width: 100%; }
body.locked { overflow: hidden; }

/* footer */
.site-footer { padding: 40px clamp(20px, 5vw, 64px); color: var(--muted); font-size: 14px; display: flex; flex-wrap: wrap; justify-content: space-between; gap: 16px; border-top: 1px solid var(--bg-3); }
.site-footer a { color: var(--ink-2); }

@media (max-width: 860px) {
  .hero, .entry { grid-template-columns: 1fr; }
  .hero .cover-wrap { order: -1; width: min(70%, 320px); }
  .aside { position: static; }
  .nav .hide-sm { display: none; }
  .brand { font-size: 24px; }
}
