/* ═══════ buyGPUs.co.uk — stylesheet ═══════ */

:root {
  /* palette */
  --ink: #0c1322;
  --ink-soft: #46536b;
  --paper: #f8f9fb;
  --card: #ffffff;
  --line: #dfe4ed;
  --accent: #2f5ff6;
  --accent-deep: #1d3fbf;
  --violet: #7b3ff2;
  --ok: #146b33;
  --warn: #b86a10;
  --radius: 16px;
  --shadow-1: 0 1px 2px rgba(12, 19, 34, .08);
  --shadow-2: 0 12px 28px rgba(12, 19, 34, .12);
  --shadow-lift: 0 18px 36px rgba(12, 19, 34, .16);
  --gap: clamp(16px, 2.2vw, 28px);
  --wrap: min(1240px, 94vw);
  --sticky-top: 6.5rem;

  --font-display: "Sora", system-ui, sans-serif;
  --font-body: "Inter", system-ui, sans-serif;
}

* { box-sizing: border-box; }
html { color-scheme: light; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: clamp(15px, 0.95rem, 17px);
  line-height: 1.55;
}
img { max-width: 100%; height: auto; display: block; }
a { color: inherit; }
button { font: inherit; }
.wrap { width: var(--wrap); margin-inline: auto; }

.display {
  font-family: var(--font-display);
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.08;
}

/* ═══════ Header ═══════ */

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--paper);
}

.bar {
  display: flex;
  align-items: center;
  gap: var(--gap);
  padding: 0.5rem 0;
}

.logo {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  text-decoration: none;
  font-family: var(--font-display);
  font-size: 1.65rem;
  white-space: nowrap;
}
.logo .accent-word { color: var(--accent); }
.logo .mark { width: 2.3rem; height: 2.3rem; color: var(--accent); }

.bar .search { display: none; }

.site-header nav {
  ul {
    display: flex;
    flex-wrap: wrap;
    gap: 1.6rem 2rem;
    margin: 0;
    padding: 0.7rem 0;
    border-bottom: 1px solid var(--line);
    list-style: none;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
  }
  a { text-decoration: none; color: var(--ink-soft); }
  a:hover { color: var(--accent); }
}

/* ═══════ Hero ═══════ */

.hero {
  display: grid;
  grid-template-areas: "copy img";
  gap: var(--gap);
  align-items: start;
  padding-block: clamp(2.5rem, 6vw, 5rem);
  background:
    radial-gradient(90rem 60rem at 85% 15%, rgba(123, 63, 242, .07), transparent 60%),
    radial-gradient(80rem 55rem at 10% 90%, rgba(47, 95, 246, .06), transparent 60%),
    var(--paper);
}

.hero .hero-copy {
  grid-area: copy;
  max-width: 46rem;
}
.hero-copy h1 {
  font-size: clamp(2.4rem, 5.4vw, 4.2rem);
  margin: 0;
  background: linear-gradient(92deg, var(--ink) 55%, var(--accent-deep) 82%, var(--violet));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.hero-copy .lead {
  margin: 1rem 0 0;
  color: var(--ink-soft);
  font-size: 1.05rem;
}
.hero-copy .cta {
  display: inline-block;
  margin-top: 1.2rem;
  padding: 0.7rem 1.4rem;
  border-radius: 999px;
  background: var(--accent);
  color: #fff;
  text-decoration: none;
  font-weight: 600;
  box-shadow: var(--shadow-1);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.hero-copy .cta:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-2);
}

.hero figure {
  grid-area: img;
  justify-self: end;
  align-self: stretch;
  margin: 0;
  width: clamp(26rem, 36vw, 40rem);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-2);
}
.hero figure img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

@media (max-width: 56rem) {
  .hero {
    grid-template-areas:
      "img img"
      "copy copy";
  }
  .hero figure { width: 100%; height: 16rem; }
  .hero .hero-copy { max-width: none; }
}

/* ═══════ Shop grid ═══════ */

