:root {
  --void: #070d1a;
  --panel: rgba(255, 255, 255, 0.045);
  --line: rgba(140, 180, 255, 0.2);
  --ink: #e9f0ff;
  --muted: #9aabc9;
  --cyan: #3de0ff;
  --plate: #ffc800;
  --pass: #3ddc84;
  --fail: #ff6b6b;
  --warn: #ffc857;
  --head: "Sora", "Arial Narrow", Arial, sans-serif;
  --body: "Figtree", system-ui, -apple-system, BlinkMacSystemFont, Arial, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, Consolas, monospace;
  box-sizing: border-box;
}

*, *:before, *:after {
  box-sizing: inherit;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: 70px;
  background: var(--void);
}

body {
  margin: 0;
  color: var(--ink);
  font: 18px/1.65 var(--body);
  padding-bottom: env(safe-area-inset-bottom, 0);
  background: radial-gradient(900px 500px at 78% -80px, rgba(61, 224, 255, 0.16), transparent 70%),
              linear-gradient(rgba(140, 180, 255, 0.05) 1px, transparent 1px) 0 0 / 48px 48px,
              linear-gradient(90deg, rgba(140, 180, 255, 0.05) 1px, transparent 1px) 0 0 / 48px 48px,
              var(--void);
}

h1, h2, h3, h4 {
  font-family: var(--head);
  line-height: 1.15;
  margin: 0 0 0.5em;
  letter-spacing: -0.01em;
  color: var(--ink);
}

h1 {
  font-size: clamp(2.3rem, 6.4vw, 4.2rem);
  font-weight: 800;
}

h2 {
  font-size: clamp(1.7rem, 4vw, 2.4rem);
  font-weight: 800;
  margin-top: 1.2em;
}

h3 {
  font-size: 1.25rem;
  font-weight: 600;
}

a {
  color: var(--cyan);
  text-decoration: underline;
  text-underline-offset: 3px;
}

a:hover {
  filter: brightness(1.15);
}

:focus-visible {
  outline: 3px solid var(--cyan);
  outline-offset: 3px;
}

/* Accessibility Skip Link */
.skip-link {
  position: absolute;
  top: -120px;
  left: 16px;
  background: var(--cyan);
  color: #04121c;
  padding: 12px 20px;
  font-family: var(--head);
  font-weight: 800;
  font-size: 0.95rem;
  border-radius: 8px;
  z-index: 10000;
  text-decoration: none;
  transition: top 0.2s ease;
}

.skip-link:focus {
  top: 16px;
}

.wrap {
  max-width: 1040px;
  margin: 0 auto;
  padding: 0 20px;
}

.prose {
  max-width: 68ch;
  color: var(--muted);
}

.prose p {
  margin: 0 0 1.2em;
}

.prose ul, .prose ol {
  margin: 0 0 1.5em;
  padding-left: 1.4em;
  color: var(--muted);
}

.prose li {
  margin-bottom: 0.5em;
}

.prose strong {
  color: var(--ink);
}

nav {
  display: flex;
  gap: 22px;
  align-items: center;
  flex-wrap: wrap;
  padding: calc(14px + env(safe-area-inset-top, 0)) 0 14px;
  font: 600 0.95rem var(--head);
}

nav .brand {
  margin-right: auto;
  font-weight: 800;
  font-size: 1.05rem;
  text-decoration: none;
  color: var(--ink);
  display: inline-flex;
  align-items: center;
}

nav .brand i {
  font-style: normal;
  background: var(--plate);
  color: #111;
  border-radius: 6px;
  padding: 2px 7px;
  margin-right: 8px;
}

nav a {
  text-decoration: none;
  color: var(--muted);
  min-height: 44px;
  display: inline-flex;
  align-items: center;
}

nav a:hover, nav a[aria-current="page"] {
  color: var(--ink);
}

.hero {
  padding: 56px 0 76px;
}

.hero p.lead {
  font-size: 1.25rem;
  max-width: 54ch;
  margin: 0 0 34px;
  color: var(--muted);
}

/* Number Plate Form */
form.check {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  align-items: stretch;
}

.plate {
  position: relative;
  display: flex;
  align-items: stretch;
  border: 3px solid #111;
  border-radius: 12px;
  background: var(--plate);
  overflow: hidden;
  min-width: min(100%, 340px);
  flex: 0 1 400px;
  box-shadow: 0 0 0 1px rgba(255, 200, 0, 0.5), 0 0 44px rgba(255, 200, 0, 0.3);
}

.plate .gb {
  background: #0a3a9c;
  color: #fff;
  font: 800 0.8rem var(--head);
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: 6px 10px;
  user-select: none;
}

