/* KubeLab — mission-control / editorial UI
   SpaceX density + x.com timeline structure.
   No cards, no pills, no glass. Hairlines, lists, mono meta. */

*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }

:root {
    --font: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont,
        "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;

    --bg: #fff;
    --fg: #0a0a0a;
    --mute: #666;
    --faint: #999;
    --line: #e5e5e5;
    --line-strong: #0a0a0a;
    --soft: #f5f5f5;
    --link: #1d9bf0;
    --ok: #0a0;
    --err: #c00;
    --warn: #c60;

    --max: 1080px;
    --pad: 1.25rem;
    --ease: 0.12s ease;
    color-scheme: light;
}

[data-theme="dark"] {
    --bg: #000;
    --fg: #ededed;
    --mute: #888;
    --faint: #555;
    --line: #222;
    --line-strong: #ededed;
    --soft: #0d0d0d;
    --link: #1d9bf0;
    --ok: #3c3;
    --err: #f44;
    --warn: #fa0;
    color-scheme: dark;
}

/* Legacy token aliases (templates / flashcards) */
:root, [data-theme="dark"] {
    --text: var(--fg);
    --text-body: var(--fg);
    --heading: var(--fg);
    --muted: var(--mute);
    --border: var(--line);
    --border-strong: var(--line-strong);
    --border-subtle: var(--line);
    --surface: var(--bg);
    --surface-2: var(--soft);
    --surface-hover: var(--soft);
    --cta: var(--fg);
    --cta-text: var(--bg);
    --cta-hover: var(--mute);
    --navy: var(--fg);
    --navy-light: var(--mute);
    --green-600: var(--ok);
    --red-600: var(--err);
    --amber-700: var(--warn);
    --orange: var(--warn);
    --orange-dark: var(--warn);
    --radius: 0;
    --radius-sm: 0;
    --radius-pill: 0;
    --font-sans: var(--font);
    --font-mono: var(--mono);
}

html { scroll-behavior: smooth; }

body {
    font-family: var(--font);
    font-size: 15px;
    line-height: 1.5;
    background: var(--bg);
    color: var(--fg);
    min-height: 100dvh;
    display: flex;
    flex-direction: column;
    -webkit-font-smoothing: antialiased;
}

main { flex: 1; width: 100%; }

a { color: var(--link); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 2px; }

/* ═══════════ SHELL ═══════════ */
.shell {
    width: 100%;
    max-width: var(--max);
    margin: 0 auto;
    padding: 0 var(--pad);
}

/* ═══════════ HEADER ═══════════ */
header.site {
    border-bottom: 1px solid var(--line);
    background: var(--bg);
    position: sticky;
    top: 0;
    z-index: 40;
}
.header-inner {
    max-width: var(--max);
    margin: 0 auto;
    padding: 0 var(--pad);
    height: 52px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}
.logo {
    display: inline-flex;
    align-items: center;
    gap: 0.55rem;
    color: var(--fg);
    text-decoration: none;
    font-weight: 600;
    font-size: 14px;
    letter-spacing: -0.02em;
}
.logo:hover { color: var(--fg); text-decoration: none; }
.logo-mark {
    position: relative;
    width: 28px;
    height: 28px;
    display: block;
    flex-shrink: 0;
}
.logo-mark-img {
    position: absolute;
    inset: 0;
    width: 28px;
    height: 28px;
    display: block;
    object-fit: contain;
    /* Hard-contrast KL stamp — no soft radius */
    border-radius: 0;
}
/* Light theme: black mark on white (K) */
.logo-mark-light { opacity: 1; }
.logo-mark-dark { opacity: 0; }
/* Dark theme: white mark on black (inverted K) */
[data-theme="dark"] .logo-mark-light { opacity: 0; }
[data-theme="dark"] .logo-mark-dark { opacity: 1; }
.logo-word span { color: var(--mute); font-weight: 500; }

.header-nav {
    display: flex;
    align-items: center;
    gap: 0;
    flex-wrap: wrap;
    justify-content: flex-end;
}
.header-nav a {
    color: var(--mute);
    font-size: 13px;
    font-weight: 400;
    text-decoration: none;
    padding: 0.35rem 0.55rem;
}
.header-nav a:hover { color: var(--fg); text-decoration: none; }
.header-nav a[aria-current="page"] { color: var(--fg); }
.header-nav .btn { margin-left: 0.5rem; }

.theme-toggle {
    appearance: none;
    background: none;
    border: 0;
    border-left: 1px solid var(--line);
    border-right: 1px solid var(--line);
    color: var(--mute);
    font: inherit;
    font-size: 11px;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    padding: 0.35rem 0.65rem;
    cursor: pointer;
    margin: 0 0.15rem;
}
.theme-toggle:hover { color: var(--fg); }
.theme-icon-sun { display: none; }
[data-theme="dark"] .theme-icon-sun { display: inline; }
[data-theme="dark"] .theme-icon-moon { display: none; }

/* ═══════════ BUTTONS — raw bars ═══════════ */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    font: inherit;
    font-size: 12px;
    font-weight: 500;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    padding: 0.7rem 1.1rem;
    border: 1px solid var(--fg);
    border-radius: 0;
    background: transparent;
    color: var(--fg);
    cursor: pointer;
    text-decoration: none;
    line-height: 1;
    transition: background var(--ease), color var(--ease);
    white-space: nowrap;
}
.btn:hover { text-decoration: none; }
.btn:active { opacity: 0.85; }
.btn:focus-visible { outline: 1px solid var(--fg); outline-offset: 2px; }

