:root {
    --primary-color: #00d2ff;
    --secondary-color: #3a7bd5;
    --accent-color: #00f2fe;
    --bg-dark: #05080d;
    --bg-card: rgba(13, 20, 33, 0.7);
    --text-main: #f0f0f0;
    --text-dim: #b0b8c4;
    --glass-border: rgba(255, 255, 255, 0.08);
    --font-family: 'Outfit', sans-serif;
    --section-spacing: 10rem;
}

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

html {
    background-color: var(--bg-dark);
}

body {
    background-color: var(--bg-dark);
    color: var(--text-main);
    font-family: var(--font-family);
    line-height: 1.6;
    overflow-x: hidden;
    opacity: 0;
    animation: pageFadeIn 0.6s ease-out forwards;
}

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

/* Background Animation */
.bg-blobs {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: -1;
    overflow: hidden;
    pointer-events: none;
}

.blob {
    position: absolute;
    border-radius: 50%;
    filter: blur(100px);
    opacity: 0.2;
    animation: move 20s infinite alternate;
}

.blob-1 {
    width: 400px;
    height: 400px;
    background: var(--primary-color);
    top: -100px;
    right: -100px;
}

.blob-2 {
    width: 300px;
    height: 300px;
    background: var(--secondary-color);
    bottom: -50px;
    left: -50px;
    animation-delay: -5s;
}

@keyframes move {
    from { transform: translate(0, 0); }
    to { transform: translate(50px, 100px); }
}

/* Typography */
h1, h2, h3 {
    font-weight: 700;
    letter-spacing: -0.5px;
}

.gradient-text {
    background: linear-gradient(135deg, var(--primary-color), var(--accent-color));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* Layout */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
}

@media (max-width: 768px) {
    .container {
        padding: 0 1rem;
    }
}

section {
    padding: var(--section-spacing) 0;
}

/* Navbar */
nav {
    position: fixed;
    top: 0;
    width: 100%;
    padding: 1.2rem 0;
    z-index: 1000;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

nav.scrolled {
    background: rgba(5, 8, 13, 0.96);
    backdrop-filter: blur(25px) saturate(180%);
    border-bottom: none;
    padding: 0.7rem 0;
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.6);
}

.nav-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    font-weight: 700;
    font-size: 1.2rem;
    color: white;
    text-decoration: none;
}

.logo img {
    height: 40px;
}

.nav-links {
    display: flex;
    gap: 2rem;
    list-style: none;
    align-items: center;
}

.nav-links a {
    color: var(--text-dim);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.3s;
}

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

.menu-toggle {
    display: none;
    flex-direction: column;
    gap: 6px;
    cursor: pointer;
    z-index: 1001;
}

.menu-toggle span {
    width: 25px;
    height: 2px;
    background: var(--text-main);
    transition: 0.3s;
}

/* Hero Section */
.hero {
    height: 100vh;
    display: flex;
    align-items: center;
    text-align: center;
    padding-top: 5rem;
    position: relative;
}

.hero-content h1 {
    font-size: 5rem;
    margin-bottom: 2rem;
    line-height: 1;
    font-weight: 800;
}

.hero-content p {
    font-size: 1.4rem;
    color: var(--text-dim);
    max-width: 800px;
    margin: 0 auto 3.5rem;
    line-height: 1.6;
}

.btn {
    padding: 1.2rem 3rem;
    border-radius: 100px;
    font-weight: 700;
    text-decoration: none;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    display: inline-block;
    cursor: pointer;
    border: 1px solid var(--glass-border);
    background: rgba(255, 255, 255, 0.05);
    color: white;
    font-family: inherit;
    font-size: 1rem;
    position: relative;
    z-index: 2;
    backdrop-filter: blur(10px);
}

.btn:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: var(--primary-color);
    transform: translateY(-3px);
    box-shadow: 0 10px 20px rgba(0,0,0,0.2);
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: black;
    border: none;
    box-shadow: 0 15px 35px rgba(0, 210, 255, 0.3);
}

.btn-primary:hover {
    transform: translateY(-5px);
    box-shadow: 0 20px 50px rgba(0, 210, 255, 0.5);
    filter: brightness(1.1);
    color: black;
}

