/* 1. Global Reset & Defaults */
* {
    box-sizing: border-box; 
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    background-color: #CFCFCF;
    background-image: 
        radial-gradient(circle at 20% 30%, rgba(255, 215, 0, 0.08) 0%, transparent 50%),
        radial-gradient(circle at 80% 70%, rgba(92, 92, 130, 0.08) 0%, transparent 50%),
        radial-gradient(circle at 50% 50%, rgba(42, 42, 68, 0.03) 0%, transparent 50%),
        linear-gradient(135deg, #CFCFCF 0%, #D5D5D5 50%, #CFCFCF 100%);
    background-size: 100% 100%, 100% 100%, 100% 100%, 100% 100%;
    /* Using scroll instead of fixed improves performance on many devices */
    background-attachment: scroll;
    color: #333;
    scroll-behavior: smooth; /* Smooth scrolling for anchor links */
    opacity: 0;
    animation: fadeIn 0.5s ease-in forwards;
    position: relative;
    overflow-x: hidden;
}

/* Page Transition Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideInFromLeft {
    from {
        opacity: 0;
        transform: translateX(-50px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes slideInFromRight {
    from {
        opacity: 0;
        transform: translateX(50px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes scaleIn {
    from {
        opacity: 0;
        transform: scale(0.9);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* Page content animations */
main {
    animation: fadeInUp 0.6s ease-out;
}

.section {
    animation: fadeInUp 0.8s ease-out;
}

.section:nth-child(even) {
    animation: fadeInUp 0.8s ease-out 0.1s both;
}

/* Header animation */
#main-header {
    animation: slideInFromLeft 0.5s ease-out;
}

/* Hero section animation */
#hero, .skills-hero, .projects-hero, .contact-hero, #about-hero {
    animation: fadeIn 0.6s ease-out;
    position: relative;
    z-index: 1;
}

/* Hero section text styling */
.skills-hero h1,
.skills-hero h2,
.projects-hero h1,
.projects-hero h2,
.contact-hero h1,
.contact-hero h2,
#about-hero h1,
#about-hero h2 {
    color: #fff;
    position: relative;
    z-index: 2;
}

.skills-hero .tagline,
.projects-hero .tagline,
.contact-hero .tagline,
#about-hero .tagline {
    color: rgba(255, 255, 255, 0.9);
    position: relative;
    z-index: 2;
}

/* Project cards animation */
.project-card {
    animation: scaleIn 0.6s ease-out;
}

.project-card:nth-child(1) {
    animation: scaleIn 0.6s ease-out 0.1s both;
}

.project-card:nth-child(2) {
    animation: scaleIn 0.6s ease-out 0.2s both;
}

.project-card:nth-child(3) {
    animation: scaleIn 0.6s ease-out 0.3s both;
}

/* Skills category animation */
.skills-category {
    animation: slideInFromRight 0.6s ease-out;
}

.skills-category:nth-child(1) {
    animation: slideInFromRight 0.6s ease-out 0.1s both;
}

.skills-category:nth-child(2) {
    animation: slideInFromRight 0.6s ease-out 0.2s both;
}

.skills-category:nth-child(3) {
    animation: slideInFromRight 0.6s ease-out 0.3s both;
}

/* Project detail animation */
.project-detail {
    animation: fadeInUp 0.6s ease-out;
}

.project-detail:nth-child(1) {
    animation: fadeInUp 0.6s ease-out 0.1s both;
}

.project-detail:nth-child(2) {
    animation: fadeInUp 0.6s ease-out 0.2s both;
}

.project-detail:nth-child(3) {
    animation: fadeInUp 0.6s ease-out 0.3s both;
}

.project-detail:nth-child(4) {
    animation: fadeInUp 0.6s ease-out 0.4s both;
}

/* Contact form animation */
.contact-form-container, .contact-info-card {
    animation: scaleIn 0.6s ease-out;
}

.contact-info-card {
    animation: slideInFromLeft 0.6s ease-out;
}

.contact-form-container {
    animation: slideInFromRight 0.6s ease-out;
}

/* About content animation */
.about-content {
    animation: fadeInUp 0.8s ease-out;
}

.about-content p {
    animation: fadeInUp 0.8s ease-out;
}

.about-content p:nth-child(1) {
    animation: fadeInUp 0.8s ease-out 0.1s both;
}

.about-content p:nth-child(2) {
    animation: fadeInUp 0.8s ease-out 0.2s both;
}

.about-content p:nth-child(3) {
    animation: fadeInUp 0.8s ease-out 0.3s both;
}

/* Button hover animations - ripple effect */
.btn-primary::before, .btn-secondary::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
    pointer-events: none;
}

.btn-primary:hover::before, .btn-secondary:hover::before {
    width: 300px;
    height: 300px;
}

/* Navigation link animations */
#nav-menu a {
    position: relative;
    transition: all 0.3s ease;
}

#nav-menu a::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    width: 0;
    height: 2px;
    background: #FFD700;
    transition: all 0.3s ease;
    transform: translateX(-50%);
}

#nav-menu a:hover::after {
    width: 80%;
}

