/* UK Chip Guide — tokens + native nesting */
:root {
  --bg: #f7f7f5;
  --ink: #0a0a0a;
  --ink-soft: #2a2a2a;
  --muted: #5c5c5c;
  --accent: #c8ff00;
  --accent-ink: #0a0a0a;
  --surface: #ffffff;
  --surface-tint: #f0f0ec;
  --line: rgba(10, 10, 10, 0.12);
  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-5: 1.5rem;
  --space-6: 2rem;
  --space-7: 3rem;
  --space-8: 4.5rem;
  --space-9: 6rem;
  --radius: 1rem;
  --radius-pill: 999px;
  --max: 72rem;
  --narrow: 42rem;
  --font-display: "Archivo", "Arial Narrow", "Helvetica Neue", sans-serif;
  --font-body: "Archivo", "Helvetica Neue", Helvetica, Arial, sans-serif;
  --font-mono: "IBM Plex Mono", "SFMono-Regular", Consolas, monospace;
  --age-h: 2.25rem;
  --shadow-one: 6px 6px 0 var(--ink);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation: none !important;
    transition: none !important;
  }
  .hero { background-attachment: scroll !important; }
}

body {
  margin: 0;
  padding-top: var(--age-h);
  font-family: var(--font-body);
  font-size: 1.0625rem;
  line-height: 1.65;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

a {
  color: var(--ink);
  text-decoration: none;
  transition: color 0.2s ease;

  &:hover {
    text-decoration: underline;
    text-underline-offset: 0.2em;
  }

  &:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 3px;
  }
}

.accent-link {
  color: var(--ink);
  font-weight: 600;
}

h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 800;
  line-height: 1.05;
  letter-spacing: -0.03em;
  margin: 0 0 var(--space-4);
  color: var(--ink);
}

h1 { font-size: clamp(2.75rem, 9vw, 6.5rem); }
h2 { font-size: clamp(1.75rem, 4vw, 2.75rem); }
h3 { font-size: clamp(1.25rem, 2.5vw, 1.5rem); letter-spacing: -0.02em; }

p { margin: 0 0 var(--space-4); max-width: 70ch; }
p:last-child { margin-bottom: 0; }

.mono {
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  letter-spacing: 0.02em;
}

.wrap {
  width: min(100% - 2rem, var(--max));
  margin-inline: auto;
}

.wrap--narrow {
  width: min(100% - 2rem, var(--narrow));
  margin-inline: auto;
}

/* Age notice — pinned top */
.age-bar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  min-height: var(--age-h);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-3);
  padding: var(--space-2) var(--space-4);
  background: var(--ink);
  color: var(--bg);
  font-family: var(--font-mono);
  font-size: 0.75rem;
  letter-spacing: 0.04em;
  text-align: center;

  a {
    color: var(--accent);
    text-decoration: underline;
    text-underline-offset: 0.15em;
  }

  &[data-collapsed="true"] {
    .age-bar__full { display: none; }
  }
}

.age-bar__toggle {
  background: transparent;
  border: 0;
  color: var(--accent);
  font-family: var(--font-mono);
  font-size: 0.7rem;
  cursor: pointer;
  padding: 0.2rem 0.4rem;
  text-decoration: underline;
}

/* Site header */
.site-header {
  padding: var(--space-5) 0;
  background: var(--bg);
}

.site-header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
  flex-wrap: wrap;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: var(--space-3);
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.125rem;
  letter-spacing: -0.03em;
  color: var(--ink);
  text-decoration: none;

  &:hover { text-decoration: none; }

  img {
    width: 2rem;
    height: 2rem;
  }
}

.nav {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2) var(--space-4);
  font-size: 0.9375rem;
  font-weight: 600;

  a:hover { color: var(--ink); }
}

.nav-toggle {
  display: none;
  background: var(--ink);
  color: var(--accent);
  border: 0;
  padding: 0.5rem 0.85rem;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  cursor: pointer;
}

