/* Persistent Header */
.persistent-header {
    position: fixed;
    top: 0; left: 0; width: 100vw;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 50px;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    z-index: 1000;
}
.header-brand {
    font-family: var(--font-heading);
    font-size: 1.4rem;
    letter-spacing: 3px;
    text-decoration: none;
    color: #fff;
}
.header-nav {
    display: flex;
    gap: 40px;
}
.header-nav a {
    color: var(--text-primary);
    text-decoration: none;
    font-size: 0.8rem;
    letter-spacing: 2px;
    text-transform: uppercase;
    position: relative;
    transition: opacity 0.3s;
}
.header-nav a::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 0;
    width: 0;
    height: 1px;
    background: var(--accent-glow);
    transition: width 0.3s ease;
}
.header-nav a:hover::after,
.header-nav a.active::after {
    width: 100%;
}
.header-nav a:hover { opacity: 0.8; }
.header-nav a.active { opacity: 1; }

.header-cta {
    border: 1px solid rgba(255, 255, 255, 0.25);
    padding: 10px 24px;
    border-radius: 30px;
    text-decoration: none;
    color: #fff;
    font-size: 0.75rem;
    letter-spacing: 2px;
    font-family: var(--font-sans);
    transition: all 0.3s ease;
    display: inline-block;
}
.header-cta:hover {
    background: #fff;
    color: #000;
}

/* WebGL Background */
#webgl-canvas {
    position: fixed;
    top: 0; left: 0;
    width: 100vw; height: 100vh;
    z-index: -1;
    pointer-events: none;
}

/* Scroll Sections */
.scroll-container {
    position: relative;
    z-index: 10;
}

section {
    min-height: 100vh;
    width: 100vw;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 15vh 10vw;
    background: transparent;
}

/* ===== HERO ===== */
.hero {
    text-align: center;
    position: relative;
}
.hero h1 {
    font-size: clamp(4rem, 10vw, 11rem);
    line-height: 1.05;
    margin-bottom: 24px;
    color: #fff;
}
.hero p {
    font-size: 1.1rem;
    color: rgba(255, 255, 255, 0.7);
    letter-spacing: 3px;
    text-transform: uppercase;
    font-family: var(--font-sans);
    font-weight: 300;
}
/* Decorative line below hero subtitle */
.hero-line {
    width: 60px;
    height: 1px;
    background: var(--accent-glow);
    margin: 40px auto 0;
    opacity: 0.6;
}

/* ===== ABOUT ===== */
.about {
    align-items: flex-start;
    position: relative;
}
.about h2 {
    font-size: clamp(2.5rem, 5vw, 4rem);
    margin-bottom: 40px;
    color: #fff;
}
.about p {
    font-size: clamp(1rem, 1.8vw, 1.2rem);
    max-width: 640px;
    line-height: 1.9;
    color: rgba(255, 255, 255, 0.85);
    margin-bottom: 1.5rem;
    font-weight: 300;
}

/* ===== PROJECTS ===== */
.projects {
    align-items: center;
}
.projects h2 {
    font-size: clamp(2.5rem, 5vw, 4rem);
    margin-bottom: 60px;
    color: #fff;
}
.project-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
    gap: 32px;
    width: 100%;
    max-width: 1200px;
    isolation: isolate;
}

.project-card {
    position: relative;
    width: 100%;
    aspect-ratio: 4 / 3;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 16px;
    overflow: hidden;
    background: #0a0a0a;
    transition: box-shadow 0.4s ease, border-color 0.4s ease;
    display: flex;
    flex-direction: column;
    z-index: 1;
}
.project-card:hover {
    border-color: rgba(99, 102, 241, 0.4);
    box-shadow: 0 8px 40px rgba(99, 102, 241, 0.12), 0 0 0 1px rgba(99, 102, 241, 0.15);
    z-index: 2;
}

.project-image-wrapper {
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
    z-index: 1;
}
.project-image-wrapper img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.8s cubic-bezier(0.16, 1, 0.3, 1), filter 0.6s ease;
    filter: brightness(0.5) saturate(0.8);
}
.project-card:hover .project-image-wrapper img {
    transform: scale(1.06);
    filter: brightness(0.35) saturate(1);
}