/* Footer animation */
footer {
    animation: fadeIn 0.6s ease-out 0.3s both;
}

/* Ripple effect for buttons */
.ripple {
    position: absolute;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.6);
    transform: scale(0);
    animation: ripple-animation 0.6s ease-out;
    pointer-events: none;
}

@keyframes ripple-animation {
    to {
        transform: scale(4);
        opacity: 0;
    }
}

/* Smooth transitions for interactive elements */
.project-card, .skill-item, .project-detail {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

/* Loading animation for page transitions */
@keyframes pageLoad {
    0% {
        opacity: 0;
        transform: scale(0.95);
    }
    100% {
        opacity: 1;
        transform: scale(1);
    }
}

/* Stagger animation for lists */
.animate-stagger > * {
    opacity: 0;
    animation: fadeInUp 0.6s ease-out forwards;
}

.animate-stagger > *:nth-child(1) { animation-delay: 0.1s; }
.animate-stagger > *:nth-child(2) { animation-delay: 0.2s; }
.animate-stagger > *:nth-child(3) { animation-delay: 0.3s; }
.animate-stagger > *:nth-child(4) { animation-delay: 0.4s; }
.animate-stagger > *:nth-child(5) { animation-delay: 0.5s; }

h1, h2, h3, h4 {
    font-weight: 600;
    margin-bottom: 1rem;
}

h1 {
    font-size: 2.8rem;
}

h2 {
    font-size: 2.5rem;
}

h3 {
    font-size: 2rem;
}

h4 {
    font-size: 1.5rem;
}

.container {
    width: 90%;
    max-width: 1200px;
    margin: auto;
    overflow: hidden;
}

/* 2. Header/Navigation Styling (Flexbox) */
#main-header {
    background: #2a2a44;
    color: #fff;
    padding: 1rem 0;
    position: sticky;
    top: 0;
    z-index: 1000;
}

#main-header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo a {
    color: #fff;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: transform 0.3s ease;
}

.logo a:hover {
    transform: scale(1.05);
}

.logo a i {
    color: #FFD700;
    font-size: 1.2em;
}

#nav-menu ul {
    list-style: none;
    display: flex; 
}

#nav-menu a {
    /* Default desktop nav link color */
    color: #4f46e5;
    padding: 0.75rem 1rem;
    text-decoration: none;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

#nav-menu a i {
    font-size: 0.9em;
    transition: transform 0.3s;
}

#nav-menu a:hover {
    background: #4a4a70;
    border-radius: 4px;
    transform: translateX(5px);
}

#nav-menu a:hover i {
    transform: scale(1.2);
}

.menu-toggle {
    display: none; 
}

/* 3. Section Styling */
.section {
    padding: 5rem 0;
    text-align: center;
}

#hero {
    background: linear-gradient(135deg, #2a2a44, #5c5c82);
    color: #fff;
    padding: 8rem 0;
}

.tagline {
    font-size: 1.3rem;
    margin-bottom: 1rem;
    font-weight: 500;
}

.sub-tagline {
    font-size: 1.1rem;
    margin-bottom: 2rem;
    opacity: 0.9;
    max-width: 700px;
    margin-left: auto;
    margin-right: auto;
}

.hero-buttons {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
}

.btn-primary {
    display: inline-block;
    background: #FFD700; /* Accent color */
    color: #2a2a44;
    padding: 12px 25px;
    text-decoration: none;
    border-radius: 50px;
    font-weight: bold;
    transition: background 0.3s, transform 0.3s ease;
    position: relative;
    overflow: hidden;
}

.btn-primary:hover {
    background: #e6c200;
    transform: translateY(-3px) scale(1.05);
}

/* 4. Projects Grid (CSS Grid) */
.project-grid {
    display: grid;
    /* Responsive Magic: 
       Creates as many columns as possible, each at least 300px wide. */
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); 
    gap: 30px; 
    margin-top: 2rem;
}

.project-card {
    background: #CFCFCF;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
    text-align: left;
    transition: transform 0.3s;
    border: 1px solid rgba(92, 92, 130, 0.1);
}

.project-card:hover {
    transform: translateY(-5px);
}

.project-card img {
    width: 100%;
    height: 200px;
    object-fit: cover;
    display: block;
}

.project-card h4, .project-card p {
    padding: 10px 15px;
}

/* 5. Contact Form Styling */
.contact-form-container {
    max-width: 600px;
    margin: 2rem auto 0;
    text-align: left;
    padding: 20px;
    background: #CFCFCF;
    border-radius: 8px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.05);
    border: 1px solid rgba(92, 92, 130, 0.1);
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: bold;
    color: #2a2a44;
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 12px;
    border: 1px solid rgba(92, 92, 130, 0.2);
    border-radius: 4px;
    font-size: 1rem;
    transition: border-color 0.3s;
    background: #CFCFCF;
    color: #333;
}

