
/* ==========================================
   GO BEGINNER - BLACK & GOLD THEME
   Version 2.0
   Preserving the original visual identity
========================================== */


/* ==========================================
   1. GLOBAL SETTINGS
========================================== */

/* Remove default browser spacing */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* Website color system */
:root {
    --bg-primary: #f4f4f6;
    --bg-surface: #ffffff;

    --dark-header: #141416;
    --dark-surface: #1e1e22;

    --accent-gold: #c59b27;
    --accent-gold-hover: #e5b839;

    --accent-green: #10b981;
    --accent-red: #ef4444;

    --text-primary: #18181b;
    --text-secondary: #71717a;
    --text-muted: #a1a1aa;

    --border-light: #e4e4e7;
    --border-dark: #27272a;

    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.04);
    --shadow-md: 0 10px 30px rgba(0, 0, 0, 0.08);
    --shadow-lg: 0 20px 40px rgba(0, 0, 0, 0.12);

    --content-width: 1280px;
    --content-padding: 24px;
}

/* Smooth scrolling */
html {
    scroll-behavior: smooth;
    scroll-padding-top: 100px;
}

/* Basic page settings */
body {
    font-family:
        -apple-system,
        BlinkMacSystemFont,
        "Segoe UI",
        Roboto,
        Helvetica,
        Arial,
        sans-serif;

    background-color: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
}

/* Links */
a {
    text-decoration: none;
    color: inherit;
}

/* Images */
img {
    max-width: 100%;
    display: block;
}

/* Buttons */
button {
    font: inherit;
}


/* ==========================================
   2. HEADER
========================================== */

.site-header {
    min-height: 76px;
    padding: 12px 5%;

    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 28px;

    background: rgba(20, 20, 22, 0.96);

    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);

    border-bottom: 1px solid rgba(255, 255, 255, 0.08);

    position: sticky;
    top: 0;
    z-index: 1000;
}

/* Logo container */
.header-logo {
    display: flex;
    align-items: center;
    gap: 12px;

    flex-shrink: 0;

    transition: transform 0.3s ease;
}

.header-logo:hover {
    transform: translateY(-1px);
}

/* Logo symbol */
.header-logo .logo-icon {
    font-size: 20px;
    color: var(--accent-gold);

    filter: drop-shadow(
        0 0 8px rgba(197, 155, 39, 0.4)
    );
}

/* Brand name */
.header-logo .brand-name {
    display: block;

    font-family: "Arial Black", sans-serif;
    font-size: 18px;
    font-weight: 900;
    letter-spacing: 1.5px;

    color: #ffffff;
}

/* Brand subtitle */
.header-logo .brand-tagline {
    display: block;

    font-size: 9px;
    letter-spacing: 2.5px;
    font-weight: 600;

    color: var(--accent-gold);
}


/* ==========================================
   3. QUICK CHAPTER NAVIGATION
========================================== */

.header-chapter-nav {
    display: flex;
    align-items: center;
    gap: 10px;

    flex: 1;
    max-width: 590px;
}

/* Chapter navigation item */
.header-chapter-nav .chapter-tab {
    flex: 1;

    min-width: 0;

    padding: 9px 13px;

    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 20px;

    color: var(--text-muted);

    font-size: 12px;
    font-weight: 600;

    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;

    white-space: nowrap;

    transition: all 0.3s ease;
}

/* Chapter number */
.header-chapter-nav .chapter-tab span {
    color: var(--accent-gold);
    font-weight: 800;
}

/* Hover effect */
.header-chapter-nav .chapter-tab:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #ffffff;

    border-color: rgba(255, 255, 255, 0.25);
}

/* Active chapter */
.header-chapter-nav .chapter-tab.active {
    background: var(--accent-gold);
    color: #141416;

    border-color: var(--accent-gold);

    box-shadow:
        0 0 15px rgba(197, 155, 39, 0.3);
}

.header-chapter-nav .chapter-tab.active span {
    color: #141416;
}


/* ==========================================
   4. MAIN NAVIGATION
========================================== */

.main-nav {
    display: flex;
    align-items: center;
    gap: 24px;

    flex-shrink: 0;
}

.main-nav a {
    color: var(--text-muted);

    font-size: 14px;
    font-weight: 600;

    white-space: nowrap;

    transition: color 0.3s ease;
}

.main-nav a:hover,
.main-nav a.active {
    color: var(--accent-gold);
}


/* ==========================================
   5. PROGRESS BAR
   Used by learning chapters
========================================== */

.learning-progress-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;

    background: var(--bg-surface);

    padding: 16px 28px;
    margin-bottom: 35px;

    border-radius: 16px;
    border: 1px solid var(--border-light);

    box-shadow: var(--shadow-sm);
}

.progress-step {
    display: flex;
    align-items: center;
    gap: 10px;

    font-size: 13px;
    font-weight: 600;

    color: var(--text-muted);
}

.progress-step .step-num {
    width: 26px;
    height: 26px;

    border-radius: 50%;

    background: var(--bg-primary);

    display: flex;
    align-items: center;
    justify-content: center;

    font-size: 12px;
}

.progress-step.completed {
    color: var(--text-primary);
}

.progress-step.completed .step-num {
    background: rgba(16, 185, 129, 0.15);
    color: var(--accent-green);
}

.progress-step.current {
    color: var(--accent-gold);
}

.progress-step.current .step-num {
    background: var(--accent-gold);
    color: #141416;
    font-weight: 800;
}

.progress-line {
    flex: 1;

    height: 2px;

    background: var(--border-light);

    margin: 0 15px;
}

.progress-line.active {
    background: var(--accent-gold);
}


/* ==========================================
   6. HOME PAGE CONTAINER
========================================== */

#home-page {
    width: 100%;
    max-width: var(--content-width);

    margin: 0 auto;

    padding:
        40px
        var(--content-padding)
        80px;
}


/* ==========================================
   7. HERO SECTION
========================================== */

.hero {
    min-height: 480px;

    padding: 65px 8%;

    display: flex;
    align-items: center;
    justify-content: space-between;

    gap: 40px;

    background: var(--dark-header);

    border-radius: 24px;

    color: #ffffff;

    box-shadow: var(--shadow-lg);

    position: relative;
    overflow: hidden;

    border: 1px solid var(--border-dark);
}

/* Gold background decoration */
.hero::after {
    content: "";

    position: absolute;

    top: -50%;
    right: -20%;

    width: 500px;
    height: 500px;

    background:
        radial-gradient(
            circle,
            rgba(197, 155, 39, 0.15) 0%,
            transparent 70%
        );

    pointer-events: none;
}

/* Hero text container */
.hero-content {
    max-width: 570px;

    position: relative;
    z-index: 2;
}

/* Small section label */
.eyebrow {
    display: inline-block;

    color: var(--accent-gold);

    font-size: 11px;
    font-weight: 800;
    letter-spacing: 2px;

    margin-bottom: 14px;
}

/* Hero title */
.hero h1 {
    font-size: clamp(36px, 4.5vw, 58px);

    line-height: 1.15;

    margin-bottom: 20px;

    font-weight: 800;
}

/* Gold divider */
.hero-line {
    width: 48px;
    height: 3px;

    background: var(--accent-gold);

    margin-bottom: 20px;

    border-radius: 2px;
}

/* Hero description */
.hero p {
    max-width: 520px;

    color: var(--text-muted);

    font-size: 16px;
    line-height: 1.8;

    margin-bottom: 28px;
}

/* Main action button */
.primary-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 12px;

    padding: 14px 32px;

    background: var(--accent-gold);
    color: #141416;

    border-radius: 30px;

    font-size: 14px;
    font-weight: 700;

    transition: all 0.3s ease;

    box-shadow:
        0 4px 20px rgba(197, 155, 39, 0.25);
}

/* Button hover */
.primary-button:hover {
    background: var(--accent-gold-hover);

    transform: translateY(-2px);

    box-shadow:
        0 8px 25px rgba(197, 155, 39, 0.35);
}


/* ==========================================
   8. HERO MINI GO BOARD
========================================== */

.hero-decoration {
    width: 280px;
    height: 280px;

    flex-shrink: 0;

    display: flex;
    align-items: center;
    justify-content: center;

    position: relative;
    z-index: 1;

    transform: rotate(6deg);
}

.mini-board {
    width: 250px;
    height: 250px;

    background-color: #dfbd88;

    background-image:
        linear-gradient(
            to right,
            rgba(89, 67, 42, 0.4) 1px,
            transparent 1px
        ),
        linear-gradient(
            to bottom,
            rgba(89, 67, 42, 0.4) 1px,
            transparent 1px
        );

    background-size: 35px 35px;

    border-radius: 12px;
    border: 2px solid #b89762;

    position: relative;

    box-shadow:
        0 20px 40px rgba(0, 0, 0, 0.4);
}

/* Mini board stones */
.mini-stone {
    position: absolute;

    width: 28px;
    height: 28px;

    border-radius: 50%;

    z-index: 2;
}

.mini-stone.black {
    background:
        radial-gradient(
            circle at 35% 30%,
            #555,
            #111 70%
        );

    box-shadow:
        2px 4px 8px rgba(0, 0, 0, 0.4);

    top: 70px;
    left: 70px;
}

.mini-stone.white {
    background:
        radial-gradient(
            circle at 35% 30%,
            #fff,
            #dcd6cd 70%
        );

    box-shadow:
        2px 4px 8px rgba(0, 0, 0, 0.2);

    top: 70px;
    left: 105px;
}

.mini-stone.second {
    top: 105px;
    left: 105px;
}


/* ==========================================
   9. COMMON SECTION HEADING
========================================== */

.section-heading {
    max-width: 680px;

    margin: 0 auto 38px;

    text-align: center;
}

.section-heading .eyebrow {
    margin-bottom: 10px;
}

.section-heading h2 {
    color: var(--text-primary);

    font-size: clamp(27px, 3vw, 36px);

    line-height: 1.25;

    font-weight: 800;

    margin-bottom: 12px;
}

.section-heading p {
    color: var(--text-secondary);

    font-size: 15px;
    line-height: 1.8;
}


/* ==========================================
   10. LEARNING JOURNEY SECTION
========================================== */

.learning-journey {
    padding: 85px 0 75px;
}

.journey-grid {
    display: grid;

    grid-template-columns: repeat(3, minmax(0, 1fr));

    gap: 22px;
}

.journey-card {
    min-height: 220px;

    padding: 30px;

    background: var(--bg-surface);

    border: 1px solid var(--border-light);
    border-radius: 16px;

    box-shadow: var(--shadow-sm);

    position: relative;
    overflow: hidden;

    transition:
        transform 0.3s ease,
        box-shadow 0.3s ease,
        border-color 0.3s ease;
}

.journey-card:hover {
    transform: translateY(-5px);

    box-shadow: var(--shadow-md);

    border-color: rgba(197, 155, 39, 0.45);
}

/* Large decorative number */
.journey-number {
    display: block;

    color: var(--accent-gold);

    font-size: 32px;
    font-weight: 900;

    line-height: 1;

    margin-bottom: 22px;
}

.journey-card h3 {
    font-size: 19px;
    font-weight: 800;

    margin-bottom: 10px;
}

.journey-card p {
    color: var(--text-secondary);

    font-size: 14px;
    line-height: 1.8;

    margin-bottom: 20px;
}

.journey-range {
    display: inline-block;

    color: #92701d;

    background: rgba(197, 155, 39, 0.12);

    padding: 6px 10px;

    border-radius: 5px;

    font-size: 10px;
    font-weight: 800;
    letter-spacing: 1px;
}


/* ==========================================
   11. COURSE SECTION
========================================== */

.course-section {
    padding: 70px 0 85px;

    border-top: 1px solid var(--border-light);
}

/* Three-column course layout */
.course-grid {
    display: grid;

    grid-template-columns: repeat(3, minmax(0, 1fr));

    gap: 22px;
}

/* Individual course card */
.course-card {
    min-height: 255px;

    padding: 26px;

    background: var(--bg-surface);

    border: 1px solid var(--border-light);
    border-radius: 16px;

    box-shadow: var(--shadow-sm);

    display: flex;
    flex-direction: column;
    align-items: flex-start;

    transition:
        transform 0.3s ease,
        box-shadow 0.3s ease,
        border-color 0.3s ease;
}

/* Hover effect for available courses */
.course-card.available:hover {
    transform: translateY(-5px);

    box-shadow: var(--shadow-md);

    border-color: rgba(197, 155, 39, 0.55);
}

/* Course number and status row */
.course-card-top {
    width: 100%;

    display: flex;
    align-items: center;
    justify-content: space-between;

    gap: 10px;

    margin-bottom: 22px;
}

/* Course number */
.course-number {
    color: var(--accent-gold);

    font-size: 27px;
    font-weight: 900;

    line-height: 1;
}

/* Course status */
.course-status {
    color: #92701d;

    background: rgba(197, 155, 39, 0.12);

    padding: 5px 9px;

    border-radius: 5px;

    font-size: 9px;
    font-weight: 800;
    letter-spacing: 0.8px;
}

/* Course title */
.course-card h3 {
    color: var(--text-primary);

    font-size: 18px;
    font-weight: 800;

    line-height: 1.4;

    margin-bottom: 10px;
}

/* Course description */
.course-card p {
    color: var(--text-secondary);

    font-size: 13px;
    line-height: 1.8;

    margin-bottom: 22px;
}

/* Available course link */
.course-link {
    display: inline-flex;
    align-items: center;
    gap: 9px;

    color: #92701d;

    font-size: 13px;
    font-weight: 800;

    margin-top: auto;

    transition:
        color 0.25s ease,
        gap 0.25s ease;
}

.course-link:hover {
    color: var(--accent-gold-hover);

    gap: 14px;
}

/* Upcoming course */
.course-card.upcoming {
    background: #fafafa;

    border-style: dashed;

    box-shadow: none;
}

.course-card.upcoming .course-number {
    color: #b6a77e;
}

.course-card.upcoming .course-status {
    color: #858585;

    background: #eeeeef;
}

.course-card.upcoming h3 {
    color: #55555b;
}

.course-card.upcoming p {
    color: #898990;
}

/* Disabled course label */
.course-disabled {
    display: inline-block;

    color: #898990;

    font-size: 12px;
    font-weight: 700;

    margin-top: auto;
}


/* ==========================================
   12. START LEARNING SECTION
========================================== */

.start-learning-section {
    padding: 65px 8%;

    background: var(--dark-header);

    border: 1px solid var(--border-dark);
    border-radius: 20px;

    color: #ffffff;

    text-align: center;

    position: relative;
    overflow: hidden;
}

.start-learning-section::before {
    content: "";

    position: absolute;

    width: 350px;
    height: 350px;

    left: -130px;
    bottom: -230px;

    background:
        radial-gradient(
            circle,
            rgba(197, 155, 39, 0.18),
            transparent 70%
        );

    pointer-events: none;
}

.start-learning-content {
    max-width: 680px;

    margin: 0 auto;

    position: relative;
    z-index: 1;
}

.start-learning-content .eyebrow {
    margin-bottom: 14px;
}

.start-learning-content h2 {
    font-size: clamp(27px, 3vw, 38px);

    line-height: 1.25;

    margin-bottom: 16px;
}

.start-learning-content p {
    color: var(--text-muted);

    font-size: 15px;
    line-height: 1.8;

    margin-bottom: 28px;
}


/* ==========================================
   13. FOOTER
========================================== */

.site-footer {
    background: var(--dark-header);

    padding: 38px 24px;

    color: var(--text-muted);

    text-align: center;

    border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.footer-brand {
    margin-bottom: 12px;
}

.footer-brand .brand-name {
    display: block;

    color: #ffffff;

    font-family: "Arial Black", sans-serif;

    font-size: 16px;
    font-weight: 900;
    letter-spacing: 1.5px;
}

.footer-brand .brand-tagline {
    display: block;

    color: var(--accent-gold);

    font-size: 9px;
    font-weight: 700;
    letter-spacing: 2px;
}

.site-footer p {
    font-size: 13px;

    margin-bottom: 18px;
}

.footer-copyright {
    color: #77777e;

    font-size: 11px;
}


/* ==========================================
   14. LEARNING PAGES
   Existing Chapter 1, Chapter 2 and Chapter 3
========================================== */

#learning-page {
    max-width: 1140px;

    margin: 0 auto;

    padding: 40px 20px 80px;
}

.chapter-title {
    margin-bottom: 30px;
}

.chapter-title h2 {
    font-size: 32px;
    font-weight: 800;

    margin-bottom: 8px;
}

/* Lesson and concept grids */
.lesson-grid,
.concept-grid {
    display: grid;

    grid-template-columns: repeat(3, minmax(0, 1fr));

    gap: 20px;

    margin-bottom: 35px;
}

.concept-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

/* Lesson cards */
.lesson-card {
    padding: 30px;

    background: var(--bg-surface);

    border: 1px solid var(--border-light);
    border-radius: 16px;

    box-shadow: var(--shadow-sm);

    transition: all 0.3s ease;
}

.lesson-card:hover {
    transform: translateY(-4px);

    box-shadow: var(--shadow-md);

    border-color: rgba(197, 155, 39, 0.3);
}

.lesson-number {
    display: block;

    color: var(--accent-gold);

    font-size: 20px;
    font-weight: 800;

    margin-bottom: 12px;
}

.lesson-card h3 {
    font-size: 18px;
    font-weight: 700;

    margin-bottom: 10px;
}

.lesson-card p {
    color: var(--text-secondary);

    font-size: 14px;
    line-height: 1.7;
}


/* ==========================================
   15. DEMO PANELS AND CONTROLS
========================================== */

.demo-panel {
    padding: 36px;

    background: var(--bg-surface);

    border: 1px solid var(--border-light);
    border-radius: 20px;

    box-shadow: var(--shadow-md);

    margin-bottom: 35px;
}

.board-controls {
    display: flex;
    flex-wrap: wrap;

    gap: 12px;

    margin-bottom: 24px;
}

.control-button {
    padding: 10px 20px;

    background: var(--bg-primary);

    border: 1px solid var(--border-light);
    border-radius: 20px;

    color: var(--text-primary);

    font-size: 13px;
    font-weight: 600;

    cursor: pointer;

    transition: all 0.25s ease;
}

.control-button:hover,
.control-button.active {
    background: var(--dark-header);

    color: #ffffff;

    border-color: var(--dark-header);
}


/* ==========================================
   16. GO BOARD
========================================== */

.board-wrapper {
    width: 100%;
    max-width: 520px;

    padding: 16px;

    background: #dfbd88;

    border-radius: 12px;

    box-shadow:
        inset 0 0 15px rgba(0, 0, 0, 0.15),
        var(--shadow-md);

    margin: 0 auto;
}

/* Board grid */
.go-board {
    width: 100%;

    display: grid;

    position: relative;

    background-color: #dfbd88;

    background-image:
        linear-gradient(
            to right,
            transparent calc(50% - 0.5px),
            #59432a 50%,
            transparent calc(50% + 0.5px)
        ),
        linear-gradient(
            to bottom,
            transparent calc(50% - 0.5px),
            #59432a 50%,
            transparent calc(50% + 0.5px)
        );
}