.plate input {
  flex: 1;
  min-width: 0;
  border: 0;
  background: transparent;
  color: #111;
  text-transform: uppercase;
  text-align: center;
  font: 800 2.3rem var(--head);
  letter-spacing: 0.06em;
  padding: 12px 8px;
}

.plate input::placeholder {
  color: #111;
  opacity: 0.4;
}

.plate input:focus-visible {
  outline: none;
}

.plate:focus-within {
  box-shadow: 0 0 0 3px var(--cyan), 0 0 54px rgba(61, 224, 255, 0.45);
}

.plate:after {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  width: 6px;
  left: -10%;
  background: var(--cyan);
  box-shadow: 0 0 22px 8px rgba(61, 224, 255, 0.7);
  opacity: 0;
  pointer-events: none;
}

.plate.scan:after {
  animation: scan 1.1s ease-in-out 1;
}

@keyframes scan {
  0% { left: -10%; opacity: 1; }
  100% { left: 104%; opacity: 1; }
}

button.go {
  font: 800 1.05rem var(--head);
  background: var(--cyan);
  color: #04121c;
  border: 0;
  border-radius: 12px;
  padding: 0 28px;
  min-height: 62px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

button.go:hover {
  filter: brightness(1.1);
}

/* Compact checker for inner pages */
form.check-compact {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  align-items: stretch;
  margin: 28px 0;
}

form.check-compact .plate {
  flex: 0 1 320px;
  min-width: min(100%, 280px);
}

form.check-compact .plate input {
  font-size: 1.6rem;
  padding: 8px 6px;
}

form.check-compact button.go {
  min-height: 48px;
  padding: 0 22px;
  font-size: 0.95rem;
}

.note {
  font-size: 0.95rem;
  color: var(--muted);
  margin: 16px 0 0;
  max-width: 60ch;
}

.note a {
  color: var(--cyan);
}

#result, .checker-result {
  display: none;
  margin-top: 28px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 20px;
  backdrop-filter: blur(8px);
}

#result.on, .checker-result.on {
  display: block;
}

#result .row, .checker-result .row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  border-top: 1px solid var(--line);
  padding: 12px 0;
  flex-wrap: wrap;
}

.tag {
  font: 800 0.8rem var(--head);
  padding: 2px 10px;
  border-radius: 99px;
  border: 2px solid currentColor;
  display: inline-block;
}

.pass { color: var(--pass); }
.fail { color: var(--fail); }
.warn { color: var(--warn); }
.mono { font-family: var(--mono); }

section {
  padding: 68px 0;
  border-top: 1px solid var(--line);
}

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 18px;
  margin-top: 28px;
}

.tile {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 20px;
}

.tile h3 {
  color: var(--cyan);
  margin-top: 0;
}

.tile p {
  margin: 0;
  color: var(--muted);
}

.grades {
  display: grid;
  gap: 12px;
  margin-top: 20px;
}

.grade {
  display: flex;
  gap: 16px;
  align-items: baseline;
  padding: 14px 18px;
  border: 1px solid var(--line);
  border-left: 5px solid currentColor;
  border-radius: 10px;
  background: var(--panel);
}

.grade b {
  font: 800 1rem var(--head);
  min-width: 96px;
}

.grade span {
  color: var(--ink);
}

.trace {
  margin-top: 28px;
  display: grid;
  gap: 22px;
  grid-template-columns: 1.4fr 1fr;
  align-items: start;
}

@media (max-width: 820px) {
  .trace {
    grid-template-columns: 1fr;
  }
}

.chart {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 16px;
}

.chart svg {
  width: 100%;
  height: auto;
  display: block;
}

.flag {
  padding: 12px 16px;
  border-left: 4px solid var(--fail);
  background: rgba(255, 107, 107, 0.12);
  border-radius: 0 10px 10px 0;
  font-weight: 600;
  color: var(--ink);
}

.cap {
  font-size: 0.9rem;
  color: var(--muted);
}

table {
  border-collapse: collapse;
  width: 100%;
  margin-top: 22px;
  background: var(--panel);
  border-radius: 12px;
  overflow: hidden;
}

th, td {
  text-align: left;
  padding: 13px 16px;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
}

th {
  font-family: var(--head);
  width: 32%;
  color: var(--cyan);
}

tr:last-child th, tr:last-child td {
  border-bottom: 0;
}

details {
  border-top: 1px solid var(--line);
  padding: 16px 0;
}

details:last-child {
  border-bottom: 1px solid var(--line);
}

summary {
  font: 600 1.1rem var(--head);
  cursor: pointer;
  color: var(--ink);
  min-height: 44px;
  display: flex;
  align-items: center;
}

details p {
  margin: 0.6em 0 0;
  max-width: 66ch;
  color: var(--muted);
}

