:root {
    /* Burgundy Palette */
    --burgundy-50: #fef2f3;
    --burgundy-100: #fde3e6;
    --burgundy-200: #fcccd1;
    --burgundy-300: #f9a8b0;
    --burgundy-400: #f47581;
    --burgundy-500: #ea4959;
    --burgundy-600: #d62c3c;
    --burgundy-700: #b4212f;
    --burgundy-800: #901e29;
    --burgundy-900: #7c2029;
    --burgundy-950: #430c11;

    /* Neutral Grays */
    --gray-950: #0a0a0a;
    --gray-900: #121212;
    --gray-850: #18181b;
    --gray-800: #27272a;
    --gray-700: #3f3f46;

    /* Fonts */
    --font-main: 'Inter', sans-serif;
    --font-mono: 'JetBrains Mono', monospace;

    /* Default Theme (Dark) */
    --bg-main: var(--gray-900);
    --bg-gradient-start: var(--gray-850);
    --bg-gradient-end: var(--gray-950);
    
    --text-primary: #f4f4f5;
    --text-secondary: #a1a1aa;
    
    --card-bg: rgba(39, 39, 42, 0.6);
    --card-border: rgba(255, 255, 255, 0.08);
    --card-hover-bg: rgba(63, 63, 70, 0.8);
    --card-shadow: rgba(0,0,0,0.3);
    
    --accent: var(--burgundy-500); 

    --aurora-1: rgba(234, 73, 89, 0.15);
    --aurora-2: rgba(124, 32, 41, 0.1);
    --aurora-3: rgba(180, 33, 47, 0.1);
    
    --btn-bg: rgba(255,255,255,0.08);
    --btn-hover-bg: rgba(255,255,255,0.15);
    
    --progress-bg: rgba(255,255,255,0.1);
}

[data-theme="light"] {
    --bg-main: #ffffff;
    --bg-gradient-start: #fef2f3;
    --bg-gradient-end: #ffffff;

    --text-primary: #18181b;
    --text-secondary: #52525b;

    --card-bg: rgba(255, 255, 255, 0.8);
    --card-border: rgba(0, 0, 0, 0.08);
    --card-hover-bg: #ffffff;
    --card-shadow: rgba(0,0,0,0.1);

    --accent: var(--burgundy-600);

    --aurora-1: rgba(234, 73, 89, 0.08);
    --aurora-2: rgba(252, 204, 209, 0.4);
    --aurora-3: rgba(244, 117, 129, 0.1);
    
    --btn-bg: rgba(0,0,0,0.05);
    --btn-hover-bg: rgba(0,0,0,0.1);
    
    --progress-bg: rgba(0,0,0,0.05);
}

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

body {
    background-color: var(--bg-main);
    color: var(--text-primary);
    font-family: var(--font-main);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    transition: background-color 0.3s, color 0.3s;
    overflow-x: hidden;
}

/* --- Backgrounds --- */
.aurora-bg {
    position: fixed;
    top: -5%; 
    left: -5%; 
    width: 110%; 
    height: 110%;
    background: radial-gradient(at 50% 0%, var(--bg-gradient-start) 0%, var(--bg-gradient-end) 100%);
    z-index: -2;
    transition: background 0.3s, transform 0.1s linear;
}

.blob {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    opacity: 0.8;
    z-index: -1;
    animation: float 25s infinite ease-in-out alternate;
}

.blob-1 { top: -10%; left: -10%; width: 50vw; height: 50vw; background: var(--aurora-1); animation-duration: 30s; }
.blob-2 { bottom: -10%; right: -10%; width: 40vw; height: 40vw; background: var(--aurora-2); animation-duration: 35s; animation-delay: -5s; }
.blob-3 { bottom: 20%; left: 20%; width: 30vw; height: 30vw; background: var(--aurora-3); animation-duration: 28s; animation-delay: -15s; }

@keyframes float {
    0% { transform: translate(0, 0) scale(1); }
    100% { transform: translate(5%, 5%) scale(1.1); }
}

.noise-overlay {
    position: fixed;
    top: -50%; left: -50%; width: 200%; height: 200%;
    background: url('data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSI1MTIiIGhlaWdodD0iNTEyIj48ZmlsdGVyIGlkPSJub2lzZSI+PGZlVHVyYnVsZW5jZSB0eXBlPSJmcmFjdGFsTm9pc2UiIGJhc2VGcmVxdWVuY3k9IjAuNjUiIG51bU9jdGF2ZXM9IjMiIHN0aXRjaFRpbGVzPSJzdGl0Y2giLz48L2ZpbHRlcj48cmVjdCB3aWR0aD0iMTAwJSIgaGVpZ2h0PSIxMDAlIiBmaWx0ZXI9InVybCgjbm9pc2UpIiBvcGFjaXR5PSIwLjAzIi8+PC9zdmc+');
    opacity: 0.05;
    pointer-events: none;
    z-index: -1;
    animation: noise-grain 0.5s steps(3) infinite;
}

@keyframes noise-grain { 0% { transform: translate(0, 0); } 100% { transform: translate(10%, 10%); } }

