/* IDL Learn – base: design tokens, reset, layout, header. */
:root {
    --brand: #163EC4;
    --brand-dark: #0E2CA0;
    --brand-soft: #EEF3FF;
    --accent: #FFBC00;
    --ok: #059669;
    --ok-soft: #E7F8F1;
    --no: #DC2626;
    --no-soft: #FDECEC;
    --ink: #172036;
    --text: #3C4760;
    --muted: #68758E;
    --line: #E5E9F2;
    --bg: #F5F7FB;
    --card: #FFFFFF;
    --radius: 18px;
    --radius-sm: 12px;
    --shadow: 0 1px 2px rgba(23, 32, 54, .04), 0 12px 32px -22px rgba(23, 32, 54, .32);
    --font: 'Nunito', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
}
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; min-height: 100vh; background: var(--bg); color: var(--text); font: 500 16px/1.55 var(--font); -webkit-font-smoothing: antialiased; }
h1, h2, h3 { margin: 0 0 .4em; color: var(--ink); font-weight: 900; line-height: 1.15; letter-spacing: -0.01em; }
h1 { font-size: clamp(26px, 3.4vw, 38px); }
h2 { font-size: 21px; }
h3 { font-size: 17px; }
p { margin: 0 0 .8em; }
a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }
img, svg { max-width: 100%; }
code { padding: 2px 6px; border-radius: 6px; background: var(--brand-soft); color: var(--brand-dark); font-size: .92em; }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; border-radius: 6px; }
[hidden] { display: none !important; }

.wrap { width: 100%; max-width: 1180px; margin: 0 auto; padding: 0 20px; }
.page { padding-top: 34px; padding-bottom: 72px; }
.page--narrow { max-width: 820px; }
.muted { color: var(--muted); }
.small { font-size: 14px; }
.eyebrow { margin: 0 0 6px; font-size: 12.5px; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; color: var(--brand); }
.skip-link { position: absolute; left: -999px; top: 8px; z-index: 100; padding: 8px 14px; border-radius: 8px; background: var(--ink); color: #fff; }
.skip-link:focus { left: 8px; }

/* ---------- Header ---------- */
.header { position: sticky; top: 0; z-index: 50; background: rgba(255, 255, 255, .92); border-bottom: 1px solid var(--line); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); }
.header__in { display: flex; align-items: center; gap: 22px; min-height: 64px; }
.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--ink); font-weight: 900; font-size: 18px; text-decoration: none !important; }
.brand__mark { display: inline-flex; align-items: center; justify-content: center; width: 40px; height: 40px; border-radius: 12px; background: var(--brand); color: #fff; font-size: 14px; font-weight: 900; letter-spacing: .04em; box-shadow: 0 6px 16px -8px var(--brand); }
.brand__mark--lg { width: 64px; height: 64px; border-radius: 18px; font-size: 20px; margin-bottom: 18px; }
.nav { display: flex; flex-wrap: wrap; gap: 2px; flex: 1; }
.nav__link { padding: 8px 12px; border-radius: 999px; color: var(--text); font-weight: 800; font-size: 15px; text-decoration: none !important; }
.nav__link:hover { background: var(--brand-soft); color: var(--brand-dark); }
.nav__link.is-on { background: var(--brand); color: #fff; }
.user { position: relative; display: flex; align-items: center; gap: 12px; margin-left: auto; }
.user__btn { display: inline-flex; align-items: center; gap: 8px; padding: 4px 12px 4px 4px; border: 1px solid var(--line); border-radius: 999px; background: #fff; cursor: pointer; font-weight: 800; }
.avatar { display: inline-flex; align-items: center; justify-content: center; width: 32px; height: 32px; border-radius: 50%; background: var(--accent); color: #fff; font-weight: 900; }
.user__menu { position: absolute; right: 0; top: calc(100% + 8px); min-width: 220px; padding: 8px; border-radius: 14px; background: #fff; border: 1px solid var(--line); box-shadow: var(--shadow); }
.user__menu a, .user__menu button { display: block; width: 100%; padding: 10px 12px; border: 0; border-radius: 8px; background: none; text-align: left; color: var(--ink); font-weight: 700; cursor: pointer; text-decoration: none; }
.user__menu a:hover, .user__menu button:hover { background: var(--bg); }
.user__role { margin: 4px 12px 8px; font-size: 13px; color: var(--muted); text-transform: capitalize; }
.save-state { font-size: 13px; font-weight: 700; color: var(--muted); }
.save-state.is-off { padding: 4px 10px; border-radius: 999px; background: var(--no-soft); color: var(--no); }

@media (max-width: 900px) {
    .header__in { flex-wrap: wrap; gap: 10px; padding-top: 10px; padding-bottom: 10px; }
    .nav { order: 3; flex-basis: 100%; overflow-x: auto; flex-wrap: nowrap; padding-bottom: 4px; }
    .nav__link { white-space: nowrap; }
    .user__name { display: none; }
}