.chip {
  border: 1.5px solid var(--line);
  background: var(--card);
  border-radius: 999px;
  padding: 0.45rem 1.1rem;
  cursor: pointer;
  font-weight: 600;
  font-size: 0.85rem;
  transition: border-color 0.15s ease;
}
.chip:hover { border-color: var(--accent); }
.chip:focus-visible, .facets .sort:focus-visible, .pager button:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}
.chip.is-active {
  background: var(--ink);
  color: #fff;
  border-color: var(--ink);
}
/* the homepage grid keeps its heading flush */
.shop-head h2 {
  font-size: clamp(1.4rem, 2.4vw, 2rem);
  margin: 0;
}

.grid {
  list-style: none;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(270px, 1fr));
  gap: var(--gap);
  margin: 0;
  margin-top: var(--gap);
  padding-inline: clamp(0.5rem, 2vw, 1.5rem);
  padding-block: 1.5rem;
}

/* ═══════ Product cards ═══════ */

.card {
  position: relative;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-1);
  transition: box-shadow 0.2s ease, transform 0.2s ease;
  padding: 0 0 1.4rem;
}

/* text under the image gets breathing room */
.card .name,
.card .rating,
.card .price,
.card .add {
  padding-inline: 1.25rem;
}
.card:hover {
  transform: translateY(-6px);
  box-shadow: var(--shadow-lift);
}
.card img {
  width: 100%;
  height: 14rem;
  object-fit: cover;
}

