:root {
    --bg: #0d0a1c;
    --bg-alt: rgba(255, 255, 255, 0.04);
    --fg: #f8f5ff;
    --muted: rgba(248, 245, 255, 0.75);
    --accent: #ff89c4;
    --accent-strong: #ff5aa6;
    --secondary: #46d6c8;
    --bg-deep: #060415;
    --bg-surface: rgba(18, 16, 38, 0.58);
    --glow-pink: rgba(255, 137, 196, 0.55);
    --glow-cyan: rgba(90, 220, 210, 0.5);
    --glow-violet: rgba(130, 110, 255, 0.45);
    --card-glow: rgba(255, 138, 196, 0.35);
    --card-border: rgba(255, 255, 255, 0.08);
    --shadow: 0 30px 60px rgba(7, 3, 28, 0.4);
    font-size: 16px;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: "Raleway", "Segoe UI", "Helvetica Neue", "Noto Sans SC", sans-serif;
    line-height: 1.7;
    background-color: var(--bg);
    background-image: radial-gradient(circle at 18% 18%, rgba(255, 138, 196, 0.12), transparent 45%),
        radial-gradient(circle at 82% 28%, rgba(70, 214, 200, 0.08), transparent 48%),
        radial-gradient(circle at 52% 82%, rgba(130, 110, 255, 0.08), transparent 55%);
    color: var(--fg);
    min-height: 100vh;
    overflow-x: hidden;
    position: relative;
    isolation: isolate;
    scroll-behavior: smooth;
}

body::before,
body::after {
    content: "";
    position: fixed;
    inset: -20%;
    pointer-events: none;
    z-index: -2;
    will-change: transform, opacity;
}

body::before {
    background:
        radial-gradient(65% 60% at 30% 40%, rgba(255, 137, 196, 0.22) 0%, rgba(255, 137, 196, 0.12) 45%, transparent 80%),
        radial-gradient(60% 55% at 70% 65%, rgba(90, 220, 210, 0.2) 0%, rgba(90, 220, 210, 0.1) 45%, transparent 78%),
        radial-gradient(50% 50% at 50% 20%, rgba(130, 110, 255, 0.2) 0%, rgba(130, 110, 255, 0.08) 40%, transparent 75%);
    opacity: 0.38;
    animation: auroraShift 36s ease-in-out infinite alternate;
}

body::after {
    inset: -28%;
    background: conic-gradient(from 120deg at 35% 30%, rgba(255, 138, 196, 0.18), transparent 70%),
        radial-gradient(55% 50% at 75% 35%, rgba(90, 220, 210, 0.16) 0%, rgba(90, 220, 210, 0.08) 48%, transparent 80%);
    opacity: 0.28;
    animation: nebulaDrift 42s ease-in-out infinite alternate;
    z-index: -1;
}

.starfield {
    position: fixed;
    inset: 0;
    background-image: radial-gradient(1px 1px at 20% 30%, rgba(255, 255, 255, 0.8), transparent),
        radial-gradient(1px 1px at 80% 60%, rgba(255, 255, 255, 0.6), transparent),
        radial-gradient(1px 1px at 40% 80%, rgba(255, 255, 255, 0.7), transparent),
        radial-gradient(1px 1px at 60% 20%, rgba(255, 255, 255, 0.5), transparent),
        radial-gradient(1px 1px at 30% 50%, rgba(255, 255, 255, 0.5), transparent);
    opacity: 0.4;
    pointer-events: none;
    animation: twinkle 12s linear infinite, starDrift 120s linear infinite;
    z-index: 0;
}

@keyframes starDrift {
    0% {
        transform: translate3d(0, 0, 0);
    }
    50% {
        transform: translate3d(1.5%, -1.5%, 0);
    }
    100% {
        transform: translate3d(0, 0, 0);
    }
}

@keyframes twinkle {
    0%, 100% {
        opacity: 0.35;
    }
    50% {
        opacity: 0.55;
    }
}

@keyframes auroraShift {
    0%,
    100% {
        transform: translate3d(-3%, -2%, 0) scale(1);
        opacity: 0.34;
    }
    50% {
        transform: translate3d(3%, 2.2%, 0) scale(1.04);
        opacity: 0.48;
    }
}

