/* ============================================================
   layer-2.quest — Styles
   Parallax Storytelling Journey through Blockchain Architecture
   ============================================================ */

/* --- Design Palette Reference ---
   #06060C  Deepest Black (Background Layer 1)
   #0A1428  Midnight Blue (Background Layer 2)
   #141432  Deep Indigo (Background Layer 3)
   #FFFFFF  White (Text Primary)
   #B8B8C8  Cool Silver (Text Secondary)
   #7C5CFC  Electric Violet (Accent Primary)
   #00E5FF  Neon Cyan (Accent Secondary)
   #FF8C42  Solar Orange (Accent Warm)
   #2A2050  Dim Violet (Depth Line)
   #0A0A14  Dark Base (Text on light)
   ---------------------------------------- */

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

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

body {
    background: #06060C;
    color: #FFFFFF;
    font-family: 'IBM Plex Sans', sans-serif;
    font-weight: 400;
    font-size: 16px;
    line-height: 1.75;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* --- Typography --- */
h1, h2, h3 {
    font-family: 'Syne', sans-serif;
    font-weight: 700;
    letter-spacing: 0.04em;
    color: #FFFFFF;
}

.section-label {
    font-family: 'IBM Plex Mono', monospace;
    font-weight: 400;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #7C5CFC;
    margin-bottom: 16px;
}

.section-title {
    font-size: 36px;
    margin-bottom: 24px;
    line-height: 1.2;
}

.section-body {
    color: #B8B8C8;
    font-size: 16px;
    line-height: 1.75;
    margin-bottom: 16px;
    max-width: 560px;
}

.section-annotation {
    font-family: 'IBM Plex Mono', monospace;
    font-weight: 400;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #7C5CFC;
    margin-top: 24px;
    opacity: 0.7;
}

/* --- Parallax Container --- */
.parallax-container {
    position: relative;
    width: 100%;
}

/* --- Sections --- */
.quest-section {
    position: relative;
    width: 100%;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.section-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    overflow: hidden;
}

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

.section-content {
    position: relative;
    z-index: 2;
    padding: 80px 40px;
    max-width: 640px;
    opacity: 0;
    transform: translateY(40px);
    transition: opacity 0.5s cubic-bezier(0.22, 1, 0.36, 1),
                transform 0.5s cubic-bezier(0.22, 1, 0.36, 1);
}

.section-content.visible {
    opacity: 1;
    transform: translateY(0);
}

/* Content positioning variants */
.content-left {
    margin-right: auto;
    margin-left: 8%;
}

.content-center {
    margin-left: auto;
    margin-right: auto;
    text-align: center;
}

.content-center .section-body {
    margin-left: auto;
    margin-right: auto;
}

.content-right {
    margin-left: auto;
    margin-right: 8%;
    text-align: right;
}

.content-right .section-body {
    margin-left: auto;
}

/* Hover glow on content blocks */
.section-content:hover {
    box-shadow: 0 0 30px rgba(124, 92, 252, 0.08);
}

/* --- Section Backgrounds --- */

/* Section 0: Hero */
.section-hero {
    background: #06060C;
}

/* Section 1: Layer 1 - Dense horizontal lines */
.section-layer1 {
    background: #06060C;
}

.layer1-bg {
    background:
        repeating-linear-gradient(
            to bottom,
            transparent,
            transparent 3px,
            rgba(42, 32, 80, 0.2) 3px,
            rgba(42, 32, 80, 0.2) 4px
        );
}

/* Section 2: Layer 2 - Midnight blue with hex grid */
.section-layer2 {
    background: #0A1428;
}

.hex-grid-svg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1;
}

/* Section 3: Rollups */
.section-rollups {
    background: #0A1428;
}

.rollups-bg {
    background:
        radial-gradient(ellipse at 30% 50%, rgba(124, 92, 252, 0.06) 0%, transparent 60%),
        radial-gradient(ellipse at 70% 50%, rgba(0, 229, 255, 0.04) 0%, transparent 60%);
}

/* Section 4: State Channels - Deep indigo with curves */
.section-channels {
    background: #141432;
    border-top: 1px solid rgba(0, 229, 255, 0.05);
}

.section-channels .section-annotation {
    color: #00E5FF;
}

.channel-curves-svg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1;
}

/* Section 5: Sidechains */
.section-sidechains {
    background: #141432;
}

