:root {
    --bg-dark: #050a14;
    --bg-panel: #2f2f2f;
    --neon-blue: #00f3ff; /* Matching the logo 'sec' and '24' */
    --neon-purple: #bc13fe; /* Matching the shield glow */
    --neon-red: #ff0055; /* Matching the gear glow */
    --text-main: #ffffff;
    --font-head: 'Orbitron', sans-serif;
    --font-body: 'Roboto Mono', monospace;
}

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

body {
    background-color: var(--bg-dark);
    color: var(--text-main);
    font-family: var(--font-body);
    overflow-x: hidden;
}

/* --- Circuit Background Effect --- */
.circuit-bg {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: 
        linear-gradient(rgba(5, 10, 20, 0.95), rgba(5, 10, 20, 0.95)),
        linear-gradient(90deg, rgba(0, 243, 255, 0.03) 1px, transparent 1px),
        linear-gradient(rgba(0, 243, 255, 0.03) 1px, transparent 1px);
    background-size: 100% 100%, 50px 50px, 50px 50px;
    z-index: -1;
}

/* --- Navbar --- */
.navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 50px;
    background: rgba(5, 10, 20, 0.8);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(0, 243, 255, 0.1);
    position: fixed;
    width: 100%;
    top: 0;
    z-index: 100;
}

/* Nav toggle (mobile) */
.nav-toggle {
    display: none;
    background: transparent;
    border: none;
    color: var(--text-main);
    font-size: 1.35rem;
    padding: 8px;
    cursor: pointer;
}

/* Mobile menu layout */
@media (max-width: 900px) {
    .nav-toggle { display: block; z-index: 220; }

    /* Full-screen overlay menu when opened to avoid overlapping content */
    .nav-links {
        display: none;
        position: fixed;
        inset: 0; /* top:0; right:0; bottom:0; left:0 */
        flex-direction: column;
        background: rgba(5,10,20,0.98);
        padding: 44px 20px 20px 20px; /* slightly reduced top padding so links fit on small screens */
        gap: 20px;
        border-radius: 0;
        align-items: center;
        justify-content: center; /* center links vertically for better visibility */
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
        overscroll-behavior: contain;
        max-height: 100vh;
        z-index: 200;
    }
    .navbar.open .nav-links { display: flex; }
    .nav-links a { padding: 14px 20px; display: block; font-size: 1.06rem; }

    /* Make the nav overlay scrollbar easier to see on some devices */
    .nav-links::-webkit-scrollbar { width: 8px; }
    .nav-links::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.08); border-radius: 6px; }
    .nav-links::-webkit-scrollbar-track { background: transparent; }

    /* Slightly smaller top padding for very small screens */
    @media (max-width: 420px) {
        .nav-links { padding-top: 20px; padding-bottom: 16px; gap: 12px; justify-content: flex-start; align-items: flex-start; }
        .nav-links a { font-size: 0.92rem; padding: 10px 14px; line-height: 1.1; }
        /* Shrink mobile logo slightly to free vertical space */
        .nav-logo { width: 64px; height: auto; }
    }

    /* Extra-tight spacing for very small screens */
    @media (max-width: 360px) {
        .nav-links { padding-top: 12px; gap: 10px; }
        .nav-links a { font-size: 0.88rem; padding: 8px 12px; }
        .nav-logo { width: 56px; height: auto; }
    }
}

@media (max-width: 600px) {
    .nav-logo { width: 72px; }
}

/* Ensure nav toggle is always on top of hero */
.nav-toggle { position: relative; z-index: 230; }

/* Body state when menu is open (freeze background) */
body.menu-open {
    width: 100%;
    height: 100vh;
    overflow: hidden;
    -webkit-overflow-scrolling: touch;
}



/* --- Square Logo Configuration (500x500) --- */

/* --- Rectangular Logo Sizing --- */

.logo-container {
    display: block;
    /* This controls the size. 
       200px is a standard size for a wide logo. 
       You can change this number to make it bigger or smaller. */
    width: 300px; 
}

.nav-logo {
    width: 100%;       /* Forces image to match the container width above */
    height: auto;      /* Calculates height automatically to keep ratio */
    display: block;    /* Removes tiny gaps below image */
    filter: drop-shadow(0 0 5px rgba(0, 243, 255, 0.5)); /* Neon glow */
}

