/* ====== BASE STYLES & VARIABLES ====== */
:root {
    --primary-color: #9a6f87; 
    --accent-red: #D12D01; /* High contrast red requested */
    --text-color: #333333;
    --bg-color: #fdfdfd;
    --border-color: #c9b4c3;
    --font-heading: 'Playfair Display', serif;
    --font-body: 'Georgia', 'Times New Roman', Times, serif;
    --card-outline-color: #9a6f87; /*outline*/
    --card-inner-box-border-color: rgba(154, 111, 135, 0.3); /*sub-stroke*/
}

/* --- CUSTOM SCROLLBAR & SMOOTH SCROLL --- */
html {
    scroll-behavior: smooth;
}

::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: var(--bg-color);
}

::-webkit-scrollbar-thumb {
    background: var(--primary-pink);
    border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--accent-red);
}

/* --- SCROLL REVEAL ANIMATIONS --- */
.reveal-on-scroll {
    opacity: 50;
    transform: translateY(40px);
    transition: opacity 2s ease-out, transform 8s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.reveal-on-scroll.is-visible {
    opacity: 1;
    transform: translateY(0);
}


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

body {
    background-color: var(--bg-color);
    color: var(--text-color);
    font-family: var(--font-body);
    line-height: 1.6;
    overflow-x: hidden;
}

a {
    text-decoration: none;
    color: inherit;
}

/* ====== NAVBAR ====== */
#navbar {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    width: 95%;
    max-width: 1100px;
    z-index: 1000;
    transition: transform 0.4s cubic-bezier(0.3, 1, 0.3, 1);
}

.nav-content {
    position: relative;
    height: 63px;
    background: rgba(253, 253, 253, 0.4);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(25px); 
    border: 1px solid rgba(201, 180, 195, 0.5);
    border-radius: 50px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 35px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.03);
}

/* The new centered pill container */
.nav-center {
    position: absolute;
    height: 38px;
    left: 50%;
    transform: translateX(-50%); /* This guarantees it is mathematically dead-center */
    background: rgba(201, 180, 195, 0.15); /* Same soft background as the buttons */
    border: 1px solid rgba(201, 180, 195, 0.5);
    border-radius: 50px;
    padding: 8px 40px;
    display: flex;
    align-items: center;
    margin-left: 15px;
}

.nav-right {
    display: flex;
    align-items: center;
    gap: 25px;
}

.logo {
    font-family: var(--font-heading);
    color: var(--primary-color);
    font-weight: 540;
    font-size: 0.95rem;
    letter-spacing: 1px;
    transition: opacity 0.3s ease;
}

.mobile-logo {
    display: none; /* Hidden on desktop */
}

.logo:hover {
    opacity: 0.7;
}

.nav-links {
    list-style: none;
    display: flex;
    gap: 35px;
    align-items: center;
}

.nav-links a {
    font-family: var(--font-body);
    font-size: 0.8rem;
    color: var(--primary-color);
    letter-spacing: 0px;
    text-transform: uppercase;
    transition: color 0.3s ease;
}

.nav-links a:hover, .nav-links a.active {
    color: var(--accent-red);
    opacity: 1;
    
}

.resume-circle {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: rgba(201, 180, 195, 0.15);
    border: 1px solid rgba(201, 180, 195, 0.5);
    color: var(--primary-color);
    font-size: 1.1rem;
    transition: all 0.3s ease;
}

.resume-circle:hover {
    background: var(--accent-red);
    border-color: var(--accent-red);
    color: white;
    transform: scale(1.05);
}

/* ====== PAGE SECTIONS (Scaled up) ====== */
main {
    max-width: 1200px; /* Scaled up from 1100px */
    margin: 0 auto;
    padding: 150px 20px 100px 20px;
    min-height: 80vh;
}

.page-section {
    display: none; 
    animation: fadeIn 0.6s ease forwards;
}