/* Board sizes */
.board-19 {
    grid-template-columns: repeat(19, minmax(0, 1fr));
}

.board-9 {
    grid-template-columns: repeat(9, minmax(0, 1fr));
}

/* Individual board intersection */
.board-point {
    width: 100%;

    aspect-ratio: 1 / 1;

    position: relative;

    display: flex;
    align-items: center;
    justify-content: center;

    border: none;

    background: transparent;

    cursor: pointer;
}

/* Horizontal board line */
.board-point::before {
    content: "";

    position: absolute;

    width: 100%;
    height: 1px;

    background: #59432a;

    top: 50%;
}

/* Vertical board line */
.board-point::after {
    content: "";

    position: absolute;

    height: 100%;
    width: 1px;

    background: #59432a;

    left: 50%;
}

/* Stones */
.stone {
    width: 88%;
    height: 88%;

    position: relative;
    z-index: 3;

    border-radius: 50%;

    pointer-events: none;

    animation:
        stoneScaleIn 0.18s
        cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

/* Stone placement animation */
@keyframes stoneScaleIn {
    0% {
        transform: scale(1.4);
        opacity: 0;
    }

    100% {
        transform: scale(1);
        opacity: 1;
    }
}

/* Black stone */
.stone.black {
    background:
        radial-gradient(
            circle at 35% 28%,
            #555,
            #141414 70%
        );

    box-shadow:
        1px 3px 6px rgba(0, 0, 0, 0.4);
}

/* White stone */
.stone.white {
    background:
        radial-gradient(
            circle at 35% 28%,
            #ffffff,
            #e3dfd7 75%
        );

    box-shadow:
        1px 3px 6px rgba(0, 0, 0, 0.25);

    border: 1px solid #d1cac0;
}

/* Highlighted liberties */
.board-point.liberty-highlight {
    background: rgba(16, 185, 129, 0.25);

    border-radius: 50%;
}

/* Last move marker */
.board-point .last-move-marker {
    width: 8px;
    height: 8px;

    position: absolute;
    z-index: 5;

    background: var(--accent-red);

    border-radius: 50%;
}


/* ==========================================
   17. GAME BOARD LAYOUT AND STATISTICS
========================================== */

.game-board-layout {
    display: grid;

    grid-template-columns: minmax(0, 1fr) 240px;

    gap: 25px;

    align-items: start;

    margin-top: 20px;
}

.game-stat {
    padding: 20px;

    background: var(--bg-surface);

    border: 1px solid var(--border-light);
    border-radius: 12px;

    text-align: center;

    box-shadow: var(--shadow-sm);
}

.game-stat span {
    color: var(--accent-gold);

    font-size: 11px;
    font-weight: 800;
    letter-spacing: 1px;
}

.game-stat strong {
    display: block;

    font-size: 28px;

    margin: 4px 0;
}

/* Previous and next lesson navigation */
.lesson-navigation {
    display: flex;
    justify-content: space-between;
    align-items: center;

    gap: 15px;

    padding-top: 30px;

    border-top: 1px solid var(--border-light);
}


/* ==========================================
   18. RESPONSIVE DESIGN
========================================== */

/* Medium screens: tablets and small laptops */
@media (max-width: 1100px) {

    .site-header {
        gap: 18px;

        padding-left: 3%;
        padding-right: 3%;
    }

    .header-chapter-nav {
        max-width: 470px;
        gap: 7px;
    }

    .header-chapter-nav .chapter-tab {
        padding: 8px 9px;
        font-size: 11px;
    }

    .main-nav {
        gap: 15px;
    }

    .course-grid,
    .journey-grid {
        gap: 16px;
    }

    .course-card {
        padding: 22px;
    }
}


/* Tablet layout */
@media (max-width: 868px) {

    .site-header {
        flex-wrap: wrap;

        justify-content: space-between;

        height: auto;

        padding: 16px 5%;
    }

    .header-logo {
        order: 1;
    }

    .main-nav {
        order: 2;
    }

    .header-chapter-nav {
        order: 3;

        width: 100%;
        max-width: none;
    }

    .header-chapter-nav .chapter-tab {
        flex: 1;
    }

    .hero {
        flex-direction: column;

        text-align: center;

        padding: 45px 30px;

        gap: 25px;
    }

    .hero-content {
        max-width: 650px;
    }

    .hero-line {
        margin-left: auto;
        margin-right: auto;
    }

    .hero p {
        margin-left: auto;
        margin-right: auto;
    }

    .hero-decoration {
        margin-top: 5px;
    }

    .journey-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .course-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .lesson-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .concept-grid,
    .game-board-layout {
        grid-template-columns: 1fr;
    }

    .game-board-layout {
        gap: 20px;
    }

    .learning-progress-bar {
        flex-wrap: wrap;
        gap: 12px;
    }

    .progress-line {
        min-width: 20px;
    }
}


/* Mobile layout */
@media (max-width: 560px) {

    #home-page {
        padding: 22px 14px 50px;
    }

    .site-header {
        padding: 14px 16px;

        gap: 14px;
    }

    .header-logo .brand-name {
        font-size: 15px;
    }

    .header-logo .brand-tagline {
        font-size: 8px;
    }

    .main-nav {
        gap: 13px;
    }

    .main-nav a {
        font-size: 12px;
    }

    .header-chapter-nav {
        gap: 6px;
    }

    .header-chapter-nav .chapter-tab {
        padding: 8px 5px;

        font-size: 10px;

        white-space: normal;

        text-align: center;
    }

    .header-chapter-nav .chapter-tab span {
        font-size: 10px;
    }

    .hero {
        min-height: auto;

        padding: 40px 20px;

        border-radius: 18px;
    }

    .hero h1 {
        font-size: 36px;
    }

    .hero p {
        font-size: 14px;
    }

    .hero-decoration {
        width: 220px;
        height: 220px;
    }

    .mini-board {
        width: 200px;
        height: 200px;

        background-size: 28px 28px;
    }

    .mini-stone {
        width: 23px;
        height: 23px;
    }

    .mini-stone.black {
        top: 56px;
        left: 56px;
    }

    .mini-stone.white {
        top: 56px;
        left: 84px;
    }

    .mini-stone.second {
        top: 84px;
        left: 84px;
    }

    .learning-journey {
        padding: 60px 0 45px;
    }

    .course-section {
        padding: 55px 0 60px;
    }

    .section-heading {
        margin-bottom: 26px;
    }

    .section-heading h2 {
        font-size: 27px;
    }

    .section-heading p {
        font-size: 13px;
    }

    .journey-grid,
    .course-grid,
    .lesson-grid,
    .concept-grid {
        grid-template-columns: 1fr;
    }

    .journey-card {
        min-height: auto;
        padding: 25px;
    }

    .course-card {
        min-height: 225px;
        padding: 24px;
    }

    .start-learning-section {
        padding: 45px 22px;

        border-radius: 16px;
    }

    .start-learning-content h2 {
        font-size: 27px;
    }

    .start-learning-content p {
        font-size: 13px;
    }

    .site-footer {
        padding: 30px 18px;
    }

    #learning-page {
        padding: 25px 14px 55px;
    }

    .chapter-title h2 {
        font-size: 26px;
    }

    .demo-panel {
        padding: 20px 14px;
    }

    .board-wrapper {
        padding: 9px;
    }

    .learning-progress-bar {
        padding: 14px;
    }

    .progress-step {
        font-size: 11px;
        gap: 6px;
    }

    .progress-line {
        margin: 0 5px;
    }

    .lesson-navigation {
        flex-wrap: wrap;
    }
}

/* ========================================================================
   GO BEGINNING — UNIFIED MANGA VISUAL SYSTEM
   This final layer restyles every existing page without changing game logic.
========================================================================= */

:root {
    --bg-primary: #f7f5ef;
    --bg-surface: #ffffff;
    --dark-header: #0a0a0a;
    --dark-surface: #121212;
    --accent-gold: #c99a2e;
    --accent-gold-hover: #e0b548;
    --text-primary: #0a0a0a;
    --text-secondary: #5e5a52;
    --text-muted: #89847a;
    --border-light: rgba(10, 10, 10, .23);
    --border-dark: #0a0a0a;
    --shadow-sm: 4px 4px 0 #0a0a0a;
    --shadow-md: 7px 7px 0 #0a0a0a;
    --shadow-lg: 10px 10px 0 #0a0a0a;
    --content-width: 1240px;
    --content-padding: 28px;
}

body {
    min-width: 320px;
    background: var(--bg-primary);
    color: var(--text-primary);
    font-family: Arial, Helvetica, sans-serif;
    line-height: 1.55;
}

button, a { -webkit-tap-highlight-color: transparent; }
a:focus-visible, button:focus-visible { outline: 3px solid var(--accent-gold); outline-offset: 4px; }

.skip-link {
    position: fixed; z-index: 2000; top: -60px; left: 12px;
    padding: 10px 13px; border: 2px solid var(--dark-header);
    background: var(--accent-gold); color: var(--dark-header); font-weight: 900;
}
.skip-link:focus { top: 12px; }

