/*
 * One stylesheet, no framework, no build step.
 *
 * The product is a developer tool, so the visual target is "documentation you trust": a system font
 * stack, one accent colour, generous line height, and tables that are readable at a glance. Everything
 * is either a custom property or a single-purpose class -- there is no utility system to learn and no
 * compilation step between editing this file and seeing it.
 *
 * Dark mode is the browser's preference, not a toggle: a toggle needs state, and state needs JavaScript
 * and a cookie, for a choice the operating system already made.
 */

:root {
    color-scheme: light dark;
    --fg: #14181f;
    --muted: #5a6472;
    --bg: #ffffff;
    --surface: #f8f9fb;
    --border: #dfe3ea;
    --accent: #0b5cab;
    --accent-fg: #ffffff;
    --accent-soft: #e8f1fb;
    --code-bg: #f1f3f6;
    --ok: #0f7b45;
    --warn: #9a6400;
    --danger: #b3261e;
    --radius: 8px;
    --page: 62rem;
}

@media (prefers-color-scheme: dark) {
    :root {
        --fg: #e7ebf1;
        --muted: #9aa5b4;
        --bg: #14181f;
        --surface: #1a2029;
        --border: #2c3542;
        --accent: #6fb2ff;
        --accent-fg: #0b1420;
        --accent-soft: #17293c;
        --code-bg: #1e242e;
        --ok: #5ed39a;
        --warn: #e0b25c;
        --danger: #ff8a80;
    }
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    padding: 0;
    font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    font-size: 17px;
    line-height: 1.65;
    color: var(--fg);
    background: var(--bg);
    -webkit-text-size-adjust: 100%;
}

/* ------------------------------------------------------------------ layout */

main {
    max-width: var(--page);
    margin: 0 auto;
    padding: 2.5rem 1.25rem 4rem;
}

section {
    margin: 3.5rem 0 0;
}

section:first-of-type {
    margin-top: 0;
}

.narrow {
    max-width: 42rem;
}

/* ---------------------------------------------------------------- headings */

h1 {
    margin: 0 0 0.6rem;
    font-size: 2.1rem;
    line-height: 1.2;
    letter-spacing: -0.02em;
}

h2 {
    margin: 0 0 1rem;
    font-size: 1.4rem;
    letter-spacing: -0.01em;
}

h3 {
    margin: 2rem 0 0.5rem;
    font-size: 1.1rem;
}

h4 {
    margin: 1.5rem 0 0.4rem;
    font-size: 1rem;
}

p {
    margin: 0 0 1rem;
}

.lead {
    font-size: 1.15rem;
    color: var(--muted);
}

.muted {
    color: var(--muted);
}

.small {
    font-size: 0.9rem;
}

.eyebrow {
    margin: 0 0 0.5rem;
    font-size: 0.8rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--accent);
}

a {
    color: var(--accent);
    text-decoration-thickness: 1px;
    text-underline-offset: 2px;
}

/* -------------------------------------------------------------------- nav */

.site-nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
    max-width: var(--page);
    margin: 0 auto;
    padding: 1.1rem 1.25rem;
}

.site-nav .brand {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 650;
    color: var(--fg);
    text-decoration: none;
}

.brand-mark {
    padding: 0.15rem 0.45rem;
    border-radius: 5px;
    background: var(--accent);
    color: var(--accent-fg);
    font-size: 0.85rem;
    font-weight: 700;
    letter-spacing: 0.02em;
}

.site-nav nav {
    display: flex;
    align-items: center;
    gap: 1.25rem;
    flex-wrap: wrap;
}

.site-nav nav a:not(.button) {
    color: var(--muted);
    text-decoration: none;
    font-size: 0.95rem;
}

.site-nav nav a:not(.button):hover {
    color: var(--fg);
}

/* --------------------------------------------------------- language switch */

/* Four two-letter codes in a pill. Small on purpose: the switcher matters enormously to the one
   visitor who needs it and not at all to the one already reading their own language. */
.lang-switch ul {
    display: flex;
    align-items: center;
    gap: 0;
    margin: 0;
    padding: 0.15rem;
    list-style: none;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--surface);
}

.site-nav nav .lang-switch a {
    display: block;
    padding: 0.15rem 0.4rem;
    border-radius: 5px;
    font-size: 0.8rem;
    font-weight: 600;
    letter-spacing: 0.02em;
    text-transform: uppercase;
    text-decoration: none;
    color: var(--muted);
}