@keyframes nebulaDrift {
    0% {
        transform: translate3d(-1.2%, -1.8%, 0) scale(1);
        opacity: 0.24;
    }
    50% {
        transform: translate3d(1.6%, 1.4%, 0) scale(1.03);
        opacity: 0.32;
    }
    100% {
        transform: translate3d(-1.2%, -1.8%, 0) scale(1);
        opacity: 0.24;
    }
}

.hero {
    position: relative;
    padding: 8rem 8vw 6rem;
    display: grid;
    grid-template-columns: minmax(0, 2.5fr) minmax(0, 1fr);
    gap: 3rem;
    align-items: center;
    z-index: 1;
    isolation: isolate;
    overflow: hidden;
}

.hero::before {
    content: "";
    position: absolute;
    inset: 12% 12% 10% 8%;
    background:
        radial-gradient(60% 55% at 20% 30%, rgba(255, 137, 196, 0.35) 0%, rgba(255, 137, 196, 0.15) 48%, transparent 80%),
        radial-gradient(55% 50% at 80% 40%, rgba(90, 220, 210, 0.3) 0%, rgba(90, 220, 210, 0.12) 46%, transparent 78%);
    opacity: 0.52;
    transform: translate3d(0, 0, 0);
    z-index: 0;
    animation: heroGlow 32s ease-in-out infinite alternate;
}

@keyframes heroGlow {
    0%,
    100% {
        transform: translate3d(-0.8%, -0.2%, 0) scale(1);
        opacity: 0.4;
    }
    50% {
        transform: translate3d(1.4%, -1.4%, 0) scale(1.02);
        opacity: 0.52;
    }
}

.hero__content {
    max-width: 640px;
    position: relative;
    padding: 2.8rem;
    border-radius: 2rem;
    background: linear-gradient(135deg, rgba(21, 18, 40, 0.92), rgba(13, 10, 28, 0.74));
    border: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: 0 40px 70px rgba(7, 3, 28, 0.45);
    overflow: hidden;
    isolation: isolate;
    z-index: 1;
}

.hero__content::before {
    content: "";
    position: absolute;
    inset: -30% 10% 65% -25%;
    background: radial-gradient(70% 70% at 50% 50%, rgba(255, 137, 196, 0.25) 0%, rgba(255, 137, 196, 0.08) 45%, transparent 80%);
    opacity: 0.65;
    pointer-events: none;
    z-index: 0;
}

.hero__content > * {
    position: relative;
    z-index: 1;
}

.hero__date {
    letter-spacing: 0.35em;
    text-transform: uppercase;
    color: var(--muted);
    margin-bottom: 1.5rem;
    font-size: 0.85rem;
}

.hero h1 {
    font-family: "Noto Serif SC", "Songti SC", serif;
    font-size: clamp(2.8rem, 5vw, 3.6rem);
    margin: 0 0 1rem;
    letter-spacing: 0.05em;
}

.hero__lead {
    font-size: 1.1rem;
    color: var(--muted);
    margin-bottom: 2.5rem;
}

.hero__note {
    margin: -1.2rem 0 2.2rem;
    color: rgba(248, 245, 255, 0.82);
    font-size: 1rem;
    max-width: 32rem;
}

.hero__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
}

.btn {
    padding: 0.8rem 1.6rem;
    border-radius: 999px;
    border: 1px solid transparent;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    transition: transform 160ms ease, box-shadow 160ms ease, background 160ms ease, color 160ms ease;
    font-size: 1rem;
}

.btn--primary {
    color: var(--bg);
    background: linear-gradient(135deg, var(--accent) 0%, var(--accent-strong) 100%);
    box-shadow: var(--shadow);
}

.btn--ghost {
    color: var(--accent);
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 137, 196, 0.4);
}

.btn--audio {
    color: var(--secondary);
    border-color: rgba(70, 214, 200, 0.45);
}

.btn--audio.is-playing {
    background: rgba(70, 214, 200, 0.16);
    box-shadow: 0 16px 30px rgba(70, 214, 200, 0.22);
}

.btn:hover,
.btn:focus-visible {
    transform: translateY(-2px);
    box-shadow: 0 18px 30px rgba(255, 138, 196, 0.22);
}

.btn--ghost:hover,
.btn--ghost:focus-visible {
    background: rgba(255, 255, 255, 0.12);
}

.hero__badge {
    align-self: start;
    justify-self: end;
    padding: 1.5rem 2rem;
    background: linear-gradient(150deg, rgba(26, 22, 50, 0.9), rgba(13, 10, 28, 0.72));
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 1.25rem;
    box-shadow: 0 30px 60px rgba(7, 3, 28, 0.35);
    text-align: center;
    position: relative;
    overflow: hidden;
    isolation: isolate;
    z-index: 1;
}