.btn-primary {
    background: var(--fg);
    color: var(--bg);
    border-color: var(--fg);
}
.btn-primary:hover {
    background: transparent;
    color: var(--fg);
}

.btn-ghost {
    background: transparent;
    color: var(--fg);
    border-color: var(--line);
}
.btn-ghost:hover {
    border-color: var(--fg);
    background: var(--fg);
    color: var(--bg);
}

.btn-amber {
    border-color: var(--warn);
    color: var(--warn);
    background: transparent;
}
.btn-amber:hover {
    background: var(--warn);
    color: var(--bg);
}

.btn-sm { font-size: 11px; padding: 0.5rem 0.8rem; }
.btn-block { width: 100%; }
.btn[disabled],
.btn[disabled]:hover {
    opacity: 0.3;
    cursor: not-allowed;
    background: transparent;
    color: var(--mute);
    border-color: var(--line);
}

/* ═══════════ FLASH ═══════════ */
.flashes {
    max-width: var(--max);
    margin: 0 auto;
    padding: 0.75rem var(--pad) 0;
}
.flash {
    font-size: 13px;
    padding: 0.65rem 0;
    border-bottom: 1px solid var(--line);
    color: var(--fg);
}
.flash.success { color: var(--ok); }
.flash.error { color: var(--err); }

/* ═══════════ TYPE ═══════════ */
.kicker {
    font-family: var(--mono);
    font-size: 11px;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--mute);
    margin-bottom: 1rem;
}
.overline {
    font-family: var(--mono);
    font-size: 11px;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--mute);
    margin-bottom: 1rem;
}

/* ═══════════ HERO — title left, copy right; art fills dead space under title ═══════════ */
.hero {
    max-width: var(--max);
    margin: 0 auto;
    padding: 2.5rem var(--pad) 2.5rem;
    text-align: left;
    border-bottom: 1px solid var(--line);
}
.hero-grid {
    display: grid;
    grid-template-columns: 1.35fr 1fr;
    gap: 2.5rem;
    align-items: start;
}
.hero-main {
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 0;
}
.hero-main .kicker { margin-bottom: 0.85rem; }
.hero h1 {
    font-size: clamp(2.4rem, 7vw, 4rem);
    font-weight: 600;
    line-height: 0.98;
    letter-spacing: -0.045em;
    color: var(--fg);
    max-width: 14ch;
    margin: 0;
}
.hero h1 em {
    font-style: italic;
    font-weight: 400;
    color: var(--mute);
}
/* The gap under the short headline — landscape art lives here */
.hero-gap-art {
    margin: 1.35rem 0 0;
    width: 100%;
    max-width: 100%;
}
.ascii-frame {
    width: 100%;
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    border: 1px solid var(--fg);
    background: var(--bg);
    border-radius: 0;
    overflow: hidden;
    line-height: 0;
    /* landscape band under the title */
    min-height: 7.5rem;
    height: clamp(7.5rem, 14vw, 10.5rem);
}
.ascii-art {
    display: block;
    margin: 0;
    padding: 0.4rem 0.45rem;
    box-sizing: border-box;
    width: 100%;
    height: 100%;
    font-family: var(--mono), ui-monospace, "SF Mono", Menlo, Consolas, monospace;
    font-size: 9px;
    line-height: 1.05;
    letter-spacing: 0;
    color: var(--fg);
    background: transparent;
    border: 0;
    white-space: pre;
    overflow: hidden;
    user-select: none;
    cursor: crosshair;
    border-radius: 0;
    text-rendering: geometricPrecision;
    -webkit-font-smoothing: none;
    font-smooth: never;
    tab-size: 1;
}
.ascii-statement {
    margin: 0.65rem 0 0;
    font-size: clamp(1.05rem, 2.2vw, 1.3rem);
    font-weight: 700;
    letter-spacing: -0.04em;
    line-height: 1.15;
    color: var(--fg);
}
[data-theme="dark"] .ascii-frame {
    border-color: #ededed;
    background: #000;
}
[data-theme="dark"] .ascii-art { color: #ededed; }
[data-theme="light"] .ascii-frame {
    border-color: #0a0a0a;
    background: #fff;
}
[data-theme="light"] .ascii-art { color: #0a0a0a; }

.hero-side {
    border-left: 1px solid var(--line);
    padding-left: 2rem;
    min-width: 0;
}
.hero .lede {
    font-size: 15px;
    line-height: 1.55;
    color: var(--mute);
    max-width: 36ch;
    margin: 0 0 1.5rem;
}
.hero-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 1.75rem;
}
.hero-meta {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
    margin: 0;
    padding: 0;
}
.hero-meta li {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    font-size: 13px;
    border-bottom: 1px solid var(--line);
    padding-bottom: 0.65rem;
}
.hero-meta .mk {
    font-family: var(--mono);
    font-size: 11px;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--faint);
}
.hero-meta .mv { color: var(--fg); }

@media (max-width: 860px) {
    .hero-grid { grid-template-columns: 1fr; gap: 2rem; }
    .hero-side {
        border-left: 0;
        border-top: 1px solid var(--line);
        padding-left: 0;
        padding-top: 1.5rem;
    }
    .ascii-frame {
        min-height: 6.5rem;
        height: 7.5rem;
    }
}

/* Compact page hero (catalog, etc.) */
.page-hero {
    max-width: var(--max);
    margin: 0 auto;
    padding: 2.75rem var(--pad) 1.75rem;
    border-bottom: 1px solid var(--line);
}
.page-hero h1 {
    font-size: clamp(1.75rem, 4vw, 2.5rem);
    font-weight: 600;
    letter-spacing: -0.035em;
    line-height: 1.05;
    color: var(--fg);
}
.page-hero h1 em {
    font-style: italic;
    font-weight: 400;
    color: var(--mute);
}
.page-hero .lede {
    margin-top: 0.75rem;
    color: var(--mute);
    font-size: 15px;
    max-width: 48ch;
}

