* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Courier New', monospace;
    background: #0a0e27;
    color: #e0e0e0;
    overflow-x: hidden;
}

/* Animated background */
.bg-animation {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    background: linear-gradient(45deg, #0a0e27 0%, #1a1f3a 50%, #0a0e27 100%);
}

.bg-animation::before {
    content: '';
    position: absolute;
    width: 200%;
    height: 200%;
    background-image: 
        linear-gradient(90deg, rgba(0, 255, 157, 0.03) 1px, transparent 1px),
        linear-gradient(rgba(0, 255, 157, 0.03) 1px, transparent 1px);
    background-size: 50px 50px;
    animation: gridMove 20s linear infinite;
}

@keyframes gridMove {
    0% { transform: translate(0, 0); }
    100% { transform: translate(50px, 50px); }
}

/* Navigation */
nav {
    position: fixed;
    top: 0;
    width: 100%;
    background: rgba(10, 14, 39, 0.95);
    backdrop-filter: blur(10px);
    padding: 1rem 5%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    z-index: 1000;
    border-bottom: 1px solid rgba(0, 255, 157, 0.2);
}

.logo {
    font-size: 1.5rem;
    font-weight: bold;
    color: #00ff9d;
    text-shadow: 0 0 10px rgba(0, 255, 157, 0.5);
}

.nav-links {
    display: flex;
    gap: 2rem;
    list-style: none;
}

.nav-links a {
    color: #e0e0e0;
    text-decoration: none;
    transition: all 0.3s;
    position: relative;
}

.nav-links a:hover {
    color: #00ff9d;
}

.nav-links a::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 0;
    width: 0;
    height: 2px;
    background: #00ff9d;
    transition: width 0.3s;
}

.nav-links a:hover::after {
    width: 100%;
}

/* Hero Section */
.hero {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 5%;
    text-align: center;
    gap: 4rem;
}

.hero-image-container {
    position: relative;
    width: 350px;
    height: 350px;
    flex-shrink: 0;
}

.profile-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 10px;
    border: 3px solid #00ff9d;
    box-shadow: 0 0 30px rgba(0, 255, 157, 0.3);
    animation: glitchImage 5s infinite;
    position: relative;
    top: 65px;
}

@keyframes glitchImage {
    0%, 90%, 100% {
        filter: none;
        transform: translate(0);
    }
    91% {
        filter: hue-rotate(90deg) saturate(3);
        transform: translate(-3px, 3px);
    }
    92% {
        filter: hue-rotate(180deg) saturate(2);
        transform: translate(3px, -3px);
    }
    93% {
        filter: hue-rotate(270deg) saturate(4);
        transform: translate(-3px, -3px);
    }
    94% {
        filter: none;
        transform: translate(0);
    }
}

.scan-line {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 2px;
    background: linear-gradient(90deg, transparent, #00ff9d, transparent);
    animation: scan 3s linear infinite;
    opacity: 0.7;
}

@keyframes scan {
    0% { top: 0; }
    100% { top: 100%; }
}

.hero-wrapper {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4rem;
    flex-wrap: wrap;
    max-width: 1400px;
    margin: 0 auto;
}

.hero-content h1 {
    margin-top: 1rem;
    font-size: 4rem;
    color: #00ff9d;
    margin-bottom: 1rem;
    text-shadow: 0 0 20px rgba(0, 255, 157, 0.5);
    animation: glitch 3s infinite;
}

@keyframes glitch {
    0%, 90%, 100% { transform: translate(0); }
    92% { transform: translate(-2px, 2px); }
    94% { transform: translate(2px, -2px); }
    96% { transform: translate(-2px, -2px); }
}

.hero-content h2 {
    font-size: 2rem;
    color: #64ffda;
    margin-bottom: 1rem;
}

.hero-content p {
    font-size: 1.2rem;
    color: #b8b8d1;
    max-width: 600px;
    margin: 0 auto 2rem;
    line-height: 1.6;
}

.cta-button {
    display: inline-block;
    padding: 1rem 2rem;
    background: transparent;
    color: #00ff9d;
    border: 2px solid #00ff9d;
    text-decoration: none;
    font-size: 1.1rem;
    transition: all 0.3s;
    position: relative;
    overflow: hidden;
}

.cta-button::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: #00ff9d;
    transition: left 0.3s;
    z-index: -1;
}

.cta-button:hover::before {
    left: 0;
}

