:root {
  --bg: #ffffff;
  --bg-soft: #f5f7fa;
  --surface: #ffffff;
  --text: #16202c;
  --text-muted: #5a6776;
  --border: #dde3ea;
  --accent: #1f5fd1;
  --accent-text: #ffffff;
  --accent-soft: #e8effc;
  --ok: #137a3f;
  --ok-soft: #e4f4ea;
  --bad: #b3261e;
  --bad-soft: #fbe9e7;
  --warn: #8a5a00;
  --code-bg: #0f1722;
  --code-text: #dbe4ee;
  --radius: 10px;
  --shadow: 0 1px 2px rgba(16, 24, 40, .06), 0 4px 16px rgba(16, 24, 40, .06);
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0d131b;
    --bg-soft: #121a24;
    --surface: #16202c;
    --text: #e6ecf2;
    --text-muted: #9aa8b7;
    --border: #2a3644;
    --accent: #6c9ef8;
    --accent-text: #0d131b;
    --accent-soft: #1b2a44;
    --ok: #5cc98a;
    --ok-soft: #12301f;
    --bad: #f28b82;
    --bad-soft: #3a1714;
    --warn: #e3b25c;
    --code-bg: #080d13;
    --shadow: none;
  }
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.6 var(--font);
  -webkit-font-smoothing: antialiased;
}
a { color: var(--accent); }
h1, h2, h3 { line-height: 1.2; margin: 0 0 .5em; }
h1 { font-size: clamp(2rem, 5vw, 3.2rem); letter-spacing: -.02em; }
h2 { font-size: clamp(1.5rem, 3vw, 2rem); letter-spacing: -.01em; }
h3 { font-size: 1.1rem; }
p { margin: 0 0 1em; }

.wrap { max-width: 1120px; margin: 0 auto; padding: 0 16px; }
.wrap.narrow { max-width: 720px; }
section { padding: 64px 0; scroll-margin-top: 60px; }
section + section { border-top: 1px solid var(--border); }
.lead { font-size: 1.125rem; color: var(--text-muted); max-width: 65ch; }
.muted { color: var(--text-muted); }
.fineprint { font-size: .875rem; color: var(--text-muted); margin-top: 1em; }

/* Top bar */
.topbar { position: sticky; top: 0; z-index: 10; background: color-mix(in srgb, var(--bg) 92%, transparent); backdrop-filter: blur(8px); border-bottom: 1px solid var(--border); }
.topbar-inner { display: flex; align-items: center; gap: 24px; height: 60px; }
.brand { font-weight: 700; color: var(--text); text-decoration: none; }
.topnav { display: flex; gap: 20px; margin-left: auto; }
.topnav a { color: var(--text-muted); text-decoration: none; font-size: .95rem; }
.topnav a:hover { color: var(--text); }

/* Language dropdown (<details>, no script needed) */
.brand + .langs { margin-left: auto; }   /* pages without the main menu: keep it on the right */
.lang-menu { position: relative; }
.lang-menu summary { display: flex; align-items: center; gap: 6px; padding: 5px 10px; border: 1px solid var(--border); border-radius: 8px; color: var(--text-muted); font-size: .9rem; font-weight: 600; cursor: pointer; list-style: none; user-select: none; }
.lang-menu summary::-webkit-details-marker { display: none; }
.lang-menu summary::after { content: ""; width: 6px; height: 6px; margin: 0 2px 3px 2px; border-right: 1.5px solid currentColor; border-bottom: 1.5px solid currentColor; transform: rotate(45deg); }
.lang-menu[open] summary::after { margin-bottom: -3px; transform: rotate(-135deg); }
.lang-menu summary:hover, .lang-menu[open] summary { color: var(--text); border-color: var(--text-muted); }
.lang-list { position: absolute; right: 0; top: calc(100% + 6px); z-index: 20; min-width: 168px; margin: 0; padding: 6px; list-style: none; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); }
.lang-list a { display: flex; justify-content: space-between; gap: 16px; padding: 7px 10px; border-radius: 6px; color: var(--text); text-decoration: none; font-size: .95rem; }
.lang-list a span { color: var(--text-muted); font-size: .8rem; letter-spacing: .04em; }
.lang-list a:hover { background: var(--bg-soft); }
.lang-list a[aria-current="page"] { font-weight: 600; background: var(--accent-soft); }

