/* Reset and Base Styles */
:root {
    --nav-gradient: linear-gradient(135deg, #00ff88, #00ccff);
}

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

html {
    scroll-behavior: smooth;
    /* Hide scrollbar but keep functionality */
    scrollbar-width: none; /* Firefox */
    -ms-overflow-style: none; /* IE and Edge */
}

/* Hide scrollbar for Chrome, Safari and Opera */
html::-webkit-scrollbar {
    display: none;
}

body {
    font-family: 'Inter', sans-serif;
    background-color: #000000;
    color: #ffffff;
    line-height: 1.6;
    overflow-x: hidden;
    /* Hide scrollbar but keep functionality */
    scrollbar-width: none; /* Firefox */
    -ms-overflow-style: none; /* IE and Edge */
}

/* Hide scrollbar for Chrome, Safari and Opera */
body::-webkit-scrollbar {
    display: none;
}

/* Performance optimizations with will-change */
.project-card {
    will-change: transform;
}

.hero-content, .hero-image {
    will-change: transform;
}

.notification {
    will-change: transform;
}

.hamburger {
    will-change: transform;
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }
    
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* CSS animations for Easter eggs */
@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

@keyframes gradient {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Navigation */
.navbar {
    position: fixed;
    top: 0;
    width: 100%;
    background: rgba(0, 0, 0, 0.95);
    backdrop-filter: blur(10px);
    z-index: 1000;
    padding: 1rem 0;
    transition: all 0.3s ease;
}

.navbar.scrolled {
    background: rgba(0, 0, 0, 0.98);
    box-shadow: 0 2px 20px rgba(0, 0, 0, 0.3);
}

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

.nav-logo span {
    font-size: 1.8rem;
    font-weight: 700;
    background: linear-gradient(135deg, #00ff88, #00ccff);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    transition: all 0.3s ease;
}

.nav-menu {
    display: flex;
    list-style: none;
    gap: 2rem;
}

.nav-link {
    color: #ffffff;
    text-decoration: none;
    font-weight: 500;
    transition: all 0.3s ease;
    position: relative;
}

.nav-link:hover,
.nav-link.active {
    background: linear-gradient(135deg, #00ff88, #00ccff);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

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

.nav-link:hover::after,
.nav-link.active::after {
    width: 100%;
}

.hamburger {
    display: none;
    flex-direction: column;
    cursor: pointer;
}

.bar {
    width: 25px;
    height: 3px;
    background: #ffffff;
    margin: 3px 0;
    transition: 0.3s;
}

/* Hero Section */
.hero {
    min-height: 100vh;
    display: flex;
    align-items: center;
    position: relative;
    background: linear-gradient(135deg, #000000 0%, #111111 50%, #000000 100%);
    overflow: hidden;
    background-color: #000; /* Ensure immediate background color */
}

.hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: 
        radial-gradient(circle at 20% 80%, rgba(0, 255, 136, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 80% 20%, rgba(0, 204, 255, 0.1) 0%, transparent 50%);
    pointer-events: none;
}

.hero-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4rem;
    align-items: center;
    position: relative;
    z-index: 1;
}

.hero-content {
    animation: fadeInUp 1s ease-out;
}

.greeting {
    display: block;
    font-size: 1.2rem;
    color: #888888;
    margin-bottom: 0.5rem;
}

.name {
    display: block;
    font-size: 3.5rem;
    font-weight: 700;
    background: linear-gradient(135deg, #00ff88, #00ccff);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 1rem;
    transition: all 0.3s ease;
}

.hero-subtitle {
    font-size: 1.5rem;
    color: #cccccc;
    margin-bottom: 1.5rem;
    font-weight: 500;
}

.hero-description {
    font-size: 1.1rem;
    color: #888888;
    margin-bottom: 2.5rem;
    max-width: 500px;
    line-height: 1.7;
    min-height: 3.4rem; /* Reserve space to prevent layout shift */
}

.hero-buttons {
    display: flex;
    gap: 1rem;
    margin-bottom: 2rem;
}

.btn {
    padding: 12px 30px;
    border: none;
    border-radius: 50px;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.3s ease;
    cursor: pointer;
    display: inline-block;
    text-align: center;
}

.btn-primary {
    background: linear-gradient(135deg, #00ff88, #00ccff);
    color: #000000;
    transition: all 0.3s ease;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 30px rgba(0, 255, 136, 0.3);
}

.btn-primary:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none;
}

.btn-secondary {
    background: transparent;
    color: #ffffff;
    border: 2px solid #333333;
}

.btn-secondary:hover {
    border-color: #00ff88;
    color: #00ff88;
    transform: translateY(-2px);
}

.hero-social {
    display: flex;
    gap: 1rem;
}

.hero-social a {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: #111111;
    color: #ffffff;
    text-decoration: none;
    transition: all 0.3s ease;
}

.hero-social a:hover {
    background: linear-gradient(135deg, #00ff88, #00ccff);
    color: #000000;
    transform: translateY(-2px);
}

.hero-image {
    display: flex;
    justify-content: center;
    align-items: center;
}

.code-animation {
    background: #111111;
    border-radius: 10px;
    padding: 2rem;
    border: 1px solid #333333;
    font-family: 'Courier New', monospace;
    font-size: 0.9rem;
    line-height: 1.8;
    animation: fadeInRight 1s ease-out 0.3s both;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
    width: 100%;
    min-height: 200px; /* Ensure consistent height from start */
}

.code-line {
    margin-bottom: 0.5rem;
    opacity: 0;
    min-height: 1.8rem; /* Reserve space for each line */
}

.code-line.indent {
    padding-left: 2rem;
}

.keyword { color: #ff6b6b; }
.variable { color: #4ecdc4; }
.operator { color: #ffe66d; }
.string { color: #95e1d3; }
.array { color: #ffa726; }
.function { color: #42a5f5; }

.scroll-indicator {
    position: absolute;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%);
    animation: bounce 2s infinite;
}

.scroll-arrow {
    width: 20px;
    height: 20px;
    border-bottom: 2px solid #00ff88;
    border-right: 2px solid #00ff88;
    transform: rotate(45deg);
}

/* Section Styles */
section {
    padding: 6rem 0;
}

.section-title {
    font-size: 2.5rem;
    font-weight: 700;
    text-align: center;
    margin-bottom: 3rem;
    background: linear-gradient(135deg, #00ff88, #00ccff);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    transition: all 0.3s ease;
}

/* About Section */
.about {
    background: #111111;
}

.about-content {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 4rem;
    align-items: center;
}

.about-text p {
    font-size: 1.1rem;
    color: #cccccc;
    margin-bottom: 1.5rem;
    line-height: 1.8;
}

.about-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2rem;
    margin-top: 2rem;
}

.stat {
    text-align: center;
    padding: 1.5rem;
    background: #000000;
    border-radius: 10px;
    border: 1px solid #333333;
}

.stat h3 {
    font-size: 2rem;
    font-weight: 700;
    background: linear-gradient(135deg, #00ff88, #00ccff);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 0.5rem;
}

.stat p {
    color: #888888;
    font-size: 0.9rem;
}

.profile-card {
    background: #000000;
    border-radius: 15px;
    padding: 2rem;
    border: 1px solid #333333;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
}

.profile-header {
    text-align: center;
    margin-bottom: 2rem;
}

.profile-header h3 {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
}

.profile-header p {
    color: #888888;
}

.info-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1rem;
    padding: 0.75rem;
    background: #111111;
    border-radius: 8px;
}

.info-item i {
    color: #00ff88;
    width: 20px;
}

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

.skill-category {
    background: #111111;
    padding: 2rem;
    border-radius: 15px;
    border: 1px solid #333333;
}

.skill-category h3 {
    font-size: 1.5rem;
    margin-bottom: 1.5rem;
    color: #00ff88;
}

.skill-items {
    display: grid;
    gap: 1rem;
}

.skill-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    background: #000000;
    border-radius: 8px;
    border: 1px solid #333333;
    transition: all 0.3s ease;
}

.skill-item:hover {
    border-color: #00ff88;
    transform: translateY(-2px);
}

.skill-item i {
    font-size: 1.2rem;
    color: #00ff88;
    width: 24px;
}

/* Projects Section */
.projects {
    background: #111111;
}

.projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
}

.project-card {
    background: #000000;
    border-radius: 15px;
    overflow: hidden;
    border: 1px solid #333333;
    transition: all 0.3s ease;
}

.project-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
}

.project-image {
    height: 200px;
    background: linear-gradient(135deg, #00ff88, #00ccff);
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

/* Project-specific backgrounds */
.project-card:nth-child(1) .project-image {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    background-image: 
        radial-gradient(circle at 25% 25%, rgba(255,255,255,0.2) 2px, transparent 2px),
        radial-gradient(circle at 75% 75%, rgba(255,255,255,0.1) 1px, transparent 1px),
        linear-gradient(45deg, transparent 40%, rgba(255,255,255,0.1) 50%, transparent 60%);
    background-size: 30px 30px, 20px 20px, 40px 40px;
}

.project-card:nth-child(1) .project-image::before {
    content: '🖥️';
    font-size: 4rem;
    position: absolute;
    color: rgba(255,255,255,0.4);
    animation: float 3s ease-in-out infinite;
    text-shadow: 0 0 20px rgba(255,255,255,0.3);
}

.project-card:nth-child(2) .project-image {
    background: linear-gradient(135deg, #ff6b6b 0%, #ffa726 100%);
    background-image: 
        repeating-linear-gradient(45deg, rgba(255,255,255,0.1) 0px, rgba(255,255,255,0.1) 2px, transparent 2px, transparent 8px),
        repeating-linear-gradient(-45deg, rgba(255,255,255,0.05) 0px, rgba(255,255,255,0.05) 2px, transparent 2px, transparent 8px);
    background-size: 16px 16px, 16px 16px;
}

.project-card:nth-child(2) .project-image::before {
    content: '🔐';
    font-size: 4rem;
    position: absolute;
    color: rgba(255,255,255,0.5);
    animation: pulse 2s ease-in-out infinite;
    text-shadow: 0 0 20px rgba(255,255,255,0.3);
}

.project-card:nth-child(3) .project-image {
    background: linear-gradient(135deg, #4ecdc4 0%, #2196f3 100%);
    background-image: 
        repeating-linear-gradient(0deg, transparent, transparent 5px, rgba(255,255,255,0.1) 5px, rgba(255,255,255,0.1) 6px),
        repeating-linear-gradient(90deg, transparent, transparent 5px, rgba(255,255,255,0.1) 5px, rgba(255,255,255,0.1) 6px);
    background-size: 12px 12px;
}

.project-card:nth-child(3) .project-image::before {
    content: '⚖️';
    font-size: 4rem;
    position: absolute;
    color: rgba(255,255,255,0.5);
    animation: bounce 2s ease-in-out infinite;
    text-shadow: 0 0 20px rgba(255,255,255,0.3);
}

.project-card:nth-child(4) .project-image {
    background: linear-gradient(135deg, #a8edea 0%, #fed6e3 100%);
    background-image: 
        radial-gradient(circle at 30% 70%, rgba(255,255,255,0.3) 10%, transparent 10%),
        radial-gradient(circle at 70% 30%, rgba(255,255,255,0.2) 8%, transparent 8%),
        linear-gradient(30deg, transparent 30%, rgba(255,255,255,0.1) 50%, transparent 70%);
    background-size: 25px 25px, 20px 20px, 35px 35px;
}

.project-card:nth-child(4) .project-image::before {
    content: '⚡';
    font-size: 4rem;
    position: absolute;
    color: rgba(0,0,0,0.4);
    animation: flash 1.5s ease-in-out infinite;
    text-shadow: 0 0 20px rgba(255,255,255,0.5);
}

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

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

.project-links {
    display: flex;
    gap: 1rem;
}

.project-link {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 50px;
    height: 50px;
    background: #ffffff;
    color: #000000;
    border-radius: 50%;
    text-decoration: none;
    transition: all 0.3s ease;
}

.project-link:hover {
    transform: scale(1.1);
}

.project-info {
    padding: 1.5rem;
}

.project-info h3 {
    font-size: 1.3rem;
    margin-bottom: 1rem;
    color: #ffffff;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.project-badge {
    font-size: 0.7rem;
    padding: 0.2rem 0.5rem;
    border-radius: 12px;
    font-weight: 600;
}

/* Replace invalid :contains selectors with explicit variants */
.project-badge.featured {
    background: linear-gradient(135deg, #ffd700, #ffed4e);
    color: #000000;
}

.project-badge.wip {
    background: linear-gradient(135deg, #ff6b6b, #ff8e8e);
    color: #ffffff;
}

.project-card.featured {
    border: 2px solid #ffd700;
    position: relative;
}

.project-card.featured::before {
    content: '';
    position: absolute;
    top: -2px;
    left: -2px;
    right: -2px;
    bottom: -2px;
    background: linear-gradient(135deg, #ffd700, #ffed4e, #00ff88, #00ccff);
    border-radius: 17px;
    z-index: -1;
    opacity: 0.3;
}

.project-info p {
    color: #cccccc;
    margin-bottom: 1.5rem;
    line-height: 1.6;
}

.project-tech {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.tech-tag {
    padding: 0.3rem 0.8rem;
    background: #333333;
    color: #00ff88;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 500;
}

/* Contact Section */
.contact-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4rem;
}

.contact-info h3 {
    font-size: 1.8rem;
    margin-bottom: 1rem;
    color: #00ff88;
    background: linear-gradient(135deg, #00ff88, #00ccff);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    transition: all 0.3s ease;
}

.contact-info p {
    color: #cccccc;
    margin-bottom: 2rem;
    line-height: 1.7;
}

.contact-items {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.contact-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    background: #111111;
    border-radius: 8px;
    border: 1px solid #333333;
}

.contact-item i {
    color: #00ff88;
    width: 20px;
}

.contact-item a {
    color: #cccccc;
    text-decoration: none;
    transition: color 0.3s ease;
}

.contact-item a:hover {
    color: #00ff88;
}

.contact-form {
    background: #111111;
    padding: 2rem;
    border-radius: 15px;
    border: 1px solid #333333;
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 1rem;
    background: #000000;
    border: 1px solid #333333;
    border-radius: 8px;
    color: #ffffff;
    font-family: inherit;
    transition: border-color 0.3s ease;
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #00ff88;
}

.form-group input::placeholder,
.form-group textarea::placeholder {
    color: #666666;
}

/* Footer */
.footer {
    background: #111111;
    border-top: 1px solid #333333;
    padding: 2rem 0;
}

.footer-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.footer-content p {
    color: #888888;
}

.footer-social a {
    color: #888888;
    font-size: 1.5rem;
    text-decoration: none;
    transition: color 0.3s ease;
}

.footer-social a:hover {
    color: #00ff88;
}

/* Explicit h1 sizing inside sections to avoid deprecation layout changes */
.hero-title {
    font-size: 1rem; /* children spans (.name, .greeting) already define their sizes */
    line-height: 1.2;
}

/* Utility and accessibility helpers */
.visually-hidden {
    position: absolute !important;
    height: 1px; width: 1px;
    overflow: hidden;
    clip: rect(1px, 1px, 1px, 1px);
    white-space: nowrap; /* added line */
}

.visually-hidden-focusable {
    position: absolute;
    left: -10000px;
    top: auto;
    width: 1px;
    height: 1px;
    overflow: hidden;
}

.visually-hidden-focusable:focus {
    left: 10px;
    top: 10px;
    width: auto;
    height: auto;
    background: #111;
    color: #fff;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.3);
}

:focus-visible {
    outline: 2px dashed #00ff88;
    outline-offset: 2px;
}

/* Animations */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeInRight {
    from {
        opacity: 0;
        transform: translateX(30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes bounce {
    0%, 20%, 50%, 80%, 100% {
        transform: translateY(0) translateX(-50%);
    }
    40% {
        transform: translateY(-10px) translateX(-50%);
    }
    60% {
        transform: translateY(-5px) translateX(-50%);
    }
}

@keyframes float {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-10px);
    }
}

@keyframes pulse {
    0%, 100% {
        transform: scale(1);
        opacity: 1;
    }
    50% {
        transform: scale(1.02);
        opacity: 0.9;
    }
}

@keyframes gradient {
    0% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
    100% {
        background-position: 0% 50%;
    }
}

@keyframes flash {
    0%, 100% {
        opacity: 0.3;
    }
    50% {
        opacity: 0.8;
    }
}

/* Responsive Design */
@media (max-width: 768px) {
    .hamburger {
        display: flex;
    }

    .nav-menu {
        position: fixed;
        left: -100%;
        top: 70px;
        flex-direction: column;
        background: rgba(0, 0, 0, 0.95);
        width: 100%;
        text-align: center;
        transition: 0.3s;
        padding: 2rem 0;
    }

    .nav-menu.active {
        left: 0;
    }

    .nav-menu li {
        margin: 1rem 0;
    }

    .hero-container {
        grid-template-columns: 1fr;
        gap: 2rem;
        text-align: center;
    }

    .name {
        font-size: 2.5rem;
    }

    .hero-buttons {
        flex-direction: column;
        align-items: center;
    }

    .about-content {
        grid-template-columns: 1fr;
        gap: 2rem;
    }

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

    .contact-content {
        grid-template-columns: 1fr;
        gap: 2rem;
    }

    .footer-content {
        flex-direction: column;
        gap: 1rem;
        text-align: center;
    }

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

    .hero-description {
        max-width: 100%;
    }

    .code-animation {
        font-size: 0.8rem;
        padding: 1rem;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 0 15px;
    }

    .name {
        font-size: 2rem;
    }

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

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

    .skill-category,
    .contact-form {
        padding: 1.5rem;
    }

    .project-info {
        padding: 1rem;
    }
}
