/* ==========================================================================
   CSS Variables & Design System
   ========================================================================== */
:root {
    /* Premium Cyber-Tech Black Theme */

    --bg-dark: #030303;
    --bg-panel: rgba(10, 10, 15, 0.6);

    --neon-blue: #38bdf8;
    --neon-purple: #c084fc;

    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;

    --border-color: rgba(56, 189, 248, 0.15);

    /* Typography */
    --font-heading: 'Space Grotesk', sans-serif;
    --font-body: 'Space Grotesk', sans-serif;
    --font-mono: 'Fira Code', monospace;

    /* Spacing & Utilities */
    --section-pad: 100px 20px;
    --glass-blur: blur(16px);
    --transition: all 0.3s ease;
}

/* ==========================================================================
   Base Styles
   ========================================================================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    scroll-behavior: smooth;
}

body {
    background-color: var(--bg-dark);
    color: var(--text-primary);
    font-family: var(--font-body);
    line-height: 1.6;
    overflow-x: hidden;
    position: relative;
}

h1, h2, h3, h4 {
    font-family: var(--font-heading);
    font-weight: 700;
}

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

ul {
    list-style: none;
}

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

/* ==========================================================================
   Utility Classes
   ========================================================================== */
.glass-panel {
    background: var(--bg-panel);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(15, 23, 42, 0.08);
}

.hover-glow {
    transition: var(--transition);
}

.hover-glow:hover {
    border-color: rgba(37, 99, 235, 0.25);
    box-shadow: 0 10px 30px rgba(37, 99, 235, 0.12);
    transform: translateY(-5px);
}

.neon-text-blue {
    color: var(--neon-blue);
    text-shadow: none;
}

.neon-text-purple {
    color: var(--neon-purple);
    text-shadow: none;
}

/* Buttons */
.neon-btn {
    display: inline-block;
    padding: 12px 30px;
    background: transparent;
    color: var(--neon-blue);
    border: 1px solid var(--neon-blue);
    border-radius: 4px;
    font-family: var(--font-mono);
    text-transform: uppercase;
    letter-spacing: 2px;
    position: relative;
    overflow: hidden;
    z-index: 1;
    transition: var(--transition);
    cursor: pointer;
}

.neon-btn:hover {
    background: rgba(37, 99, 235, 0.08);
    box-shadow: 0 8px 20px rgba(37, 99, 235, 0.15);
}

.neon-btn.outline {
    border-color: var(--neon-purple);
    color: var(--neon-purple);
}

.neon-btn.outline:hover {
    background: rgba(124, 58, 237, 0.08);
    box-shadow: 0 8px 20px rgba(124, 58, 237, 0.15);
}

/* ==========================================================================
   Navigation
   ========================================================================== */
.navbar {
    position: fixed;
    top: 0;
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 40px;
    z-index: 100;
    border-radius: 0;
    border-top: none;
    border-left: none;
    border-right: none;
    background: rgba(3, 3, 3, 0.75);
}

.logo {
    font-family: var(--font-mono);
    font-size: 1.4rem;
    font-weight: 700;
    letter-spacing: 2px;
}

/* Groups nav-links + resume button together */
.nav-right {
    display: flex;
    align-items: center;
    gap: 25px;
}

.nav-links {
    display: flex;
    gap: 25px;
}

.nav-links li a {
    font-family: var(--font-mono);
    font-size: 0.95rem;
    font-weight: 700;
    position: relative;
}

.nav-links li a:hover {
    color: var(--neon-blue);
}

.nav-links li a::after {
    content: '';
    position: absolute;
    width: 0;
    height: 2px;
    bottom: -5px;
    left: 0;
    background-color: var(--neon-blue);
    transition: var(--transition);
}

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

.resume-btn {
    padding: 8px 20px;
    font-size: 0.9rem;
    font-weight: 700;
    letter-spacing: 1px;
}

