/* ============================================================
   Introduction to AI — course stylesheet
   Editorial "book that happens to be alive" layer on top of
   the PrivateBox brand. The page uses the real site navbar and
   footer (tokens.css / pb-chrome.css / footer.css); this file
   styles everything inside the course itself.
   ============================================================ */

:root {
    --paper: #faf9f6;
    --paper-deep: #f4f2ec;
    --course-ink: #171513;
    --ink-soft: #4b5563;
    --ink-faint: #8a8578;
    --accent: #2563eb;
    --accent-soft: rgba(37, 99, 235, 0.08);
    --bronze: #9a7b3f;
    --bronze-soft: rgba(154, 123, 63, 0.1);
    --good: #047857;
    --bad: #b42318;
    --course-line: rgba(23, 21, 19, 0.09);
    --line-soft: rgba(23, 21, 19, 0.05);
    --serif: 'Iowan Old Style', 'Palatino Linotype', Palatino, Georgia, 'Times New Roman', serif;
    --sans: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --measure: 68ch;
    --ease: cubic-bezier(0.16, 1, 0.3, 1);
}

html {
    scroll-behavior: smooth;
}

body.course-page {
    background: var(--paper);
    color: var(--course-ink);
    font-family: var(--sans);
    font-size: 1.0625rem;
    line-height: 1.65;
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
}

body.course-page ::selection {
    background: rgba(37, 99, 235, 0.16);
}

/* The [hidden] attribute must always win, even over classes that set
   an explicit display (e.g. .course-btn's inline-flex). */
body.course-page [hidden] {
    display: none !important;
}

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

.course-main img { max-width: 100%; height: auto; display: block; }

/* Mobile reading-progress bar, tucked under the site navbar */
.mobile-progress {
    position: fixed;
    top: 64px;
    left: 0;
    right: 0;
    z-index: 89;
    height: 3px;
    background: var(--line-soft);
    display: none;
}

.mobile-progress-fill {
    height: 100%;
    width: 0%;
    background: var(--accent);
    transition: width 0.2s linear;
}

/* ─── Journey rail / course contents (desktop) ─────────── */
.journey-rail {
    position: fixed;
    top: 50%;
    left: clamp(0.75rem, 1.6vw, 1.75rem);
    transform: translateY(-50%);
    z-index: 80;
    display: flex;
    flex-direction: column;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.6s var(--ease);
}

.journey-rail.is-visible {
    opacity: 1;
    pointer-events: auto;
}

.rail-title {
    font-size: 0.64rem;
    font-weight: 800;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: var(--ink-faint);
    margin: 0 0 0.7rem 2px;
}

.rail-track {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 0.55rem;
}

.rail-line {
    position: absolute;
    left: 12px;
    top: 13px;
    bottom: 13px;
    width: 2px;
    background: var(--course-line);
    border-radius: 2px;
}

.rail-fill {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 0%;
    background: var(--accent);
    border-radius: 2px;
    transition: height 0.2s linear;
}

.rail-node {
    position: relative;
    z-index: 2;
    display: flex;
    align-items: center;
    gap: 0.65rem;
    background: none;
    border: none;
    padding: 0;
    margin: 0;
    cursor: pointer;
    font-family: var(--sans);
    text-align: left;
}

.rail-dot {
    flex: none;
    width: 26px;
    height: 26px;
    border-radius: 50%;
    border: 2px solid var(--course-line);
    background: var(--paper);
    color: var(--ink-faint);
    font-size: 0.62rem;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: border-color 0.3s, color 0.3s, background 0.3s, transform 0.2s;
}

.rail-label {
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--ink-faint);
    white-space: nowrap;
    max-width: 168px;
    overflow: hidden;
    text-overflow: ellipsis;
    transition: color 0.3s;
}

.rail-node:hover .rail-dot { transform: scale(1.12); border-color: var(--accent); color: var(--accent); }
.rail-node:hover .rail-label { color: var(--course-ink); }

.rail-node.is-current .rail-dot {
    border-color: var(--accent);
    color: var(--accent);
    box-shadow: 0 0 0 4px var(--accent-soft);
}

.rail-node.is-current .rail-label { color: var(--course-ink); }

.rail-node.is-done .rail-dot {
    background: var(--good);
    border-color: var(--good);
    color: #fff;
}

.rail-cards {
    margin: 0.9rem 0 0 2px;
    font-size: 0.68rem;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    color: var(--bronze);
    background: var(--bronze-soft);
    border-radius: 999px;
    padding: 0.28rem 0.6rem;
    white-space: nowrap;
    align-self: flex-start;
}

/* Titles only when there is comfortable room; dots-only in between */
@media (max-width: 1439px) {
    .rail-label, .rail-title { display: none; }
}

@media (max-width: 1199px) {
    .journey-rail { display: none; }
    .mobile-progress { display: block; }
}

/* ─── Page structure ───────────────────────────────────── */
.course-main {
    padding-top: 64px;
}

.lesson,
.course-hero,
.course-finale {
    position: relative;
    padding: 0 1.5rem;
}

.lesson-inner {
    max-width: 760px;
    margin: 0 auto;
    padding: 4.5rem 0 3rem;
}

/* Inline links: bold ink, no underline; the shift to blue on hover
   is the affordance */
.prose a,
.go-deeper-body a,
.widget-feedback a,
.finale-block a,
.inpractice a,
.try-real a,
.storage-note a {
    color: var(--course-ink);
    font-weight: 700;
    text-decoration: none;
    transition: color 0.2s;
}