.hero__badge::after {
    content: "";
    position: absolute;
    inset: -40% -15% 55% 15%;
    background: radial-gradient(65% 65% at 50% 50%, rgba(255, 137, 196, 0.22) 0%, rgba(255, 137, 196, 0.08) 50%, transparent 80%);
    opacity: 0.55;
    pointer-events: none;
    z-index: 0;
}

.hero__badge > * {
    position: relative;
    z-index: 1;
}

.hero__badge-label {
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.2em;
    color: var(--muted);
}

.hero__badge-name {
    display: block;
    font-family: "Noto Serif SC", serif;
    font-size: 1.8rem;
    margin-top: 0.6rem;
}

.section {
    position: relative;
    padding: 5rem 8vw;
    z-index: 1;
}

.section--alt {
    background: rgba(255, 255, 255, 0.03);
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.section__header {
    max-width: 760px;
    margin-bottom: 3rem;
}

.section__header h2 {
    font-family: "Noto Serif SC", serif;
    font-size: clamp(2rem, 4vw, 2.6rem);
    margin: 0 0 1rem;
}

.section__header p {
    margin: 0;
    color: var(--muted);
    font-size: 1.05rem;
}

.traits-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1.6rem;
}

.trait-card {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--card-border);
    border-radius: 1.25rem;
    padding: 1.8rem;
    position: relative;
    overflow: hidden;
    transition: transform 200ms ease, border-color 200ms ease, background 200ms ease;
}

.trait-card::after {
    content: "";
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at top right, var(--card-glow), transparent 55%);
    opacity: 0;
    transition: opacity 200ms ease;
}

.trait-card:hover,
.trait-card:focus-within {
    transform: translateY(-8px);
    border-color: rgba(255, 137, 196, 0.4);
}

.trait-card:hover::after,
.trait-card:focus-within::after {
    opacity: 1;
}

.trait-card h3 {
    margin-top: 0;
    margin-bottom: 0.75rem;
    font-size: 1.2rem;
}

.trait-card p {
    margin: 0;
    color: var(--muted);
}

.mathscape {
    display: grid;
    grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr);
    gap: 2.5rem;
    align-items: center;
}

#math-canvas {
    width: 100%;
    background: rgba(7, 3, 28, 0.7);
    border-radius: 1.5rem;
    border: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: var(--shadow);
}

.mathscape__note {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 1.5rem;
    padding: 2rem;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.mathscape__note p {
    margin-top: 0;
    color: var(--muted);
}

.slider-label {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    margin-top: 1.5rem;
    font-weight: 600;
    color: var(--accent);
}

.slider-label input {
    width: 100%;
    accent-color: var(--accent);
}

.proof {
    display: grid;
    gap: 1.8rem;
}

.proof__step {
    padding: 2.2rem;
    border-radius: 1.5rem;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.08);
    position: relative;
}

.proof__step header {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
    margin-bottom: 1rem;
}

.proof__label {
    font-size: 0.75rem;
    letter-spacing: 0.3em;
    text-transform: uppercase;
    color: var(--secondary);
}

.proof__step h3 {
    margin: 0;
    font-size: 1.35rem;
}

.proof__step p {
    margin: 0;
    color: var(--muted);
}

.journey {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 1.8rem;
}

.journey__item {
    padding: 2.2rem;
    border-radius: 1.5rem;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.08);
    position: relative;
    overflow: hidden;
    transition: transform 200ms ease, border-color 200ms ease;
}

.journey__item::after {
    content: "";
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at 85% 15%, rgba(70, 214, 200, 0.28), transparent 55%);
    opacity: 0;
    transition: opacity 200ms ease;
}

.journey__item:hover,
.journey__item:focus-within {
    transform: translateY(-6px);
    border-color: rgba(70, 214, 200, 0.35);
}

.journey__item:hover::after,
.journey__item:focus-within::after {
    opacity: 1;
}

.journey__moment {
    display: inline-block;
    padding: 0.2rem 0.75rem;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.08);
    color: var(--secondary);
    letter-spacing: 0.12em;
    font-size: 0.75rem;
    text-transform: uppercase;
    margin-bottom: 1rem;
}

.journey__item header h3 {
    margin: 0 0 0.9rem;
    font-size: 1.3rem;
}

