/* ===== Global Reset ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --dream-blue: #7eaeff;
    --dream-light: #d8e8ff;
    --dream-white: #ffffff;
    --dream-dark: #0a0f1a;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Helvetica Neue', 'Arial', sans-serif;
    background: #000;
    color: var(--dream-white);
}

/* ===== Music control - always top-right ===== */
.music-control {
    position: fixed;
    top: 2rem;
    right: 2.5rem;
    z-index: 1000;
}

.music-icon {
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(10px);
    cursor: pointer;
    transition: all 0.3s;
    color: rgba(255, 255, 255, 0.85);
}

.music-icon:hover {
    background: rgba(255, 255, 255, 0.15);
    border-color: rgba(255, 255, 255, 0.4);
}

.music-icon.playing {
    animation: spin-slow 8s linear infinite;
}

@keyframes spin-slow {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.music-panel {
    position: absolute;
    top: 60px;
    right: 0;
    width: 280px;
    padding: 1.2rem;
    background: rgba(10, 15, 26, 0.9);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 12px;
    backdrop-filter: blur(20px);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.3s ease;
}

.music-control:hover .music-panel {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.slider-row {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    margin-bottom: 0.8rem;
}

.slider-row:last-child {
    margin-bottom: 0;
}

.slider-label {
    font-size: 0.75rem;
    letter-spacing: 0.1em;
    color: rgba(255, 255, 255, 0.5);
    min-width: 2.5rem;
}

.slider {
    flex: 1;
    -webkit-appearance: none;
    appearance: none;
    height: 3px;
    background: rgba(255, 255, 255, 0.15);
    border-radius: 2px;
    outline: none;
    cursor: pointer;
}

.slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 12px;
    height: 12px;
    background: #fff;
    border-radius: 50%;
    cursor: pointer;
    transition: transform 0.2s;
}

.slider::-webkit-slider-thumb:hover {
    transform: scale(1.3);
}

.slider::-moz-range-thumb {
    width: 12px;
    height: 12px;
    background: #fff;
    border: none;
    border-radius: 50%;
    cursor: pointer;
}

/* ===== HERO: Misty room + mist-erase ===== */
#hero {
    position: relative;
    width: 100%;
    height: 100vh;
    overflow: hidden;
    background: #000;
    display: flex;
    align-items: center;
    justify-content: center;
}

#hero-image {
    position: absolute;
    inset: 0;
    background-image: url("other/zhonghui778954_67406_an_empty_pale_room_with_a_single_long_whit_b39410cf-dd50-401f-8be0-0fa3cfc57647.png");
    background-size: cover;
    background-position: center;
}

#fog-canvas {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    display: block;
    cursor: crosshair;
    touch-action: none;
}

.hero-content {
    position: relative;
    z-index: 2;
    text-align: center;
    pointer-events: none;
    padding: 4rem 3rem;
}

/* Soft radial halo lifts the text off the pale mist for clean contrast */
.hero-content::before {
    content: "";
    position: absolute;
    inset: 0;
    z-index: -1;
    background: radial-gradient(ellipse 70% 60% at center,
        rgba(20, 30, 50, 0.28) 0%,
        rgba(20, 30, 50, 0.12) 45%,
        rgba(20, 30, 50, 0) 75%);
    filter: blur(20px);
}

.hero-title {
    font-size: clamp(2.5rem, 7vw, 4.5rem);
    font-weight: 100;
    letter-spacing: 0.5em;
    color: rgba(255, 255, 255, 0.98);
    text-shadow: 0 4px 60px rgba(0, 0, 0, 0.15);
    animation: float-slow 8s ease-in-out infinite;
}

@keyframes float-slow {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-12px); }
}

.hero-subtitle {
    position: relative;
    font-size: clamp(0.85rem, 1.5vw, 1.05rem);
    font-weight: 300;
    font-style: italic;
    letter-spacing: 0.08em;
    margin-top: 1.4rem;
    padding-top: 1.4rem;
    color: rgba(255, 255, 255, 0.92);
    text-shadow: 0 2px 30px rgba(0, 0, 0, 0.25);
}

