/* ============================================================
   parallel.quest -- styles
   Palette:
     Reality dark:    #0A0820
     Aurora violet:   #7040C0
     Aurora emerald:  #30C860
     Candle amber:    #E8A830
     Candle rose:     #D06848
     Phantom white:   #E0E0F0
     Fracture gray:   #505068
   Font: Libre Baskerville (Google Fonts)
   ============================================================ */

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

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

body {
    font-family: 'Libre Baskerville', Georgia, serif;
    font-weight: 400;
    font-size: clamp(15px, 1vw, 17px);
    line-height: 1.8;
    color: #E0E0F0;
    background: #0A0820;
    overflow-x: hidden;
}

/* ---- Typography ---- */
h1, h2 {
    font-family: 'Libre Baskerville', Georgia, serif;
    font-weight: 700;
}

h1 {
    font-size: clamp(28px, 3.5vw, 52px);
}

h2 {
    font-size: clamp(20px, 2vw, 36px);
    margin-bottom: 0.6em;
}

.timeline-marker {
    font-family: 'Libre Baskerville', Georgia, serif;
    font-weight: 700;
    font-style: italic;
    font-size: clamp(20px, 2vw, 36px);
    color: #E8A830;
    display: block;
    margin-bottom: 0.3em;
}

.annotation,
.convergence-annotation {
    font-family: 'Libre Baskerville', Georgia, serif;
    font-weight: 400;
    font-style: italic;
    font-size: 12px;
    color: #505068;
    display: block;
    margin-top: 0.8em;
}

/* ============================================================
   SECTION 1: Reality Fracture Hero
   ============================================================ */
.hero {
    position: relative;
    width: 100%;
    height: 100vh;
    min-height: 600px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    background: #0A0820;
}

/* Aurora gradient bands */
.aurora-bands {
    position: absolute;
    inset: 0;
    background:
        radial-gradient(ellipse 120% 50% at 30% 20%, rgba(112, 64, 192, 0.25) 0%, transparent 70%),
        radial-gradient(ellipse 100% 40% at 70% 60%, rgba(48, 200, 96, 0.18) 0%, transparent 70%),
        radial-gradient(ellipse 80% 60% at 50% 80%, rgba(112, 64, 192, 0.12) 0%, transparent 60%);
    animation: auroraShift 15s ease-in-out infinite alternate;
    pointer-events: none;
    z-index: 1;
}

@keyframes auroraShift {
    0% {
        background-position: 0% 0%, 100% 100%, 50% 50%;
        filter: hue-rotate(0deg);
    }
    50% {
        filter: hue-rotate(8deg);
    }
    100% {
        background-position: 100% 100%, 0% 0%, 50% 50%;
        filter: hue-rotate(-5deg);
    }
}

/* Candle atmospheric warm pools */
.candle-pool {
    position: absolute;
    border-radius: 50%;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.6s ease;
    z-index: 2;
}

.candle-pool[data-pool="1"] {
    width: 120px;
    height: 120px;
    top: 15%;
    left: 10%;
    background: radial-gradient(circle, rgba(232, 168, 48, 0.2) 0%, transparent 70%);
}

.candle-pool[data-pool="2"] {
    width: 90px;
    height: 90px;
    top: 65%;
    left: 75%;
    background: radial-gradient(circle, rgba(208, 104, 72, 0.18) 0%, transparent 70%);
}

.candle-pool[data-pool="3"] {
    width: 80px;
    height: 80px;
    top: 40%;
    left: 85%;
    background: radial-gradient(circle, rgba(232, 168, 48, 0.15) 0%, transparent 70%);
}

.candle-pool[data-pool="4"] {
    width: 100px;
    height: 100px;
    top: 80%;
    left: 25%;
    background: radial-gradient(circle, rgba(208, 104, 72, 0.2) 0%, transparent 70%);
}