.btn-secondary {
    display: inline-block;
    background: #5c5c82;
    color: #fff;
    padding: 12px 25px;
    text-decoration: none;
    border-radius: 50px;
    font-weight: bold;
    font-size: 1rem;
    transition: background 0.3s, transform 0.3s ease;
    border: 2px solid #5c5c82;
    position: relative;
    overflow: hidden;
}

.btn-secondary:hover {
    background: #4a4a70;
    transform: translateY(-3px) scale(1.05);
}

.about-content {
    max-width: 1000px;
    margin: 0 auto;
    text-align: left;
}

/* Profile Image Styles */
.profile-image-container {
    text-align: center;
    margin-bottom: 3rem;
    animation: fadeInUp 0.8s ease-out;
}

.profile-image {
    width: 300px;
    height: 300px;
    border-radius: 50%;
    object-fit: cover;
    border: 5px solid #FFD700;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.profile-image:hover {
    transform: scale(1.05);
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.3);
}

/* Hero Image Styles */
.hero-content {
    display: grid;
    grid-template-columns: 1fr 1.5fr;
    gap: 3rem;
    align-items: center;
    max-width: 1200px;
    margin: 0 auto;
}

.hero-image-container {
    text-align: center;
    animation: slideInFromLeft 0.8s ease-out;
}

.hero-profile-image {
    width: 100%;
    max-width: 400px;
    height: auto;
    border-radius: 20px;
    object-fit: cover;
    border: 5px solid rgba(255, 255, 255, 0.3);
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.3);
    transition: transform 0.3s ease;
}

.hero-profile-image:hover {
    transform: translateY(-10px) scale(1.02);
}

.hero-text {
    animation: slideInFromRight 0.8s ease-out;
}

/* About Section Image Styles */
.about-image-container {
    float: left;
    margin-right: 2rem;
    margin-bottom: 1rem;
    animation: fadeInUp 0.8s ease-out;
}

.about-image {
    width: 250px;
    height: 250px;
    border-radius: 15px;
    object-fit: cover;
    border: 4px solid #FFD700;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
    transition: transform 0.3s ease;
}

.about-image:hover {
    transform: scale(1.05) rotate(2deg);
}

.about-text {
    overflow: hidden;
}

/* Hero Badge and Stats */
.hero-badge {
    display: inline-block;
    background: rgba(255, 255, 255, 0.2);
    padding: 0.5rem 1.5rem;
    border-radius: 25px;
    margin-bottom: 1.5rem;
    font-size: 1rem;
    font-weight: 600;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.3);
    animation: fadeIn 0.8s ease-out 0.2s both;
    text-shadow: 1px 1px 6px rgba(0, 0, 0, 0.35);
}

.hero-badge i {
    margin-right: 0.5rem;
}

.hero-stats {
    display: flex;
    gap: 2rem;
    margin: 2rem 0;
    flex-wrap: wrap;
    justify-content: center;
}

.stat-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    padding: 1rem;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    transition: transform 0.3s ease, background 0.3s ease;
    min-width: 120px;
}

.stat-item:hover {
    transform: translateY(-5px);
    background: rgba(255, 255, 255, 0.2);
}

.stat-item i {
    font-size: 2rem;
    color: #FFD700;
}

.stat-item span {
    font-size: 0.9rem;
    font-weight: 500;
}

/* Icon spacing in buttons */
.btn-primary i, .btn-secondary i {
    margin-right: 0.5rem;
}

/* Skills icons */
.skill-item i {
    margin-right: 0.5rem;
}

/* Info item icons */
.info-item {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
}

.info-item i {
    font-size: 1.5rem;
    color: #FFD700;
    margin-top: 0.2rem;
    min-width: 30px;
}

.info-item strong {
    display: block;
    margin-bottom: 0.5rem;
}

/* Enhanced section backgrounds */
.section {
    position: relative;
    overflow: hidden;
}

.section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: 
        radial-gradient(ellipse at top, rgba(255, 215, 0, 0.03) 0%, transparent 50%),
        radial-gradient(ellipse at bottom, rgba(92, 92, 130, 0.03) 0%, transparent 50%);
    pointer-events: none;
    z-index: 0;
}

/* Don't apply overlay to hero sections */
.skills-hero::before,
.projects-hero::before,
.contact-hero::before,
#about-hero::before,
#hero::before {
    display: none;
}

.section > .container {
    position: relative;
    z-index: 1;
}

/* Ensure hero sections have proper z-index */
.skills-hero > .container,
.projects-hero > .container,
.contact-hero > .container,
#about-hero > .container {
    position: relative;
    z-index: 2;
}

.section:nth-child(odd) {
    background: linear-gradient(to bottom, rgba(207, 207, 207, 0.8), rgba(213, 213, 213, 0.9));
}

.section:nth-child(even) {
    background: linear-gradient(to bottom, rgba(213, 213, 213, 0.9), rgba(207, 207, 207, 0.8));
}

/* Hero section special background */
#hero {
    position: relative;
    overflow: hidden;
}

#hero::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: 
        radial-gradient(circle, rgba(255, 215, 0, 0.1) 0%, transparent 70%),
        radial-gradient(circle at 30% 30%, rgba(255, 255, 255, 0.1) 0%, transparent 50%);
    animation: heroBackground 20s ease-in-out infinite;
    z-index: 0;
}

