/* miris.tech — Playful Cyberpunk Split-Screen */

:root {
    --midnight-indigo: #0D0B2E;
    --dark-plum: #1A0A2E;
    --electric-cyan: #00F0FF;
    --hot-magenta: #FF2F93;
    --coral-flare: #FF6B4A;
    --lavender-gray: #C8C0E0;
    --ghost-white: #F0E8FF;
    --neon-teal: #00D4CC;
    --frosted-violet: #2A1F4E;
}

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

html {
    font-size: 16px;
    scroll-behavior: smooth;
}

body {
    font-family: 'Space Grotesk', sans-serif;
    background-color: var(--midnight-indigo);
    color: var(--lavender-gray);
    overflow-x: hidden;
    line-height: 1.5;
}

/* ===== Typography ===== */

.display-mono {
    font-family: 'Share Tech Mono', monospace;
    font-size: clamp(2.2rem, 5vw + 0.5rem, 5rem);
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--ghost-white);
    text-shadow: 0 0 20px rgba(0, 240, 255, 0.3);
    line-height: 1.1;
    margin-bottom: 1.5rem;
    font-weight: 400;
}

.panel-signal .display-mono {
    text-shadow: 0 0 20px rgba(0, 240, 255, 0.3);
}

.panel-noise .display-mono {
    text-shadow: 0 0 20px rgba(255, 47, 147, 0.3);
}

.display-sm {
    font-size: clamp(1.5rem, 3vw + 0.3rem, 3rem);
}

.body-text {
    font-family: 'Space Grotesk', sans-serif;
    font-size: clamp(1rem, 1.2vw + 0.4rem, 1.2rem);
    font-weight: 300;
    line-height: 1.75;
    color: var(--lavender-gray);
    max-width: 500px;
    margin-bottom: 1rem;
}

.pixel-label {
    font-family: 'Silkscreen', monospace;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.2em;
    color: var(--electric-cyan);
    display: block;
    margin-bottom: 1rem;
    opacity: 0.8;
    font-weight: 400;
}

.panel-noise .pixel-label,
.noise-label {
    color: var(--hot-magenta);
}

.card-caption {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 0.8rem;
    font-weight: 300;
    color: var(--lavender-gray);
    opacity: 0.6;
    margin-top: 0.75rem;
}

/* Title Split */

.title-split {
    display: flex;
    align-items: baseline;
    gap: 0;
    flex-wrap: wrap;
}

.title-signal {
    color: var(--electric-cyan);
    text-shadow: 0 0 30px rgba(0, 240, 255, 0.4), 0 0 60px rgba(0, 240, 255, 0.15);
}

.title-noise {
    color: var(--hot-magenta);
    text-shadow: 0 0 30px rgba(255, 47, 147, 0.4), 0 0 60px rgba(255, 47, 147, 0.15);
}

.signal-noise-label {
    display: flex;
    gap: 0;
    align-items: center;
    margin-bottom: 2rem;
}

.sn-signal {
    color: var(--electric-cyan);
}

.sn-divider {
    color: var(--lavender-gray);
    opacity: 0.4;
}

.sn-noise {
    color: var(--hot-magenta);
}

/* ===== Scene Counter ===== */

.scene-counter {
    position: fixed;
    bottom: 24px;
    left: 24px;
    z-index: 100;
    display: flex;
    align-items: center;
    gap: 12px;
}

.counter-num {
    position: absolute;
    top: 50%;
    left: 22px;
    transform: translate(-50%, -50%);
    font-family: 'Share Tech Mono', monospace;
    font-size: 12px;
    color: var(--electric-cyan);
    z-index: 2;
    font-weight: 400;
}

.counter-ring {
    width: 44px;
    height: 44px;
    flex-shrink: 0;
}

.ring-bg {
    fill: none;
    stroke: var(--frosted-violet);
    stroke-width: 2;
}

.ring-progress {
    fill: none;
    stroke: var(--electric-cyan);
    stroke-width: 2;
    stroke-dasharray: 125.66;
    stroke-dashoffset: 125.66;
    transform: rotate(-90deg);
    transform-origin: center;
    transition: stroke-dashoffset 200ms linear;
    stroke-linecap: round;
}

.counter-label {
    font-family: 'Silkscreen', monospace;
    font-size: 10px;
    letter-spacing: 0.15em;
    color: var(--electric-cyan);
    opacity: 0.6;
    text-transform: uppercase;
    white-space: nowrap;
    transition: opacity 300ms ease;
}

/* ===== Split Layout ===== */

.split-layout {
    display: flex;
    min-height: 100vh;
    position: relative;
}