/* ═══════════ SECTION ═══════════ */
.section {
    max-width: var(--max);
    margin: 0 auto;
    padding: 2rem var(--pad) 4rem;
}
.section-bar {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 0;
    padding-bottom: 0.85rem;
    border-bottom: 1px solid var(--fg);
}
.section-bar h2 {
    font-size: 12px;
    font-weight: 500;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--fg);
}
.section-bar a {
    font-family: var(--mono);
    font-size: 11px;
    color: var(--mute);
    letter-spacing: 0.04em;
    text-transform: uppercase;
}
.section-bar a:hover { color: var(--fg); }

/* ═══════════ MANIFEST LIST (tracks) ═══════════ */
.manifest {
    list-style: none;
    border-bottom: 1px solid var(--line);
}
.manifest-item,
.track-card {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 1rem 1.5rem;
    padding: 1.35rem 0;
    border-top: 1px solid var(--line);
    background: transparent;
    text-decoration: none;
    color: inherit;
    transition: background var(--ease);
}
a.manifest-item:hover,
.track-card:hover {
    background: var(--soft);
    text-decoration: none;
    color: inherit;
}
/* when track-card is article wrapping content */
.track-card {
    display: block;
    padding: 0;
    border: 0;
}
.track-card > a.manifest-item {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 1rem 1.5rem;
    padding: 1.35rem 0;
    border-top: 1px solid var(--line);
    color: inherit;
    text-decoration: none;
}
.track-card:first-child > a.manifest-item,
.manifest > .manifest-item:first-child,
.manifest > li:first-child .manifest-item {
    border-top: 0;
}

.manifest-body { min-width: 0; }
.manifest-top {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    flex-wrap: wrap;
    margin-bottom: 0.35rem;
}
.manifest-title {
    font-size: 1.05rem;
    font-weight: 600;
    letter-spacing: -0.02em;
    color: var(--fg);
    line-height: 1.25;
}
.manifest-item:hover .manifest-title,
.track-card:hover .manifest-title {
    text-decoration: underline;
    text-underline-offset: 3px;
}
.manifest-summary {
    font-size: 13px;
    line-height: 1.5;
    color: var(--mute);
    max-width: 62ch;
    margin-top: 0.35rem;
}
.manifest-side {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    justify-content: space-between;
    gap: 0.75rem;
    text-align: right;
    min-width: 7.5rem;
}
.manifest-price {
    font-size: 14px;
    font-weight: 600;
    letter-spacing: -0.02em;
    color: var(--fg);
}
.manifest-meta {
    font-family: var(--mono);
    font-size: 11px;
    color: var(--faint);
    letter-spacing: 0.02em;
    line-height: 1.5;
}

/* badge as mono tag */
.badge {
    font-family: var(--mono);
    font-size: 10px;
    font-weight: 500;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--mute);
    border: 1px solid var(--line);
    padding: 0.15rem 0.4rem;
    border-radius: 0;
    background: transparent;
}
.badge.free {
    color: var(--fg);
    border-color: var(--fg);
}
.badge.level { color: var(--mute); }

/* Account achievement badges — square art, mono editorial vibe */
.achievements {
    margin: 0 0 2rem;
    padding-bottom: 1.75rem;
    border-bottom: 1px solid var(--line);
}
.achievement-grid {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(132px, 1fr));
    gap: 1rem 0.75rem;
}
.achievement-card {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    padding: 0;
    border: none;
    background: transparent;
    min-height: 0;
}
.achievement-art-wrap {
    aspect-ratio: 1 / 1;
    width: 100%;
    border: 1px solid var(--line);
    background: var(--bg);
    display: block;
    overflow: hidden;
}
.achievement-card.is-earned .achievement-art-wrap {
    border-color: var(--fg);
}
.achievement-art {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: contain;
    /* SVGs are black-on-transparent; invert for dark theme */
    filter: none;
}
[data-theme="dark"] .achievement-art {
    filter: invert(1);
}
.achievement-card.is-locked .achievement-art-wrap {
    opacity: 0.38;
}
.achievement-card.is-locked .achievement-title,
.achievement-card.is-locked .achievement-blurb,
.achievement-card.is-locked .achievement-date {
    opacity: 0.55;
}
.achievement-title {
    font-weight: 600;
    font-size: 0.88rem;
    letter-spacing: -0.02em;
    margin-top: 0.15rem;
}
.achievement-blurb {
    font-size: 0.72rem;
    line-height: 1.35;
    color: var(--mute);
}
.achievement-date {
    font-family: var(--mono);
    font-size: 10px;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--faint);
}
.score-new-badges {
    margin: 1rem 0 1.5rem;
    padding: 0.85rem 1rem;
    border: 1px solid var(--line);
    background: var(--soft, transparent);
}
.score-new-badges[hidden] { display: none !important; }
.score-new-badges-label {
    margin: 0 0 0.5rem;
    font-family: var(--mono, ui-monospace, monospace);
    font-size: 11px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--faint, var(--mute));
}
.score-new-badges-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}
.score-new-badge-item {
    display: grid;
    grid-template-columns: 40px 1fr;
    grid-template-rows: auto auto;
    column-gap: 0.65rem;
    row-gap: 0.1rem;
    align-items: center;
}
.score-new-badge-art {
    grid-row: 1 / span 2;
    width: 40px;
    height: 40px;
    object-fit: contain;
    border: 1px solid var(--line);
    background: var(--bg);
}
[data-theme="dark"] .score-new-badge-art {
    filter: invert(1);
}
.score-new-badge-title {
    font-weight: 600;
    font-size: 0.95rem;
}
.score-new-badge-blurb {
    grid-column: 2;
    font-size: 0.8rem;
    color: var(--mute);
}

