/* parallel.quest - Terminal Aesthetic with Dual-Pane Layout */
/* Colors from DESIGN.md:
   #0a0e14 - Abyss Navy (left pane bg)
   #080c12 - Void Indigo (right pane bg)
   #060a0e - Terminal Black (process bar)
   #7fb3d8 - Ethereal Ice (primary text)
   #4a7a9a - Frost Mist (secondary text)
   #2a4a6b - Slate Shadow (dimmed)
   #b8d8f0 - Phosphor White (cursor/highlight)
   #3d5a72 - Carrara Whisper (marble vein)
   #a0d4f0 - Cold Pulse (scan-line flash)
   #0d1219 - marble vein dark
   #111820 - marble vein medium
*/

*,
*::before,
*::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    font-size: 16px;
    -webkit-text-size-adjust: 100%;
}

body {
    font-family: 'IBM Plex Mono', monospace;
    font-weight: 400;
    font-size: clamp(13px, 1.4vw, 16px);
    line-height: 1.7;
    letter-spacing: 0.02em;
    color: #7fb3d8;
    background: #0a0e14;
    overflow: hidden;
    height: 100vh;
    width: 100vw;
}

/* Scan-line overlay */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1000;
    pointer-events: none;
    background: repeating-linear-gradient(
        to bottom,
        transparent 0px,
        transparent 1px,
        rgba(10, 14, 20, 0.15) 1px,
        rgba(10, 14, 20, 0.15) 2px
    );
}

/* Process Bar */
.process-bar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 32px;
    background: #060a0e;
    display: flex;
    align-items: center;
    padding: 0 clamp(16px, 2vw, 32px);
    z-index: 100;
    font-family: 'Space Mono', monospace;
    font-size: 12px;
    color: #4a8fa8;
    gap: 8px;
    border-bottom: 1px solid rgba(42, 74, 107, 0.3);
    cursor: pointer;
    user-select: none;
}

.process-divider {
    color: #2a4a6b;
}

.process-domain {
    color: #7fb3d8;
}

.process-uptime,
.process-progress {
    color: #4a7a9a;
}

/* Scroll Container */
.scroll-container {
    height: 100vh;
    overflow-y: auto;
    scroll-snap-type: y mandatory;
    padding-top: 32px;
    scrollbar-width: none;
}

.scroll-container::-webkit-scrollbar {
    display: none;
}

/* Snap Sections */
.snap-section {
    min-height: 100vh;
    display: grid;
    grid-template-columns: 1fr 1px 1fr;
    position: relative;
    scroll-snap-align: start;
}

