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

:root {
    --primary-blue: #0066FF;
    --deep-blue: #001B44;
    --cyan: #00D4FF;
    --purple: #9D4EDD;
    --magenta: #E01583;
    --orange: #FF6B35;
    --yellow: #FFD60A;
    --dark-bg: #0A0E27;
    --card-bg: rgba(13, 20, 45, 0.8);
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, var(--dark-bg) 0%, #1a1a3e 100%);
    color: #fff;
    overflow-x: hidden;
    line-height: 1.6;
}

/* Animated Background */
.bg-animation {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    overflow: hidden;
}

.circuit-line {
    position: absolute;
    background: linear-gradient(90deg, transparent, var(--cyan), transparent);
    height: 2px;
    animation: circuitFlow 8s linear infinite;
    opacity: 0.3;
}

@keyframes circuitFlow {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(200vw); }
}

.pixel-grid {
    position: absolute;
    width: 100%;
    height: 100%;
    background-image: 
        linear-gradient(rgba(0, 212, 255, 0.05) 1px, transparent 1px),
        linear-gradient(90deg, rgba(0, 212, 255, 0.05) 1px, transparent 1px);
    background-size: 50px 50px;
    animation: gridPulse 4s ease-in-out infinite;
}

@keyframes gridPulse {
    0%, 100% { opacity: 0.3; }
    50% { opacity: 0.6; }
}

/* Navigation */
nav {
    position: fixed;
    top: 0;
    width: 100%;
    padding: 20px 5%;
    background: rgba(10, 14, 39, 0.9);
    backdrop-filter: blur(10px);
    z-index: 1000;
    border-bottom: 1px solid rgba(0, 212, 255, 0.2);
}

nav .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 1400px;
    margin: 0 auto;
}

.logo {
    font-size: 28px;
    font-weight: bold;
    background: linear-gradient(135deg, var(--cyan), var(--purple));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    text-transform: uppercase;
    letter-spacing: 2px;
}

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

.nav-links a {
    color: #fff;
    text-decoration: none;
    font-weight: 500;
    transition: all 0.3s;
    position: relative;
}

.nav-links a::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--cyan);
    transition: width 0.3s;
}

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

/* Hero Section */
.hero {
    min-height: 60vh;
    display: flex;
    align-items: center;
    padding: 120px 5% 80px;
}

.hero-container {
    max-width: 1400px;
    margin: 0 auto;
    text-align: center;
}

.hero-content h1 {
    font-size: 4rem;
    margin-bottom: 20px;
    background: linear-gradient(135deg, var(--cyan), var(--purple), var(--magenta));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    animation: textGlow 3s ease-in-out infinite;
}

@keyframes textGlow {
    0%, 100% { filter: brightness(1); }
    50% { filter: brightness(1.3); }
}

.hero-content .subtitle {
    font-size: 1.5rem;
    color: var(--cyan);
    margin-bottom: 10px;
    font-weight: 300;
}

.hero-content .tagline {
    font-size: 1.2rem;
    color: rgba(255, 255, 255, 0.7);
    max-width: 800px;
    margin: 0 auto;
    line-height: 1.8;
}

/* Filter Section */
.filter-section {
    padding: 40px 5%;
    background: rgba(13, 20, 45, 0.5);
}

.filter-container {
    max-width: 1400px;
    margin: 0 auto;
    display: flex;
    justify-content: center;
    gap: 15px;
    flex-wrap: wrap;
}

.filter-btn {
    padding: 12px 30px;
    background: var(--card-bg);
    border: 2px solid rgba(0, 212, 255, 0.3);
    border-radius: 8px;
    color: #fff;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s;
}

.filter-btn:hover {
    border-color: var(--cyan);
    background: rgba(0, 212, 255, 0.1);
    transform: translateY(-2px);
}

.filter-btn.active {
    background: linear-gradient(135deg, var(--primary-blue), var(--cyan));
    border-color: var(--cyan);
    box-shadow: 0 8px 25px rgba(0, 212, 255, 0.4);
}

/* Projects Section */
.projects-section {
    padding: 80px 5%;
}

.projects-grid {
    max-width: 1400px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 40px;
}

.project-card {
    background: var(--card-bg);
    border-radius: 15px;
    border: 1px solid rgba(0, 212, 255, 0.2);
    backdrop-filter: blur(10px);
    overflow: hidden;
    transition: all 0.4s;
    opacity: 0;
    animation: fadeIn 1s forwards;
}

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

.project-card:hover {
    transform: translateY(-10px);
    border-color: var(--cyan);
    box-shadow: 0 15px 40px rgba(0, 212, 255, 0.3);
}

