:root {
    --bg-color: #0b0d17;
    --text-color: #a0a0a0;
    --heading-color: #ffffff;
    --primary-color: #00f3ff; /* Cyan Neon */
    --secondary-color: #bc13fe; /* Purple Neon */
    --card-bg: rgba(255, 255, 255, 0.05);
    --font-main: 'Segoe UI', sans-serif;
    --font-mono: 'Share Tech Mono', monospace;
}

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

body {
    font-family: var(--font-main);
    background-color: var(--bg-color);
    color: var(--text-color);
    line-height: 1.6;
    overflow-x: hidden;
    min-height: 100vh;
}

/* Video Background */
.video-background {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -2;
    overflow: hidden;
}

#bg-canvas {
    width: 100%;
    height: 100%;
    display: block;
}

.video-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(11, 13, 23, 0.7); /* Dark overlay to keep text readable */
    z-index: 1;
}

/* Film Grain Effect */
.film-grain {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    pointer-events: none;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noiseFilter'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.65' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)' opacity='0.05'/%3E%3C/svg%3E");
    opacity: 0.4;
}

/* Viewfinder Overlay (REC) */
.viewfinder-overlay {
    position: fixed;
    top: 20px;
    left: 20px;
    right: 20px;
    bottom: 20px;
    z-index: 0;
    pointer-events: none;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.corner {
    position: absolute;
    width: 20px;
    height: 20px;
    border-color: rgba(255, 255, 255, 0.5);
    border-style: solid;
}

.tl { top: 0; left: 0; border-width: 2px 0 0 2px; }
.tr { top: 0; right: 0; border-width: 2px 2px 0 0; }
.bl { bottom: 0; left: 0; border-width: 0 0 2px 2px; }
.br { bottom: 0; right: 0; border-width: 0 2px 2px 0; }

.rec-indicator {
    position: absolute;
    top: 20px;
    right: 30px;
    color: #ff0000;
    font-family: var(--font-mono);
    font-weight: bold;
    animation: blink 2s infinite;
    text-shadow: 0 0 5px rgba(255, 0, 0, 0.5);
}

@keyframes blink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0; }
}

/* Background Animation (Starfield) - Kept for other pages if needed or overlay */
.bg-animation {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -3; /* Behind video */
    background: radial-gradient(ellipse at bottom, #1b2735 0%, #090a0f 100%);
    overflow: hidden;
    display: none; /* Hide on home page if video is active, or use specific classes */
}

/* Only show starfield on non-home pages if desired, or let video persist */
body:not(.page-home) .bg-animation {
    display: block;
    z-index: -1;
}

body:not(.page-home) .video-background,
body:not(.page-home) .film-grain,
body:not(.page-home) .viewfinder-overlay {
    display: none;
}

#stars, #stars2, #stars3 {
    width: 1px;
    height: 1px;
    background: transparent;
    box-shadow: 1744px 122px #FFF , 134px 1321px #FFF , 92px 859px #FFF; 
    animation: animStar 50s linear infinite;
}
#stars:after, #stars2:after, #stars3:after {
    content: " ";
    position: absolute;
    top: 2000px;
    width: 1px;
    height: 1px;
    background: transparent;
    box-shadow: 1744px 122px #FFF , 134px 1321px #FFF , 92px 859px #FFF;
}

#stars2 { animation-duration: 100s; width: 2px; height: 2px; }
#stars3 { animation-duration: 150s; width: 3px; height: 3px; }

@keyframes animStar {
    from { transform: translateY(0px); }
    to { transform: translateY(-2000px); }
}

/* Common Layout */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    position: relative;
}

a {
    text-decoration: none;
    color: inherit;
    transition: all 0.3s ease;
}

/* Header */
header {
    padding: 20px 0;
    position: absolute;
    width: 100%;
    top: 0;
    z-index: 10;
}

