/* ===== Reset & Base ===== */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    overflow-y: hidden;
    overflow-x: hidden;
    scrollbar-width: none;
}

html::-webkit-scrollbar {
    display: none;
}

body {
    background: #0a0f1e;
    color: #8b9dc3;
    font-family: 'Nunito Sans', sans-serif;
    font-weight: 400;
    font-size: clamp(0.95rem, 1.2vw, 1.15rem);
    line-height: 1.7;
    overflow-x: auto;
    overflow-y: hidden;
    scroll-snap-type: x mandatory;
    scroll-behavior: smooth;
    scrollbar-width: none;
}

body::-webkit-scrollbar {
    display: none;
}

/* ===== Scroll Wrapper ===== */
#scroll-wrapper {
    display: flex;
    width: 600vw;
    height: 100vh;
}

/* ===== Panel Base ===== */
.panel {
    position: relative;
    width: 100vw;
    height: 100vh;
    flex-shrink: 0;
    scroll-snap-align: start;
    overflow: hidden;
    perspective: 1000px;
}

.panel-canvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    pointer-events: none;
}

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

/* ===== Panel Backgrounds ===== */
#panel-1 {
    background: linear-gradient(90deg, #0a0f1e 0%, #121a32 60%, #1c2a4a 100%);
}

#panel-2 {
    background: linear-gradient(90deg, #1c2a4a 0%, #121a32 50%, #0a0f1e 100%);
}

#panel-3 {
    background: linear-gradient(90deg, #0a0f1e 0%, #121a32 40%, #1c2a4a 100%);
}

#panel-4 {
    background: #0a0f1e;
}

#panel-5 {
    background: linear-gradient(90deg, #0a0f1e 0%, #1a3a2e 30%, #121a32 70%, #0a0f1e 100%);
}

#panel-6 {
    background: linear-gradient(90deg, #0a0f1e 0%, #1a3a2e 20%, #121a32 60%, #1c2a4a 100%);
}

/* ===== Typography ===== */
.panel-title {
    font-family: 'Commissioner', sans-serif;
    font-weight: 300;
    font-variation-settings: 'wght' 300;
    font-size: clamp(2.5rem, 5vw, 4.5rem);
    color: #e8edf5;
    letter-spacing: 0.08em;
    transition: font-variation-settings 600ms ease-in-out, letter-spacing 600ms ease-in-out;
    cursor: default;
}

.panel-title:hover {
    font-variation-settings: 'wght' 500;
    letter-spacing: 0.02em;
}

.panel-subtitle {
    font-family: 'Nunito Sans', sans-serif;
    font-weight: 400;
    color: #8b9dc3;
    font-size: clamp(0.95rem, 1.2vw, 1.15rem);
    line-height: 1.7;
    margin-top: 1rem;
    max-width: 32rem;
}

.panel-number {
    font-family: 'IBM Plex Mono', monospace;
    font-weight: 400;
    font-size: 0.75rem;
    letter-spacing: 0.12em;
    color: #34d5c8;
    display: block;
    margin-bottom: 0.75rem;
}

/* ===== Panel Text Block (no frame) ===== */
.panel-text-block {
    text-align: center;
    transform: translateZ(60px);
}

.void-text {
    opacity: 0.7;
}

/* ===== Retro Frame ===== */
.retro-frame {
    position: relative;
    padding: 3rem 4rem;
    border-radius: 12px;
    box-shadow: inset 0 0 20px rgba(52, 213, 200, 0.08);
    background: rgba(10, 15, 30, 0.6);
    max-width: 36rem;
    transform: translateZ(60px);
}

.frame-border {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 2;
}

.frame-border rect {
    fill: none;
    stroke: rgba(52, 213, 200, 0.7);
    stroke-width: 2;
    filter: drop-shadow(0 0 6px rgba(52, 213, 200, 0.4));
    stroke-dasharray: 2000;
    stroke-dashoffset: 2000;
    transition: stroke-dashoffset 1.2s ease-in-out;
}

.panel.active .frame-border rect {
    stroke-dashoffset: 0;
}

.frame-dots {
    position: absolute;
    top: 12px;
    left: 16px;
    display: flex;
    gap: 6px;
    z-index: 3;
}

.dot {
    width: 4px;
    height: 4px;
    border-radius: 50%;
}

.dot-cyan {
    background: #34d5c8;
}

.dot-gold {
    background: #c9a84c;
}