.card .tag {
  position: absolute;
  top: 0.75rem;
  left: 0.75rem;
  margin: 0;
  padding: 0.3rem 0.75rem;
  border-radius: 999px;
  background: var(--ink);
  color: #fff;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.card .tag.chip-best { background: var(--accent); }

.card .name {
  margin: 0;
  margin-top: 1.1rem;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.05rem;
}
.card .name .spec { color: var(--ink-soft); font-weight: 500; }

.card .rating {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin: 0;
  margin-top: 0.4rem;
  font-size: 0.85rem;
  color: var(--warn);
}
.card .rating span {
  color: var(--ink-soft);
  background: var(--paper);
  border-radius: 6px;
  padding: 0.25rem 0.55rem;
  font-size: 0.8rem;
}

.card .price {
  margin: 0;
  margin-top: 0.55rem;
  font-weight: 700;
  font-size: 1.15rem;
  color: var(--ink);
}

.card .add {
  margin: 0.15rem 0 0;
  border: none;
  background: none;
  color: var(--accent-deep);
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
}
.card .add::after { content: " →"; }
.card .add:hover { text-decoration: underline; }

/* scroll reveal: only when js/app.js has flagged itself */
html.js .reveal {
  opacity: 0;
  transform: translateY(22px);
  transition: opacity 0.55s ease, transform 0.55s ease;
}
html.js .reveal.revealed { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  html.js .reveal { opacity: 1; transform: none; transition: none; }
}

/* filtered-out cards */
.card[hidden] { display: none; }

/* ═══════ Footer ═══════ */

footer {
  background: var(--ink);
  color: #cdd6e4;
  padding-block: clamp(2rem, 4vw, 3rem) 1.2rem;
}
footer .foot-grid {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: var(--gap);
}
footer h3 { color: #fff; margin: 0; font-size: 1.1rem; }
footer .fine { color: #8d9ab3; margin: 0.4rem 0 0; font-size: 0.85rem; }
footer nav ul {
  display: flex;
  gap: 1.5rem;
  margin: 0;
  padding: 0;
  list-style: none;
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
footer nav a:hover { color: #9db9ff; }
footer .fine-print {
  margin: 1.4rem auto 0;
  font-size: 0.8rem;
  color: #7f8ea8;
}
footer .fine-print a:hover { color: #9db9ff; }

/* ═══════ Product detail page ═══════ */

.product {
  padding-block: clamp(2rem, 5vw, 3.5rem) clamp(2.5rem, 5vw, 4rem);
}

/* one vertical rhythm: every band on the page gets the same breath */
main.product > * + * {
  margin-top: clamp(2rem, 4vw, 3.1rem);
}

.prod-head {
  display: grid;
  justify-items: start;
  gap: 0.7rem;
}
.prod-head .crumbs {
  font-size: 0.82rem;
  color: var(--ink-soft);
  white-space: nowrap;
}
.prod-head .crumbs a { color: var(--accent-deep); text-decoration: none; }
.prod-head h1 {
  font-size: clamp(1.9rem, 4vw, 2.9rem);
  margin: 0;
}
.prod-head .subhead {
  color: var(--ink-soft);
  margin: 0;
  font-size: 1rem;
  max-width: 58ch;
}
/* the four numbers shoppers actually compare, above the fold */
.prod-head .glance {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem 0.6rem;
  margin: 0;
  margin-top: 0.3rem;
  list-style: none;
  font-size: 0.8rem;
  color: var(--ink-soft);
}
.prod-head .glance li {
  padding: 0.32rem 0.8rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--card);
  font-weight: 600;
  white-space: nowrap;
}

/* band one: the photo and the price summary face each other */
.prod-layout {
  display: grid;
  grid-template-columns: min(29rem, 50%) min(25rem, 45%);
  column-gap: clamp(1.2rem, 2.6vw, 2.2rem);
  align-items: center;
  justify-content: center;
  margin-top: 0;
}
.prod-layout figure {
  margin: 0;
  position: relative;
  max-width: 29rem;
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-2);
}
.prod-layout figure img {
  width: 100%;
  height: auto;
  object-fit: cover;
}
.prod-layout .caption {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 0.45rem 0.8rem 0.55rem;
  font-size: 0.8rem;
  line-height: 1.4;
  color: var(--ink-soft);
  background: rgba(255, 255, 255, .86);
}

/* band two: the price summary reads left to right, not as a centred poster */
.buy-box {
  display: grid;
  justify-items: start;
  row-gap: 0.85rem;
  padding: 1.2rem 1.4rem 1.3rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--card);
  box-shadow: var(--shadow-2);
  align-self: center;
}
.buy-box .price {
  margin: 0;
  font-weight: 800;
  font-size: clamp(1.5rem, 3vw, 2.1rem);
  letter-spacing: -0.01em;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}
.buy-box .stock {
  margin: 0;
  justify-self: start;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  padding: 0.3rem 0.8rem;
  border-radius: 999px;
  background: rgba(26, 143, 76, .12);
  color: var(--ok);
}
.buy-box .add,
.buy-box .buy {
  justify-self: start;
  text-decoration: none;
  border: 1.5px solid var(--accent-deep);
  background: var(--accent);
  color: #fff;
  font-weight: 600;
  font-size: 0.9rem;
  cursor: pointer;
  padding: 0.5rem 1.2rem;
  border-radius: 999px;
  transition: background 0.15s ease, border-color 0.15s ease;
}
.buy-box .add:hover,
.buy-box .buy:hover {
  background: var(--accent-deep);
  border-color: var(--accent-deep);
}
.buy-box .add:focus-visible,
.buy-box .buy:focus-visible {
  outline: 2px solid var(--accent-deep);
  outline-offset: 3px;
}
.buy-box .note,
.buy-box .secure {
  margin: 0;
  font-size: 0.78rem;
  line-height: 1.45;
  color: var(--ink-soft);
}
.buy-box .note {
  border-top: 1px solid var(--line);
  padding-top: 0.9rem;
  margin-top: 0.9rem;
}

/* band three: the spec table gets its own card and its own measure */
.prod-spec {
  width: min(44rem, 92%);
  margin-inline: auto;
  padding: 1.3rem 1.5rem 1.4rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--card);
  box-shadow: var(--shadow-1);
}

section h2,
main .legal-head h1 {
  margin: 0;
}
.prod-spec h2,
.prod-related h2 {
  font-size: clamp(1.3rem, 2.4vw, 1.8rem);
  margin: 0;
}

/* spec + data tables */
table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.92rem;
  margin: 0;
  margin-top: 1rem;
}
caption,
th,
td {
  padding: 0.6rem 0.9rem;
  border-bottom: 1px solid var(--line);
  text-align: left;
}
caption {
  color: var(--ink-soft);
  font-size: 0.85rem;
  border-bottom: none;
}
thead th {
  background: #eef1f6;
  font-weight: 600;
}
th {
  font-weight: 600;
  width: 38%;
}

/* product tables keep a readable measure instead of stretching across the page */
/* the offers band keeps its own measure, centred under the heading */
.offers-main {
  max-width: min(43rem, 100%);
  margin-inline: auto;
}
.offers-table {
  width: 100%;
  table-layout: fixed;
  font-size: 0.95rem;
}
.offers-table th,
.offers-table td {
  padding: 0.55rem 0.85rem;
}
.offers-table .retailer-col { width: 30%; }
.offers-table .price-col { width: 21%; }
.offers-table .stock-col { width: 49%; }
.offers-table th {
  width: auto;
  font-weight: 600;
}
.offers-table td[data-price] {
  padding-inline: 0.45rem;
  text-align: right;
  font-variant-numeric: tabular-nums;
  font-weight: 700;
  color: var(--ink);
}
.offers-table td:not([data-price]) {
  font-size: 0.86rem;
  color: var(--ink-soft);
}
.prod-offers .offers-table tbody tr:nth-child(even),
.prod-spec .spec-table tbody tr:nth-child(even) {
  background: rgba(223, 228, 237, .38);
}
.spec-table th {
  width: 33%;
}
/* lists in prose sections */
.notes, .third-list, .cookie-list, .contact-list {
  padding-left: 1.3rem;
  margin: 0;
  margin-top: 1rem;
  list-style: disc;
}
.notes li,
.third-list li,
.cookie-list li,
.contact-list li {
  margin-top: 0.5rem;
  max-width: 60ch;
}
.notes li::marker,
.third-list li::marker,
.cookie-list li::marker,
.contact-list li::marker { color: var(--accent); }
main strong { color: var(--accent-deep); }

/* related-cards strip on the product page */
.prod-related .grid {
  grid-template-columns: repeat(auto-fit, minmax(17rem, 1fr));
}

/* prose boxes */
.policy,
.intro,
.controller {
  max-width: 66ch;
}

.cta {
  display: inline-block;
  padding: 0.55rem 1.2rem;
  border-radius: 999px;
  background: var(--accent);
  color: #fff;
  text-decoration: none;
  font-weight: 600;
  font-size: 0.9rem;
}

@media (max-width: 56rem) {
  .prod-layout {
    grid-template-columns: 1fr;
    row-gap: 1.2rem;
    justify-content: center;
  }
  .prod-layout figure { justify-self: center; }
  .offers-table { table-layout: auto; }
  .offers-table th,
  .offers-table td { padding: 0.4rem 0.55rem; }
  .offers-table .go { font-size: 0.74rem; padding: 0.3rem 0.65rem; }
  .prod-head .glance { margin-top: 0.2rem; }
}

/* ═══════ Legal pages ═══════ */

main.legal {
  padding-block: clamp(2rem, 5vw, 3.5rem) clamp(2.5rem, 5vw, 4rem);
}
main.legal .legal-head h1 {
  font-size: clamp(1.9rem, 4vw, 2.9rem);
}
main.legal .updated {
  color: var(--ink-soft);
  margin: 0;
  margin-top: 0.4rem;
  font-size: 0.9rem;
}
.toc {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.3rem;
  margin: 1.2rem 0 0;
  padding: 0.5rem 0.9rem;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--card);
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  list-style: none;
}
.toc a { color: var(--accent-deep); text-decoration: none; }
.toc a:hover { text-decoration: underline; }
.toc ul { display: contents; }
main.legal section h2 {
  font-size: clamp(1.3rem, 2.4vw, 1.8rem);
  margin-top: 2rem;
}
main.legal p {
  max-width: 68ch;
}
main.legal ol {
  padding-left: 1.6rem;
  margin: 0;
  margin-top: 1rem;
}
main.legal ol li {
  margin-top: 0.55rem;
  max-width: 66ch;
}
main.legal ol li::marker { color: var(--accent); }
.back-top { margin-top: 2.5rem; }

