/* ============================================================
   AMRIT GITA
   CHAPTER PAGE STYLESHEET
   File: css/chapter.css

   Scope:
   - body.chapter-page

   Notes:
   - Hero orbit is styled here; coordinates are controlled by JS.
   - Chapter Journey uses a full-height blue CSS starfield.
   - Old black-hole/asteroid canvas is disabled in CSS.
   - Timeline numbers 01–18 never blink/disappear.
============================================================ */


/* ============================================================
   PAGE SAFETY
============================================================ */

body.chapter-page {
    background: #07111f;
}

body.chapter-page .chapter-main {
    position: relative;
    overflow: hidden;
}

body.chapter-page [hidden] {
    display: none !important;
}

body.chapter-page .chapter-small-label {
    display: block;
    margin-bottom: 8px;
    color: var(--ag-gold-dark);
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}


/* ============================================================
   HERO
============================================================ */

body.chapter-page .chapter-hero {
    position: relative;
    padding: calc(var(--ag-header-height) + 26px) 0 32px;
    overflow: hidden;
    background:
        radial-gradient(circle at 16% 18%, rgba(239, 172, 67, 0.10), transparent 20%),
        radial-gradient(circle at 84% 30%, rgba(223, 151, 46, 0.11), transparent 26%),
        linear-gradient(135deg, #061321 0%, #091a2e 46%, #102b4a 100%);
}

body.chapter-page .chapter-hero::before {
    content: "";
    position: absolute;
    inset: 0;
    background:
        linear-gradient(
            115deg,
            rgba(255, 255, 255, 0.018),
            transparent 30%,
            transparent 72%,
            rgba(236, 173, 70, 0.035)
        );
    pointer-events: none;
}

body.chapter-page .chapter-hero-glow {
    position: absolute;
    inset: 0;
    background:
        radial-gradient(circle at 76% 45%, rgba(239, 167, 54, 0.13), transparent 27%),
        radial-gradient(circle at 20% 32%, rgba(255, 209, 137, 0.055), transparent 23%);
    pointer-events: none;
}


/* ============================================================
   HERO CARD
============================================================ */

body.chapter-page .chapter-hero-card {
    position: relative;
    z-index: 2;
    display: grid;
    grid-template-columns: minmax(0, 1.06fr) minmax(360px, 0.94fr);
    align-items: center;
    gap: 34px;
    min-height: 410px;
    padding: 34px 38px;
    overflow: hidden;
    border: 1px solid rgba(232, 193, 128, 0.15);
    border-radius: 32px;
    background:
        radial-gradient(circle at 82% 30%, rgba(226, 161, 61, 0.075), transparent 30%),
        linear-gradient(145deg, rgba(7, 20, 37, 0.94), rgba(12, 31, 54, 0.96));
    box-shadow:
        0 28px 80px rgba(0, 0, 0, 0.28),
        inset 0 1px 0 rgba(255, 255, 255, 0.035);
}

body.chapter-page .chapter-hero-card::before {
    content: "ॐ";
    position: absolute;
    right: -38px;
    bottom: -92px;
    color: rgba(238, 180, 87, 0.025);
    font-family: "Nirmala UI", "Mangal", serif;
    font-size: 290px;
    line-height: 1;
    pointer-events: none;
}

body.chapter-page .chapter-hero-card::after {
    content: "";
    position: absolute;
    width: 260px;
    height: 260px;
    left: -120px;
    top: -120px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(222, 155, 53, 0.08), transparent 70%);
    pointer-events: none;
}


/* ============================================================
   HERO CONTENT
============================================================ */

body.chapter-page .chapter-hero-content {
    position: relative;
    z-index: 3;
    max-width: 710px;
}

body.chapter-page .chapter-page-kicker {
    width: fit-content;
    display: inline-flex;
    align-items: center;
    gap: 11px;
    margin-bottom: 22px;
    padding: 11px 17px;
    border: 1px solid rgba(237, 193, 123, 0.22);
    border-radius: 999px;
    color: #f0c985;
    background: rgba(255, 248, 235, 0.055);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.035);
    font-size: 12px;
    font-weight: 850;
}

body.chapter-page .chapter-page-kicker span:first-child,
body.chapter-page .chapter-kicker-symbol {
    color: #f0ae4d;
    font-family: "Nirmala UI", "Mangal", serif;
    font-size: 25px;
    line-height: 1;
}

body.chapter-page .chapter-hero-content h1 {
    max-width: 670px;
    margin: 0 0 18px;
    color: #fff5e5;
    font-size: clamp(46px, 5vw, 70px);
    font-weight: 900;
    line-height: 0.96;
    letter-spacing: -0.05em;
}

body.chapter-page .chapter-hero-content h1 span {
    display: block;
    margin-top: 8px;
    color: #e87908;
}

body.chapter-page .chapter-hero-content > p {
    max-width: 670px;
    margin: 0 0 25px;
    color: #d4c1a9;
    font-size: 16px;
    line-height: 1.72;
}


/* ============================================================
   HERO USER CONTEXT
============================================================ */

body.chapter-page .chapter-user-context {
    width: fit-content;
    min-width: 350px;
    display: flex;
    align-items: stretch;
    overflow: hidden;
    border: 1px solid rgba(235, 195, 132, 0.14);
    border-radius: 18px;
    background:
        linear-gradient(
            180deg,
            rgba(255, 255, 255, 0.060),
            rgba(255, 255, 255, 0.035)
        );
    box-shadow: 0 14px 34px rgba(0, 0, 0, 0.14);
}

body.chapter-page .chapter-context-item {
    min-width: 142px;
    display: flex;
    flex-direction: column;
    padding: 15px 20px;
}

body.chapter-page .chapter-context-item > span {
    margin-bottom: 4px;
    color: #a99a87;
    font-size: 9px;
    font-weight: 850;
    letter-spacing: 0.10em;
    text-transform: uppercase;
}

body.chapter-page .chapter-context-item strong {
    color: #fff2dd;
    font-size: 15px;
    font-weight: 850;
}

body.chapter-page .chapter-context-divider {
    width: 1px;
    margin: 12px 0;
    background: rgba(235, 195, 132, 0.14);
}


/* ============================================================
   HERO VISUAL
============================================================ */

body.chapter-page .chapter-hero-visual {
    position: relative;
    z-index: 3;
    width: min(100%, 430px);
    justify-self: end;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 22px 22px 18px;
    overflow: hidden;
    border: 1px solid rgba(236, 194, 126, 0.16);
    border-radius: 28px;
    background:
        radial-gradient(circle at 50% 44%, rgba(223, 158, 55, 0.10), transparent 42%),
        linear-gradient(160deg, rgba(255, 248, 236, 0.055), rgba(255, 248, 236, 0.024));
    box-shadow:
        0 20px 50px rgba(0, 0, 0, 0.18),
        inset 0 1px 0 rgba(255, 255, 255, 0.028);
}

body.chapter-page .chapter-visual-heading {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    margin-bottom: 4px;
    padding: 0 3px;
}

body.chapter-page .chapter-visual-heading span {
    color: #9f907e;
    font-size: 9px;
    font-weight: 850;
    letter-spacing: 0.14em;
    text-transform: uppercase;
}

body.chapter-page .chapter-visual-heading strong {
    color: #efb45a;
    font-size: 13px;
    font-weight: 850;
}


/* ============================================================
   HERO ORBIT STAGE
============================================================ */

body.chapter-page .chapter-orbit-stage {
    position: relative;
    width: 320px;
    height: 320px;
    margin: 8px auto;
    flex: 0 0 auto;
    isolation: isolate;
    overflow: hidden;
}

body.chapter-page .chapter-orbit {
    position: absolute;
    left: 50%;
    top: 50%;
    border-radius: 50%;
    transform: translate(-50%, -50%);
    pointer-events: none;
}

body.chapter-page .chapter-orbit-outer {
    width: 272px;
    height: 272px;
    border: 1.8px solid rgba(236, 194, 126, 0.28);
    box-shadow: inset 0 0 34px rgba(226, 164, 67, 0.045);
    animation: chapterOuterSpin 30s linear infinite;
}

body.chapter-page .chapter-orbit-outer::after {
    content: "";
    position: absolute;
    inset: 11px;
    border: 1.4px dotted rgba(236, 194, 126, 0.20);
    border-radius: 50%;
}

body.chapter-page .chapter-orbit-middle {
    width: 224px;
    height: 224px;
    border: 1.7px dashed rgba(236, 194, 126, 0.26);
    box-shadow: inset 0 0 20px rgba(226, 164, 67, 0.028);
    animation: chapterMiddleSpin 22s linear infinite;
}