/* legacy track bits (dashboard etc.) */
.track-grid { /* becomes vertical stack */
    display: flex;
    flex-direction: column;
}
.track-top { display: none; } /* handled in new card markup */
.track-meta { display: none; }
.track-foot { display: none; }
.price { font-weight: 600; }
.summary { color: var(--mute); font-size: 13px; }

/* ═══════════ PROGRESS ═══════════ */
.progress {
    height: 1px;
    background: var(--line);
    border: 0;
    overflow: hidden;
    width: 100%;
    max-width: 200px;
}
.progress > span {
    display: block;
    height: 100%;
    background: var(--fg);
}
.progress-label {
    font-family: var(--mono);
    font-size: 11px;
    color: var(--mute);
    margin-top: 0.4rem;
    letter-spacing: 0.02em;
}

/* ═══════════ DETAIL / TRACK PAGE ═══════════ */
.detail-hero {
    max-width: var(--max);
    margin: 0 auto;
    padding: 2.5rem var(--pad) 1.5rem;
    border-bottom: 1px solid var(--line);
}
.detail-hero h1 {
    font-size: clamp(1.85rem, 4vw, 2.75rem);
    font-weight: 600;
    letter-spacing: -0.035em;
    line-height: 1.05;
    margin: 0.75rem 0 0.75rem;
}
.detail-hero .summary {
    font-size: 15px;
    color: var(--mute);
    max-width: 56ch;
    line-height: 1.55;
}
.detail-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    margin-top: 0.75rem;
}
.detail-layout {
    max-width: var(--max);
    margin: 0 auto;
    padding: 1.5rem var(--pad) 4rem;
    display: grid;
    gap: 0;
}
.access-box {
    border: 1px solid var(--line);
    border-left: 2px solid var(--fg);
    padding: 1.15rem 1.25rem;
    margin-bottom: 1.5rem;
    background: var(--bg);
}
.access-box.locked {
    border-left-color: var(--warn);
}
.access-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
}

/* steps as timeline rows */
.step-list {
    list-style: none;
    border-top: 1px solid var(--fg);
}
.step-row {
    display: grid;
    grid-template-columns: 2.5rem 1fr auto;
    align-items: center;
    gap: 0.75rem;
    padding: 0.85rem 0;
    border-bottom: 1px solid var(--line);
    background: transparent;
    text-decoration: none;
    color: inherit;
    border-radius: 0;
}
a.step-row:hover {
    background: var(--soft);
    text-decoration: none;
    color: inherit;
}
.step-num {
    font-family: var(--mono);
    font-size: 11px;
    color: var(--faint);
    width: auto;
    height: auto;
    border: 0;
    background: none;
    border-radius: 0;
    display: block;
    text-align: left;
}
.step-row.done .step-num { color: var(--fg); }
.step-row .step-title {
    font-size: 14px;
    font-weight: 500;
    color: var(--fg);
}
.step-row .step-lock {
    font-family: var(--mono);
    font-size: 10px;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--faint);
    margin-left: 0;
}