/* --- Layout --- */
.app-header {
    position: fixed;
    top: 0; left: 0; width: 100%;
    display: flex; justify-content: space-between; align-items: center;
    padding: 20px 30px;
    z-index: 100;
    backdrop-filter: blur(5px);
    border-bottom: 1px solid transparent;
    transition: border-color 0.3s, background 0.3s;
}

.app-header.scrolled {
    border-bottom: 1px solid var(--card-border);
    background: var(--card-bg);
}

.brand-link {
    color: var(--text-secondary);
    text-decoration: none;
    display: flex; align-items: center; gap: 10px;
    font-family: var(--font-mono);
    font-weight: 700;
    font-size: 1.1rem;
}
.brand-icon-wrapper {
    width: 36px; height: 36px;
    display: flex; align-items: center; justify-content: center;
    background: var(--btn-bg);
    border-radius: 8px;
    border: 1px solid var(--card-border);
    color: var(--accent);
    transition: all 0.3s ease;
}
.brand-link:hover .brand-icon-wrapper {
    background: var(--accent);
    color: #fff;
    transform: rotate(-5deg) scale(1.1);
}
.brand-accent { color: var(--accent); }

/* --- Content --- */
.main-content {
    padding: 120px 20px 60px 20px;
    max-width: 1000px;
    margin: 0 auto;
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 100px;
}

/* Advanced Animations */
.fade-in-up {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.8s cubic-bezier(0.2, 0.8, 0.2, 1), transform 0.8s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.fade-in-up.visible {
    opacity: 1;
    transform: translateY(0);
}

.hero-section {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 40px;
}

.hero-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
}

.hero-text {
    flex: 1;
    max-width: 600px;
}

/* Mascot Container */
#mascot-container {
    width: 500px;
    height: 500px;
    position: relative;
    /* Slight glow behind mascot */
    filter: drop-shadow(0 0 20px rgba(234, 73, 89, 0.2));
}

/* Responsive Mascot */
@media (max-width: 768px) {
    .hero-content {
        flex-direction: column-reverse;
        text-align: center;
    }
    
    .hero-text {
        margin: 0 auto;
    }
    
    #mascot-container {
        width: 300px;
        height: 300px;
        margin-bottom: 20px;
    }
}

.hero-title {
    font-size: 3.5rem; 
    font-weight: 700; 
    margin-bottom: 10px;
    min-height: 1.2em;
}

.cursor {
    display: inline-block;
    margin-left: 2px;
    animation: blink 1s infinite;
    color: var(--accent);
}

@keyframes blink { 50% { opacity: 0; } }

.hero-subtitle {
    font-size: 1.2rem; color: var(--text-secondary); line-height: 1.6; 
    /* max-width removed here as parent handles it */
}

.section-title {
    font-size: 1.8rem; font-weight: 600; margin-bottom: 30px;
    display: flex; align-items: center; gap: 12px;
}
.section-title::after {
    content: ''; flex: 1; height: 1px; background: var(--card-border);
}

/* --- Glass Cards with Tilt --- */
.glass-card {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 24px;
    padding: 35px;
    backdrop-filter: blur(10px);
    transition: transform 0.1s linear, border-color 0.3s, box-shadow 0.3s; /* Fast transform for tilt */
    transform-style: preserve-3d;
    position: relative;
}

.glass-card:hover {
    border-color: var(--accent);
    box-shadow: 0 20px 50px var(--card-shadow);
}

/* --- Skills Progress Bars --- */
.skills-container {
    display: flex; flex-direction: column; gap: 25px;
}

.skill-bar-wrapper {
    width: 100%;
}

.skill-info {
    display: flex; justify-content: space-between; margin-bottom: 8px;
    font-family: var(--font-mono); font-size: 0.95rem; font-weight: 600;
    align-items: center;
}

.skill-name i {
    font-size: 1.2rem;
    margin-right: 8px;
    vertical-align: middle;
}

.skill-percent { color: var(--accent); }

.skill-bar-bg {
    width: 100%; height: 8px;
    background: var(--progress-bg);
    border-radius: 4px;
    overflow: hidden;
    position: relative;
}

.skill-bar-fill {
    height: 100%;
    background: var(--accent);
    width: 0; /* Animated via JS */
    border-radius: 4px;
    transition: width 1.5s cubic-bezier(0.22, 1, 0.36, 1);
    position: relative;
    box-shadow: 0 0 10px var(--accent);
}

/* Shine effect on progress bar */
.skill-bar-fill::after {
    content: ''; position: absolute; top: 0; left: 0; bottom: 0; right: 0;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
    transform: translateX(-100%);
    animation: shimmer 2s infinite;
}

@keyframes shimmer { 100% { transform: translateX(100%); } }

/* --- Projects Showcase Layout --- */
.projects-showcase {
    display: flex;
    flex-direction: column;
    gap: 100px;
    margin-top: 40px;
}

.project-row {
    display: flex;
    align-items: center;
    gap: 50px;
    position: relative;
}

/* Alternate layout */
.project-row:nth-child(even) {
    flex-direction: row-reverse;
}

