:root {
    --bg-color: #121212;
    --text-color: #ffffff;
    --neon-blue: #0078D4;
    --neon-gold: #FFD43B;
    --neon-teal: #008080; /* React color roughly */
    --piston-grey: #333;
    --danger-red: #ff4444;
}

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

body {
    background-color: var(--bg-color);
    color: var(--text-color);
    font-family: 'Roboto', 'Segoe UI', sans-serif;
    overflow: hidden; /* Prevent default scroll, handle in container */
}

/* Scroll Container */
.scroll-container {
    height: 100vh;
    width: 100%;
    overflow-y: scroll;
    scroll-snap-type: y mandatory;
    scroll-behavior: smooth;
    overflow-x: hidden; /* Ensure no horizontal scroll */
}

.slide {
    height: 100vh;
    width: 100%;
    scroll-snap-align: start;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    position: relative;
    padding: 2rem;
    overflow: hidden;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
}

.slide::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.7); /* Overlay to ensure text readability */
    z-index: 0;
}

.content {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 100%;
    max-width: 1200px;
    text-align: center;
    position: relative;
    z-index: 1; /* Ensure content is above overlay */
}

/* Backgrounds */
/* Intro uses same as page 1 or generic? Let's use page1 for intro too or a gradient */
#slide-intro { 
    background: radial-gradient(circle, #1a1a1a 0%, #000 100%); 
    position: relative;
}

#intro-canvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0; /* Behind content (which is z-index 1) but above background */
    pointer-events: none;
}

#slide-1 { background-image: url('page1.png'); }
#slide-2 { background-image: url('page2.png'); }
#slide-3 { background-image: url('page3.png'); }
#slide-4 { background-image: url('page4.png'); }
/* Slide 5 is the Blueprint - handled via CSS rules below, no image file yet */
#slide-5 { background-color: #0a0a0a; background-image: linear-gradient(rgba(255, 255, 255, 0.03) 1px, transparent 1px), linear-gradient(90deg, rgba(255, 255, 255, 0.03) 1px, transparent 1px); background-size: 40px 40px; }
#slide-6 { background-image: url('page5.png'); }
#slide-7 { background-image: url('page6.png'); }

/* Blueprint Slide Styles */
.blueprint-container {
    display: flex;
    width: 90%;
    height: 60vh;
    border: 2px solid #333;
    position: relative;
    background: #000;
}

.blueprint-split {
    position: absolute;
    left: 50%;
    top: 0;
    bottom: 0;
    width: 2px;
    background: white;
    box-shadow: 0 0 15px white;
    transform: translateX(-50%);
    z-index: 10;
}