/* ═══════════ LESSON ═══════════ */
.lesson-body {
    background: transparent;
    border: 0;
    border-top: 1px solid var(--line);
    border-radius: 0;
    padding: 1.5rem 0;
}
.lesson-body h1, .lesson-body h2, .lesson-body h3 {
    color: var(--fg);
    letter-spacing: -0.02em;
    margin: 1.5rem 0 0.55rem;
    line-height: 1.2;
}
.lesson-body h1:first-child, .lesson-body h2:first-child { margin-top: 0; }
.lesson-body h2 {
    font-size: 1.1rem;
    font-weight: 600;
    border-bottom: 1px solid var(--line);
    padding-bottom: 0.35rem;
}
.lesson-body h3 { font-size: 1rem; font-weight: 600; }
.lesson-body p { margin: 0.7rem 0; line-height: 1.65; }
.lesson-body ul, .lesson-body ol { margin: 0.7rem 0 0.7rem 1.25rem; }
.lesson-body li { margin: 0.3rem 0; line-height: 1.55; }
.lesson-body a { color: var(--link); }
.lesson-body code {
    font-family: var(--mono);
    font-size: 0.88em;
    background: var(--soft);
    border: 1px solid var(--line);
    padding: 0.05em 0.3em;
}
.lesson-body pre {
    background: var(--soft);
    border: 1px solid var(--line);
    border-radius: 0;
    padding: 0.9rem 1rem;
    overflow-x: auto;
    margin: 1rem 0;
    font-size: 12.5px;
    line-height: 1.55;
}
.lesson-body pre code { background: none; border: none; padding: 0; }
.lesson-body table { border-collapse: collapse; width: 100%; margin: 1rem 0; font-size: 13px; }
.lesson-body th, .lesson-body td {
    border: 1px solid var(--line);
    padding: 0.4rem 0.6rem;
    text-align: left;
}
.lesson-body th { background: var(--soft); font-weight: 600; }
.lesson-body blockquote {
    border-left: 2px solid var(--fg);
    padding-left: 0.9rem;
    margin: 0.9rem 0;
    color: var(--mute);
    font-style: italic;
}
.lesson-nav {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    margin-top: 1.25rem;
    flex-wrap: wrap;
    padding-top: 1rem;
    border-top: 1px solid var(--line);
}
.back-link {
    font-family: var(--mono);
    font-size: 11px;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--mute);
    text-decoration: none;
}
.back-link:hover { color: var(--fg); text-decoration: none; }
.step-overline {
    font-family: var(--mono);
    font-size: 11px;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--faint);
    margin: 0.75rem 0 0.3rem;
}
/* Exam remaining minutes — quiet, not a big countdown UI */
.exam-timer {
    letter-spacing: 0.06em;
    text-transform: none;
    color: var(--mute);
    font-weight: 400;
    margin-left: 0.15rem;
}
.exam-timer--low {
    color: var(--warn, #c9a227);
}
.step-title-main {
    font-size: 1.4rem;
    font-weight: 600;
    letter-spacing: -0.03em;
    margin-bottom: 0.75rem;
    line-height: 1.15;
}
.done-form { margin-top: 1rem; }

/* ═══════════ EXAM QUESTION BROWSER (left panel) ═══════════ */
.exam-picker {
    margin: 0.15rem 0 0.85rem;
    padding: 0.65rem 0 0.75rem;
    border-bottom: 1px solid var(--line);
    position: sticky;
    top: 0;
    z-index: 2;
    background: var(--bg);
}
.exam-picker-label {
    display: block;
    font-family: var(--mono);
    font-size: 10px;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--faint);
    margin-bottom: 0.35rem;
}
.exam-picker-row {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    flex-wrap: wrap;
}
.exam-question-select {
    flex: 1 1 10rem;
    min-width: 0;
    font-family: var(--mono);
    font-size: 12px;
    line-height: 1.3;
    color: var(--fg);
    background: var(--soft);
    border: 1px solid var(--line);
    border-radius: 0;
    padding: 0.4rem 0.5rem;
    max-width: 100%;
    cursor: pointer;
}
.exam-question-select:focus {
    outline: 1px solid var(--fg);
    outline-offset: 1px;
}
.exam-picker-nav {
    display: flex;
    gap: 0.2rem;
    flex-shrink: 0;
}
.exam-nav-btn {
    min-width: 2rem;
    padding-left: 0.45rem;
    padding-right: 0.45rem;
}
.exam-nav-btn:disabled {
    opacity: 0.35;
    cursor: not-allowed;
}
.exam-flag-btn {
    flex-shrink: 0;
    font-family: var(--mono);
    font-size: 11px;
    letter-spacing: 0.02em;
    white-space: nowrap;
}
.exam-flag-btn:disabled {
    opacity: 0.35;
    cursor: not-allowed;
}
.exam-flag-btn.is-flagged {
    color: var(--warn, #c90);
    border-color: var(--warn, #c90);
}
.exam-q-body {
    margin: 0;
    padding: 0;
    font-family: var(--mono);
    font-size: 12.5px;
    line-height: 1.55;
    white-space: pre-wrap;
    word-break: break-word;
    color: var(--fg);
    background: transparent;
    border: 0;
    overflow-x: auto;
}
.exam-q-panel {
    border-top: 0;
    padding-top: 0.75rem;
}

/* ═══════════ PRICING — vertical rules ═══════════ */
.pricing-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    border-top: 1px solid var(--fg);
    border-bottom: 1px solid var(--line);
}
.plan {
    padding: 1.75rem 1.25rem;
    border-right: 1px solid var(--line);
    display: flex;
    flex-direction: column;
    background: transparent;
    border-radius: 0;
    border-top: 0;
    border-bottom: 0;
    border-left: 0;
}
.plan:last-child { border-right: 0; }
.plan.featured { background: var(--soft); }
.plan.featured::before {
    content: "Popular";
    display: block;
    font-family: var(--mono);
    font-size: 10px;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--mute);
    margin-bottom: 1rem;
}
.plan h3 {
    font-family: var(--mono);
    font-size: 11px;
    font-weight: 500;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--mute);
    margin-bottom: 0.75rem;
}
.plan .plan-price {
    font-size: 2rem;
    font-weight: 600;
    letter-spacing: -0.04em;
    line-height: 1;
}
.plan .plan-price small {
    font-size: 12px;
    font-weight: 400;
    color: var(--mute);
    letter-spacing: 0;
}
.plan .plan-desc {
    font-size: 13px;
    color: var(--mute);
    margin: 0.65rem 0 1.25rem;
}
.plan ul {
    list-style: none;
    margin: 0 0 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    flex: 1;
}
.plan li {
    font-size: 13px;
    color: var(--fg);
    padding-left: 0;
    display: block;
    border-bottom: 1px solid var(--line);
    padding-bottom: 0.45rem;
}
.plan li::before { content: none; }
.plan .plan-cta { margin-top: auto; }

/* ═══════════ AUTH ═══════════ */
.auth-card {
    max-width: 380px;
    margin: 3.5rem auto;
    padding: 0 var(--pad);
    background: transparent;
    border: 0;
    border-radius: 0;
}
.auth-card h1 {
    font-size: 1.75rem;
    font-weight: 600;
    letter-spacing: -0.03em;
    margin-bottom: 0.35rem;
}
.auth-card .sub {
    font-size: 14px;
    color: var(--mute);
    margin-bottom: 1.75rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--line);
}
.field { margin-bottom: 1.1rem; }
.field label {
    display: block;
    font-family: var(--mono);
    font-size: 10px;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--mute);
    margin-bottom: 0.4rem;
}
.field input {
    width: 100%;
    font: inherit;
    font-size: 15px;
    padding: 0.65rem 0;
    border: 0;
    border-bottom: 1px solid var(--line);
    border-radius: 0;
    background: transparent;
    color: var(--fg);
}
.field input::placeholder { color: var(--faint); }
.field input:focus {
    outline: none;
    border-bottom-color: var(--fg);
}
.auth-alt {
    text-align: left;
    font-size: 13px;
    color: var(--mute);
    margin-top: 1.25rem;
}

