:root {
  --mask: #0d4a2c;        /* solder-mask green: page */
  --mask-deep: #08331e;   /* inner layers: panels */
  --silk: #eef3e6;        /* silkscreen white: text */
  --silk-dim: #a9c2ae;    /* faded silkscreen: secondary text */
  --gold: #e2b544;        /* contact fingers: highlights */
  --chip: #171a17;        /* memory chips */
  --alarm: #ff5a4f;       /* price-up sticker */
  --display: "Big Shoulders Display", "Arial Narrow", sans-serif;
  --body: "Atkinson Hyperlegible", system-ui, sans-serif;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0; color: var(--silk); font: 18px/1.55 var(--body);
  background-color: var(--mask);
  /* faint copper traces */
  background-image:
    linear-gradient(90deg, transparent 0 calc(50% - 1px), rgba(226,181,68,.07) calc(50% - 1px) calc(50% + 1px), transparent calc(50% + 1px)),
    linear-gradient(transparent 0 calc(50% - 1px), rgba(226,181,68,.05) calc(50% - 1px) calc(50% + 1px), transparent calc(50% + 1px));
  background-size: 180px 180px, 180px 120px;
  font-variant-numeric: tabular-nums;
}
a { color: var(--gold); text-underline-offset: 3px; }
a:hover { color: var(--silk); }
:focus-visible { outline: 3px solid var(--gold); outline-offset: 3px; border-radius: 4px; }

.top, main, footer { max-width: 1000px; margin: 0 auto; padding-left: 16px; padding-right: 16px; }
.top { display: flex; justify-content: space-between; align-items: baseline; flex-wrap: wrap; gap: 12px; padding-top: 20px; }
.logo { font: 900 26px var(--display); color: var(--silk); text-decoration: none; letter-spacing: .01em; }
.logo span { color: var(--silk-dim); font-weight: 700; }
nav { display: flex; gap: 20px; }
nav a { color: var(--silk); text-decoration: none; }
nav a:hover { color: var(--gold); }

h1, h2 { font-family: var(--display); font-weight: 900; line-height: 1; letter-spacing: .005em; }
h1 { font-size: clamp(44px, 8vw, 84px); margin: 48px 0 28px; }
h2 { font-size: clamp(32px, 4.5vw, 44px); margin: 0 0 10px; }