.cta-button:hover {
    color: #0a0e27;
}

/* Section Styles */
section {
    padding: 6rem 5%;
    max-width: 1200px;
    margin: 0 auto;
}

h2 {
    font-size: 2.5rem;
    color: #00ff9d;
    margin-bottom: 3rem;
    text-align: center;
    position: relative;
}

h2::after {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 50%;
    transform: translateX(-50%);
    width: 100px;
    height: 3px;
    background: linear-gradient(90deg, transparent, #00ff9d, transparent);
}

/* Projects Grid */
.projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
}

.project-card {
    background: rgba(26, 31, 58, 0.6);
    border: 1px solid rgba(0, 255, 157, 0.2);
    padding: 2rem;
    border-radius: 10px;
    transition: all 0.3s;
    cursor: pointer;
}

.project-card:hover {
    transform: translateY(-10px);
    border-color: #00ff9d;
    box-shadow: 0 10px 30px rgba(0, 255, 157, 0.2);
}

.project-card h3 {
    color: #64ffda;
    margin-bottom: 1rem;
    font-size: 1.5rem;
}

.project-card p {
    color: #b8b8d1;
    line-height: 1.6;
    margin-bottom: 1rem;
}

.project-tags {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.tag {
    padding: 0.3rem 0.8rem;
    background: rgba(0, 255, 157, 0.1);
    color: #00ff9d;
    border: 1px solid rgba(0, 255, 157, 0.3);
    border-radius: 20px;
    font-size: 0.85rem;
}

/* CTF Achievements */
.ctf-list {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.ctf-item {
    background: rgba(26, 31, 58, 0.6);
    border-left: 4px solid #00ff9d;
    padding: 2rem;
    border-radius: 5px;
    transition: all 0.3s;
}

.ctf-item:hover {
    background: rgba(26, 31, 58, 0.9);
    transform: translateX(10px);
}

.ctf-item h3 {
    color: #64ffda;
    margin-bottom: 0.5rem;
}

.ctf-item .rank {
    color: #00ff9d;
    font-size: 1.2rem;
    font-weight: bold;
}

/* Certifications */
.cert-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
}

.cert-card {
    background: rgba(26, 31, 58, 0.6);
    border: 1px solid rgba(100, 255, 218, 0.3);
    padding: 2rem;
    border-radius: 10px;
    text-align: center;
    transition: all 0.3s;
}

.cert-card:hover {
    border-color: #64ffda;
    transform: scale(1.05);
}

.cert-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
}

.cert-card h3 {
    color: #64ffda;
    margin-bottom: 0.5rem;
}

/* Contact Section */
.contact-content {
    text-align: center;
    max-width: 600px;
    margin: 0 auto;
}

.contact-links {
    display: flex;
    justify-content: center;
    gap: 2rem;
    margin-top: 2rem;
    flex-wrap: wrap;
}

.contact-link {
    color: #00ff9d;
    text-decoration: none;
    font-size: 1.2rem;
    padding: 1rem 2rem;
    border: 2px solid #00ff9d;
    border-radius: 5px;
    transition: all 0.3s;
}

.contact-link:hover {
    background: #00ff9d;
    color: #0a0e27;
}
/* back to top */
.back-to-top {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 50px;
    height: 50px;
    background: rgba(0, 255, 157, 0.9);
    color: #0a0e27;
    border: 2px solid #00ff9d;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 1.5rem;
    font-weight: bold;
    transition: all 0.3s;
    z-index: 999;
    opacity: 0;
    visibility: hidden;
    box-shadow: 0 4px 15px rgba(0, 255, 157, 0.3);
}

.back-to-top.show {
    opacity: 1;
    visibility: visible;
}

.back-to-top:hover {
    background: #00ff9d;
    transform: translateY(-5px);
    box-shadow: 0 6px 20px rgba(0, 255, 157, 0.5);
}

.back-to-top:active {
    transform: translateY(-2px);
}

/* Footer */
footer {
    text-align: center;
    padding: 2rem;
    background: rgba(10, 14, 39, 0.95);
    color: #b8b8d1;
    border-top: 1px solid rgba(0, 255, 157, 0.2);
}

/* Writeups Section - CHANGED TO VERTICAL LAYOUT */
.writeups-grid {
    display: flex;
    flex-direction: column;
    gap: 2rem;
    max-width: 900px;
    margin: 0 auto;
}