/* Page Headers & Breadcrumbs */
.page-header {
  padding: 48px 0 24px;
}

.breadcrumbs {
  display: flex;
  gap: 8px;
  align-items: center;
  font-size: 0.9rem;
  color: var(--muted);
  margin-bottom: 24px;
  flex-wrap: wrap;
}

.breadcrumbs a {
  color: var(--muted);
  text-decoration: none;
}

.breadcrumbs a:hover {
  color: var(--cyan);
}

.breadcrumbs span[aria-hidden="true"] {
  color: var(--muted);
  opacity: 0.5;
}

.meta-line {
  font-size: 0.9rem;
  color: var(--muted);
  margin-bottom: 28px;
}

.sources {
  margin-top: 48px;
  padding: 24px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 14px;
}

.sources h3 {
  margin-top: 0;
  font-size: 1.05rem;
  color: var(--cyan);
}

.sources ul {
  margin: 0;
  padding-left: 1.3em;
  color: var(--muted);
}

.sources li {
  margin-bottom: 0.4em;
}

.related {
  margin-top: 48px;
  padding-top: 36px;
  border-top: 1px solid var(--line);
}

.related h3 {
  color: var(--ink);
  margin-bottom: 16px;
}

.related-links {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
}

.related-card {
  flex: 1 1 240px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 16px 20px;
  text-decoration: none;
  color: var(--ink);
  display: block;
}

.related-card:hover {
  border-color: var(--cyan);
}

.related-card strong {
  display: block;
  font-family: var(--head);
  color: var(--cyan);
  margin-bottom: 4px;
}

.related-card span {
  font-size: 0.9rem;
  color: var(--muted);
}

footer {
  padding: 40px 0 48px;
  font-size: 0.95rem;
  color: var(--muted);
  border-top: 1px solid var(--line);
}

footer ul {
  padding: 0;
  list-style: none;
  display: flex;
  gap: 18px;
  flex-wrap: wrap;
  margin: 20px 0;
}

footer a {
  color: var(--muted);
  text-decoration: none;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
}

footer a:hover {
  color: var(--ink);
}

@media (max-width: 640px) {
  table, thead, tbody, th, td, tr {
    display: block;
  }
  th {
    width: 100%;
    padding-bottom: 4px;
    border-bottom: 0;
  }
  td {
    padding-top: 0;
    padding-bottom: 16px;
  }
}

@media (max-width: 480px) {
  .wrap {
    padding: 0 16px;
  }
  .hero {
    padding: 36px 0 48px;
  }
  form.check {
    flex-direction: column;
  }
  .plate {
    width: 100%;
    flex: 1 1 auto;
    min-width: 0;
  }
  .plate input {
    font-size: 1.8rem;
    padding: 10px 4px;
  }
  button.go {
    width: 100%;
  }
  nav {
    gap: 14px;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  .plate.scan:after {
    animation: none;
  }
}

/* Article / page hero images (added 2026-10-30) */
.article-hero { margin: 0 0 32px; }
.article-hero img { display: block; width: 100%; height: auto; border-radius: 16px; border: 1px solid rgba(0, 229, 255, 0.25); box-shadow: 0 12px 40px rgba(0, 0, 0, 0.45); }

/* Table of contents (added 2026-11-25) */
.toc{background:#f4f7f7;border:1px solid #d8e2e2;border-radius:10px;padding:16px 20px;margin:22px 0}
.toc-title{font-weight:700;margin:0 0 8px;font-size:1.02rem}
.toc ul{margin:0;padding-left:20px}
.toc li{margin:4px 0}
.toc a{text-decoration:none}
.toc a:hover{text-decoration:underline}
h2{scroll-margin-top:90px}

/* Infographic figures (added 2026-11-25) */
.infographic{margin:22px 0;background:#fff;border:1px solid #d8e2e2;border-radius:10px;padding:18px}
.infographic svg{width:100%;height:auto;display:block}
.infographic figcaption{font-size:.9rem;color:#4a5a5a;margin-top:10px}

/* MOT is a dark theme: force dark text inside the light ToC/infographic cards */
.toc,.toc .toc-title{color:#16323f}
.toc a{color:#0b5cad}
.infographic{color:#16323f}
.ig-grid{display:grid;grid-template-columns:1fr 1fr;gap:12px}
.ig-block{border:1px solid #d8e2e2;border-radius:8px;padding:12px 14px;background:#f9fbfb}
.ig-big{font-size:1.2rem;font-weight:800;display:block;margin-bottom:4px;color:#0b3b3b}
.ig-block p{margin:0;font-size:.93rem}
@media (max-width:520px){.ig-grid{grid-template-columns:1fr}}
