/* HAL 9000 Presentation Theme */
:root {
    --hal-red: #d00000;
    --hal-red-bright: #ff4d4d;
    --hal-blue: #00aeef;
    --hal-yellow: #ffd700;
    --hal-black: #000000;
    --hal-white: #ffffff;
    --hal-gray: #b0b0b0;
    --hal-dark-gray: #333333;
    --font-mono: 'Space Mono', 'Courier New', monospace;
    --font-display: 'Orbitron', sans-serif;
}

/* Override Reveal.js defaults */
.reveal {
    font-family: var(--font-mono);
    color: var(--hal-white);
    background: var(--hal-black);
    font-size: 18px;
}

.reveal h1, .reveal h2, .reveal h3, .reveal h4, .reveal h5, .reveal h6 {
    font-family: var(--font-display);
    color: var(--hal-yellow);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    text-shadow: 0 0 10px var(--hal-yellow);
}

.reveal h1 {
    font-size: 2.2em;
    margin-bottom: 0.5em;
}

.reveal h2 {
    font-size: 1.5em;
    margin-bottom: 1em;
}

.reveal p, .reveal li {
    color: var(--hal-gray);
    line-height: 1.6;
}

.reveal strong {
    color: var(--hal-white);
    font-weight: bold;
}

.reveal a {
    color: var(--hal-blue);
    text-decoration: none;
    transition: color 0.3s ease;
}

.reveal a:hover {
    color: var(--hal-red-bright);
    text-shadow: 0 0 5px var(--hal-red);
}