.logo-text {
    font-family: 'Orbitron', sans-serif;
    font-size: 1.5rem;
    font-weight: 700;
    color: white;
    letter-spacing: 2px;
    text-transform: uppercase;
}

.logo-container:hover .nav-logo {
    transform: rotate(15deg) scale(1.1); /* Adds a cool rotation effect on hover */
    filter: drop-shadow(0 0 15px rgba(188, 19, 254, 0.8)); /* Glow changes to purple */
}

/* Mobile Adjustment */
@media (max-width: 768px) {
    .nav-logo {
        height: 100px;
        width: 100px;
    }
    .logo-text {
        font-size: 1.2rem;
    }
}
.nav-links {
    list-style: none;
    display: flex;
    gap: 30px;
}

.nav-links a {
    text-decoration: none;
    color: var(--text-main);
    font-size: 0.9rem;
    transition: 0.3s;
}

.nav-links a:hover {
    color: var(--neon-blue);
    text-shadow: 0 0 8px var(--neon-blue);
}

/* --- Hero Section --- */
.hero {
    height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    text-align: center;
    padding-top: 60px;
}

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

/* Shield Icon / Hero Logo Styling */
.shield-icon {
    margin-bottom: 20px;
    position: relative;
    display: inline-block;
}

.hero-logo {
    width: 140px; /* default for desktop */
    max-width: 180px;
    height: auto;
    display: block;
    border-radius: 12px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.4), 0 0 18px rgba(188,19,254,0.08);
    filter: drop-shadow(0 0 12px rgba(188,19,254,0.25));
    transition: transform 220ms ease, box-shadow 220ms ease;
}
.hero-logo:hover,
.shield-icon:focus-within .hero-logo,
.hero-logo:focus-visible {
    transform: translateY(-6px) scale(1.05);
    box-shadow: 0 18px 40px rgba(0,0,0,0.45), 0 0 30px rgba(188,19,254,0.14);
}

/* Complete logo specific sizing */
.hero-logo--complete { width: 360px; max-width: 720px; border-radius: 10px; }

/* Responsive logo sizing */
@media (max-width: 900px) {
    .hero-logo { width: 140px; max-width: 180px; }
    .hero-logo--complete { width: 300px; max-width: 380px; }
}
@media (max-width: 600px) {
    .hero-logo { width: 110px; max-width: 140px; }
    .hero-logo--complete { width: 220px; max-width: 260px; }
    .hero-content { padding-top: 10px; }
}

.lock-overlay {
    display: none; /* no longer needed when using the logo image */
}

/* Glitch Text Effect */
.glitch {
    font-family: var(--font-head);
    font-size: 3.5rem;
    position: relative;
    color: white;
}

.glitch::before, .glitch::after {
    content: attr(data-text);
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--bg-dark);
}

.glitch::before {
    left: 2px;
    text-shadow: -1px 0 var(--neon-red);
    clip: rect(24px, 550px, 90px, 0);
    animation: glitch-anim-2 3s infinite linear alternate-reverse;
}

.glitch::after {
    left: -2px;
    text-shadow: -1px 0 var(--neon-blue);
    clip: rect(85px, 550px, 140px, 0);
    animation: glitch-anim 2.5s infinite linear alternate-reverse;
}

@keyframes glitch-anim {
    0% { clip: rect(10px, 9999px, 30px, 0); }
    20% { clip: rect(60px, 9999px, 100px, 0); }
    40% { clip: rect(10px, 9999px, 80px, 0); }
    60% { clip: rect(90px, 9999px, 20px, 0); }
    80% { clip: rect(30px, 9999px, 10px, 0); }
    100% { clip: rect(70px, 9999px, 50px, 0); }
}

#typewriter {
    color: var(--neon-blue);
    font-size: 1.2rem;
    margin: 20px 0;
    min-height: 1.5em;
    font-weight: 700;
}

.cta-buttons {
    margin-top: 30px;
}

