/* Global Comic Variables */
:root {
    --comic-yellow: #f9d71c;
    --comic-red: #e23636;
    --comic-blue: #235b9c;
    --comic-black: #080808;
    --comic-white: #ffffff;
    --border-thick: 4px solid var(--comic-black);
    --shadow-deep: 8px 8px 0px var(--comic-black);
}

body {
    margin: 0;
    padding: 0;
    font-family: 'Comic Neue', cursive;
    background-color: #f0f0f0;
    background-image: radial-gradient(var(--comic-blue) 15%, transparent 16%),
        radial-gradient(var(--comic-blue) 15%, transparent 16%);
    background-size: 20px 20px;
    background-position: 0 0, 10px 10px;
    color: var(--comic-black);
    overflow-x: hidden;
}

h1,
h2,
h3 {
    font-family: 'Bangers', system-ui;
    letter-spacing: 2px;
    text-transform: uppercase;
    margin: 0;
}

/* Enter Overlay */
#enter-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: var(--comic-black);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    cursor: pointer;
    transition: opacity 0.5s ease;
}

#enter-btn {
    background: var(--comic-yellow);
    border: var(--border-thick);
    box-shadow: var(--shadow-deep);
    font-family: 'Bangers', system-ui;
    font-size: 3rem;
    padding: 1rem 3rem;
    cursor: pointer;
    transition: transform 0.1s;
}

#enter-btn:active {
    transform: translate(4px, 4px);
    box-shadow: 4px 4px 0px var(--comic-black);
}

/* Hero Section */
#hero {
    position: relative;
    width: 100%;
    min-height: 100vh;
    /* Full viewport height */
    background: var(--comic-black);
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden;
    border-bottom: var(--border-thick);
}

.video-container {
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
}

video {
    width: 100%;
    height: 100vh;
    object-fit: cover;
}

.hero-content {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 10;
    background: transparent;
    /* Transparent to show hero background image */
}

.hero-content.hidden {
    display: none;
}