.site-nav nav .lang-switch a:hover {
    background: var(--accent-soft);
    color: var(--fg);
}

.site-nav nav .lang-switch a.active {
    background: var(--accent);
    color: var(--accent-fg);
}

/* Available to a screen reader, absent from the layout. Used for the switcher's group label, which
   is obvious visually and unlabelled otherwise. */
.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: -1px;
    padding: 0;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
    border: 0;
}

/* ------------------------------------------------------------------- hero */

.hero {
    padding: 2rem 0 0;
}

.hero h1 {
    max-width: 32ch;
    font-size: 2.6rem;
}

.hero .lead {
    max-width: 56ch;
}

.hero-actions {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
    margin-top: 1.5rem;
}

/* ---------------------------------------------------------------- buttons */

.button {
    display: inline-block;
    padding: 0.6rem 1.15rem;
    border: 1px solid var(--accent);
    border-radius: var(--radius);
    background: var(--accent);
    color: var(--accent-fg);
    font: inherit;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
}

.button:hover {
    filter: brightness(1.08);
}

.button-secondary {
    background: transparent;
    color: var(--accent);
}

.button-small {
    padding: 0.35rem 0.8rem;
    font-size: 0.9rem;
}

.button-danger {
    border-color: var(--danger);
    background: transparent;
    color: var(--danger);
}

.button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* ------------------------------------------------------------------ cards */

.cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr));
    gap: 1.25rem;
}

.card {
    padding: 1.25rem 1.35rem;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--surface);
}

.card h3 {
    margin-top: 0;
}

.card > :last-child {
    margin-bottom: 0;
}

.card-highlight {
    border-color: var(--accent);
    box-shadow: 0 0 0 1px var(--accent);
}

/* pricing */

.price {
    display: flex;
    align-items: baseline;
    gap: 0.35rem;
    margin: 0.5rem 0 0.25rem;
}

.price-amount {
    font-size: 2.2rem;
    font-weight: 700;
    letter-spacing: -0.03em;
}

.plan-features {
    margin: 1rem 0 1.5rem;
    padding: 0;
    list-style: none;
}

.plan-features li {
    padding-left: 1.5rem;
    position: relative;
}

.plan-features li::before {
    content: "✓";
    position: absolute;
    left: 0;
    color: var(--ok);
    font-weight: 700;
}

.plan-features li.no::before {
    content: "—";
    color: var(--muted);
}

/* ------------------------------------------------------------------- steps */

.steps {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr));
    gap: 1.25rem;
    margin: 0;
    padding: 0;
    list-style: none;
}

.steps li {
    padding-top: 0.5rem;
    border-top: 2px solid var(--accent);
}

/* "Step 1" comes from the markup, not from a CSS counter and a content: string. It is a word, and words
   on this site are translated -- a ::before with content: "Step " would be English on the Dutch page. */
.steps .step-label {
    display: block;
    margin-bottom: 0.3rem;
    font-size: 0.8rem;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--accent);
}

.steps strong {
    display: block;
}

/* ------------------------------------------------------- code and tables */

code {
    padding: 0.1rem 0.35rem;
    border-radius: 4px;
    background: var(--code-bg);
    font-family: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
    font-size: 0.88em;
    overflow-wrap: break-word;
}

pre {
    margin: 0 0 1rem;
    padding: 0.9rem 1rem;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--code-bg);
    overflow-x: auto;
    font-size: 0.85rem;
    line-height: 1.5;
}

pre code {
    padding: 0;
    background: none;
    font-size: 1em;
}

.table-scroll {
    overflow-x: auto;
    margin: 0 0 1rem;
}

table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.93rem;
}

th, td {
    padding: 0.55rem 0.7rem;
    border-bottom: 1px solid var(--border);
    text-align: left;
    vertical-align: top;
}

th {
    font-size: 0.8rem;
    font-weight: 650;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--muted);
}

td code {
    white-space: nowrap;
}

/* ----------------------------------------------------------------- badges */

.badge {
    display: inline-block;
    padding: 0.1rem 0.5rem;
    border: 1px solid var(--border);
    border-radius: 999px;
    background: var(--surface);
    font-size: 0.78rem;
    font-weight: 600;
    letter-spacing: 0.02em;
    white-space: nowrap;
}

.badge-accent {
    border-color: transparent;
    background: var(--accent-soft);
    color: var(--accent);
}

.badge-ok {
    border-color: transparent;
    background: var(--accent-soft);
    color: var(--ok);
}