#hero > .container {
    position: relative;
    z-index: 1;
}

@keyframes heroBackground {
    0%, 100% {
        transform: translate(0, 0) rotate(0deg);
    }
    50% {
        transform: translate(5%, 5%) rotate(180deg);
    }
}

/* Hero sections background and text visibility */
.skills-hero,
.projects-hero,
.contact-hero,
#about-hero {
    position: relative;
    overflow: hidden;
    z-index: 1;
}

.skills-hero h1,
.skills-hero h2,
.projects-hero h1,
.projects-hero h2,
.contact-hero h1,
.contact-hero h2,
#about-hero h1,
#about-hero h2 {
    color: #fff !important;
    position: relative;
    z-index: 10;
    text-shadow: 2px 2px 8px rgba(0, 0, 0, 0.5);
    font-weight: 700;
}

.skills-hero .tagline,
.projects-hero .tagline,
.contact-hero .tagline,
#about-hero .tagline {
    color: rgba(255, 255, 255, 0.95) !important;
    position: relative;
    z-index: 10;
    text-shadow: 1px 1px 4px rgba(0, 0, 0, 0.4);
}

/* Decorative background elements */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: 
        radial-gradient(circle at 20% 30%, rgba(255, 215, 0, 0.06) 0%, transparent 40%),
        radial-gradient(circle at 80% 70%, rgba(92, 92, 130, 0.06) 0%, transparent 40%),
        radial-gradient(circle at 50% 10%, rgba(42, 42, 68, 0.04) 0%, transparent 35%);
    pointer-events: none;
    z-index: -1;
    animation: backgroundMove 20s ease-in-out infinite;
}

body::after {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: 
        repeating-linear-gradient(45deg, transparent, transparent 35px, rgba(255, 215, 0, 0.02) 35px, rgba(255, 215, 0, 0.02) 70px),
        repeating-linear-gradient(-45deg, transparent, transparent 35px, rgba(92, 92, 130, 0.02) 35px, rgba(92, 92, 130, 0.02) 70px);
    pointer-events: none;
    z-index: -1;
    opacity: 0.5;
}

@keyframes backgroundMove {
    0%, 100% {
        transform: translate(0, 0) scale(1);
    }
    33% {
        transform: translate(20px, -20px) scale(1.05);
    }
    66% {
        transform: translate(-20px, 20px) scale(0.95);
    }
}

/* Animated floating shapes */
.floating-shapes {
    position: fixed;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    pointer-events: none;
    z-index: -1;
    overflow: hidden;
}

.shape {
    position: absolute;
    opacity: 0.1;
    animation: float 15s infinite ease-in-out;
}

.shape-1 {
    width: 300px;
    height: 300px;
    background: linear-gradient(135deg, #FFD700, #ffed4e);
    border-radius: 30% 70% 70% 30% / 30% 30% 70% 70%;
    top: 10%;
    left: 10%;
    animation-delay: 0s;
}

.shape-2 {
    width: 200px;
    height: 200px;
    background: linear-gradient(135deg, #5c5c82, #2a2a44);
    border-radius: 50%;
    top: 60%;
    right: 15%;
    animation-delay: 5s;
}

.shape-3 {
    width: 250px;
    height: 250px;
    background: linear-gradient(135deg, rgba(255, 215, 0, 0.3), rgba(92, 92, 130, 0.3));
    border-radius: 20% 80% 20% 80% / 80% 20% 80% 20%;
    bottom: 20%;
    left: 20%;
    animation-delay: 10s;
}

.shape-4 {
    width: 180px;
    height: 180px;
    background: linear-gradient(135deg, #2a2a44, #5c5c82);
    border-radius: 60% 40% 30% 70% / 60% 30% 70% 40%;
    top: 30%;
    right: 30%;
    animation-delay: 7s;
}

@keyframes float {
    0%, 100% {
        transform: translate(0, 0) rotate(0deg);
    }
    25% {
        transform: translate(50px, -50px) rotate(90deg);
    }
    50% {
        transform: translate(-30px, 30px) rotate(180deg);
    }
    75% {
        transform: translate(30px, 50px) rotate(270deg);
    }
}

/* Pattern overlay */
.pattern-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: 
        radial-gradient(circle at 2px 2px, rgba(255, 215, 0, 0.15) 1px, transparent 0);
    background-size: 40px 40px;
    pointer-events: none;
    z-index: -1;
    opacity: 0.3;
    animation: patternMove 30s linear infinite;
}

@keyframes patternMove {
    0% {
        transform: translate(0, 0);
    }
    100% {
        transform: translate(40px, 40px);
    }
}

/* Enhanced project cards */
.project-card {
    position: relative;
    overflow: hidden;
}

.project-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 215, 0, 0.1), transparent);
    transition: left 0.5s;
}

.project-card:hover::before {
    left: 100%;
}

/* Enhanced form inputs */
.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #FFD700;
    box-shadow: 0 0 0 3px rgba(255, 215, 0, 0.1);
}