.candle-pool[data-pool="5"] {
    width: 60px;
    height: 60px;
    top: 25%;
    left: 55%;
    background: radial-gradient(circle, rgba(232, 168, 48, 0.22) 0%, transparent 70%);
}

.candle-pool.visible {
    opacity: 1;
}

/* Geometric abstract impossible forms */
.impossible-form {
    position: absolute;
    opacity: 0;
    z-index: 3;
    pointer-events: none;
    transition: opacity 0.8s ease;
}

.impossible-form.visible {
    opacity: 0.6;
}

.penrose-triangle {
    top: 12%;
    right: 12%;
}

.klein-bottle {
    bottom: 18%;
    left: 8%;
}

.escher-staircase {
    top: 35%;
    left: 60%;
    opacity: 0;
}

/* SVG stroke draw animation */
.draw-path {
    stroke-dasharray: 1000;
    stroke-dashoffset: 1000;
    transition: stroke-dashoffset 1.2s ease-out;
}

.draw-path.drawn {
    stroke-dashoffset: 0;
}

/* Hero content */
.hero-content {
    position: relative;
    z-index: 5;
    text-align: center;
    opacity: 0;
    transform: rotate(-1deg);
    transition: opacity 0.8s ease, transform 0.8s ease;
}

.hero-content.visible {
    opacity: 1;
    transform: rotate(0deg);
}

.domain-title {
    color: #E0E0F0;
    letter-spacing: 0.02em;
    margin-bottom: 0.4em;
    text-shadow: 0 0 40px rgba(112, 64, 192, 0.3), 0 0 80px rgba(48, 200, 96, 0.15);
}

.hero-annotation {
    font-style: italic;
    font-size: 12px;
    color: #505068;
}

/* Scroll indicator */
.scroll-indicator {
    position: absolute;
    bottom: 40px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 5;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    opacity: 0;
    animation: fadeInScroll 1s ease 2s forwards;
}

.scroll-annotation {
    font-style: italic;
    font-size: 12px;
    color: #505068;
}

.scroll-indicator svg {
    animation: bobDown 2s ease-in-out infinite;
}

@keyframes fadeInScroll {
    to { opacity: 0.6; }
}

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

/* ============================================================
   SECTION 2: Timeline Branches (broken-grid)
   ============================================================ */
.broken-grid-section {
    position: relative;
    padding: 120px 0 80px;
    min-height: 100vh;
}

.timeline-block {
    position: relative;
    max-width: 55%;
    padding: 40px 48px;
    margin: 60px auto;
    background: rgba(10, 8, 32, 0.7);
    border: 1px solid rgba(80, 80, 104, 0.3);
    opacity: 0;
    transition: opacity 0.6s ease, transform 0.4s ease;
    z-index: 4;
}

.timeline-block.in-view {
    opacity: 1;
}

/* Broken-grid intentional displacement */
.block-alpha {
    margin-left: 12%;
    transform: rotate(-2deg) translateX(15px);
}

.block-alpha.in-view {
    transform: rotate(-2deg) translateX(15px);
}

.block-beta {
    margin-left: 35%;
    transform: rotate(1.5deg) translateX(-20px);
}

.block-beta.in-view {
    transform: rotate(1.5deg) translateX(-20px);
}

.block-gamma {
    margin-left: 18%;
    transform: rotate(2.5deg) translateX(10px);
}

.block-gamma.in-view {
    transform: rotate(2.5deg) translateX(10px);
}

.block-delta {
    margin-left: 40%;
    transform: rotate(-1deg) translateX(-15px);
}

.block-delta.in-view {
    transform: rotate(-1deg) translateX(-15px);
}

.block-epsilon {
    margin-left: 8%;
    transform: rotate(3deg) translateX(25px);
}

.block-epsilon.in-view {
    transform: rotate(3deg) translateX(25px);
}

.block-zeta {
    margin-left: 28%;
    transform: rotate(-2.5deg) translateX(-10px);
}

