/* UK Chip Parade — Swiss grid, hairline rules, glacier paper */

:root {
  --paper: #eef3f7;
  --paper-2: #f7fafc;
  --card: #ffffff;
  --ink: #0d1b30;
  --ink-2: #33445f;
  --ink-3: #5a6b85;
  --rule: #c2cedb;
  --rule-strong: #0d1b30;
  --accent: #f2cf1f;
  --accent-deep: #b9960a;
  --focus: #0d1b30;
  --measure: 68ch;
  --gap: clamp(1.25rem, 3vw, 2.5rem);
  --grotesque: "Helvetica Neue", Helvetica, Arial, "Segoe UI", "Liberation Sans", system-ui, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background-color: var(--paper);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='g'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='180' height='180' filter='url(%23g)' opacity='0.055'/%3E%3C/svg%3E");
  color: var(--ink);
  font-family: var(--grotesque);
  font-weight: 400;
  font-size: 17px;
  line-height: 1.65;
  letter-spacing: 0.001em;
}

img { max-width: 100%; height: auto; }

a { color: var(--ink); text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { text-decoration-color: var(--accent-deep); }

a:focus-visible,
button:focus-visible,
summary:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 3px;
  border-radius: 1px;
}

h1, h2, h3, h4 { font-weight: 700; line-height: 1.15; letter-spacing: -0.018em; margin: 0 0 0.5em; }
h1 { font-size: clamp(2.15rem, 6.2vw, 4.2rem); font-weight: 800; letter-spacing: -0.032em; }
h2 { font-size: clamp(1.45rem, 3vw, 2.1rem); }
h3 { font-size: clamp(1.12rem, 2vw, 1.35rem); }
h4 { font-size: 1rem; font-weight: 700; }

p, li { max-width: var(--measure); }
p { margin: 0 0 1.05em; }

.shell { width: min(1240px, 100% - 2.5rem); margin-inline: auto; }

/* ---------- eyebrow / meta type ---------- */
.eyebrow {
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.19em;
  text-transform: uppercase;
  color: var(--ink-3);
  margin: 0 0 0.9rem;
  max-width: none;
}
.mono-fig { font-variant-numeric: tabular-nums; letter-spacing: 0.02em; }

/* ---------- skip link ---------- */
.skip {
  position: absolute; left: -9999px; top: 0;
  background: var(--ink); color: #fff; padding: 0.75rem 1rem; z-index: 50;
}
.skip:focus { left: 0.5rem; top: 0.5rem; }

/* ---------- header ---------- */
.masthead { border-bottom: 1px solid var(--rule-strong); background: var(--paper-2); }
.masthead__bar {
  display: flex; align-items: center; gap: var(--gap);
  padding: 0.9rem 0; flex-wrap: wrap;
}
.brand { display: flex; align-items: center; gap: 0.7rem; text-decoration: none; margin-right: auto; }
.brand__mark { width: 46px; height: 46px; flex: none; }
.brand__name { display: block; font-size: 1.06rem; font-weight: 800; letter-spacing: -0.02em; line-height: 1.1; }
.brand__strap { display: block; font-size: 0.66rem; font-weight: 600; letter-spacing: 0.15em; text-transform: uppercase; color: var(--ink-3); }

.nav { display: flex; flex-wrap: wrap; gap: 0 1.15rem; align-items: center; }
.nav a {
  font-size: 0.86rem; font-weight: 500; text-decoration: none;
  padding: 0.35rem 0; border-bottom: 2px solid transparent;
}
.nav a:hover, .nav a[aria-current="page"] { border-bottom-color: var(--accent-deep); }

.agebadge {
  flex: none;
  font-size: 0.72rem; font-weight: 700; letter-spacing: 0.08em;
  border: 1.5px solid var(--rule-strong); padding: 0.3rem 0.55rem; border-radius: 2px;
  background: var(--accent);
}