.prose a:hover,
.go-deeper-body a:hover,
.widget-feedback a:hover,
.finale-block a:hover,
.inpractice a:hover,
.try-real a:hover,
.storage-note a:hover {
    color: var(--accent);
}

/* Prose */
.prose > p,
.prose > ul,
.prose > ol {
    max-width: var(--measure);
    margin-bottom: 1.35rem;
    color: #33302b;
}

.prose > ul, .prose > ol { padding-left: 1.3rem; }
.prose li { margin-bottom: 0.5rem; }
.prose li::marker { color: var(--accent); }

.prose strong { color: var(--course-ink); font-weight: 700; }

.prose h3 {
    font-family: var(--serif);
    font-size: 1.45rem;
    font-weight: 600;
    letter-spacing: -0.01em;
    line-height: 1.3;
    margin: 3rem 0 1rem;
    max-width: var(--measure);
}

.prose h3 .beat-num {
    color: var(--accent);
    font-family: var(--sans);
    font-size: 0.8rem;
    font-weight: 800;
    letter-spacing: 0.12em;
    display: block;
    margin-bottom: 0.35rem;
}

/* ─── Chapter frontispiece ─────────────────────────────── */
.frontispiece {
    padding-top: 5rem;
    margin-bottom: 2.5rem;
}

.chapter-plate {
    position: relative;
    border-radius: 20px;
    overflow: hidden;
    background: var(--paper-deep);
    border: 1px solid var(--line-soft);
    margin-bottom: 2.25rem;
}

.chapter-plate svg { width: 100%; height: auto; display: block; }

.chapter-meta {
    display: flex;
    align-items: baseline;
    gap: 1.5rem;
}

.chapter-num {
    font-family: var(--serif);
    font-size: clamp(4rem, 8vw, 6.5rem);
    font-weight: 400;
    line-height: 0.9;
    color: var(--accent);
    flex: none;
}

.chapter-kicker {
    font-size: 0.75rem;
    font-weight: 800;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: var(--ink-faint);
    margin-bottom: 0.6rem;
}

.lesson-title {
    font-family: var(--serif);
    font-size: clamp(1.9rem, 4vw, 2.7rem);
    font-weight: 600;
    letter-spacing: -0.015em;
    line-height: 1.15;
    margin-bottom: 0.75rem;
}

.lesson-promise {
    font-size: 1.02rem;
    color: var(--ink-soft);
    font-style: italic;
    max-width: 55ch;
}

/* ─── Hook block ───────────────────────────────────────── */
.hook {
    border-left: 3px solid var(--accent);
    padding: 0.35rem 0 0.35rem 1.4rem;
    margin: 0 0 2rem;
    max-width: var(--measure);
}

.hook p {
    font-family: var(--serif);
    font-size: 1.28rem;
    line-height: 1.5;
    color: var(--course-ink);
}

/* ─── Pull quotes / intern motif ───────────────────────── */
.pullquote {
    max-width: 34rem;
    margin: 3rem auto;
    text-align: center;
    position: relative;
    padding: 0 1rem;
}

.pullquote p {
    font-family: var(--serif);
    font-size: clamp(1.35rem, 2.6vw, 1.7rem);
    line-height: 1.45;
    color: var(--course-ink);
}

.pullquote p em { color: var(--accent); font-style: italic; }

.pullquote .pullquote-mark {
    font-family: var(--serif);
    font-size: 3.4rem;
    line-height: 1;
    color: var(--accent);
    display: block;
    margin-bottom: 0.25rem;
}

.pullquote cite {
    display: block;
    margin-top: 0.9rem;
    font-family: var(--sans);
    font-style: normal;
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--ink-faint);
}

/* ─── Widget cards ─────────────────────────────────────── */
.widget-card {
    background: #fff;
    border: 1px solid var(--line-soft);
    border-radius: 18px;
    box-shadow: 0 4px 18px rgba(23, 21, 19, 0.04);
    padding: 1.8rem;
    margin: 2.25rem 0;
    max-width: 760px;
}

.widget-kicker {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    font-size: 0.7rem;
    font-weight: 800;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--accent);
    margin-bottom: 0.7rem;
}

.widget-kicker::before {
    content: '';
    width: 7px; height: 7px;
    border-radius: 50%;
    background: var(--accent);
}

.widget-title {
    font-family: var(--serif);
    font-size: 1.3rem;
    font-weight: 600;
    margin-bottom: 0.4rem;
}

.widget-sub {
    font-size: 0.95rem;
    color: var(--ink-soft);
    margin-bottom: 1.25rem;
    max-width: 60ch;
}

/* generic option buttons used by several widgets */
.opt-btn {
    display: block;
    width: 100%;
    text-align: left;
    font-family: var(--sans);
    font-size: 0.98rem;
    font-weight: 500;
    color: var(--course-ink);
    background: var(--paper);
    border: 1.5px solid var(--course-line);
    border-radius: 12px;
    padding: 0.85rem 1.1rem;
    margin-bottom: 0.6rem;
    cursor: pointer;
    transition: border-color 0.2s, background 0.2s, transform 0.15s;
}

