/* Base Styles */
:root {
    /* Brand palette */
    --primary-color: #38BDF8;   /* sky blue */
    --secondary-color: #A78BFA; /* lavender */
    --accent-color: #22C55E;    /* green */
    --text-color: #ffffff;      /* high-contrast text */
    --light-text: #F9FAFB;
    --background-color: #000000; /* pure black */
    --section-bg: #000000;
    --card-bg: #111827; /* slightly lighter than bg for elevation */
    --card-shadow: 0 8px 20px rgba(0, 0, 0, 0.45);
    --transition: all 0.15s ease;
    --glow-color: rgba(56, 189, 248, 0.6);
    --border-color: rgba(249, 250, 251, 0.08);
    --muted-text: rgba(249, 250, 251, 0.8);
    --menu-bg: rgba(15, 23, 42, 0.98);
    --input-bar-bg: #0F172A;
    --input-bg: #0B1220;
    --ai-bubble-bg: #1F2937;
    --user-bubble-bg: #0B3750;
}


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

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Poppins', sans-serif;
    color: var(--text-color);
    line-height: 1.7;
    background: var(--background-color);
}

h1, h2, h3 {
    font-weight: 600;
    margin-bottom: 1rem;
    color: var(--text-color);
}

h2 {
    text-align: center;
    font-size: 2.2rem;
    margin-bottom: 2rem;
    position: relative;
    padding-bottom: 1rem;
}

h2::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 80px;
    height: 4px;
    background: linear-gradient(to right, var(--primary-color), var(--secondary-color));
    border-radius: 2px;
}

.section-title h2 {
    font-size: 2.5rem;
    color: var(--primary-color);
    position: relative;
    display: inline-block;
}

.section-title h2::after {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 0;
    width: 0;
    height: 3px;
    background-color: var(--primary-color);
    transition: width 1.5s ease;
}

.section-title.in-view h2::after {
    width: 100%;
}

p {
    margin-bottom: 1rem;
}

a {
    text-decoration: none;
    color: var(--primary-color);
    transition: var(--transition);
}

a:hover {
    color: var(--secondary-color);
}

section {
    padding: 80px 5%;
    width: 100%;
    box-sizing: border-box;
    margin: 0;
    background-color: var(--section-bg);
}

.container {
    width: 100%;
    max-width: 100%;
    margin: 0 auto;
    padding: 0 5%;
    box-sizing: border-box;
}

/* Navigation */
.navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem 2rem;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background: rgba(0, 0, 0, 0.75);
    -webkit-backdrop-filter: saturate(180%) blur(10px);
    backdrop-filter: saturate(180%) blur(10px);
    border-bottom: 1px solid var(--border-color);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
    z-index: 1000;
}

.logo {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary-color);
}

.nav-links {
    display: flex;
    list-style: none;
}

.nav-links li {
    margin-left: 2rem;
}

.nav-links a {
    color: var(--text-color);
    font-weight: 500;
    opacity: 0.9;
}

.nav-links a:hover {
    color: var(--primary-color);
}

/* Header theme toggle button */
.theme-toggle-header {
    width: 38px;
    height: 38px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-left: 1rem;
    border-radius: 999px;
    border: 1px solid var(--border-color);
    background: transparent;
    color: var(--text-color);
    cursor: pointer;
    transition: background-color 0.2s ease, transform 0.2s ease;
}

.theme-toggle-header:hover {
    background: rgba(56, 189, 248, 0.12);
    transform: translateY(-1px);
}

.hamburger {
    display: none;
    flex-direction: column;
    cursor: pointer;
}

.hamburger span {
    width: 25px;
    height: 3px;
    background-color: var(--text-color);
    margin: 2px 0;
    transition: var(--transition);
}

/* Hero Section */
.hero {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8rem 0 5rem;
    background: linear-gradient(180deg, rgba(0, 0, 0, 0) 0%, rgba(0, 0, 0, 0.7) 60%, rgba(0, 0, 0, 0) 100%);
    width: 100%;
    box-sizing: border-box;
    margin: 0;
}

.hero-content {
    flex: 1;
    max-width: 600px;
}

