/* Shared Dimensions look (navy + lime, Rubik) used by index.html and help.html.
   Light tokens on :root, dark on :root[data-theme="dark"]; the footer's Light / Dark /
   Auto toggle sets data-theme (see HEADER-FOOTER.md). Lime is a highlight (buttons,
   accent text in dark) - never an ambient wash, never text on light. See STYLES.md. */

@font-face {
    font-family: "Material Symbols Outlined";
    font-style: normal;
    font-weight: 100 700;
    src: url("MaterialSymbolsOutlined.woff2") format("woff2");
    font-display: block;
}

:root {
    --bg: #f1f3f6;
    --panel: #ffffff;
    --surface-2: #e9ecf0;
    --border: #dfe3e8;
    --border-strong: #c5ccd4;
    --text: #16303b;
    --text-2: #34484f;
    --muted: #5c6b70;
    --faint: #8a979b;
    --accent: #16303b;
    --accent-bg: rgba(22, 48, 59, 0.07);
    --brand: #d4ff3a;
    --brand-text: #0f2129;
    --ok: #3b7a00;
    --warn: #c79300;   --warn-bg: rgba(255, 181, 0, 0.16); /* yellow, still readable as text on white */
    --error: #c62828;  --error-bg: rgba(198, 40, 40, 0.09);
    --warn-row: rgba(255, 181, 0, 0.06);    --warn-border: rgba(176, 116, 0, 0.35);
    --error-row: rgba(198, 40, 40, 0.04);   --error-border: rgba(198, 40, 40, 0.30);
    --field-bg: #ffffff;
    --code-bg: rgba(22, 48, 59, 0.07);
    --pre-bg: #f7f9fb;
    --str: #00727f;
    --shadow: rgba(22, 48, 59, 0.08);
    --glow: transparent;
    --glow-2: transparent;
    --hover-tint: rgba(22, 48, 59, 0.04);
    --loader-track: rgba(22, 48, 59, 0.15);
    --hover: #eff2f6;
    --selected: #e8ecf2;
    --mono: ui-monospace, "Cascadia Code", Consolas, "Courier New", monospace;
    --container: 1120px;
    --gutter: 24px;
}

:root[data-theme="dark"] {
    --bg: #192533;                    /* hsl(212, 34%, 15%) */
    --panel: #23303e;                  /* hsl(212, 28%, 19%) */
    --surface-2: #2d3c4d;              /* hsl(212, 26%, 24%) */
    --border: rgba(255, 255, 255, 0.10);
    --border-strong: rgba(255, 255, 255, 0.22);
    --text: #f1f5f6;
    --text-2: rgba(255, 255, 255, 0.82);
    --muted: rgba(255, 255, 255, 0.65);
    --faint: rgba(255, 255, 255, 0.35);
    --accent: #d4ff3a;                 /* accent used as text */
    --accent-bg: rgba(212, 255, 58, 0.10);
    --brand: #d4ff3a;                  /* lime fill */
    --brand-text: #0f2129;             /* text on a lime fill */
    --ok: #d4ff3a;
    --warn: #ffd166;   --warn-bg: rgba(255, 209, 102, 0.13);
    --error: #ff6b6b;  --error-bg: rgba(255, 107, 107, 0.13);
    --warn-row: rgba(255, 209, 102, 0.05);   --warn-border: rgba(255, 209, 102, 0.35);
    --error-row: rgba(255, 107, 107, 0.05);  --error-border: rgba(255, 107, 107, 0.35);
    --field-bg: #192533;
    --code-bg: rgba(255, 255, 255, 0.07);
    --pre-bg: #0f2129;
    --str: #4fd0e0;
    --shadow: rgba(0, 0, 0, 0.28);
    --glow: rgba(125, 178, 224, 0.10); /* cool blue, NOT lime */
    --glow-2: rgba(125, 178, 224, 0.06);
    --hover-tint: rgba(255, 255, 255, 0.04);
    --loader-track: rgba(212, 255, 58, 0.25);
    --hover: #2d3c4d;
    --selected: #2d3c4d;
}

* {
    box-sizing: border-box;
}

[hidden] {
    display: none !important;
}

html {
    scrollbar-gutter: stable; /* same width with or without a scrollbar, so the header doesn't shift between pages */
}

html,
body {
    margin: 0;
    padding: 0;
    min-height: 100vh;
}

body {
    background-color: var(--bg);
    background-image:
        radial-gradient(circle at 85% 8%, var(--glow) 0%, transparent 45%),
        radial-gradient(circle at 10% 90%, var(--glow-2) 0%, transparent 40%);
    background-attachment: fixed;
    color: var(--text);
    font-family: "Rubik", -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    display: flex;
    flex-direction: column;
    align-items: center;
}