@media (max-width: 720px) {
  .nav-toggle { display: inline-block; }
  .nav {
    display: none;
    width: 100%;
    flex-direction: column;
    padding-top: var(--space-3);
  }
  .nav.is-open { display: flex; }
}

/* Poster hero */
.hero {
  position: relative;
  isolation: isolate;
  padding: var(--space-8) 0 var(--space-7);
  overflow: hidden;
  background-color: var(--bg);
  background-image: url("/assets/images/hero-arcs.png");
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;

  &::before {
    content: "";
    position: absolute;
    inset: 0;
    z-index: -1;
    background:
      radial-gradient(ellipse 80% 70% at 70% 20%, rgba(200, 255, 0, 0.18), transparent 55%),
      linear-gradient(180deg, rgba(247, 247, 245, 0.72), rgba(247, 247, 245, 0.95));
    pointer-events: none;
  }

  &::after {
    content: "";
    position: absolute;
    left: -10%;
    bottom: -20%;
    width: 55%;
    height: 70%;
    z-index: -1;
    background: var(--accent);
    clip-path: polygon(0 40%, 100% 0, 100% 100%, 0 100%);
    opacity: 0.9;
    transform: translate3d(0, 0, 0);
    will-change: transform;
  }
}

.hero[data-parallax] .hero__tint {
  position: absolute;
  inset: -10%;
  z-index: -2;
  background: radial-gradient(circle at 20% 80%, rgba(200, 255, 0, 0.25), transparent 45%);
  pointer-events: none;
}

.hero__label {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  background: var(--ink);
  color: var(--accent);
  padding: 0.35rem 0.75rem;
  border-radius: var(--radius-pill);
  margin-bottom: var(--space-5);
}

.hero__title {
  max-width: 14ch;
  margin-bottom: var(--space-5);

  .accent-word {
    background: var(--accent);
    color: var(--accent-ink);
    padding: 0 0.12em;
    box-decoration-break: clone;
    -webkit-box-decoration-break: clone;
  }
}

.hero__lead {
  font-size: 1.125rem;
  max-width: 38ch;
  color: var(--ink-soft);
  margin-bottom: var(--space-5);
}

.hero__meta {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3) var(--space-5);
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--muted);
}

.trust-strip {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-4);
  padding: var(--space-6) 0;
  margin-top: var(--space-6);

  @media (max-width: 640px) {
    grid-template-columns: 1fr;
  }
}

.trust-strip__item {
  padding: var(--space-4) 0;
  border: 1px solid transparent;
  transition: border-color 0.2s ease;

  &:hover { border-color: var(--line); }

  strong {
    display: block;
    font-family: var(--font-mono);
    font-size: 1.75rem;
    font-weight: 600;
    color: var(--ink);
    margin-bottom: var(--space-1);
  }

  span {
    font-size: 0.875rem;
    color: var(--muted);
  }
}

/* Sections */
.section {
  padding: var(--space-8) 0;
}

.section--tint {
  background: var(--surface-tint);
}

.section__eyebrow {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--muted);
  margin-bottom: var(--space-3);
}

.section__head {
  margin-bottom: var(--space-6);
  max-width: 40rem;
}

.hl {
  background: linear-gradient(transparent 60%, var(--accent) 60%);
}

/* Showcase table — featured row expanded */
.showcase {
  background: var(--surface);
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid transparent;
  transition: border-color 0.2s ease;

  &:hover { border-color: var(--line); }
}

.showcase__header {
  background: var(--accent);
  color: var(--accent-ink);
  padding: var(--space-4) var(--space-5);
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: var(--space-3);
  flex-wrap: wrap;

  h2 {
    margin: 0;
    font-size: clamp(1.35rem, 3vw, 1.85rem);
  }

  .mono { opacity: 0.85; }
}

.showcase__disclosure {
  padding: var(--space-3) var(--space-5);
  font-size: 0.875rem;
  color: var(--muted);
  background: var(--surface-tint);
}

.table-wrap { overflow-x: auto; }