/* ═══════ Affiliate additions ═══════ */

.price .at {
  display: block;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--ink-soft);
}

/* the retailer names are the affiliate links the disclosure talks about */
.offers-table th[scope="row"] a,
.price .at a {
  color: var(--accent-deep);
  font-weight: 600;
  text-decoration: none;
}
.offers-table th[scope="row"] a:hover,
.offers-table th[scope="row"] a:focus-visible,
.price .at a:hover,
.price .at a:focus-visible { text-decoration: underline; }
.price .at a:focus-visible { outline: 2px solid var(--accent-deep); outline-offset: 2px; }

/* every offer also gets a button, so the outbound link is a real tap target */
.offers-table .go {
  display: block;
  width: fit-content;
  margin-top: 0.5rem;
  padding: 0.34rem 0.8rem;
  border: 1.3px solid var(--accent-deep);
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--accent-deep);
  text-decoration: none;
  cursor: pointer;
}
.offers-table .go:hover,
.offers-table .go:focus-visible {
  background: rgba(109, 154, 255, 0.18);
}
.offers-table .go:focus-visible { outline: 2px solid var(--accent-deep); outline-offset: 2px; }

/* product offers table */
td.is-best {
  background: rgba(109, 154, 255, 0.14);
  font-weight: 700;
}

