/* ==========================================================================
   NorthScientific — Brand System v1.0
   Tokens and rules per DOC-BR-001. One accent. Depth from border, not shadow.
   ========================================================================== */

/* Fonts are loaded via <link> tags in each page head (with preconnect) —
   an @import here would serialise the request chain behind this stylesheet. */

:root {
  /* Colour tokens ------------------------------------------------------- */
  --void:            #06080A;   /* page ground — never lightened            */
  --surface:         #0C1013;   /* cards, panels, tiles, table rows         */
  --surface-raised:  #11171B;   /* inputs, hovered rows, modal bodies       */
  --border:          #1E262C;   /* 1px hairlines — the structural device    */
  --border-strong:   #2A343B;
  --ink:             #E8EEF2;   /* headlines, prices, primary values        */
  --muted:           #8A98A2;   /* body copy, labels, descriptor text       */
  --faint:           #57646C;
  --accent:          #79D3E8;   /* one accent — CTA, mark, active, verified */
  --accent-dim:      rgba(121, 211, 232, 0.12);
  --accent-line:     rgba(121, 211, 232, 0.32);
  --danger:          #C86A5E;
  --success:         #6FBF9B;

  /* Type ---------------------------------------------------------------- */
  --font-display: 'Archivo', Helvetica, Arial, sans-serif;
  --font-mono: 'IBM Plex Mono', ui-monospace, 'SF Mono', Menlo, monospace;

  /* Spacing — 4px base -------------------------------------------------- */
  --s1: 4px;  --s2: 8px;  --s3: 16px; --s4: 24px; --s5: 40px; --s6: 72px;
  --s7: 96px;

  --maxw: 1200px;
  --radius: 2px;
  --header-h: 116px;
}

/* Reset --------------------------------------------------------------- */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; overflow-x: hidden; }

