/* ================================
   GLOBAL RESET
================================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

/* ================================
   COLOR PALETTE SYSTEM
================================== */

/* Default Theme (Green Accent) */
:root[data-theme="default"] {
    --color-primary: hsl(158, 64%, 52%);
    --color-secondary: hsl(0, 0%, 75%);
    --color-surface-dark: hsl(220, 15%, 12%);
    --color-surface-medium: hsl(220, 15%, 16%);
    --color-light: hsl(0, 0%, 95%);
    --color-muted: hsl(0, 0%, 65%);
    --color-border-base: hsl(220, 12%, 25%);
    
    /* Backgrounds */
    --bg-gradient: linear-gradient(to bottom, rgba(31,41,55,0.95), rgba(31,41,55,0.98)),
                   linear-gradient(135deg, hsl(158, 64%, 30%), hsl(220, 15%, 15%));
    --footer-bg: rgba(31, 41, 55, 0.5);
}

/* Ocean Theme (Blue-Green) */
:root[data-theme="ocean"] {
    --color-primary: hsl(200, 80%, 55%);
    --color-secondary: hsl(180, 20%, 70%);
    --color-surface-dark: hsl(210, 25%, 12%);
    --color-surface-medium: hsl(210, 25%, 16%);
    --color-light: hsl(0, 0%, 98%);
    --color-muted: hsl(0, 0%, 70%);
    --color-border-base: hsl(210, 15%, 25%);
    
    --bg-gradient: linear-gradient(to bottom, rgba(11, 27, 48, 0.95), rgba(11, 27, 48, 0.98)),
                   linear-gradient(135deg, hsl(200, 80%, 25%), hsl(210, 30%, 15%));
    --footer-bg: rgba(11, 27, 48, 0.6);
}

/* Sunset Theme (Warm Orange/Gold) */
:root[data-theme="sunset"] {
    --color-primary: hsl(12, 80%, 60%);
    --color-secondary: hsl(45, 80%, 65%);
    --color-surface-dark: hsl(260, 20%, 12%);
    --color-surface-medium: hsl(260, 20%, 16%);
    --color-light: hsl(0, 0%, 98%);
    --color-muted: hsl(0, 0%, 70%);
    --color-border-base: hsl(260, 15%, 25%);
    
    --bg-gradient: linear-gradient(to bottom, rgba(56, 28, 28, 0.95), rgba(56, 28, 28, 0.98)),
                   linear-gradient(135deg, hsl(12, 70%, 25%), hsl(45, 70%, 15%));
    --footer-bg: rgba(56, 28, 28, 0.6);
}

/* Dark Mode (Neutral Desaturated) */
:root[data-theme="dark"] {
    --color-primary: hsl(158, 64%, 52%);
    --color-secondary: hsl(0, 0%, 60%);
    --color-surface-dark: hsl(220, 15%, 8%);
    --color-surface-medium: hsl(220, 15%, 12%);
    --color-light: hsl(0, 0%, 92%);
    --color-muted: hsl(0, 0%, 60%);
    --color-border-base: hsl(220, 12%, 18%);
    
    --bg-gradient: linear-gradient(to bottom, rgba(12, 12, 12, 0.95), rgba(12, 12, 12, 0.98)),
                   linear-gradient(135deg, hsl(220, 15%, 10%), hsl(220, 10%, 5%));
    --footer-bg: rgba(15, 15, 15, 0.6);
}

/* ================================
   BASE STYLE TOKENS
================================== */
:root {
    --color-bg: var(--color-surface-dark);
    --color-card: var(--color-surface-medium);
    --color-text: var(--color-light);
    --color-text-muted: var(--color-muted);
    --color-accent: var(--color-primary);
    --color-border: var(--color-border-base);
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    line-height: 1.6;
    overflow-x: hidden;
    background: var(--bg-gradient);
    background-attachment: fixed;
    color: var(--color-text);
    transition: background 0.6s ease, color 0.3s ease;
}

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

/* ================================
   HERO SECTION
================================== */
.hero {
    position: relative;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.hero-bg {
    position: absolute;
    inset: 0;
    z-index: 0;
    background: var(--bg-gradient);
    transition: background 0.6s ease;
}

.hero-bg::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(to bottom, rgba(16, 185, 129, 0.1), transparent);
}

.hero-content {
    position: relative;
    z-index: 10;
    text-align: center;
    padding: 5rem 1.5rem;
    max-width: 900px;
    animation: fadeInUp 0.7s ease-out;
}

.profile-img {
    width: 128px;
    height: 128px;
    border-radius: 50%;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    margin-bottom: 2rem;
}