/* HAL Eye Animations */
.hal-eye-large {
    width: 150px;
    height: 150px;
    border-radius: 50%;
    background: radial-gradient(circle at 45% 45%, var(--hal-red-bright) 0%, var(--hal-red) 45%, #700000 70%, #150000 100%);
    box-shadow: 0 0 50px var(--hal-red), inset 0 0 20px #000;
    border: 3px solid var(--hal-red-bright);
    margin: 2rem auto;
    animation: hal-pulse 3s ease-in-out infinite;
}

.hal-eye-demo {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    background: radial-gradient(circle at 45% 45%, var(--hal-red-bright) 0%, var(--hal-red) 45%, #700000 70%, #150000 100%);
    box-shadow: 0 0 40px var(--hal-red), inset 0 0 15px #000;
    border: 2px solid var(--hal-red-bright);
    margin: 1rem auto;
    animation: hal-pulse 2s ease-in-out infinite;
}

.hal-eye-small {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: radial-gradient(circle at 45% 45%, var(--hal-red-bright) 0%, var(--hal-red) 45%, #700000 70%, #150000 100%);
    box-shadow: 0 0 10px var(--hal-red), inset 0 0 5px #000;
    border: 1px solid var(--hal-red-bright);
    display: inline-block;
    vertical-align: middle;
    animation: hal-pulse 1.5s ease-in-out infinite;
}

.hal-eye-mini {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: radial-gradient(circle at 45% 45%, var(--hal-red-bright) 0%, var(--hal-red) 45%, #700000 70%, #150000 100%);
    box-shadow: 0 0 8px var(--hal-red);
    border: 1px solid var(--hal-red-bright);
    display: inline-block;
    vertical-align: middle;
    margin-right: 8px;
    animation: hal-pulse 1s ease-in-out infinite;
}

.hal-eye-image {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 2px solid var(--hal-red-bright);
    box-shadow: 0 0 15px var(--hal-red);
    display: inline-block;
    vertical-align: middle;
    animation: hal-pulse 2s ease-in-out infinite;
    object-fit: cover;
    margin-right: 1rem;
}

.hal-eye-stationary {
    width: 200px;
    height: 200px;
    border-radius: 50%;
    border: 2px solid var(--hal-red-bright);
    box-shadow: 0 0 15px var(--hal-red);
    display: inline-block;
    vertical-align: middle;
    object-fit: cover;
    margin-right: 1rem;
    animation: none !important;
    transform: none !important;
}

.hal-eye-interactive {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    background: radial-gradient(circle at 45% 45%, var(--hal-red-bright) 0%, var(--hal-red) 45%, #700000 70%, #150000 100%);
    box-shadow: 0 0 30px var(--hal-red), inset 0 0 10px #000;
    border: 2px solid var(--hal-red-bright);
    margin: 1rem auto 2rem;
    animation: hal-interactive 4s ease-in-out infinite;
    cursor: pointer;
}

.hal-eye-final {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: radial-gradient(circle at 45% 45%, var(--hal-red-bright) 0%, var(--hal-red) 45%, #700000 70%, #150000 100%);
    box-shadow: 0 0 25px var(--hal-red), inset 0 0 8px #000;
    border: 2px solid var(--hal-red-bright);
    margin: 1rem auto;
    animation: hal-farewell 6s ease-in-out infinite;
}

@keyframes hal-pulse {
    0%, 100% { box-shadow: 0 0 20px var(--hal-red), inset 0 0 10px #000; transform: scale(1); }
    50% { box-shadow: 0 0 30px var(--hal-red-bright), inset 0 0 15px #000; transform: scale(1.05); }
}

@keyframes hal-interactive {
    0%, 100% { box-shadow: 0 0 30px var(--hal-red), inset 0 0 10px #000; transform: scale(1); }
    25% { box-shadow: 0 0 40px var(--hal-red-bright), inset 0 0 15px #000; transform: scale(1.1); }
    75% { box-shadow: 0 0 35px var(--hal-red), inset 0 0 12px #000; transform: scale(1.05); }
}

@keyframes hal-farewell {
    0%, 90%, 100% { box-shadow: 0 0 25px var(--hal-red), inset 0 0 8px #000; opacity: 1; }
    95% { box-shadow: 0 0 50px var(--hal-red-bright), inset 0 0 20px #000; opacity: 0.7; }
}

/* Title Slide Styling */
.title-slide h1 {
    font-size: 3em;
    color: var(--hal-red);
    text-shadow: 0 0 20px var(--hal-red);
    margin-bottom: 0.2em;
}

title-slide h2 {
    font-size: 1.5em;
    color: var(--hal-blue);
    text-shadow: 0 0 10px var(--hal-blue);
    margin-bottom: 1em;
}

title-slide .subtitle {
    font-size: 1.1em;
    color: var(--hal-gray);
    margin-bottom: 2em;
}

/* Terminal Prompt Animation */
.terminal-prompt {
    font-family: var(--font-mono);
    background: var(--hal-dark-gray);
    border: 2px solid var(--hal-red);
    border-radius: 8px;
    padding: 1rem 1.5rem;
    margin: 2rem auto;
    max-width: 600px;
    box-shadow: 0 0 20px rgba(208, 0, 0, 0.3);
}

.terminal-prompt .prompt {
    color: var(--hal-red);
    font-weight: bold;
}

.terminal-prompt .typing-text {
    color: var(--hal-white);
    animation: typing 3s steps(30) 1s forwards;
    border-right: 2px solid var(--hal-red);
    white-space: nowrap;
    overflow: hidden;
    width: 0;
}

@keyframes typing {
    from { width: 0; }
    to { width: 100%; }
}

/* Interface Showcase */
.interface-showcase {
    display: flex;
    align-items: center;
    justify-content: space-around;
    margin: 2rem 0;
}

.feature-list ul {
    list-style: none;
    padding: 0;
}

.feature-list li {
    font-size: 1.1em;
    margin: 0.8em 0;
    padding-left: 1.5em;
    position: relative;
}

.feature-list li:before {
    content: "▶";
    color: var(--hal-red);
    position: absolute;
    left: 0;
    font-weight: bold;
}

.live-preview {
    margin: 2rem 0;
    text-align: center;
}

.live-preview iframe {
    box-shadow: 0 0 30px rgba(208, 0, 0, 0.5);
    border-radius: 8px;
}

/* Architecture Diagram */
.architecture-diagram {
    margin: 2rem 0;
}

.flow-container {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 1rem;
}

.flow-item {
    background: var(--hal-dark-gray);
    border: 2px solid var(--hal-blue);
    border-radius: 12px;
    padding: 1rem;
    text-align: center;
    min-width: 120px;
    box-shadow: 0 0 15px rgba(0, 174, 239, 0.3);
    transition: all 0.3s ease;
}

.flow-item:hover {
    transform: scale(1.05);
    box-shadow: 0 0 25px rgba(0, 174, 239, 0.5);
}

.flow-item.user { border-color: var(--hal-yellow); }
.flow-item.frontend { border-color: var(--hal-blue); }
.flow-item.proxy { border-color: var(--hal-red); }
.flow-item.ai { border-color: var(--hal-red-bright); }

.flow-icon {
    font-size: 2em;
    margin-bottom: 0.5rem;
}

.flow-label {
    font-size: 0.9em;
    color: var(--hal-white);
    font-weight: bold;
}

.flow-arrow {
    font-size: 2em;
    color: var(--hal-red);
    font-weight: bold;
}

.tech-details {
    margin-top: 2rem;
    background: var(--hal-dark-gray);
    padding: 1.5rem;
    border-radius: 8px;
    border-left: 4px solid var(--hal-blue);
}

/* Console Styling */
.demo-container {
    display: flex;
    gap: 2rem;
    align-items: flex-start;
    margin: 2rem 0;
    position: relative;
}

/* Initial state: console-demo takes full width */
.console-demo {
    flex: 1;
    width: 100%;
    transition: all 0.8s ease-in-out;
    margin: 0;
}

/* Demo features initially hidden and positioned for fade-in */
.demo-features {
    flex: 0;
    width: 0;
    opacity: 0;
    overflow: hidden;
    transition: all 0.8s ease-in-out;
    transform: translateX(20px);
}

/* When fragment becomes visible, adjust layout */
.demo-container:has(.demo-features.visible) .console-demo,
.demo-container .demo-features.visible ~ .console-demo {
    flex: 1;
    width: 50%;
}

.demo-features.visible {
    flex: 1;
    width: 50%;
    opacity: 1;
    transform: translateX(0);
}

/* Fallback for browsers that don't support :has() */
.demo-container.fragment-visible .console-demo {
    flex: 1;
    width: 50%;
}

.demo-container.fragment-visible .demo-features {
    flex: 1;
    width: 50%;
    opacity: 1;
    transform: translateX(0);
}

.qa-session {
    margin: 0;
}

.hal-console-embed, .qa-console {
    background: var(--hal-black);
    border: 2px solid var(--hal-red);
    border-radius: 8px;
    box-shadow: 0 0 25px rgba(208, 0, 0, 0.4);
    max-width: 800px;
    margin: 0 auto;
}

.console-header {
    background: var(--hal-dark-gray);
    padding: 0.8rem 1.2rem;
    border-bottom: 1px solid var(--hal-red);
    display: flex;
    align-items: center;
    gap: 0.8rem;
    font-family: var(--font-display);
    font-weight: bold;
    color: var(--hal-red);
    letter-spacing: 0.1em;
}

.console-output, .qa-output {
    padding: 1.5rem;
    min-height: 150px;
    max-height: 300px;
    overflow-y: auto;
    font-family: var(--font-mono);
    line-height: 1.6;
    text-align: left;
}

.console-line {
    margin-bottom: 1rem;
    color: var(--hal-white);
}

.console-input-container, .qa-input-container {
    display: flex;
    border-top: 1px solid var(--hal-red);
}

.console-input-container input, .qa-input-container input {
    flex: 1;
    background: var(--hal-black);
    border: none;
    padding: 1rem 1.5rem;
    color: var(--hal-white);
    font-family: var(--font-mono);
    font-size: 1rem;
    outline: none;
}

.console-input-container input::placeholder, .qa-input-container input::placeholder {
    color: var(--hal-gray);
}

.console-input-container button, .qa-input-container button {
    background: var(--hal-red);
    border: none;
    padding: 1rem 2rem;
    color: var(--hal-white);
    font-family: var(--font-display);
    font-weight: bold;
    cursor: pointer;
    transition: background-color 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.console-input-container button:hover, .qa-input-container button:hover {
    background: var(--hal-red-bright);
    box-shadow: 0 0 10px var(--hal-red);
}

/* Mobile Responsive Showcase */
.mobile-showcase {
    margin: 2rem 0;
    padding: 2rem;
    background: linear-gradient(135deg, #1a1a1a 0%, #000000 100%);
    border-radius: 15px;
    position: relative;
    overflow: hidden;
}

.mobile-showcase::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: radial-gradient(circle at 50% 50%, rgba(208, 0, 0, 0.1) 0%, transparent 70%);
    pointer-events: none;
}

.device-frames {
    display: flex;
    justify-content: center;
    gap: 4rem;
    align-items: center;
    position: relative;
    z-index: 1;
}

.device {
    border: 3px solid var(--hal-red);
    border-radius: 25px;
    padding: 0.8rem;
    background: linear-gradient(145deg, #2a2a2a 0%, #1a1a1a 100%);
    box-shadow: 
        0 0 30px rgba(208, 0, 0, 0.6),
        inset 0 0 20px rgba(255, 255, 255, 0.05),
        0 8px 32px rgba(0, 0, 0, 0.8);
    position: relative;
    transition: all 0.3s ease;
    animation: device-glow 3s ease-in-out infinite;
}

.device:hover {
    transform: translateY(-5px);
    box-shadow: 
        0 0 40px rgba(208, 0, 0, 0.8),
        inset 0 0 25px rgba(255, 255, 255, 0.08),
        0 12px 40px rgba(0, 0, 0, 0.9);
}

.device.mobile {
    width: 200px;
    height: 360px;
}

.device.tablet {
    width: 320px;
    height: 240px;
}

.screen {
    width: 100%;
    height: 100%;
    background: radial-gradient(circle at center, #0a0a0a 0%, #000000 100%);
    border-radius: 15px;
    padding: 1.2rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: space-between;
    border: 1px solid rgba(208, 0, 0, 0.3);
    position: relative;
    overflow: hidden;
}

.screen::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: 
        linear-gradient(45deg, transparent 48%, rgba(208, 0, 0, 0.02) 49%, rgba(208, 0, 0, 0.02) 51%, transparent 52%),
        linear-gradient(-45deg, transparent 48%, rgba(208, 0, 0, 0.02) 49%, rgba(208, 0, 0, 0.02) 51%, transparent 52%);
    background-size: 20px 20px;
    pointer-events: none;
    opacity: 0.3;
}

.mobile-hal-eye {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: radial-gradient(circle at 40% 40%, var(--hal-red-bright) 0%, var(--hal-red) 35%, #700000 65%, #150000 100%);
    box-shadow: 
        0 0 25px var(--hal-red),
        inset 0 0 10px rgba(0, 0, 0, 0.8),
        0 0 5px rgba(255, 255, 255, 0.1);
    margin: 1rem 0;
    animation: hal-mobile-pulse 2.5s ease-in-out infinite;
    border: 2px solid rgba(208, 0, 0, 0.5);
    position: relative;
    z-index: 2;
}

.mobile-nav {
    font-size: 0.65em;
    color: var(--hal-blue);
    margin: 0.5rem 0;
    text-align: center;
    letter-spacing: 0.1em;
    font-family: var(--font-display);
    font-weight: bold;
    text-shadow: 0 0 8px var(--hal-blue);
    border-bottom: 1px solid rgba(0, 174, 239, 0.3);
    padding-bottom: 0.5rem;
}

.mobile-console {
    background: linear-gradient(145deg, #1a1a1a 0%, #0f0f0f 100%);
    padding: 0.8rem;
    border-radius: 6px;
    font-size: 0.55em;
    color: var(--hal-white);
    text-align: center;
    border: 1px solid rgba(208, 0, 0, 0.3);
    font-family: var(--font-mono);
    box-shadow: inset 0 2px 8px rgba(0, 0, 0, 0.5);
    width: 100%;
    margin-top: auto;
}

.mobile-input {
    background: linear-gradient(145deg, #2a2a2a 0%, #1a1a1a 100%);
    padding: 0.6rem;
    border-radius: 4px;
    font-size: 0.5em;
    color: var(--hal-gray);
    text-align: center;
    border: 1px solid rgba(208, 0, 0, 0.2);
    font-family: var(--font-mono);
    margin-top: 0.5rem;
}

.tablet-layout {
    display: flex;
    width: 100%;
    height: 100%;
    gap: 0.8rem;
    position: relative;
    z-index: 2;
}

.tablet-sidebar {
    width: 35%;
    background: linear-gradient(145deg, #2a2a2a 0%, #1a1a1a 100%);
    border-radius: 6px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    font-size: 0.6em;
    color: var(--hal-red);
    border: 1px solid rgba(208, 0, 0, 0.3);
    box-shadow: inset 0 2px 8px rgba(0, 0, 0, 0.5);
    font-family: var(--font-display);
    font-weight: bold;
    text-shadow: 0 0 5px var(--hal-red);
    position: relative;
}

.tablet-sidebar::before {
    content: '';
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: radial-gradient(circle at 40% 40%, var(--hal-red-bright) 0%, var(--hal-red) 50%, #700000 100%);
    box-shadow: 0 0 10px var(--hal-red);
    margin-bottom: 0.5rem;
    animation: hal-pulse 2s ease-in-out infinite;
}

.tablet-content {
    flex: 1;
    background: linear-gradient(145deg, #1a1a1a 0%, #0f0f0f 100%);
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.65em;
    color: var(--hal-white);
    border: 1px solid rgba(0, 174, 239, 0.3);
    box-shadow: inset 0 2px 8px rgba(0, 0, 0, 0.5);
    font-family: var(--font-display);
    font-weight: bold;
    text-shadow: 0 0 5px var(--hal-blue);
}

.responsive-features {
    margin-top: 2rem;
    position: relative;
    z-index: 1;
}

@keyframes device-glow {
    0%, 100% {
        box-shadow: 
            0 0 30px rgba(208, 0, 0, 0.6),
            inset 0 0 20px rgba(255, 255, 255, 0.05),
            0 8px 32px rgba(0, 0, 0, 0.8);
    }
    50% {
        box-shadow: 
            0 0 40px rgba(208, 0, 0, 0.8),
            inset 0 0 25px rgba(255, 255, 255, 0.08),
            0 8px 35px rgba(0, 0, 0, 0.9);
    }
}

@keyframes hal-mobile-pulse {
    0%, 100% {
        box-shadow: 
            0 0 25px var(--hal-red),
            inset 0 0 10px rgba(0, 0, 0, 0.8),
            0 0 5px rgba(255, 255, 255, 0.1);
        transform: scale(1);
    }
    50% {
        box-shadow: 
            0 0 35px var(--hal-red-bright),
            inset 0 0 15px rgba(0, 0, 0, 0.9),
            0 0 8px rgba(255, 255, 255, 0.15);
        transform: scale(1.05);
    }
}

/* Code Styling */
.reveal pre {
    background: var(--hal-dark-gray);
    border: 1px solid var(--hal-blue);
    border-radius: 8px;
    box-shadow: 0 0 15px rgba(0, 174, 239, 0.2);
}

.reveal code {
    font-family: var(--font-mono);
    color: var(--hal-white);
}

/* Roadmap Styling */
.roadmap {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin: 2rem 0;
}

.roadmap-item {
    background: var(--hal-dark-gray);
    border: 2px solid var(--hal-blue);
    border-radius: 12px;
    padding: 1.5rem;
    text-align: center;
    transition: all 0.3s ease;
}

.roadmap-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 25px rgba(0, 174, 239, 0.3);
}

.roadmap-item h3 {
    color: var(--hal-blue);
    margin-bottom: 1rem;
    font-size: 1.2em;
}

.roadmap-item p {
    color: var(--hal-gray);
    font-size: 0.9em;
    line-height: 1.4;
}

/* File Structure */
.implementation-overview {
    display: flex;
    gap: 3rem;
    align-items: flex-start;
}

.file-structure, .tech-stack {
    flex: 1;
}

.file-structure pre {
    background: var(--hal-black);
    border: 2px solid var(--hal-yellow);
    border-radius: 8px;
    padding: 1.5rem;
    font-size: 0.8em;
    box-shadow: 0 0 15px rgba(255, 215, 0, 0.2);
}

.tech-stack ul {
    list-style: none;
    padding: 0;
}

.tech-stack li {
    background: var(--hal-dark-gray);
    margin: 0.8rem 0;
    padding: 1rem;
    border-radius: 6px;
    border-left: 4px solid var(--hal-blue);
}

/* Q&A Session */
.qa-suggestions {
    margin-top: 2rem;
    text-align: center;
}

.suggestion-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    justify-content: center;
    margin-top: 1rem;
}

.suggestion-btn {
    background: var(--hal-dark-gray);
    border: 2px solid var(--hal-blue);
    color: var(--hal-white);
    padding: 0.8rem 1.2rem;
    border-radius: 25px;
    cursor: pointer;
    font-family: var(--font-mono);
    font-size: 0.9em;
    transition: all 0.3s ease;
}

.suggestion-btn:hover {
    background: var(--hal-blue);
    color: var(--hal-black);
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 174, 239, 0.4);
}

/* Conclusion Styling */
.conclusion-content {
    display: flex;
    gap: 3rem;
    align-items: flex-start;
    margin: 2rem 0;
}

.summary, .next-steps {
    flex: 1;
}

.summary ul {
    list-style: none;
    padding: 0;
}

.summary li {
    margin: 1rem 0;
    padding: 1rem;
    background: var(--hal-dark-gray);
    border-radius: 8px;
    border-left: 4px solid var(--hal-blue);
}

.cta-buttons {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-top: 1.5rem;
}

.cta-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 1rem 2rem;
    border-radius: 8px;
    text-decoration: none;
    font-family: var(--font-display);
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    transition: all 0.3s ease;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
}

.cta-button.primary {
    background: var(--hal-red);
    color: var(--hal-white);
    border: 2px solid var(--hal-red);
}

.cta-button.primary:hover {
    background: var(--hal-red-bright);
    box-shadow: 0 0 25px var(--hal-red);
    transform: translateY(-3px);
}

.cta-button.secondary {
    background: transparent;
    color: var(--hal-blue);
    border: 2px solid var(--hal-blue);
}

.cta-button.secondary:hover {
    background: var(--hal-blue);
    color: var(--hal-black);
    transform: translateY(-3px);
}

.final-message {
    text-align: center;
    margin-top: 3rem;
    padding: 2rem;
    background: var(--hal-dark-gray);
    border-radius: 15px;
    border: 2px solid var(--hal-red);
}

.hal-quote {
    font-style: italic;
    font-size: 1.2em;
    color: var(--hal-red);
    margin: 1rem 0;
    font-family: var(--font-display);
    text-shadow: 0 0 10px var(--hal-red);
}

.contact-info {
    color: var(--hal-gray);
    font-size: 0.9em;
    margin-top: 1rem;
}

/* Responsive Design */
/* Large tablets and small desktops */
@media (max-width: 1200px) {
    .reveal {
        font-size: 16px;
    }
    
    .interface-showcase {
        flex-direction: column;
        gap: 2rem;
    }
    
    .device-frames {
        gap: 2rem;
    }
}

/* Tablets */
@media (max-width: 900px) {
    .reveal h1 {
        font-size: 2em;
    }
    .reveal h2 {
        font-size: 1.4em;
    }
    .reveal {
        font-size: 15px;
    }
    
    .hal-eye-large {
        width: 120px;
        height: 120px;
    }
    
    .terminal-prompt {
        padding: 0.8rem 1.2rem;
        font-size: 0.9em;
    }
    
    .live-preview iframe {
        height: 300px;
    }
}

/* Small tablets and large phones */
@media (max-width: 768px) {
    .reveal h1 {
        font-size: 1.8em;
        line-height: 1.2;
        margin-bottom: 0.5em;
    }
    .reveal h2 {
        font-size: 1.3em;
        line-height: 1.3;
        margin-bottom: 0.8em;
    }
    .reveal {
        font-size: 14px;
    }
    
    /* Layout adjustments */
    .flow-container, .device-frames, .implementation-overview, .conclusion-content, .demo-container {
        flex-direction: column;
        gap: 1.5rem;
    }
    
    /* Mobile responsive behavior for demo container */
    .console-demo {
        width: 100% !important;
        flex: 1 !important;
    }
    
    .demo-features {
        width: 100% !important;
        flex: 1 !important;
        transform: translateY(20px) !important;
    }
    
    .demo-features.visible {
        transform: translateY(0) !important;
    }
    
    /* Grid layouts become single column */
    .roadmap {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    /* Button adjustments */
    .suggestion-buttons {
        flex-direction: column;
        align-items: center;
        gap: 0.8rem;
    }
    
    .cta-buttons {
        align-items: center;
    }
    
    /* HAL eye adjustments */
    .hal-eye-large {
        width: 100px;
        height: 100px;
    }
    
    .hal-eye-demo {
        width: 80px;
        height: 80px;
    }
    
    /* Device frames adjustments */
    .device.mobile {
        width: 160px;
        height: 280px;
    }
    
    .device.tablet {
        width: 280px;
        height: 200px;
    }
    
    /* Console adjustments */
    .console-input-container, .qa-input-container {
        flex-direction: column;
    }
    
    .console-input-container input, .qa-input-container input {
        border-bottom: 1px solid var(--hal-red);
        border-radius: 0;
    }
    
    .console-input-container button, .qa-input-container button {
        border-radius: 0 0 8px 8px;
        padding: 1.2rem 2rem;
    }
    
    /* Live preview iframe */
    .live-preview iframe {
        height: 250px;
        width: 100%;
    }
}

/* Mobile phones */
@media (max-width: 600px) {
    .reveal h1 {
        font-size: 1.5em;
        line-height: 1.2;
    }
    .reveal h2 {
        font-size: 1.1em;
        line-height: 1.3;
    }
    .reveal {
        font-size: 13px;
    }
    
    /* Title slide adjustments */
    .title-slide h1 {
        font-size: 2.2em;
    }
    
    /* HAL eye adjustments */
    .hal-eye-large {
        width: 80px;
        height: 80px;
    }
    
    .hal-eye-demo {
        width: 60px;
        height: 60px;
    }
    
    /* Terminal prompt */
    .terminal-prompt {
        padding: 0.6rem 1rem;
        font-size: 0.8em;
        margin: 1rem auto;
    }
    
    /* Device frames for mobile showcase */
    .device.mobile {
        width: 120px;
        height: 220px;
    }
    
    .device.tablet {
        width: 220px;
        height: 160px;
    }
    
    /* Console elements */
    .console-header {
        padding: 0.6rem 1rem;
        font-size: 0.8em;
    }
    
    .console-output, .qa-output {
        padding: 1rem;
        min-height: 120px;
        max-height: 200px;
    }
    
    /* Buttons */
    .suggestion-btn {
        padding: 0.6rem 1rem;
        font-size: 0.8em;
        width: 100%;
        max-width: 280px;
    }
    
    .cta-button {
        padding: 0.8rem 1.5rem;
        font-size: 0.9em;
        width: 100%;
        max-width: 300px;
    }
    
    /* Roadmap items */
    .roadmap-item {
        padding: 1rem;
    }
    
    /* Architecture flow items */
    .flow-item {
        min-width: 100px;
        padding: 0.8rem;
    }
    
    .flow-icon {
        font-size: 1.5em;
    }
    
    .flow-label {
        font-size: 0.8em;
    }
    
    /* Code blocks */
    .reveal pre {
        font-size: 0.7em;
        max-height: 300px;
        overflow-y: auto;
    }
    
    /* Live preview iframe */
    .live-preview iframe {
        height: 200px;
    }
}

/* Very small phones */
@media (max-width: 480px) {
    .reveal {
        font-size: 12px;
    }
    
    .reveal h1 {
        font-size: 1.3em;
    }
    
    .reveal h2 {
        font-size: 1em;
    }
    
    /* Title slide */
    .title-slide h1 {
        font-size: 1.8em;
    }
    
    /* HAL eyes */
    .hal-eye-large {
        width: 60px;
        height: 60px;
    }
    
    /* Devices */
    .device.mobile {
        width: 100px;
        height: 180px;
    }
    
    .device.tablet {
        width: 180px;
        height: 130px;
    }
    
    /* Console */
    .console-output, .qa-output {
        min-height: 100px;
        max-height: 150px;
        padding: 0.8rem;
    }
    
    /* Terminal prompt */
    .terminal-prompt {
        font-size: 0.7em;
        padding: 0.5rem 0.8rem;
    }
    
    /* Spacing adjustments */
    .mobile-showcase {
        padding: 1rem;
    }
    
    .roadmap-item, .tech-stack li, .summary li {
        padding: 0.8rem;
    }
    
    /* Final message */
    .final-message {
        padding: 1rem;
    }
    
    .hal-quote {
        font-size: 1em;
    }
}

/* Chess Backdrop Slide Styling */
.chess-backdrop-overlay {
    position: relative;
    height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    align-items: center;
    background: linear-gradient(to bottom, rgba(0,0,0,0.7) 0%, rgba(0,0,0,0.3) 50%, rgba(0,0,0,0.8) 100%);
    overflow: hidden;
}

.backdrop-title {
    color: var(--hal-yellow);
    font-size: 2.5em;
    text-shadow: 0 0 20px var(--hal-yellow), 2px 2px 4px rgba(0,0,0,0.8);
    margin-top: 2rem;
    margin-bottom: 3rem;
    z-index: 10;
    position: relative;
}

.scrolling-text {
    animation: scrollUp 15s linear forwards;
    animation-delay: 3s;
    position: absolute;
    bottom: -200vh;
    width: 80%;
    max-width: 800px;
    text-align: center;
    z-index: 5;
    opacity: 0;
}

.text-section {
    margin-bottom: 4rem;
    padding: 2rem;
    background: rgba(0, 0, 0, 0.7);
    border-radius: 15px;
    border: 1px solid rgba(208, 0, 0, 0.3);
    backdrop-filter: blur(5px);
}

.text-section h3 {
    color: var(--hal-blue);
    font-size: 1.8em;
    margin-bottom: 1rem;
    text-shadow: 0 0 10px var(--hal-blue);
}

.text-section p {
    color: var(--hal-white);
    font-size: 1.2em;
    line-height: 1.6;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.8);
}

.realization-section {
    background: rgba(208, 0, 0, 0.2);
    border: 2px solid var(--hal-red);
    box-shadow: 0 0 30px rgba(208, 0, 0, 0.5);
}

.realization-container {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 80%;
    max-width: 800px;
    z-index: 15;
    opacity: 0;
    animation: fadeInRealization 15s linear forwards;
    animation-delay: 3s;
}

@keyframes fadeInRealization {
    0% {
        opacity: 0;
    }
    60% {
        opacity: 0;
    }
    80% {
        opacity: 1;
    }
    100% {
        opacity: 1;
    }
}

.realization-section .insight-text {
    color: var(--hal-yellow);
    font-size: 1.4em;
    font-weight: bold;
    text-shadow: 0 0 15px var(--hal-yellow), 2px 2px 4px rgba(0,0,0,0.8);
}

@keyframes scrollUp {
    0% {
        transform: translateY(0);
        opacity: 0;
    }
    5% {
        opacity: 1;
    }
    70% {
        transform: translateY(-180vh);
        opacity: 1;
    }
    100% {
        transform: translateY(-220vh);
        opacity: 0;
    }
}

@keyframes scrollUpAndStop {
    0% {
        transform: translateY(0);
        opacity: 0;
    }
    5% {
        opacity: 1;
    }
    60% {
        transform: translateY(-50vh);
        opacity: 1;
    }
    100% {
        transform: translateY(-50vh);
        opacity: 1;
    }
}

/* Fragment animations */
.reveal .fragment {
    transition: all 0.3s ease;
}

.reveal .fragment.visible {
    animation: fadeInUp 0.6s ease forwards;
}

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

/* Touch-friendly improvements */
@media (hover: none) and (pointer: coarse) {
    /* Touch device specific styles */
    .suggestion-btn, .cta-button, .console-input-container button, .qa-input-container button {
        min-height: 44px; /* Apple's recommended minimum touch target */
        min-width: 44px;
    }
    
    .hal-eye-interactive, .hal-eye-large, .hal-eye-demo {
        cursor: default;
    }
    
    /* Disable hover animations on touch devices */
    .flow-item:hover, .roadmap-item:hover, .device:hover {
        transform: none;
        box-shadow: inherit;
    }
    
    /* Increase touch targets */
    .console-input-container input, .qa-input-container input {
        padding: 1.2rem 1.5rem;
        font-size: 16px; /* Prevents zoom on iOS */
    }
    
    /* Better spacing for touch */
    .suggestion-buttons {
        gap: 1rem;
    }
    
    .cta-buttons {
        gap: 1.2rem;
    }
}

/* Improve performance on mobile */
@media (max-width: 768px) {
    /* Reduce animation complexity on mobile */
    .hal-eye-large, .hal-eye-demo, .hal-eye-interactive {
        animation-duration: 4s; /* Slower animations for better performance */
    }
    
    /* Simplify gradients for better performance */
    .mobile-showcase::before {
        background: rgba(208, 0, 0, 0.05);
    }
    
    /* Reduce shadow complexity */
    .device {
        box-shadow: 0 0 20px rgba(208, 0, 0, 0.4), 0 4px 16px rgba(0, 0, 0, 0.6);
    }
    
    /* Optimize text shadows */
    .reveal h1, .reveal h2, .reveal h3 {
        text-shadow: 0 0 5px currentColor;
    }
}

/* Accessibility improvements */
@media (prefers-reduced-motion: reduce) {
    /* Disable animations for users who prefer reduced motion */
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
    
    .hal-eye-large, .hal-eye-demo, .hal-eye-interactive, .hal-eye-small, .hal-eye-mini, .hal-eye-final {
        animation: none !important;
    }
    
    .typing-text {
        animation: none !important;
        width: 100% !important;
        border-right: none !important;
    }
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    :root {
        --hal-red: #ff0000;
        --hal-blue: #0088ff;
        --hal-yellow: #ffff00;
        --hal-white: #ffffff;
        --hal-black: #000000;
        --hal-gray: #cccccc;
        --hal-dark-gray: #444444;
    }
    
    .reveal h1, .reveal h2, .reveal h3 {
        text-shadow: 2px 2px 4px #000000;
    }
    
    .hal-console-embed, .qa-console {
        border-width: 3px;
    }
}

/* Mobile device specific optimizations */
.mobile-device {
    /* Improve scroll performance */
    -webkit-overflow-scrolling: touch;
}

.mobile-device .console-output,
.mobile-device .qa-output {
    /* Smooth scrolling for console outputs */
    -webkit-overflow-scrolling: touch;
    scroll-behavior: smooth;
}

.touch-device .suggestion-btn:active,
.touch-device .cta-button:active,
.touch-device .console-input-container button:active,
.touch-device .qa-input-container button:active {
    /* Active state feedback for touch */
    transform: scale(0.95);
    opacity: 0.8;
}

/* Prevent text selection on touch elements */
.touch-device .hal-eye-interactive,
.touch-device .suggestion-btn,
.touch-device .cta-button {
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
    -webkit-touch-callout: none;
}

/* Optimize animations for mobile */
@media (max-width: 768px) {
    /* Use transform3d for hardware acceleration */
    .hal-eye-large, .hal-eye-demo, .hal-eye-interactive,
    .hal-eye-small, .hal-eye-mini, .hal-eye-final {
        transform: translateZ(0); /* Force hardware acceleration */
    }
    
    /* Reduce motion for better performance */
    .reveal .fragment.visible {
        animation-duration: 0.4s;
    }
    
    /* Optimize gradients */
    .device {
        background: linear-gradient(145deg, #2a2a2a 0%, #1a1a1a 100%);
    }
    
    .screen {
        background: #0a0a0a;
    }
    
    /* Simplify complex backgrounds on mobile */
    .screen::before {
        display: none;
    }
}

/* Improve input focus styles for mobile */
@media (max-width: 768px) {
    .console-input-container input:focus,
    .qa-input-container input:focus {
        outline: 2px solid var(--hal-red);
        outline-offset: 2px;
        box-shadow: 0 0 15px rgba(208, 0, 0, 0.6);
    }
}

/* Add loading states for better UX */
.console-line.typing::after {
    content: '';
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--hal-yellow);
    margin-left: 8px;
    animation: typing-dot 1s ease-in-out infinite;
}

@keyframes typing-dot {
    0%, 100% { opacity: 0.3; }
    50% { opacity: 1; }
}

/* Bridge text styling */
.bridge-text {
    font-size: 1.4em;
    font-weight: bold;
    color: var(--hal-white);
    text-shadow: 1px 1px 3px rgba(0,0,0,0.8);
    line-height: 1.5;
}