.bp-pane {
    width: 50%;
    height: 100%;
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.bp-label {
    position: absolute;
    top: 20px;
    padding: 10px 20px;
    border-radius: 4px;
    font-weight: bold;
    text-transform: uppercase;
    font-size: 0.9rem;
    z-index: 5;
}

.label-tax {
    border: 1px solid var(--danger-red);
    color: var(--danger-red);
    box-shadow: 0 0 10px var(--danger-red);
}

.label-eff {
    border: 1px solid var(--neon-blue);
    color: var(--neon-blue);
    box-shadow: 0 0 10px var(--neon-blue);
}

.box-user, .box-server {
    width: 80px;
    height: 50px;
    border: 2px solid #555;
    background: #222;
    display: flex;
    justify-content: center;
    align-items: center;
    color: #aaa;
    font-size: 0.8rem;
    position: absolute;
    z-index: 2;
}

.box-user { top: 20%; left: 50%; transform: translateX(-50%); }
.box-server { bottom: 20%; left: 50%; transform: translateX(-50%); }

/* Left Side: Tangled Wires */
.tangled-wires {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

/* Right Side: Blue Beam */
.blue-beam {
    position: absolute;
    top: 20%;
    bottom: 20%;
    left: 50%;
    width: 4px;
    background: var(--neon-blue);
    transform: translateX(-50%);
    box-shadow: 0 0 20px var(--neon-blue);
    animation: beamPulse 2s infinite;
}

@keyframes beamPulse {
    0% { opacity: 0.8; box-shadow: 0 0 15px var(--neon-blue); }
    50% { opacity: 1; box-shadow: 0 0 25px var(--neon-blue), 0 0 50px var(--neon-blue); }
    100% { opacity: 0.8; box-shadow: 0 0 15px var(--neon-blue); }
}

h1 {
    font-size: 3rem;
    margin-bottom: 0.5rem;
    text-transform: uppercase;
    letter-spacing: 2px;
    text-align: center;
    text-shadow: 0 0 10px rgba(255,255,255,0.1);
}

h2 {
    font-size: 1.5rem;
    font-weight: 300;
    color: #aaa;
    margin-bottom: 2rem;
    text-align: center;
}

/* Top Banner */
.banner {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 60px;
    background: rgba(0, 0, 0, 0.9);
    border-bottom: 1px solid #333;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 2rem;
    z-index: 2000;
    backdrop-filter: blur(5px);
}

.banner-title {
    font-size: 1.2rem;
    font-weight: 700;
    letter-spacing: 1px;
    color: white;
    text-decoration: none;
    display: flex;
    align-items: center;
}

.banner-title span {
    color: var(--neon-blue);
    margin-right: 5px;
}

.faq-btn {
    background: transparent;
    border: 1px solid var(--neon-gold);
    color: var(--neon-gold);
    padding: 8px 15px;
    border-radius: 4px;
    text-decoration: none;
    font-size: 0.9rem;
    transition: all 0.3s;
    font-weight: bold;
}

.faq-btn:hover {
    background: var(--neon-gold);
    color: black;
    box-shadow: 0 0 10px var(--neon-gold);
}


/* Pager Navigation */
.pager {
    position: fixed;
    right: 20px;
    top: 50%;
    transform: translateY(-50%);
    z-index: 1000;
    height: 250px; /* Increased height for extra dot */
    display: flex;
    flex-direction: column;
    align-items: center;
}

.pager ul {
    list-style: none;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    height: 100%;
    position: relative;
    z-index: 2;
}

.pager .progress-line {
    position: absolute;
    top: 0;
    bottom: 0;
    width: 2px;
    background: rgba(255,255,255,0.2);
    z-index: 1;
}

.pip {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: #555;
    border: none;
    cursor: pointer;
    position: relative;
    transition: all 0.3s ease;
    outline: none;
}

.pip:focus-visible {
    box-shadow: 0 0 0 2px white;
}

.pip.active {
    transform: scale(1.4);
    background: white;
    box-shadow: 0 0 10px white;
}

/* Tooltip */
.tooltip {
    position: absolute;
    right: 25px;
    top: 50%;
    transform: translateY(-50%) translateX(10px);
    background: rgba(0,0,0,0.8);
    padding: 5px 10px;
    border-radius: 4px;
    font-size: 0.8rem;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: all 0.3s ease;
}

.pip:hover .tooltip {
    opacity: 1;
    transform: translateY(-50%) translateX(0);
}


/* Audio Controls */
.audio-controls {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 2000;
    background: rgba(0,0,0,0.8);
    padding: 10px;
    border-radius: 30px;
    display: flex;
    align-items: center;
    gap: 10px;
    border: 1px solid #444;
}

#mute-btn {
    background: transparent;
    border: none;
    color: white;
    font-size: 1.2rem;
    cursor: pointer;
}

#volume-slider {
    width: 80px;
    cursor: pointer;
}

/* Landing Overlay */
#landing-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #000;
    z-index: 3000;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: opacity 1s ease;
}

#landing-overlay.hidden {
    opacity: 0;
    pointer-events: none;
}

.landing-content {
    text-align: center;
    animation: fadeIn 2s ease;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

#start-btn {
    margin-top: 2rem;
    padding: 15px 40px;
    background: var(--neon-blue);
    color: white;
    border: none;
    font-size: 1.5rem;
    font-weight: bold;
    cursor: pointer;
    border-radius: 5px;
    box-shadow: 0 0 20px var(--neon-blue);
    transition: all 0.3s;
}

#start-btn:hover {
    background: white;
    color: var(--neon-blue);
    transform: scale(1.05);
}

/* Transcript Modal */
#transcript-modal {
    position: fixed;
    bottom: 80px;
    left: 20px; /* Or relative to icon */
    width: 300px;
    max-height: 400px;
    background: rgba(0,0,0,0.9);
    border: 1px solid var(--neon-gold);
    border-radius: 8px;
    z-index: 2500;
    padding: 15px;
    overflow-y: auto;
    box-shadow: 0 0 15px rgba(0,0,0,0.5);
    transition: opacity 0.3s;
}

