/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Roboto', sans-serif;
    font-size: 16px;
    color: #2D3748;
    background: #F3F4F6;
    line-height: 1.6;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

h1, h2, h3 {
    font-family: 'Lora', serif;
    color: #1A202C;
}

p {
    color: #2D3748;
}

/* Header Styles */
header {
    background: #F3F4F6;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    position: sticky;
    top: 0;
    z-index: 1000;
    transition: height 0.5s ease-in-out;
}

.header-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 15px 0;
    position: relative;
}

.logo {
    position: relative;
    min-height: 120px;
    width: 100%;
    text-align: center;
    background: #F3F4F6;
    z-index: 2;
}

.logo-animation {
    position: relative;
    display: inline-block;
    transition: transform 0.7s cubic-bezier(0.25, 0.1, 0.25, 1);
    will-change: transform;
}

.logo-animation.centered {
    transform: translateX(0);
    max-width: 1080px;
}

.logo-animation.moving-left {
    transform: translateX(-calc(50% + 20px));
    max-width: 200px;
}

.logo video {
    width: 100%;
    max-width: 1080px;
    height: auto;
    display: block;
    margin: 0 auto;
    transition: max-width 0.7s cubic-bezier(0.25, 0.1, 0.25, 1),
                opacity 0.7s cubic-bezier(0.25, 0.1, 0.25, 1),
                transform 0.7s cubic-bezier(0.25, 0.1, 0.25, 1);
    position: relative;
    z-index: 2;
    will-change: transform, opacity, max-width;
}

.logo video.shrunk {
    max-width: 200px;
    opacity: 0;
    display: none; /* Replace inline style.display = 'none' */
}

.logo img#fallback-logo {
    width: 200px;
    height: 66.67px;
    display: none;
    margin: 0;
    object-fit: contain;
    position: absolute;
    top: 50%;
    left: 0;
    transform: translateY(-50%);
    z-index: 3;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.7s cubic-bezier(0.25, 0.1, 0.25, 1),
                visibility 0s linear 0.7s;
    will-change: opacity;
}

.logo img#fallback-logo.visible {
    display: block;
    opacity: 1;
    visibility: visible;
    transition: opacity 0.7s cubic-bezier(0.25, 0.1, 0.25, 1);
}

nav {
    display: flex;
    align-items: center;
    gap: 20px;
}

nav a {
    font-family: 'Roboto', sans-serif;
    font-size: 1rem;
    color: #1A202C;
    text-decoration: none;
    font-weight: 500;
    transition: color 0.3s ease;
    white-space: nowrap;
}

nav a:hover {
    color: #2563EB;
}

nav a.join-btn {
    background: #2563EB;
    color: #FFFFFF;
    padding: 8px 16px;
    border-radius: 5px;
    transition: background 0.3s ease;
}

nav a.join-btn:hover {
    background: #1E3A8A;
    color: #FFFFFF;
}

.hamburger {
    display: none;
    font-size: 1.5rem;
    background: none;
    border: none;
    cursor: pointer;
    color: #1A202C;
}

.header-content nav {
    transition: opacity 0.3s ease-in-out;
}

.header-content.nav-hidden nav {
    opacity: 0;
    visibility: hidden;
}

.header-content.nav-visible nav {
    opacity: 1;
    visibility: visible;
}

/* Welcome Message */
.welcome-message {
    background: #F3F4F6;
    padding: 10px 0;
    text-align: center;
}

.welcome-message p {
    color: #F3F4F6;
}

/* Hero Section */
.hero, .story {
    position: relative;
    min-height: 80vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* First Hero Section (Fixed Background Video) */
.hero#home .hero-video-bg {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    z-index: 0;
}

.hero#home .hero-video-bg video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0.7;
}

/* Overlay for Fixed Video */
.hero#home .hero-video-bg .overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    background: rgba(0, 0, 0, 0.6);
    z-index: 1;
}

/* Second Hero Section (Normal Scrolling Video) */
.hero:not(#home) .hero-video-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 2;
}

.hero:not(#home) .hero-video-bg video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0.7;
}

.hero:not(#home) .overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    z-index: 1;
}

.hero-content, .story-content {
    position: relative;
    z-index: 3;
    text-align: center;
    color: #FFFFFF;
    max-width: 800px;
    margin: 0 auto;
}