/* ---- Hero: the RAM stick ---- */
.stick-wrap { position: relative; }
.slot {
  position: relative; padding-bottom: 14px;
  border-bottom: 10px solid var(--chip); border-radius: 0 0 6px 6px;
}
.dimm {
  position: relative; display: grid; grid-template-columns: 1fr minmax(0, 2.3fr) 1fr; align-items: center; gap: 2.5%;
  background: #0a5a33; border: 2px solid #1d7a4c; border-radius: 10px 10px 2px 2px;
  padding: 5% 4% 9%; box-shadow: inset 0 0 0 6px #0b5230;
  animation: insert .9s cubic-bezier(.2,.9,.25,1.15) .15s both;
}
@keyframes insert { from { transform: translateY(-120px); opacity: 0; } to { transform: none; opacity: 1; } }
.chips { display: grid; grid-template-columns: 1fr 1fr; gap: 10%; }
.chips i { aspect-ratio: 1 / 1.15; background: var(--chip); border-radius: 3px; box-shadow: inset 0 0 0 2px #2a2f2a; }
.label {
  background: var(--silk); color: var(--chip); border-radius: 4px; padding: 5% 7% 6%;
  display: flex; flex-direction: column; align-items: flex-start; container-type: inline-size;
}
.answer { font: 900 clamp(56px, 46cqi, 200px) / .85 var(--display); color: var(--alarm); display: inline-block; transform-origin: 30% 80%; }
.answer.yes { color: #10804a; }
.label:hover .answer { animation: jolt .4s; }
@keyframes jolt { 30% { transform: rotate(-4deg); } 70% { transform: rotate(3deg); } }
.part { font-size: clamp(13px, 4.6cqi, 18px); color: #4b544b; margin-top: 6px; }
.fingers {
  position: absolute; left: 3%; right: 3%; bottom: 0; height: 7%; z-index: 1;
  background: repeating-linear-gradient(90deg, var(--gold) 0 9px, transparent 9px 13px);
  border-top: 2px solid #b8902d;
}
.fingers::after { content: ""; position: absolute; left: 41%; width: 2.2%; top: -2px; bottom: 0; background: #0a5a33; }
.void {
  position: absolute; right: -10px; top: -26px; transform: rotate(7deg); z-index: 2;
  background: var(--alarm); color: #fff; font: 900 clamp(20px, 2.6vw, 30px) / 1.05 var(--display);
  padding: 12px 18px 10px; border-radius: 6px; text-align: center;
  box-shadow: 0 6px 0 rgba(0,0,0,.25); border: 2px dashed rgba(255,255,255,.6);
}
.void small { display: block; font: 700 13px var(--body); letter-spacing: 0; }
.lede { font-size: 22px; max-width: 34em; margin: 34px 0 0; }
.lede b { color: var(--gold); }

/* ---- Price board ---- */
section { margin: 72px 0; }
.board { background: var(--mask-deep); border-radius: 12px; padding: 28px clamp(16px, 3vw, 32px); }
.board-head { display: flex; justify-content: space-between; align-items: baseline; flex-wrap: wrap; gap: 8px; }
.updated, .sub, .fine { color: var(--silk-dim); }
.fine { font-size: 15px; max-width: 46em; }
.controls { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 12px 20px; margin: 16px 0 8px; }
.tabs { display: flex; gap: 6px; flex-wrap: wrap; }
.tab {
  font: 700 16px var(--body); color: var(--silk); background: transparent; cursor: pointer;
  border: 2px solid #2c6b48; border-radius: 6px; padding: 7px 14px;
}
.tab[aria-selected="true"] { background: var(--gold); border-color: var(--gold); color: var(--chip); }
.sortby { display: flex; align-items: center; gap: 10px; font-size: 15px; color: var(--silk-dim); }
.sortby select {
  font: 700 16px var(--body); color: var(--silk); background: var(--mask); cursor: pointer;
  border: 2px solid #2c6b48; border-radius: 6px; padding: 7px 10px;
}
.filters { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 22px; margin: 6px 0 4px; font-size: 15px; }
.fgroup { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.flabel { color: var(--silk-dim); margin-right: 2px; }
.fchip {
  font: 700 14px var(--body); color: var(--silk); background: transparent; cursor: pointer;
  border: 1px solid #2c6b48; border-radius: 999px; padding: 4px 12px;
}
.fchip:hover { border-color: var(--gold); }
.fchip[aria-pressed="true"] { background: var(--silk); border-color: var(--silk); color: var(--chip); }
.fstock { display: flex; align-items: center; gap: 8px; cursor: pointer; }
.fstock input { width: 18px; height: 18px; margin: 0; accent-color: var(--gold); }
.fcount { color: var(--gold); font-weight: 700; }
.filters { flex-direction: column; align-items: stretch; gap: 8px; }
.flabel { display: inline-block; min-width: 4.5em; }
.fmisc { gap: 10px 20px; }
.fmax { display: flex; align-items: center; gap: 6px; }
.fmax input {
  width: 6.5em; font: 700 15px var(--body); color: var(--silk); background: var(--mask);
  border: 1px solid #2c6b48; border-radius: 6px; padding: 4px 8px;
}
.fclear { font: 700 14px var(--body); color: var(--gold); background: none; border: 0; padding: 4px 0; cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }
.fclear[hidden] { display: none; }
.none td { padding: 24px 8px; color: var(--silk-dim); }
.ptable { width: 100%; border-collapse: collapse; margin-top: 8px; }
.ptable th { text-align: left; padding: 0; border-bottom: 2px solid #2c6b48; }
.ptable th.num { text-align: right; }
.sorth {
  font: 700 15px var(--body); color: var(--silk-dim); background: none; border: 0; cursor: pointer;
  padding: 10px 8px; white-space: nowrap;
}
.sorth:hover { color: var(--silk); }
.sorth::after { content: "\2195"; display: inline-block; width: 1em; margin-left: 4px; opacity: .35; }
th[aria-sort="ascending"] .sorth, th[aria-sort="descending"] .sorth { color: var(--gold); }
th[aria-sort="ascending"] .sorth::after { content: "\2191"; opacity: 1; }
th[aria-sort="descending"] .sorth::after { content: "\2193"; opacity: 1; }
.ptable td { padding: 14px 8px; border-bottom: 1px solid #1d5638; vertical-align: top; }
.num { text-align: right; white-space: nowrap; }
.row { cursor: pointer; }
.row:hover td { background: rgba(226,181,68,.06); }
.row.open td { border-bottom-color: transparent; }
.pcell { padding-left: 30px !important; position: relative; }
.pcell::before {
  content: "+"; position: absolute; left: 8px; top: 14px; width: 1em; color: var(--gold);
  font-weight: 700; font-size: 20px; line-height: 1.5;
}
.row.open .pcell::before { content: "\2013"; }
.pbrand { display: block; font-size: 13px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--gold); }
.pname { font-size: 20px; font-weight: 700; line-height: 1.25; }
.pspec { color: var(--silk-dim); font-size: 15px; }
.psize { font-weight: 700; }
.pprice .price { font-weight: 700; }
.pgb { font-weight: 700; color: var(--gold); }
.pgb-unit { display: none; }
.cheapest {
  display: inline-block; color: var(--chip); background: var(--gold); font-size: 12px; font-weight: 700;
  padding: 0 7px; border-radius: 4px; margin-left: 6px; white-space: nowrap; vertical-align: 1px;
}
.detail td { padding: 0 8px 18px 30px; }
.fullname { margin: 0 0 10px; font-size: 15px; color: var(--silk-dim); }
.part-no { display: inline-block; margin-left: 8px; font: 13px ui-monospace, Menlo, Consolas, monospace; color: var(--silk); background: rgba(0,0,0,.25); padding: 1px 6px; border-radius: 4px; }
.sources { list-style: none; margin: 0; padding: 0; border-left: 2px solid var(--gold); }
.sources li { display: flex; justify-content: space-between; gap: 6px 16px; flex-wrap: wrap; padding: 5px 0 5px 14px; font-size: 16px; }
.sources .price { font-weight: 700; }
.flag { font-size: 13px; font-weight: 700; padding: 1px 7px; border-radius: 4px; margin-left: 8px; }
.flag.out { background: var(--alarm); color: #fff; }
.flag.unk { border: 1px solid var(--silk-dim); color: var(--silk-dim); }

/* ---- Prices over time ---- */
.trend-chart { margin-top: 18px; background: var(--mask-deep); border-radius: 12px; padding: 14px 10px 6px; }
.trend-chart svg { display: block; overflow: visible; }
.trend .grid { stroke: #1d5638; stroke-width: 1; vector-effect: non-scaling-stroke; }
.trend .ylab, .trend .xlab { fill: var(--silk-dim); font: 13px var(--body); }
.trend .ylab { text-anchor: end; }
.trend .xlab { text-anchor: middle; }
.trend .zero { stroke: var(--silk-dim); stroke-width: 1; stroke-dasharray: 4 4; opacity: .6; }
.trend .sline { fill: none; stroke-width: 3; stroke-linejoin: round; stroke-linecap: round; }
.trend .sdot { stroke-width: 2; }
.trend-key { list-style: none; display: flex; flex-wrap: wrap; gap: 8px 26px; margin: 14px 0 0; padding: 0; font-size: 16px; }
.trend-key li { display: flex; align-items: baseline; gap: 6px; flex-wrap: wrap; }
.trend-key b { white-space: nowrap; }
.trend-key i { display: inline-block; width: 14px; height: 4px; border-radius: 2px; transform: translateY(-4px); }
svg .line { fill: none; stroke: var(--gold); stroke-width: 3; vector-effect: non-scaling-stroke; stroke-linejoin: round; stroke-linecap: round; }
svg .area { fill: rgba(226,181,68,.12); stroke: none; }
svg .dot { fill: var(--mask-deep); stroke: var(--gold); stroke-width: 2; vector-effect: non-scaling-stroke; }
svg .dot.last { fill: var(--gold); }
.down { color: #7be0a4; }
.up { color: var(--alarm); }
.ptrend { display: flex; align-items: center; flex-wrap: wrap; gap: 6px 16px; margin: 0 0 12px; }
.ptrend-chart { width: 240px; max-width: 100%; }
.ptrend-chart svg { display: block; width: 100%; height: 48px; }
.ptrend .pspec { margin: 0; }

/* ---- Then vs now ---- */
.bars { display: grid; gap: 26px; margin-top: 24px; }
.bar-title { display: flex; justify-content: space-between; gap: 12px; font-weight: 700; }
.bar-title .x { font: 900 30px/1 var(--display); color: var(--alarm); }
.track { margin-top: 8px; display: grid; gap: 4px; }
.fill { height: 30px; border-radius: 3px; display: flex; align-items: center; padding: 0 10px; font-size: 15px; font-weight: 700; white-space: nowrap; min-width: max-content; }
.fill.then { background: #2c6b48; color: var(--silk); }
.fill.now { background: var(--alarm); color: #fff; }
.bar-src { font-size: 14px; color: var(--silk-dim); margin-top: 6px; }

/* ---- Forms ---- */
.forms { display: grid; grid-template-columns: repeat(auto-fit, minmax(290px, 1fr)); gap: 40px; }
.form h2 { font-size: 34px; scroll-margin-top: 24px; }
.form label { display: block; font-weight: 700; margin: 14px 0; }
.form input, .form select {
  display: block; width: 100%; margin-top: 6px; font: 17px var(--body); padding: 11px 12px;
  color: var(--silk); background: var(--mask-deep); border: 2px solid #2c6b48; border-radius: 6px;
}
.form input:focus { border-color: var(--gold); outline: none; }
.form .check { display: flex; align-items: center; gap: 10px; font-weight: 400; }
.form .check input { width: 20px; height: 20px; margin: 0; accent-color: var(--gold); }
.form button[type=submit] {
  font: 700 17px var(--body); color: var(--chip); background: var(--gold); border: 0;
  border-radius: 6px; padding: 12px 20px; cursor: pointer;
}
.form-msg { min-height: 1.5em; font-weight: 700; color: var(--gold); }

footer { padding-top: 24px; padding-bottom: 48px; color: var(--silk-dim); font-size: 15px; border-top: 1px solid #2c6b48; }

@media (max-width: 640px) {
  body { font-size: 17px; }
  /* Rows become cards: name across the top, then size / price / per GB on one line. */
  .ptable thead, .wide { display: none; }
  .ptable, .ptable tbody { display: block; }
  .row { display: grid; grid-template-columns: auto 1fr auto; align-items: baseline; gap: 2px 14px; padding: 12px 0; border-bottom: 1px solid #1d5638; }
  .row.open { border-bottom-color: transparent; }
  .row td, .row.open td { display: block; padding: 0; border: 0; }
  .row .pcell { grid-column: 1 / -1; padding: 0 0 6px 26px !important; }
  .pcell::before { left: 2px; top: 0; }
  .row .psize { padding-left: 26px; text-align: left; }
  .row .pprice { text-align: left; }
  .row td.wide { display: none; }
  .row:hover td { background: none; }
  .pgb-unit { display: inline; font-size: 14px; font-weight: 400; color: var(--silk-dim); }
  .detail { display: block; }
  .detail[hidden] { display: none; }
  .detail td { display: block; padding: 0 0 16px 26px; border-bottom: 1px solid #1d5638; }
  .controls { flex-direction: column; align-items: stretch; }
  .sortby select { flex: 1; }
  .dimm { grid-template-columns: .5fr 3fr .5fr; padding: 6% 3% 13%; }
  .slot { padding-bottom: 10px; }
  .chips { grid-template-columns: 1fr; gap: 12%; }
  .chips i:nth-child(n+3) { display: none; }
  .void { position: static; display: inline-block; margin: 18px 0 0; transform: rotate(-2deg); font-size: 22px; }
  .lede { font-size: 19px; }
  nav { gap: 14px; font-size: 16px; }
}
@media (prefers-reduced-motion: reduce) {
  .dimm, .label:hover .answer { animation: none; }
}
.void[hidden] { display: none !important; }

/* ---- Research consent banner (shared-link visitors, see consent.js) ---- */
.consent {
  position: fixed; left: 16px; right: 16px; bottom: 16px; z-index: 10; max-width: 968px; margin: 0 auto;
  display: flex; flex-wrap: wrap; align-items: center; gap: 12px 20px; padding: 14px 18px;
  background: var(--mask-deep); border: 2px solid var(--gold); border-radius: 8px; box-shadow: 0 8px 30px rgba(0,0,0,.4);
  font-size: 16px;
}
.consent p { margin: 0; flex: 1 1 320px; }
.consent-btns { display: flex; gap: 10px; }
.consent button {
  font: 700 16px var(--body); padding: 9px 18px; border-radius: 6px; cursor: pointer;
  background: var(--gold); color: var(--chip); border: 2px solid var(--gold);
}
.consent button.quiet { background: transparent; color: var(--silk); border-color: var(--silk-dim); }

/* The multi-page flow (flow.js): product page, watch a price, your alerts. */
a.button { display: inline-block; font: 700 17px var(--body); color: var(--chip); background: var(--gold); border-radius: 6px; padding: 12px 20px; text-decoration: none; }
a.more { font-weight: 700; }