td.is-best::after {
  content: "best today";
  display: block;
  text-align: center;
  color: var(--accent-deep);
  font-weight: 600;
  font-size: 0.7rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

/* the plain-English spread line under the offers table */
.offers-main .spread {
  margin: 0;
  margin-top: 1rem;
  font-size: 0.86rem;
  color: var(--ink-soft);
  text-align: center;
}
.offers-main .spread .delta { color: var(--accent-deep); font-weight: 700; }

/* affiliate disclosure box */
.disclosure {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #eef1f6;
  padding: 1rem 1.3rem;
  font-size: 0.88rem;
  line-height: 1.55;
  margin: 1.2rem 0 0;
}
.disclosure strong { color: var(--ink); }

/* on the product page the note closes the prices band, same measure as the table */
main.product > .disclosure {
  margin: 1.3rem auto 0;
  max-width: min(43rem, 100%);
  padding: 1.05rem 1.4rem;
}

/* ═══════ Shop-page facets ═══════ */
.facets {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(11rem, 1fr));
  gap: 0.9rem 1rem;
  align-items: start;
}

.facet-label {
  margin: 0;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-soft);
}

.chips {
  margin: 0.6rem 0 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.facets .chip {
  flex: 0 1 auto;
  padding: 0.35rem 0.85rem;
}

.facets .sort {
  border: 1.5px solid var(--line);
  background: var(--card);
  border-radius: 999px;
  padding: 0.35rem 0.85rem;
  cursor: pointer;
  font-weight: 600;
  font-size: 0.85rem;
  color: var(--ink-soft);
}
.facets .sort:hover { border-color: var(--accent); }
.facets .sort.is-active {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}

.live-count {
  margin: 1.2rem 0 1.7rem;
  font-size: 0.85rem;
  color: var(--ink-soft);
}

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

/* facets live as a sticky left sidebar */
.shop-layout {
  display: grid;
  grid-template-columns: 16rem 1fr;
  gap: 1.6rem;
  align-items: start;
}

.shop-layout > .facets > .facet { min-width: 0; }

.shop-layout > .facets {
  position: sticky;
  top: var(--sticky-top);
  min-width: 0;
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.8rem;
  padding: 1rem 1.1rem;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.shop-layout > .shop-side {
  min-width: 0;
  display: grid;
  justify-items: start;
  align-items: start;
}

.shop-side > .grid {
  grid-template-columns: repeat(3, minmax(15rem, 1fr));
  margin-top: 0;
  padding-block: 0;
}

.shop-side > .pager { justify-self: stretch; }

.pager {
  margin: 1.6rem 0 2.6rem;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 0.4rem;
}

.pager button {
  border: 1.5px solid var(--line);
  background: var(--card);
  border-radius: 999px;
  padding: 0.35rem 0.85rem;
  cursor: pointer;
  font-weight: 600;
  font-size: 0.85rem;
  color: var(--ink-soft);
}
.pager button:hover { border-color: var(--accent); }
.pager button.is-active {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}

@media (max-width: 70rem) {
  .shop-layout { grid-template-columns: 14rem 1fr; gap: 1.2rem; }
  .shop-side > .grid { grid-template-columns: repeat(2, minmax(14rem, 1fr)); }
}

@media (max-width: 56rem) {
  .shop-layout { display: block; }
  .shop-side > .grid { grid-template-columns: repeat(auto-fill, minmax(270px, 1fr)); }
}
