/* ======================================================
   aiice.quest -- Ethereal Blue Pixel Dreamscape
   ====================================================== */

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

html {
    scroll-behavior: smooth;
    overflow-x: hidden;
}

body {
    background: #0a0a1a;
    color: #c8e0ff;
    font-family: 'Caveat', cursive;
    font-size: 22px;
    line-height: 1.65;
    overflow-x: hidden;
}

/* --- Scene (full-viewport section) --- */
.scene {
    position: relative;
    width: 100vw;
    min-height: 100vh;
    overflow: hidden;
    border-bottom: 4px solid #1a1a3e;
    background: #0f1029;
}

#title-gate {
    background: #0a0a1a;
}

#signal-band {
    background: #0a0a1a;
    border-bottom: none;
}

/* --- Star Field --- */
.star-field {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
}

/* --- Aurora Container --- */
.aurora-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 40%;
    pointer-events: none;
    z-index: 1;
    overflow: hidden;
}

/* --- Aurora Bands --- */
.aurora-band {
    position: absolute;
    width: 120%;
    left: -10%;
    height: 4px;
    filter: blur(40px);
    opacity: 0.7;
}

.aurora-band-1 {
    top: 20%;
    background: linear-gradient(90deg, transparent, #3b82f6 30%, #3b82f6 70%, transparent);
    filter: blur(48px);
    animation: aurora-wave-1 12s ease-in-out infinite;
}

.aurora-band-2 {
    top: 30%;
    background: linear-gradient(90deg, transparent, #22d3a0 30%, #22d3a0 70%, transparent);
    filter: blur(40px);
    animation: aurora-wave-2 18s ease-in-out infinite;
}

.aurora-band-3 {
    top: 25%;
    background: linear-gradient(90deg, transparent, #8b5cf6 30%, #8b5cf6 70%, transparent);
    filter: blur(56px);
    animation: aurora-wave-3 25s ease-in-out infinite;
}

.aurora-band-4 {
    top: 35%;
    background: linear-gradient(90deg, transparent, #ec4899 30%, #ec4899 70%, transparent);
    filter: blur(36px);
    animation: aurora-wave-4 15s ease-in-out infinite;
}

.aurora-band-5 {
    top: 15%;
    background: linear-gradient(90deg, transparent, #3b82f6 20%, #22d3a0 50%, #8b5cf6 80%, transparent);
    filter: blur(60px);
    opacity: 0.4;
    animation: aurora-wave-5 22s ease-in-out infinite;
}

@keyframes aurora-wave-1 {
    0%, 100% { transform: translateY(-20px) translateX(0); }
    25% { transform: translateY(16px) translateX(-8px); }
    50% { transform: translateY(-8px) translateX(16px); }
    75% { transform: translateY(20px) translateX(-16px); }
}

@keyframes aurora-wave-2 {
    0%, 100% { transform: translateY(16px) translateX(8px); }
    33% { transform: translateY(-16px) translateX(-16px); }
    66% { transform: translateY(8px) translateX(24px); }
}

@keyframes aurora-wave-3 {
    0%, 100% { transform: translateY(-12px) translateX(-8px); }
    50% { transform: translateY(20px) translateX(16px); }
}

@keyframes aurora-wave-4 {
    0%, 100% { transform: translateY(8px); }
    50% { transform: translateY(-20px); }
}

@keyframes aurora-wave-5 {
    0%, 100% { transform: translateY(-16px) translateX(8px); }
    33% { transform: translateY(12px) translateX(-24px); }
    66% { transform: translateY(-8px) translateX(16px); }
}

/* ===================================
   SECTION 1: Title Gate
   =================================== */

#title-gate .star-field {
    opacity: 0;
    transition: opacity 1s ease;
}

#title-gate .aurora-container {
    opacity: 0;
    transition: opacity 2s ease 0.3s;
    height: 60%;
}

#title-gate.loaded .star-field {
    opacity: 1;
}

#title-gate.loaded .aurora-container {
    opacity: 1;
}

.title-container {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 10;
    text-align: center;
}

.title-logotype {
    font-family: 'Silkscreen', cursive;
    font-size: 48px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #c8e0ff;
    opacity: 0;
    transition: opacity 1.5s ease;
    position: relative;
    z-index: 2;
}

#title-gate.loaded .title-logotype {
    opacity: 1;
}

.lens-flare {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 0;
    height: 0;
    border-radius: 50%;
    background: radial-gradient(circle, #ffffff 0%, #3b82f6 20%, rgba(59, 130, 246, 0.3) 40%, transparent 60%);
    opacity: 0;
    pointer-events: none;
    z-index: 1;
}

#title-gate.loaded .lens-flare {
    width: 400px;
    height: 400px;
    opacity: 0.2;
    transition: width 1.5s ease, height 1.5s ease, opacity 1.5s ease;
}

.scroll-arrow {
    position: absolute;
    bottom: 80px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 10;
    opacity: 0;
    transition: opacity 0.6s ease;
}

#title-gate.loaded .scroll-arrow {
    opacity: 1;
}

.scroll-arrow-inner {
    display: block;
    animation: arrow-bounce 1.5s ease-in-out infinite;
}

.arrow-icon {
    font-family: 'Press Start 2P', cursive;
    font-size: 12px;
    color: #4a6fa5;
    display: block;
    animation: arrow-bounce 1.5s ease-in-out infinite;
}

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

/* ===================================
   SECTION 2: Manifesto Band
   =================================== */

#manifesto-band {
    display: flex;
    align-items: center;
    justify-content: center;
    background: #0f1029;
}