.logo {
    font-family: var(--font-mono);
    color: var(--primary-color);
    border: 1px solid var(--primary-color);
    padding: 5px 15px;
    font-size: 0.9rem;
    letter-spacing: 2px;
}

.logo:hover {
    background: var(--primary-color);
    color: #000;
    box-shadow: 0 0 10px var(--primary-color);
}

/* Hero Section (Home) */
.hero-section {
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
}

.hero-content {
    max-width: 800px;
}

h1.glitch {
    font-family: var(--font-mono);
    font-size: 4rem;
    color: var(--heading-color);
    position: relative;
    margin-bottom: 20px;
    text-shadow: 2px 2px var(--secondary-color);
}

.typewriter p {
    font-size: 1.5rem;
    margin-bottom: 30px;
}

.highlight {
    color: var(--primary-color);
    font-weight: bold;
}

.roles {
    display: flex;
    justify-content: center;
    gap: 15px;
    flex-wrap: wrap;
    margin-bottom: 40px;
}

.role-tag {
    background: rgba(255, 255, 255, 0.1);
    padding: 5px 15px;
    border-radius: 20px;
    font-size: 0.9rem;
    border: 1px solid rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(5px);
}

.mission {
    font-style: italic;
    color: rgba(255, 255, 255, 0.6);
    margin-bottom: 50px;
}

/* Navigation Buttons */
.main-nav {
    display: flex;
    justify-content: center;
    gap: 20px;
}

.nav-btn {
    position: relative;
    padding: 15px 40px;
    background: var(--primary-color);
    color: #000;
    font-weight: bold;
    font-family: var(--font-mono);
    text-transform: uppercase;
    letter-spacing: 1px;
    clip-path: polygon(10% 0, 100% 0, 100% 70%, 90% 100%, 0 100%, 0 30%);
    overflow: hidden;
}

.nav-btn.outline {
    background: transparent;
    color: var(--primary-color);
    border: 1px solid var(--primary-color);
    clip-path: none;
    border-radius: 4px;
}

.nav-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 0 20px rgba(0, 243, 255, 0.5);
}

.nav-btn.outline:hover {
    background: rgba(0, 243, 255, 0.1);
    box-shadow: 0 0 20px rgba(0, 243, 255, 0.2);
}

/* Products Page */
.page-products, .page-contact, .page-skills {
    padding-top: 100px;
}

.section h2 {
    font-family: var(--font-mono);
    font-size: 3rem;
    color: var(--heading-color);
    margin-bottom: 10px;
    text-align: center;
}

.subtitle {
    text-align: center;
    margin-bottom: 50px;
    color: var(--primary-color);
    font-family: var(--font-mono);
}

.product-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 30px;
}

.product-card {
    background: var(--card-bg);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    padding: 25px;
    transition: transform 0.3s, border-color 0.3s;
    position: relative;
    overflow: hidden;
}

.product-card:hover {
    transform: translateY(-10px);
    border-color: var(--primary-color);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
}

.product-card h3 {
    color: var(--heading-color);
    margin-bottom: 15px;
    font-size: 1.4rem;
}

.product-card p {
    font-size: 0.95rem;
    margin-bottom: 25px;
    color: #ccc;
}

.product-links {
    display: flex;
    gap: 15px;
}

.btn {
    padding: 8px 16px;
    border-radius: 4px;
    font-size: 0.85rem;
    font-weight: bold;
    text-transform: uppercase;
}

.btn-github {
    background: #333;
    color: #fff;
}

.btn-demo {
    background: linear-gradient(45deg, var(--primary-color), var(--secondary-color));
    color: #fff;
}

.btn:hover {
    opacity: 0.9;
}

/* Skills Page */
.skills-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 40px;
}

.skill-category {
    background: var(--card-bg);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 15px;
    padding: 30px;
    transition: transform 0.3s;
}

.skill-category:hover {
    transform: translateY(-5px);
    border-color: var(--secondary-color);
}