/* strip under header */
.alertstrip { border-bottom: 1px solid var(--rule); background: var(--ink); color: #e9eef5; }
.alertstrip p {
  margin: 0; padding: 0.6rem 0; font-size: 0.83rem; max-width: none;
}
.alertstrip a { color: #fff; }

/* ---------- hero ---------- */
.hero { border-bottom: 1px solid var(--rule-strong); padding: clamp(2.5rem, 7vw, 5.5rem) 0 clamp(2rem, 4vw, 3rem); }
.hero h1 { max-width: 24ch; text-wrap: balance; }
.hero__line { border: 0; border-top: 1px solid var(--rule-strong); margin: 1.6rem 0; }
.hero__grid { display: grid; grid-template-columns: 1fr; gap: var(--gap); }
.hero__stand { font-size: clamp(1rem, 1.6vw, 1.14rem); color: var(--ink-2); }
.hero__facts { display: grid; gap: 0; border-top: 1px solid var(--rule); }
.hero__fact { border-bottom: 1px solid var(--rule); padding: 0.7rem 0; display: flex; gap: 1rem; justify-content: space-between; }
.hero__fact dt { font-size: 0.78rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--ink-3); font-weight: 600; }
.hero__fact dd { margin: 0; font-weight: 700; font-variant-numeric: tabular-nums; text-align: right; }

@media (min-width: 62rem) {
  .hero__grid { grid-template-columns: 1.55fr 1fr; align-items: start; }
}

/* ---------- generic sections ---------- */
.band { padding: clamp(2.2rem, 5vw, 3.6rem) 0; border-bottom: 1px solid var(--rule); }
.band--ruled { border-bottom: 1px solid var(--rule-strong); }
.band--tint { background: var(--paper-2); }
.band__head { margin-bottom: clamp(1.3rem, 3vw, 2rem); }
.band__head p { color: var(--ink-2); }

.cols { display: grid; gap: var(--gap); }
@media (min-width: 55rem) { .cols--2 { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 55rem) { .cols--3 { grid-template-columns: repeat(3, 1fr); } }
@media (min-width: 62rem) { .cols--side { grid-template-columns: 1.7fr 1fr; } }

/* ---------- index-card tiles ---------- */
.card {
  background: var(--card);
  border: 1px solid var(--rule-strong);
  border-radius: 2px;
  padding: clamp(1.1rem, 2.2vw, 1.6rem);
}
.card--flag { border-top: 5px solid var(--accent); }
.card h3 { margin-top: 0; }
.card p:last-child, .card ul:last-child { margin-bottom: 0; }
.card__rule { border: 0; border-top: 1px solid var(--rule); margin: 0.95rem 0; }

/* operator tiles */
.op { display: flex; flex-direction: column; gap: 0.85rem; }
.op__top { display: flex; align-items: center; gap: 0.9rem; justify-content: space-between; }
.op__logo { height: 34px; width: auto; max-width: 150px; object-fit: contain; }
.op__wordmark { font-size: 1.18rem; font-weight: 800; letter-spacing: -0.02em; }
.op__band {
  flex: none; font-size: 0.7rem; font-weight: 700; letter-spacing: 0.13em; text-transform: uppercase;
  border: 1.5px solid var(--rule-strong); padding: 0.25rem 0.5rem; border-radius: 2px; background: var(--paper-2);
}
.op__band--excellent { background: var(--accent); }
.op__band--strong { background: #dfe9f2; }
.op__band--mixed { background: var(--paper); }
.op__verdict { margin: 0; }
.op__facts { margin: 0; border-top: 1px solid var(--rule); }
.op__facts div { display: flex; gap: 0.8rem; justify-content: space-between; border-bottom: 1px solid var(--rule); padding: 0.45rem 0; font-size: 0.9rem; }
.op__facts dt { color: var(--ink-3); font-weight: 500; max-width: none; }
.op__facts dd { margin: 0; font-weight: 600; text-align: right; max-width: none; }

/* ---------- buttons ---------- */
.btn {
  display: inline-block; text-decoration: none; font-weight: 700; font-size: 0.94rem;
  padding: 0.72rem 1.15rem; border: 1.5px solid var(--rule-strong); border-radius: 2px;
  background: var(--accent); color: var(--ink); letter-spacing: 0.005em;
}
.btn:hover { background: var(--ink); color: #fff; }
.btn--ghost { background: transparent; }
.btn--ghost:hover { background: var(--ink); color: #fff; }
.btn--wide { display: block; text-align: center; }
.btn__sub { display: block; font-size: 0.72rem; font-weight: 500; letter-spacing: 0.04em; color: var(--ink-2); margin-top: 0.15rem; }
.btn:hover .btn__sub { color: #cfd9e6; }

/* ---------- comparison table ---------- */
.tablewrap { border: 1px solid var(--rule-strong); background: var(--card); overflow-x: auto; }
table.compare { border-collapse: collapse; width: 100%; min-width: 46rem; font-size: 0.92rem; }
table.compare caption {
  text-align: left; padding: 0.9rem 1rem; font-size: 0.82rem; color: var(--ink-2);
  border-bottom: 1px solid var(--rule-strong); background: var(--paper-2);
}
table.compare th, table.compare td { padding: 0.7rem 0.85rem; border-bottom: 1px solid var(--rule); text-align: left; vertical-align: top; }
table.compare thead th { background: var(--ink); color: #fff; font-size: 0.74rem; letter-spacing: 0.1em; text-transform: uppercase; font-weight: 700; border-bottom: 0; }
table.compare tbody th { font-weight: 700; white-space: nowrap; }
table.compare tbody tr:nth-child(even) td, table.compare tbody tr:nth-child(even) th { background: #f4f8fb; }
table.compare td.num { font-variant-numeric: tabular-nums; white-space: nowrap; }
.tablenote { font-size: 0.85rem; color: var(--ink-2); margin-top: 0.8rem; }

/* ---------- notice blocks ---------- */
.notice {
  border: 1px solid var(--rule-strong); border-left: 6px solid var(--accent);
  background: var(--card); padding: clamp(1rem, 2.2vw, 1.4rem); border-radius: 2px;
}
.notice h2, .notice h3 { margin-top: 0; }
.notice p:last-child { margin-bottom: 0; }
.notice--dark { background: var(--ink); color: #e9eef5; border-color: var(--ink); }
.notice--dark a { color: #fff; }

/* ---------- resource links ---------- */
.resources { list-style: none; padding: 0; margin: 0; display: grid; gap: 0; border-top: 1px solid var(--rule); }
.resources li { border-bottom: 1px solid var(--rule); max-width: none; }
.resources a { display: flex; align-items: center; gap: 0.9rem; padding: 0.8rem 0; text-decoration: none; font-weight: 600; }
.resources a:hover { text-decoration: underline; }
.resources img { height: 30px; width: auto; max-width: 116px; object-fit: contain; flex: none; }
.resources span.res__what { font-weight: 400; font-size: 0.87rem; color: var(--ink-2); }
.res__label { min-width: 116px; font-weight: 800; letter-spacing: -0.01em; }

/* ---------- FAQ ---------- */
.faq { border-top: 1px solid var(--rule-strong); }
.faq details { border-bottom: 1px solid var(--rule); }
.faq summary {
  cursor: pointer; padding: 0.95rem 0; font-weight: 700; font-size: 1.02rem; list-style: none;
  display: flex; gap: 1rem; align-items: baseline; justify-content: space-between;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; font-weight: 700; font-size: 1.3rem; line-height: 1; color: var(--accent-deep); }
.faq details[open] summary::after { content: "\2212"; }
.faq details > div { padding-bottom: 0.9rem; }
.faq details > div p:last-child { margin-bottom: 0; }

/* ---------- prose page ---------- */
.prose { padding: clamp(2rem, 5vw, 3.4rem) 0; }
.prose h2 { margin-top: 2.1rem; padding-top: 1.1rem; border-top: 1px solid var(--rule); }
.prose h3 { margin-top: 1.6rem; }
.prose ul, .prose ol { padding-left: 1.15rem; }
.prose li { margin-bottom: 0.45rem; }
.prose__lede { font-size: clamp(1.05rem, 1.9vw, 1.25rem); color: var(--ink-2); max-width: 60ch; }
.prose dl { margin: 0 0 1.2rem; }
.prose dt { font-weight: 700; margin-top: 0.9rem; }
.prose dd { margin: 0.15rem 0 0; max-width: var(--measure); }

.pagehead { border-bottom: 1px solid var(--rule-strong); padding: clamp(2rem, 5vw, 3.6rem) 0 clamp(1.3rem, 3vw, 2rem); }
.pagehead h1 { font-size: clamp(1.9rem, 5vw, 3.2rem); max-width: 22ch; }
.crumbs { font-size: 0.82rem; color: var(--ink-3); margin-bottom: 1rem; }
.crumbs a { color: var(--ink-3); }
.updated { font-size: 0.82rem; color: var(--ink-3); letter-spacing: 0.02em; }

/* ---------- footer ---------- */
.footer { background: var(--ink); color: #d8e0ea; border-top: 1px solid var(--ink); }
.footer a { color: #fff; }
.footer__top { display: grid; gap: var(--gap); padding: clamp(2.2rem, 5vw, 3.4rem) 0 2rem; }
@media (min-width: 60rem) { .footer__top { grid-template-columns: 1.4fr 1fr 1fr; } }
.footer h2 { font-size: 0.72rem; letter-spacing: 0.19em; text-transform: uppercase; color: #9fb0c6; font-weight: 700; }
.footer ul { list-style: none; margin: 0; padding: 0; }
.footer li { margin-bottom: 0.5rem; max-width: none; }
.footer li a { font-size: 0.92rem; }
.footer__note { color: #c3cfdd; font-size: 0.92rem; max-width: 62ch; }
.footer__licences { border-top: 1px solid #26364f; padding: 1.6rem 0; }
.footer__licences table { border-collapse: collapse; width: 100%; font-size: 0.82rem; color: #c9d4e2; }
.footer__licences caption { text-align: left; font-size: 0.72rem; letter-spacing: 0.19em; text-transform: uppercase; color: #9fb0c6; font-weight: 700; padding-bottom: 0.7rem; }
.footer__licences th, .footer__licences td { text-align: left; padding: 0.4rem 0.8rem 0.4rem 0; border-bottom: 1px solid #22314a; vertical-align: top; }
.footer__licences thead th { color: #9fb0c6; font-weight: 600; }
.footer__bottom {
  border-top: 1px solid #26364f; padding: 1.4rem 0 2.4rem; display: flex; flex-wrap: wrap; gap: 0.8rem 1.5rem;
  align-items: center; justify-content: space-between; font-size: 0.82rem; color: #9fb0c6;
}
.footer__bottom p { margin: 0; max-width: none; }

/* ---------- cookie bar ---------- */
.cookiebar {
  position: fixed; inset: auto 0 0 0; z-index: 40;
  background: var(--card); border-top: 2px solid var(--ink);
  padding: 1rem 0;
}
.cookiebar[hidden] { display: none; }
.cookiebar__inner { display: flex; flex-wrap: wrap; gap: 1rem; align-items: center; justify-content: space-between; }
.cookiebar p { margin: 0; font-size: 0.88rem; max-width: 72ch; }
.cookiebar__actions { display: flex; gap: 0.6rem; flex-wrap: wrap; }
.cookiebar button { font-family: inherit; cursor: pointer; }

/* ---------- 404 ---------- */
.lost { padding: clamp(3rem, 9vw, 6rem) 0; }
.lost h1 { max-width: 20ch; }

/* ---------- misc ---------- */
.tag-list { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 0.5rem; }
.tag-list li { border: 1px solid var(--rule); background: var(--card); padding: 0.25rem 0.55rem; font-size: 0.82rem; border-radius: 2px; max-width: none; }
.stack > * + * { margin-top: clamp(1.1rem, 2.5vw, 1.6rem); }
.chipline { display: flex; gap: 0.35rem; align-items: center; margin-bottom: 1.2rem; }
.chipline span { width: 12px; height: 12px; border-radius: 50%; border: 2px solid var(--ink); }
.chipline span:nth-child(odd) { background: var(--accent); }

@media (prefers-reduced-motion: no-preference) {
  a, .btn { transition: background-color 120ms linear, color 120ms linear, border-color 120ms linear; }
}