/* Section titles with icons */
h2 i, h3 i {
    margin-right: 0.5rem;
    color: #FFD700;
}

/* Footer icons */
.footer-links a {
    position: relative;
    padding: 0 0.5rem;
}

.footer-links a:not(:last-child)::after {
    content: '|';
    margin-left: 0.5rem;
    color: #999;
}

.about-content p {
    margin-bottom: 1.5rem;
    font-size: 1.1rem;
    line-height: 1.8;
}

.about-content .btn-primary {
    margin-top: 1rem;
}

.contact-info {
    max-width: 600px;
    margin: 2rem auto 0;
    text-align: left;
    background: #CFCFCF;
    padding: 30px;
    border-radius: 8px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.05);
    border: 1px solid rgba(92, 92, 130, 0.1);
}

.contact-item {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    margin-bottom: 1.5rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid #eee;
}

.contact-item:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

.contact-item i {
    font-size: 1.5rem;
    color: #FFD700;
    margin-top: 0.2rem;
    min-width: 30px;
}

.contact-item strong {
    display: block;
    margin-bottom: 0.5rem;
    color: #2a2a44;
    font-size: 1.1rem;
}

.contact-item a {
    color: #5c5c82;
    text-decoration: none;
    font-size: 1rem;
    transition: color 0.3s;
}

.contact-item a:hover {
    color: #2a2a44;
    text-decoration: underline;
}

.project-image-placeholder {
    width: 100%;
    height: 200px;
    background: linear-gradient(135deg, #5c5c82, #2a2a44);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 1.1rem;
}

.project-link {
    display: inline-block;
    color: #5c5c82;
    text-decoration: none;
    font-weight: 600;
    margin-top: 10px;
    padding: 0 15px 15px;
    transition: color 0.3s;
}

.project-link:hover {
    color: #2a2a44;
}

.footer-links {
    margin-top: 1rem;
}

.footer-links a {
    color: #ccc;
    text-decoration: none;
    transition: color 0.3s;
}

.footer-links a:hover {
    color: #fff;
}

/* 6. Mobile Responsiveness (Media Query) */
@media (max-width: 768px) {
    /* Show menu button, hide main menu */
    .menu-toggle {
        display: block;
        background: none;
        border: none;
        /* Blue toggle icon on mobile */
        color: #4f46e5;
        font-size: 1.5rem;
        cursor: pointer;
        padding: 0.5rem;
    }

    #nav-menu {
        /* Mobile menu: full-screen dropdown */
        position: absolute;
        top: 60px; 
        left: 0;
        width: 100%;
        /* Dark background so it stands out above content */
        background: #0f172a;
        display: none; /* Hidden by default (controlled by JS) */
        flex-direction: column;
        text-align: center;
        padding: 1rem 0;
        box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    }

    #nav-menu.active {
        display: flex;
    }

    #nav-menu ul {
        flex-direction: column;
        width: 100%;
    }

    #nav-menu ul li {
        width: 100%;
    }

    #nav-menu a {
        display: block;
        padding: 1rem;
        width: 100%;
        /* Ensure links are readable on the dark mobile menu background */
        color: #ffffff;
    }
    
    #hero {
        padding: 4rem 0;
    }

    .hero-content {
        grid-template-columns: 1fr;
        gap: 2rem;
        text-align: center;
    }

    .hero-image-container {
        order: -1;
    }

    .hero-profile-image {
        max-width: 300px;
    }

    h1 {
        font-size: 2.2rem;
    }

    h2 {
        font-size: 2rem;
    }

    h3 {
        font-size: 1.75rem;
    }

    .tagline {
        font-size: 1.1rem;
    }

    .sub-tagline {
        font-size: 1rem;
        padding: 0 1rem;
    }

    .hero-buttons {
        flex-direction: column;
        align-items: center;
    }

    .hero-buttons a {
        width: 80%;
        text-align: center;
    }

    .section {
        padding: 3rem 0;
    }

    .about-content {
        padding: 0 1rem;
        text-align: center;
    }

    .about-image-container {
        float: none;
        margin: 0 auto 2rem;
    }

    .about-image {
        width: 200px;
        height: 200px;
    }

    .profile-image {
        width: 250px;
        height: 250px;
    }

    .about-content p {
        font-size: 1rem;
    }

    .project-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .contact-info {
        margin: 1rem;
        padding: 20px;
    }

    .container {
        width: 95%;
    }
}

@media (max-width: 480px) {
    h1 {
        font-size: 1.95rem;
    }

    h2 {
        font-size: 1.75rem;
    }

    h3 {
        font-size: 1.5rem;
    }

    .tagline {
        font-size: 1rem;
    }

    .logo {
        font-size: 1.2rem;
    }

    #hero {
        padding: 3rem 0;
    }

    .hero-profile-image {
        max-width: 250px;
    }

    .profile-image {
        width: 200px;
        height: 200px;
    }

    .about-image {
        width: 180px;
        height: 180px;
    }

    .section {
        padding: 2.5rem 0;
    }
}