body {
  background: var(--void);
  color: var(--muted);
  font-family: var(--font-display);
  font-size: 16px;
  line-height: 1.65;
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

img, svg { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; }
::selection { background: var(--accent); color: var(--void); }

/* Keyboard accessibility ---------------------------------------------- */
a:focus-visible, button:focus-visible, select:focus-visible, [tabindex]:focus-visible {
  outline: 2px solid var(--accent); outline-offset: 2px;
}
.skip-link {
  position: absolute; left: 16px; top: -48px; z-index: 300;
  background: var(--surface-raised); color: var(--ink);
  border: 1px solid var(--accent-line); padding: 10px 16px;
  font-size: 0.85rem; transition: top .2s ease;
}
.skip-link:focus { top: 12px; }
.visually-hidden {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

/* Subtle engineering grid, drawn from border value only ---------------- */
.grid-field {
  background-image:
    linear-gradient(to right, rgba(30,38,44,0.5) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(30,38,44,0.5) 1px, transparent 1px);
  background-size: 72px 72px;
}

/* Layout -------------------------------------------------------------- */
.wrap { max-width: var(--maxw); margin: 0 auto; padding: 0 var(--s4); }
/* Grid/flex children must be allowed to shrink below their content width,
   otherwise long mono strings force horizontal overflow on small screens. */
.hero__grid > *, .steps > *, .split > div, .stats > *,
.cat-layout > *, .footer__grid > *, .coa > div, .card { min-width: 0; }
.section { padding: var(--s7) 0; }
@media (max-width: 720px) { .section { padding: var(--s6) 0; } }

/* Typography ---------------------------------------------------------- */
h1, h2, h3 { color: var(--ink); font-weight: 600; line-height: 1.02; letter-spacing: -0.028em; }
h1 { font-size: clamp(3rem, 8vw, 5.6rem); }
h2 { font-size: clamp(2rem, 4.4vw, 3.1rem); letter-spacing: -0.024em; }
h3 { font-size: 1.25rem; font-weight: 500; letter-spacing: -0.01em; line-height: 1.2; }

p { max-width: 62ch; }
strong { color: var(--ink); font-weight: 500; }

/* Eyebrow / mono labels ----------------------------------------------- */
.eyebrow {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 400;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--muted);
  display: inline-flex;
  align-items: center;
  gap: var(--s3);
}
.eyebrow::before {
  content: "";
  width: 28px; height: 1px;
  background: var(--accent);
  display: inline-block;
}
.eyebrow.no-rule::before { display: none; }
.mono { font-family: var(--font-mono); }
.data { font-family: var(--font-mono); letter-spacing: 0.02em; }
.accent-text { color: var(--accent); }

/* Buttons ------------------------------------------------------------- */
.btn {
  display: inline-flex; align-items: center; gap: var(--s2);
  font-family: var(--font-display);
  font-size: 0.95rem; font-weight: 500;
  padding: 14px 26px;
  border: 1px solid transparent;
  transition: background .18s ease, border-color .18s ease, color .18s ease, transform .18s ease;
  white-space: nowrap;
}
.btn:active { transform: translateY(1px); }
.btn.is-disabled { opacity: .45; pointer-events: none; cursor: default; }

/* Truncated corner reserved for primary CTA + the mark (never both) */
.btn-primary {
  background: var(--accent);
  color: var(--void);
  font-weight: 600;
  clip-path: polygon(0 0, 100% 0, 100% calc(100% - 15px), calc(100% - 15px) 100%, 0 100%);
}
.btn-primary:hover { background: #96e0f1; }

.btn-ghost {
  background: transparent;
  color: var(--ink);
  border-color: var(--border-strong);
}
.btn-ghost:hover { border-color: var(--accent-line); color: var(--accent); }

.btn-block { width: 100%; justify-content: center; }
.btn-sm { padding: 10px 18px; font-size: 0.85rem; }

/* Tags / status ------------------------------------------------------- */
.tag {
  font-family: var(--font-mono);
  font-size: 0.66rem; letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--muted);
}
.status { display: inline-flex; align-items: center; gap: 7px; }
.status::before { content: ""; width: 6px; height: 6px; border-radius: 50%; }
.status--in    { color: var(--success); }
.status--in::before { background: var(--success); }
.status--low   { color: var(--accent); }
.status--low::before { background: var(--accent); }
.status--out   { color: var(--danger); }
.status--out::before { background: var(--danger); }
.status--qc    { color: var(--muted); }
.status--qc::before { background: var(--muted); }
.card__foot .status--qc, .pdp__price-row .status--qc { font-size: 10px; letter-spacing: 0.04em; text-transform: uppercase; }

/* Hairline divider ---------------------------------------------------- */
.rule { height: 1px; background: var(--border); border: 0; }

/* =====================================================================
   Announcement bar
   ===================================================================== */
.announce {
  background: var(--void);
  border-bottom: 1px solid var(--border);
  font-family: var(--font-mono);
  font-size: 10.5px; letter-spacing: 0.2em; text-transform: uppercase;
  color: var(--muted);
  text-align: center;
  padding: 9px 16px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.announce span { color: var(--muted); }
@media (max-width: 560px) {
  .announce { white-space: normal; font-size: 0.6rem; letter-spacing: 0.1em; line-height: 1.5; padding: 8px 14px; }
}

/* =====================================================================
   Header
   ===================================================================== */
.header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(6, 8, 10, 0.82);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border);
}
.header__inner {
  display: flex; align-items: center; gap: var(--s4);
  padding: 20px var(--s4);
  max-width: var(--maxw); margin: 0 auto;
}
.header__logo { flex: 0 1 auto; min-width: 0; display: inline-flex; }
.header__logo svg { height: 30px; width: auto; max-width: 100%; }
.header__nav { display: flex; gap: 34px; margin-left: var(--s3); }
.header__nav a {
  color: var(--ink); font-size: 14px; font-weight: 400;
  position: relative; padding: 4px 0;
  transition: color .16s ease;
}
.header__nav a:hover, .header__nav a[aria-current] { color: var(--accent); }
.header__nav a[aria-current]::after {
  content: ""; position: absolute; left: 0; bottom: -2px;
  width: 100%; height: 1px; background: var(--accent);
}
.header__spacer { flex: 1 1 auto; min-width: var(--s3); }
.header__tools { display: flex; align-items: center; gap: var(--s4); flex: none; }
.search {
  display: flex; align-items: center; gap: 8px;
  background: var(--surface-raised);
  border: 1px solid var(--border);
  padding: 9px 14px; min-width: 200px;
  color: var(--faint); font-size: 0.85rem;
  transition: border-color .16s ease;
}
.search:focus-within { border-color: var(--accent-line); }
.search input {
  background: none; border: 0; outline: 0; color: var(--ink);
  font-family: var(--font-display); font-size: 0.85rem; width: 100%;
}
.search input::placeholder { color: var(--faint); }
.cart-link { display: inline-flex; align-items: center; gap: 8px; color: var(--ink); font-size: 0.95rem; flex: none; white-space: nowrap; }
.cart-link svg { flex: none; }
.cart-link .count { color: var(--accent); font-family: var(--font-mono); }
.menu-toggle { display: none; flex: none; width: 40px; height: 40px; align-items: center; justify-content: center; background: none; border: 0; color: var(--ink); margin-right: -8px; }
.menu-toggle svg { width: 24px; height: 24px; }

/* Tablet & below — collapse nav to the drawer */
@media (max-width: 960px) {
  .header__nav, .search { display: none; }
  .menu-toggle { display: inline-flex; }
  .header__inner { gap: var(--s3); padding: 16px var(--s4); }
}
/* Small phones — shrink wordmark, tighten gaps */
@media (max-width: 560px) {
  .header__inner { padding: 14px var(--s3); gap: var(--s2); }
  .header__logo svg { height: 24px; }
  .header__tools { gap: var(--s3); }
  .cart-link { font-size: 0.9rem; }
}
/* Very narrow — cart becomes icon + count only */
@media (max-width: 380px) {
  .cart-link .cart-word { display: none; }
  .cart-link { gap: 6px; }
}

/* Mobile drawer ------------------------------------------------------- */
/* The drawer opens below the announcement bar and its top row mirrors
   .header__inner exactly, so the close button lands on the same pixels as the
   menu button that opened it — no second tap target to hunt for.
   --announce-h is measured in app.js because the bar wraps on small screens. */
