/* ==========================================================================
   PlusPhysics hub page
   Department of Physics • D B Pampa College, Parumala
   Visual system (from the 2026-11 redesign): navy brand, amber accent used only as a fill with
   navy text, Space Grotesk headings, Inter body, JetBrains Mono for numbers.
   ========================================================================== */

:root {
    --navy: #0B1329;
    --navy-2: #111B36;
    --navy-3: #131D3B;
    --navy-line: #1A2647;
    --navy-line-2: #22305A;
    --navy-line-3: #33405F;
    --amber: #F5A524;
    --amber-ink: #FFE2A8;          /* amber-tinted text on navy */
    --bg: #F4F6FA;
    --card: #FFFFFF;
    --line: #E2E6EE;
    --line-2: #D5DAE3;
    --wash: #EEF2F8;
    --ink: #0B1329;
    --ink-2: #33405F;
    --muted: #4B5567;
    --on-dark: #C9D2E3;
    --on-dark-2: #A9B4CC;
    --link: #1D4ED8;
    --good: #0F7B4F;
    --good-wash: #E7F6EE;
    --font-display: 'Space Grotesk', 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
    --font-sans: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
    --font-mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, monospace;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { font-size: 16px; scroll-behavior: smooth; -webkit-font-smoothing: antialiased; -webkit-text-size-adjust: 100%; }

body {
    font-family: var(--font-sans);
    background: var(--bg);
    color: var(--ink);
    line-height: 1.55;
    min-height: 100vh;
}

[hidden] { display: none !important; }
a { color: var(--link); }
a:hover { color: var(--navy); }
button { font: inherit; color: inherit; }
h1, h2, h3 { font-family: var(--font-display); letter-spacing: -0.015em; text-wrap: balance; }

:where(a, button, input, select):focus-visible { outline: 2px solid #2563eb; outline-offset: 2px; }
.site-header :focus-visible, .hero :focus-visible, .site-footer :focus-visible,
.class11-strip :focus-visible, .admission-card :focus-visible { outline-color: var(--amber); }

.wrap { width: 100%; max-width: 1200px; margin: 0 auto; padding: 0 24px; }

.skip-link {
    position: absolute;
    left: 0.75rem;
    top: -4rem;
    z-index: 50;
    padding: 0.6rem 0.9rem;
    background: #fff;
    color: var(--navy);
    border: 2px solid var(--navy);
    border-radius: 8px;
    font-weight: 700;
}
.skip-link:focus { top: 0.75rem; }

/* ---------------------------------------------------------------- buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.6rem;
    min-height: 48px;
    padding: 0 20px;
    border: 1px solid transparent;
    border-radius: 12px;
    font: 600 15px/1.2 var(--font-sans);
    text-decoration: none;
    cursor: pointer;
    touch-action: manipulation;
    transition: background 0.15s, border-color 0.15s, filter 0.15s;
}
.btn svg { flex: none; }
.btn-lg { min-height: 52px; padding: 0 24px; font-size: 16px; }
.btn-amber { background: var(--amber); color: var(--navy); font-weight: 700; }
.btn-amber:hover { color: var(--navy); filter: brightness(1.06); }
.btn-navy { background: var(--navy); color: #fff; }
.btn-navy:hover { color: #fff; background: #1A2647; }
.btn-outline-dark { background: transparent; color: #fff; border-color: var(--navy-line-3); }
.btn-outline-dark:hover { color: #fff; background: rgba(255, 255, 255, 0.06); border-color: #4A5A80; }

/* ---------------------------------------------------------------- header */
.site-header { background: var(--navy); color: #fff; border-bottom: 1px solid var(--navy-line); }
.header-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding-top: 14px; padding-bottom: 14px; }
.brand { display: flex; align-items: center; gap: 12px; min-width: 0; color: #fff; text-decoration: none; }
.brand:hover { color: #fff; }
.brand-mark { flex: none; width: 48px; height: 48px; }
.brand-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.brand-name { font: 400 21px/1.1 var(--font-display); letter-spacing: -0.01em; color: #FFB02E; }
.brand-name strong { font-weight: 800; color: #fff; }
.brand-name .brand-physics { color: #FFB02E; }
.brand-sub { font-size: 12px; color: var(--on-dark-2); }

.site-nav { display: flex; align-items: center; flex-wrap: wrap; gap: 4px; }
.site-nav a {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-height: 44px;
    padding: 0 14px;
    border-radius: 8px;
    color: #fff;
    font-weight: 500;
    font-size: 15px;
    text-decoration: none;
}
.site-nav a:hover { color: #fff; background: var(--navy-line); }
.site-nav .soon { font-size: 11px; font-weight: 600; color: var(--navy); background: var(--on-dark-2); padding: 2px 7px; border-radius: 999px; }
.site-nav .nav-feedback { margin-left: 8px; border: 1px solid var(--navy-line-3); border-radius: 10px; font-weight: 600; font-size: 14px; }
.header-tools { display: none; gap: 4px; }
.icon-btn {
    display: inline-grid;
    place-items: center;
    width: 44px;
    height: 44px;
    border: 0;
    border-radius: 10px;
    background: transparent;
    color: #fff;
    cursor: pointer;
}
.icon-btn:hover { color: #fff; background: var(--navy-line); }
.icon-close { display: none; }
#menu-toggle[aria-expanded="true"] .icon-menu { display: none; }
#menu-toggle[aria-expanded="true"] .icon-close { display: block; }

/* ---------------------------------------------------------------- hero */
.hero {
    background: radial-gradient(circle at 80% 20%, rgba(47, 111, 237, 0.18), transparent 45%), var(--navy);
    color: #fff;
}
.hero-grid { display: flex; flex-wrap: wrap; align-items: center; gap: 56px; padding-top: 64px; padding-bottom: 128px; }
.hero-copy { flex: 1 1 480px; min-width: 0; display: flex; flex-direction: column; align-items: flex-start; gap: 24px; }
.hero-badge {
    font-size: 13px;
    font-weight: 600;
    color: var(--amber-ink);
    border: 1px solid #4A3E1F;
    background: rgba(245, 165, 36, 0.10);
    padding: 7px 12px;
    border-radius: 999px;
}
.hero-title { font-weight: 700; font-size: clamp(38px, 5vw, 62px); line-height: 1.04; letter-spacing: -0.025em; }
.hero-lead { font-size: 19px; line-height: 1.6; color: var(--on-dark); max-width: 540px; text-wrap: pretty; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; }
.hero-stats { display: flex; flex-wrap: wrap; gap: 32px; padding-top: 8px; }
.hero-stats div { display: flex; flex-direction: column-reverse; gap: 2px; }
.hero-stats dd { font: 700 28px/1.1 var(--font-display); }
.hero-stats dt { font-size: 13px; color: var(--on-dark-2); }

/* the featured lab: the real lab running live (embedded); the whole card opens it (stretched link) */
.feature-card {
    position: relative;
    flex: 1 1 420px;
    min-width: 0;
    display: flex;
    flex-direction: column;
    background: var(--navy-2);
    border: 1px solid var(--navy-line-2);
    border-radius: 20px;
    overflow: hidden;
    color: #fff;
    transition: border-color 0.15s, box-shadow 0.15s;
}
.feature-card:hover { border-color: #3A4A73; box-shadow: 0 18px 40px -20px rgba(0, 0, 0, 0.6); }
.feature-card:hover .feature-go { text-decoration: underline; text-underline-offset: 3px; }
.feature-card:focus-within { outline: 2px solid var(--amber); outline-offset: 2px; }
.feature-link { color: #fff; text-decoration: none; }
.feature-link:hover { color: #fff; }
.feature-link:focus-visible { outline: none; }
.feature-link::after { content: ''; position: absolute; inset: 0; z-index: 2; } /* the whole card is the link */
.feature-stage {
    position: relative;
    display: block;
    aspect-ratio: 52 / 33;
    background: #060911;
}
.feature-poster, .feature-sim {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    display: block;
    border: 0;
}
.feature-poster { object-fit: cover; }
.feature-sim { opacity: 0; transition: opacity 0.5s ease; pointer-events: none; background: #060911; }
.feature-sim.is-live { opacity: 1; }
.feature-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 20px; border-top: 1px solid var(--navy-line-2); }
.feature-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.feature-kicker { font-size: 12px; font-weight: 600; color: var(--on-dark-2); }
.feature-title { font-weight: 600; font-size: 16px; line-height: 1.3; }
.feature-desc { font-size: 13px; line-height: 1.45; color: var(--on-dark); margin-top: 2px; }
.feature-go { flex: none; display: inline-flex; align-items: center; gap: 6px; font-weight: 600; font-size: 14px; color: var(--amber-ink); }

/* ---------------------------------------------------------------- progress card (overlaps the hero) */
.progress-wrap { margin-top: -72px; position: relative; z-index: 2; }
.progress-card {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 24px 40px;
    padding: 24px 28px;
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: 18px;
    box-shadow: 0 14px 40px rgba(11, 19, 41, 0.08);
}
.pc-copy { flex: 1 1 320px; min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.pc-copy h2 { font-weight: 600; font-size: 20px; line-height: 1.3; }
.pc-copy p { font-size: 14px; color: var(--muted); line-height: 1.5; }
.pc-copy p a { font-weight: 600; }
.pc-meter { flex: 1 1 260px; min-width: 0; display: flex; flex-direction: column; gap: 8px; }
.pc-meter-row { display: flex; justify-content: space-between; font-size: 13px; font-weight: 600; }
.pc-count { font-family: var(--font-mono); font-variant-numeric: tabular-nums; }
.pc-bar { height: 8px; background: #E9EDF3; border-radius: 999px; overflow: hidden; }
.pc-bar span { display: block; height: 100%; width: 0; background: var(--navy); border-radius: inherit; transition: width 0.3s ease; }
.pc-note { font-size: 12px; color: var(--muted); }
.pc-note button {
    margin-left: 4px;
    padding: 6px 2px;
    background: none;
    border: 0;
    color: var(--link);
    font-weight: 600;
    text-decoration: underline;
    text-underline-offset: 3px;
    cursor: pointer;
}
.progress-card .btn { flex: none; }

/* ---------------------------------------------------------------- catalogue */
.catalogue { display: flex; flex-direction: column; gap: 24px; padding-top: 72px; padding-bottom: 24px; }
.cat-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 20px; }
.cat-head h2, .section-head h2 { font-weight: 700; font-size: 38px; line-height: 1.15; letter-spacing: -0.02em; }
.cat-head p, .section-head p { margin-top: 8px; font-size: 16px; color: var(--muted); }

.class-toggle { display: flex; gap: 4px; padding: 4px; background: #E9EDF3; border-radius: 14px; }
.switcher-tab {
    min-height: 44px;
    padding: 0 18px;
    border: 0;
    border-radius: 10px;
    background: transparent;
    color: var(--ink);
    font: 600 15px/1.2 var(--font-sans);
    cursor: pointer;
    touch-action: manipulation;
}
.switcher-tab span { font-weight: 500; color: var(--muted); }
.switcher-tab.active { background: var(--card); box-shadow: 0 1px 3px rgba(11, 19, 41, 0.15); }
.switcher-tab:not(.active):hover { background: rgba(255, 255, 255, 0.5); }

.curriculum-panel { display: none; flex-direction: column; gap: 20px; }
.curriculum-panel.active { display: flex; }

/* sticky search + topic chips */
.hub-toolbar {
    position: sticky;
    top: 8px;
    z-index: 10;
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 14px;
    background: rgba(255, 255, 255, 0.96);
    -webkit-backdrop-filter: blur(8px);
    backdrop-filter: blur(8px);
    border: 1px solid var(--line);
    border-radius: 18px;
    box-shadow: 0 8px 24px -16px rgba(11, 19, 41, 0.35);
    scroll-margin-top: 16px;
}
.search-box { position: relative; display: flex; align-items: center; }
.search-box > svg { position: absolute; left: 16px; color: var(--muted); pointer-events: none; }
.search-box input {
    width: 100%;
    min-height: 52px;
    padding: 0 52px 0 48px;
    border: 1.5px solid var(--line-2);
    border-radius: 12px;
    background: #fff;
    color: var(--ink);
    font: 500 16px var(--font-sans);
    -webkit-appearance: none;
    appearance: none;
    transition: border-color 0.15s, box-shadow 0.15s;
}
.search-box input::placeholder { color: #6B7488; }
.search-box input::-webkit-search-cancel-button { display: none; }
.search-box input:focus { outline: none; border-color: var(--navy); box-shadow: 0 0 0 3px rgba(11, 19, 41, 0.12); }
.search-kbd {
    position: absolute;
    right: 14px;
    padding: 1px 8px;
    border: 1px solid var(--line-2);
    border-bottom-width: 2px;
    border-radius: 6px;
    background: var(--bg);
    color: var(--muted);
    font: 600 12px/1.5 var(--font-mono);
    pointer-events: none;
}
.search-box input:focus ~ .search-kbd, .search-box input:not(:placeholder-shown) ~ .search-kbd { display: none; }
.search-clear-btn {
    position: absolute;
    right: 6px;
    width: 44px;
    height: 44px;
    border: 0;
    border-radius: 10px;
    background: none;
    color: var(--muted);
    font-size: 24px;
    line-height: 1;
    cursor: pointer;
}
.search-clear-btn:hover { color: var(--ink); background: var(--wash); }

.topic-filters { display: flex; flex-wrap: wrap; gap: 6px; }
.filter-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-height: 40px;
    padding: 0 4px 0 11px;
    border: 1px solid var(--line-2);
    border-radius: 999px;
    background: #fff;
    color: var(--ink);
    font: 600 13.5px/1.2 var(--font-sans);
    white-space: nowrap;
    cursor: pointer;
    touch-action: manipulation;
    transition: background 0.15s, border-color 0.15s, color 0.15s;
}
@media (pointer: coarse) { .filter-chip { min-height: 44px; } }
.filter-chip:hover { border-color: var(--navy); }
.chip-count {
    min-width: 24px;
    height: 26px;
    padding: 0 6px;
    display: inline-grid;
    place-items: center;
    border-radius: 999px;
    background: var(--wash);
    color: var(--muted);
    font: 600 12px/1 var(--font-mono);
}
.filter-chip.active { background: var(--navy); border-color: var(--navy); color: #fff; }
.filter-chip.active .chip-count { background: var(--navy-line-3); color: #fff; }

.toolbar-foot { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 4px 12px; min-height: 28px; }
.result-count { font-size: 14px; color: var(--muted); font-variant-numeric: tabular-nums; }
.clear-filters {
    min-height: 36px;
    padding: 0 10px;
    border: 0;
    border-radius: 8px;
    background: transparent;
    color: var(--link);
    font: 600 14px var(--font-sans);
    cursor: pointer;
}
.clear-filters:hover { background: var(--wash); }

/* chapter cards */
.chapters-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(min(100%, 340px), 1fr));
    gap: 20px;
    align-items: start;
}
.chapter-card {
    display: flex;
    flex-direction: column;
    min-width: 0;
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: 18px;
    scroll-margin-top: 240px; /* clears the sticky toolbar, also when its chips wrap to two rows */
    transition: border-color 0.15s, box-shadow 0.15s, transform 0.15s;
}
.chapter-card:hover { border-color: #B8C0CE; box-shadow: 0 10px 30px rgba(11, 19, 41, 0.07); }
.chapter-card.is-target { animation: targetPulse 1.6s ease-out 1; }
@keyframes targetPulse {
    0% { box-shadow: 0 0 0 3px rgba(245, 165, 36, 0.9); border-color: var(--amber); }
    100% { box-shadow: 0 0 0 3px rgba(245, 165, 36, 0); }
}
.chapter-header { position: relative; display: flex; flex-direction: column; gap: 10px; padding: 22px 22px 14px; }
.chapter-meta { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.chapter-number { font: 600 13px/1 var(--font-mono); color: var(--muted); text-transform: uppercase; }
.category-tag { font-size: 12px; font-weight: 600; padding: 5px 10px; border-radius: 999px; background: var(--wash); color: var(--ink-2); }
.chapter-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; font-weight: 600; font-size: 22px; line-height: 1.22; letter-spacing: -0.01em; }
/* phones only: opens and closes the chapter's lab list */
.chapter-toggle {
    display: none;
    flex: none;
    place-items: center;
    width: 32px;
    height: 32px;
    margin: -4px -6px 0 0;
    padding: 0;
    border: 0;
    border-radius: 8px;
    background: none;
    color: var(--muted);
    cursor: pointer;
}
.chapter-toggle svg { transition: transform 0.2s ease; }
/* compact cards (all widths): the whole header opens the chapter; its labs show only when open */
.chapter-toggle { display: grid; }
.chapter-toggle[aria-expanded="true"] svg { transform: rotate(90deg); }
.chapter-toggle::after { content: ''; position: absolute; inset: 0; border-radius: 18px; }
.chapter-card { cursor: pointer; }
.chapter-card:not(.is-collapsed) { cursor: auto; }
.chapter-card.is-collapsed .sim-list { display: none; }
.chapter-card.is-collapsed .chapter-header { min-height: 250px; }
.chapter-card.is-collapsed:hover { border-color: var(--navy); box-shadow: 0 10px 30px rgba(11, 19, 41, 0.10); transform: translateY(-2px); }
.chapter-foot { margin-top: auto; }
.chapter-desc { font-size: 14px; line-height: 1.55; color: var(--muted); }
.chapter-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding-top: 12px; border-top: 1px solid #EEF1F5; }
.lab-dots { display: flex; gap: 6px; min-height: 10px; align-items: center; }
.lab-dots i { width: 10px; height: 10px; border-radius: 999px; border: 1.5px solid #7A8499; background: #fff; }
.lab-dots i.is-seen { border-color: var(--navy); background: var(--navy); }
.lab-dots i.is-mastered { border-color: var(--good); background: var(--good); }
.chapter-progress-text { font-size: 13px; font-weight: 600; color: var(--ink-2); font-variant-numeric: tabular-nums; }

.sim-list { list-style: none; display: flex; flex-direction: column; padding: 0 12px 12px; }
.sim-link {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: start;
    gap: 10px;
    min-height: 44px;
    padding: 10px;
    border-radius: 10px;
    color: var(--ink);
    font-size: 15px;
    font-weight: 600;
    line-height: 1.4;
    text-decoration: none;
    transition: background 0.12s;
}
.sim-link:hover { background: var(--bg); color: var(--ink); }
.sim-no { font: 600 12px/1.9 var(--font-mono); color: var(--muted); font-variant-numeric: tabular-nums; }
.sim-name { min-width: 0; overflow-wrap: anywhere; }
.sim-name mark { background: #FFE2A8; color: inherit; border-radius: 3px; padding: 0 1px; }
.sim-state { min-width: 22px; text-align: center; font: 700 11px/1.9 var(--font-mono); color: transparent; border-radius: 999px; }
.sim-state::before { content: '\203A'; color: #9AA3B5; font: 400 20px/1 var(--font-sans); }
.sim-link:hover .sim-state::before { color: var(--navy); }
.sim-link.is-seen .sim-state { color: var(--good); background: var(--good-wash); padding: 0 8px; }
.sim-link.is-seen .sim-state::before { content: none; }
.sim-link.is-mastered .sim-state { background: var(--good); color: #fff; }
.sim-link.is-planned { opacity: 0.7; cursor: default; }
.sim-link.is-planned:hover { background: transparent; color: inherit; }
.sim-badge-live {
    background: #dcfce7;
    color: #15803d;
    font-size: 11px;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 999px;
    border: 1px solid #86efac;
    display: inline-flex;
    align-items: center;
}
.sim-badge-dev {
    background: #fef3c7;
    color: #b45309;
    font-size: 11px;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 999px;
    border: 1px solid #fde68a;
    display: inline-flex;
    align-items: center;
}
.sim-badge-plan {
    background: #f1f5f9;
    color: #64748b;
    font-size: 11px;
    font-weight: 500;
    padding: 2px 8px;
    border-radius: 999px;
    border: 1px solid #e2e8f0;
    display: inline-flex;
    align-items: center;
}

/* ---------------------------------------------------------------- levels, badges, missions (2026-11)
   Each lab shows a three-part ring: 1 explored (its controls used), 2 self-checked, 3 mastered (all right). */
.lv-ring {
    --off: #D5DAE3;
    --s1: var(--off); --s2: var(--off); --s3: var(--off);
    position: relative;
    display: inline-block;
    flex: none;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: conic-gradient(var(--s1) 0deg 112deg, transparent 112deg 120deg, var(--s2) 120deg 232deg, transparent 232deg 240deg, var(--s3) 240deg 352deg, transparent 352deg 360deg);
}
.lv-ring::after { content: ''; position: absolute; inset: 4px; border-radius: 50%; background: var(--card); }
.lv-1 { --s1: var(--navy); }
.lv-2 { --s1: var(--navy); --s2: var(--navy); }
.lv-3 { --s1: var(--good); --s2: var(--good); --s3: var(--good); }
.sim-link .sim-state.lv-ring { min-width: 0; margin-top: 1px; padding: 0; color: transparent; }
.sim-link .sim-state.lv-ring::before { content: none; }
.sim-link:hover .sim-state.lv-ring::after { background: var(--bg); }

.pc-levels { list-style: none; display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: 13px; color: var(--ink-2); }
.pc-levels li { display: inline-flex; align-items: center; gap: 6px; }
.pc-levels b { font-family: var(--font-mono); font-weight: 600; color: var(--ink); font-variant-numeric: tabular-nums; }
.pc-levels .lv-ring { width: 18px; height: 18px; }
.pc-levels .lv-ring::after { inset: 3.5px; }
.pc-week { font-size: 13px; font-weight: 600; color: var(--ink-2); }

.badges-card {
    margin-top: 20px;
    padding: 22px 28px 24px;
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: 18px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}
.badges-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 4px 16px; }
.badges-head h2 { font-family: var(--font-display); font-weight: 700; font-size: 22px; line-height: 1.2; }
.badges-head p { font-size: 14px; color: var(--muted); max-width: 62ch; }
.badge-list { list-style: none; display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 12px; }
.badge { display: flex; gap: 12px; align-items: flex-start; padding: 12px; border: 1px solid var(--line); border-radius: 14px; background: var(--card); min-width: 0; }
.badge-icon {
    flex: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #5B667D;
    border: 2px dashed #7A849A;
}
.badge.is-earned .badge-icon { background: var(--amber); border: 0; color: var(--navy); }
.badge-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.badge-top { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.badge-top strong { font-size: 14px; font-weight: 700; }
.badge-count { flex: none; font: 600 12px/1.4 var(--font-mono); color: var(--ink-2); font-variant-numeric: tabular-nums; }
.badge.is-earned .badge-count { color: var(--good); }
.badge-rule { font-size: 12.5px; line-height: 1.45; color: var(--muted); }
.badge-meter { display: block; height: 5px; margin-top: 2px; border-radius: 999px; background: #E9EDF3; overflow: hidden; }
.badge-meter span { display: block; height: 100%; background: #D48806; border-radius: inherit; }
.badge.is-earned .badge-meter span { background: var(--good); }

.mission-callout {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px 16px;
    padding: 14px 16px;
    border-radius: 14px;
    background: var(--navy);
    color: #fff;
}
.mission-callout[hidden] { display: none; }
.mc-tag { flex: none; font: 700 11px/1 var(--font-mono); letter-spacing: 0.08em; text-transform: uppercase; color: var(--navy); background: var(--amber); border-radius: 6px; padding: 5px 7px; }
.mc-text { flex: 1 1 280px; min-width: 0; font-size: 14px; line-height: 1.5; color: var(--on-dark); }
.mc-text strong { color: #fff; }
.mission-callout .btn { flex: none; }

.chapter-cert {
    position: relative;
    z-index: 3; /* above the card-wide toggle */
    margin-left: auto;
    font-size: 13px;
    font-weight: 700;
    color: var(--navy);
    background: var(--amber);
    border-radius: 999px;
    padding: 4px 10px;
    text-decoration: none;
}
.chapter-cert:hover { color: var(--navy); filter: brightness(1.06); }

.no-results {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    padding: 40px 24px;
    text-align: center;
    background: var(--card);
    border: 1px dashed #B8C0CE;
    border-radius: 16px;
}
.no-results h3 { font-weight: 600; font-size: 20px; }
.no-results p { font-size: 15px; color: var(--muted); }
.no-results .btn { margin-top: 6px; }

.class11-strip {
    margin-top: 12px;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    padding: 28px 32px;
    background: var(--navy);
    color: #fff;
    border-radius: 20px;
}
.class11-strip > div:first-child { flex: 1 1 380px; min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.class11-strip h3 { font-weight: 600; font-size: 22px; }
.class11-strip p { font-size: 15px; color: var(--on-dark); }
.strip-actions { display: flex; flex-wrap: wrap; gap: 10px; }

/* Class 11 roadmap */
.roadmap-lead { font-size: 16px; color: var(--muted); max-width: 64ch; }
.roadmap-legend { display: flex; flex-wrap: wrap; gap: 16px; font-size: 14px; color: var(--muted); }
.roadmap-legend span { display: inline-flex; align-items: center; gap: 8px; }
.roadmap-legend span::before { content: ''; width: 10px; height: 10px; border-radius: 999px; }
.lg-proto::before { background: #C77800; }
.lg-blue::before { background: #7A8499; }
.unit-list { list-style: none; display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 360px), 1fr)); gap: 12px; }
.unit-card {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    align-content: start;
    gap: 8px 16px;
    padding: 16px 18px;
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: 14px;
}
.unit-no { grid-column: 1; grid-row: 1; font: 600 14px/1.6 var(--font-mono); color: var(--muted); white-space: nowrap; }
.unit-body { grid-column: 1 / -1; display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.unit-body strong { font-size: 16px; line-height: 1.35; }
.unit-body span { font-size: 14px; line-height: 1.5; color: var(--muted); }
.unit-status { grid-column: 2; grid-row: 1; font-size: 12px; font-weight: 600; padding: 5px 10px; border-radius: 999px; background: var(--wash); color: var(--ink-2); white-space: nowrap; }
.unit-card.is-proto { border-color: #F2D7A6; }
.unit-card.is-proto .unit-status { background: #FFF1D6; color: #6B4100; }
.roadmap-cta { align-self: flex-start; }

/* ---------------------------------------------------------------- how it works */
.how { display: flex; flex-direction: column; gap: 28px; padding-top: 72px; padding-bottom: 72px; }
.section-head { max-width: 640px; }
.steps { list-style: none; display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr)); gap: 20px; }
.steps li { display: flex; flex-direction: column; gap: 12px; padding: 26px; background: var(--card); border: 1px solid var(--line); border-radius: 18px; }
.step-no { width: 44px; height: 44px; display: grid; place-items: center; border-radius: 12px; background: var(--navy); color: #fff; font: 700 18px var(--font-display); }
.steps h3 { font-weight: 600; font-size: 22px; }
.steps p { font-size: 15px; line-height: 1.6; color: var(--muted); }

/* ---------------------------------------------------------------- about */
.about { background: var(--card); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.about-grid { display: flex; flex-wrap: wrap; gap: 40px; padding-top: 64px; padding-bottom: 64px; }
.about-copy { flex: 2 1 480px; min-width: 0; display: flex; flex-direction: column; gap: 14px; }
.about-copy h2 { font-weight: 700; font-size: 32px; line-height: 1.2; letter-spacing: -0.02em; }
.about-copy p { font-size: 16px; line-height: 1.7; color: var(--muted); max-width: 68ch; }
.about-credit { flex: 1 1 280px; min-width: 0; align-self: flex-start; display: flex; flex-direction: column; gap: 8px; padding: 24px; border-radius: 16px; background: var(--bg); }
.about-credit span { font-size: 14px; line-height: 1.5; color: var(--muted); }
.about-credit strong { font: 600 20px/1.3 var(--font-display); }

/* ---------------------------------------------------------------- admission card (Standard 4.3) */
.admission-wrap { padding-top: 48px; padding-bottom: 48px; }
.admission-card {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    width: 100%;
    padding: 2.25rem 2rem;
    background: linear-gradient(135deg, #1e3a8a, #0f172a);
    color: #fff;
    border: 1px solid rgba(251, 191, 36, 0.4);
    border-radius: 20px;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
}
.attention-flash { animation: bannerGlowPulse 3s infinite ease-in-out; }
@keyframes bannerGlowPulse {
    0%, 100% { box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1); border-color: rgba(251, 191, 36, 0.2); }
    50% { box-shadow: 0 0 22px 5px rgba(251, 191, 36, 0.45); border-color: rgba(251, 191, 36, 0.7); }
}
.promo-copy { display: flex; flex-direction: column; gap: 0.25rem; }
.promo-kicker { font-size: 0.82rem; letter-spacing: 0.04em; color: #fbbf24; font-weight: 700; }
.promo-lead { font-size: 1.1rem; color: #e2e8f0; font-weight: 500; }
.promo-headline { font-size: clamp(1.4rem, 1.1rem + 1.2vw, 1.85rem); font-weight: 700; line-height: 1.2; }
.program-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr)); gap: 1rem; }
.program-card { display: flex; flex-direction: column; gap: 0.35rem; padding: 1.15rem; background: rgba(255, 255, 255, 0.06); border: 1px solid rgba(255, 255, 255, 0.12); border-radius: 14px; }
.program-card strong { font-size: 1.15rem; color: #fbbf24; }
.program-card span { font-size: 0.86rem; color: #e2e8f0; }
.program-card small { font-size: 0.78rem; color: #a5b4c8; }
.promo-actions { display: flex; flex-wrap: wrap; gap: 1rem; }
.promo-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 48px;
    padding: 0 1.65rem;
    border-radius: 12px;
    font-size: 0.95rem;
    font-weight: 700;
    text-decoration: none;
    transition: background 0.15s, border-color 0.15s;
}
.promo-button.main-cta { background: var(--amber); color: var(--navy); }
.promo-button.main-cta:hover { color: var(--navy); filter: brightness(1.06); }
.promo-button.sub-cta { color: #fff; border: 1.5px solid rgba(255, 255, 255, 0.4); }
.promo-button.sub-cta:hover { color: #fff; background: rgba(255, 255, 255, 0.1); border-color: #fff; }

/* ---------------------------------------------------------------- footer + feedback (Standards 4.4 / 4.5) */
.site-footer { background: var(--navy); color: #fff; }
.site-footer .wrap { display: flex; flex-direction: column; gap: 32px; padding-top: 48px; padding-bottom: 32px; }
.footer-top { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 32px; }
.feedback-card { flex: 1 1 320px; min-width: 0; display: flex; flex-direction: column; align-items: flex-start; gap: 10px; }
.feedback-card h2 { font-weight: 700; font-size: 22px; }
.feedback-card p { font-size: 15px; line-height: 1.6; color: var(--on-dark); max-width: 52ch; }
.feedback-card .btn { margin-top: 6px; }
.feedback-mail { font: 500 14px var(--font-mono); color: var(--on-dark); padding: 6px 0; }
.feedback-mail:hover { color: #fff; }
.footer-nav { display: flex; flex-wrap: wrap; gap: 48px; }
.footer-nav div { display: flex; flex-direction: column; gap: 2px; }
.footer-nav h3 { font: 600 13px var(--font-sans); letter-spacing: 0; color: var(--on-dark-2); padding-bottom: 6px; }
.footer-nav a { color: #fff; text-decoration: none; padding: 9px 0; font-size: 15px; }
.footer-nav a:hover { color: var(--amber-ink); text-decoration: underline; text-underline-offset: 3px; }
.series-footer { border-top: 1px solid var(--navy-line); padding-top: 20px; font-size: 13px; color: var(--on-dark-2); }

/* ==========================================================================
   Responsive
   ========================================================================== */
@media (max-width: 1100px) {
    .site-nav a { padding: 0 10px; }
}

/* header collapses into a menu */
@media (max-width: 900px) {
    .header-row { flex-wrap: wrap; padding-top: 10px; padding-bottom: 10px; }
    .header-tools { display: flex; }
    .site-nav { display: none; flex: 1 1 100%; flex-direction: column; align-items: stretch; gap: 2px; padding: 8px 0 6px; border-top: 1px solid var(--navy-line); }
    .site-nav.is-open { display: flex; }
    .site-nav a { min-height: 48px; padding: 0 12px; font-size: 16px; }
    .site-nav .nav-feedback { margin: 6px 0 0; justify-content: center; }
    /* tablets: the demo spans the width, so keep it wide and short */
    .feature-card { flex-basis: 100%; }
    .feature-stage { aspect-ratio: 2 / 1; }  /* wide and short; the machine sits inside the crop */
}

@media (max-width: 680px) {
    .wrap { padding: 0 16px; }
    .badges-card { padding: 18px 16px 18px; border-radius: 14px; }
    /* phones: badges swipe sideways inside their own row, so the labs stay near the top of the page */
    .badge-list { grid-template-columns: none; grid-auto-flow: column; grid-auto-columns: minmax(240px, 80%); overflow-x: auto; scroll-snap-type: x mandatory; padding-bottom: 6px; overscroll-behavior-x: contain; }
    .badge { scroll-snap-align: start; }
    .brand-mark { width: 38px; height: 38px; }
    .brand-name { font-size: 19px; }
    .brand-sub { display: none; }

    .hero-grid { gap: 24px; padding-top: 28px; padding-bottom: 100px; }
    .hero-copy { gap: 16px; }
    .hero-badge { font-size: 12px; padding: 5px 10px; }
    .hero-lead { font-size: 16px; }
    .hero-actions { width: 100%; flex-direction: column; gap: 10px; }
    .hero-actions .btn { width: 100%; }
    .hero-stats { width: 100%; justify-content: space-between; gap: 12px; padding-top: 0; }
    .hero-stats dd { font-size: 22px; }
    .hero-stats dt { font-size: 12px; max-width: 12ch; }
    .feature-card { flex-basis: 100%; border-radius: 16px; }
    .feature-stage { aspect-ratio: 2 / 1; }
    .feature-foot { padding: 12px 14px; }
    .feature-desc { display: none; }
    .feature-title { font-size: 15px; }

    .progress-wrap { margin-top: -76px; }
    .progress-card { gap: 16px; padding: 18px; border-radius: 16px; }
    .pc-copy h2 { font-size: 18px; }
    .progress-card .btn { width: 100%; }

    .catalogue { gap: 18px; padding-top: 48px; }
    .cat-head { gap: 14px; }
    .cat-head h2, .section-head h2 { font-size: 30px; }
    .class-toggle { width: 100%; }
    .switcher-tab { flex: 1; min-height: 52px; padding: 4px 8px; font-size: 15px; line-height: 1.25; }
    .switcher-tab span { display: block; font-size: 12.5px; }

    /* the sticky toolbar stays short on a phone: chips scroll sideways, counts go */
    .hub-toolbar { top: 6px; gap: 10px; padding: 10px; border-radius: 14px; }
    .search-box input { min-height: 48px; }
    .search-kbd { display: none; }
    .topic-filters { flex-wrap: nowrap; overflow-x: auto; margin: 0 -10px; padding: 0 10px 2px; scrollbar-width: none; }
    .topic-filters::-webkit-scrollbar { display: none; }
    .filter-chip { flex: none; padding: 0 14px; }
    .filter-chip .chip-count { display: none; }
    .result-count { font-size: 13px; }

    /* chapter cards become rows that open to show their labs (script.js manages the state) */
    .chapters-grid { gap: 10px; }
    .chapter-card { border-radius: 14px; scroll-margin-top: 186px; } /* clears the sticky toolbar */
    .chapter-header { gap: 8px; padding: 14px 14px 12px; }
    .chapter-heading { font-size: 18px; }
    /* phones: a closed chapter is a short row */
    .chapter-card.is-collapsed .chapter-header { min-height: 0; }
    .chapter-card.is-collapsed .chapter-desc { display: none; }
    .chapter-card.is-collapsed .chapter-foot { padding-top: 0; border-top: 0; }
    .chapter-card.is-collapsed:hover { transform: none; }
    .sim-list { padding: 0 6px 8px; }
    .sim-link { font-size: 14.5px; padding: 10px 8px; min-height: 48px; align-items: center; }

    .class11-strip { padding: 22px 18px; border-radius: 16px; }
    .class11-strip h3 { font-size: 20px; }
    .strip-actions { width: 100%; }
    .strip-actions .btn { flex: 1 1 auto; }

    .unit-card { padding: 14px; }

    .how { gap: 20px; padding-top: 56px; padding-bottom: 56px; }
    .steps { gap: 12px; }
    .steps li { flex-direction: row; flex-wrap: wrap; align-items: center; gap: 10px 14px; padding: 18px; }
    .steps li p { flex: 1 1 100%; }
    .step-no { width: 40px; height: 40px; font-size: 16px; }
    .steps h3 { font-size: 19px; }

    .about-grid { gap: 20px; padding-top: 44px; padding-bottom: 44px; }
    .about-copy h2 { font-size: 24px; }
    .about-copy p { font-size: 15px; }

    .admission-wrap { padding-top: 32px; padding-bottom: 32px; }
    .admission-card { padding: 1.5rem 1.15rem; border-radius: 16px; }
    .promo-actions { flex-direction: column; }
    .promo-button { width: 100%; }

    .site-footer .wrap { padding-top: 36px; }
    .footer-nav { gap: 32px; }
}

@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    .attention-flash, .chapter-card.is-target { animation: none; }
    *, *::before, *::after { transition: none !important; }
}