/* Cards & Glassmorphism */
.glass-card {
    background: var(--bg-card);
    backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    border-radius: 32px;
    padding: 3rem;
    transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.glass-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, rgba(255,255,255,0.05), transparent);
    opacity: 0;
    transition: opacity 0.5s;
    pointer-events: none;
}

.glass-card:hover {
    transform: translateY(-12px) scale(1.02);
    border-color: rgba(0, 210, 255, 0.4);
    box-shadow: 0 30px 60px rgba(0,0,0,0.4);
}

.glass-card:hover::before {
    opacity: 1;
}

/* Projects Grid */
.section-title {
    text-align: center;
    margin-bottom: 5rem;
}

.section-title h2 {
    font-size: 3.5rem;
    margin-bottom: 1.2rem;
}

.projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 2.5rem;
}

.project-card img {
    width: 100%;
    height: 240px;
    object-fit: cover;
    border-radius: 20px;
    margin-bottom: 2rem;
    transition: transform 0.5s;
}

.project-card:hover img {
    transform: scale(1.05);
}

/* Gallery */
.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
}

.gallery-item {
    position: relative;
    border-radius: 24px;
    overflow: hidden;
    height: 300px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
}

.gallery-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.8s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.gallery-item:hover img {
    transform: scale(1.15) rotate(2deg);
}

.gallery-item::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(to bottom, transparent, rgba(0,0,0,0.4));
    opacity: 0;
    transition: opacity 0.4s;
}

.gallery-item:hover::after {
    opacity: 1;
}

/* News Section */
.news-card {
    display: flex;
    align-items: center;
    gap: 3rem;
}

@media (max-width: 992px) {
    .news-card {
        flex-direction: column;
        text-align: center;
    }
}

/* Experimental Teaser */
.experimental-teaser {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 3rem;
    padding: 4rem;
    background: linear-gradient(135deg, rgba(0, 210, 255, 0.1), rgba(58, 123, 213, 0.1));
    border: 1px solid rgba(0, 210, 255, 0.2);
}

@media (max-width: 992px) {
    .experimental-teaser {
        flex-direction: column;
        text-align: center;
        padding: 3rem 2rem;
    }
    .experimental-teaser div {
        display: flex;
        flex-direction: column;
        align-items: center;
        width: 100%;
    }
}

/* Footer */
footer {
    padding: 4rem 0;
    border-top: 1px solid var(--glass-border);
    text-align: center;
    color: var(--text-dim);
}

/* Responsive Design */
@media (max-width: 1024px) {
    :root { --section-spacing: 7rem; }
    .hero-content h1 { font-size: 4rem; }
}

@media (max-width: 768px) {
    nav {
        background: rgba(5, 8, 13, 0.9);
        backdrop-filter: blur(10px);
        padding: 1rem 0;
    }

    .nav-links {
        position: fixed;
        top: 0;
        right: -100%;
        width: 100%;
        height: 100vh;
        background: #05080d;
        flex-direction: column;
        justify-content: center;
        transition: 0.4s cubic-bezier(0.4, 0, 0.2, 1);
        z-index: 1000;
        gap: 3rem;
    }

    .nav-links.active {
        right: 0;
    }

    .menu-toggle {
        display: flex;
    }

    /* Hamburger Animation to X */
    .menu-toggle.open span:nth-child(1) { transform: rotate(45deg) translate(5px, 6px); }
    .menu-toggle.open span:nth-child(2) { opacity: 0; }
    .menu-toggle.open span:nth-child(3) { transform: rotate(-45deg) translate(5px, -6px); }

    .hero-content h1 { font-size: 2.8rem; }
    .hero-content p { font-size: 1.1rem; }
    
    .projects-grid { grid-template-columns: 1fr; }
    .glass-card { padding: 1.5rem; border-radius: 20px; }
    .section-title h2 { font-size: 2.2rem; }

    /* Hamburger Animation to X */
    .menu-toggle.open span:nth-child(1) { transform: rotate(45deg) translate(5px, 6px); }
    .menu-toggle.open span:nth-child(2) { opacity: 0; }
    .menu-toggle.open span:nth-child(3) { transform: rotate(-45deg) translate(5px, -6px); }

    /* Post Detail Improvements */
    .post-header { height: 45vh; padding-bottom: 3rem; }
    .post-header h1 { font-size: 2.2rem !important; }
    .post-content-wrapper .glass-card { padding: 2rem !important; }
    .post-content-wrapper { line-height: 1.6 !important; font-size: 1rem !important; }
    .post-meta { flex-direction: column; align-items: flex-start; gap: 0.5rem; }
}