.drawer {
  position: fixed; top: var(--announce-h, 0px); left: 0; right: 0; bottom: 0;
  z-index: 100;
  background: var(--void);
  transform: translateX(100%); transition: transform .28s cubic-bezier(.4,0,.2,1);
  display: flex; flex-direction: column;
  overflow-y: auto;
}
.drawer.open { transform: translateX(0); }
.drawer__top {
  display: flex; justify-content: space-between; align-items: center;
  gap: var(--s3);
  padding: 16px var(--s4);           /* matches .header__inner ≤960px */
  border-bottom: 1px solid var(--border);
  margin-bottom: var(--s3);
}
.drawer__top img { height: 30px; width: auto; }  /* matches .header__logo svg */
.drawer__close {
  flex: none; width: 40px; height: 40px; margin-right: -8px;
  display: inline-flex; align-items: center; justify-content: center;
  background: none; border: 0; color: var(--ink);
  font-size: 1.6rem; line-height: 1;
}
.drawer a { color: var(--ink); font-size: 1.5rem; font-weight: 500; padding: 10px var(--s4); border-bottom: 1px solid var(--border); }
@media (max-width: 560px) {
  .drawer__top { padding: 14px var(--s3); }   /* matches .header__inner ≤560px */
  .drawer__top img { height: 24px; }
  .drawer a { padding-left: var(--s3); padding-right: var(--s3); }
}

/* =====================================================================
   Hero
   ===================================================================== */
.hero { position: relative; border-bottom: 1px solid var(--border); overflow: hidden; }
/* Contained two-column layout, matching the reference hero strip (467/467,
   64px gap, 96/88 section padding). */
.hero__grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 64px;
  align-items: center;
  /* Vertical longhand only — this element is also .wrap, and a padding
     shorthand here would wipe out the horizontal gutter .wrap provides,
     letting text run into the screen edge on narrow viewports. */
  padding-top: var(--s7); padding-bottom: 88px;
}
.hero__left { display: flex; flex-direction: column; align-items: flex-start; min-width: 0; }

/* Reference: eyebrow is accent, IBM Plex Mono 11px, 0.26em tracking. */
.hero .eyebrow { color: var(--accent); font-size: 11px; letter-spacing: 0.26em; }
/* Reference H1: 74px / line-height 0.98 / -0.035em. */
.hero .hero__title { font-size: clamp(2.7rem, 6.4vw, 4.625rem); line-height: 0.98; letter-spacing: -0.035em; margin: var(--s4) 0; color: var(--ink); font-weight: 600; max-width: none; }
.hero h1.eyebrow { font-weight: 400; line-height: 1.4; margin: 0; }
/* Reference lead: 17px / 1.65 / muted / 467px column. */
.hero__lead { font-size: 17px; line-height: 1.65; color: var(--muted); max-width: 467px; }
.hero__cta { display: flex; gap: var(--s3); margin-top: var(--s5); flex-wrap: wrap; }
.hero .btn { padding: 16px 26px; font-size: 15px; }
.hero .btn-ghost { padding: 15px 24px; }
/* Reference markers: mono 11px, 0.12em, muted, above a hairline rule. */
.hero__markers {
  display: flex; gap: var(--s5); margin-top: var(--s5); padding-top: 22px;
  border-top: 1px solid var(--border);
  font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.12em;
  text-transform: uppercase; color: var(--muted); flex-wrap: wrap;
}
.hero__ruo {
  margin-top: var(--s4);
  font-family: var(--font-mono); font-size: 10px; letter-spacing: 0.16em;
  text-transform: uppercase; color: var(--faint);
}

/* Hero right — bordered, diagonally-hatched product frame (378×438 in the
   reference), transparent column, no dividing border. Keeps the drawn vial. */
.hero__right { display: flex; align-items: center; justify-content: center; min-width: 0; position: relative; }
.hero__frame {
  position: relative; z-index: 1;
  /* Square to match the square product photos — cover then crops nothing. */
  width: 100%; aspect-ratio: 1 / 1;
  border: 1px solid #1A2228;
  background:
    repeating-linear-gradient(135deg, rgba(255,255,255,0.015) 0 2px, transparent 2px 10px),
    var(--void);
  overflow: hidden;
  display: flex; align-items: center; justify-content: center;
  /* Slight blue glow — layered box-shadows are GPU-cheap and don't disturb
     the carousel's opacity compositing (a blur filter here froze it). */
  box-shadow:
    0 0 55px -6px rgba(121, 211, 232, 0.24),
    0 0 120px -24px rgba(121, 211, 232, 0.16);
}
/* Cross-fading product carousel inside the frame */
.hero__slides { position: absolute; inset: 0; z-index: 2; }
.hero__slide {
  position: absolute; inset: 0; width: 100%; height: 100%;
  object-fit: cover;
  opacity: 0;
  transition: opacity .8s ease;
}
.hero__slide.is-active { opacity: 1; }
.hero__meta {
  position: absolute; left: 14px; bottom: 12px; z-index: 5;
  font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.06em;
  color: var(--accent);
}
/* Slide indicator — minimal tick marks */
.hero__dots { position: absolute; left: 14px; right: 14px; bottom: 34px; z-index: 5; display: flex; gap: 5px; }
.hero__dots button {
  flex: 1; height: 2px; padding: 0; border: 0; background: var(--border-strong);
  cursor: pointer; transition: background .3s ease;
}
.hero__dots button:hover { background: var(--muted); }
.hero__dots button.on { background: var(--accent); }

@media (max-width: 900px) {
  .hero__grid { grid-template-columns: 1fr; gap: var(--s5); padding-top: var(--s6); padding-bottom: var(--s6); }
  .hero__right { order: -1; }
  .hero__frame { max-width: 420px; margin: 0 auto; }
}

/* =====================================================================
   Marquee / trust strip
   ===================================================================== */