.compare-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9375rem;

  th, td {
    padding: var(--space-4) var(--space-5);
    text-align: left;
    vertical-align: middle;
    border-bottom: 1px solid transparent;
  }

  thead th {
    font-family: var(--font-mono);
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--muted);
    font-weight: 500;
    background: var(--bg);
  }

  tbody tr {
    border-bottom: 1px solid transparent;
    transition: background 0.15s ease, border-color 0.15s ease;

    &:hover {
      background: rgba(200, 255, 0, 0.08);
      border-bottom-color: var(--line);
    }
  }

  .featured {
    background: rgba(200, 255, 0, 0.12);

    td {
      padding-top: var(--space-5);
      padding-bottom: var(--space-5);
    }

    .featured__note {
      display: block;
      margin-top: var(--space-2);
      font-size: 0.875rem;
      color: var(--ink-soft);
      max-width: 36ch;
      line-height: 1.5;
    }
  }
}

.op-cell {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  min-width: 12rem;

  img {
    width: 2.5rem;
    height: 2.5rem;
    object-fit: contain;
    background: var(--bg);
    border-radius: 0.5rem;
    padding: 0.2rem;
  }

  strong { font-weight: 700; }
}

.stars {
  font-family: var(--font-mono);
  font-size: 0.875rem;
  letter-spacing: 0.05em;
  white-space: nowrap;
  color: var(--ink);

  .stars__full { color: var(--ink); }
  .stars__empty { color: #c5c5c0; }
}

.badge {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 0.3rem 0.65rem;
  border-radius: var(--radius-pill);
  background: var(--ink);
  color: var(--accent);
  white-space: nowrap;
}

.badge--soft {
  background: var(--accent);
  color: var(--accent-ink);
}

.badge--mute {
  background: var(--surface-tint);
  color: var(--ink-soft);
}

.cta-link {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 0.9375rem;
  letter-spacing: -0.02em;
  color: var(--ink);
  text-decoration: underline;
  text-underline-offset: 0.25em;
  text-decoration-thickness: 2px;
  text-decoration-color: var(--accent);
  background: none;
  border: 0;
  padding: 0;
  cursor: pointer;

  &:hover {
    text-decoration-color: var(--ink);
  }
}

.cta-note {
  display: block;
  margin-top: var(--space-1);
  font-family: var(--font-mono);
  font-size: 0.65rem;
  color: var(--muted);
}

/* Operator rows / scorecards */
.scorecards {
  display: grid;
  gap: var(--space-5);
  margin-top: var(--space-7);
}

.scorecard {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: var(--space-5);
  align-items: start;
  background: var(--surface);
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid transparent;
  transition: border-color 0.2s ease;

  &:hover { border-color: var(--ink); }

  @media (max-width: 700px) {
    grid-template-columns: 1fr;
  }
}

.scorecard__accent {
  grid-column: 1 / -1;
  background: var(--accent);
  padding: var(--space-3) var(--space-5);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: var(--space-3);
  flex-wrap: wrap;

  h3 {
    margin: 0;
    font-size: 1.25rem;
  }

  .stars { font-size: 0.9375rem; }
}

.scorecard__body {
  padding: 0 var(--space-5) var(--space-5);
  display: grid;
  grid-template-columns: auto 1fr;
  gap: var(--space-4);
  align-items: start;

  @media (max-width: 500px) {
    grid-template-columns: 1fr;
  }
}

.scorecard__logo {
  width: 4.5rem;
  height: 4.5rem;
  object-fit: contain;
  background: var(--bg);
  border-radius: 0.75rem;
  padding: var(--space-2);
}

.scorecard__facts {
  p { margin-bottom: var(--space-3); font-size: 0.975rem; }
}

.scorecard__badges {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  margin: var(--space-3) 0;
}

.scorecard__action {
  padding: 0 var(--space-5) var(--space-5);
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  gap: var(--space-3);
  min-width: 10rem;
  border-left: 1px solid transparent;
  transition: border-color 0.2s ease;

  .scorecard:hover & { border-left-color: var(--line); }

  @media (max-width: 700px) {
    border-left: 0;
    padding-top: 0;
  }
}

.score-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(9rem, 1fr));
  gap: var(--space-3);
  margin-top: var(--space-4);
  font-family: var(--font-mono);
  font-size: 0.75rem;
}