.dot-teal {
    background: #2a9d8f;
}

.frame-inner {
    position: relative;
    z-index: 1;
}

/* ===== Progress Bar ===== */
#progress-bar {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 3px;
    background: #0a0f1e;
    z-index: 100;
}

#progress-fill {
    height: 100%;
    width: 0%;
    background: #34d5c8;
    filter: drop-shadow(0 0 4px rgba(52, 213, 200, 0.6));
    transition: width 0.3s ease-out;
}

.diamond {
    position: absolute;
    bottom: -4px;
    width: 8px;
    height: 8px;
    background: #c9a84c;
    transform: rotate(45deg);
    z-index: 101;
    opacity: 0.6;
    transition: opacity 0.3s, transform 0.3s;
}

.diamond.active {
    opacity: 1;
    animation: diamond-pulse 2s ease-in-out infinite;
}

.diamond[data-panel="0"] { left: calc(100% / 12); }
.diamond[data-panel="1"] { left: calc(300% / 12); }
.diamond[data-panel="2"] { left: calc(500% / 12); }
.diamond[data-panel="3"] { left: calc(700% / 12); }
.diamond[data-panel="4"] { left: calc(900% / 12); }
.diamond[data-panel="5"] { left: calc(1100% / 12); }

@keyframes diamond-pulse {
    0%, 100% {
        transform: rotate(45deg) scale(1);
        box-shadow: 0 0 4px rgba(201, 168, 76, 0.4);
    }
    50% {
        transform: rotate(45deg) scale(1.3);
        box-shadow: 0 0 8px rgba(201, 168, 76, 0.7);
    }
}

/* ===== Scroll Prompt ===== */
#scroll-prompt {
    position: fixed;
    bottom: 2rem;
    right: 3rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    z-index: 99;
    animation: prompt-fade 2.5s ease-in-out infinite;
    transition: opacity 0.6s ease-out;
}

#scroll-prompt.hidden {
    opacity: 0;
    pointer-events: none;
}

.prompt-text {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 0.75rem;
    letter-spacing: 0.12em;
    color: #34d5c8;
    opacity: 0.7;
}

.chevron {
    animation: chevron-shift 2.5s ease-in-out infinite;
}

@keyframes prompt-fade {
    0%, 100% { opacity: 0.4; }
    50% { opacity: 1; }
}

@keyframes chevron-shift {
    0%, 100% { transform: translateX(0); }
    50% { transform: translateX(6px); }
}

/* ===== Nature: Water Lines ===== */
.water-lines {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    pointer-events: none;
}

.water-line {
    fill: none;
    stroke: rgba(52, 213, 200, 0.3);
    stroke-width: 1.5;
}

.water-line-1 {
    animation: water-drift 8s linear infinite;
}

.water-line-2 {
    animation: water-drift 12s linear infinite;
    opacity: 0.6;
}

.water-line-3 {
    animation: water-drift 16s linear infinite;
    opacity: 0.4;
}

@keyframes water-drift {
    0% { transform: translateX(0); }
    100% { transform: translateX(100px); }
}

/* ===== Nature: Fern Overlay ===== */
.fern-overlay {
    position: absolute;
    bottom: 0;
    left: 5%;
    width: 20%;
    height: 60%;
    z-index: 0;
    pointer-events: none;
}

.fern-frond {
    fill: none;
    stroke: #2a9d8f;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-dasharray: 500;
    stroke-dashoffset: 500;
    filter: drop-shadow(2px 4px 3px rgba(26, 58, 46, 0.5));
}

.panel.active .fern-frond {
    animation: fern-unfurl 2s ease-out forwards;
}

@keyframes fern-unfurl {
    to {
        stroke-dashoffset: 0;
    }
}

.panel.active .fern-2 { animation-delay: 0.2s; }
.panel.active .fern-3 { animation-delay: 0.2s; }
.panel.active .fern-4 { animation-delay: 0.5s; }
.panel.active .fern-5 { animation-delay: 0.5s; }
.panel.active .fern-6 { animation-delay: 0.8s; }
.panel.active .fern-7 { animation-delay: 0.8s; }

/* ===== Panel-specific depth ===== */
#panel-1 .panel-content { transform: translateZ(0); }
#panel-4 .panel-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

/* ===== Final Frame Extras ===== */
.final-frame {
    background: rgba(10, 15, 30, 0.7);
}

.final-frame .panel-subtitle {
    color: #34d5c8;
    font-weight: 600;
}