body.chapter-page .chapter-orbit-inner {
    width: 178px;
    height: 178px;
    border: 1.9px solid rgba(236, 194, 126, 0.30);
    box-shadow: inset 0 0 28px rgba(230, 165, 65, 0.05);
    animation: chapterInnerSpin 16s linear infinite;
}


/* ============================================================
   HERO 01–18 ORBIT NUMBERS
   IMPORTANT:
   JS controls left/top coordinates.
   Do not add nth-child transforms here.
============================================================ */

body.chapter-page .chapter-orbit-numbers {
    position: absolute;
    inset: 0;
    z-index: 5;
    pointer-events: none;
}

body.chapter-page .chapter-orbit-number {
    position: absolute;
    left: 50%;
    top: 50%;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid rgba(237, 203, 151, 0.24);
    border-radius: 50%;
    color: #d1bea7;
    background: rgba(10, 31, 53, 0.98);
    box-shadow: 0 7px 16px rgba(0, 0, 0, 0.14);
    font-family: Georgia, serif;
    font-size: 10px;
    font-weight: 700;
    line-height: 1;
    transform: translate(-50%, -50%);
    will-change: left, top;
    transition:
        width 350ms ease,
        height 350ms ease,
        color 350ms ease,
        background 350ms ease,
        border-color 350ms ease,
        box-shadow 350ms ease,
        font-size 350ms ease;
}

body.chapter-page .chapter-orbit-number.is-active {
    width: 40px;
    height: 40px;
    color: #ffffff;
    border-color: rgba(255, 194, 92, 0.56);
    background: linear-gradient(135deg, #f1971b, #bf5905);
    box-shadow:
        0 0 0 6px rgba(230, 142, 22, 0.10),
        0 0 26px rgba(236, 148, 24, 0.44),
        0 8px 20px rgba(0, 0, 0, 0.22);
    font-size: 12px;
    animation: chapterOrbitActiveBlink 1.45s ease-in-out infinite;
}


/* ============================================================
   HERO CENTER NUMBER
============================================================ */

body.chapter-page .chapter-hero-number {
    position: absolute;
    left: 50%;
    top: 50%;
    z-index: 7;
    width: 166px;
    height: 166px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px;
    border: 1.8px solid rgba(238, 198, 135, 0.28);
    border-radius: 50%;
    background:
        radial-gradient(
            circle at 38% 28%,
            rgba(20, 47, 80, 0.99),
            rgba(7, 20, 36, 0.99)
        );
    box-shadow:
        0 24px 52px rgba(0, 0, 0, 0.26),
        inset 0 0 28px rgba(234, 170, 72, 0.038);
    transform: translate(-50%, -50%);
}

body.chapter-page .chapter-active-label {
    color: #9d8e7b;
    font-size: 10px;
    font-weight: 850;
    letter-spacing: 0.13em;
    text-transform: uppercase;
}

body.chapter-page #chapterActiveNumber {
    color: #ee8610;
    font-family: Georgia, serif;
    font-size: 58px;
    font-weight: 500;
    line-height: 0.9;
    letter-spacing: -0.035em;
}

body.chapter-page #chapterActiveNumber.is-changing {
    animation: chapterCenterSwap 560ms ease;
}

body.chapter-page .chapter-active-total {
    color: #c9b79e;
    font-size: 11px;
    font-weight: 700;
}

body.chapter-page .chapter-active-total b {
    color: #fff2dd;
    font-size: 14px;
}

body.chapter-page .chapter-active-sanskrit {
    color: #d79a36;
    font-family: "Nirmala UI", "Mangal", serif;
    font-size: 17px;
    font-weight: 700;
}

body.chapter-page .chapter-active-glow {
    position: absolute;
    left: 50%;
    top: 50%;
    z-index: 1;
    width: 198px;
    height: 198px;
    border-radius: 50%;
    background:
        radial-gradient(
            circle,
            rgba(234, 151, 26, 0.18),
            rgba(234, 151, 26, 0.06) 46%,
            transparent 72%
        );
    filter: blur(10px);
    opacity: 0.72;
    transform: translate(-50%, -50%);
    animation: chapterActiveGlowIdle 3.8s ease-in-out infinite;
}

body.chapter-page .chapter-active-glow.is-pulsing {
    animation: chapterGlowPulse 1.15s ease;
}

body.chapter-page .chapter-visual-footnote {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-top: 5px;
    color: #a9957c;
    font-size: 11px;
    font-weight: 700;
}

body.chapter-page .chapter-visual-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #e7a348;
    box-shadow: 0 0 14px rgba(231, 163, 72, 0.48);
    animation: chapterVisualDotPulse 2.3s ease-in-out infinite;
}


/* ============================================================
   JOURNEY DASHBOARD
============================================================ */