/* Visual Side */
.project-visual {
    flex: 1.5;
    position: relative;
    border-radius: 20px;
    overflow: hidden;
    border: 1px solid var(--card-border);
    box-shadow: 0 20px 40px rgba(0,0,0,0.3);
    height: 340px; /* Fixed height for consistency */
}

.project-visual iframe {
    width: 100%;
    height: 100%;
    border: none;
    transition: transform 0.5s cubic-bezier(0.2, 0.8, 0.2, 1);
    filter: grayscale(20%) contrast(1.1);
    pointer-events: none; 
}

.project-visual:hover iframe {
    pointer-events: auto;
    transform: scale(1.02); 
    filter: grayscale(0%) contrast(1);
}

.project-visual img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s cubic-bezier(0.2, 0.8, 0.2, 1);
    filter: grayscale(20%) contrast(1.1);
}

.project-visual:hover img {
    transform: scale(1.05);
    filter: grayscale(0%) contrast(1);
}

.project-visual-split {
    flex: 1.5;
    display: flex;
    gap: 15px;
    height: 340px;
}

.project-visual-split img {
    width: calc(50% - 7.5px); /* Split space evenly */
    height: 100%;
    object-fit: cover; /* Or contain if you want to see full image without cropping */
    border-radius: 20px;
    border: 1px solid var(--card-border);
    box-shadow: 0 20px 40px rgba(0,0,0,0.3);
    transition: transform 0.5s cubic-bezier(0.2, 0.8, 0.2, 1), filter 0.5s ease;
    filter: grayscale(20%) contrast(1.1);
}

.project-visual-split img:hover {
    transform: scale(1.05);
    filter: grayscale(0%) contrast(1);
}

/* On mobile, stack them or keep side-by-side if small enough */
@media (max-width: 900px) {
    .project-visual-split {
        width: 100%;
        height: 250px;
        flex: none;
    }
}

/* Content Side */
.project-details {
    flex: 1;
    position: relative;
    z-index: 2;
    /* Extending the glass card style specifically for this layout */
    display: flex;
    flex-direction: column;
    gap: 15px;
    padding: 40px; /* More padding */
}

/* On mobile, stack them */
@media (max-width: 900px) {
    .project-row, .project-row:nth-child(even) {
        flex-direction: column;
        gap: 30px;
    }
    
    .project-visual {
        width: 100%;
        height: 250px;
        flex: none;
    }
    
    .project-details {
        width: 100%;
        flex: none;
    }
}

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

.project-tech-stack {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.project-tech-stack i {
    font-size: 1.5rem;
    transition: transform 0.2s;
}

.project-tech-stack i:hover {
    transform: scale(1.2);
}

.project-name { font-weight: 700; font-size: 1.5rem; color: var(--text-primary); }
.project-desc { font-size: 1rem; color: var(--text-secondary); flex: 1; line-height: 1.6; }

.project-links {
    display: flex;
    gap: 15px;
    margin-top: 10px;
}

.project-link-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 0.9rem;
    color: var(--text-secondary);
    text-decoration: none;
    transition: color 0.2s;
    font-weight: 600;
}

.project-link-btn:hover {
    color: var(--accent);
}

/* --- Experience Timeline --- */
.timeline-item {
    display: flex; gap: 25px; margin-bottom: 40px;
    position: relative;
}
.timeline-item:last-child { margin-bottom: 0; }

.timeline-marker {
    display: flex; flex-direction: column; align-items: center; gap: 10px;
}
.marker-dot {
    width: 14px; height: 14px; border-radius: 50%; background: var(--accent);
    box-shadow: 0 0 15px var(--accent);
    z-index: 2;
}
.marker-line {
    width: 2px; flex: 1; background: var(--card-border);
    position: relative;
}
/* Animated line fill could be added here but keeping it simple for performance */

.timeline-content {
    padding-bottom: 10px;
}
.role-title { font-weight: 700; font-size: 1.2rem; color: var(--text-primary); }
.role-period { font-size: 0.9rem; color: var(--accent); font-family: var(--font-mono); margin-bottom: 10px; display: block; }
.role-desc { font-size: 1rem; color: var(--text-secondary); line-height: 1.6; }

/* --- Contact --- */
.contact-links {
    display: flex; gap: 20px; flex-wrap: wrap;
}
.contact-btn {
    display: flex; align-items: center; gap: 10px;
    padding: 12px 24px;
    background: var(--btn-bg);
    border: 1px solid var(--card-border);
    border-radius: 12px;
    color: var(--text-primary);
    text-decoration: none;
    transition: all 0.3s ease;
    font-weight: 600;
    font-size: 1.05rem;
}
.contact-btn:hover {
    background: var(--accent);
    border-color: var(--accent);
    color: white;
    transform: translateY(-3px);
    box-shadow: 0 10px 20px var(--card-shadow);
}

/* --- Nav Buttons --- */
.nav-btn {
    background: transparent; border: none; cursor: pointer;
    color: var(--text-secondary); padding: 8px; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    transition: all 0.2s;
}
.nav-btn:hover { color: var(--text-primary); background: var(--btn-hover-bg); }