.score-grid__item {
  padding: var(--space-3);
  background: var(--bg);
  border-radius: 0.5rem;
  border: 1px solid transparent;
  transition: border-color 0.15s ease;

  &:hover { border-color: var(--line); }

  dt {
    color: var(--muted);
    margin-bottom: var(--space-1);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    font-size: 0.65rem;
  }

  dd {
    margin: 0;
    font-weight: 600;
    color: var(--ink);
    font-size: 0.8125rem;
  }
}

/* Method / how we compare */
.method {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-6);
  align-items: start;

  @media (max-width: 800px) {
    grid-template-columns: 1fr;
  }
}

.method__figure {
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--surface-tint);

  img {
    width: 100%;
    height: auto;
    object-fit: cover;
  }
}

/* Safety cards */
.safety-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--space-4);

  @media (max-width: 900px) {
    grid-template-columns: repeat(2, 1fr);
  }
  @media (max-width: 480px) {
    grid-template-columns: 1fr;
  }
}

.safety-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--space-3);
  padding: var(--space-5);
  background: var(--surface);
  border-radius: var(--radius);
  text-align: center;
  text-decoration: none;
  color: var(--ink);
  border: 1px solid transparent;
  min-height: 8rem;
  transition: border-color 0.2s ease, background 0.2s ease;

  &:hover {
    border-color: var(--ink);
    text-decoration: none;
    background: rgba(200, 255, 0, 0.1);
  }

  img {
    max-height: 2.5rem;
    width: auto;
    max-width: 8rem;
    object-fit: contain;
  }

  span {
    font-family: var(--font-mono);
    font-size: 0.75rem;
    font-weight: 600;
  }
}

/* FAQ prose blocks */
.faq-block {
  max-width: 42rem;
  margin-bottom: var(--space-6);

  h3 {
    margin-bottom: var(--space-3);
  }
}

/* Cookie banner */
.cookie-banner {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 900;
  background: var(--ink);
  color: var(--bg);
  padding: var(--space-4) var(--space-5);
  display: none;

  &[data-visible="true"] { display: block; }

  .wrap {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-4);
  }

  p {
    margin: 0;
    font-size: 0.875rem;
    max-width: 48rem;
    color: #d8d8d4;
  }

  a { color: var(--accent); }

  .cookie-actions {
    display: flex;
    gap: var(--space-3);
    flex-wrap: wrap;
  }
}

.cookie-btn {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 0.875rem;
  background: transparent;
  border: 0;
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 0.2em;
  text-decoration-thickness: 2px;
  cursor: pointer;
  padding: 0.35rem 0;

  &--primary {
    background: var(--accent);
    color: var(--accent-ink);
    text-decoration: none;
    padding: 0.5rem 1rem;
    border-radius: var(--radius-pill);
  }
}

/* Footer */
.site-footer {
  background: var(--ink);
  color: #c8c8c4;
  padding: var(--space-8) 0 var(--space-6);
  margin-top: var(--space-4);
  position: relative;
  overflow: hidden;

  a {
    color: #e8e8e4;
    &:hover { color: var(--accent); }
  }
}

.site-footer__mark {
  position: absolute;
  right: -2rem;
  bottom: -2rem;
  width: 12rem;
  height: 12rem;
  opacity: 0.08;
  pointer-events: none;
}

.site-footer__grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr;
  gap: var(--space-6);
  margin-bottom: var(--space-6);

  @media (max-width: 720px) {
    grid-template-columns: 1fr;
  }
}

.site-footer__brand {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  color: var(--bg);
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.125rem;
  margin-bottom: var(--space-3);
  text-decoration: none;

  &:hover { color: var(--accent); text-decoration: none; }

  img { width: 1.75rem; height: 1.75rem; }
}

.site-footer h4 {
  color: var(--accent);
  font-family: var(--font-mono);
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  margin-bottom: var(--space-3);
}