.opt-btn:hover { border-color: var(--accent); background: #fff; }

.opt-btn.is-picked {
    border-color: var(--accent);
    background: var(--accent-soft);
}

.opt-btn.is-right { border-color: var(--good); background: rgba(4, 120, 87, 0.07); }
.opt-btn.is-wrong { border-color: var(--bad); background: rgba(180, 35, 24, 0.06); }

.opt-btn:disabled { cursor: default; opacity: 0.9; }

.widget-feedback {
    font-size: 0.95rem;
    line-height: 1.55;
    border-radius: 12px;
    padding: 0.9rem 1.1rem;
    margin-top: 0.9rem;
    background: var(--paper-deep);
    border: 1px solid var(--line-soft);
    color: #33302b;
}

.widget-feedback.is-good { border-color: rgba(4, 120, 87, 0.35); background: rgba(4, 120, 87, 0.06); }
.widget-feedback.is-bad { border-color: rgba(180, 35, 24, 0.3); background: rgba(180, 35, 24, 0.05); }

.widget-note {
    font-size: 0.82rem;
    color: var(--ink-faint);
    margin-top: 0.9rem;
}

/* probability bars (be-the-model) */
.prob-list { margin-top: 1.4rem; }

.prob-row {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    margin-bottom: 0.55rem;
}

.prob-token {
    flex: none;
    width: 9.5rem;
    font-weight: 600;
    font-size: 0.95rem;
}

.prob-bar {
    flex: 1;
    height: 12px;
    background: var(--paper-deep);
    border-radius: 999px;
    overflow: hidden;
}

.prob-bar-fill {
    height: 100%;
    width: 0%;
    border-radius: 999px;
    background: var(--accent);
    transition: width 0.9s var(--ease);
}

.prob-pct {
    flex: none;
    width: 3.2rem;
    text-align: right;
    font-variant-numeric: tabular-nums;
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--ink-soft);
}

.model-sentence {
    font-family: var(--serif);
    font-size: 1.3rem;
    margin-bottom: 1.2rem;
}

.model-sentence .blank {
    display: inline-block;
    min-width: 5.5rem;
    border-bottom: 2px solid var(--accent);
    color: var(--accent);
    text-align: center;
    font-style: italic;
}

.token-choices {
    display: flex;
    flex-wrap: wrap;
    gap: 0.6rem;
    margin-bottom: 0.4rem;
}

.token-chip {
    font-family: var(--sans);
    font-size: 0.95rem;
    font-weight: 600;
    background: var(--paper);
    color: var(--course-ink);
    border: 1.5px solid var(--course-line);
    border-radius: 999px;
    padding: 0.5rem 1.1rem;
    cursor: pointer;
    transition: border-color 0.2s, background 0.2s, transform 0.15s;
}

.token-chip:hover { border-color: var(--accent); transform: translateY(-1px); }
.token-chip.is-picked { border-color: var(--accent); background: var(--accent-soft); }
.token-chip:disabled { cursor: default; opacity: 0.75; }

/* temperature toy */
.temp-slider-row {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin: 1.1rem 0;
}

.temp-slider-row label {
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--ink-faint);
    white-space: nowrap;
}

input[type="range"].temp-slider {
    flex: 1;
    accent-color: var(--accent);
    height: 28px;
}

.temp-output {
    font-family: var(--serif);
    font-size: 1.15rem;
    line-height: 1.55;
    background: var(--paper-deep);
    border-radius: 12px;
    padding: 1.1rem 1.3rem;
    min-height: 5.2rem;
}

.temp-label-chip {
    display: inline-block;
    font-family: var(--sans);
    font-size: 0.7rem;
    font-weight: 800;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--accent);
    margin-bottom: 0.45rem;
}

/* case file (spot the hallucination) */
.casefile {
    background: #fff;
    border: 1px solid var(--course-line);
    border-radius: 4px;
    padding: 1.6rem 1.7rem;
    font-family: var(--serif);
    font-size: 1.05rem;
    line-height: 1.8;
    position: relative;
    box-shadow: 2px 3px 0 var(--paper-deep);
}

.casefile::before {
    content: 'AI OUTPUT · UNDER REVIEW';
    position: absolute;
    top: -0.7rem;
    left: 1.2rem;
    font-family: var(--sans);
    font-size: 0.62rem;
    font-weight: 800;
    letter-spacing: 0.14em;
    color: var(--bad);
    background: var(--paper);
    border: 1px solid rgba(180, 35, 24, 0.35);
    border-radius: 4px;
    padding: 0.2rem 0.55rem;
}

.claim {
    background: transparent;
    border: none;
    border-bottom: 2px dotted rgba(37, 99, 235, 0.45);
    font: inherit;
    color: inherit;
    cursor: pointer;
    padding: 0 1px;
    transition: background 0.2s;
}

.claim:hover { background: var(--accent-soft); }
.claim.is-flagged-bad { background: rgba(180, 35, 24, 0.12); border-bottom-color: var(--bad); text-decoration: line-through; text-decoration-color: rgba(180, 35, 24, 0.55); text-decoration-thickness: 1.5px; }
.claim.is-flagged-good { background: rgba(4, 120, 87, 0.1); border-bottom-color: var(--good); }

.casefile-verdicts { margin-top: 1.2rem; }

.verdict {
    display: none;
    font-family: var(--sans);
    font-size: 0.9rem;
    line-height: 1.5;
    padding: 0.7rem 1rem;
    border-radius: 10px;
    margin-bottom: 0.5rem;
}

.verdict.is-shown { display: block; }
.verdict.is-bad { background: rgba(180, 35, 24, 0.06); border: 1px solid rgba(180, 35, 24, 0.25); }
.verdict.is-good { background: rgba(4, 120, 87, 0.06); border: 1px solid rgba(4, 120, 87, 0.25); }

/* overloaded desk (context rot) */
.desk-stage {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 130px;
    gap: 1.2rem;
    align-items: stretch;
}

.desk-chat {
    background: var(--paper-deep);
    border-radius: 12px;
    padding: 1rem;
    height: 300px;
    overflow: hidden;
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
}