/* Tablet responsiveness */
@media (min-width: 769px) and (max-width: 1024px) {
    .project-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .container {
        width: 85%;
    }
    
    .contact-wrapper {
        grid-template-columns: 1fr;
    }
}

/* Mobile background optimizations */
@media (max-width: 768px) {
    .floating-shapes {
        display: none; /* Hide on mobile for better performance */
    }
    
    .pattern-overlay {
        opacity: 0.2;
    }
    
    body::after {
        opacity: 0.3;
    }
    
    .shape {
        opacity: 0.05;
    }
}

/* Additional responsive styles for new pages */
@media (max-width: 768px) {
    .skills-list {
        justify-content: center;
    }
    
    .tech-tags {
        justify-content: center;
    }
    
    .project-body {
        padding: 1.5rem;
    }
    
    .project-header {
        padding: 1.5rem;
    }
    
    .skills-category {
        padding: 1.5rem;
    }
    
    .contact-info-card {
        padding: 1.5rem;
    }
}

/* Footer */
footer {
    background: #2a2a44;
    color: #ccc;
    text-align: center;
    padding: 1.5rem 0;
    font-size: 0.9rem;
}

/* SEO Notes Page */
.seo-hero {
    background: linear-gradient(135deg, #2a2a44, #5c5c82);
    color: #fff;
    padding: 6rem 0;
}

.seo-layout {
    /* Flex-wrap makes the layout respond smoothly while resizing (no hard breakpoint needed) */
    display: flex;
    flex-wrap: wrap;
    gap: 2rem;
    align-items: flex-start;
}

.seo-toc {
    background: #CFCFCF;
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.06);
    border: 1px solid rgba(92, 92, 130, 0.12);
    position: sticky;
    top: 90px;
    flex: 0 1 340px;
    max-width: 340px;
    width: 100%;
}

.seo-toc-title {
    font-size: 1.3rem;
    margin-bottom: 1rem;
    color: #2a2a44;
}

.seo-toc ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.seo-toc li + li {
    margin-top: 0.5rem;
}

.seo-toc a {
    color: #5c5c82;
    text-decoration: none;
    font-weight: 600;
    display: inline-block;
    padding: 0.25rem 0;
    overflow-wrap: anywhere;
}

.seo-toc a:hover {
    color: #2a2a44;
    text-decoration: underline;
}

.seo-toc-footer {
    margin-top: 1.25rem;
}

.seo-content {
    display: grid;
    gap: 1.5rem;
    flex: 1 1 560px;
    min-width: 0; /* prevent horizontal overflow in flex layouts */
}

.seo-card {
    background: #CFCFCF;
    border-radius: 12px;
    padding: 2rem;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.06);
    border: 1px solid rgba(92, 92, 130, 0.12);
    text-align: left;
    min-width: 0; /* allow content to shrink within responsive layouts */
}

/* Prevent any SEO text from overflowing on small screens (fixes non-wrapping/side-scroll issues) */
.seo-card,
.seo-card p,
.seo-card li,
.seo-card a,
.seo-note {
    overflow-wrap: anywhere;
    word-break: break-word;
    hyphens: auto;
}

.seo-card h2 {
    color: #2a2a44;
    margin-bottom: 1rem;
}

.seo-card h3 {
    color: #2a2a44;
    margin-top: 1.25rem;
    margin-bottom: 0.75rem;
    font-size: 1.35rem;
}

.seo-list {
    margin-left: 1.25rem;
    margin-top: 0.75rem;
}

.seo-list li {
    margin-bottom: 0.6rem;
    line-height: 1.8;
}

.seo-note {
    margin-top: 1rem;
    padding: 1rem 1.25rem;
    background: rgba(92, 92, 130, 0.08);
    border-left: 4px solid #FFD700;
    border-radius: 8px;
}

.seo-sub {
    margin-top: 1rem;
}

.seo-code {
    margin-top: 1.25rem;
}

.seo-code pre {
    margin-top: 0.75rem;
    background: #2a2a44;
    color: #fff;
    padding: 1rem 1.25rem;
    border-radius: 10px;
    overflow: auto;
    border: 1px solid rgba(255, 255, 255, 0.15);
}

.seo-code code {
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
    font-size: 0.95rem;
}

@media (max-width: 1024px) {
    .seo-layout {
        gap: 1.25rem;
    }

    .seo-toc {
        position: static;
        top: auto;
        padding: 1.25rem;
        max-width: none;
        flex-basis: 100%;
    }

    .seo-content {
        flex-basis: 100%;
    }

    .seo-card {
        padding: 1.5rem;
    }

    .seo-hero {
        padding: 4.5rem 0;
    }
}

@media (max-width: 600px) {
    .seo-hero h1 {
        font-size: 2rem;
        line-height: 1.2;
    }

    .seo-toc-title {
        font-size: 1.15rem;
    }

    .seo-card h2 {
        font-size: 1.4rem;
    }

    .seo-card h3 {
        font-size: 1.2rem;
    }

    .seo-card {
        padding: 1.25rem;
    }

    .seo-code pre {
        padding: 0.9rem 1rem;
        -webkit-overflow-scrolling: touch;
    }

    /* Reduce indentation on narrow screens so bullet lists stay within the card */
    .seo-list {
        margin-left: 1rem;
    }
}