/* Hamburger Menu Button - hidden on desktop */
.hamburger {
    display: none;
    flex-direction: column;
    justify-content: space-between;
    width: 28px;
    height: 20px;
    background: none;
    border: none;
    cursor: pointer;
    z-index: 200;
    padding: 0;
}

.hamburger span {
    display: block;
    height: 2px;
    width: 100%;
    background: var(--neon-blue);
    border-radius: 2px;
    transition: var(--transition);
}

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

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

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

/* Overlay for mobile menu */
.nav-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 90;
}

.nav-overlay.active {
    display: block;
}

/* ==========================================================================
   Layout Sections
   ========================================================================== */
.section {
    padding: var(--section-pad);
    max-width: 1200px;
    margin: 0 auto;
    min-height: 80vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.section-title {
    font-size: 2.5rem;
    margin-bottom: 50px;
    display: flex;
    align-items: center;
    gap: 15px;
}

.section-title::after {
    content: '';
    display: block;
    height: 1px;
    width: 300px;
    background: linear-gradient(90deg, var(--border-color), transparent);
}

/* ==========================================================================
   Hero Section
   ========================================================================== */
.hero-section {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 100px 20px 20px;
    position: relative;
}

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

.greeting {
    font-family: var(--font-mono);
    color: var(--neon-purple);
    margin-bottom: 20px;
}

.glitch {
    font-size: 5rem;
    font-weight: 700;
    text-transform: uppercase;
    position: relative;
    color: var(--text-primary);
    text-shadow: 0 0 20px rgba(56, 189, 248, 0.15);
    margin-bottom: 10px;
}

/* Subtle glitch effect */
.glitch::before, .glitch::after {
    content: attr(data-text);
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0.8;
}

.glitch::before {
    left: 2px;
    text-shadow: -2px 0 var(--neon-purple);
    clip: rect(44px, 450px, 56px, 0);
    animation: glitch-anim 5s infinite linear alternate-reverse;
}

.glitch::after {
    left: -2px;
    text-shadow: -2px 0 var(--neon-blue);
    clip: rect(44px, 450px, 56px, 0);
    animation: glitch-anim2 5s infinite linear alternate-reverse;
}

@keyframes glitch-anim {
    0% { clip: rect(72px, 9999px, 83px, 0); }
    20% { clip: rect(12px, 9999px, 98px, 0); }
    40% { clip: rect(38px, 9999px, 15px, 0); }
    60% { clip: rect(98px, 9999px, 54px, 0); }
    80% { clip: rect(2px, 9999px, 87px, 0); }
    100% { clip: rect(45px, 9999px, 12px, 0); }
}

@keyframes glitch-anim2 {
    0% { clip: rect(12px, 9999px, 83px, 0); }
    20% { clip: rect(85px, 9999px, 25px, 0); }
    40% { clip: rect(45px, 9999px, 5px, 0); }
    60% { clip: rect(12px, 9999px, 78px, 0); }
    80% { clip: rect(78px, 9999px, 23px, 0); }
    100% { clip: rect(34px, 9999px, 45px, 0); }
}

.subtitle {
    font-size: 1.5rem;
    color: var(--text-secondary);
    margin-bottom: 40px;
    font-weight: 400;
}

/* Terminal */
.terminal {
    max-width: 600px;
    margin-bottom: 40px;
    font-family: var(--font-mono);
    font-size: 0.9rem;
    overflow: hidden;
}

.terminal-header {
    background: rgba(15, 23, 42, 0.7);
    padding: 10px 15px;
    display: flex;
    align-items: center;
    border-bottom: 1px solid var(--border-color);
}

.btn-close, .btn-min, .btn-max {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    margin-right: 8px;
}

.btn-close { background-color: #ff5f56; }
.btn-min { background-color: #ffbd2e; }
.btn-max { background-color: #27c93f; }

.terminal-title {
    margin-left: 15px;
    color: var(--text-secondary);
}

.terminal-body {
    padding: 20px;
    color: var(--text-primary);
}

.prompt {
    color: #059669;
    margin-right: 10px;
}

.typing-text {
    border-right: 2px solid var(--neon-blue);
    animation: blink 1s step-end infinite;
    white-space: nowrap;
    overflow: hidden;
}

.cursor {
    animation: blink 1s step-end infinite;
}

@keyframes blink {
    50% { opacity: 0; }
}

.terminal-output {
    color: var(--text-secondary);
    margin-top: 5px;
    opacity: 0;
}

.delay-1 { animation: fadeIn 0.1s forwards 1.5s; }
.delay-2 { animation: fadeIn 0.1s forwards 2.5s; }
.delay-3 { animation: fadeIn 0.1s forwards 3.5s; color: var(--neon-blue); }

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

/* ==========================================================================
   About Section
   ========================================================================== */
.about-grid {
    display: grid;
    grid-template-columns: 3fr 2fr;
    gap: 40px;
}

.about-text {
    padding: 40px;
    font-size: 1.1rem;
}

.about-text p {
    margin-bottom: 20px;
}

.about-text p:last-child {
    margin-bottom: 0;
}

.about-stats {
    padding: 40px;
    display: flex;
    flex-direction: column;
    justify-content: space-around;
    align-items: center;
    text-align: center;
}

.stat-item {
    margin-bottom: 30px;
}

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

.stat-item i {
    font-size: 3rem;
    margin-bottom: 15px;
}

.stat-item h3 {
    font-size: 2.5rem;
    margin-bottom: 5px;
}

/* ==========================================================================
   Skills Section
   ========================================================================== */

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

.skill-category {
    padding: 30px;
    transition: var(--transition);
    position: relative;
    overflow: hidden;
}

/* Futuristic top border shine on card hover */
.skill-category::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 3px;
    background: linear-gradient(90deg, transparent, var(--neon-blue), var(--neon-purple), transparent);
    transition: all 0.6s ease;
}

.skill-category:hover::before {
    left: 100%;
}

.skill-category:hover {
    border-color: var(--neon-purple);
    box-shadow: 0 0 30px rgba(168, 85, 247, 0.2), 0 0 60px rgba(56, 189, 248, 0.1);
    transform: translateY(-8px);
    background: rgba(15, 12, 28, 0.85);
}

.skill-category h3 {
    margin-bottom: 25px;
    font-size: 1.5rem;
    color: var(--neon-blue);
    transition: var(--transition);
}

.skill-category:hover h3 {
    color: #ffffff;
    text-shadow: 0 0 10px var(--neon-blue), 0 0 20px var(--neon-purple);
    transform: translateX(4px);
}

.skill-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
}

.tag {
    font-family: var(--font-mono);
    font-size: 0.9rem;
    padding: 8px 16px;
    background: rgba(56, 189, 248, 0.06);
    border: 1px solid rgba(56, 189, 248, 0.15);
    border-radius: 20px;
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    cursor: default;
}

.skill-category:hover .tag {
    border-color: rgba(168, 85, 247, 0.4);
    box-shadow: 0 0 8px rgba(168, 85, 247, 0.1);
}

.tag:hover {
    background: linear-gradient(135deg, rgba(56, 189, 248, 0.18), rgba(168, 85, 247, 0.22));
    border-color: var(--neon-blue) !important;
    color: #ffffff;
    box-shadow: 0 0 15px rgba(56, 189, 248, 0.4), 0 0 30px rgba(168, 85, 247, 0.2) !important;
    transform: scale(1.08) translateY(-2px);
}

/* ==========================================================================
   Projects Section
   ========================================================================== */
.projects-grid, .cert-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 30px;
    align-items: stretch;
}

.project-item, .cert-item {
    display: flex;
    flex-direction: column;
    gap: 15px;
    height: 100%;
}

.project-item .project-title, .cert-item .cert-title {
    font-size: 1.2rem;
    font-weight: 700;
    margin: 0;
    color: var(--text-primary);
    text-align: left;
    font-family: var(--font-heading);
}

.project-image-wrapper, .cert-image-wrapper {
    position: relative;
    overflow: hidden;
    aspect-ratio: 16 / 9;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(30, 41, 59, 0.02);
    border: 1px solid var(--border-color);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.04);
    transition: var(--transition);
}