.desk-msg {
    background: #fff;
    border: 1px solid var(--line-soft);
    border-radius: 10px;
    font-size: 0.82rem;
    padding: 0.5rem 0.75rem;
    margin-top: 0.45rem;
    color: var(--ink-soft);
    flex: none;
    animation: desk-in 0.35s var(--ease);
}

@keyframes desk-in {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}

.desk-msg.is-key {
    border-color: var(--accent);
    color: var(--course-ink);
    font-weight: 600;
}

.desk-msg.is-faded { opacity: 0.35; filter: blur(0.4px); }

.focus-meter {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-end;
    gap: 0.5rem;
}

.focus-dial {
    width: 100%;
    height: 210px;
    border-radius: 12px;
    background: linear-gradient(to top, rgba(180, 35, 24, 0.14), rgba(234, 179, 8, 0.14), rgba(4, 120, 87, 0.16));
    border: 1px solid var(--line-soft);
    position: relative;
    overflow: hidden;
}

.focus-needle {
    position: absolute;
    left: 6px;
    right: 6px;
    height: 4px;
    border-radius: 4px;
    background: var(--course-ink);
    top: 8%;
    transition: top 0.6s var(--ease);
}

.focus-caption {
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--ink-faint);
    text-align: center;
}

.desk-controls {
    display: flex;
    flex-wrap: wrap;
    gap: 0.6rem;
    margin-top: 1.1rem;
}

/* buttons */
.course-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    font-family: var(--sans);
    font-size: 0.92rem;
    font-weight: 700;
    color: #fff;
    background: var(--accent);
    border: none;
    border-radius: 10px;
    padding: 0.7rem 1.4rem;
    cursor: pointer;
    text-decoration: none;
    transition: background 0.2s, transform 0.15s;
}

.course-btn:hover { background: #1d4ed8; transform: translateY(-1px); }

.course-btn.is-ghost {
    background: transparent;
    color: var(--accent);
    border: 1.5px solid rgba(37, 99, 235, 0.35);
}

.course-btn.is-ghost:hover { background: var(--accent-soft); }

.course-btn.is-quiet {
    background: transparent;
    color: var(--ink-soft);
    border: 1.5px solid var(--course-line);
}

.course-btn.is-quiet:hover { background: var(--paper-deep); color: var(--course-ink); transform: none; }

.course-btn:disabled { opacity: 0.5; cursor: default; transform: none; }

/* interrogation room */
.frame-toggle {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1rem;
    flex-wrap: wrap;
}

.frame-toggle .frame-btn {
    flex: 1;
    min-width: 200px;
    font-family: var(--sans);
    font-size: 0.88rem;
    font-weight: 600;
    padding: 0.75rem 1rem;
    border-radius: 10px;
    border: 1.5px solid var(--course-line);
    background: var(--paper);
    cursor: pointer;
    transition: border-color 0.2s, background 0.2s;
    text-align: left;
}

.frame-btn[aria-pressed="true"] {
    border-color: var(--accent);
    background: var(--accent-soft);
}

.frame-answer {
    background: var(--paper-deep);
    border-radius: 12px;
    padding: 1.1rem 1.3rem;
    font-size: 0.97rem;
    line-height: 1.6;
    min-height: 9rem;
}

.frame-answer .frame-tag {
    display: inline-block;
    font-size: 0.68rem;
    font-weight: 800;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    margin-bottom: 0.5rem;
}

.frame-answer.is-echo .frame-tag { color: var(--bad); }
.frame-answer.is-honest .frame-tag { color: var(--good); }

/* green light / red light + match */
.gl-scenario {
    font-family: var(--serif);
    font-size: 1.25rem;
    line-height: 1.45;
    min-height: 4.6rem;
    margin-bottom: 1.1rem;
}

.gl-buttons { display: flex; gap: 0.7rem; flex-wrap: wrap; }

.gl-btn {
    flex: 1;
    min-width: 130px;
    font-family: var(--sans);
    font-weight: 700;
    font-size: 0.95rem;
    padding: 0.85rem 1rem;
    border-radius: 12px;
    cursor: pointer;
    border: 1.5px solid var(--course-line);
    background: var(--paper);
    transition: transform 0.15s, border-color 0.2s, background 0.2s;
}

.gl-btn:hover { transform: translateY(-1px); }
.gl-btn.gl-go { color: var(--good); }
.gl-btn.gl-go:hover { border-color: var(--good); background: rgba(4, 120, 87, 0.06); }
.gl-btn.gl-stop { color: var(--bad); }
.gl-btn.gl-stop:hover { border-color: var(--bad); background: rgba(180, 35, 24, 0.05); }
.gl-btn:disabled { cursor: default; opacity: 0.6; transform: none; }

.gl-progress {
    font-size: 0.8rem;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    color: var(--ink-faint);
    margin-bottom: 0.8rem;
}

.gl-next { margin-top: 1rem; }

/* prompt workbench */
.workbench-prompt {
    font-family: ui-monospace, 'SF Mono', SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 0.88rem;
    line-height: 1.65;
    background: #1c1a17;
    color: #f2efe8;
    border-radius: 12px;
    padding: 1.2rem 1.4rem;
    margin-bottom: 1.1rem;
    white-space: pre-wrap;
    word-break: break-word;
}

.workbench-prompt .wb-add { color: #8ab4ff; }

.wb-steps { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-bottom: 1.1rem; }

.wb-step {
    font-family: var(--sans);
    font-size: 0.82rem;
    font-weight: 700;
    padding: 0.55rem 1rem;
    border-radius: 999px;
    border: 1.5px solid var(--course-line);
    background: var(--paper);
    cursor: pointer;
    transition: border-color 0.2s, background 0.2s;
}

.wb-step:hover { border-color: var(--accent); }
.wb-step.is-added { border-color: var(--accent); background: var(--accent-soft); color: var(--accent); cursor: default; }

.wb-quality {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    margin-bottom: 1rem;
}

.wb-quality-label {
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--ink-faint);
    white-space: nowrap;
}

.wb-quality-bar {
    flex: 1;
    height: 10px;
    border-radius: 999px;
    background: var(--paper-deep);
    overflow: hidden;
}

.wb-quality-fill {
    height: 100%;
    width: 10%;
    background: linear-gradient(to right, #b42318, #d97706, #047857);
    background-size: 400px 100%;
    border-radius: 999px;
    transition: width 0.7s var(--ease);
}

.wb-quality-word {
    font-size: 0.85rem;
    font-weight: 700;
    width: 8.5rem;
    color: var(--ink-soft);
}

.wb-preview {
    background: var(--paper-deep);
    border-radius: 12px;
    padding: 1.1rem 1.3rem;
    font-size: 0.95rem;
    line-height: 1.6;
    margin-bottom: 1.1rem;
    min-height: 7rem;
}

.wb-preview .wb-preview-tag {
    display: block;
    font-size: 0.68rem;
    font-weight: 800;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--ink-faint);
    margin-bottom: 0.5rem;
}

/* match the tool to the job */
.match-task {
    font-family: var(--serif);
    font-size: 1.2rem;
    min-height: 3.4rem;
    margin-bottom: 1rem;
}

.match-buttons { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 0.6rem; }

/* ask the documents */
.docdemo-questions { display: flex; flex-direction: column; gap: 0.5rem; margin-bottom: 1.1rem; }

.docdemo-window {
    border: 1px solid var(--course-line);
    border-radius: 14px;
    overflow: hidden;
    background: #fff;
}

.docdemo-titlebar {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: var(--paper-deep);
    border-bottom: 1px solid var(--line-soft);
    padding: 0.55rem 1rem;
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--ink-faint);
}

