/* parallel.quest -- diagonal-cut multiverse traversal */

:root {
    --c-blue: #0a1628;       /* Dimension Blue (reality A) */
    --c-violet: #2d1b69;     /* Dimension Violet (reality B) */
    --c-cyan: #00f0ff;       /* Rift Cyan (primary accent) */
    --c-pink: #ff6b9d;       /* Rift Pink (secondary accent) */
    --c-white: #e0e0e0;      /* Transit White */
    --c-void: #1a0f3c;       /* Deep Void */
    --c-gold: #ffd700;       /* Quest Gold */
    --c-mid: #333355;        /* Mid Dimension */

    --font-display: "Space Grotesk", "Space", system-ui, sans-serif;
    --font-body: "Inter", system-ui, sans-serif;
    --font-mono: "Fira Code", ui-monospace, monospace;
}

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-body);
    font-size: 16px;
    line-height: 1.7;
    color: var(--c-white);
    background: var(--c-void);
    overflow-x: hidden;
    font-weight: 400;
    -webkit-font-smoothing: antialiased;
}

/* ==== NOISE OVERLAY ==== */
.noise-overlay {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 9999;
    opacity: 0.04;
    mix-blend-mode: overlay;
    background-image:
        repeating-linear-gradient(
            0deg,
            rgba(255,255,255,0.05) 0,
            rgba(255,255,255,0.05) 1px,
            transparent 1px,
            transparent 3px
        );
}

/* ==== HERO: RIFT OPENING ==== */
.hero {
    position: relative;
    min-height: 100vh;
    width: 100%;
    display: grid;
    grid-template-columns: 1fr 1fr;
    overflow: hidden;
    isolation: isolate;
}

.hero-half {
    position: relative;
    min-height: 100vh;
    transition: filter 0.6s ease, transform 0.8s cubic-bezier(.2,.8,.2,1);
}