.project-info {
    position: absolute;
    bottom: 0; left: 0;
    width: 100%;
    padding: 28px;
    z-index: 2;
    background: linear-gradient(180deg, transparent 0%, rgba(0,0,0,0.85) 60%, rgba(0,0,0,0.95) 100%);
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.project-info h3 {
    font-size: 1.3rem;
    color: #fff;
    margin-bottom: 4px;
    font-family: var(--font-heading);
    letter-spacing: 1px;
}
.project-info p {
    font-size: 0.88rem;
    color: rgba(255,255,255,0.7);
    line-height: 1.5;
    margin-bottom: 12px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.project-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}
.project-tag {
    font-size: 0.65rem;
    font-family: var(--font-sans);
    font-weight: 500;
    padding: 3px 8px;
    border: 1px solid rgba(255,255,255,0.15);
    border-radius: 4px;
    color: rgba(255,255,255,0.8);
    background: rgba(255,255,255,0.05);
    letter-spacing: 0.5px;
}

/* ===== CONTACT ===== */
.contact {
    text-align: center;
    align-items: center;
    padding-bottom: 5vh;
}
.contact h2 {
    font-size: clamp(2.5rem, 5vw, 5rem);
    margin-bottom: 24px;
}
.contact p {
    font-size: 1.1rem;
    color: rgba(255,255,255,0.6);
    max-width: 540px;
    margin-bottom: 40px;
    line-height: 1.7;
}
.contact-btn {
    font-size: 1.3rem;
    font-family: var(--font-heading);
    color: #fff;
    text-decoration: none;
    border-bottom: 1px solid rgba(255,255,255,0.4);
    padding-bottom: 6px;
    transition: border-color 0.3s, color 0.3s;
    letter-spacing: 2px;
}
.contact-btn:hover {
    border-color: var(--accent-glow);
    color: var(--accent-glow);
}

/* Social Links */
.social-links {
    display: flex;
    gap: 24px;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
}
.social-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: rgba(255,255,255,0.6);
    text-decoration: none;
    font-family: var(--font-sans);
    font-size: 0.85rem;
    letter-spacing: 1px;
    transition: color 0.3s;
}
.social-link:hover { color: #fff; }
.social-link svg {
    width: 18px;
    height: 18px;
    fill: currentColor;
}

/* Footer */
.site-footer {
    text-align: center;
    padding: 40px 10vw;
    border-top: 1px solid rgba(255,255,255,0.06);
    color: rgba(255,255,255,0.3);
    font-size: 0.8rem;
    letter-spacing: 1px;
    font-family: var(--font-sans);
}

/* ===== PROJECT MODAL ===== */
.project-modal {
    position: fixed;
    top: 0; left: 0;
    width: 100vw; height: 100vh;
    background: rgba(0,0,0,0.98);
    z-index: 2000;
    display: none;
    flex-direction: column;
    overflow-y: auto;
    opacity: 0;
}
.modal-close {
    position: fixed;
    top: 24px; right: 32px;
    color: #fff;
    font-family: var(--font-sans);
    font-weight: 500;
    font-size: 0.85rem;
    letter-spacing: 2px;
    z-index: 2010;
    padding: 10px 16px;
    border: 1px solid rgba(255,255,255,0.2);
    border-radius: 6px;
    background: rgba(0,0,0,0.4);
    backdrop-filter: blur(8px);
    transition: border-color 0.3s;
    cursor: none !important;
}
.modal-close:hover {
    border-color: rgba(255,255,255,0.6);
}
.modal-image-container {
    width: 100%;
    height: 55vh;
    min-height: 300px;
    position: relative;
    overflow: hidden;
}
.modal-image-container img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    filter: brightness(0.5);
}
.modal-content {
    padding: 8vh 10vw 12vh;
    max-width: 900px;
    margin: 0 auto;
    width: 100%;
}
.modal-content h2 {
    font-size: clamp(2rem, 4vw, 4rem);
    margin-bottom: 20px;
    line-height: 1.15;
}
.modal-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 40px;
}
/* Modal rendered markdown typography */
.modal-content h1,
.modal-content h2,
.modal-content h3 {
    color: #fff;
    margin-top: 2em;
    margin-bottom: 0.8em;
}
.modal-content h1 { font-size: clamp(2rem, 4vw, 3.5rem); margin-top: 0; }
.modal-content p,
.modal-content li {
    font-size: 1.1rem;
    color: rgba(255,255,255,0.75);
    line-height: 1.85;
    margin-bottom: 1em;
}
.modal-content strong {
    color: #fff;
    font-weight: 600;
}
.modal-content ul, .modal-content ol {
    padding-left: 1.5em;
    margin-bottom: 1.5em;
}
.modal-content code {
    background: rgba(255,255,255,0.08);
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 0.95em;
}
.modal-content hr {
    border: none;
    border-top: 1px solid rgba(255,255,255,0.1);
    margin: 3em 0;
}
.modal-cta {
    display: inline-block;
    padding: 14px 36px;
    border: 1px solid rgba(255,255,255,0.3);
    border-radius: 30px;
    color: #fff;
    text-decoration: none;
    font-family: var(--font-sans);
    font-size: 0.85rem;
    letter-spacing: 2px;
    transition: all 0.3s;
    margin-top: 40px;
}
.modal-cta:hover {
    background: #fff;
    color: #000;
}