.badge-warn {
    border-color: transparent;
    color: var(--warn);
}

.badge-danger {
    border-color: transparent;
    color: var(--danger);
}

/* ----------------------------------------------------------------- notes */

.note {
    margin: 0 0 1rem;
    padding: 0.85rem 1rem;
    border-left: 3px solid var(--accent);
    border-radius: 0 var(--radius) var(--radius) 0;
    background: var(--surface);
    font-size: 0.95rem;
}

.note > :last-child {
    margin-bottom: 0;
}

.note-warn {
    border-left-color: var(--warn);
}

.note-danger {
    border-left-color: var(--danger);
}

/* -------------------------------------------------------------------- faq */

details {
    padding: 0.75rem 0;
    border-bottom: 1px solid var(--border);
}

summary {
    font-weight: 600;
    cursor: pointer;
}

details p:first-of-type {
    margin-top: 0.6rem;
}

details > :last-child {
    margin-bottom: 0;
}

/* ------------------------------------------------------------------ forms */

label {
    display: block;
    margin-bottom: 0.35rem;
    font-size: 0.9rem;
    font-weight: 600;
}

input[type="email"], input[type="text"] {
    width: 100%;
    padding: 0.6rem 0.75rem;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--bg);
    color: var(--fg);
    font: inherit;
}

input:focus-visible, .button:focus-visible, a:focus-visible, summary:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

.form-row {
    display: flex;
    gap: 0.6rem;
    align-items: flex-end;
    flex-wrap: wrap;
}

.form-row > div {
    flex: 1 1 16rem;
}

.field-error {
    margin: 0.4rem 0 0;
    color: var(--danger);
    font-size: 0.9rem;
}

/* --------------------------------------------------------------- account */

.panel {
    margin: 0 0 1.5rem;
    padding: 1.25rem 1.35rem;
    border: 1px solid var(--border);
    border-radius: var(--radius);
}

.panel-head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
    margin-bottom: 0.75rem;
}

.panel-head h2, .panel-head h3 {
    margin: 0;
}

.meter {
    height: 8px;
    margin: 0.4rem 0 0.3rem;
    border-radius: 999px;
    background: var(--border);
    overflow: hidden;
}

.meter > span {
    display: block;
    height: 100%;
    background: var(--accent);
}

.meter-full > span {
    background: var(--danger);
}

.usage-row + .usage-row {
    margin-top: 1.1rem;
}

.usage-numbers {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    font-size: 0.9rem;
}

.key-value {
    display: flex;
    gap: 0.5rem;
    align-items: center;
    flex-wrap: wrap;
    margin: 0 0 0.75rem;
}

.key-value code {
    flex: 1 1 20rem;
    padding: 0.6rem 0.7rem;
    font-size: 0.85rem;
    word-break: break-all;
}

dl.facts {
    display: grid;
    grid-template-columns: max-content 1fr;
    gap: 0.35rem 1.25rem;
    margin: 0;
}

dl.facts dt {
    color: var(--muted);
    font-size: 0.9rem;
}

dl.facts dd {
    margin: 0;
}

/* htmx: dim a panel while its replacement is in flight */
.htmx-request.panel, .panel.htmx-request {
    opacity: 0.6;
    transition: opacity 120ms linear;
}

/* ----------------------------------------------------------------- footer */

.site-footer {
    max-width: var(--page);
    margin: 0 auto;
    padding: 2rem 1.25rem 3rem;
    border-top: 1px solid var(--border);
    font-size: 0.92rem;
}

.footer-cols {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(12rem, 1fr));
    gap: 1.5rem;
    margin-bottom: 1.5rem;
}

.footer-cols ul {
    margin: 0.4rem 0 0;
    padding: 0;
    list-style: none;
}

.footer-cols p {
    margin: 0.4rem 0 0;
    font-size: 0.9rem;
}

.footer-legal {
    margin: 0;
    font-size: 0.85rem;
}

/* --------------------------------------------------------------- utility */

.stack > * + * {
    margin-top: 1rem;
}

.center {
    text-align: center;
}

.nowrap {
    white-space: nowrap;
}

.copy-status {
    font-size: 0.85rem;
    color: var(--ok);
}

@media (max-width: 40rem) {
    body {
        font-size: 16px;
    }

    .hero h1 {
        font-size: 2rem;
    }

    dl.facts {
        grid-template-columns: 1fr;
    }
}