.page-section.active {
    display: block; 
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(15px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ====== GRADIENT TEXT ====== */
.gradient-text {
    background: linear-gradient(0deg, #9e4127d9 0%, #A16DB4 100%); 
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    color: transparent;
    display: inline-block;
}

/* ====== HOME PAGE ====== */
.hero {
    margin-bottom: 90px;
}

.hero h1 {
    font-family: var(--font-heading);
    font-size: 4.2rem; /* Scaled up */
    font-weight: 400;
    line-height: 1.2;
    margin-bottom: 25px;
}

.hero p {
    color: #9E4027; /* Neutral tone for subtitle */
    font-size: 1.1rem;
}

.section-divider {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-top: 1px solid var(--border-color);
    padding-top: 10px;
    margin-bottom: 50px;
    color: var(--primary-color);
    font-family: var(--font-heading);
    font-size: 1.2rem;
}

/* Projects Grid - Subtle premium interactions */
/* Projects Grid - Premium multi-border interaction */
.projects-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 40px;
}

.project-card {
    display: block;
    /* Pronounced border on the overall box per Figma frame design */
    border: 2px solid var(--card-outline-color); 
    border-radius: 12px;
    padding: 0; /* Important: remove overall padding per Figma design */
    text-align: center;
    position: relative;
    background: #fff;
    transition: transform 0.4s ease, box-shadow 0.4s ease, border-color 0.4s ease;
    overflow: hidden; /* For the rounded inner corners to feel perfect */
    z-index: 1;
}

.project-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 15px 35px rgba(154, 111, 135, 0);
    /* border-color change on hover isn't per Figma, */
}

.project-card::before {
    content: '';
    position: absolute;
    top: 5%; left: 5%; right: 5%; bottom: 5%;
    background: var(--hover-glow, rgba(199, 145, 204, 0.179)); /* Fallback color */
    filter: blur(25px);
    opacity: 0;
    z-index: -1;
    transition: opacity 0.5s ease, transform 0.5s ease;
    border-radius: 12px;
}

.project-card:hover::before {
    opacity: 1;
    transform: scale(0.9);
}


/* Renamed from .img-placeholder per the new design structure */
/* This container holds the mockup and tags within a light sub-stroke box per Figma frame */
.project-top-container {
    width: calc(100% - 40px); /* substitute padding per Figma design */
    margin: 20px auto; /* Margin to create space from main box outline */
    height: 300px; /* Scaled up height per previous request */
    background-color: #fff; /* White background per Figma design */
    border: 1px solid var(--card-inner-box-border-color); /* The light sub-stroke per Figma frame */
    border-radius: 10px; /* Very rounded inner corners per Figma frame */
    display: flex;
    align-items: center;
    justify-content: center;
    color: #999;
    font-family: sans-serif;
    font-size: 0.9rem;
    overflow: hidden;
    position: relative;
}

.project-top-container img {
    width: 100%;
    height: 100%;
    object-fit: contain; /* Contain the mockups within the frame, very important! */
    padding: 20px; /* Add padding *inside* the sub-box to center the mockup frame nicely */
    transition: transform 0.5s ease;
}

.project-card:hover .project-top-container img {
    transform: scale(1.03); /* Subtle image zoom effect on entire mockup per frame */
}

/* Updated details rules to center text and add space from the main outline per design */
.project-card h3 {
    font-family: var(--font-heading);
    font-weight: 500;
    font-size: 2rem;
    color: #333;
    margin: 0 0 5px 0; /* Updated margins */
    padding: 0 15px; /* Add horizontal padding per Figma design frame */
    transition: color 0.3s ease;
}

.project-card:hover h3 {
    color: var(--accent-red);
}

.project-card .subtitle {
    font-size: 0.9rem;
    color: #666;
    margin: 0 0 15px 0;
    padding: 0 15px; /* Add horizontal padding */
}

.project-card .desc {
    font-size: 0.95rem;
    color: #555;
    margin: 0 0 25px 0;
    padding: 0 15px; /* Add horizontal padding */
}

.tags {
    display: flex;
    justify-content: center;
    gap: 10px;
    padding: 0 15px 20px 15px; /* Add bottom padding to the *whole* tags block per Figma frame */
}

.tag {
    background-color: var(--accent-red);
    color: white;
    font-family: sans-serif;
    font-size: 0.65rem;
    font-weight: bold;
    padding: 6px 14px;
    border-radius: 20px;
    letter-spacing: 0.5px;
}

.github-icon {
    position: absolute;
    top: 35px;
    right: 35px;
    font-size: 1.6rem;
    color: #333;
    background: rgba(255,255,255,0.8);
    border-radius: 50%;
    width: 35px; height: 35px;
    display: flex; align-items: center; justify-content: center;
    z-index: 10;
}

/* ====== ARCHIVE PAGE ====== */
.archive-hero h1 {
    font-family: var(--font-heading);
    font-size: 4rem;
    font-style: italic;
    font-weight: 400;
    margin-bottom: 80px;
}

.coming-soon {
    text-align: center;
    margin-top: 80px;
    color: #555;
}

.coming-soon i {
    font-size: 5rem;
    color: #444;
    margin-bottom: 20px;
}

.coming-soon h2 {
    font-family: var(--font-heading);
    font-weight: 400;
    font-size: 2rem;
    font-style: italic;
}

/* --- DOUBLE-ICON THEME TOGGLE --- */
.theme-switch {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: space-between;
    left: 20px;
    width: 72px;
    height: 38px;
    background: rgba(201, 180, 195, 0.2);
    border: 1px solid rgba(201, 180, 195, 0.5);
    border-radius: 50px;
    padding: 0 10px;
    cursor: pointer;
    transition: background 0.3s ease;
    margin-right: 10px; /* Space between toggle and resume button */
}

.theme-switch .light-icon {
    font-size: 1rem;
    color: #ffffff;
    z-index: 1; /* Keeps icons above the slider */
    transition: color 0.3s ease;
}

.theme-switch .dark-icon {
    font-size: 1rem;
    color: #c9c9c9;
    z-index: 1; /* Keeps icons above the slider */
    transition: color 0.3s ease;
}

/* The sliding circle */
.switch-thumb {
    position: absolute;
    top: 0px;
    left: 0px;
    width: 38px;
    height: 38px;
    background: #b6b6b6;;
    border-radius: 50%;
    transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    z-index: 0;
}

/* Make the active icon white so it pops against the colored circle */
body:not(.dark-mode) .theme-switch .light-icon {
    color: #000000; 
}

/* --- DARK MODE THEME --- */
/* --- DARK MODE OVERRIDES FOR TOGGLE --- */
body.dark-mode .theme-switch {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.2);
}