.panel {
    position: relative;
    overflow-y: auto;
    overflow-x: hidden;
}

.panel-signal {
    flex: 0 0 55%;
    background-color: var(--midnight-indigo);
    z-index: 2;
}

.panel-noise {
    flex: 0 0 45%;
    background: var(--dark-plum);
    z-index: 2;
    padding: 0 2rem;
    transition: background 800ms ease;
}

/* Gradient shift as user scrolls deeper */
.panel-noise.depth-1 { background: #1A0A2E; }
.panel-noise.depth-2 { background: #1F0C34; }
.panel-noise.depth-3 { background: #240E3A; }
.panel-noise.depth-4 { background: #2A1040; }
.panel-noise.depth-5 { background: #300F45; }

/* ===== Scanlines ===== */

.scanlines {
    position: absolute;
    inset: 0;
    background: repeating-linear-gradient(
        0deg,
        transparent,
        transparent 3px,
        rgba(255, 255, 255, 0.03) 3px,
        rgba(255, 255, 255, 0.03) 4px
    );
    pointer-events: none;
    z-index: 3;
}

/* ===== Background Decoration Curves ===== */

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

.bg-curves-noise {
    opacity: 0.8;
}

/* ===== Curve Divider ===== */

.curve-divider {
    position: absolute;
    left: calc(55% - 30px);
    top: 0;
    width: 60px;
    height: 100%;
    z-index: 5;
    overflow: visible;
}

.curve-path {
    fill: none;
    stroke: var(--electric-cyan);
    stroke-width: 2;
}

.curve-glow {
    fill: none;
    stroke: var(--electric-cyan);
    stroke-width: 2;
    opacity: 0.4;
}

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

.curve-path {
    animation: breathe 4s ease-in-out infinite;
}

/* ===== Hero Arc ===== */

.hero-arc {
    position: absolute;
    left: -20px;
    top: 5%;
    height: 90%;
    width: 60px;
    pointer-events: none;
    z-index: 0;
}

.hero-arc-svg {
    width: 100%;
    height: 100%;
}

.hero-arc-path {
    animation: hero-arc-glow 5s ease-in-out infinite;
}

@keyframes hero-arc-glow {
    0%, 100% { stroke: rgba(0, 240, 255, 0.15); }
    50% { stroke: rgba(0, 240, 255, 0.35); }
}

/* ===== Scenes (Left Panel) ===== */

.scene {
    min-height: 100vh;
    display: flex;
    align-items: center;
    padding: 5vh 5vw;
    position: relative;
    z-index: 1;
}

.scene-content {
    position: relative;
}

/* Reveal animations for scene content */
.scene-content .display-mono,
.scene-content .display-sm {
    opacity: 0;
    transform: translateY(25px);
    transition: opacity 500ms cubic-bezier(0.23, 1, 0.32, 1),
                transform 500ms cubic-bezier(0.23, 1, 0.32, 1);
}

.scene-content .label-reveal {
    opacity: 0;
    transform: translateY(15px);
    transition: opacity 400ms cubic-bezier(0.23, 1, 0.32, 1),
                transform 400ms cubic-bezier(0.23, 1, 0.32, 1);
}

.scene-content .reveal-line {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 500ms cubic-bezier(0.23, 1, 0.32, 1),
                transform 500ms cubic-bezier(0.23, 1, 0.32, 1);
}

.scene.revealed .scene-content .label-reveal {
    opacity: 0.8;
    transform: translateY(0);
}

.scene.revealed .scene-content .display-mono,
.scene.revealed .scene-content .display-sm {
    opacity: 1;
    transform: translateY(0);
}

.scene.revealed .scene-content .reveal-line {
    opacity: 1;
    transform: translateY(0);
}

/* Stagger delays for reveal-line elements */
.scene.revealed .scene-content .label-reveal { transition-delay: 0ms; }
.scene.revealed .scene-content .display-mono,
.scene.revealed .scene-content .display-sm { transition-delay: 60ms; }
.scene.revealed .scene-content .reveal-line:nth-child(3) { transition-delay: 120ms; }
.scene.revealed .scene-content .reveal-line:nth-child(4) { transition-delay: 180ms; }
.scene.revealed .scene-content .reveal-line:nth-child(5) { transition-delay: 240ms; }
.scene.revealed .scene-content .reveal-line:nth-child(6) { transition-delay: 300ms; }
.scene.revealed .scene-content .reveal-line:nth-child(7) { transition-delay: 360ms; }

/* Interference fragment */
.interference-fragment {
    margin-top: 2rem;
    padding: 1.2rem;
    border-left: 2px solid var(--hot-magenta);
    border-radius: 0 8px 8px 0;
    background: rgba(255, 47, 147, 0.05);
    opacity: 0;
    transform: translateX(30px);
    transition: opacity 600ms ease, transform 600ms ease;
}

.scene.revealed .interference-fragment,
.noise-scene.revealed .interference-fragment {
    opacity: 1;
    transform: translateX(0);
    transition-delay: 400ms;
}

.fragment-from-signal {
    border-left-color: var(--electric-cyan);
    background: rgba(0, 240, 255, 0.05);
}

/* Resonance statement */
.resonance-statement {
    margin-top: 2.5rem;
    padding: 1.5rem 0;
    position: relative;
    opacity: 0;
    transform: scale(0.95);
    transition: opacity 600ms ease, transform 600ms ease;
}

.scene.revealed .resonance-statement {
    opacity: 1;
    transform: scale(1);
    transition-delay: 350ms;
}

.resonance-text {
    font-size: clamp(1.4rem, 2.5vw + 0.3rem, 2.5rem);
    text-shadow: 0 0 25px rgba(0, 240, 255, 0.4), 0 0 50px rgba(0, 240, 255, 0.15);
    animation: resonance-pulse 3s ease-in-out infinite;
}

@keyframes resonance-pulse {
    0%, 100% {
        opacity: 0.7;
        text-shadow: 0 0 20px rgba(0, 240, 255, 0.3);
    }
    50% {
        opacity: 1;
        text-shadow: 0 0 35px rgba(0, 240, 255, 0.5), 0 0 60px rgba(0, 240, 255, 0.2);
    }
}

/* Final message section */
.final-message {
    margin-top: 3rem;
    opacity: 0;
    transition: opacity 800ms ease;
    transition-delay: 500ms;
}

.scene.revealed .final-message {
    opacity: 1;
}

/* ===== Noise Scenes (Right Panel) ===== */

.noise-scene {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 2rem 0;
    position: relative;
    z-index: 1;
}

.noise-content {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

/* Noise scene reveal */
.noise-content > * {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 400ms ease, transform 400ms ease;
}

.noise-scene.revealed .noise-content > *:nth-child(1) { opacity: 1; transform: translateY(0); transition-delay: 200ms; }
.noise-scene.revealed .noise-content > *:nth-child(2) { opacity: 1; transform: translateY(0); transition-delay: 250ms; }
.noise-scene.revealed .noise-content > *:nth-child(3) { opacity: 1; transform: translateY(0); transition-delay: 300ms; }
.noise-scene.revealed .noise-content > *:nth-child(4) { opacity: 1; transform: translateY(0); transition-delay: 350ms; }

/* ===== Cards ===== */

.card {
    background-color: var(--frosted-violet);
    border: 1px solid rgba(0, 240, 255, 0.15);
    border-radius: 8px;
    padding: 1.5rem;
    transition: transform 350ms cubic-bezier(0.34, 1.56, 0.64, 1),
                box-shadow 350ms cubic-bezier(0.34, 1.56, 0.64, 1),
                border-color 350ms ease;
    position: relative;
    backdrop-filter: blur(4px);
}

.card::before {
    content: '';
    position: absolute;
    inset: 0;
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    pointer-events: none;
}

.hover-card {
    cursor: pointer;
}

.hover-card:hover {
    transform: translateY(-8px) !important;
    box-shadow: 0 12px 30px rgba(0, 240, 255, 0.2);
    border-color: rgba(0, 240, 255, 0.4);
}

/* Magenta glow for certain cards */
.card-2:hover,
.card-4:hover,
.card-6:hover,
.card-extra:hover {
    box-shadow: 0 12px 30px rgba(255, 47, 147, 0.2);
    border-color: rgba(255, 47, 147, 0.4);
}

/* Collage layout */
.collage-frame {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.collage-card {
    transition: transform 350ms cubic-bezier(0.34, 1.56, 0.64, 1),
                box-shadow 350ms cubic-bezier(0.34, 1.56, 0.64, 1),
                border-color 350ms ease;
}

/* Interference zone */
.interference-zone {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.interference-card {
    border-color: rgba(255, 47, 147, 0.2);
}

/* Resonance cards */
.resonance-cards {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.resonance-card {
    border-color: rgba(255, 47, 147, 0.3);
}

.noise-resonance {
    text-align: center;
    margin-top: 1rem;
}

/* ===== Duotone Blocks ===== */

.duotone-block {
    width: 100%;
    height: 150px;
    border-radius: 4px;
    position: relative;
    overflow: hidden;
}

.duotone-cyan {
    background: linear-gradient(135deg, var(--midnight-indigo) 0%, #061a3a 30%, var(--electric-cyan) 100%);
    filter: contrast(1.3) saturate(1.5);
}

.duotone-cyan .duotone-pattern {
    position: absolute;
    inset: 0;
    background: repeating-linear-gradient(
        45deg,
        transparent,
        transparent 3px,
        rgba(0, 240, 255, 0.05) 3px,
        rgba(0, 240, 255, 0.05) 6px
    );
}

.duotone-magenta {
    background: linear-gradient(135deg, var(--dark-plum) 0%, #2a0a30 30%, var(--hot-magenta) 100%);
    filter: contrast(1.3) saturate(1.5);
}

.duotone-magenta .duotone-pattern {
    position: absolute;
    inset: 0;
    background: repeating-linear-gradient(
        -45deg,
        transparent,
        transparent 3px,
        rgba(255, 47, 147, 0.05) 3px,
        rgba(255, 47, 147, 0.05) 6px
    );
}

.duotone-intense {
    filter: contrast(1.5) saturate(2);
}

/* Circuit Doodle overlays */
.circuit-doodle {
    position: absolute;
    bottom: 8px;
    right: 8px;
    width: 80px;
    height: 50px;
    opacity: 0.6;
}

/* ===== Decorative Curves ===== */

.deco-curve {
    opacity: 0.2;
    color: var(--electric-cyan);
    width: 200px;
    display: flex;
    align-items: center;
}

.deco-1 {
    margin-left: 0;
}

.deco-2 {
    color: var(--hot-magenta);
    margin-left: auto;
}

.deco-curve svg {
    width: 100%;
    height: auto;
}

/* ===== End Message ===== */

.noise-body {
    color: var(--ghost-white);
    text-shadow: 0 0 15px rgba(255, 47, 147, 0.2);
    font-size: clamp(1rem, 1.1vw + 0.4rem, 1.15rem);
}

.end-message {
    border-color: rgba(255, 47, 147, 0.25);
}

/* Convergence content */
.convergence-content {
    align-items: center;
}

.convergence-curves {
    width: 100%;
    max-width: 300px;
    margin: 0 auto;
}

.convergence-svg {
    width: 100%;
    height: auto;
    animation: convergence-flow 6s ease-in-out infinite;
}

@keyframes convergence-flow {
    0%, 100% {
        opacity: 0.5;
        transform: translateX(0);
    }
    50% {
        opacity: 1;
        transform: translateX(5px);
    }
}

/* ===== Convergence State ===== */

body.converged .panel-signal {
    background: linear-gradient(180deg, var(--midnight-indigo), var(--dark-plum));
}

body.converged .panel-noise {
    background: linear-gradient(180deg, var(--dark-plum), var(--midnight-indigo)) !important;
}

/* ===== Responsive ===== */

@media (max-width: 768px) {
    .split-layout {
        flex-direction: column;
    }

    .panel-signal,
    .panel-noise {
        flex: none;
        width: 100%;
    }

    .curve-divider {
        display: none;
    }

    .scene {
        min-height: 80vh;
        padding: 4vh 4vw;
    }

    .noise-scene {
        min-height: 60vh;
        padding: 3rem 1.5rem;
    }

    .display-mono {
        font-size: 2.5rem;
    }

    .display-sm {
        font-size: 1.6rem;
    }

    .body-text {
        max-width: 100%;
    }

    .hero-arc {
        display: none;
    }

    .scene-counter {
        bottom: 16px;
        left: 16px;
    }

    .counter-label {
        display: none;
    }
}

@media (max-width: 480px) {
    .display-mono {
        font-size: 2rem;
        letter-spacing: 0.08em;
    }

    .display-sm {
        font-size: 1.4rem;
    }

    .scene {
        min-height: 70vh;
        padding: 3vh 3vw;
    }

    .noise-scene {
        min-height: 50vh;
        padding: 2rem 1rem;
        gap: 1rem;
    }

    .card {
        padding: 1rem;
    }

    .duotone-block {
        height: 100px;
    }

    .pixel-label {
        font-size: 10px;
        letter-spacing: 0.15em;
    }

    .body-text {
        font-size: 0.95rem;
    }

    .scene-counter {
        width: 40px;
        height: 40px;
        bottom: 16px;
        left: 16px;
    }

    .counter-num {
        font-size: 10px;
    }

    .counter-ring {
        width: 40px;
        height: 40px;
    }

    .ring-bg,
    .ring-progress {
        stroke-width: 1.5;
    }

    .title-split {
        flex-direction: column;
    }
}