.hero h1 {
    font-size: 3rem;
    margin-bottom: 1.5rem;
    color: var(--text-color);
    letter-spacing: 0.3px;
    line-height: 1.15;
}

.hero p {
    font-size: 1.2rem;
    margin-bottom: 2rem;
    color: var(--muted-text);
}
/* Hero problem one-liner */
.hero-problem {
    font-size: 1.05rem;
    color: var(--muted-text);
    margin-bottom: 1rem;
}

.cta-button {
    display: inline-block;
    padding: 0.8rem 2rem;
    background: linear-gradient(to right, var(--primary-color), var(--secondary-color));
    color: white;
    border-radius: 30px;
    font-weight: 500;
    box-shadow: 0 10px 24px rgba(56, 189, 248, 0.18), 0 6px 18px rgba(167, 139, 250, 0.16);
    transition: var(--transition);
}

.cta-button:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.5);
    color: white;
}

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

.hero-image img {
    max-width: 100%;
    border-radius: 10px;
    box-shadow: var(--card-shadow);
    filter: brightness(0.9);
}

/* Features Section */
.features {
    background-color: var(--section-bg);
}

.feature-cards {
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 2rem;
}

.feature-card {
    flex: 1;
    min-width: 300px;
    background-color: var(--card-bg);
    padding: 2rem;
    border-radius: 10px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.35);
    border: 1px solid var(--border-color);
    transition: var(--transition);
    text-align: center;
}

.feature-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.15);
}

.feature-icon {
    font-size: 2.5rem;
    color: var(--primary-color);
    margin-bottom: 1.5rem;
}

/* Demo Section */
.demo {
    background-color: var(--section-bg);
}

.demo-container {
    display: flex;
    justify-content: center;
    align-items: flex-start;
    gap: 2rem;
    flex-wrap: wrap;
}

/* Sign language placeholder */
.sign-demo {
    flex: 1;
    min-width: 300px;
    max-width: 400px;
    display: grid;
    grid-template-columns: 1fr;
    gap: 1rem;
}

.webcam-feed {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 0.5rem;
}

.webcam-feed video {
    width: 100%;
    height: 260px;
    background: #111;
    border-radius: 8px;
    transform: scaleX(-1);
}

.sign-button {
    background: linear-gradient(to right, var(--primary-color), var(--secondary-color));
    color: #fff;
    border: none;
    padding: 0.8rem 1.1rem;
    border-radius: 10px;
    cursor: pointer;
}

/* camera select removed */

.sign-button.stop {
    background: linear-gradient(to right, #ef4444, #f59e0b);
}

.chat-container {
    flex: 1;
    min-width: 300px;
    max-width: 800px;
    background-color: var(--card-bg);
    border-radius: 15px;
    box-shadow: 0 18px 40px rgba(0, 0, 0, 0.45);
    overflow: hidden;
}

.chat-messages {
    height: 400px;
    padding: 1.5rem;
    overflow-y: auto;
}

.message {
    margin-bottom: 1rem;
    padding: 1rem;
    border-radius: 10px;
    max-width: 80%;
}

.ai-message {
    background-color: var(--ai-bubble-bg);
    color: var(--text-color);
    border-top-left-radius: 0;
}

.user-message {
    background-color: var(--user-bubble-bg);
    margin-left: auto;
    border-top-right-radius: 0;
    color: var(--text-color);
}

.chat-input-container {
    display: flex;
    padding: 1rem;
    background-color: var(--input-bar-bg);
    border-top: 1px solid var(--border-color);
}

#user-input {
    flex: 1;
    padding: 0.8rem 1rem;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    background-color: var(--input-bg);
    color: var(--text-color);
    font-family: 'Poppins', sans-serif;
}

#user-input:focus {
    outline: none;
    box-shadow: 0 0 0 2px rgba(0,168,255,0.35);
}

.input-button {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    border: none;
    background-color: var(--primary-color);
    color: white;
    margin-left: 0.5rem;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    justify-content: center;
    align-items: center;
}

.input-button:hover {
    background-color: var(--secondary-color);
}

/* Button active/glow effects */
.input-button.active {
    background-color: var(--accent-color);
    box-shadow: 0 0 20px rgba(34, 197, 94, 0.6);
    animation: button-glow 1.5s infinite alternate;
}

