:root {
    --bg: #111418;
    --panel: #1b2026;
    --panel-2: #242b33;
    --text: #f5f7fa;
    --muted: #aab4c0;
    --accent: #52c653;
    --accent-dark: #2d8e35;
    --line: #343d47;
    --focus: #ffffff;
}

* { box-sizing: border-box; }

html { background: var(--bg); }

body {
    margin: 0;
    min-height: 100vh;
    background:
        radial-gradient(circle at top right, rgba(82, 198, 83, .10), transparent 32rem),
        var(--bg);
    color: var(--text);
    font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

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

.topbar {
    min-height: 76px;
    padding: 0 4vw;
    border-bottom: 1px solid var(--line);
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: rgba(17, 20, 24, .94);
    position: sticky;
    top: 0;
    z-index: 10;
}

.brand {
    font-size: 1.35rem;
    font-weight: 800;
    letter-spacing: .01em;
}

.page {
    width: min(1180px, 92vw);
    margin: 0 auto;
    padding: 42px 0 80px;
}

.hero { margin-bottom: 32px; }
.hero.compact { margin-bottom: 24px; }

.eyebrow {
    margin: 0 0 8px;
    color: var(--accent);
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: .12em;
    font-size: .82rem;
}

h1 {
    margin: 0;
    font-size: clamp(2rem, 4vw, 3.4rem);
    line-height: 1.05;
}

.subtle {
    margin: 12px 0 0;
    color: var(--muted);
    font-size: 1.08rem;
}

.card-grid {
    display: grid;
    gap: 20px;
}

.lesson-grid { grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); }
.session-grid { grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); }

.card {
    min-height: 190px;
    padding: 24px;
    border-radius: 18px;
    background: linear-gradient(145deg, var(--panel-2), var(--panel));
    border: 2px solid transparent;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    transition: transform .12s ease, border-color .12s ease, box-shadow .12s ease;
}

.card:hover { transform: translateY(-2px); }
.card h2 { margin: 8px 0 2px; font-size: 1.55rem; }
.card p { color: var(--muted); margin: 4px 0 0; }

.card-number {
    width: 56px;
    height: 56px;
    border-radius: 14px;
    background: var(--accent);
    color: #071008;
    display: grid;
    place-items: center;
    font-size: 1.5rem;
    font-weight: 900;
}

.segment-stack {
    width: min(900px, 100%);
    margin: 0 auto;
}

.segment-card {
    display: grid;
    grid-template-columns: 260px 1fr;
    overflow: hidden;
    border-radius: 18px;
    background: var(--panel);
    border: 3px solid transparent;
    min-height: 150px;
}

.thumb-wrap {
    position: relative;
    min-height: 150px;
    background: #050607;
    overflow: hidden;
}

.thumb-wrap img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.play-badge {
    position: absolute;
    left: 16px;
    bottom: 16px;
    width: 46px;
    height: 46px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    background: rgba(0,0,0,.78);
    font-size: 1.1rem;
}

.segment-copy {
    padding: 22px 26px;
    display: flex;
    gap: 20px;
    align-items: center;
}

.segment-copy h2 { font-size: 1.8rem; margin: 4px 0; }
.segment-copy p { color: var(--muted); margin: 0; }

.segment-code {
    color: var(--accent);
    font-size: .78rem;
    font-weight: 900;
    letter-spacing: .12em;
}

.status-mark {
    width: 44px;
    height: 44px;
    flex: 0 0 auto;
    border-radius: 50%;
    border: 2px solid var(--line);
    display: grid;
    place-items: center;
    font-size: 1.4rem;
    font-weight: 900;
}

.segment-card.completed .status-mark {
    background: var(--accent);
    color: #071008;
    border-color: var(--accent);
}

.discussion-break {
    text-align: center;
    padding: 16px 10px;
    color: var(--muted);
    font-weight: 700;
}

.discussion-break span::before,
.discussion-break span::after {
    content: " • ";
    color: var(--accent);
}

.primary-button,
.secondary-button,
.small-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    appearance: none;
    border: 2px solid transparent;
    border-radius: 12px;
    font: inherit;
    font-weight: 800;
    cursor: pointer;
}

.primary-button {
    background: var(--accent);
    color: #071008;
    padding: 14px 22px;
}

.secondary-button,
.small-button {
    background: var(--panel-2);
    color: var(--text);
}

.secondary-button { padding: 14px 22px; }
.small-button { padding: 10px 14px; }

.session-footer {
    width: min(900px, 100%);
    margin: 28px auto 0;
    text-align: center;
}

.video-shell {
    background: #000;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 18px 60px rgba(0,0,0,.35);
}

.video-shell video {
    width: 100%;
    max-height: 72vh;
    display: block;
    background: #000;
}

.player-heading { margin-bottom: 18px; }

.player-actions {
    margin-top: 18px;
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.player-note { color: var(--muted); }

.error-panel,
.empty-state {
    max-width: 760px;
    padding: 30px;
    border-radius: 18px;
    background: var(--panel);
    border: 1px solid var(--line);
}

.error-panel code { color: var(--accent); }

.focusable:focus,
.focusable.keyboard-focus {
    outline: none;
    border-color: var(--focus) !important;
    box-shadow: 0 0 0 5px rgba(82, 198, 83, .42);
}

@media (max-width: 720px) {
    .topbar { padding: 0 20px; }
    .page { width: min(94vw, 1180px); padding-top: 28px; }

    .segment-card {
        grid-template-columns: 1fr;
    }

    .thumb-wrap {
        min-height: 200px;
        max-height: 280px;
    }

    .segment-copy h2 { font-size: 1.45rem; }
}

.lesson-title {
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--text);
    margin-top: 6px;
}

.theme-title {
    margin: 10px 0 0;
    font-size: 1.6rem;
    color: var(--accent);
}

.session-title {
    font-size: 1.1rem;
    font-weight: 800;
    color: var(--text);
    margin: 8px 0 2px;
}

.session-subtitle {
    font-size: 0.95rem;
    color: var(--muted);
    margin: 0 0 8px;
    line-height: 1.35;
}