/* Hero */
.hero { background: linear-gradient(180deg, var(--bg-soft), var(--bg)); }
.hero-grid { display: grid; grid-template-columns: 1.1fr 1fr; gap: 48px; align-items: center; }
/* Grid items default to min-width: auto, so long code lines would widen the page. */
.hero-grid > *, .validator-grid > *, .cards > * { min-width: 0; }
.badge { display: inline-block; font-size: .8rem; font-weight: 600; color: var(--accent); background: var(--accent-soft); padding: 4px 10px; border-radius: 999px; margin-bottom: 16px; }
.actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 24px; }
.code-card { margin: 0; }
.code-card pre { margin: 0; background: var(--code-bg); color: var(--code-text); border-radius: var(--radius); padding: 20px; overflow-x: auto; font: 13px/1.6 var(--mono); box-shadow: var(--shadow); }
.code-card .muted { color: #7d8b9a; }
.code-card .ok { color: #5cc98a; }
.code-card figcaption { font-size: .875rem; color: var(--text-muted); margin-top: 8px; }

/* Buttons */
.button { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 10px 18px; border-radius: 8px; border: 1px solid var(--border); background: var(--surface); color: var(--text); font: 600 .95rem var(--font); text-decoration: none; cursor: pointer; }
.button:hover { border-color: var(--accent); }
.button.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-text); }
.button.primary:hover { filter: brightness(1.08); }
.button.wide { width: 100%; margin-top: 16px; }
.button:disabled { opacity: .6; cursor: progress; }
.button.file { position: relative; overflow: hidden; font-weight: 500; }
.button.file input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
button.link { background: none; border: 0; padding: 0; color: var(--accent); font: inherit; font-size: .9rem; cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* Cards */
.cards { display: grid; gap: 16px; margin-top: 24px; }
.cards.three { grid-template-columns: repeat(3, 1fr); }
.cards.four { grid-template-columns: repeat(4, 1fr); }
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow); }
.card p:last-child { margin-bottom: 0; }
.card.dim { background: var(--bg-soft); box-shadow: none; }
.tag { display: inline-block; vertical-align: middle; font-size: .7rem; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; color: var(--ok); background: var(--ok-soft); padding: 2px 8px; border-radius: 999px; margin-left: 6px; }
.tag.soon { color: var(--text-muted); background: var(--border); }

/* Countries table */
.table-title { margin-top: 24px; font-size: 1.1rem; }
.countries { width: 100%; border-collapse: collapse; margin-top: 8px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); font-size: .95rem; }
.countries th, .countries td { text-align: left; vertical-align: top; padding: 12px 14px; border-bottom: 1px solid var(--border); }
.countries thead th { background: var(--bg-soft); font-size: .8rem; text-transform: uppercase; letter-spacing: .04em; color: var(--text-muted); }
.countries tbody tr:last-child th, .countries tbody tr:last-child td { border-bottom: 0; }
.countries tbody th { font-weight: 600; white-space: nowrap; }
.countries td:nth-child(3) { white-space: nowrap; color: var(--text); font-variant-numeric: tabular-nums; }
.countries td:nth-child(2) { color: var(--text-muted); }

/* Steps */
.steps { list-style: none; padding: 0; margin: 24px 0 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; counter-reset: step; }
.steps li { counter-increment: step; }
.steps li::before { content: counter(step); display: inline-flex; width: 32px; height: 32px; border-radius: 50%; align-items: center; justify-content: center; background: var(--accent-soft); color: var(--accent); font-weight: 700; margin-bottom: 12px; }
.steps p { color: var(--text-muted); }