.project-image-wrapper img, .cert-image-wrapper img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.project-image-wrapper:hover img, .cert-image-wrapper:hover img {
    transform: scale(1.06);
}

.project-overlay, .cert-overlay {
    position: absolute;
    bottom: -100%;
    left: 0;
    width: 100%;
    height: 100%;
    padding: 15px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    align-items: flex-start;
    background: rgba(9, 9, 11, 0.92);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    transition: bottom 0.4s cubic-bezier(0.77, 0, 0.175, 1);
    z-index: 2;
}

.project-image-wrapper:hover .project-overlay,
.cert-image-wrapper:hover .cert-overlay {
    bottom: 0;
}

.project-desc {
    color: var(--text-secondary);
    font-size: 0.8rem;
    line-height: 1.4;
    margin-bottom: 8px;
}

.project-overlay .project-tech {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 10px;
}

.project-overlay .project-tech span {
    padding: 3px 8px;
    border-radius: 10px;
    background: rgba(37, 99, 235, 0.08);
    border: 1px solid rgba(37, 99, 235, 0.12);
    font-size: 0.68rem;
    font-weight: 600;
    color: var(--neon-purple);
}

.project-overlay-links, .cert-overlay a {
    display: flex;
    gap: 10px;
    width: 100%;
    margin-top: auto;
}