.project-image {
    position: relative;
    height: 200px;
    background: linear-gradient(135deg, var(--deep-blue), var(--primary-blue));
    overflow: hidden;
    background-repeat: no-repeat;
    background-position: center;
}

.project-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 102, 255, 0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s;
}

.project-card:hover .project-overlay {
    opacity: 1;
}

.view-details {
    color: #fff;
    font-size: 1.2rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.project-badge {
    position: absolute;
    top: 15px;
    right: 15px;
    background: linear-gradient(135deg, var(--magenta), var(--orange));
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
    z-index: 10;
}

.project-content {
    padding: 30px;
}

.project-tags {
    display: flex;
    gap: 10px;
    margin-bottom: 15px;
    flex-wrap: wrap;
}

.tag {
    background: rgba(0, 212, 255, 0.1);
    border: 1px solid var(--cyan);
    padding: 5px 12px;
    border-radius: 15px;
    font-size: 0.85rem;
    color: var(--cyan);
}

.project-content h3 {
    font-size: 1.5rem;
    margin-bottom: 15px;
    color: #fff;
}

.project-content p {
    color: rgba(255, 255, 255, 0.7);
    line-height: 1.6;
    margin-bottom: 20px;
}

.project-meta {
    display: flex;
    gap: 15px;
    margin-bottom: 20px;
    padding-top: 15px;
    border-top: 1px solid rgba(0, 212, 255, 0.2);
}

.meta-item {
    color: rgba(255, 255, 255, 0.6);
    font-size: 0.9rem;
}

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

.project-link {
    padding: 10px 20px;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s;
    text-align: center;
    flex: 1;
}

.project-link:not(.secondary) {
    background: linear-gradient(135deg, var(--primary-blue), var(--cyan));
    color: #fff;
}

.project-link.secondary {
    background: transparent;
    border: 2px solid var(--cyan);
    color: var(--cyan);
}

.project-link:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(0, 212, 255, 0.4);
}

/* Stats Section */
.stats-section {
    padding: 80px 5%;
    background: linear-gradient(180deg, rgba(0, 102, 255, 0.05), transparent);
}

.stats-container {
    max-width: 1400px;
    margin: 0 auto;
    text-align: center;
}

.section-title {
    font-size: 3rem;
    margin-bottom: 60px;
    background: linear-gradient(135deg, var(--cyan), var(--purple));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.achievement-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 30px;
}

.achievement-card {
    background: var(--card-bg);
    padding: 40px 30px;
    border-radius: 15px;
    border: 1px solid rgba(157, 78, 221, 0.3);
    transition: all 0.4s;
}

.achievement-card:hover {
    transform: translateY(-10px);
    border-color: var(--purple);
    box-shadow: 0 15px 40px rgba(157, 78, 221, 0.3);
}

.achievement-icon {
    font-size: 3rem;
    margin-bottom: 20px;
}

.achievement-number {
    font-size: 2.5rem;
    font-weight: bold;
    background: linear-gradient(135deg, var(--cyan), var(--purple));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 10px;
}

.achievement-label {
    color: rgba(255, 255, 255, 0.7);
    font-size: 1rem;
}

/* CTA Section */
.cta-section {
    padding: 100px 5%;
    background: linear-gradient(180deg, transparent, rgba(0, 102, 255, 0.05));
}

.cta-container {
    max-width: 800px;
    margin: 0 auto;
    text-align: center;
}

.cta-container h2 {
    font-size: 3rem;
    margin-bottom: 30px;
    background: linear-gradient(135deg, var(--cyan), var(--magenta));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.cta-container p {
    font-size: 1.2rem;
    color: rgba(255, 255, 255, 0.8);
    margin-bottom: 40px;
}

.btn {
    padding: 15px 35px;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    text-decoration: none;
    display: inline-block;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary-blue), var(--cyan));
    color: #fff;
    box-shadow: 0 8px 25px rgba(0, 212, 255, 0.4);
}

.btn-primary:hover {
    transform: translateY(-3px);
    box-shadow: 0 12px 35px rgba(0, 212, 255, 0.6);
}

/* Floating Bubbles */
.floating-bubbles {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    pointer-events: none;
    z-index: 1;
}

.bubble {
    position: absolute;
    width: 80px;
    height: 80px;
    border-radius: 50%;
    opacity: 0.6;
    animation: floatBubble linear infinite;
    filter: drop-shadow(0 0 15px var(--cyan));
    mix-blend-mode: screen;
    object-fit: cover;
}