.category-header {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 25px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    padding-bottom: 15px;
}

.category-header .icon {
    font-size: 1.5rem;
}

.category-header h3 {
    color: var(--heading-color);
    font-family: var(--font-mono);
    font-size: 1.2rem;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.skill-item {
    margin-bottom: 20px;
}

.skill-item:last-child {
    margin-bottom: 0;
}

.skill-info {
    display: flex;
    justify-content: space-between;
    margin-bottom: 8px;
    font-size: 0.9rem;
    font-family: var(--font-mono);
    color: #ccc;
}

.progress-bar {
    width: 100%;
    height: 8px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
    overflow: hidden;
}

.progress {
    height: 100%;
    background: linear-gradient(90deg, var(--primary-color), var(--secondary-color));
    border-radius: 4px;
    position: relative;
    width: 0; 
    animation: loadProgress 1.5s ease-out forwards;
}

@keyframes loadProgress {
    from { width: 0; }
}

/* Contact Page */
.contact-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 40px;
}

.contact-card {
    background: var(--card-bg);
    padding: 40px;
    border-radius: 15px;
    border: 1px solid var(--primary-color);
    text-align: center;
    max-width: 400px;
    width: 100%;
    box-shadow: 0 0 15px rgba(0, 243, 255, 0.1);
}

.qr-code-placeholder {
    width: 200px;
    height: 200px;
    background: rgba(0, 0, 0, 0.5);
    margin: 20px auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    border: 2px solid rgba(255, 255, 255, 0.1);
    position: relative;
    overflow: hidden;
}

.scan-line {
    position: absolute;
    width: 100%;
    height: 2px;
    background: var(--primary-color);
    top: 0;
    animation: scan 2s linear infinite;
    box-shadow: 0 0 5px var(--primary-color);
}

@keyframes scan {
    0% { top: 0; }
    100% { top: 100%; }
}

/* Footer */
.site-footer {
    background: rgba(11, 13, 23, 0.9);
    border-top: 1px solid var(--primary-color);
    padding: 30px 0;
    margin-top: 50px;
    text-align: center;
    backdrop-filter: blur(10px);
    position: relative;
    z-index: 10;
}

.footer-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    font-family: var(--font-mono);
    color: rgba(255, 255, 255, 0.6);
    font-size: 0.9rem;
}

.footer-links {
    margin: 15px 0;
    display: flex;
    justify-content: center;
    gap: 20px;
}

.footer-links a {
    color: var(--primary-color);
    text-transform: uppercase;
    font-size: 0.85rem;
    position: relative;
}

.footer-links a::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 0;
    height: 1px;
    background: var(--secondary-color);
    transition: width 0.3s ease;
}

.footer-links a:hover::after {
    width: 100%;
}

.footer-note {
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.3);
    margin-top: 15px;
}

/* Responsive */
@media (max-width: 768px) {
    .site-footer {
        padding: 20px 0;
    }
    
    .footer-links {
        gap: 15px;
    }

    h1.glitch { 
        font-size: 2.5rem; 
        margin-top: 20px;
    }
    
    .hero-content { 
        padding: 0 20px; 
        width: 100%;
    }
    
    .main-nav { 
        flex-direction: column; 
        width: 100%; 
        gap: 15px;
        align-items: stretch; /* Stretch buttons to full width */
    }
    
    .nav-btn { 
        width: 100%; 
        text-align: center; 
        padding: 15px 20px; /* Larger touch target */
    }
    
    .roles {
        gap: 10px;
        margin-bottom: 30px;
    }
    
    .role-tag {
        font-size: 0.8rem;
        padding: 4px 10px;
    }
}

@media (max-width: 480px) {
    h1.glitch {
        font-size: 2rem;
    }
    
    .typewriter p {
        font-size: 1.1rem;
    }
    
    .mission {
        font-size: 0.9rem;
        padding: 0 10px;
    }
}