.hero-subtitle::before {
    content: "";
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 40px;
    height: 1px;
    background: rgba(255, 255, 255, 0.5);
}

.hero-hint {
    font-size: 0.72rem;
    font-weight: 400;
    letter-spacing: 0.35em;
    margin-top: 2rem;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.55);
    text-shadow: 0 2px 20px rgba(0, 0, 0, 0.25);
}

@keyframes hint-pulse {
    0%, 100% { opacity: 0.35; }
    50% { opacity: 0.75; }
}

.scroll-hint {
    position: absolute;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%);
    font-size: 1.5rem;
    color: rgba(255, 255, 255, 0.7);
    z-index: 2;
    animation: bounce 2s ease-in-out infinite;
}

@keyframes bounce {
    0%, 100% { transform: translateX(-50%) translateY(0); }
    50% { transform: translateX(-50%) translateY(10px); }
}

/* ===== Instructions Section ===== */
#instructions {
    position: relative;
    min-height: 100vh;
    color: #1a1a1a;
    padding: 6rem 2rem;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden;
    background-color: #eef1f4;
}

#instructions .instructions-bg {
    position: absolute;
    inset: 0;
    background-image: url("other/zhonghui778954_67406_a_quiet_surreal_sky_filled_with_a_few_ordi_179e23c1-74a7-459d-8bb4-d82623826dab.png");
    background-size: cover;
    background-position: center;
    filter: blur(6px) brightness(1.08);
    transform: scale(1.06);
    opacity: 0.55;
}

/* Soft veils to melt the section into the black sections above/below */
#instructions::before,
#instructions::after {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    height: 22vh;
    z-index: 1;
    pointer-events: none;
}

#instructions::before {
    top: 0;
    background: linear-gradient(to bottom, #000 0%, rgba(0, 0, 0, 0) 100%);
}

#instructions::after {
    bottom: 0;
    background: linear-gradient(to top, #000 0%, rgba(0, 0, 0, 0) 100%);
}

.instructions-content {
    position: relative;
    z-index: 2;
    max-width: 720px;
    width: 100%;
    max-height: 68vh;
    overflow-y: auto;
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
    padding: 3rem 2.5rem;
    -webkit-mask-image: linear-gradient(to bottom, transparent 0, #000 15%, #000 85%, transparent 100%);
    mask-image: linear-gradient(to bottom, transparent 0, #000 15%, #000 85%, transparent 100%);
    /* Hide scrollbar in all browsers while keeping scroll functional */
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.instructions-content::-webkit-scrollbar {
    display: none;
    width: 0;
    height: 0;
}

.section-title {
    font-size: 2rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    margin-bottom: 2rem;
    margin-top: 4rem;
}

.section-title:first-child {
    margin-top: 0;
}

.requirement-list {
    margin-bottom: 2rem;
}

.req-item {
    display: flex;
    gap: 3rem;
    margin-bottom: 1rem;
    font-size: 1rem;
    line-height: 1.6;
}

.req-label {
    min-width: 150px;
    color: #222;
}

.req-text {
    color: #333;
}

.method-content {
    margin-top: 1rem;
}

.method-step {
    margin-bottom: 3rem;
    font-size: 1rem;
    line-height: 1.8;
    color: #222;
    letter-spacing: 0.01em;
}

/* ===== Series Entrance ===== */
#series-entrance {
    position: relative;
    min-height: 100vh;
    background: #000;
    padding: 8rem 2rem;
    display: flex;
    flex-direction: column;
    align-items: center;
}

/* Soft veil at top to blend from instructions (black-to-black seam) */
#series-entrance::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 30vh;
    background: linear-gradient(to bottom, #000 0%, rgba(0, 0, 0, 0) 100%);
    pointer-events: none;
    z-index: 1;
}

#series-entrance .section-title {
    position: relative;
    z-index: 2;
    color: #fff;
    text-align: center;
    letter-spacing: 0.3em;
    font-weight: 300;
    margin-bottom: 4rem;
}

.series-grid {
    position: relative;
    z-index: 2;
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 2.5rem;
    max-width: 1000px;
    width: 100%;
}

.series-card {
    position: relative;
    cursor: pointer;
    overflow: hidden;
    border-radius: 8px;
    aspect-ratio: 4 / 3;
    transition: transform 0.5s cubic-bezier(0.22, 1, 0.36, 1),
                box-shadow 0.5s cubic-bezier(0.22, 1, 0.36, 1);
    will-change: transform;
}

.series-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.55);
}