.main-title {
    font-size: 8vw;
    /* Larger to look like a logo */
    color: #01a9e1;
    /* Matched from logo */
    font-family: 'Bangers', 'Impact', system-ui;
    /* Prioritize Comic font */
    text-shadow:
        4px 4px 0px #000,
        -1px -1px 0px #fff;
    /* Crisp edges */
    -webkit-text-stroke: 2px #000;
    /* Comic book outline */
    text-align: center;
    line-height: 1;
    transform: rotate(-2deg);
    animation: popIn 0.8s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.hero-logo {
    width: 200px;
    margin-top: 2rem;
    filter: drop-shadow(5px 5px 0px var(--comic-black));
}

@keyframes popIn {
    0% {
        transform: scale(0) rotate(-10deg);
        opcode: 0;
    }

    100% {
        transform: scale(1) rotate(-2deg);
        opcode: 1;
    }
}

.floating {
    animation: float 3s ease-in-out infinite;
}

@keyframes float {
    0% {
        transform: translateY(0px) rotate(0deg);
    }

    50% {
        transform: translateY(-15px) rotate(2deg);
    }

    100% {
        transform: translateY(0px) rotate(0deg);
    }
}

/* Comic Book Layout */
.comic-book {
    max-width: 1000px;
    margin: 0 auto;
    padding: 40px 20px;
    background: var(--comic-white);
    border-left: var(--border-thick);
    border-right: var(--border-thick);
    box-shadow: 0 0 50px rgba(0, 0, 0, 0.5);
    min-height: 200vh;
}

.comic-page {
    margin-bottom: 60px;
    border: 2px dashed #ccc;
    /* Page separator guide */
    padding: 20px;
    background: #fff;
}

.panel-layout {
    display: grid;
    gap: 20px;
}

.panel-layout.split {
    grid-template-columns: 1fr 1fr;
}

.panel-layout.three-grid {
    grid-template-columns: 1fr 1fr 1fr;
}

.panel {
    border: var(--border-thick);
    box-shadow: 8px 8px 0px rgba(0, 0, 0, 0.2);
    background: #fff;
    position: relative;
    overflow: hidden;
    /* Essential for parallax masking */
    min-height: 300px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s;
}

.panel:hover {
    transform: scale(1.02);
    z-index: 2;
    box-shadow: 12px 12px 0px rgba(0, 0, 0, 0.3);
}

.panel.panel-large {
    min-height: 500px;
}

.panel img {
    width: 100%;
    height: 120%;
    /* Taller for parallax movement */
    object-fit: cover;
    display: block;
    position: absolute;
    /* Take out of flow to move freely */
    top: -10%;
    /* Center it vertically initially */
    left: 0;
    will-change: transform;
    /* Optimize for animation */
}

.text-panel {
    padding: 2rem;
    background-color: var(--comic-yellow);
    text-align: center;
}

.text-panel h2 {
    font-size: 3rem;
    color: var(--comic-black);
    margin-bottom: 1rem;
    text-shadow: 2px 2px 0px #fff;
}

.text-panel p {
    font-size: 1.5rem;
    font-weight: bold;
}

/* Speech Bubbles */
.speech-bubble {
    position: absolute;
    background: #fff;
    border: 3px solid #000;
    border-radius: 50%;
    padding: 1.5rem;
    text-align: center;
    box-shadow: 3px 3px 0px rgba(0, 0, 0, 0.1);
    max-width: 200px;
    z-index: 5;
    font-weight: bold;
    font-size: 1.1rem;
}

.speech-bubble::after {
    content: '';
    position: absolute;
    border-style: solid;
    border-width: 15px 15px 0;
    border-color: #000 transparent;
    display: block;
    width: 0;
    z-index: 1;
    bottom: -15px;
    left: 20%;
}

.speech-bubble::before {
    content: '';
    position: absolute;
    border-style: solid;
    border-width: 12px 12px 0;
    border-color: #fff transparent;
    display: block;
    width: 0;
    z-index: 2;
    bottom: -10px;
    /* Slight offset to create border effect */
    left: 21%;
    /* Match alignment */
}

/* Positioning Bubbles */
.top-left {
    top: 10%;
    left: 5%;
}

.top-right {
    top: 10%;
    right: 5%;
}

.bottom-right {
    bottom: 10%;
    right: 5%;
}

.caption-box {
    position: absolute;
    top: 0;
    left: 0;
    background: var(--comic-yellow);
    border-right: 3px solid #000;
    border-bottom: 3px solid #000;
    padding: 5px 15px;
    font-family: 'Bangers';
    font-size: 1.2rem;
    z-index: 5;
}

/* Responsive */
@media (max-width: 768px) {

    .panel-layout.split,
    .panel-layout.three-grid {
        grid-template-columns: 1fr;
    }

    .main-title {
        font-size: 15vw;
    }
}

/* CA Badge */
.comic-badge {
    position: absolute;
    top: 20px;
    right: 20px;
    background: var(--comic-white);
    border: var(--border-thick);
    padding: 10px 20px;
    font-family: 'Bangers', system-ui;
    font-size: 1.5rem;
    cursor: pointer;
    z-index: 100;
    /* Above video and hero content */
    box-shadow: 4px 4px 0px var(--comic-black);
    transition: all 0.2s ease;
    user-select: none;
}

.comic-badge:hover {
    transform: translate(-2px, -2px);
    box-shadow: 6px 6px 0px var(--comic-black);
    background: var(--comic-yellow);
}

.comic-badge:active {
    transform: translate(2px, 2px);
    box-shadow: 2px 2px 0px var(--comic-black);
}

.comic-badge.copied {
    background: #4ade80;
    /* Green for success */
    color: var(--comic-black);
}

/* Center Badge (Enter UNOM) */
.comic-badge.center-badge {
    left: 50%;
    right: auto;
    transform: translateX(-50%);
    text-decoration: none;
    background: var(--comic-yellow);
    color: var(--comic-black);
}

.comic-badge.center-badge:hover {
    transform: translateX(-50%) translate(-2px, -2px);
    box-shadow: 6px 6px 0px var(--comic-black);
    background: #fff;
}

/* Left Badge */
.comic-badge.left-badge {
    left: 20px;
    right: auto;
    text-decoration: none;
}

.comic-badge.left-badge:hover {
    transform: translate(-2px, -2px);
    box-shadow: 6px 6px 0px var(--comic-black);
    background: #fff;
}

/* DARK THEME & FULL WIDTH STYLES (New) */

.dark-section {
    width: 100vw;
    background-color: #080808;
    color: #e0e0e0;
    padding: 80px 0;
    position: relative;
    border-top: 2px solid #333;
}

.content-wrapper {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    flex-direction: column;
    gap: 8rem;
    /* Large spacing between narrative blocks */
}

/* Narrative Block Structure */
.narrative-block {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 4rem;
}

.narrative-block.reverse {
    flex-direction: row-reverse;
}

.narrative-text {
    flex: 1;
    text-align: left;
}

.narrative-image {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: center;
}

.narrative-image img {
    max-width: 100%;
    height: auto;
    border: 4px solid #fff;
    box-shadow: 8px 8px 0px rgba(255, 255, 255, 0.1);
    transition: transform 0.3s ease;
}

.narrative-image img:hover {
    transform: scale(1.02);
}

/* Typography */
.narrative-text h2.neon-title {
    font-size: 4rem;
    margin-bottom: 2rem;
    color: #fff;
    text-shadow: 0 0 15px rgba(255, 255, 255, 0.4);
}

.narrative-header {
    font-family: 'Bangers', cursive;
    font-size: 3rem;
    color: var(--comic-yellow);
    margin-bottom: 1.5rem;
    text-transform: uppercase;
    letter-spacing: 2px;
    text-shadow: 2px 2px 0px #000;
}

.narrative-text p {
    font-family: 'Comic Neue', sans-serif;
    font-size: 1.4rem;
    line-height: 1.8;
    margin-bottom: 1.5rem;
    color: #d0d0d0;
    font-weight: 700;
}

.highlight-text {
    color: var(--comic-red);
    font-weight: 900;
    font-size: 1.6rem;
    text-transform: uppercase;
    border-left: 4px solid var(--comic-red);
    padding-left: 1rem;
}

/* Finale Block Specifics */
.centered-finale {
    flex-direction: column;
    text-align: center;
    gap: 2rem;
    margin-top: 2rem;
    background: #111;
    padding: 4rem;
    border: 1px solid #333;
    border-radius: 20px;
}

.centered-finale .narrative-text {
    text-align: center;
}

.centered-finale .final-quote {
    font-size: 2rem;
    color: #4ade80;
    /* Matrix green */
    font-weight: bold;
    font-style: italic;
    margin-top: 2rem;
}

.finale-img {
    max-width: 60%;
    margin-bottom: 2rem;
    border-radius: 50%;
    /* Moon shape? */
    border: 4px solid var(--comic-yellow);
    box-shadow: 0 0 30px rgba(249, 215, 28, 0.2);
}

/* Neon Title Shared */
.neon-title {
    font-family: 'Bangers';
    font-size: 3.5rem;
    color: #fff;
    margin-bottom: 1rem;
    text-shadow: 0 0 10px rgba(255, 255, 255, 0.3);
}

.center-text {
    text-align: center;
}

/* Responsive */
@media (max-width: 900px) {
    .content-wrapper {
        gap: 4rem;
    }

    .narrative-block,
    .narrative-block.reverse {
        flex-direction: column;
        text-align: center;
        gap: 3rem;
    }

    .narrative-text {
        text-align: left;
        /* Keep text readable on mobile */
        padding: 0 1rem;
    }

    .narrative-image img {
        max-width: 90%;
    }

    .centered-finale {
        padding: 2rem 1rem;
    }

    .finale-img {
        max-width: 70%;
    }

    .narrative-text h2.neon-title {
        font-size: 2.8rem;
    }

    .narrative-header {
        font-size: 2.2rem;
        text-align: center;
    }

    .highlight-text {
        font-size: 1.4rem;
    }
}

/* BIG FOOTER STYLES */
.big-footer {
    width: 100vw;
    background: var(--comic-black);
    color: #fff;
    padding: 6rem 0;
    border-top: var(--border-thick);
    position: relative;
    /* ensure z-index works if needed */
}

.footer-content {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 3rem;
}

.footer-left {
    flex: 1;
    min-width: 300px;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    align-items: flex-start;
    /* Left align buttons */
}

.footer-right {
    flex: 1;
    min-width: 300px;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    align-items: flex-end;
    /* Right align text */
    text-align: right;
}

.footer-title {
    font-family: 'Bangers', cursive;
    font-size: 6rem;
    color: var(--comic-yellow);
    margin: 0;
    line-height: 0.9;
    text-shadow: 4px 4px 0px #fff;
    -webkit-text-stroke: 2px #000;
    /* Outline if possible */
}

.footer-subtitle {
    font-family: 'Comic Neue', cursive;
    font-size: 2rem;
    color: #fff;
    margin-top: 1rem;
    font-weight: bold;
    letter-spacing: 1px;
}

/* Comic Footer Buttons */
.footer-btn {
    display: inline-block;
    text-align: center;
    background: #fff;
    color: var(--comic-black);
    font-family: 'Bangers', cursive;
    font-size: 2rem;
    padding: 1rem 2rem;
    text-decoration: none;
    border: 3px solid var(--comic-black);
    box-shadow: 6px 6px 0px var(--comic-black);
    /* Deep shadow */
    transition: transform 0.1s, box-shadow 0.1s;
    min-width: 280px;
    text-transform: uppercase;
}

.footer-btn.x-btn {
    background: var(--comic-yellow);
    /* Yellow for contrast */
}

.footer-btn.join-btn {
    background: var(--comic-red);
    /* Red for urgency */
    color: #fff;
}

.footer-btn:hover {
    transform: translate(-3px, -3px);
    box-shadow: 9px 9px 0px var(--comic-black);
}

.footer-btn:active {
    transform: translate(3px, 3px);
    box-shadow: 3px 3px 0px var(--comic-black);
}

/* Responsive Footer */
@media (max-width: 768px) {
    .footer-content {
        flex-direction: column;
        text-align: center;
        gap: 2rem;
    }

    .footer-title {
        font-size: 4rem;
    }

    .footer-right {
        width: 100%;
        align-items: center;
        /* Center buttons on mobile */
    }

    .footer-btn {
        width: 80%;
        /* Full width-ish on mobile */
    }
}

/* ====================================
   COMPREHENSIVE MOBILE OPTIMIZATIONS
   ==================================== */

/* Medium Mobile (576px and below) */
@media (max-width: 576px) {

    /* Body & Background fixes */
    body {
        background-size: 15px 15px;
        background-position: 0 0, 7px 7px;
    }

    /* Enter Button - Touch Friendly */
    #enter-btn {
        font-size: 2rem;
        padding: 0.8rem 2rem;
        min-height: 60px;
        min-width: 200px;
    }

    /* Hero Section */
    #hero {
        min-height: 100svh;
        /* Use svh for better mobile viewport handling */
    }

    video {
        height: 100svh;
    }

    .main-title {
        font-size: 12vw;
        -webkit-text-stroke: 1px #000;
        padding: 0 10px;
    }

    /* Comic Badges - Mobile Friendly */
    .comic-badge {
        font-size: 1rem;
        padding: 8px 14px;
        top: 10px;
        right: 10px;
    }

    .comic-badge.center-badge {
        top: auto;
        bottom: 20px;
        font-size: 1.2rem;
        padding: 12px 24px;
        min-height: 50px;
        display: flex;
        align-items: center;
        justify-content: center;
    }

    .comic-badge.left-badge {
        left: 10px;
    }

    /* Lore Section */
    .dark-section {
        padding: 40px 0;
    }

    .content-wrapper {
        gap: 3rem;
        padding: 0 15px;
    }

    .narrative-block {
        gap: 1.5rem;
    }

    .narrative-text h2.neon-title {
        font-size: 2rem;
        margin-bottom: 1rem;
    }

    .narrative-header {
        font-size: 1.6rem;
        margin-bottom: 1rem;
        text-align: center;
    }

    .narrative-text p {
        font-size: 1.1rem;
        line-height: 1.6;
        margin-bottom: 1rem;
    }

    .highlight-text {
        font-size: 1.2rem;
        padding-left: 0.8rem;
    }

    .narrative-image img {
        max-width: 100%;
        border-width: 3px;
        box-shadow: 5px 5px 0px rgba(255, 255, 255, 0.1);
    }

    /* Finale Block */
    .centered-finale {
        padding: 1.5rem;
        border-radius: 15px;
        margin-top: 1rem;
    }

    .finale-img {
        max-width: 80%;
        border-width: 3px;
    }

    .centered-finale .final-quote {
        font-size: 1.4rem;
    }

    /* Footer Mobile */
    .big-footer {
        padding: 3rem 0;
    }

    .footer-content {
        padding: 0 15px;
        gap: 1.5rem;
    }

    .footer-left {
        min-width: 100%;
        align-items: center;
    }

    .footer-title {
        font-size: 3rem;
        -webkit-text-stroke: 1px #000;
    }

    .footer-subtitle {
        font-size: 1.4rem;
    }

    .footer-btn {
        font-size: 1.4rem;
        padding: 0.8rem 1.5rem;
        min-width: 100%;
        width: 100%;
        min-height: 50px;
    }
}