.sign-button.active {
    background: linear-gradient(to right, var(--accent-color), var(--primary-color));
    box-shadow: 0 0 20px rgba(34, 197, 94, 0.6);
    animation: button-glow 1.5s infinite alternate;
}

@keyframes button-glow {
    from { box-shadow: 0 0 10px rgba(34, 197, 94, 0.6); }
    to { box-shadow: 0 0 25px rgba(34, 197, 94, 0.9); }
}

/* Mic recording glow */
.mic-button.recording {
    background-color: #ff4d4d;
    box-shadow: 0 0 0 0 rgba(255, 77, 77, 0.6);
    animation: mic-pulse 1.5s infinite;
}

@keyframes mic-pulse {
    0% { box-shadow: 0 0 0 0 rgba(255, 77, 77, 0.6); }
    70% { box-shadow: 0 0 0 15px rgba(255, 77, 77, 0); }
    100% { box-shadow: 0 0 0 0 rgba(255, 77, 77, 0); }
}

/* Impact Section */
.impact {
    background-color: var(--section-bg);
}

.impact-cards {
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 2rem;
}

.impact-card {
    flex: 1;
    min-width: 300px;
    background-color: var(--card-bg);
    padding: 2rem;
    border-radius: 10px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.35);
    border: 1px solid var(--border-color);
    transition: var(--transition);
    text-align: center;
}

.impact-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.15);
}

.impact-icon {
    font-size: 2.5rem;
    color: var(--primary-color);
    margin-bottom: 1.5rem;
}
/* Impact stats */
.impact-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin-top: 2rem;
}