/* Buttons */
.btn-neon {
    padding: 12px 30px;
    background: transparent;
    border: 2px solid var(--neon-blue);
    color: var(--neon-blue);
    text-decoration: none;
    font-family: var(--font-head);
    font-weight: bold;
    margin-right: 15px;
    transition: 0.3s;
    box-shadow: 0 0 10px rgba(0, 243, 255, 0.2);
}

.btn-neon:hover {
    background: var(--neon-blue);
    color: var(--bg-dark);
    box-shadow: 0 0 20px var(--neon-blue);
}

.btn-ghost {
    padding: 12px 30px;
    color: white;
    text-decoration: none;
    border: 1px solid rgba(255,255,255,0.3);
    transition: 0.3s;
}

.btn-ghost:hover {
    border-color: white;
    background: rgba(255,255,255,0.05);
}

/* --- Services / Cards --- */
.services {
    padding: 80px 50px;
    background: var(--bg-panel);
}

.section-title {
    font-family: var(--font-head);
    text-align: center;
    margin-bottom: 50px;
    font-size: 2rem;
    color: var(--neon-blue);
}

.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
    max-width: 1200px;
    margin: 0 auto;
    align-items: stretch;
}

.card {
    background: rgba(255, 255, 255, 0.03);
    padding: 40px;
    border: 1px solid rgba(0, 243, 255, 0.1);
    transition: 0.3s;
    text-align: center;
    border-radius: 10px;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
}

.card:hover {
    transform: translateY(-5px);
    border-color: var(--neon-blue);
    box-shadow: 0 0 20px rgba(0, 243, 255, 0.1);
}

.card i {
    font-size: 2.5rem;
    color: var(--neon-purple);
    margin-bottom: 20px;
    display: block;
}

.card h3 {
    font-family: var(--font-head);
    margin-bottom: 15px;
}

.card p {
    color: #8892b0;
    font-size: 0.95rem;
    line-height: 1.6;
    margin-top: auto; /* Keep description near the bottom for consistent card height */
}

/* Responsive tweaks for medium screens */
@media (max-width: 900px) {
    .card {
        padding: 30px;
    }
    .card i {
        font-size: 2.2rem;
    }
    .card-grid {
        gap: 24px;
    }
}

/* Mobile adjustments */
@media (max-width: 600px) {
    .services {
        padding: 50px 20px;
    }
    .section-title {
        font-size: 1.5rem;
        margin-bottom: 30px;
    }
    .card-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    .card {
        padding: 20px;
    }
    .card i {
        font-size: 1.8rem;
        margin-bottom: 15px;
    }
    .card h3 {
        font-size: 1.05rem;
        margin-bottom: 10px;
    }
    .card p {
        font-size: 0.88rem;
        line-height: 1.5;
    }
}

/* --- About Section --- */
.about {
    padding: 80px 50px;
    background: transparent;
}
.about .about-content {
    max-width: 1000px;
    margin: 0 auto;
    text-align: center;
    color: #cbd6e6;
    font-size: 1rem;
    line-height: 1.7;
}
.about .about-list {
    margin-top: 20px;
    display: flex;
    gap: 20px;
    justify-content: center;
    flex-wrap: wrap;
    color: #8892b0;
    font-size: 0.95rem;
}
.about .about-list li {
    list-style: none;
    min-width: 220px;
}

/* --- Experience Section --- */
.experience {
    padding: 80px 50px;
    background: rgba(255,255,255,0.02);
}
.experience .experience-content {
    max-width: 1000px;
    margin: 0 auto;
}
.timeline {
    display: grid;
    gap: 20px;
    max-width: 900px;
    margin: 0 auto;
}
.timeline-item {
    background: rgba(255,255,255,0.03);
    padding: 20px;
    border: 1px solid rgba(0,243,255,0.06);
    border-radius: 8px;
}
.timeline-item h3 {
    font-family: var(--font-head);
    margin-bottom: 6px;
}
.timeline-date {
    color: #8892b0;
    font-size: 0.9rem;
    display: block;
    margin-bottom: 10px;
    font-weight: 600;
}

/* --- Certifications Section --- */
.certifications {
    padding: 80px 50px;
    background: transparent;
}
.cert-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 20px;
    max-width: 1000px;
    margin: 0 auto;
    justify-content: center;
    align-items: start;
}
.cert-card {
    width: 100%;
    max-width: 320px; /* prevents overly wide cards when there are few cards */
}