.manifesto-column {
    position: relative;
    z-index: 10;
    max-width: 720px;
    padding: 32px;
    margin: 0 auto;
}

.manifesto-paragraph {
    font-family: 'Caveat', cursive;
    font-size: 22px;
    font-weight: 400;
    line-height: 1.65;
    color: #e8f0ff;
    margin-bottom: 32px;
    opacity: 0;
    transform: translateY(16px);
    clip-path: inset(0 100% 0 0);
    transition: opacity 0.6s ease, transform 0.6s ease, clip-path 1.2s ease;
}

.manifesto-paragraph.visible {
    opacity: 1;
    transform: translateY(0);
    clip-path: inset(0 0 0 0);
}

/* ===================================
   SECTION 3: Showcase Triptych
   =================================== */

#showcase-triptych {
    display: flex;
    align-items: stretch;
    background: #0f1029;
}

.triptych-container {
    position: relative;
    z-index: 10;
    display: flex;
    width: 100%;
    min-height: 100vh;
}

.triptych-column {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    position: relative;
    padding: 24px;
    opacity: 0;
    transform: translateY(32px);
    transition: opacity 0.8s ease, transform 0.8s ease;
}

.triptych-column.visible {
    opacity: 1;
    transform: translateY(0);
}

.triptych-border-left {
    position: absolute;
    top: 0;
    left: 0;
    width: 2px;
    height: 100%;
    background: #1a1a3e;
    transform: scaleY(0);
    transform-origin: top;
    transition: transform 0.8s ease;
}

.triptych-column:first-child .triptych-border-left {
    display: none;
}

.triptych-column.visible .triptych-border-left {
    transform: scaleY(1);
}

.sprite-container {
    width: 256px;
    height: 256px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 24px;
}

.sprite-canvas {
    width: 256px;
    height: 256px;
    image-rendering: pixelated;
    image-rendering: crisp-edges;
}

.triptych-caption {
    font-family: 'Caveat', cursive;
    font-size: 22px;
    font-weight: 400;
    color: #e8f0ff;
    text-align: center;
    line-height: 1.65;
}

/* ===================================
   SECTION 4: Data Horizon
   =================================== */

#data-horizon {
    display: flex;
    align-items: center;
    justify-content: center;
    background: #0a0a1a;
}

.horizon-container {
    position: relative;
    z-index: 10;
    width: 100%;
    height: 100vh;
    overflow: hidden;
}

#horizon-canvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    image-rendering: pixelated;
    image-rendering: crisp-edges;
    opacity: 0;
    transition: opacity 1s ease;
}

#data-horizon.active #horizon-canvas {
    opacity: 1;
}

.horizon-labels {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

.horizon-label {
    position: absolute;
    font-family: 'Press Start 2P', cursive;
    font-size: 10px;
    color: #4a6fa5;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    transform: scale(0);
    transition: transform 0.3s ease;
    white-space: nowrap;
}

#data-horizon.active .horizon-label {
    transform: scale(1);
}

/* ===================================
   SECTION 5: Signal Band
   =================================== */

#signal-band {
    display: flex;
    align-items: center;
    justify-content: center;
}

.signal-content {
    position: relative;
    z-index: 10;
    text-align: center;
}

.signal-phrase {
    font-family: 'Caveat', cursive;
    font-size: 32px;
    font-weight: 700;
    color: #e8f0ff;
    letter-spacing: 0.04em;
    opacity: 0;
    transition: opacity 1s ease;
}

#signal-band.active .signal-phrase {
    opacity: 1;
}

#signal-flare {
    width: 0;
    height: 0;
    opacity: 0;
    border-radius: 50%;
    background: radial-gradient(circle, #ffffff 0%, #3b82f6 20%, rgba(59, 130, 246, 0.2) 40%, transparent 60%);
}

#signal-band.active #signal-flare {
    width: 320px;
    height: 320px;
    transition: width 1.5s ease, height 1.5s ease;
}

@keyframes signal-flare-pulse {
    0% { opacity: 0; }
    30% { opacity: 0.4; }
    100% { opacity: 0.15; }
}

@keyframes signal-flare-breathe {
    0%, 100% { opacity: 0.12; }
    50% { opacity: 0.22; }
}

/* ===================================
   Twinkle Animation for Star Fields
   =================================== */

@keyframes twinkle-1 {
    0%, 100% { opacity: 0.3; }
    50% { opacity: 0.8; }
}

@keyframes twinkle-2 {
    0%, 100% { opacity: 0.5; }
    50% { opacity: 0.9; }
}

@keyframes twinkle-3 {
    0%, 100% { opacity: 0.4; }
    50% { opacity: 0.7; }
}

/* ===================================
   Mobile Responsive
   =================================== */

@media (max-width: 768px) {
    body {
        font-size: 18px;
    }

    .title-logotype {
        font-size: 32px;
    }

    .manifesto-paragraph {
        font-size: 18px;
    }

    .triptych-container {
        flex-direction: column;
    }

    .triptych-column {
        min-height: 33.33vh;
    }

    .triptych-border-left {
        top: 0;
        left: 0;
        width: 100%;
        height: 2px;
        transform: scaleX(0);
        transform-origin: left;
    }

    .triptych-column.visible .triptych-border-left {
        transform: scaleX(1);
    }

    .sprite-container {
        width: 192px;
        height: 192px;
    }

    .sprite-canvas {
        width: 192px;
        height: 192px;
    }

    .signal-phrase {
        font-size: 24px;
        padding: 0 32px;
    }

    .horizon-label {
        font-size: 8px;
    }

    #title-gate.loaded .lens-flare {
        width: 256px;
        height: 256px;
    }
}