.series-preview {
    position: absolute;
    inset: 0;
    overflow: hidden;
}

.series-preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.6s ease, filter 0.4s ease;
    filter: brightness(0.7);
}

.series-card:hover .series-preview img {
    transform: scale(1.08);
    filter: brightness(0.9);
}

.series-title {
    position: absolute;
    bottom: 1.5rem;
    left: 1.5rem;
    z-index: 2;
    font-size: 1.5rem;
    font-weight: 300;
    letter-spacing: 0.25em;
    color: #fff;
    text-shadow: 0 2px 20px rgba(0, 0, 0, 0.8);
}

/* ===== Gallery Overlay ===== */
.gallery-overlay {
    position: fixed;
    inset: 0;
    z-index: 900;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.6s ease, visibility 0.6s ease;
}

.gallery-overlay.active {
    opacity: 1;
    visibility: visible;
}

.gallery-bg {
    position: absolute;
    inset: -5%;
    width: 110%;
    height: 110%;
    background-size: cover;
    background-position: center;
    filter: blur(30px) brightness(0.35);
    transition: background-image 0.6s ease;
    transform: scale(1.1);
}

.gallery-close {
    position: fixed;
    top: 2rem;
    left: 2.5rem;
    z-index: 950;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(10px);
    color: #fff;
    font-size: 1.2rem;
    cursor: pointer;
    transition: all 0.3s;
}

.gallery-close:hover {
    background: rgba(255, 255, 255, 0.18);
    transform: rotate(90deg);
}

.gallery-container {
    position: relative;
    z-index: 910;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.gallery-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    max-width: 80%;
    max-height: 85vh;
    text-align: center;
    will-change: transform, opacity;
    backface-visibility: hidden;
}

.gallery-image {
    max-width: 100%;
    max-height: 70vh;
    object-fit: contain;
    border-radius: 4px;
    box-shadow: 0 10px 60px rgba(0, 0, 0, 0.7);
}

.gallery-caption {
    margin-top: 1.8rem;
    max-width: 640px;
    font-size: 0.95rem;
    line-height: 1.7;
    font-weight: 300;
    letter-spacing: 0.03em;
    color: rgba(255, 255, 255, 0.85);
}

.gallery-nav {
    position: fixed;
    top: 50%;
    transform: translateY(-50%);
    font-size: 3rem;
    color: rgba(255, 255, 255, 0.5);
    background: none;
    border: none;
    cursor: pointer;
    padding: 1rem;
    line-height: 1;
    z-index: 920;
    transition: color 0.3s, transform 0.3s;
}

.gallery-nav:hover {
    color: #fff;
}

.gallery-prev { left: 1.5rem; }
.gallery-prev:hover { transform: translateY(-50%) translateX(-5px); }
.gallery-next { right: 1.5rem; }
.gallery-next:hover { transform: translateY(-50%) translateX(5px); }

.gallery-counter {
    position: fixed;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%);
    z-index: 920;
    font-size: 0.85rem;
    letter-spacing: 0.2em;
    color: rgba(255, 255, 255, 0.6);
}

/* ===== Responsive ===== */
@media (max-width: 768px) {
    .music-control { top: 1rem; right: 1rem; }
    .gallery-close { top: 1rem; left: 1rem; }
    .series-grid { grid-template-columns: 1fr; }
    #instructions { padding: 4rem 1.5rem; }
    .instructions-content { max-height: 75vh; padding: 1.5rem; }
    .req-item { flex-direction: column; gap: 0.3rem; }
    .req-label { min-width: auto; }
    .gallery-nav { font-size: 2rem; }
    .gallery-content { max-width: 92%; }
}