.docdemo-titlebar::before {
    content: '';
    width: 8px; height: 8px;
    border-radius: 50%;
    background: var(--accent);
    opacity: 0.65;
}

.docdemo-body { padding: 1.2rem 1.3rem; font-size: 0.95rem; line-height: 1.65; min-height: 10rem; }

.docdemo-source {
    margin-top: 0.9rem;
    background: rgba(37, 99, 235, 0.05);
    border-left: 3px solid var(--accent);
    border-radius: 0 10px 10px 0;
    padding: 0.7rem 1rem;
    font-size: 0.85rem;
    color: #33302b;
}

.docdemo-source .src-label {
    display: block;
    font-size: 0.66rem;
    font-weight: 800;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--accent);
    margin-bottom: 0.3rem;
}

.docdemo-toggle-row { margin-top: 1rem; display: flex; align-items: center; gap: 0.7rem; flex-wrap: wrap; }

/* ─── In practice today (mitigation cards) ─────────────── */
.inpractice {
    background: linear-gradient(140deg, #f7faf7, #f1f6f2);
    border: 1px solid rgba(4, 120, 87, 0.22);
    border-radius: 16px;
    padding: 1.5rem 1.7rem;
    margin: 2.25rem 0;
    max-width: 760px;
}

.inpractice-kicker {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    font-size: 0.7rem;
    font-weight: 800;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--good);
    margin-bottom: 0.6rem;
}

.inpractice-kicker::before {
    content: '✓';
    font-size: 0.8rem;
}

.inpractice h4 {
    font-family: var(--serif);
    font-size: 1.18rem;
    font-weight: 600;
    margin-bottom: 0.55rem;
    color: var(--course-ink);
}

.inpractice p {
    font-size: 0.95rem;
    line-height: 1.6;
    color: #33302b;
    max-width: 62ch;
    margin-bottom: 0.8rem;
}

.inpractice p:last-child { margin-bottom: 0; }

.inpractice .ip-still {
    font-weight: 700;
    color: var(--course-ink);
}

/* ─── Try it for real ──────────────────────────────────── */
.try-real {
    background: var(--paper-deep);
    border: 1px dashed rgba(23, 21, 19, 0.18);
    border-radius: 14px;
    padding: 1.4rem 1.5rem;
    margin: 2.25rem 0;
    max-width: 760px;
}

.try-real-kicker {
    font-size: 0.7rem;
    font-weight: 800;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--bronze);
    margin-bottom: 0.6rem;
}

.try-real p { font-size: 0.97rem; color: #33302b; margin-bottom: 0.9rem; max-width: 62ch; }

.try-real-prompt {
    display: flex;
    align-items: flex-start;
    gap: 0.8rem;
    background: #fff;
    border: 1px solid var(--line-soft);
    border-radius: 10px;
    padding: 0.85rem 1rem;
    margin-bottom: 0.6rem;
}

.try-real-prompt code {
    font-family: ui-monospace, 'SF Mono', SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 0.85rem;
    line-height: 1.55;
    color: var(--course-ink);
    flex: 1;
    white-space: pre-wrap;
}

.copy-btn {
    flex: none;
    font-family: var(--sans);
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--accent);
    background: var(--accent-soft);
    border: none;
    border-radius: 7px;
    padding: 0.4rem 0.75rem;
    cursor: pointer;
    transition: background 0.2s;
}