#transcript-modal.hidden {
    opacity: 0;
    pointer-events: none;
}

.transcript-content {
    position: relative;
    color: #ddd;
    font-size: 0.9rem;
    line-height: 1.6;
}

#close-transcript {
    position: absolute;
    top: -10px;
    right: -10px;
    background: transparent;
    border: none;
    color: #aaa;
    font-size: 1.5rem;
    cursor: pointer;
}

#close-transcript:hover { color: white; }

.transcript-toggle {
    position: absolute;
    bottom: 20px;
    left: 20px;
    background: transparent;
    border: 1px solid rgba(255,255,255,0.3);
    color: rgba(255,255,255,0.7);
    padding: 5px 10px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.8rem;
    display: flex;
    align-items: center;
    gap: 5px;
    transition: all 0.3s;
    z-index: 10;
}

.transcript-toggle:hover {
    border-color: var(--neon-gold);
    color: var(--neon-gold);
    background: rgba(0,0,0,0.5);
}


/* Slide 1: DNA */
.dna-container {
    position: relative;
    width: 300px;
    height: 400px;
    display: flex;
    justify-content: center;
    align-items: center;
}

.dna-strand {
    width: 20px;
    height: 100%;
    position: absolute;
    border-radius: 10px;
    transition: all 0.5s ease;
    display: flex;
    justify-content: center;
    align-items: center;
}

.blue-strand {
    background: linear-gradient(180deg, var(--neon-blue), transparent 50%, var(--neon-blue));
    left: 100px;
    animation: spiralBlue 3s infinite ease-in-out alternate;
    box-shadow: 0 0 15px var(--neon-blue);
}

.gold-strand {
    background: linear-gradient(180deg, var(--neon-gold), transparent 50%, var(--neon-gold));
    right: 100px;
    animation: spiralGold 3s infinite ease-in-out alternate;
    box-shadow: 0 0 15px var(--neon-gold);
}

@keyframes spiralBlue {
    0% { transform: translateX(0) scale(1); z-index: 1; }
    100% { transform: translateX(80px) scale(0.8); z-index: 0; }
}

@keyframes spiralGold {
    0% { transform: translateX(0) scale(0.8); z-index: 0; }
    100% { transform: translateX(-80px) scale(1); z-index: 1; }
}

.dna-strand .label {
    opacity: 0;
    background: rgba(0,0,0,0.8);
    padding: 5px;
    border-radius: 4px;
    pointer-events: none;
    white-space: nowrap;
    transition: opacity 0.3s;
}

.dna-strand:hover .label, .dna-strand:focus .label {
    opacity: 1;
}

/* Slide 2: Engine */
.engine-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-top: 2rem;
}

.engine-block {
    width: 400px;
    height: 200px;
    background: #222;
    border: 2px solid #444;
    border-radius: 10px;
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
    box-shadow: inset 0 0 20px #000;
}

.piston-group {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    grid-template-rows: repeat(2, 1fr);
    gap: 10px;
    width: 90%;
    height: 80%;
}

.piston {
    background: var(--piston-grey);
    border-radius: 4px;
    transition: background 0.1s, transform 0.1s;
    border: 1px solid #555;
}

/* Engine States */
/* Python State */
.slide[data-engine-state="python"] .piston.p1 {
    animation: pistonFireSlow 2s infinite;
    background: var(--neon-gold);
    box-shadow: 0 0 10px var(--neon-gold);
}

/* C# State */
.slide[data-engine-state="csharp"] .piston {
    animation: pistonFireFast 0.2s infinite alternate;
    background: var(--neon-blue);
    box-shadow: 0 0 8px var(--neon-blue);
}

.slide[data-engine-state="csharp"] .piston:nth-child(even) {
    animation-delay: 0.1s;
}

@keyframes pistonFireSlow {
    0%, 80% { opacity: 0.3; transform: scaleY(0.9); }
    90% { opacity: 1; transform: scaleY(1); }
    100% { opacity: 0.3; transform: scaleY(0.9); }
}

@keyframes pistonFireFast {
    0% { transform: translateY(0); opacity: 0.8; }
    100% { transform: translateY(-5px); opacity: 1; box-shadow: 0 0 15px var(--neon-blue); }
}