/* Validator */
.validator { background: var(--bg-soft); }
.privacy-note { font-size: .9rem; color: var(--ok); }
.validator-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-top: 16px; align-items: start; }
.panel { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow); }
.panel label { display: block; font-weight: 600; font-size: .9rem; margin-bottom: 6px; }
textarea, input[type="email"], input[type="text"] { width: 100%; border: 1px solid var(--border); border-radius: 8px; background: var(--bg); color: var(--text); padding: 10px 12px; font: 15px/1.5 var(--font); }
textarea { font: 12.5px/1.5 var(--mono); resize: vertical; min-height: 240px; }
.contact-form textarea { font: 15px/1.5 var(--font); min-height: 160px; margin-bottom: 8px; }
.contact-form input + label, .contact-form .trap + label { margin-top: 16px; }
input + label { margin-top: 16px; }
.row { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 16px; margin-top: 12px; }
.result { min-height: 200px; }
.result .status { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 1.1rem; padding: 10px 14px; border-radius: 8px; margin-bottom: 12px; }
.result .status.valid { color: var(--ok); background: var(--ok-soft); }
.result .status.invalid { color: var(--bad); background: var(--bad-soft); }
.result h3 { font-size: .95rem; margin: 16px 0 8px; }
.issues { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.issues li { border: 1px solid var(--border); border-left: 3px solid var(--bad); border-radius: 6px; padding: 8px 10px; font-size: .9rem; }
.issues.warnings li { border-left-color: var(--warn); }
.issues .rule { font: 600 12px var(--mono); color: var(--text-muted); }
.issues .where { display: block; font: 11.5px/1.4 var(--mono); color: var(--text-muted); word-break: break-all; margin-top: 4px; }

/* Pricing */
.plan .price { font-size: 2rem; font-weight: 700; margin: 4px 0 12px; }
.plan .price span { font-size: .9rem; font-weight: 400; color: var(--text-muted); margin-left: 4px; }
.plan ul { list-style: none; padding: 0; margin: 0; display: grid; gap: 6px; color: var(--text-muted); font-size: .95rem; }
.plan strong { color: var(--text); }
.plan.featured { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent), var(--shadow); }

/* Early access */
.early-access { background: var(--bg-soft); }
.early-access .actions { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 16px; }
/* Honeypot field of the contact form: off-screen, only bots fill it in */
.trap { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }

/* FAQ */
details { border-bottom: 1px solid var(--border); padding: 14px 0; }
summary { font-weight: 600; cursor: pointer; }
details p { color: var(--text-muted); margin: 10px 0 0; }

/* Footer */
.footer { border-top: 1px solid var(--border); padding: 24px 0; font-size: .875rem; color: var(--text-muted); }
.footer-inner { display: flex; flex-direction: column; align-items: center; gap: 8px; text-align: center; }
.footer p { margin: 0; }

/* Legal pages */
.legal { padding: 48px 0; }
.legal h2 { font-size: 1.25rem; margin-top: 1.5em; }
.table-scroll { overflow-x: auto; }
.legal-table { width: 100%; border-collapse: collapse; font-size: .9rem; }
.legal-table th, .legal-table td { text-align: left; vertical-align: top; padding: 10px 12px; border-bottom: 1px solid var(--border); }
.legal-table thead th { background: var(--bg-soft); font-size: .8rem; color: var(--text-muted); }
.draft { border: 1px dashed var(--warn); color: var(--warn); border-radius: 8px; padding: 10px 14px; }

@media (max-width: 900px) {
  .hero-grid, .validator-grid { grid-template-columns: 1fr; }
  .cards.three, .steps { grid-template-columns: 1fr; }
  .cards.four { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 640px) {
  .countries thead { display: none; }
  .countries, .countries tbody, .countries tr, .countries th, .countries td { display: block; width: 100%; }
  .countries tr { border-bottom: 1px solid var(--border); padding: 10px 14px; }
  .countries tbody tr:last-child { border-bottom: 0; }
  .countries th, .countries td { border: 0; padding: 2px 0; white-space: normal !important; }
  .countries td[data-label]::before { content: attr(data-label) ": "; color: var(--text-muted); font-size: .85rem; }
  section { padding: 48px 0; }
  .topnav { display: none; }
  .langs { margin-left: auto; }
  .cards.four { grid-template-columns: 1fr; }
}