.impact-stat {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 1.5rem;
    text-align: center;
    min-height: 120px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.impact-stat h3 {
    font-size: 2rem;
    color: var(--primary-color);
    margin-bottom: 0.5rem;
}

.impact-stat p {
    margin: 0;
    line-height: 1.4;
    font-size: 0.95rem;
}

/* Roadmap Section */
.roadmap {
    background-color: var(--section-bg);
}

.timeline {
    position: relative;
    max-width: 800px;
    margin: 0 auto;
}

.timeline::before {
    content: '';
    position: absolute;
    top: 0;
    bottom: 0;
    left: 50%;
    width: 4px;
    background: linear-gradient(to bottom, var(--primary-color), var(--secondary-color));
    transform: translateX(-50%);
}

.timeline-item {
    position: relative;
    margin-bottom: 3rem;
}

.timeline-dot {
    position: absolute;
    left: 50%;
    width: 20px;
    height: 20px;
    background-color: var(--primary-color);
    border-radius: 50%;
    transform: translateX(-50%);
    z-index: 1;
}

.timeline-content {
    position: relative;
    width: 45%;
    padding: 1.5rem;
    background-color: var(--card-bg);
    border-radius: 10px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    border: 1px solid var(--border-color);
}

.timeline-item:nth-child(odd) .timeline-content {
    margin-left: auto;
}

.timeline-item:nth-child(even) .timeline-content {
    margin-right: auto;
}

/* Footer */
.footer {
    background: #000000;
    color: white;
    padding: 3rem 2rem;
    text-align: center;
}

.footer-links {
    display: flex;
    justify-content: center;
    margin-bottom: 1.5rem;
}

.footer-links a {
    color: rgba(255, 255, 255, 0.9);
    margin: 0 1rem;
    transition: color 0.25s ease;
}

.footer-links a:hover {
    color: var(--secondary-color);
}

.social-icons {
    display: flex;
    justify-content: center;
    margin-bottom: 1.5rem;
}

.social-icon {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background-color: rgba(255, 255, 255, 0.08);
    color: white;
    margin: 0 0.5rem;
    transition: transform 0.15s ease, background-color 0.15s ease;
}

.social-icon:hover {
    background-color: var(--primary-color);
    transform: translateY(-3px);
}

.copyright {
    font-size: 0.9rem;
    opacity: 0.7;
}

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

@keyframes slideInLeft {
    from { transform: translateX(-50px); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

@keyframes slideInRight {
    from { transform: translateX(50px); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

@keyframes floatUp {
    0% { transform: translateY(20px); opacity: 0; }
    100% { transform: translateY(0); opacity: 1; }
}

@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

@keyframes glow {
    0% { box-shadow: 0 0 5px var(--glow-color); }
    50% { box-shadow: 0 0 20px var(--glow-color); }
    100% { box-shadow: 0 0 5px var(--glow-color); }
}

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

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Loading Animation */
body.loading::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: var(--background-color);
    z-index: 9999;
    display: flex;
    justify-content: center;
    align-items: center;
}

body.loading::after {
    content: '';
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 50px;
    height: 50px;
    border: 5px solid rgba(255, 255, 255, 0.1);
    border-top: 5px solid var(--primary-color);
    border-radius: 50%;
    z-index: 10000;
    animation: spin 1s linear infinite;
}

body.loaded .container {
    animation: fadeIn 1s ease forwards;
}

/* Theme Toggle */
.theme-toggle {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 50px;
    height: 50px;
    background-color: var(--primary-color);
    color: white;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    z-index: 1000;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
    transition: all 0.15s ease;
}

.theme-toggle:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.4);
}

/* Light Theme Variables */
body.light-theme {
    --background-color: #ffffff;
    --section-bg: #ffffff;
    --card-bg: #ffffff;
    --text-color: #000000;
    --card-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    --border-color: rgba(0, 0, 0, 0.1);
    --muted-text: rgba(0, 0, 0, 0.8);
    --menu-bg: rgba(255, 255, 255, 0.98);
    --input-bar-bg: #ffffff;
    --input-bg: #f6f7f9;
    --ai-bubble-bg: #eef2f5;
    --user-bubble-bg: #d7efff;
}

/* Ensure full-page background is light in light mode */
body.light-theme {
    background: var(--background-color);
}

/* Light hero background override */
body.light-theme .hero {
    background: linear-gradient(180deg, rgba(255, 255, 255, 0) 0%, var(--background-color) 60%, rgba(255, 255, 255, 0) 100%);
}

/* Light navbar glass */
body.light-theme .navbar {
    background: rgba(255, 255, 255, 0.75);
    border-bottom: 1px solid var(--border-color);
}

/* Light mode footer */
body.light-theme .footer {
    background: linear-gradient(180deg, rgba(255, 255, 255, 0) 0%, rgba(245, 245, 245, 1) 40%);
    color: #222222;
}

body.light-theme .footer-links a {
    color: #333333;
}

body.light-theme .social-icon {
    background-color: rgba(0, 0, 0, 0.06);
    color: #333333;
}

/* Enhanced Animations */
.fade-in {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

.fade-in.animate {
    opacity: 1;
    transform: translateY(0);
}

.feature-card, .impact-card {
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.feature-card:hover, .impact-card:hover {
    transform: translateY(-15px) scale(1.03);
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.4);
    animation: glow 1s infinite;
}



.timeline-item:nth-child(odd) {
    opacity: 0;
    transform: translateX(-50px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

.timeline-item:nth-child(even) {
    opacity: 0;
    transform: translateX(50px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

.timeline-item.animate:nth-child(odd) {
    opacity: 1;
    transform: translateX(0);
}

.timeline-item.animate:nth-child(even) {
    opacity: 1;
    transform: translateX(0);
}

/* Chat Typing Animation */
.typing-indicator {
    display: flex;
    padding: 10px;
    background-color: #3a3a3a;
    border-radius: 5px;
    margin-bottom: 10px;
    width: fit-content;
}

.typing-indicator span {
    height: 8px;
    width: 8px;
    background-color: var(--light-text);
    border-radius: 50%;
    display: inline-block;
    margin: 0 2px;
    animation: typing 1.5s infinite;
}

.typing-indicator span:nth-child(2) {
    animation-delay: 0.2s;
}

.typing-indicator span:nth-child(3) {
    animation-delay: 0.4s;
}

.message.appear {
    animation: fadeIn 0.5s ease forwards;
}

.hero-content {
    animation: slideInLeft 1s ease-out forwards;
}

.hero-image {
    animation: slideInRight 1s ease-out forwards;
}

.input-button {
    transition: transform 0.1s ease, background-color 0.15s ease;
}

.input-button:hover {
    transform: scale(1.1);
}

.hamburger span {
    transition: transform 0.3s ease, opacity 0.3s ease;
}

.hamburger.active span:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
}

.hamburger.active span:nth-child(2) {
    opacity: 0;
}

.hamburger.active span:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
}

/* Enhanced Card Effects */
.feature-card .feature-icon {
    transition: transform 0.2s ease;
}

.feature-card:hover .feature-icon {
    transform: scale(1.2) rotate(10deg);
    color: var(--secondary-color);
}

.impact-number {
    transition: color 0.3s ease;
}

.impact-card:hover .impact-number {
    color: var(--secondary-color);
}

/* Responsive Design */
@media (max-width: 992px) {
    .hero {
        flex-direction: column;
        text-align: center;
        padding-top: 6rem;
    }
    
    .hero-content {
        margin-bottom: 3rem;
    }
    
    .timeline::before {
        left: 30px;
    }
    
    .timeline-dot {
        left: 30px;
    }
    
    .timeline-content {
        width: calc(100% - 60px);
        margin-left: 60px !important;
    }
}

@media (max-width: 768px) {
    .navbar {
        padding: 1rem;
    }
    
    .nav-links {
        position: fixed;
        top: 70px;
        left: 0;
        right: 0;
        background-color: rgba(10, 10, 10, 0.95);
        flex-direction: column;
        align-items: center;
        padding: 2rem 0;
        box-shadow: 0 20px 40px rgba(0, 0, 0, 0.45);
        border-top: 1px solid rgba(255, 255, 255, 0.06);
        transform: translateY(-150%);
        transition: var(--transition);
    }
    
    .nav-links.active {
        transform: translateY(0);
    }
    
    .nav-links li {
        margin: 1rem 0;
    }
    
    .hamburger {
        display: flex;
    }
    
    h2 {
        font-size: 1.8rem;
    }
    
    .hero h1 {
        font-size: 2.2rem;
    }
    
    .feature-cards, .impact-cards {
        flex-direction: column;
    }
    
    .feature-card, .impact-card {
        min-width: 100%;
    }
    
    /* Mobile Demo Layout - Webcam on top, Chat below */
    .demo-container {
        flex-direction: column;
        align-items: center;
        gap: 1.5rem;
    }
    
    .sign-demo {
        order: 1; /* Webcam section appears first */
        width: 100%;
        max-width: none;
        margin-top: 0;
    }
    
    .chat-container {
        order: 2; /* Chat section appears second */
        width: 100%;
        max-width: none;
    }
    
    .webcam-feed video {
        height: 200px; /* Reduce height on mobile */
    }
    
    .chat-messages {
        height: 300px; /* Reduce chat height on mobile */
    }
    
    /* Impact stats mobile adjustments */
    .impact-stats {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .impact-stat {
        padding: 1.25rem;
        min-height: 100px;
    }
    
    .impact-stat h3 {
        font-size: 1.8rem;
    }
    
    .impact-stat p {
        font-size: 0.9rem;
    }
}

@media (max-width: 576px) {
    section {
        padding: 3rem 1rem;
    }
    
    .hero h1 {
        font-size: 1.8rem;
    }
    
    .hero p {
        font-size: 1rem;
    }
    
    .timeline-content {
        padding: 1rem;
    }
    
    /* Extra small mobile adjustments */
    .webcam-feed video {
        height: 180px; /* Even smaller on very small screens */
    }
    
    .chat-messages {
        height: 250px; /* Smaller chat on very small screens */
    }
    
    .chat-input-container {
        flex-wrap: wrap;
        gap: 0.5rem;
    }
    
    .input-button {
        width: 40px;
        height: 40px;
        margin-left: 0;
    }
    
    #user-input {
        flex: 1;
        min-width: 100%;
        margin-bottom: 0.5rem;
    }
    
    .sign-controls {
        display: flex;
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .sign-button {
        width: 100%;
        padding: 0.6rem;
        font-size: 0.9rem;
    }
    
    /* Impact stats for very small screens */
    .impact-stat {
        padding: 1rem;
        min-height: 90px;
    }
    
    .impact-stat h3 {
        font-size: 1.6rem;
        margin-bottom: 0.25rem;
    }
    
    .impact-stat p {
        font-size: 0.85rem;
        line-height: 1.3;
    }
}