/* ═══════════ BANNERS ═══════════ */
.stub-banner {
    background: transparent;
    border: 0;
    border-left: 2px solid var(--mute);
    border-radius: 0;
    padding: 0.5rem 0 0.5rem 0.9rem;
    font-size: 13px;
    color: var(--mute);
    margin-bottom: 1.25rem;
}
.stub-banner strong { color: var(--fg); }

/* ═══════════ FUNNEL (in-app conversion / retention, no email) ═══════════ */
.funnel-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 1rem;
    margin: 1.25rem 0 2rem;
}
.funnel-card {
    border: 1px solid var(--line);
    border-radius: 6px;
    padding: 1.1rem 1.15rem 1.2rem;
    background: var(--panel, transparent);
}
.funnel-card--primary {
    border-color: var(--accent, var(--line));
    box-shadow: inset 3px 0 0 var(--accent, #c9a227);
}
.funnel-card--priority {
    border-color: color-mix(in srgb, var(--warn, #c9a227) 55%, var(--line));
}
.funnel-card--score {
    margin: 1.25rem 0 1.75rem;
}
.funnel-kicker {
    font-family: var(--mono);
    font-size: 11px;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--faint, var(--mute));
    margin: 0 0 0.4rem;
}
.funnel-title {
    font-size: 1.15rem;
    margin: 0 0 0.5rem;
    line-height: 1.25;
}
.funnel-copy {
    font-size: 14px;
    color: var(--mute);
    margin: 0 0 1rem;
    line-height: 1.45;
}
.funnel-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    align-items: center;
}
.funnel-footnote {
    font-size: 13px;
    color: var(--mute);
    margin: 0.85rem 0 0;
    padding-top: 0.75rem;
    border-top: 1px solid var(--line);
}
.funnel-strip {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem 1.25rem;
    border: 1px solid var(--line);
    border-radius: 6px;
    padding: 0.9rem 1.1rem;
    font-size: 14px;
    color: var(--mute);
    margin-bottom: 0.5rem;
}
.funnel-strip strong { color: var(--fg); }
.funnel-strip-sep { opacity: 0.45; margin: 0 0.35rem; }
.funnel-welcome {
    font-size: 13px;
    line-height: 1.4;
    color: var(--mute);
    padding: 0.55rem 0.85rem;
    border-bottom: 1px solid var(--line);
    background: color-mix(in srgb, var(--accent, #888) 8%, transparent);
}
.funnel-welcome strong { color: var(--fg); }
.funnel-welcome--priority {
    background: color-mix(in srgb, var(--ok, #3a7) 12%, transparent);
}
.funnel-welcome--soft {
    background: transparent;
}

/* ═══════════ FOOTER ═══════════ */
footer.site {
    border-top: 1px solid var(--line);
    padding: 1.75rem var(--pad) 2.5rem;
    margin-top: auto;
}
.footer-inner {
    max-width: var(--max);
    margin: 0 auto;
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 0.75rem 1.5rem;
    font-family: var(--mono);
    font-size: 11px;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--faint);
}
footer.site a { color: var(--mute); text-decoration: none; }
footer.site a:hover { color: var(--fg); }
footer.site .sep { margin: 0 0.4rem; color: var(--line); }
footer.site p { margin: 0; }

/* ═══════════ PAGE HEAD (dashboard) ═══════════ */
.page-head {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
    margin-bottom: 0;
    padding-bottom: 1.25rem;
    border-bottom: 1px solid var(--fg);
}
.page-head h1 {
    font-size: clamp(1.4rem, 3vw, 1.85rem);
    font-weight: 600;
    letter-spacing: -0.03em;
}
.page-head .sub {
    color: var(--mute);
    margin-top: 0.35rem;
    font-size: 13px;
}

/* dashboard row reuse */
.dash-row {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 1rem;
    padding: 1.2rem 0;
    border-bottom: 1px solid var(--line);
    align-items: center;
}
.dash-row h3 {
    font-size: 1rem;
    font-weight: 600;
    letter-spacing: -0.02em;
}
.dash-row h3 a { color: inherit; text-decoration: none; }
.dash-row h3 a:hover { text-decoration: underline; }

/* ═══════════ WORKBENCH ═══════════ */
body.page-workbench {
    height: 100dvh;
    overflow: hidden;
}
body.page-workbench main {
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
}
body.page-workbench footer.site { display: none; }

.workbench {
    --workbench-lesson-w: 360px;
    flex: 1;
    min-height: 0;
    display: grid;
    grid-template-columns: var(--workbench-lesson-w) 6px minmax(0, 1fr);
    grid-template-areas: "lesson split play";
    gap: 0;
    width: 100%;
    max-width: none;
    margin: 0;
    padding: 0;
    border-top: 0;
}
.workbench-lesson {
    grid-area: lesson;
    min-height: 0;
    min-width: 0;
    overflow-y: auto;
    padding: 1rem 1.15rem 1.5rem;
    border-right: 0;
}
.workbench-split {
    grid-area: split;
    position: relative;
    z-index: 3;
    width: 6px;
    margin: 0;
    padding: 0;
    border: 0;
    border-left: 1px solid var(--line);
    background: var(--bg);
    cursor: col-resize;
    touch-action: none;
    user-select: none;
    outline: none;
}
.workbench-split::after {
    content: "";
    position: absolute;
    top: 0;
    bottom: 0;
    left: -3px;
    right: -3px;
}
.workbench-split:hover,
.workbench-split:focus-visible,
.workbench.is-resizing .workbench-split {
    background: var(--fg);
    border-left-color: var(--fg);
    opacity: 0.35;
}
.workbench-split:focus-visible {
    opacity: 0.55;
    outline: 1px solid var(--fg);
    outline-offset: -1px;
}
.workbench.is-resizing {
    cursor: col-resize;
    user-select: none;
}
body.workbench-resizing {
    cursor: col-resize !important;
    user-select: none !important;
}
body.workbench-resizing .workbench-play,
body.workbench-resizing .cka-terminal-host {
    pointer-events: none;
}
.workbench-play {
    grid-area: play;
    min-height: 0;
    min-width: 0;
    display: flex;
    background: #000;
}

.terminal-frame {
    flex: 1;
    min-height: 0;
    min-width: 0;
    display: flex;
    flex-direction: column;
    background: #000;
    border: 0;
    border-radius: 0;
    overflow: hidden;
}
.terminal-titlebar {
    display: flex;
    align-items: center;
    padding: 0.5rem 0.85rem;
    background: #0a0a0a;
    border-bottom: 1px solid #222;
    flex-shrink: 0;
}
.terminal-title {
    flex: 1;
    font-family: var(--mono);
    font-size: 11px;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: #888;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.terminal-toolbar {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.5rem 0.75rem;
    background: #000;
    border-bottom: 1px solid #222;
    flex-wrap: wrap;
    flex-shrink: 0;
}
.terminal-status {
    font-family: var(--mono);
    font-size: 11px;
    color: #555;
    flex: 1;
    min-width: 100px;
}
.terminal-body {
    flex: 1;
    min-height: 0;
    background: #000;
    padding: 2px;
}
.terminal-body--mock {
    font-family: var(--mono);
    font-size: 13px;
    color: #aaa;
    padding: 0.9rem 1rem;
}
.terminal-body--mock .mock-dim { color: #444; margin-top: 0.4rem; }

.cka-terminal-host {
    height: 100%;
    background: #000;
    overflow: hidden;
}
.cka-terminal-host:empty::before {
    content: "Start the session to open the terminal.";
    display: block;
    padding: 0.9rem;
    font-size: 12px;
    color: #444;
    font-family: var(--mono);
}

/* ═══════════ UTILS ═══════════ */
.wrap { max-width: var(--max); margin: 0 auto; padding: 0 var(--pad); }
.narrow { max-width: 640px; }
.pills { display: none; } /* removed from vibe */
.pill { display: none; }
.feature-grid { display: none; }

/* ═══════════ RESPONSIVE ═══════════ */
@media (max-width: 860px) {
    .pricing-grid { grid-template-columns: 1fr; }
    .plan {
        border-right: 0;
        border-bottom: 1px solid var(--line);
    }
    .plan:last-child { border-bottom: 0; }
    .manifest-item,
    .track-card > a.manifest-item {
        grid-template-columns: 1fr;
    }
    .manifest-side {
        align-items: flex-start;
        text-align: left;
        flex-direction: row;
        justify-content: space-between;
        width: 100%;
    }
}

@media (max-width: 960px) {
    body.page-workbench {
        height: auto;
        overflow: auto;
    }
    body.page-workbench main { display: block; }
    body.page-workbench footer.site { display: block; }
    .workbench {
        display: block;
        --workbench-lesson-w: auto !important;
    }
    .workbench-split { display: none; }
    .workbench-lesson { border-right: 0; }
    .workbench-play { display: block; min-height: 50vh; }
    .terminal-frame { height: min(55vh, 460px); border-top: 1px solid #222; }
}

@media (max-width: 640px) {
    :root { --pad: 1rem; }
    .header-inner { height: auto; min-height: 52px; padding-top: 0.55rem; padding-bottom: 0.55rem; }
    .hero { padding-top: 2.75rem; }
    .hero h1 { max-width: none; }
    .header-nav a { padding: 0.3rem 0.4rem; font-size: 12px; }
}

/* ── Exam score link (step page) ── */
.exam-score-link { margin: 0.85rem 0 0; }

.score-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.75rem 1rem;
    margin-bottom: 1.25rem;
}
.score-grade-status {
    font-size: 13px;
    color: var(--muted);
}

/* ── Page score (examen blanc, modèle type killer.sh) ── */
.score-page {
    padding: 2rem 1.5rem 3.5rem;
}
.score-inner {
    max-width: 760px;
    margin: 0 auto;
}
.score-header {
    margin: 1.25rem 0 1.5rem;
    text-align: center;
}
.score-header h1 {
    font-size: clamp(1.35rem, 3vw, 1.75rem);
    font-weight: 800;
    letter-spacing: -0.02em;
    color: var(--heading, var(--fg));
    margin: 0.35rem 0 0.65rem;
}
.score-meta {
    font-size: 12px;
    color: var(--muted);
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem 0.5rem;
    justify-content: center;
    align-items: center;
}
.score-meta .sep { color: var(--faint, var(--muted)); }
.score-session {
    font-family: var(--mono, ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace);
    font-size: 11px;
}
.score-demo-badge {
    background: transparent;
    border-color: var(--amber-700, #946f00);
    color: var(--amber-700, #946f00);
}
.score-disclaimer {
    margin: 1rem auto 0;
    max-width: 40rem;
    font-size: 13px;
    color: var(--muted);
    line-height: 1.55;
    text-align: left;
}

.score-summary {
    display: flex;
    flex-wrap: wrap;
    gap: 1.25rem 2rem;
    align-items: center;
    justify-content: space-between;
    background: var(--surface, var(--bg));
    border: 1px solid var(--border, var(--line));
    border-radius: var(--radius, 12px);
    padding: 1.35rem 1.5rem;
    margin-bottom: 1.25rem;
}
.score-summary-main { flex: 1; min-width: 180px; }
.score-summary-label {
    display: block;
    font-size: 12px;
    font-weight: 600;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    margin-bottom: 0.35rem;
}
.score-summary-count {
    font-size: 2rem;
    font-weight: 800;
    letter-spacing: -0.03em;
    color: var(--text, var(--fg));
    line-height: 1.1;
}
.score-summary-count .of {
    font-weight: 500;
    color: var(--muted);
    font-size: 1.25rem;
}
.score-summary-bar {
    margin-top: 0.75rem;
    height: 10px;
    background: var(--surface-2, var(--bg));
    border: 1px solid var(--border, var(--line));
    border-radius: 999px;
    overflow: hidden;
    max-width: 280px;
}
.score-summary-bar > span {
    display: block;
    height: 100%;
    background: var(--navy-light, var(--fg));
    border-radius: 999px;
}
.score-summary-pct {
    margin-top: 0.4rem;
    font-size: 13px;
    color: var(--muted);
}
.score-summary-badge { text-align: center; }
.score-badge {
    display: inline-block;
    font-size: 0.95rem;
    font-weight: 700;
    padding: 0.55rem 1.1rem;
    border-radius: 999px;
    letter-spacing: -0.01em;
}
.score-badge--high { background: var(--green-600, #009427); color: #fff; }
.score-badge--pass { background: var(--navy-light, #2c3863); color: #fff; }
.score-badge--low { background: var(--amber-700, #946f00); color: #fff; }
.score-badge--fail { background: var(--red-600, #b72935); color: #fff; }
[data-theme="dark"] .score-badge--high,
[data-theme="dark"] .score-badge--pass,
[data-theme="dark"] .score-badge--low,
[data-theme="dark"] .score-badge--fail { color: #0a0a0a; }
.score-threshold-hint {
    margin-top: 0.55rem;
    font-size: 11px;
    color: var(--faint, var(--muted));
    max-width: 12rem;
}

.score-demo-note {
    background: var(--surface-2, var(--bg));
    border: 1px solid var(--border, var(--line));
    border-radius: 10px;
    padding: 0.9rem 1.1rem;
    font-size: 13px;
    color: var(--muted);
    margin-bottom: 1.5rem;
    line-height: 1.5;
}
.score-demo-note strong { color: var(--text, var(--fg)); }

.score-questions {
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
}
.score-q {
    background: var(--surface, var(--bg));
    border: 1px solid var(--border, var(--line));
    border-radius: var(--radius, 12px);
    overflow: hidden;
}
.score-q-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.85rem 1.1rem;
    background: var(--surface-2, var(--bg));
    border-bottom: 1px solid var(--border-subtle, var(--line));
}
.score-q-title {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 0.35rem 0.65rem;
    min-width: 0;
}
.score-q-num { font-weight: 700; color: var(--text, var(--fg)); white-space: nowrap; }
.score-q-name { font-size: 13px; color: var(--muted); }
.score-q-pts {
    font-size: 11px;
    font-weight: 600;
    color: var(--faint, var(--muted));
    text-transform: uppercase;
    letter-spacing: 0.04em;
}
.score-q-score { font-variant-numeric: tabular-nums; white-space: nowrap; flex-shrink: 0; }
.score-q-got { font-size: 1.25rem; font-weight: 800; color: var(--text, var(--fg)); }
.score-q-of { font-size: 12px; color: var(--muted); margin: 0 0.15rem; }
.score-q-total { font-size: 1.1rem; font-weight: 700; color: var(--muted); }
.score-q--full .score-q-got { color: var(--green-600, #009427); }
.score-q--zero .score-q-got { color: var(--red-600, #b72935); }
.score-q--partial .score-q-got { color: var(--amber-700, #946f00); }

.score-subtasks { list-style: none; margin: 0; padding: 0.25rem 0; }
.score-subtask {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0.55rem 1.1rem;
    font-size: 13px;
    color: var(--text-body, var(--fg));
    border-top: 1px solid var(--border-subtle, var(--line));
}
.score-subtask:first-child { border-top: none; }
.score-subtask-label { flex: 1; min-width: 0; line-height: 1.4; }
.score-icon { flex-shrink: 0; display: inline-flex; align-items: center; justify-content: center; }
.score-icon--pass { color: var(--green-600, #009427); }
.score-icon--fail { color: var(--red-600, #b72935); }
.score-subtask.is-fail .score-subtask-label { color: var(--muted); }

.score-feedback {
    border-top: 1px solid var(--border-subtle, var(--line));
    padding: 0.65rem 1.1rem 0.9rem;
    font-size: 13px;
    color: var(--muted);
}
.score-feedback summary {
    cursor: pointer;
    font-weight: 600;
    color: var(--text, var(--fg));
    list-style: none;
    user-select: none;
}
.score-feedback summary::-webkit-details-marker { display: none; }
.score-feedback summary::before { content: "▸ "; color: var(--faint, var(--muted)); }
.score-feedback[open] summary::before { content: "▾ "; }
.score-feedback p { margin-top: 0.5rem; line-height: 1.55; color: var(--muted); }

.score-footer-nav {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    justify-content: space-between;
    margin-top: 2rem;
    padding-top: 1.25rem;
    border-top: 1px solid var(--border, var(--line));
}

@media (max-width: 640px) {
    .score-page { padding: 1.25rem 1rem 2.5rem; }
    .score-q-head { flex-direction: column; align-items: flex-start; }
}