.hero-content h1, .story-content h1 {
    font-size: 3rem;
    margin-bottom: 20px;
    color: #FFFFFF;
    text-shadow: 0 0 8px rgba(0, 0, 0, 0.7);
}

.hero-content p, .story-content p {
    font-size: 1.2rem;
    margin-bottom: 30px;
    color: #FFFFFF;
    text-shadow: 0 0 8px rgba(0, 0, 0, 0.7);
}

.cta-button {
    display: inline-block;
    background: #2563EB;
    color: #FFFFFF;
    padding: 12px 24px;
    border-radius: 5px;
    text-decoration: none;
    font-family: 'Roboto', sans-serif;
    font-weight: 500;
    transition: background 0.3s ease;
}

.cta-button:hover {
    background: #1E3A8A;
}

/* Vision Section */
.vision {
    padding: 80px 0;
    background: #F3F4F6;
    position: relative;
    z-index: 2;
}

.vision-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

.vision-video {
    flex: 1;
    max-width: 50%;
    position: relative;
    overflow: hidden;
    border-radius: 8px;
}

.vision-video video {
    width: 100%;
    height: auto;
    display: block;
    object-fit: cover;
}

.vision-content {
    flex: 1;
    max-width: 50%;
    text-align: left;
    color: #1A202C;
}

.vision-content h1 {
    font-size: 2.5rem;
    margin-bottom: 20px;
    color: #1A202C;
}

.vision-content p {
    font-size: 1.2rem;
    margin-bottom: 20px;
    color: #2D3748;
}

/* Connect Section */
.connect, .free-thinking, .community, .join, .shop, .contact, .privacy {
    padding: 80px 0;
    text-align: center;
    background: #F3F4F6;
    position: relative;
    z-index: 2;
}

.connect h2, .free-thinking h2, .community h1, .join h1, .shop h1, .contact h1, .privacy h1 {
    font-size: 2.5rem;
    margin-bottom: 20px;
}

.connect p, .free-thinking p, .community p, .join p, .shop p, .contact p, .privacy p {
    font-size: 1.1rem;
    max-width: 800px;
    margin: 0 auto 30px;
}

/* Social Links */
.social-links {
    display: flex;
    justify-content: center;
    gap: 20px;
}

.social-links img {
    width: 30px;
    height: 30px;
    transition: transform 0.3s ease;
}

.social-links a:hover img {
    transform: scale(1.1);
}

/* Social Proof */
.social-proof {
    background: #F3F4F6;
    padding: 20px 0;
    text-align: center;
    position: relative;
    z-index: 2;
}

.social-proof p {
    color: #1A202C;
    font-weight: 500;
}

/* Community Section */
.featured-story, .story-item {
    background: #FFFFFF;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    margin-bottom: 20px;
}

.featured-story h2, .story-item h3 {
    font-size: 1.5rem;
    margin-bottom: 10px;
}