.cert-card {
    background: rgba(255,255,255,0.03);
    padding: 20px;
    border: 1px solid rgba(188,19,254,0.06);
    border-radius: 8px;
    text-align: center;
}
.cert-card h3 {
    font-family: var(--font-head);
    margin-bottom: 8px;
}
.cert-card p {
    color: #8892b0;
    font-size: 0.95rem;
}

/* Badge images and fallbacks */
.cert-badge {
    display: block;
    margin: 0 auto 12px;
    max-width: 140px;
    width: 100%;
    height: auto;
    transition: transform 220ms ease, filter 220ms ease, box-shadow 220ms ease;
}
.cert-fallback {
    display: none;
    font-size: 2rem;
    color: var(--neon-purple);
    text-align: center;
    margin-bottom: 12px;
}

/* Card hover / focus interactions */
.cert-card {
    transition: transform 240ms ease, box-shadow 240ms ease, border-color 240ms ease;
    will-change: transform, box-shadow;
}
.cert-card:hover,
.cert-card:focus-within,
.cert-card:focus-visible {
    transform: translateY(-6px) scale(1.03);
    box-shadow: 0 12px 30px rgba(0, 243, 255, 0.06), 0 6px 12px rgba(0,0,0,0.35);
    border-color: rgba(0,243,255,0.12);
}

.cert-card:hover .cert-badge,
.cert-card:focus-within .cert-badge {
    transform: translateY(-4px) rotate(-2deg) scale(1.02);
    filter: drop-shadow(0 6px 18px rgba(0,243,255,0.06));
}

/* Subtle hover glow on the badge text for keyboard users */
.cert-card:focus-visible {
    outline: 3px solid rgba(0,243,255,0.08);
    outline-offset: 6px;
}

/* If image fails to load, JS will show the fallback icon */


/* --- Contact Section --- */
.contact {
    padding: 80px 50px;
    background: rgba(255,255,255,0.01);
}
.contact .contact-content {
    max-width: 800px;
    margin: 0 auto;
    text-align: center;
    color: #cbd6e6;
    font-size: 1rem;
    line-height: 1.7;
}
.contact-actions {
    margin-top: 20px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    align-items: center;
}
.contact-note {
    color: #8892b0;
    font-size: 0.9rem;
    margin-top: 8px;
}

/* Button outline used in navbar */
.btn-outline {
    padding: 8px 16px;
    border: 1px solid rgba(255,255,255,0.12);
    border-radius: 6px;
    color: white;
    text-decoration: none;
}

/* Focus styles for keyboard accessibility */
.btn-outline:focus-visible,
.btn-neon:focus-visible,
.btn-ghost:focus-visible,
.card:focus-visible,
.contact-form input:focus-visible,
.contact-form textarea:focus-visible {
    outline: 3px solid rgba(0,243,255,0.12);
    outline-offset: 3px;
}

/* Mobile adjustments for contact form */
@media (max-width: 600px) {
    .contact {
        padding: 50px 20px;
    }
    .contact-form input,
    .contact-form textarea {
        font-size: 0.95rem;
    }
}

/* --- Experience Section --- */
.experience {
    padding: 60px 50px;
    background: transparent;
}
.experience-list {
    max-width: 1000px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}
.exp-item {
    background: rgba(255,255,255,0.02);
    padding: 20px;
    border-radius: 8px;
    border: 1px solid rgba(0,243,255,0.04);
}
.exp-item h3 {
    margin-bottom: 6px;
    font-family: var(--font-head);
}
.exp-date {
    color: #8892b0;
    font-size: 0.9rem;
    margin-bottom: 8px;
}

/* --- Certifications --- */
.certifications {
    padding: 40px 50px;
    background: rgba(255,255,255,0.01);
}
.cert-list {
    max-width: 800px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 8px;
    color: #cbd6e6;
}
.cert-list li {
    list-style: none;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .experience-list {
        grid-template-columns: 1fr;
    }
}

footer {
    text-align: center;
    padding: 30px;
    color: #8892b0;
    font-size: 0.8rem;
    border-top: 1px solid rgba(255,255,255,0.05);
}