.section-sidechains .section-annotation {
    color: #FF8C42;
}

.sidechains-bg {
    background:
        radial-gradient(ellipse at 60% 40%, rgba(255, 140, 66, 0.05) 0%, transparent 50%),
        radial-gradient(ellipse at 30% 70%, rgba(124, 92, 252, 0.05) 0%, transparent 50%);
}

/* Section 6: Future */
.section-future {
    background: #06060C;
}

.future-glow {
    width: 200px;
    height: 200px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(124, 92, 252, 0.2) 0%, rgba(0, 229, 255, 0.1) 40%, transparent 70%);
    margin: 40px auto 0;
    animation: futureGlowPulse 4s ease-in-out infinite;
}

@keyframes futureGlowPulse {
    0%, 100% { transform: scale(1); opacity: 0.6; }
    50% { transform: scale(1.15); opacity: 1; }
}

/* --- Hero Section --- */
.hero-title {
    font-size: 60px;
    letter-spacing: 0.04em;
    margin-bottom: 32px;
    display: inline-block;
}

.hero-part-left {
    display: inline-block;
    opacity: 0;
    transform: translateX(-40px);
    animation: heroSlideLeft 0.6s cubic-bezier(0.22, 1, 0.36, 1) 0.2s forwards;
}

.hero-hyphen {
    display: inline-block;
    opacity: 0;
    color: #7C5CFC;
    animation: heroPulseHyphen 0.4s ease 0.4s forwards;
}

.hero-part-right {
    display: inline-block;
    opacity: 0;
    transform: translateX(40px);
    animation: heroSlideRight 0.6s cubic-bezier(0.22, 1, 0.36, 1) 0.4s forwards;
}

@keyframes heroSlideLeft {
    to { opacity: 1; transform: translateX(0); }
}

@keyframes heroSlideRight {
    to { opacity: 1; transform: translateX(0); }
}

@keyframes heroPulseHyphen {
    0% { opacity: 0; }
    60% { opacity: 1; }
    100% { opacity: 0.6; }
}

.hero-line-container {
    display: flex;
    justify-content: center;
    margin-bottom: 16px;
}

.hero-line-svg {
    width: 2px;
    height: 60px;
    overflow: visible;
}

.hero-descend-line {
    stroke-dasharray: 60;
    stroke-dashoffset: 60;
    animation: heroLineDraw 0.8s ease 0.8s forwards;
}

@keyframes heroLineDraw {
    to { stroke-dashoffset: 0; }
}

.hero-subtitle {
    font-family: 'IBM Plex Mono', monospace;
    font-weight: 400;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #7C5CFC;
    opacity: 0;
    animation: heroSubtitleFade 0.6s ease 1.4s forwards;
    margin-bottom: 48px;
}

@keyframes heroSubtitleFade {
    to { opacity: 1; }
}

.hero-chevron {
    animation: chevronBounce 2s ease-in-out infinite;
    opacity: 0;
    animation: heroChevronAppear 0.5s ease 1.8s forwards, chevronBounce 2s ease-in-out 2.3s infinite;
}

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

@keyframes heroChevronAppear {
    to { opacity: 0.8; }
}

/* Hero section content is visible by default (animated separately) */
.section-hero .section-content {
    opacity: 1;
    transform: translateY(0);
}

/* --- Depth Indicator Bar --- */
.depth-indicator {
    position: fixed;
    right: 28px;
    top: 50%;
    transform: translateY(-50%);
    z-index: 100;
    display: flex;
    flex-direction: column;
    align-items: center;
    height: 60vh;
    opacity: 0;
    animation: depthBarFadeIn 0.6s ease 0.2s forwards;
}

@keyframes depthBarFadeIn {
    to { opacity: 1; }
}

.depth-line {
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 1px;
    height: 100%;
    background: #2A2050;
}

.depth-connection-svg {
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 2px;
    height: 100%;
    pointer-events: none;
}

.connection-line {
    transition: stroke-dashoffset 0.3s ease;
}

.depth-node {
    position: absolute;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: #2A2050;
    cursor: pointer;
    transition: background 0.3s ease, box-shadow 0.3s ease;
    z-index: 2;
}

