/* Shared pieces for every AWS lesson. Load after site.css.
   Category colours are the validated dataviz palette (adjacent-pair CVD safe);
   slots 3-5 sit under 3:1 on white, so every coloured mark also carries a text label. */

:root {
    --maxw: 1120px;
    --cat-general: #2a78d6;
    --cat-compute: #eb6834;
    --cat-memory: #1baf7a;
    --cat-storage: #eda100;
    --cat-accel: #e87ba4;
    --cat-hpc: #6250d6;
    --grid: #e1e0d9;
    --axis: #c3c2b7;
    --dot-muted: #c9c6bd;
}

.c-general { --c: var(--cat-general); }
.c-compute { --c: var(--cat-compute); }
.c-memory  { --c: var(--cat-memory); }
.c-storage { --c: var(--cat-storage); }
.c-accel   { --c: var(--cat-accel); }
.c-hpc     { --c: var(--cat-hpc); }

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

.hero { padding: 52px 0 26px; max-width: 900px; }
.hero h1 { font-size: clamp(32px, 5vw, 52px); line-height: 1.06; letter-spacing: -0.02em; margin: 8px 0 16px; }
.hero .standfirst { font-size: 19px; }
.creed { margin: 26px 0 4px; padding: 18px 20px; border: 1px solid var(--accent-line); background: var(--surface);
    border-radius: 14px; box-shadow: var(--shadow); counter-reset: cr; }
.creed b.h { display: block; font: 650 11px/1.4 var(--mono); letter-spacing: .12em; text-transform: uppercase; color: var(--accent); margin-bottom: 8px; }
.creed ol { margin: 0; padding: 0; list-style: none; }
.creed li { counter-increment: cr; position: relative; padding-left: 34px; margin: 9px 0; font-size: 16.5px; }
.creed li::before { content: counter(cr); position: absolute; left: 0; top: 1px; width: 23px; height: 23px; border-radius: 50%;
    background: var(--accent); color: var(--surface); font: 650 12px/23px var(--mono); text-align: center; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 20px 0 0; padding: 0; list-style: none; }
.chips li { margin: 0; }
.chips a { display: inline-block; padding: 5px 11px; border: 1px solid var(--border); border-radius: 999px;
    font: 13px/1.4 var(--mono); color: var(--muted); text-decoration: none; background: var(--surface); }
.chips a:hover { border-color: var(--accent-line); color: var(--accent); }

/* ---------- sections ---------- */

.chapter { padding-top: 8px; scroll-margin-top: 64px; }
.chapter > h2 { display: flex; align-items: baseline; gap: 12px; }
.chapter > h2 .no { font: 600 13px/1 var(--mono); color: var(--accent); }
.lede { font-size: 17px; color: var(--muted); max-width: 70ch; }
.cols { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 28px; align-items: start; }
@media (max-width: 860px) { .cols { grid-template-columns: 1fr; } }

/* ---------- toolbar (region picker etc.) ---------- */

.toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 18px; padding: 10px 14px; margin: 18px 0 0;
    background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); font-size: 14px; }
.toolbar label { display: inline-flex; align-items: center; gap: 8px; color: var(--muted); }
select, input[type="text"], input[type="number"], input[type="search"] {
    font: 14px/1.2 var(--sans); color: var(--text); background: var(--surface-2); border: 1px solid var(--border-strong);
    border-radius: 8px; padding: 7px 9px; }
input[type="number"] { width: 92px; }
select:focus, input:focus { outline: 2px solid var(--accent-line); outline-offset: 1px; }
.seg { display: inline-flex; border: 1px solid var(--border-strong); border-radius: 999px; overflow: hidden; }
.seg button { border: 0; background: var(--surface-2); color: var(--muted); font: 600 12.5px/1 var(--mono); padding: 8px 12px; cursor: pointer; }
.seg button + button { border-left: 1px solid var(--border-strong); }
.seg button[aria-pressed="true"] { background: var(--accent); color: var(--surface); }
.btn { border: 1px solid var(--border-strong); background: var(--surface-2); color: var(--text); font: 600 13px/1 var(--sans);
    padding: 8px 12px; border-radius: 8px; cursor: pointer; }