/* Move the circle to the moon side */
body.dark-mode .switch-thumb {
    transform: translateX(34px); 
    background: #e0e0e0;
}

/* Contrast colors for icons in dark mode */
body.dark-mode .theme-switch .dark-icon {
    color: #121212; /* Dark moon inside white circle */
}

body.dark-mode .theme-switch .light-icon {
    color: #393939; /* Light sun outside circle */
}

body.dark-mode {
    --bg-color: #121212e3;
    --text-color: #ffffff;
    --navbar-bg: rgba(18, 18, 18, 0.5);
    --border-pink: rgba(217, 78, 42, 0.3);
    --camera-body-color: #2a2a2a;
    --card-outline-color: #444;
}

body.dark-mode .nav-content {
    background:rgba(212, 212, 212, 0.067);
}

body.dark-mode .project-card {
    background: #4d4d4d;
    border: 2px solid #8a8a8a; 
}

body.dark-mode .img-placeholder, 
body.dark-mode .project-top-container {
    background: #6b6b6b;
}

body.dark-mode .project-card h3, 
body.dark-mode .subtitle, 
body.dark-mode .desc {
    color: #ffffffd5;
}

body.dark-mode .project-card:hover h3 {
    color: hsla(0, 100%, 61%, 0.835);
}

body.dark-mode .showcase-title {
    color: #ffffffd5;
}

body.dark-mode .showcase-desc {
    color: #ffffff9f;
}

body.dark-mode .about-text {
    color: #ffffff9f;
}

body.dark-mode .swipe-hint {
    color: #ffffff9f;
}

body.dark-mode .fa-brands.fa-linkedin,
body.dark-mode .fa-solid.fa-envelope {
    color: #ffffff9f;
}

body.dark-mode .footer-feel-free h4 {
    color: #ffffff;
}