/* About/Mission Section Responsive Fixes */
.about-card {
    display: flex;
    align-items: center;
    gap: 4rem;
    padding: 5rem;
    flex-wrap: wrap;
}

.about-content {
    flex: 1;
    min-width: 300px;
}

.about-stats {
    flex: 1;
    min-width: 300px;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
}

.stat-item {
    padding: 2rem;
    text-align: center;
    border: 1px solid rgba(255,255,255,0.05);
}

.stat-item:nth-child(even) {
    margin-top: 2rem;
}

@media (max-width: 992px) {
    .about-card {
        padding: 3rem 2rem;
        gap: 3rem;
    }
    
    .about-card h2 {
        font-size: 2.5rem !important;
    }

    .stat-item:nth-child(even) {
        margin-top: 0;
    }
}

@media (max-width: 768px) {
    .about-card {
        padding: 2.5rem 1.2rem !important;
        flex-direction: column;
        text-align: center;
        gap: 2rem;
    }

    .about-card h2 {
        font-size: 1.8rem !important;
        margin-bottom: 1.5rem !important;
        line-height: 1.2 !important;
    }
    
    .about-stats {
        grid-template-columns: 1fr;
        width: 100%;
        min-width: unset;
        gap: 1.5rem;
    }
    
    .about-content {
        min-width: unset;
        width: 100%;
    }
    
    .about-content p {
        font-size: 1rem !important;
        line-height: 1.6 !important;
        margin-bottom: 1rem;
        word-wrap: break-word;
    }

    .stat-item {
        padding: 2rem 1.5rem !important;
        margin-top: 0 !important;
        width: 100%;
    }
}

/* Comment Section Improvements */
.comment-avatar {
    width: 45px;
    height: 45px;
    min-width: 45px;
    border-radius: 50%;
    background: var(--primary-color);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    color: black;
    overflow: hidden;
}

.comment-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.comment-actions {
    display: flex;
    gap: 1rem;
    margin-top: 1.5rem;
    padding-top: 1.2rem;
    border-top: 1px solid rgba(255,255,255,0.03);
}

.action-btn {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--glass-border);
    color: var(--text-dim);
    font-size: 0.8rem;
    padding: 0.6rem 1.2rem;
    border-radius: 50px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.6rem;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    font-weight: 600;
    backdrop-filter: blur(5px);
}

.action-btn:hover {
    background: rgba(255, 255, 255, 0.08);
    color: white;
    border-color: rgba(255, 255, 255, 0.2);
    transform: translateY(-2px);
}

.action-btn.active {
    background: rgba(0, 210, 255, 0.1);
    border-color: var(--primary-color);
    color: var(--primary-color);
    box-shadow: 0 0 15px rgba(0, 210, 255, 0.2);
}

.action-btn.active span {
    color: white;
}

.reply-container {
    margin-left: 3rem;
    margin-top: 1.5rem;
    padding-left: 1.5rem;
    border-left: 2px solid var(--glass-border);
}

/* AI Chatbot Bottom-Right Position (Opens Up-Left) */
#ai-chatbot {
    position: fixed;
    bottom: 30px;
    right: 30px;
    z-index: 999999;
}

#ai-window {
    bottom: 80px;
    right: 0;
    width: 350px;
    max-width: 90vw;
    height: 500px;
    max-height: 70vh;
}

@media (max-width: 480px) {
    #ai-chatbot {
        bottom: 20px;
        right: 20px;
    }
    
    #ai-window {
        width: calc(100vw - 40px);
        right: 0;
        bottom: 70px;
    }
    
    #ai-bubble {
        width: 50px !important;
        height: 50px !important;
        font-size: 1.2rem !important;
    }
}

@media (max-width: 480px) {
    .about-card {
        padding: 2rem 1rem;
    }
    
    .about-card h2 {
        font-size: 2rem !important;
    }
}

@media (max-width: 480px) {
    .hero-content h1 { font-size: 2.5rem; }
    .btn { width: 100%; text-align: center; }
}