.marquee {
  border-bottom: 1px solid var(--border);
  overflow: hidden; white-space: nowrap;
  padding: 18px 0;
  background: var(--void);
}
.marquee__track { display: inline-flex; gap: var(--s6); animation: slide 32s linear infinite; }
.marquee__track span {
  font-family: var(--font-mono); font-size: 0.72rem; letter-spacing: 0.2em;
  text-transform: uppercase; color: var(--muted);
  display: inline-flex; align-items: center; gap: var(--s3);
}
.marquee__track span::after { content: "·"; color: var(--accent); }
@keyframes slide { to { transform: translateX(-50%); } }

/* =====================================================================
   Section header
   ===================================================================== */
.sec-head { display: flex; justify-content: space-between; align-items: flex-end; gap: var(--s4); margin-bottom: var(--s6); flex-wrap: wrap; }
.sec-head__text { max-width: 640px; }
.sec-head h2 { margin: var(--s3) 0 var(--s3); }
.sec-head p { color: var(--muted); }
.sec-head__link { font-family: var(--font-mono); font-size: 0.72rem; letter-spacing: 0.16em; text-transform: uppercase; color: var(--accent); display: inline-flex; align-items: center; gap: 8px; white-space: nowrap; }
.sec-head__link:hover { gap: 12px; }

/* =====================================================================
   Traceability steps
   ===================================================================== */
.steps { display: grid; grid-template-columns: repeat(3, 1fr); border: 1px solid var(--border); }
.step { padding: var(--s5) var(--s4); border-right: 1px solid var(--border); position: relative; }
.step:last-child { border-right: 0; }
.step__num { font-family: var(--font-mono); font-size: 0.72rem; letter-spacing: 0.16em; color: var(--accent); }
.step h3 { margin: var(--s3) 0 var(--s2); }
.step p { color: var(--muted); font-size: 0.95rem; }
@media (max-width: 820px) {
  .steps { grid-template-columns: 1fr; }
  .step { border-right: 0; border-bottom: 1px solid var(--border); }
  .step:last-child { border-bottom: 0; }
}

/* =====================================================================
   Product grid
   ===================================================================== */