.controls {
    margin-bottom: 2rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
}

.toggle-btn {
    background: #333;
    border: 2px solid #555;
    color: white;
    padding: 10px 20px;
    cursor: pointer;
    font-size: 1rem;
    border-radius: 20px;
    transition: all 0.3s;
    width: 250px;
    display: flex;
    justify-content: space-around;
}

.toggle-btn[aria-pressed="true"] {
    border-color: var(--neon-blue);
    background: #001a33;
}
.toggle-btn[aria-pressed="false"] {
    border-color: var(--neon-gold);
    background: #331a00;
}

.toggle-text { opacity: 0.5; }
.toggle-btn[aria-pressed="false"] .python-text { opacity: 1; color: var(--neon-gold); font-weight: bold; }
.toggle-btn[aria-pressed="true"] .csharp-text { opacity: 1; color: var(--neon-blue); font-weight: bold; }


/* Slide 3: Airlock */
.airlock-container {
    width: 500px;
    height: 150px;
    display: flex;
    align-items: center;
    background: #1a1a1a;
    border: 1px solid #333;
    position: relative;
    overflow: hidden;
    border-radius: 8px;
}

.tunnel {
    flex-grow: 1;
    height: 100%;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}

.energy-shield {
    width: 10px;
    height: 100%;
    background: transparent;
    border-right: 2px solid #333;
    transition: all 0.3s;
    position: absolute;
    left: 50%;
    top: 0;
    z-index: 10;
}

.energy-shield.active {
    background: rgba(0, 120, 212, 0.3);
    border-right: 2px solid var(--neon-blue);
    box-shadow: 0 0 15px var(--neon-blue);
}

.data-object {
    position: absolute;
    left: 0;
    animation: moveRight 2s linear forwards;
}

.sphere {
    width: 20px;
    height: 20px;
    background: var(--neon-blue);
    border-radius: 50%;
    box-shadow: 0 0 5px var(--neon-blue);
}

.spike {
    width: 20px;
    height: 20px;
    background: var(--danger-red);
    clip-path: polygon(50% 0%, 0% 100%, 100% 100%);
    box-shadow: 0 0 5px var(--danger-red);
}

@keyframes moveRight {
    0% { left: 0; opacity: 1; }
    45% { left: 45%; opacity: 1; } /* Hit shield */
    55% { left: 55%; }
    100% { left: 100%; opacity: 0; }
}

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

.explosion {
    animation: explode 0.5s ease-out forwards !important;
}

.action-btn {
    padding: 10px 20px;
    background: var(--neon-blue);
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-weight: bold;
    font-size: 1rem;
    transition: transform 0.1s;
}

.action-btn:active { transform: scale(0.95); }

/* Slide 4: Integration */
.integration-container {
    width: 600px;
    height: 300px;
    display: flex;
    overflow: hidden;
    border: 1px solid #333;
    position: relative;
}

.scene {
    width: 50%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    flex-direction: column;
    transition: all 0.5s ease;
    opacity: 0.5;
    transform: scale(0.9);
}

.scene.active {
    opacity: 1;
    transform: scale(1);
    background-color: rgba(255,255,255,0.05);
}

.chef {
    font-size: 3rem;
    color: var(--neon-gold);
    text-shadow: 0 0 10px var(--neon-gold);
    transition: transform 1s; /* Slow */
}

.drone {
    font-size: 3rem;
    color: var(--neon-blue);
    text-shadow: 0 0 10px var(--neon-blue);
    transition: transform 0.1s; /* Fast */
}

/* Animations based on slider */
/* Handled via JS transforming elements */


/* Slide 5: Ecosystem */
.network-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 700px;
    position: relative;
}

.node {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    border: 2px solid;
    font-weight: bold;
    background: #1a1a1a;
    z-index: 2;
}

.csharp-node { border-color: var(--neon-blue); color: var(--neon-blue); box-shadow: 0 0 15px rgba(0,120,212,0.3); }
.python-node { border-color: var(--neon-gold); color: var(--neon-gold); box-shadow: 0 0 15px rgba(255,212,59,0.3); }

.api-gateway {
    width: 80px;
    height: 80px;
    border: 2px solid white;
    transform: rotate(45deg);
    display: flex;
    justify-content: center;
    align-items: center;
    background: #222;
    z-index: 2;
}
.api-gateway span { transform: rotate(-45deg); text-align: center; font-size: 0.8rem; }