.copy-btn:hover { background: rgba(37, 99, 235, 0.15); }
.copy-btn.is-copied { color: var(--good); background: rgba(4, 120, 87, 0.1); }

/* ─── Go deeper ────────────────────────────────────────── */
.go-deeper {
    border: 1px solid var(--line-soft);
    border-radius: 14px;
    margin: 2rem 0;
    max-width: 760px;
    background: #fff;
    overflow: hidden;
}

.go-deeper summary {
    list-style: none;
    display: flex;
    align-items: center;
    gap: 0.7rem;
    padding: 1rem 1.4rem;
    cursor: pointer;
    font-weight: 700;
    font-size: 0.95rem;
    color: var(--course-ink);
}

.go-deeper summary::-webkit-details-marker { display: none; }

.go-deeper summary::before {
    content: '+';
    font-family: var(--serif);
    font-size: 1.3rem;
    color: var(--accent);
    line-height: 1;
    transition: transform 0.3s var(--ease);
}

.go-deeper[open] summary::before { content: '−'; }

.go-deeper summary .gd-tag {
    margin-left: auto;
    font-size: 0.68rem;
    font-weight: 800;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--ink-faint);
}

.go-deeper-body { padding: 0 1.4rem 1.3rem; }
.go-deeper-body p { font-size: 0.95rem; color: #33302b; margin-bottom: 0.9rem; max-width: 62ch; }
.go-deeper-body p:last-child { margin-bottom: 0; }

/* ─── Margin notes (factlets + mini dictionary) ────────── */
.margin-note {
    font-size: 0.82rem;
    line-height: 1.55;
    color: var(--ink-soft);
}

.margin-note .mn-term {
    display: block;
    font-weight: 800;
    font-size: 0.72rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--bronze);
    margin-bottom: 0.25rem;
}

@media (min-width: 1450px) {
    .lesson-body { position: relative; }
    .margin-note {
        position: absolute;
        right: -260px;
        width: 220px;
        border-top: 2px solid var(--bronze);
        padding-top: 0.6rem;
    }
    .margin-note .mn-num {
        font-weight: 800;
        color: var(--bronze);
        margin-right: 0.3rem;
    }
}

@media (max-width: 1449px) {
    .margin-note {
        display: block;
        border-left: 2px solid var(--bronze);
        background: var(--bronze-soft);
        border-radius: 0 10px 10px 0;
        padding: 0.7rem 1rem;
        margin: 1.5rem 0;
        max-width: 34rem;
    }
    .margin-note .mn-num { font-weight: 800; color: var(--bronze); margin-right: 0.3rem; }
}

/* ─── Checkpoint quiz ──────────────────────────────────── */
.checkpoint {
    background: #fff;
    border: 1px solid var(--line-soft);
    border-top: 3px solid var(--accent);
    border-radius: 16px;
    padding: 1.8rem;
    margin: 2.5rem 0 1.5rem;
    max-width: 760px;
    box-shadow: 0 4px 18px rgba(23, 21, 19, 0.04);
}

.checkpoint-kicker {
    font-size: 0.7rem;
    font-weight: 800;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--accent);
    margin-bottom: 0.4rem;
}

.checkpoint-q {
    font-family: var(--serif);
    font-size: 1.2rem;
    line-height: 1.4;
    margin-bottom: 1rem;
}

.checkpoint-progress {
    font-size: 0.78rem;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    color: var(--ink-faint);
    margin-bottom: 0.9rem;
}

.checkpoint-done {
    display: flex;
    align-items: center;
    gap: 0.7rem;
    font-weight: 700;
    color: var(--good);
    font-size: 1rem;
}

.checkpoint-done .tick {
    flex: none;
    width: 26px; height: 26px;
    border-radius: 50%;
    background: var(--good);
    color: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
}

/* ─── Take-away card ───────────────────────────────────── */
.takeaway {
    position: relative;
    max-width: 620px;
    margin: 2.5rem auto 0;
    background: linear-gradient(140deg, #fffdf8, #faf5ea);
    border: 1px solid rgba(154, 123, 63, 0.35);
    border-radius: 16px;
    padding: 1.7rem 1.9rem 1.5rem;
    box-shadow: 0 10px 30px rgba(154, 123, 63, 0.08);
}

.takeaway::before {
    content: '';
    position: absolute;
    top: 10px; left: 10px; right: 10px; bottom: 10px;
    border: 1px solid rgba(154, 123, 63, 0.22);
    border-radius: 10px;
    pointer-events: none;
}

.takeaway-kicker {
    font-size: 0.68rem;
    font-weight: 800;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: var(--bronze);
    margin-bottom: 0.7rem;
}

.takeaway p {
    font-family: var(--serif);
    font-size: 1.22rem;
    line-height: 1.5;
    color: #3d3425;
}

/* ─── Course hero (Lesson 0) ───────────────────────────── */
.course-hero { padding-top: 2rem; }

.course-hero-inner {
    max-width: 860px;
    margin: 0 auto;
    padding: 4.5rem 0 2rem;
    text-align: center;
}

.course-hero .widget-card {
    margin-left: auto;
    margin-right: auto;
}

.hero-actions {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.8rem;
    flex-wrap: wrap;
    margin-top: 1rem;
}

.course-hero .hero-kicker {
    display: inline-block;
    font-size: 0.75rem;
    font-weight: 800;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: var(--accent);
    background: var(--accent-soft);
    border-radius: 999px;
    padding: 0.5rem 1.1rem;
    margin-bottom: 1.6rem;
}

.course-hero h1 {
    font-family: var(--serif);
    font-size: clamp(2.6rem, 6vw, 4.2rem);
    font-weight: 600;
    letter-spacing: -0.02em;
    line-height: 1.08;
    margin-bottom: 1.2rem;
}

.course-hero .hero-promise {
    font-size: clamp(1.05rem, 2vw, 1.25rem);
    color: var(--ink-soft);
    max-width: 46ch;
    margin: 0 auto 1.4rem;
}

.hero-facts {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.5rem 1.6rem;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--ink-faint);
    margin-bottom: 1rem;
}