.grid-products { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px; background: var(--border); border: 1px solid var(--border); }
@media (max-width: 900px) { .grid-products { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 560px) { .grid-products { grid-template-columns: 1fr; } }

.card {
  scroll-margin-top: 96px;
  background: var(--surface);
  padding: var(--s4);
  display: flex; flex-direction: column;
  transition: background .18s ease;
  position: relative;
}
.card:hover { background: var(--surface-raised); }
.card__shot {
  position: relative;
  aspect-ratio: 1 / 1;
  background:
    repeating-linear-gradient(135deg, rgba(255,255,255,0.014) 0 2px, transparent 2px 9px),
    var(--void);
  border: 1px solid var(--border);
  display: flex; align-items: center; justify-content: center;
  margin-bottom: var(--s3);
  overflow: hidden;
}
.card:hover .card__shot { border-color: var(--accent-line); }
.card__photo { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; z-index: 1; transition: transform .5s cubic-bezier(.2,.7,.2,1); }
.card:hover .card__photo { transform: scale(1.04); }
.card__shot .mark { width: 34px; opacity: .5; transition: opacity .2s ease; }
.card:hover .card__shot .mark { opacity: .9; }
.card__batch { position: absolute; right: 10px; bottom: 8px; z-index: 2; font-family: var(--font-mono); font-size: 9.5px; letter-spacing: 0.04em; color: var(--accent); }
.card__label { position: absolute; left: 10px; bottom: 8px; font-family: var(--font-mono); font-size: 9.5px; letter-spacing: 0.06em; text-transform: uppercase; color: #3E4950; }
.card h3 { font-size: 15px; font-weight: 500; margin-bottom: 5px; }
.card__spec { font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.02em; text-transform: uppercase; color: var(--muted); }
.card__desc { font-size: 0.85rem; color: var(--muted); margin-top: 8px; }
.card__foot { display: flex; justify-content: space-between; align-items: baseline; margin-top: var(--s4); padding-top: var(--s3); border-top: 1px solid var(--border); }
.card__price { font-family: var(--font-mono); font-size: 15px; color: var(--ink); font-weight: 500; }
.card__foot .status { font-family: var(--font-mono); font-size: 10.5px; letter-spacing: 0.04em; text-transform: uppercase; }
.card__cta { margin-top: var(--s3); }

/* =====================================================================
   COA lookup panel
   ===================================================================== */
.coa {
  border: 1px solid var(--border);
  background:
    radial-gradient(90% 120% at 15% 0%, rgba(121,211,232,0.05), transparent 55%),
    var(--surface);
  padding: var(--s6);
  display: grid; grid-template-columns: 1fr 0.9fr; gap: var(--s6); align-items: center;
}
.coa > div { min-width: 0; }
@media (max-width: 820px) { .coa { grid-template-columns: 1fr; padding: var(--s5) var(--s4); gap: var(--s5); } }
@media (max-width: 420px) { .coa { padding: var(--s4) var(--s3); } }
.coa h2 { margin: var(--s3) 0; }
.coa__form { display: flex; gap: 0; margin-top: var(--s4); border: 1px solid var(--border-strong); background: var(--void); }
.coa__form:focus-within { border-color: var(--accent-line); }
.coa__form input { flex: 1 1 0; min-width: 0; background: none; border: 0; outline: 0; color: var(--ink); font-family: var(--font-mono); font-size: 0.9rem; letter-spacing: 0.05em; padding: 14px 16px; }
.coa__form .btn { flex: none; }
.coa__form input::placeholder { color: var(--faint); }
.coa__hint { font-family: var(--font-mono); font-size: 0.68rem; letter-spacing: 0.08em; color: var(--faint); margin-top: var(--s3); }

/* COA result card (mock certificate) */
.certificate { border: 1px solid var(--border); background: var(--void); }
.certificate__bar { display: flex; justify-content: space-between; align-items: center; padding: 14px var(--s3); border-bottom: 1px solid var(--border); }
.certificate__bar .tag { color: var(--accent); }
.certificate__rows { padding: var(--s3); }
.crow { display: flex; justify-content: space-between; gap: var(--s3); padding: 11px 0; border-bottom: 1px solid var(--border); font-family: var(--font-mono); font-size: 0.78rem; }
.crow:last-child { border-bottom: 0; }
.crow span:first-child { color: var(--muted); letter-spacing: 0.08em; text-transform: uppercase; font-size: 0.68rem; flex: none; }
.crow span:last-child { color: var(--ink); text-align: right; min-width: 0; overflow-wrap: anywhere; }
.crow .pass { color: var(--success); }

/* =====================================================================
   Split feature (standards / shipping)
   ===================================================================== */
.split { display: grid; grid-template-columns: 1fr 1fr; border: 1px solid var(--border); }
.split > div { padding: var(--s6) var(--s5); }
.split > div:first-child { border-right: 1px solid var(--border); }
.split h3 { margin-bottom: var(--s3); }
.split ul { list-style: none; margin-top: var(--s4); }
.split li { display: flex; gap: var(--s3); padding: 13px 0; border-top: 1px solid var(--border); color: var(--muted); font-size: 0.95rem; }
.split li::before { content: ""; flex: none; width: 6px; height: 6px; margin-top: 8px; background: var(--accent); }
.split li b { display: block; color: var(--ink); font-weight: 500; margin-bottom: 2px; }
@media (max-width: 820px) {
  .split { grid-template-columns: 1fr; }
  .split > div:first-child { border-right: 0; border-bottom: 1px solid var(--border); }
}

/* Stat row ------------------------------------------------------------ */
.stats { display: grid; grid-template-columns: repeat(4, 1fr); border: 1px solid var(--border); }
.stat { padding: var(--s5) var(--s4); border-right: 1px solid var(--border); }
.stat:last-child { border-right: 0; }
.stat__val { font-family: var(--font-mono); font-size: 2.1rem; color: var(--ink); font-weight: 500; letter-spacing: -0.02em; }
.stat__val .accent-text { font-size: 1.4rem; }
.stat__lab { font-family: var(--font-mono); font-size: 0.66rem; letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted); margin-top: 8px; }
@media (max-width: 720px) { .stats { grid-template-columns: 1fr 1fr; } .stat:nth-child(2) { border-right: 0; } .stat:nth-child(1), .stat:nth-child(2) { border-bottom: 1px solid var(--border); } }

/* =====================================================================
   CTA band
   ===================================================================== */
.cta-band {
  border: 1px solid var(--border);
  background:
    radial-gradient(80% 140% at 50% 0%, rgba(121,211,232,0.07), transparent 60%),
    var(--surface);
  padding: var(--s7) var(--s5); text-align: center;
}
.cta-band h2 { margin: var(--s3) auto var(--s4); max-width: 16ch; }
.cta-band p { margin: 0 auto var(--s5); color: var(--muted); }
.cta-band .hero__cta { justify-content: center; }

/* =====================================================================
   Footer
   ===================================================================== */
.footer { border-top: 1px solid var(--border); background: var(--void); padding: var(--s6) 0 var(--s5); }
.footer__grid { display: grid; grid-template-columns: 1.6fr 1fr 1fr 1fr; gap: var(--s5); }
.footer__brand svg { height: 28px; width: auto; margin-bottom: var(--s4); }
.footer__brand p { color: var(--muted); font-size: 0.9rem; max-width: 34ch; }
.footer__col .footer__label { font-family: var(--font-mono); font-size: 0.68rem; letter-spacing: 0.16em; text-transform: uppercase; color: var(--faint); margin-bottom: var(--s3); }
.footer__col a { display: block; color: var(--muted); font-size: 0.92rem; padding: 6px 0; transition: color .15s ease; }
.footer__col a:hover { color: var(--accent); }
.footer__bottom { display: flex; justify-content: space-between; align-items: center; margin-top: var(--s6); padding-top: var(--s4); border-top: 1px solid var(--border); flex-wrap: wrap; gap: var(--s3); }
.footer__ruo { font-family: var(--font-mono); font-size: 0.68rem; letter-spacing: 0.14em; text-transform: uppercase; color: var(--faint); }
/* Statutory company disclosure — required on UK business websites. */
.footer__legal { max-width: 68ch; margin-top: var(--s3); font-size: 0.72rem; line-height: 1.6; color: var(--faint); }
.footer__ruo b { color: var(--muted); font-weight: 400; }
@media (max-width: 820px) { .footer__grid { grid-template-columns: 1fr 1fr; gap: var(--s5); } .footer__brand { grid-column: 1 / -1; } }

/* =====================================================================
   Catalogue page
   ===================================================================== */
.page-head { border-bottom: 1px solid var(--border); padding: var(--s6) 0; }
.page-head h1 { font-size: clamp(2.4rem, 5vw, 3.4rem); margin: var(--s3) 0 var(--s3); }
.page-head p { color: var(--muted); }
.breadcrumb { font-family: var(--font-mono); font-size: 0.68rem; letter-spacing: 0.14em; text-transform: uppercase; color: var(--faint); }
.breadcrumb a:hover { color: var(--accent); }

.cat-layout { display: grid; grid-template-columns: 220px 1fr; gap: var(--s5); align-items: start; }
@media (max-width: 820px) { .cat-layout { grid-template-columns: 1fr; } }
.filters { position: sticky; top: calc(var(--header-h) + 16px); border: 1px solid var(--border); }
@media (max-width: 820px) { .filters { position: static; } }

/* The filter panel is a disclosure. It ships open, so with JS off — or on a
   desktop-width screen — nothing is hidden. On phones app.js closes it, because
   a 500px-tall filter column pushed the first product 1.4 screens down. */
.filters__d > summary { display: none; }
.filters__d[open] > summary { display: none; }
@media (max-width: 820px) {
  .filters__d > summary,
  .filters__d[open] > summary {
    display: flex; align-items: center; gap: 10px; cursor: pointer;
    padding: var(--s4); list-style: none;
    font-family: var(--font-mono); font-size: 0.7rem; letter-spacing: 0.16em;
    text-transform: uppercase; color: var(--muted);
  }
  .filters__d > summary::-webkit-details-marker { display: none; }
  /* Chevron: points down when closed, up when open. */
  .filters__d > summary::after {
    content: ""; margin-left: auto; width: 7px; height: 7px; flex: none;
    border-right: 1px solid var(--border-strong); border-bottom: 1px solid var(--border-strong);
    transform: translateY(-2px) rotate(45deg); transition: transform .18s ease;
  }
  .filters__d[open] > summary::after { transform: translateY(1px) rotate(-135deg); }
  .filters__d[open] > summary { border-bottom: 1px solid var(--border); color: var(--ink); }
  .filters__badge {
    font-size: 0.66rem; color: var(--void); background: var(--accent);
    padding: 1px 7px; letter-spacing: 0.08em;
  }
  .filters__badge[hidden] { display: none; }
}
.filters__group { padding: var(--s4); border-bottom: 1px solid var(--border); }
.filters__group:last-child { border-bottom: 0; }
.filters__group .filters__label { font-family: var(--font-mono); font-size: 0.66rem; letter-spacing: 0.16em; text-transform: uppercase; color: var(--faint); margin-bottom: var(--s3); }
.filter-opt { display: flex; align-items: center; gap: 10px; padding: 7px 0; color: var(--muted); font-size: 0.9rem; cursor: pointer; transition: color .15s ease; }
.filter-opt:hover { color: var(--ink); }
.filter-opt input { appearance: none; width: 15px; height: 15px; border: 1px solid var(--border-strong); background: var(--void); flex: none; position: relative; cursor: pointer; }
.filter-opt input:checked { border-color: var(--accent); background: var(--accent-dim); }
.filter-opt input:checked::after { content: ""; position: absolute; inset: 3px; background: var(--accent); }
.filter-opt .n { margin-left: auto; font-family: var(--font-mono); font-size: 0.72rem; color: var(--faint); }

.cat-toolbar { display: flex; justify-content: space-between; align-items: center; margin-bottom: var(--s4); flex-wrap: wrap; gap: var(--s3); }
.cat-toolbar .count { font-family: var(--font-mono); font-size: 0.78rem; letter-spacing: 0.08em; color: var(--muted); }
.cat-toolbar .count b { color: var(--ink); }
.sortsel { background: var(--surface-raised); border: 1px solid var(--border); color: var(--ink); font-family: var(--font-mono); font-size: 0.78rem; padding: 9px 14px; outline: 0; }

/* =====================================================================
   Cart drawer
   ===================================================================== */
.cart { position: fixed; inset: 0; z-index: 120; visibility: hidden; }
.cart.open { visibility: visible; }
.cart__scrim { position: absolute; inset: 0; background: rgba(6, 8, 10, 0.6); opacity: 0; transition: opacity .3s ease; }
.cart.open .cart__scrim { opacity: 1; }
.cart__panel {
  position: absolute; top: 0; right: 0; height: 100%;
  width: min(420px, 100%);
  background: var(--surface); border-left: 1px solid var(--border);
  display: flex; flex-direction: column;
  transform: translateX(100%); transition: transform .32s cubic-bezier(.4,0,.2,1);
}
.cart.open .cart__panel { transform: translateX(0); }
.cart__head { display: flex; align-items: center; justify-content: space-between; padding: var(--s4); border-bottom: 1px solid var(--border); }
.cart__close { background: none; border: 0; color: var(--ink); font-size: 1.6rem; line-height: 1; cursor: pointer; }
.cart__items { flex: 1; overflow-y: auto; padding: var(--s3) var(--s4); }
.cart__empty { color: var(--muted); font-size: 0.8rem; padding: var(--s5) 0; text-align: center; letter-spacing: 0.06em; }
.cart__item { display: grid; grid-template-columns: 56px 1fr auto; gap: var(--s3); align-items: start; padding: var(--s3) 0; border-bottom: 1px solid var(--border); }
.cart__thumb { width: 56px; height: 56px; object-fit: cover; border: 1px solid var(--border); background: var(--void); }
.cart__meta h4 { font-size: 0.95rem; font-weight: 500; color: var(--ink); }
.cart__spec { display: block; font-size: 0.66rem; letter-spacing: 0.04em; color: var(--muted); margin-top: 3px; }
.cart__qty { display: flex; align-items: center; gap: 8px; margin-top: 10px; }
.cart__qty button { width: 22px; height: 22px; border: 1px solid var(--border-strong); background: var(--surface-raised); color: var(--ink); font-size: 0.9rem; line-height: 1; cursor: pointer; }
.cart__qty button:hover { border-color: var(--accent-line); color: var(--accent); }
.cart__qty span { font-family: var(--font-mono); font-size: 0.8rem; min-width: 16px; text-align: center; }
.cart__remove { margin-left: 6px; width: auto !important; padding: 0 8px; font-family: var(--font-mono); font-size: 0.62rem !important; letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted) !important; }
.cart__remove:hover { color: var(--danger) !important; border-color: var(--danger) !important; }
.cart__line { font-family: var(--font-mono); font-size: 0.85rem; color: var(--ink); }
.cart__foot { padding: var(--s4); border-top: 1px solid var(--border); background: var(--void); }
.cart__row { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: var(--s3); }
.cart__row span:first-child { font-family: var(--font-mono); font-size: 0.7rem; letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted); }
.cart__total { font-family: var(--font-mono); font-size: 1.3rem; color: var(--ink); font-weight: 500; }
.cart__note { font-size: 0.62rem; letter-spacing: 0.06em; color: var(--faint); margin-bottom: var(--s3); }
.cart__ruo { font-size: 0.6rem; letter-spacing: 0.14em; text-transform: uppercase; color: var(--faint); text-align: center; margin-top: var(--s3); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
@media (prefers-reduced-motion: reduce) { .cart__panel, .cart__scrim { transition: none; } }

/* =====================================================================
   FAQ
   ===================================================================== */
.faq { max-width: 760px; border-top: 1px solid var(--border); }
.faq__item { padding: var(--s4) 0; border-bottom: 1px solid var(--border); }
.faq__item h3 { font-size: 1.02rem; font-weight: 500; margin-bottom: var(--s2); }
.faq__item p { color: var(--muted); font-size: 0.95rem; }
.faq__item p a { color: var(--accent); }

/* =====================================================================
   Legal / long-form copy
   ===================================================================== */
.legal { max-width: 720px; }
.legal h2 {
  font-size: 1.15rem; font-weight: 500; letter-spacing: -0.01em;
  margin: var(--s6) 0 var(--s3); padding-top: var(--s4);
  border-top: 1px solid var(--border);
}
.legal h2:first-of-type { margin-top: var(--s5); }
.legal p { color: var(--muted); margin-bottom: var(--s3); }
.legal a { text-decoration: underline; text-underline-offset: 3px; }
.legal__note {
  border: 1px solid var(--accent-line);
  background: var(--accent-dim);
  padding: var(--s4);
}
.legal__note p { color: var(--ink); margin: var(--s3) 0 0; }
.legal__meta {
  margin-top: var(--s6); padding-top: var(--s4);
  border-top: 1px solid var(--border);
  font-size: 0.68rem; letter-spacing: 0.06em; color: var(--faint);
}
.legal__meta p { color: var(--faint); margin-bottom: 6px; }

.cat-note { margin-top: var(--s5); max-width: 68ch; }
.cat-note p { color: var(--muted); font-size: 0.95rem; margin-bottom: var(--s3); }

/* =====================================================================
   Product page
   ===================================================================== */
.pdp { display: grid; grid-template-columns: 1fr 1fr; gap: var(--s5); align-items: start; }
@media (max-width: 820px) { .pdp { grid-template-columns: 1fr; } }
.pdp__media { border: 1px solid #1A2228; background: var(--void); }
.pdp__media img { width: 100%; height: auto; }
.pdp__price-row { display: flex; align-items: baseline; gap: var(--s3); }
.pdp__price { font-size: 2rem; color: var(--ink); font-weight: 500; }
.pdp__meta { font-size: 0.72rem; letter-spacing: 0.06em; color: var(--accent); margin: var(--s2) 0 var(--s4); }
.pdp__note { font-size: 0.66rem; letter-spacing: 0.06em; color: var(--faint); margin-top: var(--s3); }
.pdp__spec { border: 1px solid var(--border); background: var(--surface); padding: var(--s3) var(--s4); margin: var(--s4) 0; }
.pdp__about { max-width: 720px; margin-top: var(--s6); }
.pdp__about h2 { font-size: 1.4rem; margin-bottom: var(--s3); }
.pdp__about p { color: var(--muted); margin-bottom: var(--s3); }
.pdp-rel { margin-top: var(--s6); }
.pdp-rel h2 { font-size: 1.4rem; margin-bottom: var(--s4); }
.pdp-rel__grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px; background: var(--border); border: 1px solid var(--border); }
@media (max-width: 640px) { .pdp-rel__grid { grid-template-columns: 1fr; } }
.pdp-rel__card { background: var(--surface); padding: var(--s4); display: flex; flex-direction: column; gap: 6px; transition: background .18s ease; }
.pdp-rel__card:hover { background: var(--surface-raised); }
.pdp-rel__card img { width: 100%; aspect-ratio: 1/1; object-fit: cover; border: 1px solid var(--border); margin-bottom: var(--s2); }
.pdp-rel__name { color: var(--ink); font-weight: 500; }
.pdp-rel__spec { font-size: 0.72rem; color: var(--muted); }
.card h3 a:hover { color: var(--accent); }

/* Toast --------------------------------------------------------------- */
.toast {
  position: fixed; right: 24px; bottom: 24px; z-index: 200;
  background: var(--surface-raised); border: 1px solid var(--accent-line);
  padding: 14px 20px; display: flex; align-items: center; gap: 14px;
  transform: translateY(140%); opacity: 0; transition: transform .32s cubic-bezier(.2,.8,.2,1), opacity .32s ease;
  clip-path: polygon(0 0, 100% 0, 100% calc(100% - 10px), calc(100% - 10px) 100%, 0 100%);
}
.toast.show { transform: translateY(0); opacity: 1; }
.toast .tag { color: var(--accent); }
.toast span { color: var(--ink); font-size: 0.9rem; }

/* ====================================================================== */
/* GUIDES — long-form article pages + index cards                          */
/* ====================================================================== */
.article { max-width: 720px; }
.article h2 { font-size: 1.45rem; letter-spacing: -0.01em; margin: var(--s6) 0 var(--s3); }
.article h2:first-child { margin-top: 0; }
.article h3 { font-size: 1.08rem; font-weight: 500; margin: var(--s5) 0 var(--s2); }
.article p { color: var(--muted); line-height: 1.75; margin-bottom: var(--s3); }
.article ul, .article ol { margin: 0 0 var(--s4); padding-left: 1.25em; color: var(--muted); }
.article li { margin-bottom: 10px; line-height: 1.7; }
.article li::marker { color: var(--accent); font-family: var(--font-mono); font-size: 0.85em; }
.article b, .article strong { color: var(--ink); font-weight: 500; }
.article p a, .article li a { color: var(--accent); text-decoration: underline; text-decoration-color: var(--accent-line); text-underline-offset: 3px; }
.article p a:hover, .article li a:hover { text-decoration-color: var(--accent); }
.article table { width: 100%; border-collapse: collapse; margin: var(--s4) 0; font-size: 0.88rem; }
.article th { font-family: var(--font-mono); font-size: 0.66rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--faint); text-align: left; padding: 10px 14px; border: 1px solid var(--border); background: var(--surface); }
.article td { padding: 11px 14px; border: 1px solid var(--border); color: var(--muted); vertical-align: top; }
.article td b { color: var(--ink); }
.article .table-scroll { overflow-x: auto; }
/* app.js inserts .table-hint as a SIBLING after the wrapper — a pseudo-element
   inside would sit in the scrollable area and slide away with the table. It is
   only inserted when the table really is wider than its box. */