.btn:hover { border-color: var(--accent); color: var(--accent); }

/* ---------- figures ---------- */

.figframe { position: relative; border: 1px solid var(--border); border-radius: 14px; overflow: hidden; background: var(--surface);
    box-shadow: var(--shadow); margin: 18px 0 8px; }
.figframe iframe { display: block; width: 100%; border: 0; background: transparent; }
.figcap { font-size: 14px; color: var(--muted); margin: 6px 2px 18px; }
.figcap b { color: var(--text); }

/* ---------- category tag ---------- */

.tag { display: inline-flex; align-items: center; gap: 6px; font: 600 11.5px/1.3 var(--mono); color: var(--text); white-space: nowrap; }
.tag::before { content: ""; width: 9px; height: 9px; border-radius: 2px; background: var(--c); flex: none; }

/* ---------- stat tiles ---------- */

.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; margin: 16px 0; }
.tile { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 12px 14px; }
.tile .k { font: 600 11px/1.3 var(--mono); letter-spacing: .08em; text-transform: uppercase; color: var(--faint); }
.tile .v { font-size: 24px; font-weight: 650; letter-spacing: -0.01em; margin-top: 2px; }
.tile .s { font-size: 13px; color: var(--muted); }

/* ---------- quiz ---------- */

.quiz { counter-reset: q; }
.q { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px 16px; margin: 12px 0; }
.q > p { counter-increment: q; font-weight: 600; margin-bottom: 10px; }
.q > p::before { content: counter(q) ". "; color: var(--accent); font-family: var(--mono); }
.q .opts { display: flex; flex-wrap: wrap; gap: 8px; }
.q .opts button { border: 1px solid var(--border-strong); background: var(--surface-2); color: var(--text); border-radius: 8px;
    padding: 8px 11px; font: 14px/1.3 var(--sans); cursor: pointer; text-align: left; }
.q .opts button:hover { border-color: var(--accent); }
.q .opts button.right { border-color: var(--ok); background: var(--ok-soft); color: var(--ok); font-weight: 600; }
.q .opts button.wrong { border-color: var(--danger); background: var(--danger-soft); color: var(--danger); }
.q .why { display: none; margin: 10px 0 0; font-size: 14.5px; color: var(--muted); }
.q.done .why { display: block; }
.score { font: 600 14px/1 var(--mono); color: var(--accent); }

/* ---------- tooltip ---------- */

.tip { position: fixed; z-index: 50; pointer-events: none; background: var(--surface); color: var(--text); border: 1px solid var(--border-strong);
    border-radius: 8px; box-shadow: var(--shadow); padding: 8px 10px; font-size: 13px; line-height: 1.45; max-width: 280px; display: none; }
.tip b { font-family: var(--mono); }
.tip .m { color: var(--muted); }

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

.lessons { display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); margin: 22px 0; }
.lesson { position: relative; display: flex; flex-direction: column; gap: 6px; padding: 18px 18px 16px; background: var(--surface);
    border: 1px solid var(--border); border-radius: 14px; box-shadow: var(--shadow); text-decoration: none; color: inherit; }
a.lesson:hover { border-color: var(--accent-line); transform: translateY(-1px); }
.lesson .days { font: 600 11px/1.3 var(--mono); letter-spacing: .08em; text-transform: uppercase; color: var(--faint); }
.lesson .t { font-size: 18px; font-weight: 650; letter-spacing: -0.01em; }
.lesson .d { font-size: 14.5px; color: var(--muted); line-height: 1.5; }
.lesson .status { position: absolute; top: 16px; right: 16px; }
.lesson.soon { background: transparent; box-shadow: none; border-style: dashed; }
.lesson.soon .t { color: var(--muted); }
.lesson ul { margin: 6px 0 0; padding-left: 18px; font-size: 14px; color: var(--muted); }
.lesson li { margin: 2px 0; }