a,
a:visited {
    color: var(--accent);
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

code {
    font-family: var(--mono);
    font-size: 0.92em;
    background: var(--code-bg);
    border-radius: 5px;
    padding: 2px 6px;
}

.material-symbols-outlined {
    font-family: "Material Symbols Outlined";
    font-weight: 400;
    font-style: normal;
    line-height: 1;
    display: inline-block;
    white-space: nowrap;
    direction: ltr;
    -webkit-font-smoothing: antialiased;
}

/* header and footer: flat panels, layout per HEADER-FOOTER.md */

.site-header,
.site-footer {
    width: 100%;
    background: var(--panel);
    line-height: 1.5;
}

.site-header {
    border-bottom: 1px solid var(--border);
}

.site-header__inner {
    max-width: calc(var(--container) + 2 * var(--gutter));
    margin: 0 auto;
    padding: 14px var(--gutter);
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 12px 16px;
}

.site-brand {
    display: inline-flex;
    align-items: center;
}

/* the logo SVG is white artwork: shown as-is on navy, filtered to near-black in light.
   An <img>, not a CSS mask, because browsers block masks on pages opened from file:// */
.site-brand__logo {
    display: block;
    height: 44px;
    width: auto;
    filter: brightness(0) opacity(0.88);
}

:root[data-theme="dark"] .site-brand__logo {
    filter: none;
}

.site-nav {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 4px 6px;
}

.site-nav__link,
.site-nav__link:visited {
    display: inline-flex;
    align-items: center;
    min-height: 44px;
    padding: 0 12px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    color: var(--text-2);
}

.site-nav__link:hover {
    background: var(--hover);
    color: var(--text);
    text-decoration: none;
}

.site-nav__link[aria-current="page"] {
    background: var(--selected);
    color: var(--text);
    font-weight: 600;
}

.site-footer {
    margin-top: auto;
    border-top: 1px solid var(--border);
    font-size: 13px;
    color: var(--muted);
}

.site-footer__inner {
    padding: 14px 32px;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
    align-items: center;
    gap: 12px 16px;
}

.site-footer .theme-toggle {
    grid-column: 1;
    justify-self: start;
}

.site-footer__copy {
    grid-column: 2;
    text-align: center;
}

.site-footer__links {
    grid-column: 3;
    justify-self: end;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: flex-end;
}

.site-footer__links a,
.site-footer__links a:visited {
    display: inline-block;
    padding: 8px 0;
    color: var(--text-2);
}

.site-footer__links a + a::before {
    content: "|";
    margin: 0 0.5em;
    color: var(--muted);
    display: inline-block;
}

.site-footer__links a:hover {
    color: var(--text);
}

/* Light / Dark / Auto */
.theme-toggle {
    display: inline-flex;
    gap: 2px;
    padding: 4px;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: var(--panel);
}

.theme-toggle button {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 7px 12px;
    border: 0;
    border-radius: 8px;
    background: transparent;
    color: var(--text-2);
    font: inherit;
    font-size: 12px;
    cursor: pointer;
}

.theme-toggle .material-symbols-outlined {
    font-size: 16px;
}

.theme-toggle button:hover {
    color: var(--text);
}

.theme-toggle button[aria-pressed="true"] {
    background: var(--surface-2);
    color: var(--text);
}

@media (max-width: 720px) {
    :root {
        --gutter: 16px;
    }

    .site-brand__logo {
        height: 36px;
    }

    .site-footer__inner {
        grid-template-columns: minmax(0, 1fr);
        justify-items: center;
        gap: 4px;
        padding-inline: var(--gutter);
    }

    .site-footer .theme-toggle,
    .site-footer__copy,
    .site-footer__links {
        grid-column: 1;
        justify-self: center;
    }

    .site-footer__links {
        justify-content: center;
    }

    .site-footer__copy {
        order: -1;
    }

    .site-footer .theme-toggle {
        order: 1;
        margin-top: 6px;
    }
}

/* hero */

.eyebrow {
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-size: 12px;
    font-weight: 600;
    color: var(--accent);
    margin: 12px 0 10px;
    text-align: center;
}

h1 {
    font-size: clamp(28px, 5vw, 38px);
    font-weight: 600;
    line-height: 1.15;
    text-align: center;
    margin: 0 0 14px;
}

h1 .dot {
    color: var(--accent);
}

.subtitle {
    color: var(--muted);
    text-align: center;
    font-size: 15px;
    line-height: 1.6;
    max-width: 520px;
    margin: 0 auto 28px;
}

/* panels */

.panel {
    width: 100%;
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: 18px;
    padding: 18px;
    box-shadow: 0 6px 18px var(--shadow);
}

.panel + .panel {
    margin-top: 16px;
}

.panel-title {
    display: block;
    font-size: 13px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--muted);
    margin-bottom: 12px;
}

/* buttons */

.btn {
    appearance: none;
    border: none;
    cursor: pointer;
    background: var(--brand);
    color: var(--brand-text);
    font-family: inherit;
    font-weight: 600;
    font-size: 14px;
    padding: 13px 26px;
    border-radius: 10px;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 8px 20px rgba(212, 255, 58, 0.22);
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.btn-outline {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    background: transparent;
    color: var(--text);
    border: 1px solid var(--border);
    font-weight: 500;
}

.btn-outline:hover {
    transform: none;
    box-shadow: none;
    border-color: var(--accent);
}

.btn-outline:disabled:hover {
    border-color: var(--border);
}

.btn:focus-visible,
button:focus-visible,
a:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

@media (max-width: 560px) {
    .panel {
        border-radius: 14px;
        padding: 14px;
    }
}