.block-zeta.in-view {
    transform: rotate(-2.5deg) translateX(-10px);
}

/* Hover: stabilize timeline (re-align) */
.timeline-block:hover {
    transform: rotate(0deg) translateX(0px) !important;
    border-color: rgba(48, 200, 96, 0.4);
    transition: transform 0.4s ease, border-color 0.4s ease, opacity 0.6s ease;
}

.timeline-block h2 {
    color: #E0E0F0;
}

.timeline-block p {
    color: rgba(224, 224, 240, 0.85);
}

/* Candle pool glow on hover */
.timeline-block::before {
    content: '';
    position: absolute;
    top: -20px;
    right: -20px;
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(232, 168, 48, 0.15) 0%, transparent 70%);
    opacity: 0;
    transition: opacity 0.4s ease;
    pointer-events: none;
}

.timeline-block:hover::before {
    opacity: 1;
}

/* Reality maps between sections */
.reality-map {
    position: relative;
    width: 100%;
    height: 200px;
    margin: 40px 0;
    overflow: hidden;
    z-index: 3;
}

.reality-map-svg {
    width: 100%;
    height: 100%;
}

.reality-map-1 {
    transform: rotate(0.5deg);
}

.reality-map-2 {
    transform: rotate(-0.8deg);
}

/* ============================================================
   SECTION 3: Convergence Altar (Footer)
   ============================================================ */
.footer-section {
    position: relative;
    padding: 120px 0 80px;
    min-height: 60vh;
    overflow: hidden;
}

.footer-pool[data-pool="6"] {
    width: 100px;
    height: 100px;
    top: 20%;
    left: 15%;
    background: radial-gradient(circle, rgba(232, 168, 48, 0.25) 0%, transparent 70%);
}

.footer-pool[data-pool="7"] {
    width: 80px;
    height: 80px;
    top: 50%;
    right: 20%;
    background: radial-gradient(circle, rgba(208, 104, 72, 0.2) 0%, transparent 70%);
}

.footer-pool[data-pool="8"] {
    width: 70px;
    height: 70px;
    bottom: 15%;
    left: 50%;
    background: radial-gradient(circle, rgba(232, 168, 48, 0.18) 0%, transparent 70%);
}

.convergence-content {
    position: relative;
    z-index: 5;
    max-width: 800px;
    margin: 0 auto;
    padding: 0 40px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 60px;
}

.convergence-block {
    text-align: center;
    opacity: 0;
    transition: opacity 0.8s ease, transform 0.8s ease;
}

/* Initially displaced, converge on viewport entry */
.block-converge-1 {
    transform: rotate(-2deg) translateX(-20px);
}

.block-converge-2 {
    transform: rotate(1.5deg) translateX(15px);
}

.block-converge-3 {
    transform: rotate(-1deg) translateX(-10px);
}

.convergence-block.converged {
    opacity: 1;
    transform: rotate(0deg) translateX(0px);
}

.convergence-block .timeline-marker {
    color: #D06848;
}

.convergence-block p {
    color: rgba(224, 224, 240, 0.8);
}

.convergence-symbol {
    display: block;
    margin: 0 auto;
}

.convergence-annotation {
    font-style: italic;
    font-size: 12px;
    color: #505068;
    margin-top: 0.4em;
}

/* ============================================================
   Parallax layer offsets (applied via JS)
   ============================================================ */
.parallax-layer {
    will-change: transform;
}

/* ============================================================
   Responsive
   ============================================================ */
@media (max-width: 900px) {
    .timeline-block {
        max-width: 80%;
        margin-left: auto !important;
        margin-right: auto !important;
        padding: 30px 28px;
    }

    .impossible-form {
        display: none;
    }

    .convergence-content {
        padding: 0 24px;
    }
}

@media (max-width: 600px) {
    .timeline-block {
        max-width: 92%;
        padding: 24px 20px;
    }

    .hero-content {
        padding: 0 20px;
    }
}
