/* a6c.quest - Surrealist Digital Dreamscape */
:root {
    --void: #0B0E1A;
    --nebula: #1C2237;
    --cyan: #00E5CC;
    --violet: #8B5CF6;
    --peach: #FF8F6B;
    --white: #E8ECF4;
    --muted: #6B7394;
    --teal: #2DD4BF;
}

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

html {
    scroll-behavior: smooth;
}

body {
    background: var(--void);
    color: var(--white);
    font-family: 'Instrument Serif', serif;
    overflow-x: hidden;
}

#particleCanvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    pointer-events: none;
}

#noiseCanvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 999;
    pointer-events: none;
    mix-blend-mode: overlay;
    opacity: 0.03;
}

.cursor-glow {
    position: fixed;
    width: 400px;
    height: 400px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(0,229,204,0.12) 0%, transparent 50%);
    transform: translate(-50%, -50%);
    pointer-events: none;
    z-index: 1;
    transition: left 150ms ease-out, top 150ms ease-out;
}

/* Floating Glyphs */
.floating-glyphs {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 998;
}

.float-glyph {
    position: absolute;
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 700;
    font-size: 20vw;
    opacity: 0.03;
    filter: blur(2px);
    animation: floatDrift 120s linear infinite;
}

.glyph-a {
    color: var(--cyan);
    top: 10%;
    left: -5%;
    animation-delay: 0s;
}

.glyph-6 {
    color: var(--peach);
    top: 40%;
    left: 30%;
    animation-delay: -40s;
}

.glyph-c {
    color: var(--violet);
    top: 70%;
    left: 60%;
    animation-delay: -80s;
}

@keyframes floatDrift {
    0% { transform: translate(0, 0) rotate(0deg); }
    25% { transform: translate(10vw, -5vh) rotate(90deg); }
    50% { transform: translate(5vw, 10vh) rotate(180deg); }
    75% { transform: translate(-5vw, 5vh) rotate(270deg); }
    100% { transform: translate(0, 0) rotate(360deg); }
}

/* Waypoints Navigation */
.waypoints {
    position: fixed;
    right: 30px;
    top: 50%;
    transform: translateY(-50%);
    display: flex;
    flex-direction: column;
    gap: 40px;
    z-index: 100;
}

.waypoint {
    position: relative;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--cyan);
    box-shadow: 0 0 20px rgba(0,229,204,0.4);
    cursor: pointer;
    transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.3s ease;
}

.waypoint:hover {
    transform: scale(3);
    box-shadow: 0 0 40px rgba(0,229,204,0.6);
}

.waypoint-label {
    position: absolute;
    right: 24px;
    top: 50%;
    transform: translateY(-50%);
    font-family: 'Space Grotesk', sans-serif;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.3em;
    color: var(--cyan);
    white-space: nowrap;
    opacity: 0;
    transition: opacity 0.2s ease 0.1s;
    pointer-events: none;
}

.waypoint:hover .waypoint-label {
    opacity: 1;
}

/* Reveal Intro */
.reveal-intro {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 2vw;
    z-index: 500;
    background: var(--void);
    animation: introFadeOut 0.8s ease 3.2s forwards;
}

.reveal-char {
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 700;
    font-size: clamp(8vw, 14vw, 28vw);
    letter-spacing: 0.15em;
    text-transform: lowercase;
    opacity: 0;
}

.reveal-a {
    color: var(--cyan);
    animation: revealBlur 0.8s ease forwards;
}

.reveal-6 {
    color: var(--peach);
    animation: revealSlide 0.8s ease 0.8s forwards;
}

.reveal-c {
    color: var(--violet);
    animation: revealScale 0.8s ease 1.6s forwards;
}

@keyframes revealBlur {
    0% { opacity: 0; filter: blur(20px); }
    100% { opacity: 1; filter: blur(0); }
}

@keyframes revealSlide {
    0% { opacity: 0; transform: translateY(40px); }
    100% { opacity: 1; transform: translateY(0); }
}

@keyframes revealScale {
    0% { opacity: 0; transform: scale(3); }
    100% { opacity: 1; transform: scale(1); }
}

@keyframes introFadeOut {
    0% { opacity: 1; pointer-events: all; }
    100% { opacity: 0; pointer-events: none; }
}

/* Chapters */
.chapters {
    position: relative;
    z-index: 2;
}

.chapter {
    position: relative;
    min-height: 200vh;
    padding: 15vh 10vw;
    background: linear-gradient(135deg, var(--void) 0%, var(--nebula) 40%, rgba(139,92,246,0.08) 70%, rgba(0,229,204,0.04) 100%);
    clip-path: polygon(0 8%, 100% 0, 100% 92%, 0 100%);
    margin-top: -8vh;
}

.chapter:first-child {
    clip-path: polygon(0 0, 100% 0, 100% 92%, 0 100%);
    margin-top: 0;
    padding-top: 20vh;
}

.chapter:last-child {
    clip-path: polygon(0 8%, 100% 0, 100% 100%, 0 100%);
}

.diagonal-seam {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 2px;
    background: linear-gradient(90deg, var(--cyan), var(--violet), var(--cyan));
    opacity: 0.5;
    animation: seamPulse 8s ease-in-out infinite;
}

@keyframes seamPulse {
    0%, 100% { opacity: 0.4; }
    50% { opacity: 0.8; }
}

.chapter-content {
    max-width: 800px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 6vh;
}

.chapter-title {
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 700;
    font-size: clamp(2vw, 3.5vw, 5vw);
    letter-spacing: 0.15em;
    text-transform: lowercase;
}

.chapter-a .chapter-title { color: var(--cyan); }
.chapter-6 .chapter-title { color: var(--peach); }
.chapter-c .chapter-title { color: var(--violet); }

.content-panel {
    background: rgba(28, 34, 55, 0.85);
    border: 1px solid var(--teal);
    padding: 3rem;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.panel-offset {
    margin-left: 10vw;
    background: transparent;
    border-color: var(--muted);
    padding: 1.5rem 2rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.body-text {
    font-family: 'Instrument Serif', serif;
    font-weight: 400;
    font-size: clamp(1rem, 1.25vw, 1.5rem);
    line-height: 1.85;
    color: var(--white);
}

.mono-fragment {
    font-family: 'JetBrains Mono', monospace;
    font-weight: 300;
    font-size: 0.75rem;
    letter-spacing: 0.05em;
    color: var(--muted);
    opacity: 0.4;
}

/* Chapter-specific aurora shifts */
.chapter-a {
    background: linear-gradient(135deg, var(--void) 0%, var(--nebula) 40%, rgba(0,229,204,0.08) 70%, rgba(0,229,204,0.04) 100%);
}

.chapter-6 {
    background: linear-gradient(135deg, var(--void) 0%, var(--nebula) 40%, rgba(255,143,107,0.08) 70%, rgba(139,92,246,0.06) 100%);
}

.chapter-c {
    background: linear-gradient(135deg, var(--void) 0%, var(--nebula) 40%, rgba(139,92,246,0.1) 70%, rgba(45,212,191,0.06) 100%);
}

@media (max-width: 768px) {
    .chapter {
        padding: 10vh 6vw;
        clip-path: polygon(0 4%, 100% 0, 100% 96%, 0 100%);
    }
    .panel-offset {
        margin-left: 0;
    }
    .waypoints {
        right: 12px;
    }
}