/* Small Mobile (480px and below) */
@media (max-width: 480px) {

    /* Even smaller screens */
    #enter-btn {
        font-size: 1.6rem;
        padding: 0.7rem 1.5rem;
    }

    .main-title {
        font-size: 14vw;
    }

    .comic-badge {
        font-size: 0.9rem;
        padding: 6px 12px;
    }

    .comic-badge.center-badge {
        font-size: 1.1rem;
        padding: 10px 20px;
    }

    .narrative-text h2.neon-title {
        font-size: 1.8rem;
    }

    .narrative-header {
        font-size: 1.4rem;
    }

    .narrative-text p {
        font-size: 1rem;
    }

    .highlight-text {
        font-size: 1.1rem;
    }

    .footer-title {
        font-size: 2.5rem;
    }

    .footer-subtitle {
        font-size: 1.2rem;
    }

    .footer-btn {
        font-size: 1.2rem;
    }
}

/* Landscape Mobile Optimizations */
@media (max-height: 500px) and (orientation: landscape) {
    #hero {
        min-height: 100vh;
    }

    video {
        height: 100vh;
        object-fit: contain;
    }

    .comic-badge.center-badge {
        bottom: 10px;
    }

    .big-footer {
        padding: 2rem 0;
    }
}

/* Touch Device Improvements */
@media (hover: none) and (pointer: coarse) {

    /* Remove hover effects on touch devices */
    .comic-badge:hover {
        transform: none;
        box-shadow: 4px 4px 0px var(--comic-black);
        background: var(--comic-white);
    }

    .comic-badge.center-badge:hover {
        transform: translateX(-50%);
        background: var(--comic-yellow);
    }

    .narrative-image img:hover {
        transform: none;
    }

    .panel:hover {
        transform: none;
        box-shadow: 8px 8px 0px rgba(0, 0, 0, 0.2);
    }

    .footer-btn:hover {
        transform: none;
        box-shadow: 6px 6px 0px var(--comic-black);
    }

    /* Increase tap targets */
    .comic-badge,
    .footer-btn {
        min-height: 48px;
    }
}

/* Fix for iOS Safari Address Bar */
@supports (-webkit-touch-callout: none) {
    #hero {
        min-height: -webkit-fill-available;
    }
}

/* Reduce motion for users who prefer it */
@media (prefers-reduced-motion: reduce) {
    .floating {
        animation: none;
    }

    .main-title {
        animation: none;
        transform: rotate(-2deg);
    }

    * {
        transition-duration: 0.01ms !important;
        animation-duration: 0.01ms !important;
    }
}