/* Next indicator at bottom of modal */
.modal-next-hint {
    text-align: center;
    padding: 40px 0 60px;
    color: rgba(255,255,255,0.3);
    font-size: 0.75rem;
    letter-spacing: 3px;
    text-transform: uppercase;
    font-family: var(--font-sans);
}
.modal-next-hint svg {
    display: block;
    margin: 10px auto 0;
    width: 20px;
    height: 20px;
    fill: none;
    stroke: rgba(255,255,255,0.3);
    stroke-width: 2;
    animation: bounceDown 1.5s ease-in-out infinite;
}
@keyframes bounceDown {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(6px); }
}

/* ===== AUDIO TOGGLE ===== */
.audio-toggle {
    position: fixed;
    bottom: 28px;
    right: 28px;
    z-index: 9999;
    background: rgba(0,0,0,0.5);
    border: 1px solid rgba(255,255,255,0.12);
    color: #fff;
    padding: 10px 18px;
    border-radius: 30px;
    cursor: none !important;
    font-family: var(--font-sans);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    display: flex;
    align-items: center;
    gap: 8px;
    transition: border-color 0.3s, background 0.3s;
    font-size: 0.8rem;
    letter-spacing: 1px;
    font-weight: 500;
}
.audio-toggle:hover {
    border-color: rgba(255,255,255,0.4);
    background: rgba(255,255,255,0.08);
}
.audio-toggle.active {
    border-color: var(--accent-glow);
}
.audio-toggle svg {
    width: 16px;
    height: 16px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
    .persistent-header { padding: 16px 20px; }
    .header-nav { display: none; }
    .header-cta { display: none; }
    
    /* Mobile menu button */
    .mobile-menu-btn {
        display: flex;
        flex-direction: column;
        gap: 5px;
        background: none;
        border: none;
        padding: 8px;
        cursor: none !important;
    }
    .mobile-menu-btn span {
        width: 24px;
        height: 1.5px;
        background: #fff;
        display: block;
        transition: all 0.3s;
    }
    
    /* Mobile Nav Overlay */
    .mobile-nav-overlay {
        position: fixed;
        top: 0; left: 0;
        width: 100vw; height: 100vh;
        background: rgba(0,0,0,0.95);
        z-index: 999;
        display: none;
        flex-direction: column;
        justify-content: center;
        align-items: center;
        gap: 40px;
    }
    .mobile-nav-overlay.open { display: flex; }
    .mobile-nav-overlay a {
        color: #fff;
        text-decoration: none;
        font-family: var(--font-heading);
        font-size: 2rem;
        letter-spacing: 4px;
        text-transform: uppercase;
        transition: opacity 0.3s;
    }
    .mobile-nav-overlay a:hover { opacity: 0.5; }
    
    section { padding: 12vh 6vw; }
    .hero h1 { font-size: clamp(3rem, 12vw, 6rem); }
    .project-list {
        grid-template-columns: 1fr;
        gap: 24px;
    }
    .project-card { aspect-ratio: 16 / 10; }
    .modal-content { padding: 6vh 6vw 10vh; }
    .audio-toggle { bottom: 16px; right: 16px; padding: 8px 14px; font-size: 0.7rem; }
}

@media (min-width: 769px) {
    .mobile-menu-btn { display: none; }
}