body.chapter-page .chapter-progress-section {
    position: relative;
    z-index: 6;
    padding: 42px 0 56px;
    overflow: hidden;
    background:
        radial-gradient(circle at 12% 8%, rgba(224, 151, 46, 0.10), transparent 24%),
        radial-gradient(circle at 88% 82%, rgba(42, 91, 137, 0.24), transparent 30%),
        linear-gradient(145deg, #061321 0%, #081a2e 48%, #0d2845 100%);
    border-top: 1px solid rgba(239, 185, 97, 0.08);
    border-bottom: 1px solid rgba(255, 255, 255, 0.025);
}

body.chapter-page .chapter-progress-section::before {
    content: "";
    position: absolute;
    width: 520px;
    height: 520px;
    left: -270px;
    top: -270px;
    border-radius: 50%;
    background:
        radial-gradient(
            circle,
            rgba(232, 158, 48, 0.11),
            rgba(232, 158, 48, 0.025) 42%,
            transparent 70%
        );
    pointer-events: none;
}

body.chapter-page .chapter-progress-section::after {
    content: "";
    position: absolute;
    width: 560px;
    height: 560px;
    right: -300px;
    bottom: -350px;
    border-radius: 50%;
    background:
        radial-gradient(
            circle,
            rgba(51, 103, 151, 0.22),
            rgba(51, 103, 151, 0.04) 44%,
            transparent 72%
        );
    pointer-events: none;
}

body.chapter-page .chapter-dashboard-grid {
    position: relative;
    z-index: 2;
    display: grid;
    grid-template-columns: minmax(0, 1.40fr) minmax(330px, 0.82fr);
    gap: 22px;
}

body.chapter-page .chapter-dashboard-card {
    position: relative;
    min-width: 0;
    overflow: hidden;
    padding: 28px 28px 24px;
    border: 1px solid rgba(230, 178, 101, 0.25);
    border-radius: 27px;
    background:
        radial-gradient(circle at 92% 14%, rgba(227, 157, 53, 0.07), transparent 28%),
        linear-gradient(145deg, #fffdf9 0%, #fbf4e9 100%);
    box-shadow:
        0 24px 70px rgba(0, 0, 0, 0.24),
        inset 0 1px 0 rgba(255, 255, 255, 0.88);
}

body.chapter-page .chapter-dashboard-card::before {
    content: "";
    position: absolute;
    width: 230px;
    height: 230px;
    right: -112px;
    top: -135px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(213, 133, 22, 0.08), transparent 70%);
    pointer-events: none;
}

body.chapter-page .chapter-dashboard-card > * {
    position: relative;
    z-index: 2;
}

body.chapter-page .chapter-dashboard-card-label {
    display: block;
    margin-bottom: 14px;
    color: #a86408;
    font-size: 10px;
    font-weight: 850;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}


/* ============================================================
   DASHBOARD CARD 1
============================================================ */

body.chapter-page .chapter-dashboard-intro {
    min-height: 210px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

body.chapter-page .chapter-dashboard-intro .chapter-small-label {
    margin-bottom: 10px;
    color: #ad6709;
    font-size: 11px;
    font-weight: 850;
    letter-spacing: 0.13em;
    text-transform: uppercase;
}

body.chapter-page .chapter-dashboard-intro h2 {
    max-width: 760px;
    margin: 0 0 12px;
    color: #24170f;
    font-size: clamp(34px, 3.4vw, 54px);
    font-weight: 900;
    line-height: 1.02;
    letter-spacing: -0.05em;
}

body.chapter-page .chapter-dashboard-intro p {
    max-width: 650px;
    margin: 0;
    color: #766351;
    font-size: 15px;
    line-height: 1.68;
}


/* ============================================================
   DASHBOARD CARD 2
============================================================ */

body.chapter-page .chapter-dashboard-stats {
    min-height: 210px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

body.chapter-page .chapter-dashboard-stats-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
}

body.chapter-page .chapter-progress-stat-box {
    min-width: 0;
    min-height: 105px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 18px 17px;
    border: 1px solid rgba(14, 44, 74, 0.10);
    border-radius: 19px;
    background:
        linear-gradient(
            180deg,
            rgba(13, 42, 72, 0.055),
            rgba(13, 42, 72, 0.020)
        );
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.72);
}

body.chapter-page .chapter-progress-stat-box strong {
    color: #0b2948;
    font-size: 42px;
    font-weight: 900;
    line-height: 1;
}

body.chapter-page .chapter-progress-stat-box span {
    margin-top: 8px;
    color: #8a7562;
    font-size: 10px;
    font-weight: 850;
    letter-spacing: 0.09em;
    text-transform: uppercase;
}

body.chapter-page .chapter-dashboard-stats-note {
    margin: 13px 0 0;
    color: #7c6855;
    font-size: 12px;
    line-height: 1.58;
}


/* ============================================================
   DASHBOARD CARD 3
============================================================ */

body.chapter-page .chapter-dashboard-resume {
    min-height: 170px;
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
    gap: 18px;
    border: 1px solid rgba(205, 132, 22, 0.23);
    background:
        radial-gradient(circle at 88% 50%, rgba(221, 137, 15, 0.09), transparent 27%),
        linear-gradient(135deg, #fff8ec 0%, #f8ead4 100%);
    box-shadow:
        0 20px 58px rgba(0, 0, 0, 0.18),
        inset 0 1px 0 rgba(255, 255, 255, 0.84);
}

body.chapter-page .chapter-resume-icon {
    width: 68px;
    height: 68px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    border: 1px solid rgba(205, 138, 33, 0.30);
    border-radius: 50%;
    color: #bd6b07;
    background: rgba(255, 253, 249, 0.92);
    box-shadow: 0 8px 20px rgba(128, 80, 19, 0.08);
    font-family: "Nirmala UI", "Mangal", serif;
    font-size: 33px;
}

body.chapter-page .chapter-resume-copy {
    min-width: 0;
    display: flex;
    flex-direction: column;
}

body.chapter-page .chapter-resume-copy > span {
    color: #a86408;
    font-size: 11px;
    font-weight: 850;
    letter-spacing: 0.10em;
    text-transform: uppercase;
}

body.chapter-page .chapter-resume-copy strong {
    margin-top: 6px;
    overflow: hidden;
    color: #28180d;
    font-size: 19px;
    font-weight: 850;
    line-height: 1.35;
    text-overflow: ellipsis;
    white-space: nowrap;
}

body.chapter-page .chapter-resume-copy small {
    margin-top: 5px;
    color: #816c59;
    font-size: 13px;
    line-height: 1.5;
}

body.chapter-page .chapter-resume-button {
    min-width: 154px;
    min-height: 56px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 0 22px;
    border: 1px solid rgba(167, 72, 0, 0.11);
    border-radius: 16px;
    color: #ffffff;
    background: linear-gradient(135deg, #ee7907 0%, #c95300 100%);
    box-shadow: 0 12px 28px rgba(190, 87, 5, 0.22);
    font-size: 15px;
    font-weight: 850;
    transition:
        transform 180ms ease,
        box-shadow 180ms ease,
        filter 180ms ease;
}

body.chapter-page .chapter-resume-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 16px 34px rgba(190, 87, 5, 0.30);
    filter: saturate(1.05);
}

body.chapter-page .chapter-resume-button:focus-visible {
    outline: 3px solid rgba(222, 133, 25, 0.22);
    outline-offset: 3px;
}

body.chapter-page .chapter-resume-arrow {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    transition: transform 180ms ease;
}

body.chapter-page .chapter-resume-button:hover .chapter-resume-arrow {
    transform: translateX(3px);
}


/* ============================================================
   DASHBOARD CARD 4
============================================================ */

body.chapter-page .chapter-dashboard-progress {
    min-height: 170px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

body.chapter-page .chapter-progress-meter-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    margin-bottom: 14px;
}

body.chapter-page .chapter-progress-meter-head > span {
    color: #806c5a;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.075em;
    text-transform: uppercase;
}

body.chapter-page .chapter-progress-meter-head > strong {
    color: #a05d08;
    font-size: 13px;
    font-weight: 850;
    white-space: nowrap;
}

body.chapter-page .chapter-overall-track {
    position: relative;
    width: 100%;
    height: 13px;
    overflow: hidden;
    border: 1px solid rgba(132, 92, 44, 0.08);
    border-radius: 999px;
    background: linear-gradient(90deg, #e7daca, #efe4d5);
    box-shadow: inset 0 2px 4px rgba(74, 48, 23, 0.08);
}

body.chapter-page .chapter-overall-track span {
    display: block;
    width: 0;
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, #e3a137 0%, #ef7a08 55%, #c45100 100%);
    box-shadow: 0 0 16px rgba(226, 120, 7, 0.26);
    transition: width 700ms ease;
}

body.chapter-page .chapter-dashboard-progress-note {
    margin: 14px 0 0;
    color: #7c6855;
    font-size: 12px;
    line-height: 1.58;
}


/* ============================================================
   CHAPTER JOURNEY — CLEAN BLUE STARFIELD
   No black holes
   No asteroids
   No explosions
   No moving canvas
============================================================ */

body.chapter-page .chapter-list-section {
    position: relative;
    z-index: 2;
    isolation: isolate;
    padding: 0;
    overflow: hidden;

    background:
        radial-gradient(
            circle at 14% 9%,
            rgba(53, 120, 210, 0.28),
            transparent 24%
        ),
        radial-gradient(
            circle at 84% 18%,
            rgba(38, 95, 175, 0.24),
            transparent 26%
        ),
        radial-gradient(
            circle at 28% 60%,
            rgba(28, 72, 142, 0.18),
            transparent 30%
        ),
        radial-gradient(
            circle at 78% 82%,
            rgba(49, 108, 192, 0.20),
            transparent 28%
        ),
        linear-gradient(
            180deg,
            #020917 0%,
            #06142a 18%,
            #081d3a 48%,
            #07172f 76%,
            #030b1b 100%
        );

    border-top:
        1px solid
        rgba(118, 167, 232, 0.12);

    border-bottom:
        1px solid
        rgba(255, 255, 255, 0.035);

    box-shadow:
        inset 0 55px 120px
        rgba(0, 0, 0, 0.24),
        inset 0 -55px 120px
        rgba(0, 0, 0, 0.28);
}


/* ============================================================
   OLD COSMIC CANVAS DISABLED

   The current JS may still contain the old black-hole /
   asteroid engine, but this canvas is intentionally hidden.
   Nothing from that engine is visible or affects layout.
============================================================ */

body.chapter-page .chapter-cosmic-canvas {
    display: none !important;
}


/* ============================================================
   FULL 01–18 STARFIELD

   This element already exists in chapter.html.
   It covers the complete natural height of the section.
============================================================ */

body.chapter-page .chapter-cosmic-atmosphere {
    position: absolute;
    inset: 0;

    z-index: 1;

    overflow: hidden;

    pointer-events: none;

    background:
        radial-gradient(
            circle at 18% 16%,
            rgba(70, 137, 226, 0.15),
            transparent 24%
        ),
        radial-gradient(
            circle at 82% 34%,
            rgba(43, 100, 188, 0.14),
            transparent 25%
        ),
        radial-gradient(
            circle at 34% 72%,
            rgba(27, 80, 164, 0.12),
            transparent 28%
        ),
        radial-gradient(
            circle at 78% 88%,
            rgba(79, 142, 224, 0.10),
            transparent 22%
        );

    opacity: 1;
}


/* Dense tiny stars */
body.chapter-page .chapter-cosmic-atmosphere::before {
    content: "";

    position: absolute;
    inset: -120px;

    background-image:
        radial-gradient(
            circle,
            rgba(255, 255, 255, 0.95) 0 0.65px,
            transparent 0.95px
        ),
        radial-gradient(
            circle,
            rgba(189, 220, 255, 0.78) 0 0.8px,
            transparent 1.08px
        ),
        radial-gradient(
            circle,
            rgba(255, 255, 255, 0.52) 0 0.55px,
            transparent 0.9px
        ),
        radial-gradient(
            circle,
            rgba(128, 182, 255, 0.62) 0 0.7px,
            transparent 1px
        );

    background-size:
        54px 54px,
        89px 89px,
        131px 131px,
        173px 173px;

    background-position:
        5px 7px,
        38px 21px,
        74px 49px,
        112px 83px;

    opacity: 0.78;

    animation:
        chapterStarFieldDrift
        46s
        linear
        infinite;

    transform: translateZ(0);
}


/* Larger glowing / twinkling stars */
body.chapter-page .chapter-cosmic-atmosphere::after {
    content: "";

    position: absolute;
    inset: 0;

    background-image:
        radial-gradient(
            circle,
            rgba(255, 255, 255, 0.95) 0 1.1px,
            rgba(171, 210, 255, 0.28) 1.6px,
            transparent 3.2px
        ),
        radial-gradient(
            circle,
            rgba(200, 226, 255, 0.88) 0 1px,
            rgba(87, 155, 245, 0.22) 1.5px,
            transparent 3px
        ),
        radial-gradient(
            circle,
            rgba(255, 255, 255, 0.80) 0 0.9px,
            rgba(144, 193, 255, 0.18) 1.4px,
            transparent 2.8px
        );

    background-size:
        260px 260px,
        340px 340px,
        430px 430px;

    background-position:
        38px 58px,
        170px 120px,
        250px 210px;

    opacity: 0.72;

    animation:
        chapterStarsTwinkle
        6.5s
        ease-in-out
        infinite alternate;
}


/* ============================================================
   OPTIONAL HTML NEBULA SPANS
   Reused only as soft blue atmosphere — no objects.
============================================================ */

body.chapter-page .chapter-cosmic-nebula {
    position: absolute;
    display: block;
    border-radius: 50%;
    filter: blur(72px);
    mix-blend-mode: screen;
    pointer-events: none;
}

body.chapter-page .chapter-cosmic-nebula-one {
    width: 560px;
    height: 560px;

    left: -230px;
    top: 5%;

    opacity: 0.20;

    background:
        radial-gradient(
            circle,
            rgba(61, 132, 226, 0.38),
            rgba(35, 88, 166, 0.10) 48%,
            transparent 72%
        );

    animation:
        chapterBlueHazeOne
        18s
        ease-in-out
        infinite alternate;
}

body.chapter-page .chapter-cosmic-nebula-two {
    width: 620px;
    height: 620px;

    right: -260px;
    top: 44%;

    opacity: 0.18;

    background:
        radial-gradient(
            circle,
            rgba(73, 143, 233, 0.34),
            rgba(29, 73, 146, 0.08) 48%,
            transparent 73%
        );

    animation:
        chapterBlueHazeTwo
        22s
        ease-in-out
        infinite alternate;
}

body.chapter-page .chapter-cosmic-nebula-three {
    width: 540px;
    height: 540px;

    left: 25%;
    bottom: 3%;

    opacity: 0.14;

    background:
        radial-gradient(
            circle,
            rgba(43, 108, 201, 0.28),
            rgba(27, 68, 137, 0.07) 50%,
            transparent 74%
        );

    animation:
        chapterBlueHazeThree
        24s
        ease-in-out
        infinite alternate;
}


/* ============================================================
   TOP / BOTTOM SOFT FADE
============================================================ */

body.chapter-page .chapter-list-section::before {
    content: "";

    position: absolute;
    inset: 0 0 auto;

    z-index: 2;

    height: 70px;

    background:
        linear-gradient(
            180deg,
            rgba(4, 15, 31, 0.88),
            rgba(4, 15, 31, 0.34) 50%,
            transparent
        );

    pointer-events: none;
}

body.chapter-page .chapter-list-section::after {
    content: "";

    position: absolute;
    inset: auto 0 0;

    z-index: 2;

    height: 88px;

    background:
        linear-gradient(
            0deg,
            rgba(3, 11, 25, 0.92),
            rgba(3, 11, 25, 0.32) 50%,
            transparent
        );

    pointer-events: none;
}


/* ============================================================
   REAL CHAPTER CONTENT LAYER
============================================================ */

body.chapter-page .chapter-list-container {
    position: relative;
    z-index: 4;
    padding-top: 72px;
    padding-bottom: 92px;
}


/* ============================================================
   CHAPTER LIST HEADING
============================================================ */

body.chapter-page .chapter-list-heading {
    position: relative;
    z-index: 5;
    display: block;
    max-width: 800px;
    margin-bottom: 46px;
}

body.chapter-page .chapter-list-heading > div {
    position: relative;
    width: fit-content;
    max-width: 760px;
    padding-bottom: 17px;
}

body.chapter-page .chapter-list-heading > div::after {
    content: "";
    position: absolute;
    left: 0;
    bottom: 0;
    width: 94px;
    height: 3px;
    border-radius: 999px;
    background:
        linear-gradient(
            90deg,
            #f0a541,
            rgba(240, 165, 65, 0.35),
            transparent
        );
    box-shadow: 0 0 22px rgba(240, 165, 65, 0.24);
}

body.chapter-page .chapter-list-heading .chapter-small-label {
    margin-bottom: 9px;
    color: #e5aa51;
}

body.chapter-page .chapter-list-heading h2 {
    margin: 0;
    color: #fff3df;
    font-size: clamp(38px, 4.2vw, 56px);
    font-weight: 900;
    line-height: 1.04;
    letter-spacing: -0.048em;
    text-shadow: 0 12px 34px rgba(0, 0, 0, 0.28);
}

body.chapter-page .chapter-list-heading > p {
    display: none !important;
}


/* ============================================================
   MESSAGE
============================================================ */

body.chapter-page .chapter-message {
    position: relative;
    z-index: 6;
    margin-bottom: 24px;
    padding: 13px 16px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 700;
    backdrop-filter: blur(10px);
}

body.chapter-page .chapter-message-info {
    border: 1px solid rgba(233, 172, 80, 0.28);
    color: #f0c27f;
    background: rgba(18, 37, 61, 0.82);
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.18);
}

body.chapter-page .chapter-message-error {
    border: 1px solid rgba(232, 103, 85, 0.26);
    color: #ffb7aa;
    background: rgba(68, 27, 31, 0.84);
}


/* ============================================================
   LOADING
============================================================ */

body.chapter-page .chapter-loading {
    position: relative;
    z-index: 6;
    width: min(920px, 100%);
    display: grid;
    gap: 22px;
    margin-inline: auto;
}

body.chapter-page .chapter-loading-card {
    min-height: 170px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 16px;
    padding: 30px;
    border: 1px solid rgba(231, 188, 121, 0.13);
    border-radius: 22px;
    background:
        linear-gradient(
            145deg,
            rgba(12, 29, 49, 0.92),
            rgba(8, 22, 39, 0.94)
        );
    box-shadow: 0 22px 60px rgba(0, 0, 0, 0.24);
}

body.chapter-page .chapter-loading-card span {
    height: 12px;
    border-radius: 999px;
    background:
        linear-gradient(
            90deg,
            rgba(63, 83, 105, 0.55) 20%,
            rgba(127, 151, 178, 0.66) 50%,
            rgba(63, 83, 105, 0.55) 80%
        );
    background-size: 220% 100%;
    animation: gitaSkeletonMove 1.3s linear infinite;
}

body.chapter-page .chapter-loading-card span:nth-child(1) {
    width: 22%;
}

body.chapter-page .chapter-loading-card span:nth-child(2) {
    width: 60%;
}

body.chapter-page .chapter-loading-card span:nth-child(3) {
    width: 42%;
}


/* ============================================================
   STATE CARDS
============================================================ */

body.chapter-page .chapter-state-card {
    position: relative;
    z-index: 6;
    width: min(540px, 100%);
    margin-inline: auto;
    padding: 48px 30px;
    border: 1px solid rgba(232, 190, 121, 0.16);
    border-radius: 25px;
    background:
        radial-gradient(circle at 82% 18%, rgba(235, 155, 40, 0.07), transparent 26%),
        linear-gradient(145deg, rgba(12, 30, 51, 0.96), rgba(7, 20, 37, 0.97));
    box-shadow: 0 28px 75px rgba(0, 0, 0, 0.28);
    text-align: center;
}

body.chapter-page .chapter-state-icon {
    width: 64px;
    height: 64px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 18px;
    border: 1px solid rgba(232, 170, 73, 0.25);
    border-radius: 50%;
    color: #e9a84c;
    background: rgba(255, 248, 235, 0.045);
    font-size: 27px;
    font-weight: 800;
}

body.chapter-page .chapter-state-card h3 {
    margin-bottom: 9px;
    color: #fff3df;
    font-size: 22px;
}

body.chapter-page .chapter-state-card p {
    max-width: 420px;
    margin: 0 auto;
    color: #b9aa96;
    font-size: 12px;
    line-height: 1.75;
}

body.chapter-page .chapter-state-card button {
    min-height: 44px;
    margin-top: 20px;
    padding: 0 19px;
    border: 0;
    border-radius: 12px;
    color: #ffffff;
    background: linear-gradient(135deg, var(--ag-saffron), var(--ag-saffron-dark));
    font-size: 11px;
    font-weight: 800;
    cursor: pointer;
}


/* ============================================================
   CHAPTER JOURNEY TIMELINE
============================================================ */

body.chapter-page .chapter-journey {
    position: relative;
    z-index: 8;
    display: grid;
    gap: 30px;
    padding: 8px 0 12px;
}

body.chapter-page .chapter-journey::before {
    content: "";
    position: absolute;
    left: 50%;
    top: 0;
    bottom: 0;
    width: 150px;
    transform: translateX(-50%);
    background:
        radial-gradient(
            ellipse at center,
            rgba(236, 166, 55, 0.15),
            rgba(236, 166, 55, 0.055) 34%,
            rgba(54, 100, 160, 0.025) 55%,
            transparent 74%
        );
    filter: blur(18px);
    animation: chapterJourneyBeamPulse 5.5s ease-in-out infinite;
    pointer-events: none;
}

body.chapter-page .chapter-journey-line {
    position: absolute;
    left: 50%;
    top: 14px;
    bottom: 14px;
    z-index: 1;
    width: 3px;
    border-radius: 999px;
    opacity: 1;

    background:
        linear-gradient(
            180deg,
            transparent 0%,
            rgba(234, 165, 55, 0.18) 1%,
            rgba(234, 165, 55, 0.80) 12%,
            rgba(72, 126, 192, 0.42) 30%,
            rgba(234, 165, 55, 0.68) 50%,
            rgba(72, 126, 192, 0.42) 70%,
            rgba(234, 165, 55, 0.80) 88%,
            rgba(234, 165, 55, 0.18) 99%,
            transparent 100%
        );

    background-size: 100% 250%;

    box-shadow:
        0 0 12px rgba(235, 165, 54, 0.29),
        0 0 30px rgba(66, 116, 183, 0.12);

    transform: translateX(-50%);

    animation:
        chapterTimelineStableFlow
        9s
        linear
        infinite;
}

body.chapter-page .chapter-item {
    position: relative;
    z-index: 5;
    display: grid;
    grid-template-columns: minmax(0, 1fr) 74px minmax(0, 1fr);
    align-items: center;
    column-gap: 14px;
}

body.chapter-page .chapter-left .chapter-marker {
    grid-column: 2;
}

body.chapter-page .chapter-left .chapter-card {
    grid-column: 1;
    grid-row: 1;
    justify-self: end;
}

body.chapter-page .chapter-right .chapter-marker {
    grid-column: 2;
}

body.chapter-page .chapter-right .chapter-card {
    grid-column: 3;
    grid-row: 1;
    justify-self: start;
}


/* ============================================================
   CHAPTER MARKERS
   IMPORTANT:
   The NUMBER itself never animates.
   Only the halo can pulse.
============================================================ */

body.chapter-page .chapter-marker {
    position: relative;
    z-index: 40;
    display: flex;
    justify-content: center;
    opacity: 1 !important;
    visibility: visible !important;
    isolation: isolate;
}

body.chapter-page .chapter-marker::before {
    content: "";
    position: absolute;
    left: 50%;
    top: 50%;
    z-index: -1;
    width: 68px;
    height: 68px;
    border: 1px solid rgba(236, 165, 54, 0.16);
    border-radius: 50%;
    background:
        radial-gradient(
            circle,
            rgba(236, 165, 54, 0.12),
            rgba(64, 113, 176, 0.04) 45%,
            transparent 70%
        );
    transform: translate(-50%, -50%);
    animation: chapterMarkerHaloStable 4.8s ease-in-out infinite;
    pointer-events: none;
}

body.chapter-page .chapter-item:nth-child(even) .chapter-marker::before {
    animation-delay: -2.4s;
}

body.chapter-page .chapter-marker-number {
    position: relative;
    z-index: 10;

    width: 50px;
    height: 50px;
    flex: 0 0 50px;

    display: flex;
    align-items: center;
    justify-content: center;

    opacity: 1 !important;
    visibility: visible !important;

    animation: none !important;
    filter: none !important;

    border: 1px solid rgba(242, 177, 72, 0.58);
    border-radius: 50%;

    color: #f4b861;

    background:
        radial-gradient(
            circle at 32% 28%,
            #1d3e62 0%,
            #0b213a 38%,
            #061321 100%
        );

    box-shadow:
        0 0 0 5px rgba(227, 153, 42, 0.055),
        0 0 24px rgba(227, 153, 42, 0.14),
        0 10px 26px rgba(0, 0, 0, 0.34),
        inset 0 1px 0 rgba(255, 255, 255, 0.07);

    text-shadow:
        0 0 10px rgba(242, 177, 72, 0.24);

    font-family: Georgia, serif;
    font-size: 12px;
    font-weight: 700;
    line-height: 1;

    will-change: auto;

    transition:
        color 180ms ease,
        border-color 180ms ease,
        box-shadow 180ms ease,
        transform 180ms ease;
}

body.chapter-page .chapter-item:hover .chapter-marker-number {
    opacity: 1 !important;
    visibility: visible !important;

    color: #ffffff;

    border-color: rgba(255, 190, 84, 0.82);

    transform: scale(1.07);

    box-shadow:
        0 0 0 8px rgba(227, 153, 42, 0.08),
        0 0 34px rgba(237, 166, 52, 0.26),
        0 13px 30px rgba(0, 0, 0, 0.36);
}


/* ============================================================
   CHAPTER CARD
============================================================ */

body.chapter-page .chapter-card {
    position: relative;
    z-index: 4;

    width: min(520px, 100%);

    padding: 26px 27px;

    overflow: hidden;

    border: 1px solid rgba(236, 191, 120, 0.28);
    border-radius: 23px;

    background:
        radial-gradient(circle at 12% 10%, rgba(228, 152, 44, 0.075), transparent 25%),
        radial-gradient(circle at 92% 86%, rgba(45, 91, 141, 0.045), transparent 30%),
        linear-gradient(
            145deg,
            rgba(255, 253, 249, 0.992),
            rgba(247, 239, 228, 0.982)
        );

    box-shadow:
        0 24px 64px rgba(0, 0, 0, 0.31),
        inset 0 1px 0 rgba(255, 255, 255, 0.91);

    transition:
        transform 260ms ease,
        box-shadow 260ms ease,
        border-color 260ms ease;

    animation:
        chapterCardReveal
        720ms
        cubic-bezier(0.2, 0.75, 0.22, 1)
        both;
}

body.chapter-page .chapter-item:nth-child(even) .chapter-card {
    animation-delay: 90ms;
}

body.chapter-page .chapter-card::before {
    content: "";
    position: absolute;
    left: -55%;
    top: -45%;
    width: 42%;
    height: 190%;
    z-index: 0;
    background:
        linear-gradient(
            90deg,
            transparent,
            rgba(255, 255, 255, 0.64),
            transparent
        );
    transform: rotate(18deg);
    opacity: 0;
    transition:
        left 650ms ease,
        opacity 220ms ease;
    pointer-events: none;
}

body.chapter-page .chapter-card:hover::before {
    left: 118%;
    opacity: 0.62;
}

body.chapter-page .chapter-card > * {
    position: relative;
    z-index: 2;
}

body.chapter-page .chapter-left .chapter-card {
    box-shadow:
        -3px 0 0 rgba(229, 151, 36, 0.46),
        0 24px 64px rgba(0, 0, 0, 0.31),
        inset 0 1px 0 rgba(255, 255, 255, 0.91);
}

body.chapter-page .chapter-right .chapter-card {
    box-shadow:
        3px 0 0 rgba(56, 112, 181, 0.38),
        0 24px 64px rgba(0, 0, 0, 0.31),
        inset 0 1px 0 rgba(255, 255, 255, 0.91);
}

body.chapter-page .chapter-item:hover .chapter-card {
    border-color: rgba(238, 170, 66, 0.45);
    transform: translateY(-6px) scale(1.008);
    box-shadow:
        0 32px 78px rgba(0, 0, 0, 0.34),
        0 0 0 1px rgba(237, 165, 55, 0.12),
        inset 0 1px 0 rgba(255, 255, 255, 0.92);
}


/* ============================================================
   CARD CONNECTORS
============================================================ */

body.chapter-page .chapter-left .chapter-card::after,
body.chapter-page .chapter-right .chapter-card::after {
    content: "";
    position: absolute;
    top: 50%;
    width: 32px;
    height: 2px;
    background:
        linear-gradient(
            90deg,
            rgba(232, 164, 55, 0.08),
            rgba(232, 164, 55, 0.56)
        );
    box-shadow: 0 0 12px rgba(232, 164, 55, 0.16);
    transform: translateY(-50%);
    pointer-events: none;
}

body.chapter-page .chapter-left .chapter-card::after {
    right: -33px;
}

body.chapter-page .chapter-right .chapter-card::after {
    left: -33px;
    transform: translateY(-50%) rotate(180deg);
}


/* ============================================================
   CHAPTER CARD HEADER
============================================================ */

body.chapter-page .chapter-card-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 20px;
}

body.chapter-page .chapter-card-label {
    color: var(--ag-text-muted);
    font-size: 9px;
    font-weight: 800;
    letter-spacing: 0.09em;
    text-transform: uppercase;
}

body.chapter-page .chapter-status {
    min-height: 26px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0 9px;
    border-radius: 999px;
    font-size: 8px;
    font-weight: 850;
    letter-spacing: 0.04em;
}

body.chapter-page .chapter-status-available {
    color: #95611d;
    background: #fff1d8;
    box-shadow: 0 5px 13px rgba(200, 133, 29, 0.08);
}

body.chapter-page .chapter-status-progress,
body.chapter-page .chapter-status-quiz {
    color: #a8500b;
    background: #fff0e1;
}

body.chapter-page .chapter-status-completed {
    color: #417b50;
    background: #edf8f0;
}

body.chapter-page .chapter-status-locked {
    color: #776b61;
    background: #f1eeeb;
}

body.chapter-page .chapter-status-coming {
    color: #806a4c;
    background: #f6efe5;
}


/* ============================================================
   CHAPTER TITLE
============================================================ */

body.chapter-page .chapter-card-title-row {
    display: grid;
    grid-template-columns: 53px minmax(0, 1fr);
    gap: 14px;
    margin-bottom: 23px;
}

body.chapter-page .chapter-devanagari-number {
    color: rgba(178, 126, 40, 0.55);
    font-family: "Nirmala UI", "Mangal", serif;
    font-size: 30px;
    font-weight: 600;
}

body.chapter-page .chapter-title {
    margin-bottom: 6px;
    color: var(--ag-text);
    font-size: clamp(19px, 1.8vw, 23px);
    line-height: 1.25;
    letter-spacing: -0.02em;
}

body.chapter-page .chapter-subtitle {
    margin: 0;
    color: var(--ag-text-soft);
    font-size: 11px;
    line-height: 1.65;
}


/* ============================================================
   CHAPTER INFO
============================================================ */

body.chapter-page .chapter-info-row {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 15px;
    margin-bottom: 15px;
}

body.chapter-page .chapter-info-row > div {
    display: flex;
    flex-direction: column;
}

body.chapter-page .chapter-info-row span {
    margin-bottom: 2px;
    color: var(--ag-text-muted);
    font-size: 8px;
    font-weight: 750;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

body.chapter-page .chapter-info-row strong {
    color: var(--ag-text);
    font-size: 13px;
}


/* ============================================================
   CHAPTER PROGRESS
============================================================ */

body.chapter-page .chapter-card-progress {
    width: 100%;
    height: 6px;
    margin-bottom: 18px;
    overflow: hidden;
    border-radius: 999px;
    background:
        linear-gradient(
            90deg,
            rgba(213, 198, 177, 0.78),
            rgba(231, 217, 197, 0.78)
        );
    box-shadow: inset 0 1px 3px rgba(68, 43, 18, 0.08);
}

body.chapter-page .chapter-card-progress span {
    position: relative;
    display: block;
    width: 0;
    height: 100%;
    border-radius: inherit;
    background:
        linear-gradient(
            90deg,
            #d69a33,
            #e97908,
            #be5002
        );
    box-shadow: 0 0 14px rgba(220, 120, 8, 0.22);
    transition: width 700ms ease;
}

body.chapter-page .chapter-card-progress span::after {
    content: "";
    position: absolute;
    inset: 0;
    background:
        linear-gradient(
            90deg,
            transparent,
            rgba(255, 255, 255, 0.48),
            transparent
        );
    transform: translateX(-120%);
    animation: chapterProgressShimmer 2.8s ease-in-out infinite;
}

body.chapter-page .chapter-completed .chapter-card-progress span {
    background: linear-gradient(90deg, #59916a, #7fb78b);
}


/* ============================================================
   CHAPTER CARD FOOTER
============================================================ */

body.chapter-page .chapter-card-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 15px;
}

body.chapter-page .chapter-status-text {
    max-width: 230px;
    overflow: hidden;
    color: var(--ag-text-muted);
    font-size: 9px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

body.chapter-page .chapter-enter-button {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    color: var(--ag-saffron-dark);
    font-size: 10px;
    font-weight: 850;
    transition:
        gap var(--ag-transition),
        color var(--ag-transition);
}

body.chapter-page .chapter-enter-button:hover {
    gap: 11px;
    color: var(--ag-saffron);
}


/* ============================================================
   SPECIAL CHAPTER STATES
============================================================ */

body.chapter-page .chapter-locked .chapter-card {
    background:
        radial-gradient(circle at 90% 12%, rgba(46, 79, 111, 0.035), transparent 27%),
        linear-gradient(145deg, #faf8f5, #f4efe9);
}

body.chapter-page .chapter-locked .chapter-marker-number {
    color: #d6c4ab;
    border-color: rgba(166, 155, 145, 0.35);
    background:
        radial-gradient(
            circle at 32% 28%,
            #26384b,
            #0a1828 70%
        );
}

body.chapter-page .chapter-coming .chapter-card {
    background:
        linear-gradient(145deg, #fffdf9, #f7f1e7);
}

body.chapter-page .chapter-coming .chapter-marker-number {
    color: #e1b36c;
}

body.chapter-page .chapter-completed .chapter-marker-number {
    color: #b8e5c3;
    border-color: rgba(110, 188, 132, 0.44);
    background:
        radial-gradient(
            circle at 32% 28%,
            #28503a,
            #0b2217 70%
        );
}


/* ============================================================
   END REFLECTION
============================================================ */

body.chapter-page .chapter-end-section {
    position: relative;
    z-index: 5;
    padding: 28px 0 100px;
    background:
        linear-gradient(
            180deg,
            #07111f 0%,
            #fbf6ec 24%,
            #fbf6ec 100%
        );
}

body.chapter-page .chapter-end-card {
    display: grid;
    grid-template-columns: 120px minmax(0, 1fr);
    align-items: center;
    gap: 38px;
    padding: 43px 48px;

    border:
        1px solid
        rgba(77, 111, 151, 0.14);

    border-radius: 28px;

    background:
        linear-gradient(
            135deg,
            #f4f7fb 0%,
            #edf2f7 52%,
            #f8f6f1 100%
        );

    box-shadow:
        0 24px 65px
        rgba(15, 35, 58, 0.12),
        inset 0 1px 0
        rgba(255, 255, 255, 0.82);
}

body.chapter-page .chapter-end-icon {
    width: 110px;
    height: 110px;

    display: flex;
    align-items: center;
    justify-content: center;

    border:
        1px solid
        rgba(194, 139, 55, 0.30);

    border-radius: 50%;

    color: #bd7b18;

    background:
        rgba(255, 255, 255, 0.72);

    box-shadow:
        0 10px 30px
        rgba(18, 45, 74, 0.08);

    font-size: 42px;
}

body.chapter-page .chapter-end-card h2 {
    margin-bottom: 10px;

    color: #10243b;

    font-size:
        clamp(
            28px,
            3vw,
            40px
        );

    line-height: 1.14;

    letter-spacing: -0.035em;
}

body.chapter-page .chapter-end-card p {
    max-width: 730px;

    margin: 0;

    color: #66778a;

    font-size: 13px;

    line-height: 1.75;
}


body.chapter-page .chapter-end-card .chapter-small-label {
    color: #a86712;
}


/* ============================================================
   RESPONSIVE — HERO
============================================================ */

@media (max-width: 1100px) {

    body.chapter-page .chapter-hero-card {
        grid-template-columns: minmax(0, 1fr) 340px;
        gap: 26px;
        padding: 30px;
    }

    body.chapter-page .chapter-hero-content h1 {
        font-size: clamp(42px, 5vw, 60px);
    }

    body.chapter-page .chapter-hero-visual {
        width: 340px;
        height: auto;
    }

    body.chapter-page .chapter-orbit-stage {
        width: 300px;
        height: 300px;
    }

    body.chapter-page .chapter-orbit-outer {
        width: 254px;
        height: 254px;
    }

    body.chapter-page .chapter-orbit-middle {
        width: 210px;
        height: 210px;
    }

    body.chapter-page .chapter-orbit-inner {
        width: 168px;
        height: 168px;
    }


    body.chapter-page .chapter-dashboard-grid {
        grid-template-columns: minmax(0, 1.25fr) minmax(300px, 0.90fr);
        gap: 18px;
    }

    body.chapter-page .chapter-dashboard-card {
        padding: 24px 22px 21px;
    }

    body.chapter-page .chapter-dashboard-intro h2 {
        font-size: clamp(31px, 4vw, 46px);
    }

    body.chapter-page .chapter-progress-stat-box strong {
        font-size: 37px;
    }

    body.chapter-page .chapter-resume-button {
        min-width: 138px;
        padding: 0 18px;
    }
}


@media (max-width: 900px) {

    body.chapter-page .chapter-hero {
        min-height: 0;
        padding: calc(var(--ag-header-height) + 22px) 0 26px;
    }

    body.chapter-page .chapter-hero-card {
        grid-template-columns: 1fr;
        gap: 26px;
        min-height: 0;
        padding: 28px;
    }

    body.chapter-page .chapter-hero-content {
        max-width: 720px;
        margin-inline: 0;
        text-align: left;
    }

    body.chapter-page .chapter-page-kicker,
    body.chapter-page .chapter-user-context {
        margin-left: 0;
        margin-right: 0;
    }

    body.chapter-page .chapter-hero-visual {
        width: min(100%, 430px);
        height: auto;
        justify-self: center;
    }


    body.chapter-page .chapter-progress-section {
        padding: 34px 0 46px;
    }

    body.chapter-page .chapter-dashboard-grid {
        grid-template-columns: 1fr;
    }

    body.chapter-page .chapter-dashboard-intro,
    body.chapter-page .chapter-dashboard-stats,
    body.chapter-page .chapter-dashboard-resume,
    body.chapter-page .chapter-dashboard-progress {
        min-height: auto;
    }

    body.chapter-page .chapter-dashboard-stats-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }


    body.chapter-page .chapter-list-container {
        padding-top: 64px;
        padding-bottom: 76px;
    }

    body.chapter-page .chapter-list-heading {
        max-width: 680px;
        margin-bottom: 38px;
    }

    body.chapter-page .chapter-journey {
        gap: 24px;
    }

    body.chapter-page .chapter-journey::before {
        left: 31px;
        width: 88px;
        transform: translateX(-50%);
    }

    body.chapter-page .chapter-journey-line {
        left: 31px;
        transform: none;
    }

    body.chapter-page .chapter-cosmic-atmosphere::after {
        left: 31px;
        width: 104px;
        transform: translateX(-50%);
    }

    body.chapter-page .chapter-item {
        grid-template-columns: 62px minmax(0, 1fr);
        column-gap: 16px;
    }

    body.chapter-page .chapter-left .chapter-marker,
    body.chapter-page .chapter-right .chapter-marker {
        grid-column: 1;
        grid-row: 1;
    }

    body.chapter-page .chapter-left .chapter-card,
    body.chapter-page .chapter-right .chapter-card {
        grid-column: 2;
        grid-row: 1;
        width: min(620px, 100%);
        justify-self: stretch;
        box-shadow:
            0 20px 52px rgba(0, 0, 0, 0.28),
            inset 0 1px 0 rgba(255, 255, 255, 0.86);
    }

    body.chapter-page .chapter-left .chapter-card::after,
    body.chapter-page .chapter-right .chapter-card::after {
        display: none;
    }

    body.chapter-page .chapter-card::before {
        display: none;
    }

    body.chapter-page .chapter-cosmic-nebula-one {
        width: 320px;
        height: 320px;
    }

    body.chapter-page .chapter-cosmic-nebula-two {
        width: 380px;
        height: 380px;
    }

    body.chapter-page .chapter-cosmic-nebula-three {
        width: 340px;
        height: 340px;
    }
}


@media (max-width: 700px) {

    body.chapter-page .chapter-hero-card {
        padding: 24px 22px;
        border-radius: 24px;
    }

    body.chapter-page .chapter-page-kicker {
        margin-bottom: 16px;
        padding: 10px 14px;
        font-size: 11px;
    }

    body.chapter-page .chapter-hero-content h1 {
        font-size: clamp(38px, 9vw, 52px);
    }

    body.chapter-page .chapter-hero-content > p {
        font-size: 14px;
        line-height: 1.68;
    }

    body.chapter-page .chapter-user-context {
        width: 100%;
        min-width: 0;
    }

    body.chapter-page .chapter-context-item {
        flex: 1;
        min-width: 0;
    }

    body.chapter-page .chapter-hero-visual {
        width: min(100%, 390px);
        height: auto;
        padding: 16px 14px 15px;
    }

    body.chapter-page .chapter-orbit-stage {
        width: 280px;
        height: 280px;
    }

    body.chapter-page .chapter-orbit-outer {
        width: 238px;
        height: 238px;
    }

    body.chapter-page .chapter-orbit-middle {
        width: 196px;
        height: 196px;
    }

    body.chapter-page .chapter-orbit-inner {
        width: 156px;
        height: 156px;
    }

    body.chapter-page .chapter-hero-number {
        width: 144px;
        height: 144px;
    }

    body.chapter-page #chapterActiveNumber {
        font-size: 50px;
    }

    body.chapter-page .chapter-active-glow {
        width: 176px;
        height: 176px;
    }
}


@media (max-width: 640px) {

    body.chapter-page .chapter-hero {
        min-height: 0;
        padding: calc(var(--ag-header-height) + 18px) 0 22px;
    }

    body.chapter-page .chapter-hero-card {
        gap: 22px;
        padding: 22px 18px;
    }

    body.chapter-page .chapter-hero-content h1 {
        font-size: clamp(36px, 10.5vw, 48px);
    }

    body.chapter-page .chapter-page-kicker {
        padding: 9px 13px;
    }

    body.chapter-page .chapter-page-kicker span:first-child,
    body.chapter-page .chapter-kicker-symbol {
        font-size: 21px;
    }

    body.chapter-page .chapter-context-item {
        padding: 13px 14px;
    }


    body.chapter-page .chapter-progress-section {
        padding: 28px 0 38px;
    }

    body.chapter-page .chapter-dashboard-grid {
        gap: 15px;
    }

    body.chapter-page .chapter-dashboard-card {
        padding: 21px 18px 19px;
        border-radius: 22px;
    }

    body.chapter-page .chapter-dashboard-intro h2 {
        font-size: clamp(29px, 9vw, 40px);
    }

    body.chapter-page .chapter-dashboard-intro p {
        font-size: 14px;
    }

    body.chapter-page .chapter-progress-stat-box {
        min-height: 94px;
        padding: 15px 14px;
    }

    body.chapter-page .chapter-progress-stat-box strong {
        font-size: 32px;
    }

    body.chapter-page .chapter-progress-stat-box span {
        font-size: 9px;
    }

    body.chapter-page .chapter-dashboard-resume {
        grid-template-columns: 52px minmax(0, 1fr);
        gap: 14px;
    }

    body.chapter-page .chapter-resume-icon {
        width: 52px;
        height: 52px;
        font-size: 26px;
    }

    body.chapter-page .chapter-resume-copy strong {
        font-size: 16px;
        white-space: normal;
    }

    body.chapter-page .chapter-resume-copy small {
        font-size: 12px;
    }

    body.chapter-page .chapter-resume-button {
        grid-column: 1 / -1;
        width: 100%;
        min-width: 0;
        min-height: 52px;
        margin-top: 2px;
        font-size: 14px;
    }

    body.chapter-page .chapter-progress-meter-head {
        align-items: flex-start;
        flex-direction: column;
        gap: 5px;
    }

    body.chapter-page .chapter-overall-track {
        height: 11px;
    }


    body.chapter-page .chapter-list-container {
        padding-top: 54px;
        padding-bottom: 66px;
    }

    body.chapter-page .chapter-list-heading {
        margin-bottom: 30px;
    }

    body.chapter-page .chapter-list-heading h2 {
        font-size: clamp(34px, 10vw, 46px);
    }

    body.chapter-page .chapter-cosmic-canvas {
        height: 100vh !important;
        height: 100svh !important;
        min-height: 0 !important;
        margin: 0 !important;
    }

    body.chapter-page .chapter-cosmic-atmosphere {
        background-size: 100% 1050px;
    }

    body.chapter-page .chapter-cosmic-atmosphere::after {
        left: 23px;
        width: 76px;
    }

    body.chapter-page .chapter-cosmic-nebula-three {
        display: none;
    }

    body.chapter-page .chapter-journey {
        gap: 20px;
    }

    body.chapter-page .chapter-journey::before {
        left: 23px;
        width: 70px;
    }

    body.chapter-page .chapter-journey-line {
        left: 23px;
    }

    body.chapter-page .chapter-item {
        grid-template-columns: 46px minmax(0, 1fr);
        column-gap: 12px;
    }

    body.chapter-page .chapter-marker {
        opacity: 1 !important;
        visibility: visible !important;
    }

    body.chapter-page .chapter-marker-number {
        width: 42px;
        height: 42px;
        flex-basis: 42px;
        opacity: 1 !important;
        visibility: visible !important;
        font-size: 10px;
    }

    body.chapter-page .chapter-marker::before {
        width: 54px;
        height: 54px;
    }

    body.chapter-page .chapter-card {
        width: 100%;
        padding: 21px 18px;
        border-radius: 19px;
    }

    body.chapter-page .chapter-card-title-row {
        grid-template-columns: 1fr;
    }

    body.chapter-page .chapter-card-footer {
        flex-direction: column;
        align-items: flex-start;
    }

    body.chapter-page .chapter-end-card {
        grid-template-columns: 1fr;
        text-align: center;
    }

    body.chapter-page .chapter-end-icon {
        margin-inline: auto;
    }
}


@media (max-width: 480px) {

    body.chapter-page .chapter-user-context {
        flex-direction: column;
    }

    body.chapter-page .chapter-context-divider {
        width: auto;
        height: 1px;
        margin: 0 14px;
    }

    body.chapter-page .chapter-hero-visual {
        width: 100%;
    }

    body.chapter-page .chapter-orbit-stage {
        width: 240px;
        height: 240px;
    }

    body.chapter-page .chapter-orbit-outer {
        width: 204px;
        height: 204px;
    }

    body.chapter-page .chapter-orbit-middle {
        width: 168px;
        height: 168px;
    }

    body.chapter-page .chapter-orbit-inner {
        width: 134px;
        height: 134px;
    }

    body.chapter-page .chapter-orbit-number {
        width: 20px;
        height: 20px;
        font-size: 7px;
    }

    body.chapter-page .chapter-orbit-number.is-active {
        width: 32px;
        height: 32px;
        font-size: 10px;
    }

    body.chapter-page .chapter-hero-number {
        width: 118px;
        height: 118px;
    }

    body.chapter-page #chapterActiveNumber {
        font-size: 40px;
    }

    body.chapter-page .chapter-active-glow {
        width: 148px;
        height: 148px;
    }
}


@media (max-width: 440px) {

    body.chapter-page .chapter-dashboard-stats-grid {
        grid-template-columns: 1fr;
    }

    body.chapter-page .chapter-progress-stat-box {
        min-height: 88px;
    }

    body.chapter-page .chapter-progress-stat-box strong {
        font-size: 30px;
    }
}


@media (max-width: 420px) {

    body.chapter-page .chapter-list-heading h2 {
        font-size: clamp(31px, 10.5vw, 39px);
    }

    body.chapter-page .chapter-item {
        grid-template-columns: 42px minmax(0, 1fr);
        column-gap: 10px;
    }

    body.chapter-page .chapter-journey-line,
    body.chapter-page .chapter-journey::before,
    body.chapter-page .chapter-cosmic-atmosphere::after {
        left: 21px;
    }

    body.chapter-page .chapter-marker-number {
        width: 38px;
        height: 38px;
        flex-basis: 38px;
        font-size: 9px;
    }

    body.chapter-page .chapter-marker::before {
        width: 50px;
        height: 50px;
    }
}


/* ============================================================
   TOUCH
============================================================ */

@media (hover: none) and (pointer: coarse) {

    body.chapter-page .chapter-item:hover .chapter-card,
    body.chapter-page .chapter-resume-button:hover {
        transform: none;
    }

    body.chapter-page .chapter-card::before {
        display: none;
    }
}


/* ============================================================
   REDUCED MOTION
============================================================ */

@media (prefers-reduced-motion: reduce) {

    body.chapter-page .chapter-orbit-outer,
    body.chapter-page .chapter-orbit-middle,
    body.chapter-page .chapter-orbit-inner,
    body.chapter-page .chapter-orbit-number,
    body.chapter-page .chapter-active-glow,
    body.chapter-page .chapter-visual-dot,
    body.chapter-page .chapter-loading-card span,
    body.chapter-page .chapter-cosmic-atmosphere::before,
    body.chapter-page .chapter-cosmic-atmosphere::after,
    body.chapter-page .chapter-cosmic-nebula,
    body.chapter-page .chapter-journey::before,
    body.chapter-page .chapter-journey-line,
    body.chapter-page .chapter-marker::before,
    body.chapter-page .chapter-card,
    body.chapter-page .chapter-card-progress span::after {
        animation: none !important;
    }

    body.chapter-page .chapter-marker-number {
        animation: none !important;
        opacity: 1 !important;
        visibility: visible !important;
    }

    body.chapter-page .chapter-card::before {
        display: none !important;
    }

    body.chapter-page * {
        scroll-behavior: auto !important;
    }
}


/* ============================================================
   ANIMATIONS
============================================================ */

@keyframes chapterOuterSpin {
    from {
        transform: translate(-50%, -50%) rotate(0deg);
    }

    to {
        transform: translate(-50%, -50%) rotate(360deg);
    }
}

@keyframes chapterMiddleSpin {
    from {
        transform: translate(-50%, -50%) rotate(360deg);
    }

    to {
        transform: translate(-50%, -50%) rotate(0deg);
    }
}

@keyframes chapterInnerSpin {
    from {
        transform: translate(-50%, -50%) rotate(0deg);
    }

    to {
        transform: translate(-50%, -50%) rotate(360deg);
    }
}

@keyframes chapterOrbitActiveBlink {
    0%,
    100% {
        box-shadow:
            0 0 0 5px rgba(230, 142, 22, 0.08),
            0 0 18px rgba(236, 148, 24, 0.24),
            0 8px 20px rgba(0, 0, 0, 0.18);
    }

    50% {
        box-shadow:
            0 0 0 8px rgba(230, 142, 22, 0.14),
            0 0 27px rgba(236, 148, 24, 0.46),
            0 8px 20px rgba(0, 0, 0, 0.22);
    }
}

@keyframes chapterCenterSwap {
    0% {
        opacity: 0;
        filter: blur(5px);
        transform: translateY(-15px) scale(0.92);
    }

    100% {
        opacity: 1;
        filter: blur(0);
        transform: translateY(0) scale(1);
    }
}

@keyframes chapterActiveGlowIdle {
    0%,
    100% {
        opacity: 0.58;
        transform: translate(-50%, -50%) scale(0.94);
    }

    50% {
        opacity: 0.84;
        transform: translate(-50%, -50%) scale(1.045);
    }
}

@keyframes chapterGlowPulse {
    0% {
        opacity: 0.48;
        transform: translate(-50%, -50%) scale(0.90);
    }

    50% {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1.10);
    }

    100% {
        opacity: 0.72;
        transform: translate(-50%, -50%) scale(1);
    }
}

@keyframes chapterVisualDotPulse {
    0%,
    100% {
        opacity: 0.46;
        transform: scale(0.86);
    }

    50% {
        opacity: 1;
        transform: scale(1.18);
    }
}

@keyframes gitaSkeletonMove {
    from {
        background-position: 200% 0;
    }

    to {
        background-position: -200% 0;
    }
}

@keyframes chapterStarFieldDrift {

    from {
        background-position:
            5px 7px,
            38px 21px,
            74px 49px,
            112px 83px;
    }

    to {
        background-position:
            59px 61px,
            -51px 110px,
            205px 180px,
            -61px 256px;
    }

}


@keyframes chapterStarsTwinkle {

    0% {
        opacity: 0.42;
        filter: brightness(0.92);
    }

    45% {
        opacity: 0.76;
        filter: brightness(1.12);
    }

    100% {
        opacity: 0.58;
        filter: brightness(1);
    }

}


@keyframes chapterBlueHazeOne {

    from {
        transform:
            translate3d(0, 0, 0)
            scale(0.96);
    }

    to {
        transform:
            translate3d(42px, 24px, 0)
            scale(1.07);
    }

}


@keyframes chapterBlueHazeTwo {

    from {
        transform:
            translate3d(0, 0, 0)
            scale(1);
    }

    to {
        transform:
            translate3d(-46px, 32px, 0)
            scale(1.09);
    }

}


@keyframes chapterBlueHazeThree {

    from {
        transform:
            translate3d(0, 0, 0)
            scale(0.95);
    }

    to {
        transform:
            translate3d(28px, -36px, 0)
            scale(1.08);
    }

}


@keyframes chapterJourneyBeamPulse {
    0%,
    100% {
        opacity: 0.54;
    }

    50% {
        opacity: 1;
    }
}

@keyframes chapterTimelineStableFlow {
    from {
        background-position: 0 0;
    }

    to {
        background-position: 0 250%;
    }
}

@keyframes chapterMarkerHaloStable {
    0%,
    100% {
        opacity: 0.42;
        transform: translate(-50%, -50%) scale(0.90);
    }

    50% {
        opacity: 0.90;
        transform: translate(-50%, -50%) scale(1.08);
    }
}

@keyframes chapterCardReveal {
    from {
        opacity: 0;
        transform: translateY(18px) scale(0.985);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@keyframes chapterProgressShimmer {
    0%,
    42% {
        transform: translateX(-120%);
    }

    72%,
    100% {
        transform: translateX(120%);
    }
}


/* ============================================================
   END OF CHAPTER.CSS
============================================================ */