.site-footer ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: var(--space-2);
  font-size: 0.875rem;
}

.site-footer__legal {
  font-size: 0.8125rem;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  padding-top: var(--space-5);
  color: #9a9a96;

  p { max-width: none; margin-bottom: var(--space-3); }
}

.disclaimer {
  font-size: 0.8125rem;
  color: var(--muted);
  padding: var(--space-5) 0;
}

/* Inner pages */
.page-hero {
  padding: var(--space-7) 0 var(--space-5);

  h1 {
    font-size: clamp(2rem, 6vw, 3.5rem);
    max-width: 16ch;
  }
}

.prose {
  max-width: 42rem;

  h2 {
    margin-top: var(--space-7);
    margin-bottom: var(--space-4);
  }

  h3 {
    margin-top: var(--space-5);
  }

  ul, ol {
    padding-left: 1.25rem;
    margin: 0 0 var(--space-4);
  }

  li { margin-bottom: var(--space-2); max-width: 70ch; }
}

.figure-inline {
  margin: var(--space-6) 0;
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--surface-tint);

  img { width: 100%; }
  figcaption {
    font-family: var(--font-mono);
    font-size: 0.75rem;
    color: var(--muted);
    padding: var(--space-3) var(--space-4);
  }
}

.timeline {
  position: relative;
  padding-left: var(--space-6);
  margin: var(--space-6) 0;

  &::before {
    content: "";
    position: absolute;
    left: 0.4rem;
    top: 0.35rem;
    bottom: 0.35rem;
    width: 3px;
    background: var(--accent);
  }
}

.timeline__item {
  position: relative;
  margin-bottom: var(--space-6);
  padding-bottom: var(--space-2);

  &::before {
    content: "";
    position: absolute;
    left: calc(-1 * var(--space-6) + 0.15rem);
    top: 0.35rem;
    width: 0.85rem;
    height: 0.85rem;
    border-radius: 50%;
    background: var(--ink);
    border: 3px solid var(--accent);
  }

  .timeline__year {
    font-family: var(--font-mono);
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--ink);
    background: var(--accent);
    display: inline-block;
    padding: 0.2rem 0.55rem;
    border-radius: var(--radius-pill);
    margin-bottom: var(--space-2);
  }

  h3 { margin-bottom: var(--space-2); font-size: 1.15rem; }
}

.glossary-list {
  dt {
    font-family: var(--font-display);
    font-weight: 800;
    font-size: 1.1rem;
    margin-top: var(--space-5);
    margin-bottom: var(--space-2);
    padding-bottom: var(--space-1);
  }

  dd {
    margin: 0 0 var(--space-4);
    color: var(--ink-soft);
    max-width: 70ch;
  }
}

.contact-form {
  display: grid;
  gap: var(--space-4);
  max-width: 28rem;

  label {
    display: grid;
    gap: var(--space-2);
    font-family: var(--font-mono);
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
  }

  input, textarea {
    font-family: var(--font-body);
    font-size: 1rem;
    padding: 0.75rem 0.9rem;
    border: 1px solid var(--line);
    background: var(--surface);
    color: var(--ink);
    border-radius: 0.5rem;

    &:focus {
      outline: 2px solid var(--accent);
      outline-offset: 2px;
      border-color: var(--ink);
    }
  }

  button[type="submit"] {
    justify-self: start;
    font-family: var(--font-display);
    font-weight: 800;
    font-size: 1rem;
    background: transparent;
    border: 0;
    color: var(--ink);
    text-decoration: underline;
    text-decoration-color: var(--accent);
    text-decoration-thickness: 3px;
    text-underline-offset: 0.25em;
    cursor: pointer;
    padding: 0.25rem 0;
  }
}

.form-note {
  font-size: 0.875rem;
  color: var(--muted);
}

.logo-fallback {
  width: 2.5rem;
  height: 2.5rem;
  display: grid;
  place-items: center;
  background: var(--ink);
  color: var(--accent);
  font-family: var(--font-mono);
  font-size: 0.65rem;
  font-weight: 700;
  border-radius: 0.5rem;
}
