/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-color: #0284c7;
    --secondary-color: #0369a1;
    --text-color: #1f2937;
    --light-bg: #f9fafb;
    --white: #ffffff;
    --gray: #6b7280;
    --max-width: 1200px;
}

body {
    font-family: 'Open Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    line-height: 1.6;
    color: var(--text-color);
}

.container {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 20px;
}

/* Header and Navigation */
header {
    background: var(--white);
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    position: sticky;
    top: 0;
    z-index: 100;
}

nav .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 20px;
}

.logo-link {
    text-decoration: none;
}

.logo {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary-color);
    margin: 0;
}

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

.nav-links a {
    text-decoration: none;
    color: var(--text-color);
    font-weight: 500;
    transition: color 0.3s;
}

.nav-links a:hover {
    color: var(--primary-color);
}

/* Hero Section */
.hero {
    position: relative;
    color: var(--white);
    padding: 4rem 0;
    text-align: center;
    overflow: hidden;
    background: #0891b2;
}

.hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(-45deg, #0ea5e9, #06b6d4, #14b8a6, #10b981, #0891b2);
    background-size: 400% 400%;
    animation: gradientMorph1 12s ease infinite;
    opacity: 0.9;
}

.hero::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(45deg, rgba(6, 182, 212, 0.6), rgba(20, 184, 166, 0.6), rgba(16, 185, 129, 0.6));
    background-size: 300% 300%;
    animation: gradientMorph2 18s ease infinite;
}

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

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

.hero-content {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.5rem;
}

.profile-photo {
    width: 200px;
    height: 200px;
    border-radius: 50%;
    object-fit: cover;
    border: 5px solid var(--white);
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}

.hero h2 {
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
}

.hero p {
    font-size: 1.25rem;
    opacity: 0.95;
}

.hero-maze-canvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    pointer-events: none;
}

/* Mini hero for subpages */
.hero-mini {
    padding: 2.5rem 0;
}

.hero-mini .hero-content {
    gap: 0.75rem;
}

.hero-mini h1 {
    font-size: 2.5rem;
    margin: 0;
}

.hero-mini p {
    font-size: 1.15rem;
    opacity: 0.95;
    margin: 0;
}

/* Sections */
.section {
    padding: 4rem 0;
}

.section:nth-child(even) {
    background: var(--light-bg);
}

.section h2 {
    font-size: 2rem;
    margin-bottom: 1.5rem;
    color: var(--primary-color);
}

.about-content {
    max-width: 800px;
    margin: 0 auto;
}

.about-content p {
    margin-bottom: 1.25rem;
    font-size: 1.05rem;
    line-height: 1.7;
}

.about-content a {
    color: var(--primary-color);
    text-decoration: none;
    border-bottom: 1px solid transparent;
    transition: border-color 0.3s;
}

.about-content a:hover {
    border-bottom-color: var(--primary-color);
}

/* Projects Grid */
.projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 2rem;
    margin-top: 2rem;
}

.project-card {
    background: var(--white);
    padding: 0;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    transition: transform 0.3s, box-shadow 0.3s;
    text-decoration: none;
    color: inherit;
    display: block;
    overflow: hidden;
}

.project-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 8px 16px rgba(0,0,0,0.2);
}

.project-thumbnail {
    height: 180px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.project-icon {
    font-size: 4rem;
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.2));
}

.project-icon-img {
    width: 80px;
    height: 80px;
    object-fit: contain;
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.2));
}

.project-icon-img-bg {
    background: white;
    border-radius: 8px;
    padding: 8px;
}

.gradient-1 {
    background: linear-gradient(135deg, #0ea5e9, #06b6d4);
}

.gradient-2 {
    background: linear-gradient(135deg, #14b8a6, #10b981);
}

.gradient-3 {
    background: linear-gradient(135deg, #0891b2, #0ea5e9);
}

.gradient-4 {
    background: linear-gradient(135deg, #06b6d4, #14b8a6);
}

.gradient-5 {
    background: linear-gradient(135deg, #10b981, #059669);
}

.gradient-6 {
    background: linear-gradient(135deg, #0ea5e9, #0891b2);
}

.gradient-7 {
    background: linear-gradient(135deg, #14b8a6, #0891b2);
}

.gradient-8 {
    background: linear-gradient(135deg, #0891b2, #10b981);
}

.gradient-9 {
    background: linear-gradient(135deg, #06b6d4, #10b981);
}

.gradient-10 {
    background: linear-gradient(135deg, #10b981, #14b8a6);
}

.gradient-11 {
    background: linear-gradient(135deg, #0ea5e9, #14b8a6);
}

.project-card h3 {
    color: var(--primary-color);
    margin: 1.5rem 1.5rem 0.75rem 1.5rem;
    font-size: 1.25rem;
}

.project-card p {
    margin: 0 1.5rem 1.5rem 1.5rem;
    color: var(--gray);
    font-size: 0.95rem;
    line-height: 1.5;
}

/* Call to Action Button */
.cta-button {
    display: inline-block;
    padding: 0.75rem 2rem;
    margin-top: 1rem;
    background: var(--primary-color);
    color: var(--white);
    text-decoration: none;
    border-radius: 6px;
    font-weight: 600;
    transition: background 0.3s, transform 0.2s;
}

.cta-button:hover {
    background: var(--secondary-color);
    transform: translateY(-2px);
}

.content-section {
    max-width: 800px;
    margin: 0 auto;
    padding: 2rem;
    background: var(--light-bg);
    border-radius: 8px;
}

/* Footer */
footer {
    position: relative;
    color: var(--white);
    text-align: center;
    padding: 2rem 0;
    overflow: hidden;
    background: #0891b2;
}

footer::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(-45deg, #0ea5e9, #06b6d4, #14b8a6, #10b981, #0891b2);
    background-size: 400% 400%;
    animation: gradientMorph1 12s ease infinite;
    opacity: 0.9;
}

footer::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(45deg, rgba(6, 182, 212, 0.6), rgba(20, 184, 166, 0.6), rgba(16, 185, 129, 0.6));
    background-size: 300% 300%;
    animation: gradientMorph2 18s ease infinite;
}

footer .container {
    position: relative;
    z-index: 1;
}

/* Footer chase animation */
.footer-chase {
    position: absolute;
    bottom: 8px;
    left: 0;
    width: 100%;
    height: 2rem;
    z-index: 1;
    overflow: hidden;
    pointer-events: none;
}

.chase-track {
    position: relative;
    width: 100%;
    height: 100%;
}

.runner, .chaser {
    position: absolute;
    font-size: 1.5rem;
    animation: runAcross 8s linear infinite;
}

.runner {
    animation-delay: 0s;
}

.chaser {
    animation-delay: 0.4s;
}

@keyframes runAcross {
    0% {
        left: -2rem;
        transform: scaleX(1);
    }
    45% {
        left: calc(100% + 0.5rem);
        transform: scaleX(1);
    }
    50% {
        left: calc(100% + 0.5rem);
        transform: scaleX(-1);
    }
    95% {
        left: -2rem;
        transform: scaleX(-1);
    }
    100% {
        left: -2rem;
        transform: scaleX(1);
    }
}

/* Responsive Design */
@media (max-width: 768px) {
    .nav-links {
        gap: 1rem;
    }

    .hero h2 {
        font-size: 2rem;
    }

    .profile-photo {
        width: 150px;
        height: 150px;
    }

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