.project-overlay-links .neon-btn, .cert-overlay .neon-btn {
    padding: 6px 12px;
    font-size: 0.7rem;
    letter-spacing: 1px;
    flex: 1;
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    min-height: 32px;
}

.cert-overlay-title {
    font-size: 1rem;
    color: var(--text-primary);
    margin-bottom: 5px;
    font-weight: 700;
}

.cert-overlay-issuer {
    color: var(--neon-purple);
    font-family: var(--font-mono);
    font-size: 0.82rem;
    margin-bottom: 15px;
}

.project-placeholder, .cert-placeholder {
    width: 100%;
    height: 100%;
    position: relative;
    overflow: hidden;
}

.project-placeholder::after, .cert-placeholder::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(120deg, transparent 30%, rgba(255,255,255,0.3) 50%, transparent 70%);
    background-size: 200% 100%;
    animation: shimmer 2.5s infinite;
}

@keyframes shimmer {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

.placeholder-icon {
    font-size: 3rem;
    transition: var(--transition);
}

.project-image-wrapper:hover .placeholder-icon,
.cert-image-wrapper:hover .placeholder-icon {
    transform: scale(1.1) translateY(-5px);
}

.cert-issuer-tag {
    font-size: 0.78rem;
    font-family: var(--font-mono);
    color: var(--text-secondary);
    background: rgba(255, 255, 255, 0.05);
    padding: 4px 10px;
    border-radius: 12px;
    border: 1px solid var(--border-color);
}

.gradient-1 { background: linear-gradient(135deg, rgba(56, 189, 248, 0.15), rgba(192, 132, 252, 0.15)); }
.gradient-2 { background: linear-gradient(135deg, rgba(192, 132, 252, 0.15), rgba(56, 189, 248, 0.15)); }
.gradient-3 { background: linear-gradient(135deg, rgba(56, 189, 248, 0.1), rgba(192, 132, 252, 0.25)); }

.cert-gradient-1 { background: linear-gradient(135deg, rgba(56, 189, 248, 0.15), rgba(192, 132, 252, 0.08)); }
.cert-gradient-2 { background: linear-gradient(135deg, rgba(192, 132, 252, 0.15), rgba(56, 189, 248, 0.08)); }
.cert-gradient-3 { background: linear-gradient(135deg, rgba(56, 189, 248, 0.1), rgba(56, 189, 248, 0.2)); }
.cert-gradient-4 { background: linear-gradient(135deg, rgba(192, 132, 252, 0.1), rgba(192, 132, 252, 0.2)); }
.cert-gradient-5 { background: linear-gradient(135deg, rgba(56, 189, 248, 0.12), rgba(192, 132, 252, 0.12)); }
.cert-gradient-6 { background: linear-gradient(135deg, rgba(192, 132, 252, 0.12), rgba(56, 189, 248, 0.12)); }

/* ==========================================================================
   Contact Section
   ========================================================================== */
.contact-section {
    text-align: center;
    align-items: center;
}

.contact-section .section-title {
    margin-bottom: 40px;
}

.contact-section .section-title::after {
    display: none;
}

.contact-card {
    max-width: 600px;
    padding: 50px;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.contact-card p {
    margin-bottom: 40px;
    font-size: 1.1rem;
    color: var(--text-secondary);
}

.social-links {
    margin-top: 40px;
    display: flex;
    gap: 20px;
}

.social-links a i {
    font-size: 1.5rem;
    color: var(--text-secondary);
    transition: var(--transition);
}

.social-links a:hover i {
    color: var(--neon-blue);
    transform: translateY(-3px);
}

/* ==========================================================================
   Footer
   ========================================================================== */
footer {
    text-align: center;
    padding: 30px;
    font-family: var(--font-mono);
    font-size: 0.9rem;
    color: var(--text-secondary);
    border-top: 1px solid var(--border-color);
}

.version {
    margin-top: 5px;
    font-size: 0.8rem;
    opacity: 0.5;
}

/* ==========================================================================
   Responsive - Tablet
   ========================================================================== */
@media (max-width: 1024px) {
    .nav-links {
        gap: 18px;
    }
    .nav-links li a {
        font-size: 0.8rem;
    }
    .glitch {
        font-size: 3.5rem;
    }
    .section-title {
        font-size: 2rem;
    }
}

/* ==========================================================================
   Responsive - Mobile
   ========================================================================== */
@media (max-width: 768px) {
    .navbar {
        padding: 15px 20px;
    }

    .hamburger {
        display: flex;
    }

    .nav-right {
        position: fixed;
        top: 0;
        right: -100%;
        width: 70%;
        max-width: 300px;
        height: 100vh;
        background: rgba(10, 10, 12, 0.95);
        backdrop-filter: blur(20px);
        -webkit-backdrop-filter: blur(20px);
        flex-direction: column;
        justify-content: center;
        align-items: center;
        gap: 30px;
        padding: 80px 30px;
        transition: right 0.4s cubic-bezier(0.77, 0, 0.175, 1);
        border-left: 1px solid var(--border-color);
        z-index: 150;
    }

    .nav-right.open {
        right: 0;
    }

    .nav-links {
        flex-direction: column;
        align-items: center;
        gap: 25px;
    }

    .nav-links li a {
        font-size: 1.1rem;
    }

    .nav-links li a::after {
        bottom: -8px;
    }

    .resume-btn {
        padding: 12px 30px;
        font-size: 0.9rem;
    }

    .glitch {
        font-size: 2.2rem;
    }

    .subtitle {
        font-size: 1.1rem;
    }

    .about-grid {
        grid-template-columns: 1fr;
    }

    .about-text, .about-stats {
        padding: 25px;
    }

    .section {
        padding: 60px 15px;
        min-height: auto;
    }

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

    .section-title::after {
        width: 60px;
    }

    .skills-container {
        grid-template-columns: 1fr;
    }

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

    .cert-grid {
        grid-template-columns: 1fr;
    }

    .cert-card {
        padding: 20px;
        gap: 15px;
    }

    .cert-icon i {
        font-size: 2rem;
    }

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

    .terminal {
        font-size: 0.75rem;
    }

    .hero-section {
        padding: 80px 15px 40px;
    }

    .stat-item h3 {
        font-size: 2rem;
    }
}