/* ====== FOOTER ====== */
footer {
    border-top: 1px solid #e0e0e0;
    padding: 60px 5% 40px 5%;
    background-color: var(--bg-color);
}

.footer-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 1200px;
    margin: 0 auto;
}

.footer-feel-free h4 {
    font-family: var(--font-heading);
    font-weight: 600;
    font-size: 1.1rem;
    color: #000;
}

.footer-nav {
    display: flex;
    gap: 30px;
}

.footer-nav a {
    font-size: 0.8rem;
    font-weight: bold;
    letter-spacing: 1px;
    transition: color 0.3s;
}

.footer-nav a:hover {
    color: var(--accent-red);
}

.footer-line {
    max-width: 1200px;
    margin: 30px auto;
    height: 1px;
    background-color: #ccc;
}

.footer-bottom {
    display: flex;
    justify-content: space-between;
    max-width: 1200px;
    margin: 0 auto;
    font-size: 0.85rem;
    color: #555;
}

/* ====== RESPONSIVE DESIGN ====== */
@media (max-width: 768px) {
    .projects-grid {
        grid-template-columns: 1fr;
    }

    .hero h1, .archive-hero h1 {
        font-size: 3rem;
    }
    

    /* --- MOBILE NAVBAR: SINGLE ROW --- */
    
    /* Swap the logo text */
    .desktop-logo { display: none; }
    .mobile-logo { display: inline-block; font-size: 0.95rem; font-weight: 550; letter-spacing: 0; margin-left: 5px;}

    /* Force single row layout */
    .nav-content {
        flex-direction: row; 
        justify-content: space-between;
        height: 50px;
        padding: 8px 15px; /* Tighter outer padding */
    }
    
    /* Keep center pill inline */
    .nav-center {
        position: static; /* Removes absolute centering so it doesn't overlap */
        transform: none;
        width: auto;
        height: 26px;
        font-size: 0.65rem;
        padding: 0px 20px; /* Tighter inner pill padding */
        margin-left: 35px;
        margin-right: 5px;
    }

    .nav-links {
        gap: 18px; /* Closer links */
        font-size: xx-small;
    }

    .nav-links a {
        font-size: xx-small; /* Slightly smaller text to fit */
    }

    /* Right icons inline */
    .nav-right {
        flex-direction: row;
        gap: 8px; /* Tighter gap between toggle and resume button */
        width: auto;
    }

    /* Shrink the toggle pill slightly for mobile */
    .theme-switch {
        width: 30px; 
        height: 28px;
        left: 12px;
        padding: 0px;
        justify-content: center;
    }

    .switch-thumb {
        display: none;  
    }

    /* LIGHT MODE: Hide the moon, show the sun */
    body:not(.dark-mode) .theme-switch .dark-icon {
        display: none;
    }
    
    body:not(.dark-mode) .theme-switch .light-icon {
        color: var(--primary-pink); /* Resets to pink (it was white on desktop) */
    }

    /* DARK MODE: Hide the sun, show the moon */
    body.dark-mode .theme-switch .light-icon {
        display: none;
    }
    
    body.dark-mode .theme-switch .dark-icon {
        display: block;
        color: #e0e0e0;
    }

    /* Shrink the resume circle slightly */
    .resume-circle {
        width: 30px;
        height: 28px;
        margin-right: 5px;
        font-size: 0.9rem;
    }

    .theme-switch .light-icon {
    font-size: 0.85rem;
    color: #ffffff;
    z-index: 1; /* Keeps icons above the slider */
    transition: color 0.3s ease;
}

    .theme-switch .dark-icon {
    font-size: 0.85rem;
    color: #c9c9c9;
    z-index: 1; /* Keeps icons above the slider */
    transition: color 0.3s ease;
}

    .github-icon .fa-brands.fa-github {
        margin-left: 0%;
    }

    .about-container {
        flex-direction: column;
    }

    .about-cursive-text {
        position: relative;
        transform: none;
        left: 0;
        text-align: center;
        margin: 20px 0;
        font-size: 5rem;
    }

    .about-text {
        padding-left: 0;
        padding-top: 0;
    }

    .footer-top, .footer-bottom {
        flex-direction: column;
        gap: 20px;
        text-align: center;
    }
}