/* Prevent sticky header from covering anchored sections when using the TOC */
.seo-card {
    scroll-margin-top: 110px;
}

/* =========================
   2025 Refresh Theme
   - New colors + cleaner layout
   - Centralized styling (removes page-embedded CSS need)
   ========================= */
:root {
    --bg: #f6f7fb;
    --bg-soft: #eef2ff;
    --card: #ffffff;
    --text: #0f172a;
    --muted: #475569;
    --border: rgba(15, 23, 42, 0.12);
    --shadow: 0 14px 40px rgba(15, 23, 42, 0.10);

    --primary: #4f46e5;   /* indigo */
    --secondary: #06b6d4; /* cyan */
    --accent: #f59e0b;    /* amber */

    --hero-gradient: linear-gradient(135deg, #0f172a 0%, #4f46e5 55%, #06b6d4 100%);
    --btn-gradient: linear-gradient(135deg, #4f46e5 0%, #06b6d4 100%);
}

/* Base */
body {
    background-color: var(--bg);
    background-image:
        radial-gradient(circle at 20% 30%, rgba(79, 70, 229, 0.12) 0%, transparent 55%),
        radial-gradient(circle at 85% 20%, rgba(6, 182, 212, 0.10) 0%, transparent 55%),
        radial-gradient(circle at 50% 90%, rgba(245, 158, 11, 0.10) 0%, transparent 55%),
        linear-gradient(180deg, var(--bg) 0%, #ffffff 100%);
    color: var(--text);
}

a {
    color: var(--primary);
}

a:hover {
    color: #3730a3;
}

/* Header / Nav (glass) */
#main-header {
    background: rgba(255, 255, 255, 0.78);
    color: var(--text);
    border-bottom: 1px solid rgba(15, 23, 42, 0.08);
    box-shadow: 0 10px 30px rgba(15, 23, 42, 0.08);
    backdrop-filter: blur(12px);
}

.logo a {
    color: var(--text);
}

.logo a i {
    color: var(--primary);
}

#nav-menu a {
    /* Keep using the main nav link color defined earlier */
    color: #4f46e5;
}

#nav-menu a::after {
    background: var(--primary);
}

#nav-menu a:hover {
    background: rgba(79, 70, 229, 0.10);
    border-radius: 999px;
    transform: none;
}

/* Hero sections */
#hero,
.skills-hero,
.projects-hero,
.contact-hero,
.seo-hero,
#about-hero {
    background: var(--hero-gradient) !important;
    color: #fff;
}

/* Sections (remove alternating gray bands from old theme) */
.section:nth-child(odd),
.section:nth-child(even) {
    background: transparent;
}

.section::before {
    background:
        radial-gradient(ellipse at top, rgba(79, 70, 229, 0.06) 0%, transparent 60%),
        radial-gradient(ellipse at bottom, rgba(6, 182, 212, 0.05) 0%, transparent 60%);
    opacity: 1;
}

/* Cards / Surfaces */
.project-card,
.project-detail,
.skills-category,
.contact-form-container,
.contact-info,
.contact-info-card,
.seo-card,
.seo-toc {
    background: var(--card) !important;
    border: 1px solid var(--border) !important;
    box-shadow: var(--shadow) !important;
}

.project-card:hover,
.project-detail:hover,
.skills-category:hover {
    transform: translateY(-6px);
}

/* Buttons */
.btn-primary {
    background: var(--btn-gradient);
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.25);
    box-shadow: 0 14px 30px rgba(79, 70, 229, 0.25);
}

.btn-primary:hover {
    background: linear-gradient(135deg, #4338ca 0%, #0891b2 100%);
    transform: translateY(-3px) scale(1.03);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.10);
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.35);
}

/* On light sections, secondary button should be outlined */
.section:not(#hero):not(.skills-hero):not(.projects-hero):not(.contact-hero):not(.seo-hero):not(#about-hero) .btn-secondary {
    background: transparent;
    color: var(--primary);
    border: 2px solid rgba(79, 70, 229, 0.35);
}

.section:not(#hero):not(.skills-hero):not(.projects-hero):not(.contact-hero):not(.seo-hero):not(#about-hero) .btn-secondary:hover {
    background: rgba(79, 70, 229, 0.08);
    transform: translateY(-3px) scale(1.03);
}

/* Utility */
.cta-row {
    display: flex;
    justify-content: center;
    gap: 1rem;
    flex-wrap: wrap;
    margin-top: 3rem;
    text-align: center;
}

.mt-2 {
    margin-top: 2rem !important;
}

/* Floating shapes (new palette) */
.shape-1 {
    background: linear-gradient(135deg, rgba(79, 70, 229, 0.55), rgba(6, 182, 212, 0.45)) !important;
}

.shape-2 {
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.45), rgba(79, 70, 229, 0.40)) !important;
}