.writeup-card {
    background: rgba(26, 31, 58, 0.6);
    border: 1px solid rgba(0, 255, 157, 0.2);
    border-radius: 10px;
    padding: 2rem;
    transition: all 0.3s;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.writeup-card:hover {
    transform: translateY(-10px);
    border-color: #00ff9d;
    box-shadow: 0 10px 30px rgba(0, 255, 157, 0.2);
}

.writeup-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1rem;
}

.writeup-header h3 {
    color: #64ffda;
    font-size: 1.5rem;
    margin: 0;
    flex: 1;
}

.writeup-category {
    background: rgba(100, 255, 218, 0.1);
    color: #64ffda;
    padding: 0.3rem 0.8rem;
    border-radius: 5px;
    font-size: 0.85rem;
    border: 1px solid rgba(100, 255, 218, 0.3);
    white-space: nowrap;
}

.writeup-description {
    color: #b8b8d1;
    line-height: 1.6;
    flex: 1;
}

.writeup-tags {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.writeup-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: auto;
    padding-top: 1rem;
    border-top: 1px solid rgba(0, 255, 157, 0.1);
}

.writeup-difficulty {
    padding: 0.4rem 1rem;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: bold;
}

.writeup-difficulty.easy {
    background: rgba(76, 175, 80, 0.2);
    color: #4caf50;
    border: 1px solid rgba(76, 175, 80, 0.4);
}

.writeup-difficulty.medium {
    background: rgba(255, 152, 0, 0.2);
    color: #ff9800;
    border: 1px solid rgba(255, 152, 0, 0.4);
}

.writeup-difficulty.hard {
    background: rgba(244, 67, 54, 0.2);
    color: #f44336;
    border: 1px solid rgba(244, 67, 54, 0.4);
}

.writeup-difficulty.coming-soon {
    background: rgba(100, 255, 218, 0.1);
    color: #64ffda;
    border: 1px solid rgba(100, 255, 218, 0.3);
}

.writeup-link {
    color: #00ff9d;
    text-decoration: none;
    font-weight: bold;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    gap: 0.3rem;
}

.writeup-link:hover {
    color: #64ffda;
    transform: translateX(5px);
}

/* ============================================
   RESPONSIVE MEDIA QUERIES
   ============================================ */

/* Large Tablets and Small Desktops (1024px and below) */
@media (max-width: 1024px) {
    .hero-content h1 {
        font-size: 3.5rem;
    }

    .hero-content h2 {
        font-size: 1.8rem;
    }

    .hero-wrapper {
        gap: 3rem;
    }

    .hero-image-container {
        width: 300px;
        height: 300px;
    }

    section {
        padding: 5rem 5%;
    }

    h2 {
        font-size: 2.2rem;
    }
}

/* Tablets (768px and below) */
@media (max-width: 768px) {
    /* Navigation */
    nav {
        padding: 1rem 3%;
        flex-wrap: wrap;
        gap: 1rem;
    }

    .logo {
        font-size: 1.3rem;
    }

    .nav-links {
        gap: 1rem;
        font-size: 0.9rem;
    }

    /* Hero Section */
    .hero {
        padding: 5rem 3% 3rem;
        gap: 2rem;
    }

    .hero-wrapper {
        flex-direction: column;
        gap: 2rem;
    }

    .hero-image-container {
        width: 250px;
        height: 250px;
    }

    .profile-img {
        top: 40px;
    }

    .hero-content h1 {
        font-size: 2.5rem;
    }

    .hero-content h2 {
        font-size: 1.5rem;
    }

    .hero-content p {
        font-size: 1rem;
        padding: 0 1rem;
    }

    .cta-button {
        padding: 0.8rem 1.5rem;
        font-size: 1rem;
    }

    /* Sections */
    section {
        padding: 4rem 3%;
    }

    h2 {
        font-size: 2rem;
        margin-bottom: 2rem;
    }

    h2::after {
        width: 80px;
    }

    /* Grids */
    .projects-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }

    .cert-grid {
        grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
        gap: 1.5rem;
    }

    /* Cards */
    .project-card,
    .writeup-card,
    .cert-card {
        padding: 1.5rem;
    }

    .project-card h3,
    .writeup-header h3 {
        font-size: 1.3rem;
    }

    /* CTF Items */
    .ctf-item {
        padding: 1.5rem;
    }

    .ctf-item:hover {
        transform: translateX(5px);
    }

    /* Contact Links */
    .contact-links {
        gap: 1rem;
        flex-direction: column;
        align-items: center;
    }

    .contact-link {
        font-size: 1rem;
        padding: 0.8rem 1.5rem;
        width: 100%;
        max-width: 300px;
        text-align: center;
    }

    /* Hover effects - reduce on tablets */
    .project-card:hover,
    .writeup-card:hover {
        transform: translateY(-5px);
    }

    .cert-card:hover {
        transform: scale(1.02);
    }
}