.article .table-hint {
  font-family: var(--font-mono); font-size: 0.66rem; letter-spacing: 0.12em;
  text-transform: uppercase; color: var(--faint);
  margin: var(--s2) 0 var(--s4);
}
@media (max-width: 720px) {
  /* Left to fit 375px the columns collapse to one word per line. Give the
     table room to breathe and let the reader swipe instead. */
  .article .table-scroll table { min-width: 560px; }
  .article th, .article td { padding: 10px 12px; }
}
.article .note { border: 1px solid var(--border); border-left: 2px solid var(--accent); background: var(--surface); padding: var(--s4); margin: var(--s4) 0; }
.article .note p { margin: 0; color: var(--ink); font-size: 0.95rem; }
.article .note p + p { margin-top: var(--s2); }
.guide-skus { font-size: 0.72rem; letter-spacing: 0.06em; text-transform: uppercase; color: var(--faint); border-top: 1px solid var(--border); padding-top: var(--s4); margin-top: var(--s5); }
.guide-skus a { color: var(--accent); }
.guide-skus a:hover { text-decoration: underline; }
.article__meta { font-family: var(--font-mono); font-size: 0.7rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--faint); display: flex; gap: var(--s3); flex-wrap: wrap; margin-top: var(--s3); }
.article__foot { max-width: 720px; margin-top: var(--s6); }