.shape-3 {
    background: linear-gradient(135deg, rgba(6, 182, 212, 0.35), rgba(79, 70, 229, 0.35)) !important;
}

.shape-4 {
    background: linear-gradient(135deg, rgba(15, 23, 42, 0.55), rgba(79, 70, 229, 0.35)) !important;
}

/* Background animation (aurora) */
@keyframes aurora-pan {
    0% {
        transform: translate3d(-4%, -3%, 0) scale(1);
        filter: blur(42px) hue-rotate(0deg);
    }
    50% {
        transform: translate3d(3%, 2%, 0) scale(1.05);
        filter: blur(48px) hue-rotate(10deg);
    }
    100% {
        transform: translate3d(4%, -2%, 0) scale(1.02);
        filter: blur(44px) hue-rotate(0deg);
    }
}

body::before {
    content: '';
    position: fixed;
    inset: -35%;
    z-index: -2;
    pointer-events: none;
    opacity: 0.65;
    background:
        radial-gradient(circle at 15% 35%, rgba(79, 70, 229, 0.55) 0%, transparent 55%),
        radial-gradient(circle at 70% 20%, rgba(6, 182, 212, 0.45) 0%, transparent 55%),
        radial-gradient(circle at 60% 85%, rgba(245, 158, 11, 0.35) 0%, transparent 60%);
    animation: aurora-pan 18s ease-in-out infinite;
}

@keyframes pattern-drift {
    0% { transform: translate(0, 0); }
    100% { transform: translate(50px, 50px); }
}

.pattern-overlay {
    opacity: 0.25;
    background-image:
        radial-gradient(circle at 2px 2px, rgba(255, 255, 255, 0.22) 1px, transparent 0);
    background-size: 44px 44px;
    animation: pattern-drift 28s linear infinite;
}

/* Respect reduced-motion preferences */
@media (prefers-reduced-motion: reduce) {
    body,
    main,
    .section,
    #main-header,
    footer,
    body::before,
    body::after,
    .pattern-overlay,
    .shape {
        animation: none !important;
        transition: none !important;
    }
}

/* Skills page (moved from skills.html <style>) */
.skills-container {
    max-width: 1000px;
    margin: 0 auto;
}

.skills-category {
    border-radius: 16px;
    padding: 2.25rem;
    margin-bottom: 2rem;
    transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.skills-category h3 {
    color: var(--text);
    margin-bottom: 1.25rem;
    padding-bottom: 0.75rem;
    border-bottom: 2px solid rgba(79, 70, 229, 0.25);
}

.skills-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.skill-item {
    background: linear-gradient(135deg, rgba(79, 70, 229, 0.12), rgba(6, 182, 212, 0.12));
    color: var(--text);
    padding: 0.7rem 1.15rem;
    border-radius: 999px;
    font-weight: 600;
    border: 1px solid rgba(15, 23, 42, 0.10);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.skill-item:hover {
    transform: translateY(-3px);
    box-shadow: 0 12px 24px rgba(79, 70, 229, 0.12);
}

.skills-desc {
    margin-top: 1.25rem;
    color: var(--muted);
    line-height: 1.8;
}

/* Projects page (moved from projects.html <style>) */
.project-detail {
    border-radius: 16px;
    overflow: hidden;
    margin-bottom: 2rem;
    transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.project-header {
    padding: 2rem;
    background: linear-gradient(135deg, rgba(79, 70, 229, 0.14), rgba(6, 182, 212, 0.12));
    border-bottom: 1px solid rgba(15, 23, 42, 0.08);
}

.project-header h3 {
    color: var(--text);
    margin-bottom: 0.5rem;
}

.project-subtitle {
    color: var(--muted);
}

.project-body {
    padding: 2rem;
    color: var(--text);
}

.tech-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 1rem;
}

.tech-tag {
    background: rgba(79, 70, 229, 0.08);
    color: #3730a3;
    padding: 0.4rem 0.95rem;
    border-radius: 999px;
    font-size: 0.9rem;
    font-weight: 600;
    border: 1px solid rgba(79, 70, 229, 0.18);
}

/* Contact page (moved from contact.html <style>) */
.contact-wrapper {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 3rem;
    max-width: 1000px;
    margin: 2rem auto 0;
}

.contact-info-card {
    padding: 1.75rem;
    border-radius: 16px;
}

.contact-info-card h3 {
    color: var(--text);
    margin-bottom: 1.25rem;
    padding-bottom: 0.75rem;
    border-bottom: 2px solid rgba(79, 70, 229, 0.25);
}

.info-item strong {
    color: var(--text);
}

.info-item a,
.info-item p {
    color: var(--muted);
}

.contact-note {
    color: var(--muted);
    margin-bottom: 1rem;
}

@media (max-width: 768px) {
    .contact-wrapper {
        grid-template-columns: 1fr;
        gap: 2rem;
    }
}

/* Footer */
footer {
    background: #0f172a;
    color: rgba(255, 255, 255, 0.8);
}

.footer-links a {
    color: rgba(255, 255, 255, 0.75);
}

.footer-links a:hover {
    color: #fff;
}