/* Shared framed header */
.site-header {
    width: min(var(--content-width), calc(100% - 40px));
    min-height: 66px; margin: 18px auto 0; padding: 10px 14px;
    position: relative; top: auto; z-index: 20;
    display: grid; grid-template-columns: auto 1fr auto; gap: 20px;
    background: var(--bg-surface); border: 2px solid var(--dark-header);
    box-shadow: 5px 5px 0 var(--dark-header); backdrop-filter: none;
}
.header-logo { gap: 10px; transform: none !important; }
.header-logo .logo-icon {
    width: 35px; height: 35px; display: grid; place-items: center;
    border-radius: 50%; background: var(--dark-header); color: var(--bg-surface);
    font-size: 16px; filter: none;
}
.header-logo .brand-name { color: var(--dark-header); font-size: 15px; letter-spacing: .09em; line-height: 1; }
.header-logo .brand-tagline { margin-top: 4px; color: #625e55; font-size: 8px; letter-spacing: .13em; line-height: 1; }
.header-chapter-nav { max-width: none; justify-content: center; gap: 4px; }
.header-chapter-nav .chapter-tab {
    flex: 0 1 auto; padding: 8px 9px; border: 1px solid transparent; border-radius: 0;
    background: transparent; color: var(--text-primary); font-size: 11px; font-weight: 800;
}
.header-chapter-nav .chapter-tab span { color: var(--accent-gold); }
.header-chapter-nav .chapter-tab:hover, .header-chapter-nav .chapter-tab.active {
    color: var(--dark-header); background: #f1dfb4; border-color: var(--dark-header); box-shadow: none;
}
.header-chapter-nav .chapter-tab.active span { color: var(--dark-header); }
.main-nav { gap: 13px; }
.main-nav a { color: var(--text-primary); border-bottom: 2px solid transparent; font-size: 11px; font-weight: 900; }
.main-nav a:hover, .main-nav a.active { color: var(--text-primary); border-color: var(--accent-gold); }

/* Shared chapter page layout */
#learning-page {
    width: min(var(--content-width), calc(100% - 40px));
    min-height: calc(100vh - 110px); margin: 0 auto; padding: 42px 0 72px;
}
.learning-progress-bar {
    padding: 13px 20px; margin-bottom: 34px; border: 2px solid var(--dark-header); border-radius: 0;
    background: var(--bg-surface); box-shadow: var(--shadow-sm);
}
.progress-step { color: #6c675e; font-size: 11px; font-weight: 900; letter-spacing: .02em; }
.progress-step .step-num { width: 27px; height: 27px; border: 1px solid var(--dark-header); border-radius: 50%; background: var(--bg-surface); color: var(--dark-header); }
.progress-step.current, .progress-step.completed { color: var(--dark-header); }
.progress-step.current .step-num { background: var(--accent-gold); color: var(--dark-header); border-color: var(--dark-header); }
.progress-step.completed .step-num { background: var(--dark-header); color: var(--bg-surface); }
.progress-line { height: 2px; background: var(--dark-header); opacity: .2; }
.progress-line.active { background: var(--accent-gold); opacity: 1; }
.chapter-content { max-width: none; }
.chapter-title { max-width: 790px; margin: 0 0 34px; }
.chapter-title h1, .chapter-title h2 {
    margin: 8px 0 12px; color: var(--dark-header); font-size: clamp(35px, 5vw, 64px);
    font-weight: 900; line-height: .94; letter-spacing: -.065em;
}
.chapter-title p { max-width: 650px; color: var(--text-secondary); font-size: 16px; line-height: 1.65; }
.eyebrow { color: #635f56; font-size: 10px; font-weight: 900; letter-spacing: .14em; }
.eyebrow::before { display: inline-block; width: 10px; height: 10px; margin-right: 8px; border: 1px solid var(--dark-header); border-radius: 50%; background: var(--accent-gold); content: ""; }

/* Shared teaching cards, demos and buttons */
.lesson-grid, .concept-grid, .game-rules-grid { gap: 17px; }
.lesson-card, .game-rule-card, .game-info-card, .game-stat {
    border: 2px solid var(--dark-header); border-radius: 0; background: var(--bg-surface);
    box-shadow: var(--shadow-sm); transition: transform .18s ease, box-shadow .18s ease;
}
.lesson-card:hover, .game-rule-card:hover { transform: translate(-3px, -3px); border-color: var(--dark-header); box-shadow: var(--shadow-md); }
.lesson-number, .rule-number { color: var(--accent-gold); font-weight: 1000; }
.lesson-card h3, .game-rule-card h4 { color: var(--dark-header); font-weight: 900; letter-spacing: -.025em; }
.lesson-card p, .game-rule-card p, .game-info-card p { color: var(--text-secondary); }
.demo-panel {
    padding: clamp(22px, 4vw, 38px); border: 2px solid var(--dark-header); border-radius: 0;
    background: var(--bg-surface); box-shadow: var(--shadow-md);
}
.demo-heading h2, .demo-heading h3, .game-section-heading h3 { color: var(--dark-header); font-weight: 900; letter-spacing: -.04em; }
.demo-heading p, .game-section-heading p { color: var(--text-secondary); }
.board-controls { gap: 9px; }
.control-button, .game-control-button {
    min-height: 40px; padding: 9px 14px; border: 2px solid var(--dark-header); border-radius: 0;
    background: var(--bg-surface); color: var(--dark-header); font-weight: 900; font-size: 12px; letter-spacing: .03em;
    box-shadow: 2px 2px 0 var(--dark-header); transition: transform .16s, background .16s, color .16s;
}
.control-button:hover, .control-button.active, .game-control-button:hover:not(:disabled) {
    transform: translate(-2px, -2px); background: var(--dark-header); color: var(--bg-surface); border-color: var(--dark-header); box-shadow: 4px 4px 0 var(--accent-gold);
}
.primary-button, .secondary-button {
    display: inline-flex; align-items: center; justify-content: center; gap: 9px; min-height: 46px;
    padding: 11px 16px; border: 2px solid var(--dark-header); border-radius: 0; background: var(--accent-gold);
    color: var(--dark-header); font-size: 12px; font-weight: 1000; letter-spacing: .05em; box-shadow: 3px 3px 0 var(--dark-header);
    transition: transform .16s, box-shadow .16s, background .16s;
}
.primary-button:hover, .secondary-button:hover { transform: translate(-3px, -3px); background: var(--accent-gold-hover); box-shadow: 6px 6px 0 var(--dark-header); }
.secondary-button { background: transparent; color: var(--bg-surface); border-color: var(--bg-surface); box-shadow: none; }
.secondary-button:hover { background: #262626; box-shadow: 4px 4px 0 var(--accent-gold); }
.lesson-navigation { border-color: var(--dark-header); }

/* Boards keep their original logic but take on the project frame. */
.board-wrapper { max-width: 560px; padding: 16px; border: 2px solid var(--dark-header); border-radius: 0; background: #d8b36a; box-shadow: 6px 6px 0 var(--dark-header); }
.go-board { background-color: #d8b36a; }
.board-point::before, .board-point::after { background: #1d1710; }
.stone.black, .mini-stone.black { background: radial-gradient(circle at 32% 25%, #4d4d4d, #050505 60%, #000); }
.stone.white, .mini-stone.white { border-color: var(--dark-header); background: radial-gradient(circle at 32% 25%, #fff, #e9e5de 65%, #b8b4ad); }
.board-point .last-move-marker { background: var(--accent-gold); border: 1px solid var(--dark-header); }
.game-board-layout { gap: 20px; }
.game-info-card, .game-stat { box-shadow: 4px 4px 0 var(--dark-header); }
.game-header { border-color: var(--dark-header); }
.game-completion { border: 2px solid var(--dark-header); border-radius: 0; background: var(--dark-header); box-shadow: var(--shadow-md); }
.game-completion .eyebrow { color: var(--accent-gold); }
.game-completion .eyebrow::before { background: var(--accent-gold); border-color: var(--bg-surface); }

/* ========================================================================
   HOME PAGE
========================================================================= */
.home-page-body #home-page { width: min(1400px, calc(100% - 40px)); max-width: none; margin: 28px auto 0; padding: 0 0 32px; }
.home-hero { min-height: 635px; display: grid; grid-template-columns: minmax(0, .94fr) minmax(440px, 1.06fr); border: 2px solid var(--dark-header); background: var(--dark-header); overflow: hidden; }
.home-hero-copy { display: flex; flex-direction: column; align-items: flex-start; justify-content: center; padding: clamp(42px, 7vw, 88px); color: var(--bg-surface); }
.home-kicker, .home-section-label { margin: 0 0 18px; color: #f0dca8; font-size: 10px; font-weight: 1000; letter-spacing: .15em; }
.home-kicker::before { display: inline-block; width: 22px; height: 2px; margin-right: 9px; vertical-align: middle; background: var(--accent-gold); content: ""; }
.home-hero h1 { margin: 0; font-size: clamp(49px, 6.5vw, 96px); line-height: .86; letter-spacing: -.08em; }
.home-hero h1 em { color: var(--accent-gold); font-style: normal; }
.home-intro { max-width: 470px; margin: 28px 0; color: #dedbd3; font-size: 16px; line-height: 1.65; }
.home-actions { display: flex; flex-wrap: wrap; gap: 12px; }
.home-note { display: flex; align-items: center; gap: 10px; margin: 43px 0 0; color: #aaa59b; font-size: 10px; font-weight: 900; letter-spacing: .11em; }
.home-note span { width: 30px; height: 1px; background: var(--accent-gold); }
.home-hero-art { position: relative; min-height: 560px; overflow: hidden; background: var(--dark-header); }
.home-hero-art::before { position: absolute; z-index: 1; inset: 0; background: linear-gradient(90deg, var(--dark-header), transparent 23%); pointer-events: none; content: ""; }
.home-hero-art img { width: 100%; height: 100%; min-height: 560px; object-fit: contain; object-position: center; filter: contrast(1.15) grayscale(1); background: var(--dark-header); }
.home-hero-art > p { position: absolute; z-index: 3; bottom: 14px; left: 15px; max-width: 260px; margin: 0; padding: 7px 9px; border: 1px solid var(--dark-header); background: rgba(255,255,255,.9); color: var(--dark-header); font-size: 8px; font-weight: 800; line-height: 1.35; }
.home-sound { position: absolute; z-index: 2; top: 28px; right: 28px; color: var(--bg-surface); font-size: clamp(34px, 5vw, 68px); font-weight: 1000; letter-spacing: -.1em; transform: rotate(-7deg); -webkit-text-stroke: 2px var(--dark-header); text-shadow: 3px 3px 0 var(--accent-gold); }
.home-stamp { position: absolute; z-index: 2; bottom: 48px; left: 8%; display: grid; place-items: center; width: 132px; height: 132px; border: 2px solid var(--dark-header); border-radius: 50%; background: var(--accent-gold); box-shadow: 5px 5px 0 var(--dark-header); transform: rotate(-12deg); text-align: center; font-size: 11px; font-weight: 1000; line-height: 1.12; letter-spacing: .08em; }
.home-ticker { border-top: 2px solid var(--dark-header); border-bottom: 2px solid var(--dark-header); overflow: hidden; background: var(--accent-gold); }
.home-ticker > div { display: flex; width: max-content; gap: 27px; padding: 12px 0; animation: home-ticker 27s linear infinite; color: var(--dark-header); font-size: 11px; font-weight: 1000; letter-spacing: .13em; }
.home-ticker span::after { margin-left: 27px; content: "✦"; }
@keyframes home-ticker { to { transform: translateX(-50%); } }
.home-story { width: min(1240px, calc(100% - 40px)); display: grid; grid-template-columns: minmax(250px, .75fr) minmax(0, 1.25fr); gap: clamp(35px, 7vw, 105px); align-items: center; margin: 0 auto; padding: clamp(76px, 10vw, 130px) 0; }
.home-story-copy > p:not(.home-section-label) { max-width: 370px; color: var(--text-secondary); font-size: 16px; line-height: 1.65; }
.home-story h2, .home-course h2, .home-closing h2 { margin: 0 0 20px; color: var(--dark-header); font-size: clamp(40px, 5vw, 70px); font-weight: 1000; line-height: .92; letter-spacing: -.07em; }
.home-story h2 mark, .home-course h2 mark { padding: 0 .04em; background: linear-gradient(transparent 59%, #f0dca8 0); }
.home-story blockquote { position: relative; max-width: 360px; margin: 30px 0 0; padding: 21px 18px 17px; border: 2px solid var(--dark-header); background: var(--bg-surface); box-shadow: var(--shadow-sm); font-size: 15px; font-weight: 900; line-height: 1.4; }
.home-story blockquote::before { position: absolute; top: -14px; left: 15px; padding: 4px 7px; border: 1px solid var(--dark-header); background: var(--accent-gold); content: "FIRST MOVE"; font-size: 8px; letter-spacing: .12em; }
.home-demo-meta { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; font-size: 10px; font-weight: 1000; letter-spacing: .1em; }
.home-demo-meta span:last-child { display: flex; align-items: center; gap: 7px; color: #615d54; }
.home-demo-meta i { display: block; width: 9px; height: 9px; border-radius: 50%; background: #41a367; animation: home-pulse 1.4s ease-in-out infinite; }
@keyframes home-pulse { 50% { transform: scale(.65); opacity: .55; } }
.home-demo-board { position: relative; width: min(100%, 570px); aspect-ratio: 1; margin-left: auto; padding: 7.6%; border: 2px solid var(--dark-header); background: #d8b36a; box-shadow: var(--shadow-lg); }
.home-demo-board::before { position: absolute; inset: 7.6%; background-image: linear-gradient(var(--dark-header) 2px, transparent 2px), linear-gradient(90deg, var(--dark-header) 2px, transparent 2px); background-size: 12.5% 12.5%; content: ""; }
.home-demo-board::after { position: absolute; inset: 7.6%; background: radial-gradient(circle at 25% 25%, var(--dark-header) 0 4px, transparent 4.5px), radial-gradient(circle at 75% 25%, var(--dark-header) 0 4px, transparent 4.5px), radial-gradient(circle at 50% 50%, var(--dark-header) 0 4px, transparent 4.5px), radial-gradient(circle at 25% 75%, var(--dark-header) 0 4px, transparent 4.5px), radial-gradient(circle at 75% 75%, var(--dark-header) 0 4px, transparent 4.5px); content: ""; }
#home-stones { position: absolute; z-index: 2; inset: 7.6%; }
.home-demo-stone { position: absolute; width: 10.8%; aspect-ratio: 1; border: 1px solid var(--dark-header); border-radius: 50%; opacity: 0; box-shadow: 2px 3px 2px rgba(0,0,0,.28); transform: translate(-50%, -50%) scale(0); transition: opacity .25s, transform .35s cubic-bezier(.21,1.4,.45,1); }
.home-demo-stone.black { background: radial-gradient(circle at 32% 25%, #4d4d4d, #050505 57%, #000); }
.home-demo-stone.white { background: radial-gradient(circle at 32% 25%, #fff, #e6e2da 65%, #b9b5ae); }
.home-demo-stone.is-visible { opacity: 1; transform: translate(-50%, -50%) scale(1); }
.home-move-tag { position: absolute; z-index: 4; top: 17px; right: -16px; padding: 8px 10px; border: 2px solid var(--dark-header); background: var(--bg-surface); box-shadow: var(--shadow-sm); font-size: 10px; font-weight: 1000; letter-spacing: .1em; }
.home-move-tag b { color: var(--accent-gold); }
.home-course { width: min(1240px, calc(100% - 40px)); margin: 0 auto; padding: 22px 0 clamp(76px, 10vw, 130px); border: 0; }
.home-course-heading { display: flex; justify-content: space-between; align-items: end; gap: 30px; margin-bottom: 39px; }
.home-course-heading > p { max-width: 330px; margin: 0 0 4px; color: var(--text-secondary); font-size: 14px; line-height: 1.5; }
.home-course-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 17px; }
.home-course-card { min-height: 320px; display: flex; flex-direction: column; justify-content: space-between; padding: 21px; border: 2px solid var(--dark-header); background: var(--bg-surface); transition: transform .18s, box-shadow .18s; }
.home-course-card:hover { transform: translate(-4px, -4px); box-shadow: var(--shadow-md); }
.home-course-card > div > span { color: var(--accent-gold); font-size: 10px; font-weight: 1000; letter-spacing: .13em; }
.home-course-card h3 { margin: 22px 0 11px; color: var(--dark-header); font-size: clamp(27px, 3vw, 38px); font-weight: 1000; line-height: .94; letter-spacing: -.06em; }
.home-course-card p { max-width: 270px; margin: 0; color: var(--text-secondary); font-size: 14px; line-height: 1.5; }
.home-course-card > a { display: grid; place-items: center; width: 41px; height: 41px; align-self: flex-end; border: 2px solid var(--dark-header); background: var(--bg-surface); color: var(--dark-header); font-size: 23px; font-weight: 900; }
.home-course-card > a:hover { background: #f0dca8; }
.home-course-card--dark { background: var(--dark-header); color: var(--bg-surface); }
.home-course-card--dark h3 { color: var(--bg-surface); }
.home-course-card--dark p { color: #d7d2c7; }
.home-course-card--gold { background: var(--accent-gold); }
.home-course-card--gold > div > span { color: var(--dark-header); }
.home-closing { position: relative; isolation: isolate; width: min(1400px, calc(100% - 40px)); min-height: 354px; display: grid; place-items: center; margin: 0 auto; padding: 48px 22px; overflow: hidden; border: 2px solid var(--dark-header); background: var(--accent-gold); text-align: center; }
.home-closing::before { position: absolute; z-index: 0; top: -125%; left: -10%; width: 55%; aspect-ratio: 1; border: 2px solid rgba(20, 20, 22, .2); border-radius: 50%; background: #f1dfae; content: ""; }
.home-closing > div { position: relative; z-index: 1; }
.home-closing .home-section-label { color: #4d3a15; }
.home-closing h2 { max-width: 800px; }
.home-closing > div > p:not(.home-section-label) { margin: 0 0 27px; font-size: 16px; font-weight: 700; }
.home-closing .primary-button { background: var(--bg-surface); }
.site-footer { width: min(1400px, calc(100% - 40px)); display: flex; justify-content: space-between; gap: 20px; margin: 0 auto 20px; padding: 15px 0; border-top: 2px solid var(--dark-header); color: #565149; font-size: 9px; font-weight: 900; letter-spacing: .08em; }
.site-footer a { color: var(--dark-header); border-bottom: 1px solid var(--accent-gold); }

@media (max-width: 1000px) {
    .site-header { grid-template-columns: auto 1fr; }
    .header-chapter-nav { grid-column: 1 / -1; grid-row: 2; max-width: none; justify-content: space-between; padding-top: 8px; border-top: 1px solid var(--border-light); }
    .main-nav { justify-self: end; }
    .home-hero { grid-template-columns: 1fr; }
    .home-hero-art { min-height: 475px; order: -1; }
    .home-hero-art img { min-height: 475px; }
    .home-hero-copy { min-height: 470px; }
    .home-story { grid-template-columns: 1fr; }
    .home-story-copy { max-width: 620px; }
    .home-demo-board { margin-left: 0; }
}

@media (max-width: 700px) {
    .site-header, #learning-page, .home-page-body #home-page, .home-story, .home-course, .home-closing, .site-footer { width: calc(100% - 24px); }
    .site-header { margin-top: 12px; gap: 10px; padding: 10px; }
    .header-logo .brand-name { font-size: 13px; }
    .main-nav { gap: 9px; }
    .main-nav a { font-size: 10px; }
    .header-chapter-nav { overflow-x: auto; justify-content: flex-start; }
    .header-chapter-nav .chapter-tab { flex: 0 0 auto; padding: 7px; font-size: 10px; white-space: nowrap; }
    #learning-page { padding-top: 33px; }
    .learning-progress-bar { overflow-x: auto; padding: 11px; gap: 8px; }
    .progress-step { flex: 0 0 auto; font-size: 9px; }
    .progress-line { min-width: 14px; margin: 0 3px; }
    .lesson-grid, .concept-grid, .game-rules-grid { grid-template-columns: 1fr; }
    .game-board-layout { grid-template-columns: 1fr; }
    .game-sidebar-stats { display: grid; grid-template-columns: repeat(2, 1fr); }
    .home-hero { min-height: 0; }
    .home-hero-art, .home-hero-art img { min-height: 345px; }
    .home-hero-copy { min-height: 0; padding: 43px 25px; }
    .home-hero h1 { font-size: clamp(46px, 13vw, 70px); }
    .home-intro { font-size: 15px; }
    .home-stamp { bottom: 31px; width: 102px; height: 102px; font-size: 8px; }
    .home-sound { top: 21px; right: 15px; }
    .home-hero-art > p { bottom: 8px; left: 9px; max-width: 226px; }
    .home-story { padding: 71px 0; }
    .home-course-heading { display: block; }
    .home-course-heading > p { margin-top: 20px; }
    .home-course-grid { grid-template-columns: 1fr; }
    .home-course-card { min-height: 240px; }
    .home-move-tag { right: -8px; top: 11px; font-size: 9px; }
    .site-footer { flex-direction: column; }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}


/* ==========================================
   19. ACCESSIBILITY AND INTERACTION
========================================== */

/* Visible keyboard focus */
a:focus-visible,
button:focus-visible {
    outline: 3px solid var(--accent-gold);
    outline-offset: 3px;
}

/* Reduce animation for users who prefer it */
@media (prefers-reduced-motion: reduce) {

    html {
        scroll-behavior: auto;
    }

    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}
/* ==========================================
   STONE CURSOR PREVIEW
========================================== */

.stone-cursor-preview {
    position: fixed;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    pointer-events: none;
    z-index: 9999;
    transform: translate(-50%, -50%);
    display: none;
}

/* Black stone cursor */
.stone-cursor-preview.black {
    background: radial-gradient(
        circle at 35% 30%,
        #666,
        #222 55%,
        #000
    );
    border: 1px solid #111;
    box-shadow: 1px 2px 4px rgba(0, 0, 0, 0.4);
}

/* White stone cursor */
.stone-cursor-preview.white {
    background: radial-gradient(
        circle at 35% 30%,
        #ffffff,
        #eeeeee 65%,
        #c9c9c9
    );
    border: 1px solid #999;
    box-shadow: 1px 2px 4px rgba(0, 0, 0, 0.25);
}
/* Hide the default mouse pointer on the Chapter 1 board */

#diagram-board,
#diagram-board .board-point {
    cursor: none !important;
}

/* ==========================================
   CHAPTER 03 - GAME INTRODUCTION
========================================== */

.game-section-heading {
    margin-bottom: 24px;
}

.game-section-heading h3 {
    font-size: 26px;
    font-weight: 800;
    margin-bottom: 10px;
}

.game-section-heading p {
    color: var(--text-secondary);
    font-size: 14px;
    line-height: 1.8;
}


/* ==========================================
   BEFORE YOU PLAY - RULE CARDS
========================================== */

.game-introduction {
    margin-bottom: 65px;
}

.game-rules-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 20px;
}

.game-rule-card {
    padding: 26px;
    background: var(--bg-surface);
    border: 1px solid var(--border-light);
    border-radius: 16px;
    box-shadow: var(--shadow-sm);
    transition: all 0.3s ease;
}

.game-rule-card:hover {
    transform: translateY(-4px);
    border-color: rgba(197, 155, 39, 0.5);
    box-shadow: var(--shadow-md);
}

.rule-number {
    display: block;
    color: var(--accent-gold);
    font-size: 28px;
    font-weight: 900;
    margin-bottom: 15px;
}

.game-rule-card h4 {
    font-size: 17px;
    margin-bottom: 10px;
}

.game-rule-card p {
    color: var(--text-secondary);
    font-size: 13px;
    line-height: 1.8;
}


/* ==========================================
   INTERACTIVE GAME SECTION
========================================== */

.game-practice-section {
    margin-bottom: 65px;
}

.game-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 28px;
    padding-bottom: 22px;
    border-bottom: 1px solid var(--border-light);
}

.game-header-info h3 {
    font-size: 22px;
    font-weight: 800;
    margin-bottom: 5px;
}

.game-header-info p {
    color: var(--text-secondary);
    font-size: 13px;
}

.game-header .eyebrow {
    margin-bottom: 5px;
}


/* ==========================================
   GAME BOARD AREA
========================================== */

.game-board-area {
    min-width: 0;
}

.board-top-label {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
    color: var(--text-secondary);
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 1px;
}

.board-bottom-hint {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-top: 14px;
    color: var(--text-secondary);
    font-size: 12px;
}

.hint-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--accent-green);
    flex-shrink: 0;
}


/* ==========================================
   GAME SIDEBAR
========================================== */

.game-sidebar-stats {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.game-info-card {
    padding: 20px;
    background: var(--bg-surface);
    border: 1px solid var(--border-light);
    border-radius: 12px;
    box-shadow: var(--shadow-sm);
}

.info-label {
    display: block;
    color: var(--accent-gold);
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 1px;
    margin-bottom: 13px;
}

.player-indicator {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 13px;
    font-weight: 700;
}

.player-stone {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    flex-shrink: 0;
}

.black-indicator {
    background: radial-gradient(circle at 35% 30%, #555, #111);
    box-shadow: 1px 2px 4px rgba(0, 0, 0, 0.3);
}

.game-info-card p {
    color: var(--text-secondary);
    font-size: 12px;
    line-height: 1.7;
    margin-top: 10px;
}

.board-size {
    display: block;
    font-size: 25px;
    font-weight: 800;
    color: var(--text-primary);
}


/* ==========================================
   PRACTICE GUIDE
========================================== */

.practice-guide {
    margin-bottom: 65px;
}

.practice-steps {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px;
}

.practice-step {
    display: flex;
    align-items: flex-start;
    gap: 18px;
    padding: 23px;
    background: var(--bg-surface);
    border: 1px solid var(--border-light);
    border-radius: 14px;
}

.practice-step-number {
    width: 38px;
    height: 38px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    border-radius: 50%;
    background: rgba(197, 155, 39, 0.13);
    color: #92701d;
    font-size: 13px;
    font-weight: 900;
}

.practice-step h4 {
    font-size: 15px;
    margin-bottom: 7px;
}

.practice-step p {
    color: var(--text-secondary);
    font-size: 13px;
    line-height: 1.8;
}


/* ==========================================
   GAME COMPLETION
========================================== */

.game-completion {
    padding: 45px 35px;
    margin-bottom: 40px;
    text-align: center;
    background: var(--dark-header);
    border: 1px solid var(--border-dark);
    border-radius: 18px;
    color: #ffffff;
}

.game-completion h3 {
    font-size: 25px;
    line-height: 1.4;
    margin-bottom: 14px;
}

.game-completion p {
    max-width: 650px;
    margin: 0 auto;
    color: var(--text-muted);
    font-size: 13px;
    line-height: 1.9;
}



/* ==========================================
   CHAPTER 3 - GAME CONTROLS
========================================== */

.game-controls {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin: 20px 0 12px;
}

.game-control-button {
    padding: 10px 22px;
    border: 1px solid #9b7847;
    border-radius: 3px;
    background: #171512;
    color: #e8d4ad;
    font-family: inherit;
    font-size: 13px;
    letter-spacing: 1px;
    cursor: pointer;
    transition: 0.25s ease;
}

.game-control-button:hover:not(:disabled) {
    background: #9b7847;
    color: #111;
}

.game-control-button:disabled {
    opacity: 0.35;
    cursor: not-allowed;
}


/* ==========================================
   GAME FEEDBACK
========================================== */

.game-feedback {
    min-height: 24px;
    margin: 10px 0 18px;
    color: #c9a66b;
    font-size: 13px;
    line-height: 1.7;
}


/* ==========================================
   GAME HISTORY
========================================== */

.game-history {
    margin-top: 22px;
    padding-top: 18px;
    border-top: 1px solid rgba(180, 145, 95, 0.25);
}

.game-history h3 {
    margin-bottom: 12px;
    color: #d7bd91;
    font-size: 14px;
    letter-spacing: 1px;
}

.game-history-list {
    max-height: 220px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.game-history-list p {
    color: #999;
    font-size: 12px;
}

.game-history-item {
    padding: 8px 10px;
    border-left: 2px solid #80643d;
    background: rgba(255, 255, 255, 0.035);
    color: #c8c0b2;
    font-size: 12px;
    line-height: 1.5;
}

.game-history-list::-webkit-scrollbar {
    width: 4px;
}

.game-history-list::-webkit-scrollbar-thumb {
    background: #80643d;
    border-radius: 4px;
}


/* ==========================================
   RESPONSIVE GAME CONTROLS
========================================== */

@media (max-width: 560px) {

    .game-controls {
        gap: 8px;
    }

    .game-control-button {
        flex: 1;
        padding: 10px 12px;
    }

    .game-history {
        margin-top: 16px;
    }

}

/* ==========================================
   CHAPTER 03 - DEAD STONE MARKING
========================================== */

/* Highlight stones marked as dead */
.dead-stone-point .stone {
    opacity: 0.45;
    outline: 3px dashed #c59b27;
    outline-offset: 2px;
}

/* Confirm button */
.confirm-dead-button {
    background: #9b7847;
    color: #111;
    font-weight: 700;
}

.confirm-dead-button:hover:not(:disabled) {
    background: #c59b27;
}

/* Final score panel */
.game-score-panel {
    margin: 20px 0;
    padding: 22px;
    background: #1e1e22;
    border: 1px solid rgba(197, 155, 39, 0.4);
    border-radius: 10px;
    color: #eee;
}

.game-score-panel[hidden] {
    display: none;
}

.game-score-panel h3 {
    margin-bottom: 14px;
    color: #d7bd91;
    font-size: 17px;
    letter-spacing: 1px;
}

.score-result {
    margin-bottom: 18px;
    color: #c59b27;
    font-size: 24px;
    font-weight: 800;
}

.score-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
    text-align: center;
}

.score-table th,
.score-table td {
    padding: 10px 8px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.score-table th {
    color: #c59b27;
}

.score-table td:first-child {
    text-align: left;
    color: #bbb;
}

.score-total {
    color: #e5b839;
    font-weight: 800;
}

.score-neutral {
    margin-top: 14px;
    color: #aaa;
    font-size: 12px;
}

@media (max-width: 560px) {
    .game-score-panel {
        padding: 15px;
    }

    .score-table {
        font-size: 11px;
    }

    .score-table th,
    .score-table td {
        padding: 8px 4px;
    }
}

/* Final chapter-three controls use the same square comic framing. */
.game-control-button {
    border: 2px solid var(--dark-header);
    border-radius: 0;
    background: var(--bg-surface);
    color: var(--dark-header);
    font-weight: 900;
    box-shadow: 2px 2px 0 var(--dark-header);
}
.game-control-button:hover:not(:disabled) {
    background: var(--dark-header);
    color: var(--bg-surface);
    box-shadow: 4px 4px 0 var(--accent-gold);
}
.game-feedback { color: #765916; font-weight: 700; }
.game-score-panel {
    border: 2px solid var(--dark-header);
    border-radius: 0;
    background: var(--dark-header);
    box-shadow: var(--shadow-sm);
}

/* Chapter 01: clear, intentional board guidance instead of a loose sentence. */
.board-instructions {
    width: min(100%, 560px);
    display: grid;
    grid-template-columns: 42px minmax(0, 1fr);
    align-items: center;
    gap: 13px;
    margin: 24px auto 0;
    padding: 13px 15px;
    border: 2px solid var(--dark-header);
    background: #fffdf7;
    box-shadow: 4px 4px 0 var(--accent-gold);
    color: var(--dark-header);
}

.board-instructions-icon {
    width: 38px;
    height: 38px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    background: var(--dark-header);
    color: var(--accent-gold);
    font-family: Georgia, serif;
    font-size: 25px;
    font-weight: 900;
    line-height: 1;
}

.board-instructions-copy strong {
    display: block;
    margin-bottom: 4px;
    color: var(--dark-header);
    font-size: 10px;
    font-weight: 1000;
    letter-spacing: .12em;
}

.board-instructions-copy p {
    margin: 0;
    color: #575249;
    font-size: 13px;
    font-weight: 600;
    line-height: 1.55;
}

.board-instructions-copy b {
    margin-left: 5px;
    color: #8e6816;
    font-size: 10px;
    font-weight: 1000;
    letter-spacing: .05em;
}

.board-instructions-copy b:first-child { margin-left: 0; }

@media (max-width: 560px) {
    .board-instructions {
        grid-template-columns: 35px minmax(0, 1fr);
        gap: 10px;
        margin-top: 19px;
        padding: 11px;
        box-shadow: 3px 3px 0 var(--accent-gold);
    }

    .board-instructions-icon { width: 32px; height: 32px; font-size: 21px; }
    .board-instructions-copy strong { font-size: 9px; }
    .board-instructions-copy p { font-size: 12px; }
    .board-instructions-copy b { display: inline-block; margin-left: 3px; }
}

/* Chapter 02: liberty guidance reflects the green intersections on the board. */
.liberty-instructions {
    grid-template-columns: 48px minmax(0, 1fr) auto;
    gap: 15px;
    margin: 0 auto 24px;
    padding: 13px 15px;
    background: var(--dark-header);
    color: var(--bg-surface);
    box-shadow: 4px 4px 0 #43a36b;
}

.liberty-instructions-mark {
    position: relative;
    width: 42px;
    height: 42px;
    display: grid;
    place-items: center;
    border: 1px solid rgba(255, 255, 255, .45);
    border-radius: 50%;
}

.liberty-instructions-mark::before {
    width: 13px;
    height: 13px;
    border-radius: 50%;
    background: #f7f5ef;
    box-shadow: 1px 2px 0 rgba(0, 0, 0, .6);
    content: "";
}

.liberty-instructions-mark i {
    position: absolute;
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #43a36b;
    box-shadow: 0 0 0 2px rgba(67, 163, 107, .18);
}

.liberty-instructions-mark i:nth-child(1) { top: 3px; left: 50%; transform: translateX(-50%); }
.liberty-instructions-mark i:nth-child(2) { top: 50%; right: 3px; transform: translateY(-50%); }
.liberty-instructions-mark i:nth-child(3) { bottom: 3px; left: 50%; transform: translateX(-50%); }
.liberty-instructions-mark i:nth-child(4) { top: 50%; left: 3px; transform: translateY(-50%); }

.liberty-instructions-copy strong {
    display: block;
    margin-bottom: 3px;
    color: #f1dca4;
    font-size: 10px;
    font-weight: 1000;
    letter-spacing: .13em;
}

.liberty-instructions-copy p {
    margin: 0;
    color: #e2dfd8;
    font-size: 13px;
    font-weight: 600;
    line-height: 1.5;
}

.liberty-instructions-action {
    align-self: stretch;
    display: flex;
    align-items: center;
    gap: 7px;
    padding-left: 15px;
    border-left: 1px solid rgba(255, 255, 255, .3);
    color: #43a36b;
    font-size: 10px;
    font-weight: 1000;
    letter-spacing: .1em;
    white-space: nowrap;
}

.liberty-instructions-action b { color: #f1dca4; font-size: 17px; line-height: 1; }

@media (max-width: 560px) {
    .liberty-instructions {
        grid-template-columns: 38px minmax(0, 1fr);
        gap: 11px;
        margin-bottom: 19px;
        padding: 11px;
        box-shadow: 3px 3px 0 #43a36b;
    }

    .liberty-instructions-mark { width: 34px; height: 34px; }
    .liberty-instructions-mark::before { width: 11px; height: 11px; }
    .liberty-instructions-mark i { width: 6px; height: 6px; }
    .liberty-instructions-copy strong { font-size: 9px; }
    .liberty-instructions-copy p { font-size: 12px; }
    .liberty-instructions-action { display: none; }
}

/* Chapter 03: a dramatic self-play prompt and a truthful scoring guide. */
.self-play-manifesto {
    display: grid;
    grid-template-columns: minmax(0, 1.2fr) minmax(250px, .8fr);
    gap: clamp(24px, 5vw, 70px);
    align-items: center;
    margin: 0 0 64px;
    padding: clamp(27px, 5vw, 54px);
    border: 2px solid var(--dark-header);
    background: var(--dark-header);
    box-shadow: var(--shadow-md);
    color: var(--bg-surface);
    overflow: hidden;
}

.self-play-copy .eyebrow { color: var(--accent-gold); }
.self-play-copy .eyebrow::before { border-color: var(--bg-surface); background: var(--accent-gold); }
.self-play-copy h3 {
    max-width: 650px;
    margin: 5px 0 16px;
    color: var(--bg-surface);
    font-size: clamp(30px, 4.5vw, 54px);
    font-weight: 1000;
    line-height: .93;
    letter-spacing: -.065em;
}

.self-play-copy p {
    max-width: 610px;
    margin: 0;
    color: #ded9cf;
    font-size: 15px;
    line-height: 1.65;
}

.self-play-quote {
    position: relative;
    display: flex;
    min-height: 210px;
    flex-direction: column;
    justify-content: center;
    padding: 27px;
    border: 2px solid var(--dark-header);
    background: var(--accent-gold);
    box-shadow: 6px 6px 0 var(--bg-surface);
    color: var(--dark-header);
}

.self-play-quote::before {
    position: absolute;
    top: 18px;
    right: 20px;
    color: rgba(10, 10, 10, .16);
    content: "⚔";
    font-size: 52px;
    font-weight: 900;
}

.self-play-quote strong {
    position: relative;
    z-index: 1;
    font-size: clamp(24px, 3vw, 34px);
    font-weight: 1000;
    line-height: .94;
    letter-spacing: -.06em;
}

.self-play-side {
    position: relative;
    z-index: 1;
    display: inline-flex;
    align-items: center;
    gap: 7px;
    color: #51401b;
    font-size: 9px;
    font-weight: 1000;
    letter-spacing: .12em;
}

.self-play-side::before { width: 8px; height: 8px; border-radius: 50%; content: ""; }
.black-side { margin-bottom: 17px; }
.black-side::before { background: var(--dark-header); }
.white-side { margin-top: 17px; }
.white-side::before { border: 1px solid var(--dark-header); background: var(--bg-surface); }

.game-outcome-guide {
    margin: 0 0 28px;
    padding: 18px;
    border: 2px solid var(--dark-header);
    background: #fffdf7;
    box-shadow: 4px 4px 0 var(--accent-gold);
}

.game-outcome-title { display: flex; align-items: end; justify-content: space-between; gap: 18px; padding: 0 0 14px; border-bottom: 2px solid var(--dark-header); }
.game-outcome-title .eyebrow { margin: 0; }
.game-outcome-title h4 { margin: 0; color: var(--dark-header); font-size: clamp(20px, 3vw, 27px); font-weight: 1000; line-height: 1; letter-spacing: -.04em; }
.game-outcome-rules { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0; margin-top: 14px; }
.game-outcome-rules article { min-width: 0; display: grid; grid-template-columns: 27px minmax(0, 1fr); gap: 9px; padding: 0 13px; border-left: 1px solid rgba(10, 10, 10, .25); }
.game-outcome-rules article:first-child { padding-left: 0; border-left: 0; }
.game-outcome-rules article:last-child { padding-right: 0; }
.game-outcome-rules span { width: 24px; height: 24px; display: grid; place-items: center; border: 1px solid var(--dark-header); border-radius: 50%; background: var(--accent-gold); color: var(--dark-header); font-size: 9px; font-weight: 1000; }
.game-outcome-rules p { margin: 0; color: #575249; font-size: 12px; font-weight: 600; line-height: 1.5; }
.game-outcome-rules b { color: var(--dark-header); font-weight: 1000; }

@media (max-width: 760px) {
    .self-play-manifesto { grid-template-columns: 1fr; gap: 25px; margin-bottom: 48px; }
    .self-play-quote { min-height: 165px; }
    .game-outcome-rules { grid-template-columns: 1fr; gap: 12px; }
    .game-outcome-rules article { padding: 0; border: 0; }
}

@media (max-width: 560px) {
    .self-play-manifesto { padding: 25px 20px; }
    .self-play-copy p { font-size: 14px; }
    .self-play-quote { padding: 22px; box-shadow: 4px 4px 0 var(--bg-surface); }
    .game-outcome-guide { margin-bottom: 22px; padding: 14px; box-shadow: 3px 3px 0 var(--accent-gold); }
    .game-outcome-title { align-items: flex-start; flex-direction: column; gap: 8px; }
    .game-outcome-rules p { font-size: 12px; }
}

/* Chapter 03 training arc: move the preparation sequence before the live board. */
.chapter-content > .practice-guide:not(.comic-training),
.chapter-content > .game-completion:not(.comic-training-completion) {
    display: none;
}

.comic-training {
    margin: 0 0 24px;
    padding: clamp(28px, 5vw, 48px);
    border: 2px solid var(--dark-header);
    background: #fffdf7;
    box-shadow: var(--shadow-md);
}

.comic-training-heading {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(240px, .7fr);
    gap: 13px 35px;
    align-items: end;
    margin-bottom: 27px;
    padding-bottom: 20px;
    border-bottom: 2px solid var(--dark-header);
}

.comic-training-heading .eyebrow { grid-column: 1 / -1; margin: 0; }
.comic-training-heading h3 {
    margin: 0;
    color: var(--dark-header);
    font-size: clamp(31px, 4.5vw, 52px);
    font-weight: 1000;
    line-height: .93;
    letter-spacing: -.065em;
}
.comic-training-heading p { max-width: 400px; margin: 0 0 3px; color: var(--text-secondary); font-size: 14px; line-height: 1.55; }

.comic-training-steps {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 13px;
}

.comic-training-steps .practice-step {
    position: relative;
    min-height: 143px;
    display: grid;
    grid-template-columns: 48px minmax(0, 1fr) 30px;
    gap: 14px;
    align-items: start;
    padding: 20px 18px;
    border: 2px solid var(--dark-header);
    border-radius: 0;
    background: var(--bg-surface);
    box-shadow: 4px 4px 0 var(--dark-header);
    transition: transform .18s ease, box-shadow .18s ease;
}

.comic-training-steps .practice-step:hover {
    transform: translate(-3px, -3px);
    box-shadow: 7px 7px 0 var(--accent-gold);
}

.comic-training-steps .practice-step:nth-child(2) { background: var(--dark-header); color: var(--bg-surface); }
.comic-training-steps .practice-step:nth-child(4) { background: var(--accent-gold); }
.comic-training-steps .practice-step-number {
    width: 42px;
    height: 42px;
    display: grid;
    place-items: center;
    border: 2px solid var(--dark-header);
    border-radius: 50%;
    background: var(--accent-gold);
    color: var(--dark-header);
    font-size: 12px;
    font-weight: 1000;
}
.comic-training-steps .practice-step:nth-child(2) .practice-step-number { background: var(--bg-surface); }
.practice-step-kicker { display: block; margin-bottom: 6px; color: #78601e; font-size: 9px; font-weight: 1000; letter-spacing: .12em; }
.comic-training-steps .practice-step:nth-child(2) .practice-step-kicker { color: var(--accent-gold); }
.comic-training-steps .practice-step h4 { margin: 0 0 7px; color: var(--dark-header); font-size: 19px; font-weight: 1000; line-height: .98; letter-spacing: -.04em; }
.comic-training-steps .practice-step:nth-child(2) h4 { color: var(--bg-surface); }
.comic-training-steps .practice-step p { margin: 0; color: var(--text-secondary); font-size: 12px; font-weight: 600; line-height: 1.45; }
.comic-training-steps .practice-step:nth-child(2) p { color: #ddd8ce; }
.practice-step-arrow { align-self: end; color: var(--accent-gold); font-size: 28px; font-weight: 900; line-height: 1; }
.comic-training-steps .practice-step:nth-child(4) .practice-step-arrow { color: var(--dark-header); }

.comic-training-completion {
    position: relative;
    overflow: hidden;
    margin: 0 0 52px;
    padding: clamp(29px, 5vw, 45px) 22px;
    border: 2px solid var(--dark-header);
    border-radius: 0;
    background: var(--dark-header);
    box-shadow: var(--shadow-md);
    text-align: center;
}
.comic-training-completion::before {
    position: absolute;
    top: -85px;
    left: -45px;
    width: 190px;
    height: 190px;
    border: 2px solid var(--accent-gold);
    border-radius: 50%;
    content: "";
    opacity: .72;
}
.comic-training-completion .eyebrow { position: relative; color: var(--accent-gold); }
.comic-training-completion .eyebrow::before { border-color: var(--bg-surface); background: var(--accent-gold); }
.comic-training-completion h3 { position: relative; max-width: 760px; margin: 7px auto 12px; color: var(--bg-surface); font-size: clamp(24px, 3.4vw, 37px); font-weight: 1000; line-height: 1; letter-spacing: -.05em; }
.comic-training-completion p { position: relative; max-width: 670px; margin: 0 auto; color: #d7d2c8; font-size: 14px; line-height: 1.6; }

@media (max-width: 720px) {
    .comic-training-heading { grid-template-columns: 1fr; gap: 10px; }
    .comic-training-steps { grid-template-columns: 1fr; }
}

@media (max-width: 560px) {
    .comic-training { padding: 23px 18px; }
    .comic-training-heading { margin-bottom: 22px; padding-bottom: 16px; }
    .comic-training-steps .practice-step { min-height: 125px; grid-template-columns: 41px minmax(0, 1fr) 23px; gap: 11px; padding: 16px 13px; box-shadow: 3px 3px 0 var(--dark-header); }
    .comic-training-steps .practice-step-number { width: 35px; height: 35px; font-size: 10px; }
    .comic-training-steps .practice-step h4 { font-size: 17px; }
    .practice-step-arrow { font-size: 23px; }
    .comic-training-completion { margin-bottom: 42px; padding: 28px 18px; }
}

/* ========================================================================
   NLP MINI LAB — EXPLAINABLE INTENT CLASSIFIER
========================================================================= */
.nlp-lab-page {
    width: min(1400px, calc(100% - 40px));
    margin: 28px auto 0;
    padding-bottom: 90px;
}

.nlp-hero {
    min-height: 510px;
    display: grid;
    grid-template-columns: minmax(0, 1.06fr) minmax(390px, .94fr);
    gap: clamp(35px, 7vw, 95px);
    align-items: center;
    padding: clamp(42px, 7vw, 86px);
    border: 2px solid var(--dark-header);
    background: var(--dark-header);
    box-shadow: var(--shadow-lg);
    color: var(--bg-surface);
    overflow: hidden;
}

.nlp-hero-copy .eyebrow { color: var(--accent-gold); }
.nlp-hero-copy .eyebrow::before { border-color: var(--bg-surface); background: var(--accent-gold); }
.nlp-hero h1 {
    margin: 9px 0 23px;
    color: var(--bg-surface);
    font-size: clamp(52px, 7vw, 95px);
    font-weight: 1000;
    line-height: .84;
    letter-spacing: -.08em;
}
.nlp-hero h1 em { color: var(--accent-gold); font-style: normal; }
.nlp-hero-copy > p { max-width: 640px; margin: 0; color: #ddd8cf; font-size: 16px; line-height: 1.65; }
.nlp-hero-tags { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 29px; }
.nlp-hero-tags span { padding: 7px 9px; border: 1px solid #6d6a64; color: #c9c4ba; font-size: 8px; font-weight: 1000; letter-spacing: .11em; }

.nlp-pipeline {
    position: relative;
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    gap: 12px;
    padding: 26px;
    border: 2px solid var(--dark-header);
    background: var(--accent-gold);
    box-shadow: 7px 7px 0 var(--bg-surface);
    color: var(--dark-header);
    transform: rotate(1.2deg);
}
.nlp-pipeline div { min-height: 84px; display: flex; flex-direction: column; justify-content: space-between; padding: 12px; border: 2px solid var(--dark-header); background: #f1d78d; }
.nlp-pipeline div.active { grid-column: 2 / 4; background: var(--dark-header); color: var(--bg-surface); }
.nlp-pipeline b { font-size: 24px; font-weight: 1000; line-height: 1; }
.nlp-pipeline span { font-size: 9px; font-weight: 1000; letter-spacing: .12em; }
.nlp-pipeline i { align-self: center; font-size: 21px; font-style: normal; font-weight: 900; }

.nlp-workbench {
    display: grid;
    grid-template-columns: minmax(0, 1.12fr) minmax(370px, .88fr);
    gap: 18px;
    align-items: stretch;
    margin: 78px 0;
}
.nlp-input-panel, .nlp-result-panel { min-width: 0; padding: clamp(25px, 4vw, 42px); border: 2px solid var(--dark-header); }
.nlp-input-panel { background: var(--dark-header); box-shadow: 7px 7px 0 var(--accent-gold); color: var(--bg-surface); }
.nlp-result-panel { display: flex; min-height: 650px; flex-direction: column; background: #fffdf7; box-shadow: 7px 7px 0 var(--dark-header); }

.nlp-panel-heading { display: flex; justify-content: space-between; gap: 20px; align-items: flex-start; margin-bottom: 28px; }
.nlp-panel-heading .eyebrow { margin-bottom: 7px; color: var(--accent-gold); }
.nlp-panel-heading .eyebrow::before { border-color: var(--bg-surface); }
.nlp-panel-heading h2 { margin: 0; color: var(--bg-surface); font-size: clamp(30px, 4vw, 48px); font-weight: 1000; line-height: .94; letter-spacing: -.06em; }
.nlp-baseline-badge { flex: 0 0 auto; padding: 7px 8px; border: 1px solid #706d66; color: #aaa59d; font-size: 8px; font-weight: 1000; letter-spacing: .1em; }

#intent-form label { display: block; margin-bottom: 8px; color: #c7c2b8; font-size: 10px; font-weight: 900; letter-spacing: .09em; text-transform: uppercase; }
.nlp-textarea-wrap { position: relative; }
#go-question {
    width: 100%; min-height: 162px; resize: vertical; padding: 18px 18px 38px;
    border: 2px solid var(--bg-surface); border-radius: 0; outline: none;
    background: #fffdf7; color: var(--dark-header); font: 700 18px/1.55 Arial, Helvetica, sans-serif;
    box-shadow: 4px 4px 0 var(--accent-gold);
}
#go-question:focus { border-color: var(--accent-gold); box-shadow: 6px 6px 0 var(--accent-gold); }
#go-question::placeholder { color: #8c877d; font-weight: 500; }
#question-count { position: absolute; right: 13px; bottom: 9px; color: #6a655c; font-size: 9px; font-weight: 900; letter-spacing: .07em; }
.nlp-analyze-button {
    width: 100%; min-height: 50px; display: flex; align-items: center; justify-content: space-between;
    margin-top: 15px; padding: 12px 16px; border: 2px solid var(--accent-gold); border-radius: 0;
    background: var(--accent-gold); color: var(--dark-header); cursor: pointer;
    font-size: 11px; font-weight: 1000; letter-spacing: .09em; box-shadow: 4px 4px 0 var(--bg-surface);
    transition: transform .16s, box-shadow .16s, background .16s;
}
.nlp-analyze-button:hover { transform: translate(-2px, -2px); background: var(--accent-gold-hover); box-shadow: 6px 6px 0 var(--bg-surface); }
.nlp-analyze-button span { font-size: 20px; }

.nlp-examples { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 30px; }
.nlp-examples > span { width: 100%; margin-bottom: 2px; color: #8f8a81; font-size: 8px; font-weight: 1000; letter-spacing: .13em; }
.nlp-examples button { padding: 8px 9px; border: 1px solid #69665f; background: transparent; color: #d6d1c7; cursor: pointer; font-size: 10px; font-weight: 700; transition: border-color .16s, color .16s, background .16s; }
.nlp-examples button:hover { border-color: var(--accent-gold); background: #211c12; color: var(--accent-gold); }

.nlp-result-empty { flex: 1; display: grid; place-content: center; justify-items: center; text-align: center; }
.nlp-result-empty > span { width: 74px; height: 74px; display: grid; place-items: center; border: 3px solid var(--dark-header); border-radius: 50%; background: var(--accent-gold); box-shadow: 5px 5px 0 var(--dark-header); font: 1000 43px/1 Georgia, serif; }
.nlp-result-empty p { margin: 25px 0 5px; color: var(--dark-header); font-size: 12px; font-weight: 1000; letter-spacing: .12em; }
.nlp-result-empty small { color: var(--text-secondary); font-size: 12px; }
.nlp-result-content[hidden], .nlp-result-empty[hidden] { display: none; }
.nlp-result-content { display: block; }
.nlp-result-topline { display: flex; align-items: center; justify-content: space-between; gap: 15px; margin-bottom: 17px; padding-bottom: 13px; border-bottom: 2px solid var(--dark-header); }
.nlp-result-topline span { color: #6c675f; font-size: 9px; font-weight: 1000; letter-spacing: .13em; }
.nlp-result-topline b { padding: 5px 7px; border: 1px solid var(--dark-header); background: var(--accent-gold); color: var(--dark-header); font-size: 8px; letter-spacing: .08em; }
#result-intent { margin: 0 0 10px; color: var(--dark-header); font-size: clamp(32px, 5vw, 54px); font-weight: 1000; line-height: .88; letter-spacing: -.07em; }
#result-description { margin: 0 0 22px; color: var(--text-secondary); font-size: 13px; line-height: 1.55; }
.nlp-trace { margin: 0; border-top: 1px solid var(--dark-header); }
.nlp-trace div { display: grid; grid-template-columns: 125px minmax(0, 1fr); gap: 10px; padding: 10px 0; border-bottom: 1px solid rgba(10,10,10,.2); }
.nlp-trace dt { color: #7c776d; font-size: 8px; font-weight: 1000; letter-spacing: .1em; }
.nlp-trace dd { min-width: 0; margin: 0; overflow-wrap: anywhere; color: var(--dark-header); font-size: 11px; font-weight: 700; }

.nlp-score-chart { display: grid; gap: 7px; margin: 20px 0; }
.nlp-score-row { display: grid; grid-template-columns: 124px minmax(0, 1fr) 20px; gap: 8px; align-items: center; }
.nlp-score-row > span { overflow: hidden; color: #5e5950; font-size: 8px; font-weight: 1000; letter-spacing: .05em; text-overflow: ellipsis; white-space: nowrap; }
.nlp-score-row i { height: 7px; display: block; border: 1px solid var(--dark-header); background: #e9e4d9; }
.nlp-score-row i b { height: 100%; display: block; background: var(--accent-gold); transition: width .35s ease; }
.nlp-score-row strong { text-align: right; font-size: 9px; }
#result-route { width: 100%; margin-top: 2px; justify-content: space-between; }

.nlp-method { padding: clamp(35px, 6vw, 68px); border: 2px solid var(--dark-header); background: #fffdf7; box-shadow: var(--shadow-md); }
.nlp-method-heading { display: grid; grid-template-columns: minmax(0, 1fr) minmax(280px, .7fr); gap: 13px 50px; align-items: end; margin-bottom: 36px; }
.nlp-method-heading .eyebrow { grid-column: 1 / -1; margin: 0; }
.nlp-method-heading h2 { margin: 0; color: var(--dark-header); font-size: clamp(36px, 5vw, 65px); font-weight: 1000; line-height: .9; letter-spacing: -.07em; }
.nlp-method-heading > p { margin: 0 0 3px; color: var(--text-secondary); font-size: 14px; line-height: 1.6; }
.nlp-method-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 13px; }
.nlp-method-grid article { min-height: 210px; padding: 22px; border: 2px solid var(--dark-header); background: var(--bg-surface); box-shadow: 4px 4px 0 var(--dark-header); }
.nlp-method-grid article:nth-child(2) { background: var(--dark-header); color: var(--bg-surface); }
.nlp-method-grid article:nth-child(3) { background: var(--accent-gold); }
.nlp-method-grid article > span { display: block; color: var(--accent-gold); font-size: 12px; font-weight: 1000; letter-spacing: .12em; }
.nlp-method-grid article:nth-child(3) > span { color: var(--dark-header); }
.nlp-method-grid h3 { margin: 45px 0 9px; color: var(--dark-header); font-size: 25px; font-weight: 1000; letter-spacing: -.045em; }
.nlp-method-grid article:nth-child(2) h3 { color: var(--bg-surface); }
.nlp-method-grid p { margin: 0; color: var(--text-secondary); font-size: 12px; line-height: 1.55; }
.nlp-method-grid article:nth-child(2) p { color: #d6d1c8; }
.nlp-limitations { display: grid; grid-template-columns: 185px minmax(0, 1fr); gap: 20px; margin-top: 27px; padding: 18px; border: 2px dashed var(--dark-header); background: #f3ead4; }
.nlp-limitations strong { color: #7b5d17; font-size: 10px; font-weight: 1000; letter-spacing: .11em; }
.nlp-limitations p { margin: 0; color: #514d45; font-size: 12px; line-height: 1.6; }

@media (max-width: 1060px) {
    .nlp-hero { grid-template-columns: 1fr; }
    .nlp-pipeline { max-width: 620px; }
    .nlp-workbench { grid-template-columns: 1fr; }
    .nlp-result-panel { min-height: 560px; }
}

@media (max-width: 720px) {
    .nlp-lab-page { width: calc(100% - 24px); margin-top: 20px; }
    .nlp-hero { min-height: 0; gap: 35px; padding: 42px 24px; }
    .nlp-pipeline { grid-template-columns: 1fr 1fr; gap: 8px; padding: 17px; box-shadow: 5px 5px 0 var(--bg-surface); transform: none; }
    .nlp-pipeline i { display: none; }
    .nlp-pipeline div.active { grid-column: auto; }
    .nlp-workbench { margin: 55px 0; }
    .nlp-input-panel, .nlp-result-panel { padding: 23px 18px; }
    .nlp-panel-heading { display: block; }
    .nlp-baseline-badge { display: inline-block; margin-top: 13px; }
    .nlp-method { padding: 28px 19px; }
    .nlp-method-heading { grid-template-columns: 1fr; gap: 14px; }
    .nlp-method-grid { grid-template-columns: 1fr; }
    .nlp-method-grid article { min-height: 170px; }
    .nlp-method-grid h3 { margin-top: 28px; }
    .nlp-limitations { grid-template-columns: 1fr; gap: 8px; }
}

@media (max-width: 460px) {
    .nlp-hero h1 { font-size: 50px; }
    .nlp-pipeline div { min-height: 72px; }
    #go-question { min-height: 145px; font-size: 16px; }
    .nlp-trace div { grid-template-columns: 1fr; gap: 4px; }
    .nlp-score-row { grid-template-columns: 98px minmax(0, 1fr) 18px; }
}

/* Keep the expanded site navigation inside narrow phone screens. */
@media (max-width: 700px) {
    .site-header {
        grid-template-columns: minmax(0, 1fr);
    }

    .site-header > * {
        min-width: 0;
        max-width: 100%;
    }

    .header-logo {
        grid-column: 1;
        grid-row: 1;
    }

    .main-nav {
        grid-column: 1;
        grid-row: 2;
        justify-self: stretch;
        justify-content: flex-start;
        gap: 18px;
        width: 100%;
        padding: 8px 0;
        overflow-x: auto;
        overscroll-behavior-inline: contain;
        scrollbar-width: thin;
        border-top: 1px solid var(--border-light);
    }

    .main-nav a {
        flex: 0 0 auto;
        white-space: nowrap;
    }

    .header-chapter-nav {
        grid-column: 1;
        grid-row: 3;
        width: 100%;
        max-width: 100%;
        border-top: 1px solid var(--border-light);
    }
}

/* ==========================================
   CHAPTER 04 — AI GO TUTOR
========================================== */

.home-course-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.home-course-card--ai {
    position: relative;
    overflow: hidden;
    color: #fff;
    background:
        radial-gradient(circle at 83% 18%, rgba(197, 155, 39, .9) 0 6px, transparent 7px),
        linear-gradient(145deg, #262629, #09090a 68%);
}

.home-course-card--ai::before {
    content: '';
    position: absolute;
    right: -44px;
    bottom: -44px;
    width: 145px;
    height: 145px;
    border: 2px solid rgba(197, 155, 39, .72);
    border-radius: 50%;
    box-shadow: inset 0 0 0 19px #111113, inset 0 0 0 21px rgba(197, 155, 39, .42);
}

.home-course-card--ai > * {
    position: relative;
    z-index: 1;
}

.home-course-card--ai h3 { color: #fff; }
.home-course-card--ai p { color: #d9d6cf; }

.ai-tutor-body {
    background: #f4f1e9;
}

.ai-tutor-page {
    width: min(var(--content-width), calc(100% - 48px));
    margin: 0 auto 72px;
}

.ai-tutor-hero {
    position: relative;
    min-height: 480px;
    display: grid;
    grid-template-columns: minmax(0, 1.5fr) minmax(280px, .72fr);
    align-items: end;
    gap: 48px;
    padding: clamp(52px, 8vw, 105px) clamp(28px, 6vw, 82px) clamp(48px, 7vw, 86px);
    overflow: hidden;
    color: #fff;
    background:
        radial-gradient(circle at 85% 18%, rgba(197,155,39,.95) 0 8px, transparent 9px),
        radial-gradient(circle at 92% 30%, #f4f1e9 0 5px, transparent 6px),
        linear-gradient(120deg, #070708 0 66%, #171719 66% 100%);
    border: 3px solid #0a0a0b;
    box-shadow: 10px 10px 0 var(--accent-gold);
}

.ai-tutor-hero::before,
.ai-tutor-hero::after {
    content: '';
    position: absolute;
    border: 2px solid rgba(197, 155, 39, .46);
    border-radius: 50%;
}

.ai-tutor-hero::before {
    width: 290px;
    height: 290px;
    right: -65px;
    top: -94px;
    box-shadow: inset 0 0 0 35px #101012, inset 0 0 0 37px rgba(197, 155, 39, .25);
}

.ai-tutor-hero::after {
    width: 95px;
    height: 95px;
    right: 28%;
    bottom: -54px;
    background: var(--accent-gold);
}

.ai-tutor-hero-copy,
.ai-tutor-hero-note {
    position: relative;
    z-index: 1;
}

.ai-tutor-kicker {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 0 0 22px;
    color: var(--accent-gold-hover);
    font-size: 11px;
    font-weight: 1000;
    letter-spacing: .15em;
}

.ai-tutor-kicker span {
    width: 11px;
    height: 11px;
    flex: 0 0 auto;
    border-radius: 50%;
    background: var(--accent-gold);
    border: 1px solid currentColor;
}

.ai-tutor-hero h1,
.ai-system-copy h2 {
    margin: 0;
    font-size: clamp(52px, 7.3vw, 102px);
    font-weight: 1000;
    line-height: .86;
    letter-spacing: -.075em;
}

.ai-tutor-hero h1 em,
.ai-system-copy h2 em {
    color: var(--accent-gold);
    font-style: normal;
}

.ai-tutor-hero-copy > p:last-child {
    max-width: 680px;
    margin: 28px 0 0;
    color: #d5d2cb;
    font-size: clamp(16px, 1.45vw, 20px);
    line-height: 1.7;
}

.ai-tutor-hero-note {
    align-self: center;
    padding: 30px;
    color: #101011;
    background: var(--accent-gold);
    border: 3px solid #fff;
    box-shadow: 8px 8px 0 #fff;
    transform: rotate(-1.2deg);
}

.ai-tutor-hero-note strong {
    display: block;
    font-size: clamp(26px, 3vw, 41px);
    line-height: .95;
    letter-spacing: -.055em;
}

.ai-tutor-hero-note span {
    display: block;
    margin-top: 24px;
    font-size: 10px;
    font-weight: 1000;
    letter-spacing: .12em;
}

.ai-chat-shell {
    margin: clamp(56px, 7vw, 88px) auto;
    background: #fff;
    border: 3px solid #111113;
    box-shadow: 11px 11px 0 #111113;
}

.ai-chat-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    padding: 24px 28px;
    border-bottom: 2px solid #111113;
}

.ai-chat-identity,
.ai-chat-tools {
    display: flex;
    align-items: center;
    gap: 15px;
}

.ai-bot-mark {
    width: 49px;
    height: 49px;
    position: relative;
    display: grid;
    place-items: center;
    flex: 0 0 auto;
    background: #111113;
    border-radius: 50%;
}

.ai-bot-mark span {
    width: 25px;
    height: 18px;
    border: 2px solid #fff;
    border-radius: 5px;
}

.ai-bot-mark span::before,
.ai-bot-mark span::after {
    content: '';
    position: absolute;
    top: 22px;
    width: 4px;
    height: 4px;
    border-radius: 50%;
    background: var(--accent-gold);
}

.ai-bot-mark span::before { left: 17px; }
.ai-bot-mark span::after { right: 17px; }
.ai-bot-mark i { position: absolute; top: 10px; width: 2px; height: 6px; background: #fff; }
.ai-bot-mark b { position: absolute; top: 7px; width: 5px; height: 5px; border-radius: 50%; background: var(--accent-gold); }

.ai-chat-identity h2 {
    margin: 0;
    color: #111113;
    font-size: 20px;
    font-weight: 1000;
    letter-spacing: -.02em;
}

.ai-chat-identity p {
    margin: 3px 0 0;
    color: var(--text-secondary);
    font-size: 13px;
}

.ai-mode-badge {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    min-height: 31px;
    padding: 0 12px;
    color: #111113;
    background: #efede8;
    border: 1px solid #d4d0c7;
    border-radius: 999px;
    font-size: 10px;
    font-weight: 1000;
    letter-spacing: .08em;
}

.ai-mode-badge i {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #777;
}

.ai-mode-badge.is-live { background: #e6f7ed; border-color: #8bcaa3; }
.ai-mode-badge.is-live i { background: #138a48; box-shadow: 0 0 0 3px rgba(19,138,72,.13); }
.ai-mode-badge.is-demo { background: #fbf1d4; border-color: #ddc16c; }
.ai-mode-badge.is-demo i { background: var(--accent-gold); }

.ai-clear-button {
    min-height: 34px;
    padding: 0 14px;
    color: #111113;
    background: #fff;
    border: 2px solid #111113;
    font: inherit;
    font-size: 10px;
    font-weight: 1000;
    letter-spacing: .08em;
    cursor: pointer;
}

.ai-clear-button:hover { color: #fff; background: #111113; }

.ai-suggestion-row {
    display: flex;
    gap: 9px;
    padding: 15px 28px;
    overflow-x: auto;
    background: #f5f3ee;
    border-bottom: 1px solid #d7d3cb;
}

.ai-suggestion-row button {
    flex: 0 0 auto;
    padding: 9px 12px;
    color: #242426;
    background: #fff;
    border: 1px solid #c9c5bc;
    border-radius: 999px;
    font: inherit;
    font-size: 10px;
    font-weight: 900;
    letter-spacing: .04em;
    cursor: pointer;
}

.ai-suggestion-row button:hover {
    color: #111113;
    background: #f1d889;
    border-color: #111113;
}

.ai-chat-log {
    min-height: 430px;
    max-height: 620px;
    display: flex;
    flex-direction: column;
    gap: 24px;
    padding: clamp(24px, 4vw, 52px);
    overflow-y: auto;
    background:
        linear-gradient(rgba(17,17,19,.025) 1px, transparent 1px),
        linear-gradient(90deg, rgba(17,17,19,.025) 1px, transparent 1px),
        #fff;
    background-size: 30px 30px;
}

.ai-message {
    display: flex;
    align-items: flex-start;
    gap: 13px;
}

.ai-message--user {
    flex-direction: row-reverse;
}

.ai-message-avatar {
    width: 34px;
    height: 34px;
    display: grid;
    place-items: center;
    flex: 0 0 auto;
    color: #fff;
    background: #111113;
    border: 2px solid #111113;
    border-radius: 50%;
    font-size: 9px;
    font-weight: 1000;
}

.ai-message--user .ai-message-avatar {
    color: #111113;
    background: var(--accent-gold);
}

.ai-message-content {
    width: min(760px, calc(100% - 48px));
}

.ai-message--user .ai-message-content {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
}

.ai-message-name {
    display: block;
    margin-bottom: 7px;
    color: #6f6c65;
    font-size: 9px;
    font-weight: 1000;
    letter-spacing: .13em;
}

.ai-message-bubble {
    padding: 18px 20px;
    color: #242426;
    background: #fff;
    border: 2px solid #111113;
    border-radius: 2px 18px 18px 18px;
    box-shadow: 5px 5px 0 #ddd9cf;
}

.ai-message--user .ai-message-bubble {
    background: var(--accent-gold);
    border-radius: 18px 2px 18px 18px;
    box-shadow: 5px 5px 0 #111113;
}

.ai-message-bubble p {
    margin: 0;
    font-size: clamp(15px, 1.55vw, 18px);
    line-height: 1.72;
    white-space: pre-wrap;
}

.ai-message-lesson {
    display: inline-flex;
    margin-top: 15px;
    padding: 8px 11px;
    color: #fff;
    background: #111113;
    font-size: 10px;
    font-weight: 1000;
    letter-spacing: .08em;
}

.ai-message-lesson:hover { color: #111113; background: var(--accent-gold); }

.ai-message--typing .ai-message-bubble {
    display: flex;
    gap: 6px;
    width: 74px;
}

.ai-message--typing .ai-message-bubble span {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--accent-gold);
    animation: aiTyping 1s infinite ease-in-out;
}

.ai-message--typing .ai-message-bubble span:nth-child(2) { animation-delay: .12s; }
.ai-message--typing .ai-message-bubble span:nth-child(3) { animation-delay: .24s; }

@keyframes aiTyping {
    0%, 80%, 100% { transform: translateY(0); opacity: .4; }
    40% { transform: translateY(-5px); opacity: 1; }
}

.ai-composer {
    padding: 24px 28px 12px;
    background: #f4f1e9;
    border-top: 2px solid #111113;
}

.ai-composer > label {
    display: block;
    margin-bottom: 9px;
    color: #111113;
    font-size: 10px;
    font-weight: 1000;
    letter-spacing: .12em;
    text-transform: uppercase;
}

.ai-composer-box {
    background: #fff;
    border: 2px solid #111113;
    box-shadow: 5px 5px 0 var(--accent-gold);
}

.ai-composer textarea {
    width: 100%;
    min-height: 82px;
    display: block;
    padding: 18px 18px 8px;
    color: #111113;
    background: transparent;
    border: 0;
    resize: vertical;
    font: inherit;
    font-size: 16px;
    line-height: 1.55;
}

.ai-composer textarea:focus { outline: 0; }

.ai-composer-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 10px 10px 10px 18px;
}

.ai-composer-footer > span {
    color: #817d74;
    font-size: 9px;
    font-weight: 900;
    letter-spacing: .08em;
}

.ai-composer-footer button {
    min-width: 120px;
    min-height: 46px;
    color: #fff;
    background: #111113;
    border: 2px solid #111113;
    font: inherit;
    font-size: 12px;
    font-weight: 1000;
    letter-spacing: .1em;
    cursor: pointer;
}

.ai-composer-footer button:hover { color: #111113; background: var(--accent-gold); }
.ai-composer-footer button:disabled { cursor: wait; opacity: .55; }

.ai-chat-disclaimer {
    margin: 0;
    padding: 10px 28px 21px;
    color: #77736a;
    background: #f4f1e9;
    font-size: 11px;
    text-align: center;
}

.ai-system-section {
    display: grid;
    grid-template-columns: minmax(0, .8fr) minmax(420px, 1.2fr);
    gap: clamp(38px, 6vw, 86px);
    align-items: center;
    padding: clamp(44px, 7vw, 84px);
    color: #fff;
    background: #101011;
    border: 3px solid #101011;
    box-shadow: 10px 10px 0 var(--accent-gold);
}

.ai-system-copy h2 {
    font-size: clamp(44px, 5vw, 74px);
}

.ai-system-copy > p:not(.ai-tutor-kicker) {
    margin: 25px 0;
    color: #c8c4bb;
    font-size: 15px;
    line-height: 1.75;
}

.ai-system-copy .secondary-button {
    color: #fff;
    border-color: #fff;
}

.ai-system-copy .secondary-button:hover {
    color: #111113;
    background: var(--accent-gold);
    border-color: var(--accent-gold);
}

.ai-architecture {
    padding: 16px;
    background: #f4f1e9;
    border: 3px solid #fff;
    box-shadow: 8px 8px 0 var(--accent-gold);
}

.ai-architecture article {
    min-height: 105px;
    display: grid;
    grid-template-columns: 48px 1fr;
    align-items: center;
    gap: 15px;
    padding: 17px;
    color: #111113;
    background: #fff;
    border: 2px solid #111113;
}

.ai-architecture article.is-output { background: var(--accent-gold); }

.ai-architecture article > span {
    display: grid;
    place-items: center;
    width: 45px;
    height: 45px;
    color: #fff;
    background: #111113;
    border-radius: 50%;
    font-size: 12px;
    font-weight: 1000;
}

.ai-architecture strong,
.ai-architecture small {
    display: block;
}

.ai-architecture strong { font-size: 16px; font-weight: 1000; }
.ai-architecture small { margin-top: 2px; color: #8e6c0d; font-size: 9px; font-weight: 1000; letter-spacing: .1em; }
.ai-architecture p { margin: 6px 0 0; color: #68645c; font-size: 12px; line-height: 1.45; }
.ai-architecture i { display: block; margin: 5px 0; color: var(--accent-gold); font-style: normal; font-size: 21px; font-weight: 1000; text-align: center; }

.ai-security-note {
    display: grid;
    grid-template-columns: 48px 1fr;
    align-items: center;
    gap: 18px;
    margin-top: 36px;
    padding: 22px 26px;
    background: #fff;
    border: 3px solid #111113;
}

.ai-security-note > div {
    display: grid;
    place-items: center;
    width: 45px;
    height: 45px;
    color: #111113;
    background: var(--accent-gold);
    border: 2px solid #111113;
    border-radius: 50%;
    font-size: 24px;
    font-weight: 1000;
}

.ai-security-note p { margin: 0; color: #4d4a44; font-size: 14px; line-height: 1.65; }
.ai-security-note strong { color: #111113; }
.ai-security-note code { padding: 2px 5px; color: #111113; background: #e8e5de; border: 1px solid #c5c1b8; }

@media (max-width: 1080px) {
    .home-course-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .ai-tutor-hero { grid-template-columns: 1fr; }
    .ai-tutor-hero-note { width: min(100%, 430px); }
    .ai-system-section { grid-template-columns: 1fr; }
}

@media (max-width: 700px) {
    .home-course-grid { grid-template-columns: 1fr; }
    .ai-tutor-page { width: calc(100% - 24px); margin-bottom: 42px; }
    .ai-tutor-hero { min-height: 0; gap: 35px; padding: 48px 24px; box-shadow: 6px 6px 0 var(--accent-gold); }
    .ai-tutor-hero h1 { font-size: clamp(49px, 16vw, 72px); }
    .ai-tutor-hero-note { padding: 23px; box-shadow: 5px 5px 0 #fff; }
    .ai-chat-shell { margin: 48px auto; box-shadow: 6px 6px 0 #111113; }
    .ai-chat-header { align-items: flex-start; padding: 18px; }
    .ai-chat-tools { align-items: flex-end; flex-direction: column; gap: 8px; }
    .ai-clear-button { min-height: 30px; padding: 0 10px; }
    .ai-suggestion-row { padding: 12px 18px; }
    .ai-chat-log { min-height: 390px; max-height: 540px; padding: 23px 17px; }
    .ai-message { gap: 8px; }
    .ai-message-avatar { width: 28px; height: 28px; }
    .ai-message-content { width: calc(100% - 36px); }
    .ai-message-bubble { padding: 14px 15px; box-shadow: 3px 3px 0 #ddd9cf; }
    .ai-message--user .ai-message-bubble { box-shadow: 3px 3px 0 #111113; }
    .ai-composer { padding: 18px 16px 10px; }
    .ai-composer-footer { align-items: flex-end; }
    .ai-composer-footer > span { max-width: 145px; line-height: 1.4; }
    .ai-composer-footer button { min-width: 92px; }
    .ai-chat-disclaimer { padding: 9px 17px 18px; }
    .ai-system-section { padding: 39px 21px; box-shadow: 6px 6px 0 var(--accent-gold); }
    .ai-system-copy h2 { font-size: clamp(42px, 13vw, 60px); }
    .ai-architecture { padding: 10px; box-shadow: 5px 5px 0 var(--accent-gold); }
    .ai-architecture article { grid-template-columns: 39px 1fr; gap: 10px; padding: 13px; }
    .ai-architecture article > span { width: 37px; height: 37px; }
    .ai-security-note { grid-template-columns: 38px 1fr; gap: 12px; padding: 18px; }
    .ai-security-note > div { width: 36px; height: 36px; }
}

@media (prefers-reduced-motion: reduce) {
    .ai-message--typing .ai-message-bubble span { animation: none; }
}

/* ==========================================
   LEARNING COMPLETION SEQUENCE
========================================== */

.completion-body,
.final-congrats-body {
    min-height: 100vh;
    min-height: 100svh;
    margin: 0;
    color: #fff;
    background: #0b0b0c;
}

.completion-stage {
    min-height: 100vh;
    min-height: 100svh;
    position: relative;
    isolation: isolate;
    display: grid;
    place-items: center;
    overflow: hidden;
    padding: 100px 28px 76px;
    background:
        linear-gradient(rgba(255,255,255,.035) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255,255,255,.035) 1px, transparent 1px),
        #0b0b0c;
    background-size: 48px 48px;
}

.completion-stage::before {
    content: '';
    position: absolute;
    z-index: -1;
    width: min(76vw, 980px);
    aspect-ratio: 1;
    border: 2px solid rgba(207,161,44,.24);
    border-radius: 50%;
    box-shadow:
        inset 0 0 0 50px #0b0b0c,
        inset 0 0 0 52px rgba(207,161,44,.18),
        inset 0 0 0 115px #0b0b0c,
        inset 0 0 0 117px rgba(207,161,44,.12);
}

.completion-brand {
    position: absolute;
    z-index: 6;
    top: 28px;
    left: 32px;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    color: #fff;
    font-size: 12px;
    font-weight: 1000;
    letter-spacing: .12em;
}

.completion-brand > span {
    display: grid;
    place-items: center;
    width: 34px;
    height: 34px;
    color: #0b0b0c;
    background: var(--accent-gold);
    border: 2px solid #fff;
    border-radius: 50%;
    font-size: 10px;
}

.completion-skip {
    position: absolute;
    z-index: 6;
    top: 31px;
    right: 32px;
    padding: 9px 12px;
    color: #dad6ce;
    background: transparent;
    border: 1px solid #66625b;
    font: inherit;
    font-size: 9px;
    font-weight: 1000;
    letter-spacing: .1em;
    cursor: pointer;
    transition: opacity .3s ease, color .2s ease, border-color .2s ease;
}

.completion-skip:hover { color: #fff; border-color: var(--accent-gold); }
.completion-skip.is-hidden { opacity: 0; pointer-events: none; }

.completion-message {
    position: relative;
    z-index: 3;
    width: min(1100px, 100%);
    text-align: center;
}

.completion-kicker {
    margin: 0 0 23px;
    color: var(--accent-gold-hover);
    font-size: 10px;
    font-weight: 1000;
    letter-spacing: .2em;
}

.completion-first {
    margin: 0;
    color: #fff;
    font-size: clamp(34px, 8vw, 124px);
    font-weight: 1000;
    line-height: .84;
    letter-spacing: -.08em;
    opacity: 0;
    filter: blur(14px);
    transform: translateY(34px) scale(.96);
    transition:
        opacity 1.25s cubic-bezier(.22,1,.36,1),
        filter 1.4s cubic-bezier(.22,1,.36,1),
        transform 1.4s cubic-bezier(.22,1,.36,1);
}

.completion-first.is-visible {
    opacity: 1;
    filter: blur(0);
    transform: translateY(0) scale(1);
}

.completion-second {
    max-width: 800px;
    margin: 32px auto 0;
    color: var(--accent-gold-hover);
    font-size: clamp(22px, 3.2vw, 47px);
    font-weight: 900;
    line-height: 1.12;
    letter-spacing: -.035em;
    opacity: 0;
    filter: blur(10px);
    transform: translateY(25px);
    transition:
        opacity 1.25s .05s cubic-bezier(.22,1,.36,1),
        filter 1.25s .05s cubic-bezier(.22,1,.36,1),
        transform 1.25s .05s cubic-bezier(.22,1,.36,1);
}

.completion-second.is-visible {
    opacity: 1;
    filter: blur(0);
    transform: translateY(0);
}

.completion-choice {
    max-width: 820px;
    margin: 50px auto 0;
    padding: 23px;
    color: #111113;
    background: #f7f3e9;
    border: 3px solid #fff;
    box-shadow: 9px 9px 0 var(--accent-gold);
    opacity: 0;
    pointer-events: none;
    transform: translateY(32px);
    transition: opacity .85s ease, transform .85s cubic-bezier(.22,1,.36,1);
}

.completion-choice.is-visible {
    opacity: 1;
    pointer-events: auto;
    transform: translateY(0);
}

.completion-choice > p {
    margin: 0 0 18px;
    color: #59554e;
    font-size: 13px;
    font-weight: 800;
}

.completion-choice > div,
.final-congrats-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 13px;
}

.completion-choice-primary,
.completion-choice-secondary {
    min-height: 58px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 15px;
    padding: 0 20px;
    border: 2px solid #111113;
    font-size: 11px;
    font-weight: 1000;
    letter-spacing: .1em;
    transition: transform .18s ease, box-shadow .18s ease, color .18s ease, background .18s ease;
}

.completion-choice-primary {
    color: #111113;
    background: var(--accent-gold);
}

.completion-choice-secondary {
    color: #fff;
    background: #111113;
}

.completion-choice-primary:hover,
.completion-choice-secondary:hover {
    transform: translate(-3px, -3px);
    box-shadow: 5px 5px 0 #8c6a12;
}

.completion-footnote {
    position: absolute;
    z-index: 3;
    bottom: 25px;
    left: 50%;
    width: 100%;
    margin: 0;
    color: #8d887f;
    font-size: 8px;
    font-weight: 1000;
    letter-spacing: .16em;
    text-align: center;
    transform: translateX(-50%);
}

.completion-rings {
    position: absolute;
    z-index: 1;
    inset: 0;
    pointer-events: none;
}

.completion-rings i {
    position: absolute;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: var(--accent-gold);
    box-shadow: 0 0 0 7px rgba(207,161,44,.1);
}

.completion-rings i:nth-child(1) { left: 9%; top: 22%; }
.completion-rings i:nth-child(2) { right: 11%; top: 31%; background: #fff; }
.completion-rings i:nth-child(3) { right: 19%; bottom: 15%; width: 10px; height: 10px; }

.completion-confetti {
    position: absolute;
    z-index: 5;
    inset: 0;
    overflow: hidden;
    pointer-events: none;
}

.completion-confetti-piece {
    position: absolute;
    top: -30px;
    left: var(--confetti-x);
    width: 10px;
    height: 17px;
    background: var(--confetti-color);
    opacity: 0;
    animation: completionConfetti var(--confetti-duration) var(--confetti-delay) cubic-bezier(.15,.65,.25,1) forwards;
}

.completion-confetti-piece.is-strip { width: 5px; height: 23px; }
.completion-confetti-piece.is-circle { width: 11px; height: 11px; border-radius: 50%; }

@keyframes completionConfetti {
    0% { opacity: 0; transform: translate3d(0,-20px,0) rotate(0); }
    8% { opacity: 1; }
    100% { opacity: .95; transform: translate3d(var(--confetti-drift), calc(100vh + 65px), 0) rotate(var(--confetti-rotation)); }
}

/* Final congratulations page */

.final-congrats-body {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    min-height: 100svh;
    background: #f4f1e9;
}

.final-congrats-header,
.final-congrats-footer {
    width: min(1400px, calc(100% - 40px));
    margin: 20px auto 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    padding: 17px 20px;
    color: #fff;
    background: #111113;
    border: 2px solid #111113;
}

.final-congrats-header .completion-brand {
    position: static;
}

.final-congrats-header > span,
.final-congrats-footer {
    font-size: 9px;
    font-weight: 1000;
    letter-spacing: .13em;
}

.final-congrats-main {
    width: min(1400px, calc(100% - 40px));
    min-height: 690px;
    position: relative;
    isolation: isolate;
    flex: 1;
    display: grid;
    grid-template-columns: minmax(0, 1.2fr) minmax(300px, .62fr);
    align-items: center;
    gap: clamp(35px, 7vw, 100px);
    margin: 18px auto 0;
    padding: clamp(45px, 7vw, 95px);
    overflow: hidden;
    color: #fff;
    background: #0b0b0c;
    border: 3px solid #111113;
    box-shadow: 10px 10px 0 var(--accent-gold);
}

.final-congrats-burst {
    position: absolute;
    z-index: -1;
    inset: -25%;
    opacity: .18;
    background: repeating-conic-gradient(from 8deg, var(--accent-gold) 0 2deg, transparent 2deg 14deg);
}

.final-congrats-copy h1 {
    max-width: 930px;
    margin: 0;
    font-size: clamp(56px, 7.3vw, 106px);
    font-weight: 1000;
    line-height: .85;
    letter-spacing: -.075em;
}

.final-congrats-copy h1 em {
    color: var(--accent-gold);
    font-style: normal;
}

.final-congrats-copy > p:not(.completion-kicker) {
    max-width: 720px;
    margin: 30px 0;
    color: #d1cdc4;
    font-size: clamp(15px, 1.45vw, 19px);
    line-height: 1.7;
}

.final-congrats-skills {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 30px;
}

.final-congrats-skills span {
    padding: 8px 10px;
    color: #fff;
    border: 1px solid #625e56;
    font-size: 9px;
    font-weight: 1000;
    letter-spacing: .11em;
}

.final-congrats-actions {
    max-width: 650px;
}

.final-congrats-actions .completion-choice-primary,
.final-congrats-actions .completion-choice-secondary {
    border-color: #fff;
}

.final-congrats-card {
    position: relative;
    min-height: 390px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 32px;
    overflow: hidden;
    color: #111113;
    background: var(--accent-gold);
    border: 3px solid #fff;
    box-shadow: 9px 9px 0 #fff;
    transform: rotate(1.3deg);
}

.final-congrats-card > span {
    font-size: 10px;
    font-weight: 1000;
    letter-spacing: .14em;
}

.final-congrats-card strong {
    display: block;
    font-size: clamp(76px, 9vw, 140px);
    line-height: .8;
    letter-spacing: -.09em;
}

.final-congrats-card p {
    max-width: 320px;
    margin: 0;
    font-size: 15px;
    font-weight: 800;
    line-height: 1.55;
}

.final-congrats-card i {
    position: absolute;
    right: -45px;
    bottom: -45px;
    width: 155px;
    height: 155px;
    border: 3px solid #111113;
    border-radius: 50%;
    box-shadow: inset 0 0 0 23px var(--accent-gold), inset 0 0 0 26px #111113;
}

.final-congrats-stone {
    position: absolute;
    z-index: 2;
    right: clamp(275px, 30vw, 485px);
    top: 8%;
    width: 62px;
    height: 62px;
    display: grid;
    place-items: center;
    color: #111113;
    background: #fff;
    border: 3px solid #111113;
    border-radius: 50%;
    box-shadow: 5px 5px 0 var(--accent-gold);
    transform: rotate(-8deg);
}

.final-congrats-stone span { font-size: 27px; font-weight: 1000; }

.final-congrats-footer {
    margin-bottom: 20px;
    color: #918c82;
    border: 0;
}

@media (max-width: 900px) {
    .final-congrats-main { grid-template-columns: 1fr; }
    .final-congrats-card { width: min(100%, 520px); min-height: 300px; transform: none; }
    .final-congrats-stone { display: none; }
}

@media (max-width: 650px) {
    .completion-stage { align-items: center; padding: 90px 18px 74px; }
    .completion-brand { top: 20px; left: 18px; }
    .completion-skip { top: 23px; right: 18px; }
    .completion-brand b { display: none; }
    .completion-kicker { font-size: 8px; }
    .completion-first { font-size: clamp(32px, 8.6vw, 44px); letter-spacing: -.06em; }
    .completion-second { margin-top: 24px; font-size: clamp(22px, 7.5vw, 34px); }
    .completion-choice { margin-top: 38px; padding: 16px; box-shadow: 6px 6px 0 var(--accent-gold); }
    .completion-choice > div,
    .final-congrats-actions { grid-template-columns: 1fr; }
    .completion-choice-primary,
    .completion-choice-secondary { min-height: 53px; padding: 0 15px; font-size: 10px; }
    .completion-footnote { padding: 0 18px; font-size: 7px; }
    .final-congrats-header,
    .final-congrats-main,
    .final-congrats-footer { width: calc(100% - 24px); }
    .final-congrats-header { margin-top: 12px; padding: 13px; }
    .final-congrats-header > span { font-size: 7px; }
    .final-congrats-main { min-height: 0; gap: 45px; margin-top: 12px; padding: 52px 23px; box-shadow: 6px 6px 0 var(--accent-gold); }
    .final-congrats-copy h1 { font-size: clamp(48px, 15vw, 70px); }
    .final-congrats-card { min-height: 270px; padding: 24px; box-shadow: 6px 6px 0 #fff; }
    .final-congrats-footer { margin-bottom: 12px; flex-direction: column; align-items: flex-start; }
}

@media (prefers-reduced-motion: reduce) {
    .completion-first,
    .completion-second,
    .completion-choice {
        transition: none;
    }

    .completion-confetti-piece {
        animation: none;
    }
}

/* ==========================================
   HOMEPAGE ENTRANCE — WELCOME TO GO
========================================== */

.site-intro { display: none; }

.intro-js .site-intro {
    position: fixed;
    z-index: 10000;
    inset: 0;
    display: grid;
    place-items: center;
    isolation: isolate;
    overflow: hidden;
    color: #fff;
    background: #050506;
    opacity: 1;
    transition: opacity .7s ease, visibility .7s ease;
}

.site-intro.is-leaving { opacity: 0; visibility: hidden; pointer-events: none; }
.site-intro-active { overflow: hidden; }

.site-intro-grid {
    position: absolute;
    z-index: -3;
    inset: 0;
    opacity: .42;
    background:
        linear-gradient(rgba(255,255,255,.07) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255,255,255,.07) 1px, transparent 1px);
    background-size: 56px 56px;
    mask-image: radial-gradient(circle at center, #000 5%, transparent 71%);
}

.site-intro::before,
.site-intro::after {
    content: '';
    position: absolute;
    z-index: -2;
    border-radius: 50%;
}

.site-intro::before {
    width: min(90vw, 1050px);
    aspect-ratio: 1;
    border: 2px solid rgba(207,161,44,.35);
    box-shadow:
        inset 0 0 0 54px #050506,
        inset 0 0 0 56px rgba(207,161,44,.22),
        inset 0 0 0 158px #050506,
        inset 0 0 0 160px rgba(207,161,44,.15);
    transform: scale(.72);
    opacity: 0;
}

.site-intro::after {
    width: 13px;
    height: 13px;
    top: 19%;
    right: 18%;
    background: var(--accent-gold);
    box-shadow: 0 0 0 8px rgba(207,161,44,.13);
    opacity: 0;
}

.site-intro-rings { position: absolute; z-index: -1; inset: 0; pointer-events: none; }

.site-intro-rings i {
    position: absolute;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #fff;
    opacity: 0;
}

.site-intro-rings i:nth-child(1) { top: 31%; left: 14%; }
.site-intro-rings i:nth-child(2) { right: 12%; bottom: 24%; width: 8px; height: 8px; background: var(--accent-gold); }
.site-intro-rings i:nth-child(3) { left: 23%; bottom: 16%; width: 6px; height: 6px; }

.site-intro-confetti { position: absolute; z-index: 2; inset: 0; pointer-events: none; }

.site-intro-confetti i {
    position: absolute;
    width: 8px;
    height: 21px;
    background: var(--accent-gold);
    opacity: 0;
}

.site-intro-confetti i:nth-child(1) { left: 15%; top: 28%; transform: rotate(42deg); }
.site-intro-confetti i:nth-child(2) { right: 18%; top: 56%; width: 17px; height: 7px; background: #fff; transform: rotate(-26deg); }
.site-intro-confetti i:nth-child(3) { left: 27%; bottom: 21%; width: 7px; height: 7px; border-radius: 50%; }
.site-intro-confetti i:nth-child(4) { right: 29%; top: 22%; width: 5px; height: 17px; background: #fff; transform: rotate(28deg); }
.site-intro-confetti i:nth-child(5) { left: 9%; bottom: 37%; width: 16px; height: 6px; transform: rotate(-18deg); }

.site-intro-copy {
    position: relative;
    z-index: 3;
    width: min(1100px, calc(100% - 44px));
    text-align: center;
}

.site-intro-copy > p {
    margin: 0 0 23px;
    color: var(--accent-gold-hover);
    font-size: 11px;
    font-weight: 1000;
    letter-spacing: .28em;
    opacity: 0;
    transform: translateY(12px);
}

.site-intro-copy h1 {
    margin: 0;
    color: #fff;
    font-size: clamp(42px, 7.5vw, 116px);
    font-weight: 1000;
    line-height: .87;
    letter-spacing: -.07em;
    opacity: 0;
    filter: blur(18px);
    transform: translateY(34px) scale(.965);
}

.site-intro-copy > span {
    width: 0;
    height: 4px;
    display: block;
    margin: 31px auto 0;
    background: var(--accent-gold);
    box-shadow: 7px 7px 0 #fff;
}

.site-intro-skip {
    position: absolute;
    z-index: 5;
    right: 30px;
    bottom: 27px;
    min-height: 37px;
    padding: 0 13px;
    color: #d9d4ca;
    background: transparent;
    border: 1px solid #5c584f;
    font: inherit;
    font-size: 9px;
    font-weight: 1000;
    letter-spacing: .12em;
    cursor: pointer;
    opacity: 0;
}

.site-intro-skip:hover,
.site-intro-skip:focus-visible { color: #fff; border-color: var(--accent-gold); outline: none; }

.site-intro.is-playing::before { animation: introRingReveal 3.6s cubic-bezier(.2,.75,.24,1) both; }
.site-intro.is-playing::after { animation: introDotReveal .8s 1.2s ease-out both; }
.site-intro.is-playing .site-intro-copy > p { animation: introSmallReveal .8s .48s ease-out both; }
.site-intro.is-playing .site-intro-copy h1 { animation: introTitleReveal 2s .86s cubic-bezier(.16,.84,.25,1) both; }
.site-intro.is-playing .site-intro-copy > span { animation: introLineReveal 1.1s 2.25s cubic-bezier(.22,1,.36,1) both; }

.site-intro.is-playing .site-intro-rings i,
.site-intro.is-playing .site-intro-confetti i,
.site-intro.is-playing .site-intro-skip { animation: introAccentReveal 1s 1.55s ease-out both; }

.site-intro.is-playing .site-intro-rings i:nth-child(2),
.site-intro.is-playing .site-intro-confetti i:nth-child(2) { animation-delay: 1.85s; }
.site-intro.is-playing .site-intro-rings i:nth-child(3),
.site-intro.is-playing .site-intro-confetti i:nth-child(3) { animation-delay: 2.1s; }
.site-intro.is-playing .site-intro-confetti i:nth-child(4) { animation-delay: 2.35s; }
.site-intro.is-playing .site-intro-confetti i:nth-child(5) { animation-delay: 2.55s; }
.site-intro.is-playing .site-intro-skip { animation-delay: 1.1s; }

@keyframes introRingReveal {
    0% { opacity: 0; transform: scale(.72) rotate(-15deg); }
    45% { opacity: 1; }
    100% { opacity: 1; transform: scale(1) rotate(0); }
}

@keyframes introDotReveal {
    0% { opacity: 0; transform: scale(0); }
    75% { opacity: 1; transform: scale(1.35); }
    100% { opacity: 1; transform: scale(1); }
}

@keyframes introSmallReveal { to { opacity: 1; transform: translateY(0); } }

@keyframes introTitleReveal {
    0% { opacity: 0; filter: blur(18px); transform: translateY(34px) scale(.965); }
    70% { opacity: 1; filter: blur(0); }
    100% { opacity: 1; filter: blur(0); transform: translateY(0) scale(1); }
}

@keyframes introLineReveal { to { width: min(250px, 52vw); } }
@keyframes introAccentReveal { from { opacity: 0; transform: translateY(13px) rotate(0); } to { opacity: 1; transform: translateY(0) rotate(0); } }

@media (max-width: 650px) {
    .site-intro-copy { width: min(100% - 32px, 520px); }
    .site-intro-copy > p { margin-bottom: 17px; font-size: 8px; letter-spacing: .19em; }
    .site-intro-copy h1 { font-size: clamp(35px, 12vw, 55px); line-height: .93; letter-spacing: -.055em; }
    .site-intro-skip { right: 16px; bottom: 17px; min-height: 33px; padding: 0 10px; font-size: 8px; }
    .site-intro::before { width: 132vw; }
}

@media (prefers-reduced-motion: reduce) {
    .site-intro::before,
    .site-intro::after,
    .site-intro-copy > p,
    .site-intro-copy h1,
    .site-intro-copy > span,
    .site-intro-rings i,
    .site-intro-confetti i,
    .site-intro-skip { animation: none !important; }

    .site-intro::before,
    .site-intro::after,
    .site-intro-copy > p,
    .site-intro-copy h1,
    .site-intro-rings i,
    .site-intro-confetti i,
    .site-intro-skip { opacity: 1; }

    .site-intro-copy > p,
    .site-intro-copy h1 { filter: none; transform: none; }
    .site-intro-copy > span { width: min(250px, 52vw); }
}

/* ==========================================
   CHAPTER 04 — REVIEW GUIDE
========================================== */

.review-guide-shell {
    margin-bottom: 68px;
}

.review-guide-shell .ai-chat-log {
    min-height: 220px;
    max-height: 460px;
}

.review-guide-mark {
    width: 44px;
    height: 44px;
    display: grid;
    flex: 0 0 44px;
    place-items: center;
    color: #111113;
    background: var(--accent-gold);
    border: 2px solid #111113;
    border-radius: 50%;
    box-shadow: 3px 3px 0 #111113;
    transform: rotate(-7deg);
}

.review-guide-mark span {
    font-size: 23px;
    font-weight: 1000;
    line-height: 1;
}

.review-topic-panel {
    padding: 28px;
    background: #f4f1e9;
    border-top: 2px solid #111113;
}

.review-topic-heading {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 24px;
    margin-bottom: 20px;
}

.review-topic-heading .home-section-label {
    margin: 0;
    color: #8f6610;
}

.review-topic-heading h3 {
    max-width: 610px;
    margin: 0;
    color: #111113;
    font-size: clamp(22px, 3vw, 36px);
    font-weight: 1000;
    line-height: 1;
    letter-spacing: -.045em;
    text-align: right;
}

.review-topic-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

.review-topic-card {
    min-height: 92px;
    display: grid;
    grid-template-columns: 45px 1fr 26px;
    align-items: center;
    gap: 14px;
    padding: 16px;
    color: #111113;
    text-align: left;
    background: #fff;
    border: 2px solid #111113;
    box-shadow: 4px 4px 0 rgba(17,17,19,.17);
    font: inherit;
    cursor: pointer;
    transition: transform .18s ease, box-shadow .18s ease, background .18s ease;
}

.review-topic-card:hover,
.review-topic-card:focus-visible {
    outline: none;
    transform: translate(-2px, -2px);
    box-shadow: 6px 6px 0 var(--accent-gold);
}

.review-topic-card.is-selected {
    background: var(--accent-gold);
    box-shadow: 5px 5px 0 #111113;
}

.review-topic-card > b {
    width: 42px;
    height: 42px;
    display: grid;
    place-items: center;
    color: #fff;
    background: #111113;
    border-radius: 50%;
    font-size: 11px;
    letter-spacing: .08em;
}

.review-topic-card > span {
    display: grid;
    gap: 4px;
}

.review-topic-card strong {
    font-size: 13px;
    font-weight: 1000;
    letter-spacing: -.01em;
}

.review-topic-card small {
    color: #716c62;
    font-size: 11px;
    font-weight: 750;
}

.review-topic-card.is-selected small {
    color: #332707;
}

.review-topic-card > i {
    font-style: normal;
    font-size: 21px;
    font-weight: 1000;
    text-align: right;
}

.review-guide-note {
    margin: 0;
    padding: 17px 28px;
    color: #d8d3c9;
    background: #111113;
    border-top: 2px solid #111113;
    font-size: 10px;
    font-weight: 850;
    letter-spacing: .055em;
    text-align: center;
}

@media (max-width: 760px) {
    .review-guide-shell .ai-chat-log { min-height: 210px; }
    .review-topic-panel { padding: 20px 16px; }
    .review-topic-heading { display: block; }
    .review-topic-heading h3 { margin-top: 8px; text-align: left; }
    .review-topic-grid { grid-template-columns: 1fr; }
    .review-topic-card { min-height: 82px; }
}

@media (prefers-reduced-motion: reduce) {
    .review-topic-card { transition: none; }
}

/* ==========================================
   LEGACY FINALE — A THOUSAND YEARS OF GO
========================================== */

.legacy-finale-body {
    min-width: 320px;
    min-height: 100vh;
    margin: 0;
    overflow: hidden;
    color: #fff;
    background: #050506;
}

.legacy-header {
    position: fixed;
    z-index: 50;
    top: 0;
    left: 0;
    width: 100%;
    min-height: 74px;
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    gap: 20px;
    padding: 14px clamp(18px, 3vw, 48px);
    color: #fff;
    border-bottom: 1px solid rgba(255,255,255,.15);
    background: linear-gradient(#050506 5%, rgba(5,5,6,.88) 72%, transparent);
}

.legacy-brand {
    width: max-content;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    color: #fff;
    text-decoration: none;
}

.legacy-brand > span {
    width: 34px;
    height: 34px;
    display: grid;
    place-items: center;
    color: #111113;
    background: var(--accent-gold);
    border-radius: 50%;
    font-size: 10px;
}

.legacy-brand b,
.legacy-header > p,
.legacy-skip {
    font-size: 9px;
    font-weight: 1000;
    letter-spacing: .16em;
}

.legacy-header > p {
    margin: 0;
    color: #aca79d;
}

.legacy-skip {
    justify-self: end;
    min-height: 37px;
    padding: 0 13px;
    color: #d9d4ca;
    background: transparent;
    border: 1px solid #5c584f;
    font-family: inherit;
    cursor: pointer;
    transition: opacity .25s ease, color .2s ease, border-color .2s ease;
}

.legacy-skip:hover,
.legacy-skip:focus-visible {
    color: #fff;
    border-color: var(--accent-gold);
    outline: none;
}

.legacy-skip.is-hidden {
    opacity: 0;
    pointer-events: none;
}

.legacy-stage {
    position: relative;
    width: 100%;
    height: 100vh;
    min-height: 650px;
    isolation: isolate;
    overflow: hidden;
    background:
        radial-gradient(circle at 50% 48%, rgba(207,161,44,.1), transparent 36%),
        #050506;
}

.legacy-grid {
    position: absolute;
    z-index: -5;
    inset: 0;
    opacity: .28;
    background:
        linear-gradient(rgba(255,255,255,.055) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255,255,255,.055) 1px, transparent 1px);
    background-size: 58px 58px;
    mask-image: radial-gradient(circle at center, #000 2%, transparent 72%);
}

.legacy-orbit {
    position: absolute;
    z-index: -4;
    inset: 0;
    pointer-events: none;
}

.legacy-orbit::before,
.legacy-orbit::after,
.legacy-orbit i {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    border: 1px solid rgba(207,161,44,.18);
    border-radius: 50%;
    transform: translate(-50%, -50%);
}

.legacy-orbit::before { width: min(74vw, 880px); aspect-ratio: 1; }
.legacy-orbit::after { width: min(51vw, 610px); aspect-ratio: 1; }
.legacy-orbit i:nth-child(1) { width: min(31vw, 370px); aspect-ratio: 1; }
.legacy-orbit i:nth-child(2) { width: 9px; height: 9px; margin: -29vh 0 0 26vw; background: var(--accent-gold); border: 0; box-shadow: 0 0 0 8px rgba(207,161,44,.12); }
.legacy-orbit i:nth-child(3) { width: 6px; height: 6px; margin: 26vh 0 0 -31vw; background: #fff; border: 0; }

.legacy-opening {
    position: absolute;
    z-index: 8;
    top: 50%;
    left: 50%;
    width: min(900px, calc(100% - 40px));
    text-align: center;
    opacity: 0;
    transform: translate(-50%, -45%);
    transition: opacity .55s ease, transform .7s ease;
}

.phase-opening .legacy-opening {
    opacity: 1;
    transform: translate(-50%, -50%);
}

.legacy-opening > p,
.legacy-final-message > p:first-child {
    margin: 0 0 20px;
    color: var(--accent-gold);
    font-size: 10px;
    font-weight: 1000;
    letter-spacing: .3em;
}

.legacy-opening h1 {
    margin: 0;
    font-size: clamp(54px, 8.3vw, 122px);
    font-weight: 1000;
    line-height: .82;
    letter-spacing: -.075em;
}

.legacy-opening h1 em {
    color: var(--accent-gold);
    font-style: normal;
}

.legacy-opening > span {
    width: min(280px, 48vw);
    height: 5px;
    display: block;
    margin: 32px auto 0;
    background: var(--accent-gold);
    box-shadow: 8px 8px 0 #fff;
}

.legacy-status {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
}

.legacy-gallery {
    position: absolute;
    z-index: 9;
    inset: 0;
    pointer-events: none;
}

.legacy-kifu-card {
    position: absolute;
    top: 51%;
    left: 50%;
    width: min(340px, 72vw);
    min-height: 430px;
    display: grid;
    grid-template-rows: auto 1fr auto;
    gap: 12px;
    padding: 16px;
    color: #111113;
    background: #eee9dc;
    border: 2px solid #111113;
    box-shadow: 10px 10px 0 var(--accent-gold), 13px 13px 0 #fff;
    opacity: 0;
    transform: translate(-50%, -50%) scale(.72) rotate(-3deg);
    transition:
        opacity .42s ease,
        transform .82s cubic-bezier(.2,.85,.2,1),
        filter .55s ease;
    will-change: transform, opacity;
}

.legacy-kifu-card header,
.legacy-kifu-card footer {
    position: relative;
    z-index: 2;
}

.legacy-kifu-card header {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    padding-bottom: 10px;
    border-bottom: 2px solid #111113;
}

.legacy-kifu-card header span,
.legacy-kifu-card header b,
.legacy-kifu-card footer small {
    font-size: 8px;
    font-weight: 1000;
    letter-spacing: .14em;
}

.legacy-kifu-card header span { color: #8c6818; }

.legacy-kifu-card footer {
    display: grid;
    gap: 5px;
    padding-top: 11px;
    border-top: 2px solid #111113;
}

.legacy-kifu-card footer strong {
    font-size: 15px;
    font-weight: 1000;
    letter-spacing: -.02em;
}

.legacy-kifu-card footer small {
    color: #686359;
    line-height: 1.4;
}

.legacy-board {
    position: relative;
    width: min(255px, 54vw);
    aspect-ratio: 1;
    align-self: center;
    justify-self: center;
    background: #cfa12c;
    border: 2px solid #111113;
    box-shadow: 5px 5px 0 #111113;
}

.legacy-board-grid {
    position: absolute;
    inset: 13px;
    background:
        linear-gradient(rgba(17,17,19,.75) 1px, transparent 1px),
        linear-gradient(90deg, rgba(17,17,19,.75) 1px, transparent 1px);
    background-size: 12.5% 12.5%;
    border-right: 1px solid rgba(17,17,19,.75);
    border-bottom: 1px solid rgba(17,17,19,.75);
}

.legacy-board > i {
    position: absolute;
    z-index: 2;
    top: var(--y);
    left: var(--x);
    width: 17px;
    height: 17px;
    border: 1px solid #111113;
    border-radius: 50%;
    transform: translate(-50%, -50%) scale(0);
    transition: transform .28s cubic-bezier(.2,1.5,.3,1);
}

.legacy-kifu-card.is-active .legacy-board > i {
    transform: translate(-50%, -50%) scale(1);
}

.legacy-board > i:nth-of-type(2) { transition-delay: .07s; }
.legacy-board > i:nth-of-type(3) { transition-delay: .14s; }
.legacy-board > i:nth-of-type(4) { transition-delay: .21s; }
.legacy-board > i:nth-of-type(5) { transition-delay: .28s; }
.legacy-board > i:nth-of-type(6) { transition-delay: .35s; }
.legacy-board > i:nth-of-type(7) { transition-delay: .42s; }

.legacy-board .black { background: #111113; box-shadow: inset -3px -3px 5px #000, inset 2px 2px 3px #474747; }
.legacy-board .white { background: #fff; box-shadow: inset -3px -3px 4px #c8c4ba; }
.legacy-board .legacy-key-stone { box-shadow: 0 0 0 4px #fff, 0 0 0 7px var(--accent-gold), inset -3px -3px 5px #000; }

.legacy-kifu-card--ancient { background: #d9cfb6; }
.legacy-kifu-card--danghu { background: #efe4c8; }
.legacy-kifu-card--shusaku { background: #e5e2da; }
.legacy-kifu-card--fuseki { background: #f5f3ed; }
.legacy-kifu-card--modern { background: #fff; }

.legacy-kifu-card.is-active {
    z-index: 12;
    opacity: 1;
    filter: none;
    transform: translate(-50%, -50%) scale(.9) rotate(0);
}

.legacy-kifu-card.is-archived {
    z-index: 5;
    opacity: .5;
    filter: saturate(.5) brightness(.7);
    transform:
        translate(calc(-50% + var(--orbit-x)), calc(-50% + var(--orbit-y)))
        scale(.28)
        rotate(var(--orbit-r));
}

.legacy-kifu-card.is-gathering {
    z-index: 7;
    opacity: .3;
    filter: brightness(1.4);
    transform: translate(-50%, -50%) scale(.06) rotate(0);
    transition-duration: .9s;
}

.legacy-convergence {
    position: absolute;
    z-index: 13;
    top: 50%;
    left: 50%;
    width: min(640px, calc(100% - 36px));
    text-align: center;
    opacity: 0;
    transform: translate(-50%, -50%);
    pointer-events: none;
}

.legacy-center-stone {
    width: 94px;
    height: 94px;
    display: block;
    margin: 0 auto;
    background: radial-gradient(circle at 34% 28%, #515151, #101011 36%, #000 72%);
    border: 2px solid #000;
    border-radius: 50%;
    box-shadow: 0 0 0 0 rgba(207,161,44,.4), 0 24px 60px #000;
    opacity: 0;
    transform: scale(.08);
}

.legacy-convergence p {
    margin: 24px 0 0;
    color: var(--accent-gold);
    font-size: 9px;
    font-weight: 1000;
    letter-spacing: .23em;
    opacity: 0;
    transform: translateY(12px);
}

.phase-gather .legacy-convergence,
.phase-stone .legacy-convergence,
.phase-burst .legacy-convergence { opacity: 1; }

.phase-gather .legacy-convergence p,
.phase-stone .legacy-convergence p {
    opacity: 1;
    transform: translateY(0);
    transition: opacity .55s .25s ease, transform .55s .25s ease;
}

.phase-gather .legacy-center-stone {
    opacity: .45;
    transform: scale(.18);
    transition: opacity .7s ease, transform .9s cubic-bezier(.2,.85,.2,1);
}

.phase-stone .legacy-center-stone {
    opacity: 1;
    transform: scale(1);
    box-shadow: 0 0 0 28px rgba(207,161,44,.08), 0 0 90px rgba(207,161,44,.34), 0 24px 60px #000;
    transition: opacity .3s ease, transform .8s cubic-bezier(.16,1,.3,1), box-shadow .8s ease;
}

.phase-burst .legacy-center-stone {
    opacity: 0;
    transform: scale(3.4);
    transition: opacity .28s .12s ease, transform .5s ease-out;
}

.phase-burst .legacy-convergence p { opacity: 0; }

.legacy-burst {
    position: absolute;
    z-index: 17;
    top: 50%;
    left: 50%;
    width: 1px;
    height: 1px;
    pointer-events: none;
}

.legacy-particle {
    position: absolute;
    top: 0;
    left: 0;
    display: block;
    opacity: 0;
    transform: translate(-50%, -50%) scale(.2) rotate(0);
}

.legacy-particle--stone-black,
.legacy-particle--stone-white {
    width: 15px;
    height: 15px;
    border: 1px solid #111113;
    border-radius: 50%;
}

.legacy-particle--stone-black { background: #070708; }
.legacy-particle--stone-white { background: #fff; }
.legacy-particle--gold-line { width: 5px; height: 36px; background: var(--accent-gold); }
.legacy-particle--paper { width: 24px; height: 15px; background: #e8dfc8; border: 1px solid #111113; }

.phase-burst .legacy-particle {
    animation: legacyParticleBurst .9s var(--delay) cubic-bezier(.12,.72,.22,1) both;
}

@keyframes legacyParticleBurst {
    0% { opacity: 0; transform: translate(-50%, -50%) scale(.2) rotate(0); }
    12% { opacity: 1; }
    100% { opacity: 0; transform: translate(calc(-50% + var(--tx)), calc(-50% + var(--ty))) scale(1) rotate(var(--turn)); }
}

.legacy-gate {
    position: absolute;
    z-index: 18;
    inset: 0;
    overflow: hidden;
    opacity: 0;
    pointer-events: none;
}

.legacy-gate-wing {
    position: absolute;
    top: 0;
    width: 50.25%;
    height: 100%;
    background:
        linear-gradient(rgba(207,161,44,.18) 1px, transparent 1px),
        linear-gradient(90deg, rgba(207,161,44,.18) 1px, transparent 1px),
        #080809;
    background-size: 58px 58px;
}

.legacy-gate-wing--left { left: 0; border-right: 2px solid var(--accent-gold); }
.legacy-gate-wing--right { right: 0; border-left: 2px solid var(--accent-gold); }

.legacy-gate > i {
    position: absolute;
    z-index: 2;
    top: 50%;
    left: 50%;
    width: 11px;
    height: 11px;
    background: var(--accent-gold);
    border-radius: 50%;
    opacity: 0;
}

.legacy-gate > i:nth-of-type(1) { margin: -31vh 0 0 -34vw; }
.legacy-gate > i:nth-of-type(2) { margin: 25vh 0 0 31vw; background: #fff; }
.legacy-gate > i:nth-of-type(3) { margin: -16vh 0 0 26vw; width: 5px; height: 27px; border-radius: 0; }
.legacy-gate > i:nth-of-type(4) { margin: 33vh 0 0 -23vw; width: 25px; height: 5px; border-radius: 0; background: #fff; }

.phase-gate .legacy-gate,
.phase-final .legacy-gate { opacity: 1; }

.phase-gate .legacy-gate-wing--left { animation: legacyGateLeft .95s .12s cubic-bezier(.72,.02,.26,1) both; }
.phase-gate .legacy-gate-wing--right { animation: legacyGateRight .95s .12s cubic-bezier(.72,.02,.26,1) both; }
.phase-gate .legacy-gate > i { animation: legacyGateSpark .7s .25s ease-out both; }

@keyframes legacyGateLeft { from { transform: translateX(0); } to { transform: translateX(-102%); } }
@keyframes legacyGateRight { from { transform: translateX(0); } to { transform: translateX(102%); } }
@keyframes legacyGateSpark { from { opacity: 0; transform: scale(0); } to { opacity: 1; transform: scale(1); } }

.phase-final .legacy-gate-wing--left { transform: translateX(-102%); }
.phase-final .legacy-gate-wing--right { transform: translateX(102%); }
.phase-final .legacy-gate > i { opacity: 1; }

.legacy-final-message {
    position: absolute;
    z-index: 25;
    top: 50%;
    left: 50%;
    width: min(1050px, calc(100% - 40px));
    text-align: center;
    opacity: 0;
    visibility: hidden;
    transform: translate(-50%, -47%);
    pointer-events: none;
}

.phase-final .legacy-final-message {
    opacity: 1;
    visibility: visible;
    transform: translate(-50%, -50%);
    pointer-events: auto;
    transition: opacity .8s ease, transform .9s cubic-bezier(.2,.85,.2,1);
}

.legacy-final-message h2 {
    margin: 0;
    font-size: clamp(48px, 8vw, 118px);
    font-weight: 1000;
    line-height: .82;
    letter-spacing: -.075em;
    outline: none;
}

.legacy-final-message h2 span,
.legacy-final-message h2 em {
    display: block;
    opacity: 0;
    transform: translateY(26px);
}

.legacy-final-message h2 em {
    color: var(--accent-gold);
    font-style: normal;
}

.phase-final .legacy-final-message h2 span:nth-child(1) { animation: legacyFinalLine .7s .15s both; }
.phase-final .legacy-final-message h2 span:nth-child(2) { animation: legacyFinalLine .7s .43s both; }
.phase-final .legacy-final-message h2 em { animation: legacyFinalLine .7s .71s both; }

@keyframes legacyFinalLine { to { opacity: 1; transform: translateY(0); } }

.legacy-final-message > p:nth-of-type(2) {
    margin: 28px auto 0;
    color: #d7d2c8;
    font-size: clamp(13px, 1.5vw, 18px);
    font-weight: 700;
    line-height: 1.55;
    opacity: 0;
}

.phase-final .legacy-final-message > p:nth-of-type(2) { animation: legacyFinalLine .7s 1s both; }

.legacy-actions {
    max-width: 850px;
    display: grid;
    grid-template-columns: 1.35fr 1fr 1fr;
    gap: 10px;
    margin: 34px auto 0;
    opacity: 0;
}

.phase-final .legacy-actions { animation: legacyFinalLine .7s 1.2s both; }

.legacy-actions a,
.legacy-actions button {
    min-height: 56px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 0 18px;
    color: #fff;
    text-decoration: none;
    background: #101012;
    border: 2px solid #fff;
    font: inherit;
    font-size: 9px;
    font-weight: 1000;
    letter-spacing: .1em;
    cursor: pointer;
}

.legacy-actions .legacy-primary {
    color: #111113;
    background: var(--accent-gold);
}

.legacy-actions a:hover,
.legacy-actions button:hover,
.legacy-actions a:focus-visible,
.legacy-actions button:focus-visible {
    color: #111113;
    background: #fff;
    outline: none;
    transform: translateY(-2px);
}

.legacy-record-note {
    position: absolute;
    z-index: 30;
    right: 24px;
    bottom: 17px;
    margin: 0;
    color: #716d64;
    font-size: 7px;
    font-weight: 900;
    letter-spacing: .13em;
}

@media (max-width: 760px) {
    .legacy-header {
        min-height: 64px;
        grid-template-columns: 1fr auto;
        padding: 11px 15px;
    }
    .legacy-header > p { display: none; }
    .legacy-brand b { font-size: 8px; }
    .legacy-skip { min-height: 34px; padding: 0 9px; font-size: 7px; }
    .legacy-stage { min-height: 620px; }
    .legacy-opening h1 { font-size: clamp(46px, 14vw, 70px); }
    .legacy-kifu-card { width: min(306px, 78vw); min-height: 398px; padding: 13px; }
    .legacy-board { width: min(225px, 57vw); }
    .legacy-kifu-card.is-active { transform: translate(-50%, -48%) scale(.84); }
    .legacy-kifu-card.is-archived { opacity: .28; transform: translate(-50%, -50%) scale(.14) rotate(var(--orbit-r)); }
    .legacy-final-message { width: calc(100% - 28px); }
    .legacy-final-message h2 { font-size: clamp(43px, 13vw, 66px); line-height: .88; }
    .legacy-final-message > p:first-child { margin-bottom: 15px; font-size: 7px; letter-spacing: .2em; }
    .legacy-final-message > p:nth-of-type(2) { margin-top: 20px; font-size: 12px; }
    .legacy-actions { grid-template-columns: 1fr; gap: 8px; margin-top: 24px; }
    .legacy-actions a,
    .legacy-actions button { min-height: 46px; padding: 0 13px; font-size: 8px; }
    .legacy-record-note { right: 12px; bottom: 9px; max-width: calc(100% - 24px); font-size: 5px; text-align: right; }
}

@media (max-height: 700px) and (min-width: 761px) {
    .legacy-kifu-card { min-height: 380px; transform: translate(-50%, -48%) scale(.68) rotate(-3deg); }
    .legacy-kifu-card.is-active { transform: translate(-50%, -48%) scale(.78); }
    .legacy-board { width: 215px; }
    .legacy-final-message h2 { font-size: clamp(45px, 7vw, 88px); }
    .legacy-final-message > p:nth-of-type(2) { margin-top: 18px; }
    .legacy-actions { margin-top: 22px; }
}

@media (prefers-reduced-motion: reduce) {
    .legacy-opening,
    .legacy-kifu-card,
    .legacy-board > i,
    .legacy-center-stone,
    .legacy-convergence p,
    .legacy-gate-wing,
    .legacy-final-message,
    .legacy-final-message h2 span,
    .legacy-final-message h2 em,
    .legacy-final-message > p:nth-of-type(2),
    .legacy-actions {
        animation: none !important;
        transition: none !important;
    }

    .phase-final .legacy-final-message h2 span,
    .phase-final .legacy-final-message h2 em,
    .phase-final .legacy-final-message > p:nth-of-type(2),
    .phase-final .legacy-actions {
        opacity: 1;
        transform: none;
    }

    .legacy-particle { display: none; }
}

/* About page: concise project artwork disclosure. */
.about-visual-note {
    display: grid;
    grid-template-columns: minmax(120px, 0.3fr) minmax(0, 1fr);
    gap: 24px;
    align-items: center;
    margin-top: 30px;
    padding: 22px 24px;
    color: var(--paper, #f5f1e8);
    background: var(--dark-header, #111113);
    border: 2px solid var(--dark-header, #111113);
    box-shadow: 8px 8px 0 var(--gold, #cfa12c);
}

.about-visual-note .eyebrow {
    margin: 0;
    color: var(--gold, #cfa12c);
}

.about-visual-note p {
    margin: 0;
    color: inherit;
    font-size: 0.95rem;
    line-height: 1.65;
}

@media (max-width: 560px) {
    .about-visual-note {
        grid-template-columns: 1fr;
        gap: 10px;
        padding: 18px;
        box-shadow: 5px 5px 0 var(--gold, #cfa12c);
    }
}