/* Marble vein background */
.section-bg {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 0;
    background:
        radial-gradient(ellipse at 20% 30%, #0d1219 0%, transparent 50%),
        radial-gradient(ellipse at 70% 60%, #111820 0%, transparent 40%),
        radial-gradient(ellipse at 40% 80%, #0d1219 0%, transparent 45%),
        linear-gradient(135deg, transparent 0%, #0d1219 25%, transparent 50%, #111820 75%, transparent 100%),
        linear-gradient(160deg, #0d1219 0%, transparent 30%, #111820 60%, transparent 90%);
    opacity: 0.4;
    pointer-events: none;
}

/* Pane Divider */
.pane-divider {
    width: 1px;
    background: rgba(42, 74, 107, 0.4);
    z-index: 1;
}

/* Panes */
.pane {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: flex-start;
    padding-top: clamp(48px, 8vh, 96px);
}

.left-pane {
    background: rgba(10, 14, 20, 0.6);
}

.right-pane {
    background: rgba(8, 12, 18, 0.6);
}

.pane-content {
    padding: 0 clamp(24px, 4vw, 64px);
    width: 100%;
    opacity: 0;
    clip-path: inset(0 0 100% 0);
    transition: none;
}

.pane-content.revealed {
    animation: scanReveal 1.2s ease-out forwards;
}

.right-pane .pane-content.revealed {
    animation: scanReveal 1.2s ease-out 0.4s forwards;
}

/* Scan-line reveal animation */
@keyframes scanReveal {
    0% {
        opacity: 0;
        clip-path: inset(0 0 100% 0);
    }
    12.5% {
        opacity: 0.15;
        clip-path: inset(0 0 87.5% 0);
    }
    25% {
        opacity: 0.3;
        clip-path: inset(0 0 75% 0);
    }
    37.5% {
        opacity: 0.45;
        clip-path: inset(0 0 62.5% 0);
    }
    50% {
        opacity: 0.6;
        clip-path: inset(0 0 50% 0);
    }
    62.5% {
        opacity: 0.7;
        clip-path: inset(0 0 37.5% 0);
    }
    75% {
        opacity: 0.8;
        clip-path: inset(0 0 25% 0);
    }
    87.5% {
        opacity: 0.9;
        clip-path: inset(0 0 12.5% 0);
    }
    100% {
        opacity: 1;
        clip-path: inset(0 0 0% 0);
    }
}

/* Right pane offset */
.right-pane .pane-content {
    transform: translateY(15vh);
}

/* Section Headers */
.section-header {
    font-family: 'IBM Plex Mono', monospace;
    font-weight: 600;
    font-size: clamp(20px, 3vw, 36px);
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: #7fb3d8;
    margin-bottom: 2em;
    line-height: 1.3;
}

.section-num {
    color: #3a5f7f;
    margin-right: 0.5em;
}

/* Terminal Lines */
.terminal-line {
    margin-bottom: 1.5em;
    color: #7fb3d8;
    max-width: 60ch;
}

.prompt {
    font-family: 'Space Mono', monospace;
    font-size: 12px;
    color: #4a8fa8;
    user-select: none;
}

/* Blinking Cursor */
.cursor {
    display: inline-block;
    width: 2px;
    height: 1.2em;
    background: #b8d8f0;
    vertical-align: text-bottom;
    animation: cursorBlink 1s step-end infinite;
}

@keyframes cursorBlink {
    0%, 50% {
        opacity: 1;
    }
    50.01%, 100% {
        opacity: 0;
    }
}

/* Right Pane Annotations */
.annotation {
    font-family: 'IBM Plex Mono', monospace;
    font-weight: 300;
    color: #4a7a9a;
    margin-bottom: 1.2em;
    font-size: clamp(12px, 1.2vw, 14px);
}

.final-annotation {
    margin-top: 2em;
    color: #3d5a72;
}

/* Glyph Grids */
.glyph-grid {
    margin: 2em 0;
}

.glyph-art {
    font-family: 'IBM Plex Mono', monospace;
    color: #2a4a6b;
    font-size: 14px;
    line-height: 1.5;
    letter-spacing: 0.05em;
}

/* Section-specific marble vein variations */
.snap-section[data-section='2'] .section-bg {
    background:
        radial-gradient(ellipse at 60% 20%, #111820 0%, transparent 45%),
        radial-gradient(ellipse at 30% 70%, #0d1219 0%, transparent 50%),
        linear-gradient(145deg, #111820 0%, transparent 40%, #0d1219 70%, transparent 100%);
    opacity: 0.35;
}

.snap-section[data-section='3'] .section-bg {
    background:
        radial-gradient(ellipse at 80% 40%, #0d1219 0%, transparent 55%),
        radial-gradient(ellipse at 15% 60%, #111820 0%, transparent 40%),
        linear-gradient(125deg, transparent 0%, #111820 35%, transparent 65%, #0d1219 85%, transparent 100%);
    opacity: 0.3;
}

.snap-section[data-section='4'] .section-bg {
    background:
        radial-gradient(ellipse at 50% 50%, #111820 0%, transparent 50%),
        radial-gradient(ellipse at 10% 20%, #0d1219 0%, transparent 45%),
        linear-gradient(155deg, #0d1219 0%, transparent 45%, #111820 80%, transparent 100%);
    opacity: 0.4;
}

.snap-section[data-section='5'] .section-bg {
    background:
        radial-gradient(ellipse at 25% 45%, #0d1219 0%, transparent 50%),
        radial-gradient(ellipse at 75% 25%, #111820 0%, transparent 45%),
        radial-gradient(ellipse at 50% 75%, #0d1219 0%, transparent 40%),
        linear-gradient(140deg, #111820 0%, transparent 30%, #0d1219 55%, transparent 85%);
    opacity: 0.35;
}

/* Transition flash effect */
.snap-section.flash-active .pane-content {
    text-shadow: 0 0 8px rgba(160, 212, 240, 0.3);
}

/* Mobile: single column layout */
@media (max-width: 768px) {
    .snap-section {
        grid-template-columns: 1fr;
        grid-template-rows: auto auto;
    }

    .pane-divider {
        display: none;
    }

    .right-pane .pane-content {
        transform: translateY(0);
        opacity: 0.6;
        border-left: 2px solid #2a4a6b;
        margin-left: clamp(12px, 2vw, 24px);
        padding-left: clamp(16px, 3vw, 32px);
    }

    .right-pane .pane-content.revealed {
        animation: scanRevealMobile 1s ease-out 0.3s forwards;
    }

    @keyframes scanRevealMobile {
        0% {
            opacity: 0;
            clip-path: inset(0 0 100% 0);
        }
        100% {
            opacity: 0.6;
            clip-path: inset(0 0 0% 0);
        }
    }

    .process-bar {
        font-size: 10px;
        gap: 4px;
        padding: 0 8px;
        overflow-x: auto;
        white-space: nowrap;
    }
}