.bubble:nth-child(1) {
    left: 10%;
    animation-duration: 20s;
    animation-delay: 0s;
}
.bubble:nth-child(2) {
    left: 35%;
    animation-duration: 25s;
    animation-delay: 5s;
}
.bubble:nth-child(3) {
    left: 60%;
    animation-duration: 22s;
    animation-delay: 2s;
}
.bubble:nth-child(4) {
    left: 80%;
    animation-duration: 28s;
    animation-delay: 7s;
}

@keyframes floatBubble {
    0% {
        transform: translateY(100vh) scale(0.9);
        opacity: 0.3;
    }
    30% {
        opacity: 0.8;
    }
    70% {
        opacity: 0.7;
    }
    100% {
        transform: translateY(-150px) scale(1.1);
        opacity: 0.2;
    }
}

/* Footer */
footer {
    padding: 40px 5%;
    text-align: center;
    background: rgba(10, 14, 39, 0.9);
    border-top: 1px solid rgba(0, 212, 255, 0.2);
}

footer p {
    color: rgba(255, 255, 255, 0.6);
}

/* Scroll animations */
.fade-in {
    opacity: 0;
    transform: translateY(30px);
    animation: fadeIn 1s forwards;
}

/* Responsive */
@media (max-width: 968px) {
    nav .container {
        flex-direction: column;
        gap: 15px;
    }

    .logo {
        font-size: 24px;
    }

    .nav-links {
        flex-wrap: wrap;
        justify-content: center;
        gap: 15px;
    }

    .hero {
        padding: 100px 5% 60px;
    }

    .hero-content h1 {
        font-size: 2.5rem;
    }

    .hero-content .subtitle {
        font-size: 1.2rem;
    }

    .hero-content .tagline {
        font-size: 1rem;
    }

    .filter-container {
        gap: 10px;
    }

    .filter-btn {
        padding: 10px 20px;
        font-size: 0.9rem;
    }

    .projects-grid {
        grid-template-columns: 1fr;
        gap: 30px;
    }

    .section-title {
        font-size: 2rem;
    }

    .achievement-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 20px;
    }

    .cta-container h2 {
        font-size: 2rem;
    }

    .cta-container p {
        font-size: 1rem;
    }
}

@media (max-width: 640px) {
    .hero {
        padding: 80px 4% 50px;
    }

    .hero-content h1 {
        font-size: 1.8rem;
    }

    .hero-content .subtitle {
        font-size: 1rem;
    }

    .hero-content .tagline {
        font-size: 0.9rem;
    }

    .filter-section {
        padding: 30px 4%;
    }

    .filter-btn {
        padding: 8px 16px;
        font-size: 0.85rem;
    }

    .projects-section {
        padding: 60px 4%;
    }

    .project-image {
        height: 180px;
    }

    .project-content {
        padding: 20px;
    }

    .project-content h3 {
        font-size: 1.3rem;
    }

    .project-links {
        flex-direction: column;
    }

    .stats-section {
        padding: 60px 4%;
    }

    .section-title {
        font-size: 1.6rem;
        margin-bottom: 40px;
    }

    .achievement-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }

    .achievement-card {
        padding: 30px 20px;
    }

    .achievement-number {
        font-size: 2rem;
    }

    .cta-section {
        padding: 60px 4%;
    }

    .cta-container h2 {
        font-size: 1.6rem;
    }

    .cta-container p {
        font-size: 0.9rem;
    }

    .btn {
        width: 100%;
        padding: 12px 25px;
    }

    .pixel-grid {
        background-size: 30px 30px;
    }

    .circuit-line {
        display: none;
    }
}

@media (max-width: 375px) {
    .hero-content h1 {
        font-size: 1.5rem;
    }

    .section-title {
        font-size: 1.4rem;
    }

    .cta-container h2 {
        font-size: 1.4rem;
    }

    .project-content h3 {
        font-size: 1.1rem;
    }
}

/* Landscape orientation fixes */
@media (max-height: 500px) and (orientation: landscape) {
    .hero {
        min-height: auto;
        padding: 80px 5% 50px;
    }

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

/* Touch-friendly tap targets */
@media (hover: none) and (pointer: coarse) {
    .btn,
    .filter-btn,
    .project-link,
    .nav-links a {
        min-height: 44px;
        min-width: 44px;
    }
}

/* Notched devices support */
@supports (padding: max(0px)) {
    nav,
    .hero,
    .filter-section,
    .projects-section,
    .stats-section,
    .cta-section,
    footer {
        padding-left: max(5%, env(safe-area-inset-left));
        padding-right: max(5%, env(safe-area-inset-right));
    }
}