/* Mobile Devices (480px and below) */
@media (max-width: 480px) {
    /* Navigation */
    nav {
        padding: 0.8rem 2%;
    }

    .logo {
        font-size: 1.1rem;
    }

    .nav-links {
        width: 100%;
        justify-content: space-around;
        gap: 0.5rem;
        font-size: 0.8rem;
    }

    .nav-links a {
        padding: 0.3rem;
    }

    /* Hero Section */
    .hero {
        padding: 4rem 2% 2rem;
        min-height: auto;
    }

    .hero-image-container {
        width: 200px;
        height: 200px;
    }

    .profile-img {
        top: 30px;
        border: 2px solid #00ff9d;
    }

    .hero-content h1 {
        font-size: 1.8rem;
        margin-bottom: 0.8rem;
    }

    .hero-content h2 {
        font-size: 1.2rem;
        margin-bottom: 0.8rem;
    }

    .hero-content p {
        font-size: 0.9rem;
        padding: 0;
        margin-bottom: 1.5rem;
    }

    .cta-button {
        padding: 0.7rem 1.2rem;
        font-size: 0.9rem;
    }

    /* Sections */
    section {
        padding: 3rem 2%;
    }

    h2 {
        font-size: 1.6rem;
        margin-bottom: 1.5rem;
    }

    h2::after {
        width: 60px;
        height: 2px;
    }

    /* Grids */
    .projects-grid,
    .cert-grid {
        grid-template-columns: 1fr;
        gap: 1.2rem;
    }

    /* Cards */
    .project-card,
    .writeup-card,
    .cert-card,
    .ctf-item {
        padding: 1.2rem;
    }

    .project-card h3,
    .writeup-header h3,
    .cert-card h3 {
        font-size: 1.1rem;
    }

    .project-card p,
    .writeup-description {
        font-size: 0.9rem;
    }

    /* Writeup Header */
    .writeup-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.8rem;
    }

    .writeup-category {
        align-self: flex-start;
    }

    /* Writeup Footer */
    .writeup-footer {
        flex-direction: column;
        gap: 1rem;
        align-items: flex-start;
    }

    /* Tags */
    .tag,
    .writeup-difficulty,
    .writeup-category {
        font-size: 0.75rem;
        padding: 0.25rem 0.6rem;
    }

    /* CTF Items */
    .ctf-item h3 {
        font-size: 1.1rem;
    }

    .ctf-item .rank {
        font-size: 1rem;
    }

    .ctf-item:hover {
        transform: translateX(0);
        background: rgba(26, 31, 58, 0.8);
    }

    /* Certification Icon */
    .cert-icon {
        font-size: 2.5rem;
    }

    /* Contact Section */
    .contact-content p {
        font-size: 0.9rem;
    }

    .contact-links {
        margin-top: 1.5rem;
    }

    .contact-link {
        font-size: 0.9rem;
        padding: 0.7rem 1.2rem;
    }

    /* Footer */
    footer {
        padding: 1.5rem 2%;
        font-size: 0.9rem;
    }

    /* Disable hover effects on mobile */
    .project-card:hover,
    .writeup-card:hover,
    .cert-card:hover {
        transform: none;
    }

    /* Background grid - make smaller on mobile */
    .bg-animation::before {
        background-size: 30px 30px;
    }
}

/* Extra Small Devices (360px and below) */
@media (max-width: 360px) {
    .logo {
        font-size: 1rem;
    }

    .nav-links {
        font-size: 0.7rem;
    }

    .hero-content h1 {
        font-size: 1.5rem;
    }

    .hero-content h2 {
        font-size: 1rem;
    }

    .hero-content p {
        font-size: 0.85rem;
    }

    .hero-image-container {
        width: 180px;
        height: 180px;
    }

    h2 {
        font-size: 1.4rem;
    }

    section {
        padding: 2.5rem 1.5%;
    }

    .project-card,
    .writeup-card,
    .cert-card,
    .ctf-item {
        padding: 1rem;
    }
}