.hero-title {
    font-size: clamp(3rem, 8vw, 5rem);
    font-weight: 700;
    background: linear-gradient(135deg, var(--color-primary), var(--color-secondary), var(--color-primary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 1rem;
    animation: fadeInUp 0.7s ease-out 0.1s both;
}

.hero-subtitle {
    font-size: clamp(1.25rem, 3vw, 1.75rem);
    color: var(--color-text-muted);
    margin-bottom: 1rem;
    animation: fadeInUp 0.7s ease-out 0.2s both;
}

.hero-bio {
    font-size: clamp(1rem, 2vw, 1.125rem);
    color: var(--color-text-muted);
    max-width: 700px;
    margin: 0 auto 2rem;
    line-height: 1.8;
    animation: fadeInUp 0.7s ease-out 0.3s both;
}

.hero-buttons {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
    animation: fadeInUp 0.7s ease-out 0.4s both;
}

/* ================================
   BUTTONS
================================== */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.875rem 2rem;
    border-radius: 0.75rem;
    font-size: 1rem;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border: 2px solid transparent;
}

.btn-primary {
    background: var(--color-primary);
    color: var(--color-bg);
    box-shadow: 0 0 40px rgba(16, 185, 129, 0.15);
}

.btn-primary:hover {
    background: var(--color-light);
    transform: translateY(-2px);
    box-shadow: 0 0 50px rgba(16, 185, 129, 0.25);
}

.btn-secondary {
    border-color: var(--color-secondary);
    color: var(--color-text);
}

.btn-secondary:hover {
    background: var(--color-primary);
    border-color: var(--color-primary);
}

/* ================================
   PROJECTS SECTION
================================== */
.projects-section {
    padding: 5rem 0;
}

.section-title {
    font-size: clamp(2.5rem, 5vw, 3.5rem);
    font-weight: 700;
    text-align: center;
    margin-bottom: 1rem;
    background: linear-gradient(135deg, var(--color-primary), var(--color-secondary), var(--color-primary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.section-subtitle {
    text-align: center;
    color: var(--color-text-muted);
    max-width: 700px;
    margin: 0 auto 3rem;
    font-size: 1.125rem;
}

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

.project-card {
    background: var(--color-card);
    border: 1px solid var(--color-primary);
    border-radius: 0.75rem;
    overflow: hidden;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    animation: fadeInUp 0.5s ease-out both;
}

.project-card:hover {
    border-color: var(--color-light)
    transform: translateY(-4px);
}

.project-image {
    position: relative;
    aspect-ratio: 16/10;
    overflow: hidden;
}

.project-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.project-card:hover .project-image img {
    transform: scale(1.1);
}

.project-content {
    padding: 1.5rem;
}

.project-content h3 {
    font-size: 1.25rem;
    margin-bottom: 0.5rem;
    color: var(--color-text);
    transition: color 0.3s;
}

.project-card:hover .project-content h3 {
    color: var(--color-primary);
}

.project-content p {
    color: var(--color-text-muted);
    font-size: 0.875rem;
    margin-bottom: 1rem;
    line-height: 1.6;
}

.project-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.tag {
    font-size: 0.75rem;
    padding: 0.375rem 0.75rem;
    border-radius: 9999px;
    background: var(--color-surface-dark);
    color: var(--color-accent);
    border: 1px solid var(--color-secondary);
}

.project-link {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    width: 100%;
    justify-content: center;
    padding: 0.75rem;
    border: 1px solid var(--color-primary);
    border-radius: 0.5rem;
    color: var(--color-text);
    text-decoration: none;
    transition: all 0.3s;
}

.project-link:hover {
    background: var(--color-accent);
    border-color: var(--color-primary);
}

.project-link svg {
    transition: transform 0.3s;
}

.project-link:hover svg {
    transform: translateX(4px);
}

/* ================================
   FOOTER
================================== */
.footer {
    background: rgba(31, 41, 55, 0.5);
    padding: 3rem 0;
    background: var(--footer-bg);
    border-top: 1px solid var(--color-border);
    transition: background 0.6s ease, border-color 0.3s ease;
}

.footer-title {
    font-size: 2rem;
    text-align: center;
    margin-bottom: 1rem;
    background: linear-gradient(135deg, var(--color-primary), var(--color-secondary), var(--color-primary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.footer-subtitle {
    text-align: center;
    color: var(--color-text-muted);
    max-width: 700px;
    margin: 0 auto 2rem;
}

.social-links {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin-bottom: 2rem;
}

.social-links a {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    border: 1px solid var(--color-primary);
    border-radius: 0.5rem;
    color: var(--color-text);
    transition: all 0.3s;
}

.social-links a:hover {
    background: rgba(16, 185, 129, 0.1);
    border-color: var(--color-primary);
    transform: translateY(-2px);
}

.footer-bottom {
    border-top: 1px solid var(--color-border);
    padding-top: 2rem;
    text-align: center;
}

.footer-bottom p {
    color: var(--color-text-muted);
    font-size: 0.875rem;
}

/* ================================
   LIGHTBOX
================================== */
.lightbox {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(31, 41, 55, 0.95);
    z-index: 1000;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    cursor: pointer;
}

.lightbox.active {
    display: flex;
}

.lightbox img {
    max-width: 90%;
    max-height: 90vh;
    border-radius: 0.75rem;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.8);
}

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

/* ================================
   RESPONSIVE
================================== */
@media (max-width: 768px) {
    .hero-content {
        padding: 3rem 1rem;
    }

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

    .social-links {
        flex-wrap: wrap;
    }
}

.theme-selector {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin-top: 1rem;
    flex-wrap: wrap;
}

.theme-btn {
    background: var(--color-card);
    border: 1px solid var(--color-border);
    border-radius: 9999px;
    padding: 0.5rem 1rem;
    color: var(--color-text);
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.theme-btn:hover {
    border-color: var(--color-primary);
    transform: translateY(-2px);
}

.theme-color {
    width: 1rem;
    height: 1rem;
    border-radius: 50%;
    display: inline-block;
    border: 2px solid rgba(255,255,255,0.3);
}