.hero-facts span { display: inline-flex; align-items: center; gap: 0.4rem; }
.hero-facts span::before { content: '·'; color: var(--bronze); font-weight: 800; }
.hero-facts span:first-child::before { content: none; }

.storage-note {
    font-size: 0.8rem;
    color: var(--ink-faint);
    max-width: 52ch;
    margin: 0 auto 2.2rem;
}

/* syllabus */
.syllabus {
    text-align: left;
    max-width: 640px;
    margin: 2.5rem auto;
    border: 1px solid var(--line-soft);
    border-radius: 16px;
    background: #fff;
    overflow: hidden;
}

.syllabus li {
    list-style: none;
    display: flex;
    align-items: baseline;
    gap: 1rem;
    padding: 0.95rem 1.4rem;
    border-bottom: 1px solid var(--line-soft);
    font-size: 0.97rem;
}

.syllabus li:last-child { border-bottom: none; }

.syllabus .syl-num {
    flex: none;
    font-family: var(--serif);
    font-size: 1.1rem;
    color: var(--accent);
    width: 1.4rem;
    text-align: right;
}

.syllabus .syl-title { font-weight: 700; margin-right: 0.35rem; }
.syllabus .syl-payoff { color: var(--ink-soft); }

/* welcome back banner */
.welcome-back {
    display: none;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    flex-wrap: wrap;
    background: var(--accent-soft);
    border: 1px solid rgba(37, 99, 235, 0.2);
    border-radius: 14px;
    padding: 0.9rem 1.4rem;
    margin: 0 auto 2rem;
    max-width: 640px;
    font-size: 0.95rem;
    font-weight: 600;
}

.welcome-back.is-shown { display: flex; }

/* ─── Finale ───────────────────────────────────────────── */
.course-finale .lesson-inner { padding-bottom: 5rem; }

.final-progress {
    font-size: 0.85rem;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    color: var(--ink-faint);
    margin-bottom: 1rem;
}

.final-result {
    text-align: center;
    padding: 1.5rem;
}

.final-score {
    font-family: var(--serif);
    font-size: 3.2rem;
    color: var(--accent);
    font-variant-numeric: tabular-nums;
}

/* finale blocks: certificate, results, shelf, what's next */
.finale-block {
    background: #fff;
    border: 1px solid var(--line-soft);
    border-radius: 18px;
    padding: 2rem;
    margin: 2.5rem 0;
    max-width: 760px;
    box-shadow: 0 4px 18px rgba(23, 21, 19, 0.04);
}

.finale-block > h3 {
    font-family: var(--serif);
    font-size: 1.45rem;
    font-weight: 600;
    margin: 0 0 0.4rem;
}

.finale-kicker {
    font-size: 0.7rem;
    font-weight: 800;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--bronze);
    margin-bottom: 0.5rem;
}

.finale-block > p { font-size: 0.98rem; color: #33302b; max-width: 62ch; margin-bottom: 1rem; }

/* results summary */
.results-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 0.9rem;
    margin: 1.4rem 0;
}

.results-stat {
    background: var(--paper);
    border: 1px solid var(--line-soft);
    border-radius: 12px;
    padding: 1rem 1.1rem;
    text-align: center;
}

.results-stat .rs-value {
    display: block;
    font-family: var(--serif);
    font-size: 1.9rem;
    color: var(--accent);
    font-variant-numeric: tabular-nums;
    line-height: 1.1;
}

.results-stat .rs-label {
    display: block;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--ink-faint);
    margin-top: 0.3rem;
}

.results-list { list-style: none; padding: 0; margin: 1.2rem 0 0; }

.results-list li {
    display: flex;
    gap: 0.8rem;
    align-items: baseline;
    padding: 0.75rem 0;
    border-bottom: 1px solid var(--line-soft);
    font-size: 0.95rem;
    color: #33302b;
}

.results-list li:last-child { border-bottom: none; }

.results-list .rl-lesson {
    flex: none;
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--good);
    width: 5.4rem;
}

/* certificate on-page form */
.cert-form {
    display: flex;
    gap: 0.7rem;
    flex-wrap: wrap;
    margin: 1.2rem 0;
}

.cert-form input[type="text"] {
    flex: 1;
    min-width: 220px;
    font-family: var(--sans);
    font-size: 1rem;
    padding: 0.75rem 1rem;
    border: 1.5px solid var(--course-line);
    border-radius: 10px;
    background: #fff;
    color: var(--course-ink);
}

.cert-form input[type="text"]:focus { border-color: var(--accent); outline: none; }

/* download shelf */
.download-shelf {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1rem;
    margin: 1.6rem 0 0.4rem;
}

.shelf-item {
    display: flex;
    flex-direction: column;
    gap: 0.45rem;
    background: var(--paper);
    border: 1px solid var(--line-soft);
    border-radius: 14px;
    padding: 1.3rem 1.4rem;
    text-decoration: none;
    color: var(--course-ink);
    transition: transform 0.25s var(--ease), box-shadow 0.25s, border-color 0.25s;
}