.depth-node:nth-child(2) { top: 0%; }
.depth-node:nth-child(3) { top: 16.67%; }
.depth-node:nth-child(4) { top: 33.33%; }
.depth-node:nth-child(5) { top: 50%; }
.depth-node:nth-child(6) { top: 66.67%; }
.depth-node:nth-child(7) { top: 83.33%; }
.depth-node:nth-child(8) { top: 100%; }

/* Offset for centering the dot */
.depth-node {
    margin-left: -5px;
    left: 50%;
}

.depth-node.active {
    background: #7C5CFC;
    box-shadow: 0 0 20px rgba(124, 92, 252, 0.4), 0 0 40px rgba(124, 92, 252, 0.2);
}

.depth-label {
    position: absolute;
    right: 22px;
    top: 50%;
    transform: translateY(-50%);
    font-family: 'IBM Plex Mono', monospace;
    font-size: 11px;
    font-weight: 400;
    letter-spacing: 0.06em;
    color: #7C5CFC;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.depth-indicator:hover .depth-label {
    opacity: 1;
}

/* --- Depth Pill --- */
.depth-pill {
    position: fixed;
    bottom: 28px;
    right: 28px;
    z-index: 100;
    background: rgba(10, 10, 20, 0.85);
    border: 1px solid #2A2050;
    border-radius: 20px;
    padding: 8px 18px;
    display: flex;
    align-items: center;
    gap: 4px;
    cursor: pointer;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

.depth-pill:hover {
    border-color: #7C5CFC;
    box-shadow: 0 0 15px rgba(124, 92, 252, 0.15);
}

.depth-pill-label {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 11px;
    font-weight: 400;
    letter-spacing: 0.08em;
    color: #B8B8C8;
    text-transform: uppercase;
}

.depth-pill-current {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 13px;
    font-weight: 400;
    color: #7C5CFC;
}

.depth-pill-sep {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 13px;
    color: #2A2050;
}

.depth-pill-total {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 13px;
    font-weight: 400;
    color: #B8B8C8;
}

/* --- Map Overlay --- */
.map-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 200;
    background: rgba(6, 6, 12, 0.95);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transform: scale(0.9);
    transform-origin: bottom right;
    transition: opacity 0.4s ease, transform 0.4s cubic-bezier(0.22, 1, 0.36, 1);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}

.map-overlay.active {
    opacity: 1;
    pointer-events: all;
    transform: scale(1);
}

.map-overlay-inner {
    text-align: center;
    position: relative;
}

.map-close {
    position: absolute;
    top: -60px;
    right: -20px;
    font-size: 32px;
    color: #B8B8C8;
    cursor: pointer;
    transition: color 0.3s ease;
    line-height: 1;
}

.map-close:hover {
    color: #FFFFFF;
}

.map-title {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 12px;
    font-weight: 400;
    letter-spacing: 0.08em;
    color: #7C5CFC;
    margin-bottom: 48px;
}

.map-chain {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0;
}

.map-node {
    display: flex;
    align-items: center;
    gap: 16px;
    cursor: pointer;
    padding: 8px 16px;
    border-radius: 8px;
    transition: background 0.3s ease;
}

.map-node:hover {
    background: rgba(124, 92, 252, 0.08);
}

.map-node span {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 13px;
    font-weight: 400;
    letter-spacing: 0.06em;
    color: #B8B8C8;
    transition: color 0.3s ease;
}

.map-node:hover span {
    color: #FFFFFF;
}

.map-node-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #2A2050;
    border: 1px solid #7C5CFC;
    transition: background 0.3s ease, box-shadow 0.3s ease;
}

.map-node.active .map-node-dot {
    background: #7C5CFC;
    box-shadow: 0 0 12px rgba(124, 92, 252, 0.4);
}

.map-node.active span {
    color: #7C5CFC;
}

.map-connector {
    width: 1px;
    height: 20px;
    background: #2A2050;
}

/* --- Responsive --- */
@media (max-width: 768px) {
    .hero-title {
        font-size: 36px;
    }

    .section-title {
        font-size: 28px;
    }

    .section-content {
        padding: 60px 24px;
        max-width: 100%;
    }

    .content-left,
    .content-right {
        margin-left: 5%;
        margin-right: 5%;
        text-align: left;
    }

    .content-right .section-body {
        margin-left: 0;
    }

    .depth-indicator {
        right: 12px;
        height: 50vh;
    }

    .depth-pill {
        right: 12px;
        bottom: 12px;
    }

    .depth-label {
        display: none;
    }
}
