/* bk8io.uk — styled after the BK8.io brand palette */
:root {
  --bg: #000a1f;
  --panel: #0b1735;
  --panel-2: #102148;
  --line: #1c2f5c;
  --text: #ffffff;
  --muted: #a4c2ff;
  --soft: #c9d6f5;
  --orange-grad: linear-gradient(102deg, #ffb71b 0%, #ff8a00 50%, #e17a00 100%);
  --blue-grad: linear-gradient(99deg, #1663ff 0%, #0042c9 50%, #0013b9 100%);
  --red-grad: linear-gradient(99deg, #e2262b 0%, #b3141a 60%, #7d0a10 100%);
  --orange: #ff9d14;
  --link: #7fb0ff;
  --note-bg: #2a1c00;
  --note-ink: #ffe3b0;
  --warn-bg: #3a0b10;
  --warn-ink: #ffd5d8;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Inter, Helvetica, Arial, sans-serif;
  --top: 64px;
  --side: 232px;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--text); font: 16px/1.65 var(--sans); }
img { max-width: 100%; height: auto; display: block; }
a { color: var(--link); text-underline-offset: 2px; }
a:hover { color: #b3d0ff; }
a:focus-visible, button:focus-visible, summary:focus-visible { outline: 3px solid var(--orange); outline-offset: 2px; }
.skip { position: absolute; left: -999px; top: 8px; background: #fff; color: #000a1f; padding: 8px 14px; z-index: 100; border-radius: 8px; }
.skip:focus { left: 8px; }

/* top bar */
.topbar { position: fixed; inset: 0 0 auto 0; height: var(--top); z-index: 50; display: flex; align-items: center; gap: 24px; padding: 0 20px; background: var(--bg); border-bottom: 1px solid var(--line); }
.wordmark { display: inline-flex; align-items: flex-end; text-decoration: none; line-height: 1; min-width: 196px; }
.wm-logo { display: block; height: 40px; width: auto; }
.wm-tld { font-size: 1.15rem; color: #fcb51a; margin: 0 0 1px 3px; font-weight: 800; letter-spacing: -0.01em; }
.toppills ul { list-style: none; display: flex; gap: 6px; margin: 0; padding: 0; }
.toppills a { display: inline-block; padding: 9px 16px; border-radius: 12px; color: var(--text); text-decoration: none; font-weight: 600; font-size: 0.95rem; }
.toppills a:hover { background: var(--panel-2); color: var(--text); }
.toppills a[aria-current="page"] { background: var(--blue-grad); color: #fff; }
.btn { display: inline-block; border-radius: 8px; padding: 9px 18px; font-weight: 700; font-size: 0.92rem; color: #fff; text-decoration: none; white-space: nowrap; }
.btn-blue { background: var(--blue-grad); color: #fff; }
.btn-orange { background: var(--orange-grad); color: #fff; }
.btn:hover { filter: brightness(1.1); color: #fff; }
.official { margin-left: auto; }
.menu-btn { display: none; background: var(--panel); border: 1px solid var(--line); border-radius: 8px; width: 40px; height: 40px; padding: 10px 9px; cursor: pointer; }
.menu-btn span { display: block; height: 2px; background: #fff; margin: 4px 0; border-radius: 2px; }

/* shell */
.shell { padding-top: var(--top); }
.sidebar { position: fixed; top: var(--top); bottom: 0; left: 0; width: var(--side); overflow-y: auto; padding: 22px 16px; background: var(--bg); border-right: 1px solid var(--line); z-index: 40; }
.tile { display: flex; align-items: center; height: 40px; padding: 0 14px; margin-bottom: 8px; border-radius: 4px; color: #fff; text-decoration: none; font-weight: 700; font-size: 0.95rem; position: relative; overflow: hidden; }
.tile::after { content: ""; position: absolute; right: -14px; top: -14px; width: 70px; height: 70px; border-radius: 50%; background: rgba(255,255,255,0.12); }
.tile-blue { background: var(--blue-grad); color: #fff; }
.tile-red { background: var(--red-grad); color: #fff; }
.tile:hover { color: #fff; filter: brightness(1.1); }
.side-list { list-style: none; margin: 18px 0 0; padding: 0; }
.side-list li { margin: 0; }
.side-list a { display: flex; align-items: center; gap: 12px; padding: 9px 12px; border-radius: 8px; color: var(--muted); text-decoration: none; font-weight: 600; font-size: 0.94rem; }
.side-list a:hover, .side-list a[aria-current="page"] { background: var(--panel-2); color: #fff; }
.ico svg { width: 18px; height: 18px; display: block; fill: currentColor; stroke: currentColor; stroke-linejoin: round; stroke-linecap: round; }
.sidebar hr { border: 0; border-top: 1px solid var(--line); margin: 18px 4px; }
.side-small { margin-top: 0; }
.side-small a { font-size: 0.86rem; padding: 6px 12px; }
.content-col { margin-left: var(--side); padding: 20px 24px 0; min-width: 0; }
.notice-strip { max-width: 1240px; margin: 0 0 18px; padding: 10px 14px; background: var(--panel); color: var(--soft); border: 1px solid var(--line); border-radius: 12px; font-size: 0.86rem; }
main { max-width: 1240px; }

/* article panel */
.doc { max-width: 860px; background: var(--panel); color: var(--text); border: 1px solid var(--line); border-radius: 12px; padding: 28px 32px 34px; }
.crumbs ol { list-style: none; padding: 0; margin: 0 0 12px; display: flex; flex-wrap: wrap; gap: 6px; font-size: 0.84rem; color: var(--muted); }
.crumbs li + li::before { content: "›"; margin-right: 6px; }
.crumbs a { color: var(--muted); }
h1, h2, h3 { line-height: 1.22; color: #fff; font-weight: 800; }
h1 { font-size: clamp(1.7rem, 3.6vw, 2.35rem); margin: 0 0 10px; letter-spacing: -0.01em; }
h2 { font-size: 1.4rem; margin: 2em 0 0.55em; }
h2::before { content: ""; display: block; width: 44px; height: 4px; border-radius: 4px; background: var(--orange-grad); margin-bottom: 12px; }
h3 { font-size: 1.1rem; margin: 1.5em 0 0.4em; color: #fff; }
p, li { color: var(--soft); }
strong { color: #fff; }
.byline { font-size: 0.84rem; color: var(--muted); margin: 0 0 18px; }
.byline a { color: var(--muted); }
.lede { font-size: 1.14rem; color: #fff; }
.hero { margin: 4px 0 22px; }
.hero img { border-radius: 12px; border: 1px solid var(--line); }
ul, ol { padding-left: 1.3em; }
li { margin: 0.3em 0; }
code { background: var(--bg); color: #ffd28a; padding: 1px 6px; border-radius: 4px; font-size: 0.92em; }

/* components (each background sets its own text colour) */
.factcard { background: var(--bg); color: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 6px 18px 10px; margin: 22px 0; position: relative; overflow: hidden; }
.factcard::before { content: ""; position: absolute; inset: 0 0 auto 0; height: 4px; background: var(--orange-grad); }
.factcard table { width: 100%; border-collapse: collapse; font-size: 0.94rem; }
.factcard th, .factcard td { text-align: left; vertical-align: top; padding: 10px 8px 10px 0; border-bottom: 1px solid var(--line); color: var(--soft); }
.factcard th { width: 34%; color: var(--muted); font-weight: 700; }
.factcard tr:last-child th, .factcard tr:last-child td { border-bottom: 0; }
.factcard caption { text-align: left; font-weight: 800; font-size: 1.05rem; padding: 14px 0 4px; color: #fff; }
.note { background: var(--note-bg); color: var(--note-ink); border: 1px solid #5a3d00; border-radius: 12px; padding: 14px 18px; margin: 20px 0; }
.note p, .note li, .note strong { color: var(--note-ink); }
.note a { color: #ffc861; }
.warn { background: var(--warn-bg); color: var(--warn-ink); border: 1px solid #6b1820; border-radius: 12px; padding: 14px 18px; margin: 20px 0; }
.warn p, .warn li, .warn strong { color: var(--warn-ink); }
.warn a { color: #ff9ea6; }
.note > :first-child, .warn > :first-child { margin-top: 0; }
.note > :last-child, .warn > :last-child { margin-bottom: 0; }
.table-scroll { overflow-x: auto; }
.datatable { width: 100%; border-collapse: collapse; margin: 18px 0; font-size: 0.92rem; background: var(--bg); color: var(--soft); border-radius: 12px; overflow: hidden; }
.datatable th, .datatable td { border-bottom: 1px solid var(--line); padding: 10px 12px; text-align: left; vertical-align: top; color: var(--soft); }
.datatable thead th { background: var(--panel-2); color: #fff; }
.timeline { list-style: none; padding: 0; margin: 20px 0; border-left: 3px solid var(--line); }
.timeline li { position: relative; padding: 0 0 20px 24px; margin: 0; }
.timeline li::before { content: ""; position: absolute; left: -9px; top: 6px; width: 15px; height: 15px; border-radius: 50%; background: var(--orange-grad); border: 3px solid var(--panel); }
.timeline .when { display: block; font-weight: 800; font-size: 0.8rem; color: var(--orange); text-transform: uppercase; letter-spacing: 0.05em; }
.timeline .what { display: block; font-weight: 800; font-size: 1.05rem; color: #fff; }
.timeline p { margin: 4px 0 0; }
.checklist { list-style: none; padding: 0; }
.checklist li { padding-left: 32px; position: relative; margin: 10px 0; }
.checklist li::before { content: "!"; position: absolute; left: 0; top: 1px; width: 22px; height: 22px; border-radius: 50%; background: var(--red-grad); color: #fff; font-size: 0.8rem; font-weight: 800; text-align: center; line-height: 22px; }

/* faq + sources */
.faq-item { border: 1px solid var(--line); border-radius: 12px; background: var(--bg); color: var(--soft); margin: 10px 0; }
.faq-item summary { cursor: pointer; padding: 13px 16px; list-style: none; }
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary h3 { display: inline; margin: 0; font-size: 1rem; }
.faq-item summary::after { content: "+"; float: right; font-weight: 800; color: var(--orange); }
.faq-item[open] summary::after { content: "–"; }
.faq-answer { padding: 0 16px 6px; }
.sources ol { font-size: 0.88rem; }

/* footer */
.sitefoot { max-width: 1240px; margin: 34px 0 0; padding: 26px 0 12px; border-top: 1px solid var(--line); font-size: 0.88rem; color: var(--soft); background: var(--bg); }
.sitefoot p, .sitefoot li { color: var(--soft); }
.sitefoot a { color: var(--link); }
.foot-grid { display: grid; grid-template-columns: 1fr 210px; gap: 28px; }
.foot-links { list-style: none; padding: 0; margin: 0; }
.foot-links li { margin: 0 0 8px; }
.age-badge { display: inline-block; background: #e2262b; color: #fff; font-weight: 800; border-radius: 4px; padding: 0 6px; margin-right: 6px; font-size: 0.85em; }
.sitefoot .licence-note, .sitefoot .licence-note strong { color: var(--muted); font-size: 0.82rem; }
.foot-base { border-top: 1px solid var(--line); margin-top: 16px; padding-top: 8px; }
.foot-base p { color: var(--muted); font-size: 0.8rem; }

/* responsive */
@media (max-width: 1024px) {
  .menu-btn { display: block; }
  .toppills { display: none; }
  .wordmark { min-width: 0; }
  .sidebar { transform: translateX(-100%); transition: transform .2s ease; box-shadow: 8px 0 24px rgba(0,0,0,.5); }
  body.menu-open .sidebar { transform: none; }
  .content-col { margin-left: 0; padding: 16px 16px 0; }
}
@media (max-width: 640px) {
  .topbar { gap: 12px; padding: 0 12px; }
  .official { padding: 8px 10px; font-size: 0.8rem; }
  .doc { padding: 20px 16px 26px; }
  .foot-grid { grid-template-columns: 1fr; }
  .factcard th { width: 40%; }
}