.hero-left {
    background:
        radial-gradient(ellipse at 30% 40%, rgba(0,240,255,0.08), transparent 60%),
        linear-gradient(160deg, var(--c-blue) 0%, #061021 60%, #050d1c 100%);
    clip-path: polygon(0 0, 100% 0, 48% 8%, 52% 18%, 46% 30%, 53% 45%, 47% 60%, 54% 75%, 48% 90%, 51% 100%, 0 100%);
}

.hero-right {
    background:
        radial-gradient(ellipse at 70% 60%, rgba(255,107,157,0.08), transparent 60%),
        linear-gradient(200deg, var(--c-violet) 0%, #1d1146 60%, #160a39 100%);
    clip-path: polygon(48% 8%, 100% 0, 100% 100%, 51% 100%, 48% 90%, 54% 75%, 47% 60%, 53% 45%, 46% 30%, 52% 18%);
}

/* ==== RIFT LINE GLOW ==== */
.rift-line {
    position: absolute;
    top: 0;
    bottom: 0;
    left: 50%;
    width: 4px;
    transform: translateX(-50%);
    z-index: 2;
    pointer-events: none;
    display: flex;
    flex-direction: column;
}

.rift-segment {
    flex: 1;
    background: var(--c-cyan);
    box-shadow:
        0 0 10px var(--c-cyan),
        0 0 22px rgba(0, 240, 255, 0.55),
        0 0 40px rgba(0, 240, 255, 0.3);
    animation: rift-pulse 2.4s ease-in-out infinite;
}

.rift-segment:nth-child(1) { transform: translateX(-6px); animation-delay: 0s; }
.rift-segment:nth-child(2) { transform: translateX(8px); animation-delay: 0.15s; }
.rift-segment:nth-child(3) { transform: translateX(-4px); animation-delay: 0.3s; }
.rift-segment:nth-child(4) { transform: translateX(7px); animation-delay: 0.45s; }
.rift-segment:nth-child(5) { transform: translateX(-7px); animation-delay: 0.6s; }
.rift-segment:nth-child(6) { transform: translateX(5px); animation-delay: 0.75s; }
.rift-segment:nth-child(7) { transform: translateX(-5px); animation-delay: 0.9s; }
.rift-segment:nth-child(8) { transform: translateX(6px); animation-delay: 1.05s; }

@keyframes rift-pulse {
    0%, 100% {
        opacity: 0.85;
        filter: brightness(1);
    }
    50% {
        opacity: 1;
        filter: brightness(1.5);
    }
}

/* ==== HERO TITLE ==== */
.hero-title-wrap {
    position: absolute;
    inset: 0;
    z-index: 5;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 2rem;
    pointer-events: none;
}

.hero-title {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: clamp(2.5rem, 8vw, 6rem);
    line-height: 0.95;
    letter-spacing: -0.02em;
    color: var(--c-white);
    display: inline-flex;
    align-items: baseline;
    text-shadow:
        -2px 0 0 rgba(0, 240, 255, 0.6),
        2px 0 0 rgba(255, 107, 157, 0.6);
    animation: chromatic-drift 5s ease-in-out infinite;
}

.hero-title__half {
    display: inline-block;
    transition: transform 0.6s cubic-bezier(.2,.8,.2,1);
}

.hero-title__half--left {
    color: #f4f4ff;
    transform: translateX(-2px);
}

.hero-title__half--right {
    color: #fff0ff;
    transform: translateX(2px);
}

.hero-title__sep {
    color: var(--c-cyan);
    text-shadow: 0 0 18px var(--c-cyan);
    animation: sep-flicker 3.4s steps(2, end) infinite;
    padding: 0 0.05em;
}

@keyframes chromatic-drift {
    0%, 100% {
        text-shadow: -2px 0 0 rgba(0, 240, 255, 0.6), 2px 0 0 rgba(255, 107, 157, 0.6);
    }
    50% {
        text-shadow: -3px 0 0 rgba(0, 240, 255, 0.8), 3px 0 0 rgba(255, 107, 157, 0.8);
    }
}

@keyframes sep-flicker {
    0%, 90%, 100% { opacity: 1; }
    92% { opacity: 0.3; }
    94% { opacity: 1; }
    96% { opacity: 0.5; }
}

.hero-sub {
    font-family: var(--font-body);
    font-weight: 300;
    font-size: clamp(0.95rem, 1.6vw, 1.15rem);
    color: rgba(224, 224, 224, 0.78);
    margin-top: 1.5rem;
    letter-spacing: 0.02em;
    max-width: 36ch;
}

.hero-coords {
    margin-top: 2.4rem;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.8rem;
    font-family: var(--font-mono);
    font-size: 0.78rem;
    color: var(--c-gold);
    letter-spacing: 0.08em;
}

.coord-sep {
    color: var(--c-cyan);
    opacity: 0.6;
}

.coord-blink {
    color: var(--c-cyan);
    animation: blink 1.6s steps(2, end) infinite;
}

@keyframes blink {
    0%, 49% { opacity: 1; }
    50%, 100% { opacity: 0.25; }
}

/* ==== DIMENSION MARKERS ==== */
.dim-marker {
    position: absolute;
    font-family: var(--font-mono);
    font-size: 0.72rem;
    letter-spacing: 0.12em;
    color: var(--c-cyan);
    opacity: 0.7;
    text-transform: uppercase;
    z-index: 4;
    padding: 0.4rem 0.6rem;
    border: 1px solid rgba(0, 240, 255, 0.2);
    background: rgba(10, 22, 40, 0.4);
    backdrop-filter: blur(2px);
}

.dim-marker--top-left { top: 1.5rem; left: 1.5rem; }
.dim-marker--bottom-left { bottom: 1.5rem; left: 1.5rem; }
.dim-marker--top-right {
    top: 1.5rem;
    right: 1.5rem;
    color: var(--c-pink);
    border-color: rgba(255, 107, 157, 0.25);
    background: rgba(45, 27, 105, 0.4);
}
.dim-marker--bottom-right {
    bottom: 1.5rem;
    right: 1.5rem;
    color: var(--c-pink);
    border-color: rgba(255, 107, 157, 0.25);
    background: rgba(45, 27, 105, 0.4);
}

.dim-marker--corner {
    top: 1.4rem;
    left: 2rem;
}

.dim-marker--right {
    left: auto;
    right: 2rem;
    color: var(--c-pink);
    border-color: rgba(255, 107, 157, 0.25);
    background: rgba(45, 27, 105, 0.4);
}

/* ==== PORTAL CLUSTERS ==== */
.portal-cluster {
    position: absolute;
    width: 120px;
    height: 120px;
    pointer-events: none;
    z-index: 3;
}

.portal-cluster--hero {
    bottom: 7%;
    left: 50%;
    transform: translateX(-50%);
    width: 80px;
    height: 80px;
    opacity: 0.7;
}

.portal-cluster--corner {
    bottom: 2rem;
    right: 2rem;
}

.portal-cluster--corner-left {
    right: auto;
    left: 2rem;
}

.portal-cluster--center {
    position: relative;
    width: 220px;
    height: 220px;
    margin: 0 auto 2rem;
    opacity: 0.85;
}

.portal-ring {
    position: absolute;
    inset: 0;
    border: 1px solid var(--c-cyan);
    border-radius: 50%;
    opacity: 0.6;
    animation: portal-spin 12s linear infinite;
}

.portal-ring:nth-child(1) {
    inset: 0;
    opacity: 0.55;
    animation-duration: 10s;
}
.portal-ring:nth-child(2) {
    inset: 18%;
    opacity: 0.4;
    border-color: var(--c-pink);
    animation-duration: 14s;
    animation-direction: reverse;
}
.portal-ring:nth-child(3) {
    inset: 36%;
    opacity: 0.7;
    border-color: var(--c-gold);
    animation-duration: 8s;
}
.portal-ring:nth-child(4) {
    inset: 50%;
    opacity: 0.9;
    border-color: var(--c-cyan);
    animation-duration: 6s;
    animation-direction: reverse;
}

@keyframes portal-spin {
    0%   { transform: rotate(0deg) scale(1); opacity: 0.4; }
    50%  { transform: rotate(180deg) scale(1.06); opacity: 0.85; }
    100% { transform: rotate(360deg) scale(1); opacity: 0.4; }
}

/* ==== SCROLL CUE ==== */
.scroll-cue {
    position: absolute;
    bottom: 2.4rem;
    left: 50%;
    transform: translateX(-50%);
    z-index: 6;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.6rem;
    pointer-events: none;
}

.scroll-cue__label {
    font-family: var(--font-mono);
    font-size: 0.7rem;
    letter-spacing: 0.3em;
    color: var(--c-cyan);
    text-transform: uppercase;
    opacity: 0.85;
}

.scroll-cue__line {
    width: 1px;
    height: 36px;
    background: linear-gradient(to bottom, var(--c-cyan), transparent);
    animation: cue-stretch 1.8s ease-in-out infinite;
    transform-origin: top;
}

@keyframes cue-stretch {
    0%, 100% { transform: scaleY(0.5); opacity: 0.4; }
    50% { transform: scaleY(1); opacity: 1; }
}

/* ==== BRANCH SECTIONS ==== */
.branch {
    position: relative;
    min-height: 80vh;
    padding: 9rem 6vw;
    overflow: hidden;
    isolation: isolate;
    margin-top: -40px;
}

.branch--left {
    background:
        radial-gradient(ellipse 60% 80% at 20% 50%, rgba(0,240,255,0.05), transparent 60%),
        linear-gradient(135deg, var(--c-blue) 0%, #081222 100%);
    clip-path: polygon(0 0, 100% 5%, 100% 100%, 0 95%);
}

.branch--right {
    background:
        radial-gradient(ellipse 60% 80% at 80% 50%, rgba(255,107,157,0.06), transparent 60%),
        linear-gradient(225deg, var(--c-violet) 0%, #1a0e44 100%);
    clip-path: polygon(0 5%, 100% 0, 100% 95%, 0 100%);
}

.branch::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: var(--c-cyan);
    box-shadow:
        0 0 10px var(--c-cyan),
        0 0 20px rgba(0, 240, 255, 0.3);
    opacity: 0.55;
    z-index: 5;
}

.branch::after {
    content: "";
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: var(--c-cyan);
    box-shadow:
        0 0 10px var(--c-cyan),
        0 0 20px rgba(0, 240, 255, 0.3);
    opacity: 0.4;
    z-index: 5;
}

.branch-inner {
    max-width: 720px;
    position: relative;
    z-index: 2;
}

.branch--left .branch-inner {
    margin-right: auto;
    margin-left: 4vw;
}

.branch--right .branch-inner {
    margin-left: auto;
    margin-right: 4vw;
    text-align: right;
}

.branch-eyebrow {
    font-family: var(--font-mono);
    font-size: 0.78rem;
    color: var(--c-cyan);
    letter-spacing: 0.2em;
    text-transform: uppercase;
    margin-bottom: 1.4rem;
    opacity: 0.85;
}

.branch-eyebrow--pink {
    color: var(--c-pink);
}

.branch-title {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: clamp(2rem, 5vw, 4rem);
    line-height: 1.05;
    letter-spacing: -0.015em;
    color: var(--c-white);
    margin-bottom: 1.8rem;
}

.accent-cyan {
    color: var(--c-cyan);
    text-shadow: 0 0 20px rgba(0, 240, 255, 0.4);
}

.accent-pink {
    color: var(--c-pink);
    text-shadow: 0 0 20px rgba(255, 107, 157, 0.4);
}

.accent-gold {
    color: var(--c-gold);
    text-shadow: 0 0 18px rgba(255, 215, 0, 0.4);
}

.branch-body {
    font-family: var(--font-body);
    font-weight: 400;
    font-size: 1.05rem;
    line-height: 1.75;
    color: rgba(224, 224, 224, 0.88);
    margin-bottom: 2.5rem;
    max-width: 60ch;
}

.branch--right .branch-body {
    margin-left: auto;
}

.branch-meta {
    list-style: none;
    display: flex;
    flex-wrap: wrap;
    gap: 0.8rem 1.5rem;
    border-top: 1px solid rgba(51, 51, 85, 0.6);
    padding-top: 1.4rem;
    font-family: var(--font-mono);
    font-size: 0.78rem;
}

.branch--right .branch-meta {
    justify-content: flex-end;
}

.branch-meta li {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
    min-width: 110px;
}

.meta-key {
    color: var(--c-gold);
    letter-spacing: 0.18em;
    font-size: 0.7rem;
}

.meta-val {
    color: var(--c-white);
    opacity: 0.82;
}

/* ==== STAGGER ANIMATION (ENTRANCE) ==== */
.reveal {
    opacity: 0;
    transition: opacity 0.6s ease-out, transform 0.6s cubic-bezier(.2,.8,.2,1);
}

.branch--left .reveal {
    transform: translateX(-30px);
}

.branch--right .reveal {
    transform: translateX(30px);
}

.reveal.is-visible {
    opacity: 1;
    transform: translate(0, 0);
}

.branch-inner > .reveal:nth-child(1) { transition-delay: 0.05s; }
.branch-inner > .reveal:nth-child(2) { transition-delay: 0.18s; }
.branch-inner > .reveal:nth-child(3) { transition-delay: 0.32s; }
.branch-inner > .reveal:nth-child(4) { transition-delay: 0.46s; }

/* ==== SHIFT BAND ==== */
.shift-band {
    position: relative;
    background:
        radial-gradient(ellipse at 50% 30%, rgba(0,240,255,0.08), transparent 70%),
        linear-gradient(180deg, var(--c-void) 0%, #0d0726 100%);
    padding: 8rem 6vw 9rem;
    margin-top: -40px;
    clip-path: polygon(0 4%, 100% 0, 100% 96%, 0 100%);
    overflow: hidden;
}

.shift-band::before,
.shift-band::after {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    height: 2px;
    background: var(--c-pink);
    box-shadow:
        0 0 10px var(--c-pink),
        0 0 20px rgba(255, 107, 157, 0.4);
    opacity: 0.55;
    z-index: 5;
}
.shift-band::before { top: 0; }
.shift-band::after { bottom: 0; }

.shift-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 1.4rem;
    max-width: 1240px;
    margin: 2.5rem auto 0;
}

.shift-card {
    position: relative;
    border: 1px solid rgba(51, 51, 85, 0.9);
    background: rgba(10, 22, 40, 0.55);
    padding: 1.6rem 1.4rem 1.8rem;
    cursor: pointer;
    transition: transform 0.45s cubic-bezier(.2,.8,.2,1),
                border-color 0.45s ease,
                background 0.45s ease,
                box-shadow 0.45s ease;
    overflow: hidden;
    isolation: isolate;
    outline: none;
}

.shift-card::before {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(0,240,255,0.06), transparent 60%);
    opacity: 0;
    transition: opacity 0.45s ease;
    z-index: -1;
}

.shift-card[data-shift="1"]::before,
.shift-card[data-shift="3"]::before {
    background: linear-gradient(135deg, rgba(255,107,157,0.06), transparent 60%);
}

.shift-card:hover,
.shift-card.is-active {
    transform: translateY(-6px) skewX(-1.2deg);
    border-color: var(--c-cyan);
    box-shadow:
        0 10px 24px rgba(0, 240, 255, 0.18),
        0 0 0 1px rgba(0, 240, 255, 0.4);
    filter: drop-shadow(-1.5px 0 0 rgba(0, 240, 255, 0.6))
            drop-shadow(1.5px 0 0 rgba(255, 107, 157, 0.6));
}

.shift-card[data-shift="1"]:hover,
.shift-card[data-shift="3"]:hover,
.shift-card[data-shift="1"].is-active,
.shift-card[data-shift="3"].is-active {
    border-color: var(--c-pink);
    box-shadow:
        0 10px 24px rgba(255, 107, 157, 0.18),
        0 0 0 1px rgba(255, 107, 157, 0.4);
}

.shift-card:hover::before,
.shift-card.is-active::before {
    opacity: 1;
}

.shift-card__id {
    display: inline-block;
    font-family: var(--font-mono);
    font-size: 0.7rem;
    letter-spacing: 0.18em;
    color: var(--c-gold);
    margin-bottom: 1rem;
}

.shift-card__title {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 1.3rem;
    color: var(--c-white);
    margin-bottom: 0.7rem;
    line-height: 1.2;
}

.shift-card__body {
    font-family: var(--font-body);
    font-size: 0.92rem;
    color: rgba(224, 224, 224, 0.78);
    line-height: 1.6;
}

.shift-card__pulse {
    position: absolute;
    bottom: 1rem;
    right: 1rem;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--c-cyan);
    box-shadow: 0 0 10px var(--c-cyan);
    animation: pulse 1.6s ease-in-out infinite;
}

.shift-card[data-shift="1"] .shift-card__pulse,
.shift-card[data-shift="3"] .shift-card__pulse {
    background: var(--c-pink);
    box-shadow: 0 0 10px var(--c-pink);
}

@keyframes pulse {
    0%, 100% { transform: scale(1); opacity: 0.7; }
    50% { transform: scale(1.6); opacity: 1; }
}

/* ==== CONVERGENCE FOOTER ==== */
.convergence {
    position: relative;
    text-align: center;
    padding: 9rem 6vw 5rem;
    background:
        radial-gradient(ellipse at 50% 40%, rgba(255,215,0,0.06), transparent 60%),
        linear-gradient(180deg, #0d0726 0%, #050310 100%);
    margin-top: -40px;
    clip-path: polygon(0 4%, 100% 0, 100% 100%, 0 100%);
}

.convergence::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: var(--c-gold);
    box-shadow:
        0 0 10px var(--c-gold),
        0 0 20px rgba(255, 215, 0, 0.3);
    opacity: 0.5;
}

.convergence-eyebrow {
    font-family: var(--font-mono);
    font-size: 0.8rem;
    letter-spacing: 0.3em;
    color: var(--c-gold);
    text-transform: uppercase;
    margin-bottom: 1.4rem;
}

.convergence-title {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: clamp(1.8rem, 4vw, 3rem);
    color: var(--c-white);
    margin-bottom: 1.6rem;
    letter-spacing: -0.02em;
}

.convergence-body {
    max-width: 56ch;
    margin: 0 auto 3rem;
    font-family: var(--font-body);
    font-size: 1.05rem;
    line-height: 1.8;
    color: rgba(224, 224, 224, 0.82);
}

.convergence-foot {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.7rem;
    font-family: var(--font-mono);
    font-size: 0.74rem;
    letter-spacing: 0.16em;
    color: var(--c-cyan);
    opacity: 0.7;
    text-transform: uppercase;
}

/* ==== RESPONSIVE ==== */
@media (max-width: 760px) {
    .hero {
        grid-template-columns: 1fr;
    }
    .hero-left,
    .hero-right {
        clip-path: none;
        min-height: 50vh;
    }
    .hero-right { display: none; }
    .hero-left {
        background:
            linear-gradient(160deg, var(--c-blue) 0%, var(--c-violet) 100%);
    }
    .rift-line {
        left: auto;
        right: 0;
        top: 50%;
        bottom: auto;
        transform: translateY(-50%);
        width: 100%;
        height: 4px;
        flex-direction: row;
    }
    .rift-segment {
        height: 4px;
    }
    .branch {
        padding: 6rem 6vw;
    }
    .branch--right .branch-inner {
        text-align: left;
    }
    .branch--right .branch-meta {
        justify-content: flex-start;
    }
    .dim-marker--top-right,
    .dim-marker--bottom-right {
        right: 1rem;
    }
    .dim-marker--top-left,
    .dim-marker--bottom-left {
        left: 1rem;
    }
    .portal-cluster--hero { display: none; }
}

/* ==== UTILITY ==== */
::selection {
    background: var(--c-cyan);
    color: var(--c-blue);
}