.journey__item p {
    margin: 0;
    color: var(--muted);
}

.favorites {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 1.8rem;
}

.favorite {
    padding: 2rem;
    border-radius: 1.5rem;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.08);
    min-height: 200px;
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
}

.favorite h3 {
    margin: 0;
    font-size: 1.25rem;
}

.favorite p {
    margin: 0;
    color: var(--muted);
}

.puzzle {
    max-width: 640px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 1.6rem;
    padding: 2.4rem;
    border: 1px solid rgba(255, 255, 255, 0.08);
    display: grid;
    gap: 1.6rem;
}

.puzzle__answer {
    padding: 1.4rem;
    border-radius: 1rem;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.05);
    color: var(--muted);
}

.footer {
    padding: 3rem 8vw 4rem;
    text-align: center;
    color: var(--muted);
    font-size: 0.95rem;
}

.footer__back {
    display: inline-block;
    margin-top: 1.5rem;
    color: var(--accent);
    text-decoration: none;
    font-weight: 600;
    letter-spacing: 0.1em;
}

#bg-music {
    display: none;
}

.media-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 1.8rem;
}

.media-card {
    margin: 0;
    padding: 0;
    border-radius: 1.6rem;
    overflow: hidden;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: 0 22px 44px rgba(7, 3, 28, 0.32);
    display: flex;
    flex-direction: column;
}

.media-card img,
.media-card video {
    width: 100%;
    display: block;
    object-fit: cover;
}

.media-card video {
    background: rgba(7, 3, 28, 0.65);
    aspect-ratio: 16 / 9;
}

.media-card figcaption {
    margin: 0;
    padding: 1.4rem 1.6rem 1.6rem;
    color: var(--muted);
    font-size: 0.95rem;
    line-height: 1.6;
}

.media-card--photo img {
    aspect-ratio: 3 / 2;
}

.footer__back:hover,
.footer__back:focus-visible {
    text-decoration: underline;
}

@media (max-width: 960px) {
    .hero {
        grid-template-columns: 1fr;
        padding: 6rem 6vw 4.5rem;
        gap: 2.5rem;
    }

    .hero__badge {
        justify-self: start;
        order: -1;
        margin-bottom: 2rem;
        max-width: 260px;
    }

    .hero__content {
        padding: 2.3rem;
    }

    .hero::before {
        inset: 18% 12% 16% 12%;
    }

    .mathscape {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 600px) {
    :root {
        font-size: 15px;
    }

    body::before {
        opacity: 0.36;
    }

    body::after {
        opacity: 0.26;
    }

    .section {
        padding: 3.8rem 1.5rem;
    }

    .hero {
        padding: 4.6rem 1.4rem 3.6rem;
        gap: 2rem;
    }

    .hero__note {
        margin: -0.6rem 0 1.8rem;
    }

    .hero__actions {
        flex-direction: column;
        align-items: stretch;
        gap: 0.8rem;
    }

    .btn {
        width: 100%;
        text-align: center;
    }

    .hero__content {
        padding: 1.85rem;
        border-radius: 1.6rem;
    }

    .hero::before {
        inset: 26% 18% 24% 18%;
    }

    .hero__badge {
        width: 100%;
        max-width: none;
        align-self: stretch;
        justify-self: stretch;
        margin-bottom: 1.4rem;
    }

    .hero__badge::after {
        inset: -55% -25% 45% 25%;
    }

    .hero__badge-name {
        font-size: 1.5rem;
    }

    .traits-grid {
        grid-template-columns: 1fr;
        gap: 1.2rem;
    }

    .media-grid {
        grid-template-columns: 1fr;
        gap: 1.4rem;
    }

    .section__header p {
        font-size: 1rem;
    }
}

@media (max-width: 480px) {
    :root {
        font-size: 14.5px;
    }

    .hero__date {
        font-size: 0.78rem;
        letter-spacing: 0.28em;
    }

    .hero h1 {
        font-size: clamp(2.1rem, 9vw, 2.5rem);
    }

    .hero__lead {
        font-size: 1rem;
    }

    .hero__content {
        padding: 1.65rem;
    }

    .hero__actions {
        gap: 0.6rem;
    }

    .section__header h2 {
        font-size: clamp(1.8rem, 8vw, 2.2rem);
    }

    .section__header p {
        font-size: 0.98rem;
    }
}

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

    body::before,
    body::after,
    .starfield,
    .hero::before {
        animation: none !important;
    }
}
