:root {
    --bg: #f5f6fb;
    --surface: #ffffff;
    --surface-soft: #f0f2fa;
    --border: #e2e6f0;
    --text: #202330;
    /* RGAA 3.2/3.3 (WCAG AA): darkened so text meets 4.5:1.
       --muted #616981 ≈ 4.9:1 on the page bg; --primary #625fa0 ≈ 5.9:1 for
       white text on buttons; --primary-dark for hover/emphasis. */
    --muted: #616981;
    --primary: #625fa0;
    --primary-dark: #4f4c83;
    --accent: #eef0fb;
    --success: #2f7d57;
    --shadow: 0 12px 30px rgba(34, 42, 70, 0.08);
    --radius-lg: 22px;
    --radius-md: 16px;
    --radius-sm: 12px;
    --container: 1180px;

    /* Referenced with fallbacks in the planning stylesheets, so the intent was
       quietly evaporating: a card got no shadow, a note got full-strength ink,
       a dashed border got the faint hairline. */
    --shadow-sm: 0 4px 14px rgba(34, 42, 70, 0.06);
    --ink-soft: #3b4054;
    /* A line that carries meaning — the load ceiling, a drop target — has to
       clear 3:1 against the surface behind it. 3.66:1 on white. */
    --line-strong: #7c85a3;

    /* State: what is true. Never identity, never emphasis. Each -ink clears 7:1
       on its own -bg, each -line clears 4.5:1 on white, so a 2px rule reads. */
    --st-ok-bg: #eef7f1;    --st-ok-line: #2f7d57;    --st-ok-ink: #1d5b3d;
    --st-watch-bg: #fdf6e9; --st-watch-line: #8a5a13; --st-watch-ink: #6b4610;
    --st-stop-bg: #fdf1f0;  --st-stop-line: #a3302a;  --st-stop-ink: #8c2620;
    --st-info-bg: #eef0fb;  --st-info-line: #625fa0;  --st-info-ink: #413f70;
}

* {
    box-sizing: border-box;
}

/* Inline line-icons ({% icon %}) — sit on the text baseline, inherit colour. */
.lm-icon {
    display: inline-block;
    vertical-align: -0.15em;
    flex-shrink: 0;
}

html {
    scroll-behavior: smooth;
    /* Kill phantom horizontal scroll (e.g. a few px overflow on some pages) at
       ALL widths. `clip` (not `hidden`) avoids creating a scroll container, so
       it doesn't break the sticky header or vertical scrolling. */
    overflow-x: clip;
}

body {
    margin: 0;
    font-family: "Inter", sans-serif;
    color: var(--text);
    background: linear-gradient(180deg, #f7f8fc 0%, #f3f5fb 100%);
}

a {
    color: inherit;
    text-decoration: none;
}

/* RGAA 10.7 — guarantee a visible keyboard-focus indicator everywhere.
   `:where()` keeps specificity at 0 so richer per-component focus styles still
   win; this is only the safety net for anything that had none. */
:where(a, button, input, select, textarea, summary, [tabindex]):focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
    border-radius: 4px;
}

/* RGAA 12.6/12.7 — skip link: first focusable element, hidden until focused,
   then slides in at the top-left over the header. */
.skip-link {
    position: absolute;
    top: 8px;
    left: 8px;
    z-index: 2000;
    padding: 10px 16px;
    border-radius: 10px;
    background: var(--primary-dark);
    color: #fff;
    font-weight: 700;
    transform: translateY(-150%);
    transition: transform 0.18s ease;
}
.skip-link:focus {
    transform: translateY(0);
    outline: 2px solid #fff;
    outline-offset: 2px;
}
/* Land focus on the main region cleanly when the skip link is used. */
#content:focus { outline: none; }

code {
    background: #eef1f7;
    padding: 2px 6px;
    border-radius: 8px;
    font-size: 0.92em;
}

.container {
    width: min(var(--container), calc(100% - 48px));
    margin: 0 auto;
}

.site-main {
    padding-bottom: 48px;
}

@media (max-width: 700px) {
    .container {
        width: min(var(--container), calc(100% - 28px));
    }
}
/* === Alert messages === */

.alert {
    padding: 14px 18px;
    border-radius: 12px;
    margin-bottom: 22px;
    font-weight: 500;
    border: 1px solid transparent;
}

/* SUCCESS — green */
.alert-success {
    background: #e9f8ef;
    border-color: #b7e6c7;
    color: #1f7a3f;
}

/* ERROR — red */
.alert-error,
.alert-danger {
    background: #fdecec;
    border-color: #f5c2c7;
    color: #a52834;
}

/* WARNING — yellow */
.alert-warning {
    background: #fff8e5;
    border-color: #ffe3a3;
    color: #8a6d1f;
}

/* INFO — blue */
.alert-info {
    background: #eef4ff;
    border-color: #c9d9ff;
    color: #2c4db0;
}

/* === Shared primitives ==================================================
   Small pieces that turned up in markup all over the site while living in a
   component sheet, so a page that wanted one had to load the whole thing:
   `.hero-kicker` pulled 18 KB of hero.css onto twelve pages for one pill, and
   `.grid` — as generic a name as exists — sat in course_components.css. Here
   they cost every page a few lines instead. */

.grid {
    display: grid;
    gap: 24px;
}

.hero-kicker {
    display: inline-flex;
    padding: 8px 12px;
    border-radius: 999px;
    background: var(--accent);
    color: var(--primary-dark);
    font-weight: 800;
    font-size: 0.9rem;
    margin-bottom: 18px;
}

.chip-row {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    align-items: center;
}

.chip {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 40px;
    padding: 10px 14px;
    border-radius: 999px;
    background: var(--surface-soft);
    border: 1px solid var(--border);
    color: var(--muted);
    font-weight: 700;
    transition: 0.2s ease;
    cursor: pointer;
    font-family: inherit;
    font-size: 0.95rem;
    line-height: 1;
    white-space: nowrap;
}

.chip:hover {
    background: #e8ecfb;
    color: var(--primary-dark);
}

.chip.active {
    background: var(--primary);
    border-color: var(--primary);
    color: white;
}

@media (max-width: 700px) {
    .chip-row {
        gap: 8px;
    }

    .chip {
        min-height: 38px;
        padding: 9px 13px;
        font-size: 0.92rem;
    }
}