/* Guides index + related-guides cards */
.guide-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1px; background: var(--border); border: 1px solid var(--border); }
@media (max-width: 720px) { .guide-grid { grid-template-columns: 1fr; } }
.guide-card { display: block; background: var(--surface); padding: var(--s5) var(--s4); transition: background .15s ease; }
.guide-card:hover { background: var(--surface-raised); }
.guide-card__kicker { font-family: var(--font-mono); font-size: 0.66rem; letter-spacing: 0.16em; text-transform: uppercase; color: var(--accent); }
.guide-card h3, .guide-card h2 { font-size: 1.05rem; font-weight: 500; color: var(--ink); margin: var(--s2) 0; line-height: 1.4; }
.guide-card:hover h3, .guide-card:hover h2 { color: var(--accent); }
.guide-card p { color: var(--muted); font-size: 0.9rem; line-height: 1.6; }
.guide-card__meta { font-family: var(--font-mono); font-size: 0.66rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--faint); margin-top: var(--s3); display: block; }

/* Reveal on scroll — opacity is only hidden once JS confirms it can reveal.
   Without JS (or if the observer never fires), content stays fully visible. */
.js-reveal .reveal { opacity: 0; transform: translateY(18px); transition: opacity .7s cubic-bezier(.2,.7,.2,1), transform .7s cubic-bezier(.2,.7,.2,1); }
.js-reveal .reveal.in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; transition: none; }
  .marquee__track { animation: none; }
  .drawer { transition: none; }
  html { scroll-behavior: auto; }
}