.story-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.story-form, .contact-form {
    max-width: 600px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.story-form label, .contact-form label {
    font-weight: 500;
    text-align: left;
}

.story-form input, .story-form textarea, .contact-form input, .contact-form textarea {
    padding: 10px;
    border: 1px solid #D1D5DB;
    border-radius: 5px;
    font-size: 1rem;
}

.story-form textarea, .contact-form textarea {
    resize: vertical;
    min-height: 150px;
}

.message {
    color: #1A202C;
    font-weight: 500;
}

/* ... Previous styles remain unchanged ... */

/* Join Section */
.quiz-container {
    max-width: 800px;
    margin: 0 auto 40px;
    background: #FFFFFF;
    padding: 30px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.quiz-step {
    text-align: center;
    display: none; /* Start hidden */
    opacity: 1; /* Ensure opacity is 1 by default when shown */
}

.quiz-step.hidden {
    display: none; /* Completely hide inactive steps */
}

.quiz-step.active {
    display: block; /* Show active step */
    opacity: 1; /* Ensure visibility */
}

.quiz-step.fade-in {
    animation: fadeIn 0.3s ease-in forwards;
}

.quiz-step.fade-out {
    animation: fadeOut 0.3s ease-out forwards;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes fadeOut {
    from { opacity: 1; }
    to { opacity: 0; }
}

.quiz-step h2 {
    font-size: 1.8rem;
    margin-bottom: 20px;
}

.quiz-options {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    margin-bottom: 20px;
    opacity: 1; /* Ensure buttons are visible */
    visibility: visible; /* Ensure no inherited visibility issues */
}

.quiz-option {
    background: #EFF6FF;
    border: 1px solid #2563EB;
    color: #2563EB;
    padding: 15px;
    font-size: 1rem;
    border-radius: 5px;
    cursor: pointer;
    transition: background 0.3s ease, color 0.3s ease;
    opacity: 1; /* Ensure individual buttons are visible */
    visibility: visible;
}

.quiz-option:hover {
    background: #2563EB;
    color: #FFFFFF;
}

.result-content {
    min-height: 250px;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.result-content img {
    width: 100px;
    height: 100px;
    margin-bottom: 20px;
}

.result-text {
    font-size: 1.5rem;
    color: #1A202C;
    margin-bottom: 10px;
}

.result-description {
    font-size: 1.1rem;
    color: #2D3748;
    margin-bottom: 20px;
}

.quiz-progress {
    font-size: 1rem;
    color: #1A202C;
    margin-top: 10px;
}

.quiz-results {
    margin-top: 40px;
}

.bar-chart {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 20px;
    padding: 20px;
    background: #FFFFFF;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.bar-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 150px;
    background: transparent; /* Ensure no inherited background */
}

.bar-item span {
    font-size: 1rem;
    color: #1A202C;
    margin-bottom: 5px;
}

.bar {
    height: 25px;
    width: 0; /* Start with 0 width, will be overridden by bar-width-* */
    border-radius: 5px;
    transition: width 0.5s ease;
    position: relative;
    background: none; /* Force remove any default background */
    border: none; /* Ensure no border */
    overflow: hidden; /* Prevent rendering issues */
}

/* Bar colors */
.bar-color-explore-ideas { background-color: #1E3A8A !important; }
.bar-color-create-art { background-color: #4B5563 !important; }
.bar-color-connect-words { background-color: #D97706 !important; }
.bar-color-explore-art { background-color: #2563EB !important; }
.bar-color-create-ideas { background-color: #B45309 !important; }
.bar-color-connect-ideas { background-color: #7C3AED !important; }

/* Ensure bar width classes work */
.bar-width-0 { width: 0px; }
.bar-width-10 { width: 10px; }
.bar-width-20 { width: 20px; }
.bar-width-30 { width: 30px; }
.bar-width-40 { width: 40px; }
.bar-width-50 { width: 50px; }
.bar-width-60 { width: 60px; }
.bar-width-70 { width: 70px; }
.bar-width-80 { width: 80px; }
.bar-width-90 { width: 90px; }
.bar-width-100 { width: 100px; }
.bar-width-110 { width: 110px; }
.bar-width-120 { width: 120px; }
.bar-width-130 { width: 130px; }
.bar-width-140 { width: 140px; }
.bar-width-150 { width: 150px; }
.bar-width-160 { width: 160px; }
.bar-width-170 { width: 170px; }
.bar-width-180 { width: 180px; }
.bar-width-190 { width: 190px; }
.bar-width-200 { width: 200px; }
.bar-width-210 { width: 210px; }
.bar-width-220 { width: 220px; }
.bar-width-230 { width: 230px; }
.bar-width-240 { width: 240px; }
.bar-width-250 { width: 250px; }
.bar-width-260 { width: 260px; }
.bar-width-270 { width: 270px; }
.bar-width-280 { width: 280px; }
.bar-width-290 { width: 290px; }
.bar-width-300 { width: 300px; }
.bar-width-310 { width: 310px; }
.bar-width-320 { width: 320px; }
.bar-width-330 { width: 330px; }
.bar-width-340 { width: 340px; }
.bar-width-350 { width: 350px; }
.bar-width-360 { width: 360px; }
.bar-width-370 { width: 370px; }
.bar-width-380 { width: 380px; }
.bar-width-390 { width: 390px; }
.bar-width-400 { width: 400px; }

.bar-label {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    color: #FFFFFF;
    font-size: 0.9rem;
    font-weight: bold;
    line-height: 25px; /* Center vertically in the bar */
}

/* Shop Section */
.shop-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
    margin-bottom: 30px;
}

.shop-item {
    background: #FFFFFF;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    text-align: center;
    transition: transform 0.3s ease;
}

.shop-item:hover {
    transform: translateY(-5px);
}

.shop-item img {
    width: 100%;
    max-width: 300px;
    height: auto;
    border-radius: 8px;
}

.shop-item h2 {
    font-size: 1.5rem;
    margin: 15px 0;
}

.shop-item p {
    margin-bottom: 20px;
}

/* Footer Styles */
footer {
    background: #1A202C;
    color: #E5E7EB;
    padding: 40px 0;
    position: relative;
    z-index: 2;
}

.footer-content {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
}

.footer-brand {
    display: flex;
    align-items: center;
    gap: 10px;
}

.footer-brand img {
    width: 40px;
    height: 40px;
}

.footer-brand p {
    color: #E5E7EB;
}

.footer-links {
    display: flex;
    gap: 20px;
}

.footer-links a {
    color: #E5E7EB;
    text-decoration: none;
    transition: color 0.3s ease;
}

.footer-links a:hover {
    color: #FFFFFF;
}

/* Media Queries */
@media (max-width: 1920px) {
    .logo img#fallback-logo {
        width: 200px;
        height: 66.67px;
    }
}

@media (max-width: 1080px) {
    .logo video {
        max-width: 100%;
    }
}

@media (max-width: 768px) {
    .logo video,
    .logo img#fallback-logo {
        width: 100%;
        max-width: 100%;
        height: auto;
        margin: 0;
        position: relative;
        transform: translateY(0);
        top: 0;
        object-fit: contain;
    }
    .logo {
        min-height: 200px;
    }
    .logo video.shrunk {
        max-width: 100%;
    }
    .header-content {
        flex-direction: column;
        align-items: stretch;
    }
    .header-content .logo {
        order: 1;
        margin-bottom: 10px;
    }
    .header-content nav {
        order: 2;
        width: 100%;
        padding-top: 10px;
    }
    .hamburger {
        display: block !important;
        position: absolute;
        top: 15px;
        right: 20px;
        z-index: 1001;
    }
    .header-content.nav-hidden nav,
    .header-content.nav-visible nav {
        top: 220px;
    }
    nav {
        display: none;
        flex-direction: column;
        width: 100%;
        background: #F3F4F6;
        padding: 20px 0;
        position: absolute;
        left: 0;
        box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    }
    nav.active {
        display: flex !important;
    }
    nav a {
        margin: 10px 0;
        text-align: center;
    }
    nav a.join-btn {
        width: 80%;
        margin: 10px auto;
    }

    /* Hero Section Adjustments for Mobile */
    .hero-video-bg video {
        width: 100%;
        height: 100%;
        object-fit: cover;
        object-position: center;
    }

    .hero-content h1, .story-content h1 {
        font-size: 2rem;
    }

    .hero-content p, .story-content p {
        font-size: 1rem;
    }

    .connect h2, .free-thinking h2, .community h1, .join h1, .shop h1, .contact h1, .privacy h1 {
        font-size: 2rem;
    }

    .quiz-options {
        grid-template-columns: 1fr;
    }

    .bar-item {
        width: 100%;
    }

    .footer-content {
        flex-direction: column;
        text-align: center;
    }

    /* Vision Section Adjustments for Mobile */
    .vision-container {
        flex-direction: column;
        align-items: center;
    }

    .vision-video,
    .vision-content {
        max-width: 100%;
        width: 100%;
    }

    .vision-content {
        text-align: center;
        padding: 20px;
    }

    .vision-content h1 {
        font-size: 2rem;
    }

    .vision-content p {
        font-size: 1rem;
    }
}

@media (min-width: 769px) {
    nav {
        flex-direction: row;
        gap: 20px;
        align-items: center;
    }

    nav a {
        display: inline-block;
        width: auto;
        text-align: center;
    }

    nav a.join-btn {
        text-align: center;
        width: auto;
    }

    .logo.minimized {
        min-height: 80px;
    }

    .logo.minimized .logo-animation,
    .logo.minimized img#fallback-logo {
        width: 200px;
        height: 66.67px;
    }
}

.video-fallback {
    display: none;
    width: 100%;
    height: 100%;
    background: #000;
    color: #FFF;
    display: flex;
    align-items: center;
    justify-content: center;
}