.wire {
    flex-grow: 1;
    height: 2px;
    background: #333;
    position: relative;
}

.packet, .packet-gold {
    width: 15px;
    height: 15px;
    background: var(--neon-blue);
    border-radius: 50%;
    position: absolute;
    top: -6px;
    left: 0;
    box-shadow: 0 0 10px var(--neon-blue);
}

/* Animation sequence defined in keyframes, triggered maybe or infinite */
.packet {
    animation: flowLeftToRight 4s infinite linear;
}

.packet-gold {
    animation: flowRightHalf 4s infinite linear;
    background: var(--neon-gold);
    box-shadow: 0 0 10px var(--neon-gold);
    opacity: 0; /* Hidden initially */
}

@keyframes flowLeftToRight {
    0% { left: 0; background: var(--neon-blue); box-shadow: 0 0 10px var(--neon-blue); }
    40% { left: 45%; background: var(--neon-blue); } /* Reach Gateway */
    45% { background: white; box-shadow: 0 0 10px white; } /* Inside Gateway */
    55% { background: white; }
    60% { left: 55%; background: var(--neon-gold); box-shadow: 0 0 10px var(--neon-gold); opacity: 1;}
    100% { left: 100%; background: var(--neon-gold); opacity: 0;}
}

/* We need 2 packets to simulate the transformation seamlessly or just one changing color.
   The single packet animation above handles color change. 
   But the DOM structure has 2 wires.
   Let's adjust. I'll make the packet traverse the whole container visually.
   Actually, let's keep it simple.
   Packet 1 travels wire 1 (Blue -> White).
   Packet 2 travels wire 2 (White -> Gold).
*/

.wire .packet {
    animation: travelWire1 3s infinite linear;
}
.wire .packet-gold { /* Actually in the second wire div */
    animation: travelWire2 3s infinite linear;
    animation-delay: 1.5s; /* Sync with first packet arrival */
}

@keyframes travelWire1 {
    0% { left: 0; opacity: 1; background: var(--neon-blue); }
    90% { left: 100%; opacity: 1; background: white; box-shadow: 0 0 10px white; }
    100% { left: 100%; opacity: 0; }
}
@keyframes travelWire2 {
    0% { left: 0; opacity: 0; background: white; }
    10% { opacity: 1; }
    100% { left: 100%; opacity: 1; background: var(--neon-gold); box-shadow: 0 0 10px var(--neon-gold); }
}


.packet-tooltip {
    position: absolute;
    top: -50px;
    left: 50%;
    transform: translateX(-50%);
    background: #fff;
    color: #000;
    padding: 5px;
    border-radius: 4px;
    font-family: monospace;
    display: none;
}

.api-gateway:hover + .wire .packet-gold {
    /* Hard to target via CSS only based on complex interaction, relying on Hover on gateway for tooltip */
}
.api-gateway:hover ~ .packet-tooltip {
    display: block;
}


/* Slide 6: Matrix */
.matrix-container {
    display: flex;
    gap: 2rem;
}

.card {
    width: 200px;
    height: 300px;
    perspective: 1000px;
    cursor: pointer;
}

.card-inner {
    position: relative;
    width: 100%;
    height: 100%;
    text-align: center;
    transition: transform 0.6s;
    transform-style: preserve-3d;
}

.card.flipped .card-inner {
    transform: rotateY(180deg);
}

.card-front, .card-back {
    position: absolute;
    width: 100%;
    height: 100%;
    backface-visibility: hidden;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    border-radius: 10px;
    border: 1px solid #444;
    background: #1a1a1a;
    box-shadow: 0 4px 8px rgba(0,0,0,0.5);
}

.card-front h3 { color: #fff; }
.card-front p { color: #aaa; margin-top: 10px; }

.card-back {
    transform: rotateY(180deg);
    background: #222;
}

.blue-back { border: 2px solid var(--neon-blue); color: var(--neon-blue); }
.gold-back { border: 2px solid var(--neon-gold); color: var(--neon-gold); }
.teal-back { border: 2px solid var(--neon-teal); color: var(--neon-teal); }
.purple-back { border: 2px solid #9b59b6; color: #9b59b6; }
.silver-back { border: 2px solid #bdc3c7; color: #bdc3c7; }