.shelf-item:hover {
    transform: translateY(-3px);
    border-color: rgba(154, 123, 63, 0.4);
    box-shadow: 0 12px 28px rgba(23, 21, 19, 0.06);
}

.shelf-item .shelf-kicker {
    font-size: 0.66rem;
    font-weight: 800;
    letter-spacing: 0.13em;
    text-transform: uppercase;
    color: var(--bronze);
}

.shelf-item .shelf-title { font-weight: 700; font-size: 1rem; }
.shelf-item .shelf-sub { font-size: 0.85rem; color: var(--ink-soft); line-height: 1.5; }

.shelf-item .shelf-open {
    margin-top: 0.4rem;
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--accent);
}

/* course strip above the site footer */
.course-strip {
    border-top: 1px solid var(--line-soft);
    padding: 2rem 1.5rem;
    text-align: center;
    font-size: 0.85rem;
    color: var(--ink-faint);
    background: var(--paper);
}

.course-strip a { color: var(--accent); text-decoration: none; font-weight: 600; }
.course-strip a:hover { text-decoration: underline; }

.course-strip .footer-reset {
    background: none;
    border: none;
    color: var(--ink-faint);
    font: inherit;
    text-decoration: underline;
    cursor: pointer;
    margin-top: 0.6rem;
}

/* scroll reveals */
.reveal {
    opacity: 0;
    transform: translateY(26px);
    transition: opacity 0.7s var(--ease), transform 0.7s var(--ease);
}

.reveal.in-view { opacity: 1; transform: translateY(0); }

/* screen-reader only */
.sr-only {
    position: absolute;
    width: 1px; height: 1px;
    padding: 0; margin: -1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
    border: 0;
}

/* ─── Certificate (print target) ───────────────────────── */
.certificate-wrap {
    margin: 2rem 0;
    border: 1px solid var(--line-soft);
    border-radius: 6px;
    overflow: hidden;
    box-shadow: 0 14px 40px rgba(23, 21, 19, 0.08);
    display: none;
}

.certificate-wrap.is-shown { display: block; }

.certificate {
    background: #fffdf8;
    color: #2b2417;
    padding: clamp(1.5rem, 5vw, 3.5rem);
    text-align: center;
    position: relative;
    border: 10px solid #fffdf8;
    outline: 2px solid rgba(154, 123, 63, 0.5);
    outline-offset: -18px;
}

.certificate .cert-brand {
    font-family: var(--sans);
    font-size: 0.8rem;
    font-weight: 800;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: var(--bronze);
    margin-bottom: 1.6rem;
}

.certificate .cert-title {
    font-family: var(--serif);
    font-size: clamp(1.6rem, 4vw, 2.4rem);
    font-weight: 600;
    margin-bottom: 0.4rem;
}

.certificate .cert-sub {
    font-size: 0.9rem;
    color: #6b6250;
    margin-bottom: 2rem;
}

.certificate .cert-name {
    font-family: var(--serif);
    font-size: clamp(1.9rem, 5vw, 3rem);
    font-style: italic;
    border-bottom: 1.5px solid rgba(154, 123, 63, 0.5);
    display: inline-block;
    padding: 0 2rem 0.4rem;
    margin-bottom: 2rem;
    min-width: 45%;
}

.certificate .cert-body {
    font-size: 0.95rem;
    color: #4b4434;
    max-width: 52ch;
    margin: 0 auto 2rem;
    line-height: 1.6;
}

.certificate .cert-seal {
    width: 84px;
    height: 84px;
    margin: 0 auto 1.5rem;
    border-radius: 50%;
    border: 2px solid var(--bronze);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.certificate .cert-seal::before {
    content: '';
    position: absolute;
    inset: 6px;
    border-radius: 50%;
    border: 1px dashed rgba(154, 123, 63, 0.6);
}

.certificate .cert-seal span {
    font-family: var(--serif);
    font-size: 1.5rem;
    color: var(--bronze);
}

.certificate .cert-meta {
    display: flex;
    justify-content: center;
    gap: 2.5rem;
    flex-wrap: wrap;
    font-size: 0.78rem;
    color: #6b6250;
    font-variant-numeric: tabular-nums;
}

.certificate .cert-meta strong { display: block; font-size: 0.68rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--bronze); margin-bottom: 0.2rem; }

.certificate .cert-footer {
    margin-top: 1.8rem;
    font-size: 0.72rem;
    color: #8a8064;
}

.certificate .cert-flourish {
    font-size: 0.72rem;
    color: var(--bronze);
    margin-top: 0.6rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

/* The certificate is downloaded as a generated A4 PDF (see
   course.js); no print stylesheet needed, so a plain Cmd+P just
   prints the page normally. */

/* ─── Reduced motion ───────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    .reveal { opacity: 1 !important; transform: none !important; }
}

/* ─── Small screens ────────────────────────────────────── */
@media (max-width: 640px) {
    body.course-page { font-size: 1rem; }
    .lesson-inner { padding-top: 3.5rem; }
    .widget-card, .checkpoint, .finale-block { padding: 1.25rem; }
    .desk-stage { grid-template-columns: 1fr; }
    .focus-meter { flex-direction: row; align-items: center; }
    .focus-dial { height: 40px; width: 100%; background: linear-gradient(to right, rgba(4, 120, 87, 0.16), rgba(234, 179, 8, 0.14), rgba(180, 35, 24, 0.14)); }
    .focus-needle { top: 6px; bottom: 6px; height: auto; width: 4px; left: 8%; right: auto; transition: left 0.6s var(--ease); }
    .chapter-num { font-size: 3.4rem; }
}
