:root {
    --bg-color: #0b0c10;
    --bg-image: url('dark-bg.jpg.jpeg');
    --text-color: #f8f9fa;
    --text-muted: #bbbbbb;
    --accent-color: #c5a880;
    --glass-bg: rgba(11, 12, 16, 0.85);
    --glass-border: rgba(197, 168, 128, 0.3);
    --nav-scrolled-bg: rgba(11, 12, 16, 0.95);
    --font-main: 'Outfit', sans-serif;
    
    /* Background Blur Controls (1 to 100) */
    --home-blur: 3;
    --portfolio-blur: 25;
}

body.light-mode {
    --bg-color: #f4f6f8;
    --bg-image: none;
    --text-color: #1a1a1a;
    --text-muted: #555555;
    --accent-color: #9c7b50;
    --glass-bg: rgba(255, 255, 255, 0.75);
    --glass-border: rgba(156, 123, 80, 0.25);
    --nav-scrolled-bg: rgba(244, 246, 248, 0.98);
}

.nav-right {
    display: flex;
    align-items: center;
    gap: 2rem;
}

/* Theme Toggle Button */
.theme-toggle-btn {
    background: transparent;
    border: none;
    border-radius: 50%;
    width: 35px;
    height: 35px;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    color: var(--text-color);
    font-size: 1.3rem;
    transition: all 0.3s ease;
    position: relative;
    top: -2px;
}

.theme-toggle-btn:hover {
    background: var(--glass-bg);
    transform: scale(1.1);
}

.theme-toggle-btn .icon-sun { display: none; }
.theme-toggle-btn .icon-moon { display: block; }

body.light-mode .theme-toggle-btn .icon-moon { display: none; }
body.light-mode .theme-toggle-btn .icon-sun { display: block; color: #d35400; }

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

body {
    background-color: var(--bg-color);
    background-image: var(--bg-image);
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
    color: var(--text-color);
    font-family: var(--font-main);
    line-height: 1.6;
    overflow-x: hidden;
}

/* Glassmorphism Utilities */
.glass-card {
    background: var(--glass-bg);
    backdrop-filter: blur(35px);
    -webkit-backdrop-filter: blur(35px);
    border: 1px solid var(--glass-border);
    border-radius: 15px;
    padding: 2rem;
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
}

.glass-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem 5%;
    background: var(--glass-bg);
    backdrop-filter: blur(35px);
    -webkit-backdrop-filter: blur(35px);
    border-bottom: 1px solid var(--glass-border);
    position: fixed;
    width: 100%;
    top: 0;
    z-index: 1000;
    transition: all 0.3s ease;
}

.glass-nav.nav-scrolled {
    padding: 1rem 5%;
    background: var(--nav-scrolled-bg);
    box-shadow: 0 4px 20px rgba(0,0,0,0.15);
}

.logo {
    font-size: 1.8rem;
    font-weight: 800;
    color: var(--text-color);
    letter-spacing: 2px;
    text-transform: uppercase;
    text-decoration: none;
}
.logo span {
    color: var(--accent-color);
}

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

.nav-links a {
    color: var(--text-color);
    text-decoration: none;
    font-weight: 400;
    font-size: 1.1rem;
    position: relative;
    transition: color 0.3s ease;
}

.nav-links a::after {
    content: '';
    position: absolute;
    width: 0;
    height: 2px;
    bottom: -5px;
    left: 0;
    background-color: var(--accent-color);
    transition: width 0.3s ease;
}

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

.nav-links a:hover::after {
    width: 100%;
}

.nav-links a.active {
    color: var(--text-color);
}

.nav-links a.active::after {
    width: 100%;
    background-color: var(--text-color);
}

/* Typography and Layout Elements */
.section-header {
    text-align: center;
    margin-bottom: 4rem;
}

.section-header h2 {
    font-size: 2.8rem;
    font-weight: 300;
    text-transform: uppercase;
    letter-spacing: 4px;
    margin-bottom: 0.5rem;
}

.separator {
    height: 2px;
    width: 80px;
    background: var(--accent-color);
    margin: 0 auto;
    border-radius: 2px;
}

/* Sections */
section {
    padding: 8rem 5% 5rem;
    min-height: 100vh;
}

body:not(.light-mode) #portfolio,
body:not(.light-mode):has(#portfolio.active-section) footer {
    backdrop-filter: blur(calc(var(--portfolio-blur) * 1px));
    -webkit-backdrop-filter: blur(calc(var(--portfolio-blur) * 1px));
    background: rgba(11, 12, 16, 0.6);
}

body:not(.light-mode) #hero,
body:not(.light-mode):has(#hero.active-section) footer {
    backdrop-filter: blur(calc(var(--home-blur) * 1px));
    -webkit-backdrop-filter: blur(calc(var(--home-blur) * 1px));
    background: rgba(11, 12, 16, 0.4);
}

/* Hybrid SPA Desktop Mode */
body.desktop-mode section {
    display: none;
    opacity: 0;
}

body.desktop-mode section#hero.active-section {
    display: flex;
    animation: fadeInSection 0.6s ease-out forwards;
}

body.desktop-mode section.active-section:not(#hero) {
    display: block;
    animation: fadeInSection 0.6s ease-out forwards;
}

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


/* Hero Section */
.hero {
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.hero-content {
    z-index: 2;
    max-width: 900px;
}

.hero-badge {
    display: inline-block;
    padding: 0.5rem 1.5rem;
    background: rgba(197, 168, 128, 0.15);
    color: var(--accent-color);
    border: 1px solid rgba(197, 168, 128, 0.3);
    border-radius: 30px;
    font-size: 0.9rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 2px;
    margin-bottom: 2rem;
    animation: fadeUp 1s ease-out;
}

.hero-content h1 {
    font-size: 5rem;
    font-weight: 800;
    line-height: 1.1;
    margin-bottom: 1.5rem;
    color: var(--text-color);
    animation: fadeUp 1s ease-out 0.1s both;
}

.hero-content p {
    font-size: 1.3rem;
    font-weight: 300;
    margin-bottom: 3rem;
    color: #aaa;
    animation: fadeUp 1s ease-out 0.2s both;
}

.hero-actions {
    display: flex;
    gap: 1.5rem;
    justify-content: center;
    margin-bottom: 4rem;
    animation: fadeUp 1s ease-out 0.4s both;
}

.cta-button {
    display: inline-block;
    padding: 1.2rem 3rem;
    background: var(--accent-color);
    color: var(--bg-color);
    border: none;
    border-radius: 30px;
    font-size: 1.1rem;
    font-weight: 600;
    text-transform: uppercase;
    text-decoration: none;
    letter-spacing: 1px;
    transition: all 0.3s ease;
    cursor: pointer;
}

.cta-button:hover {
    background: var(--text-color);
    box-shadow: 0 0 20px rgba(197, 168, 128, 0.4);
    transform: translateY(-3px);
}

.secondary-button {
    display: inline-block;
    padding: 1.2rem 3rem;
    background: transparent;
    color: var(--text-color);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 30px;
    font-size: 1.1rem;
    font-weight: 600;
    text-transform: uppercase;
    text-decoration: none;
    letter-spacing: 1px;
    transition: all 0.3s ease;
}

.secondary-button:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: var(--text-color);
    transform: translateY(-3px);
}

body.light-mode .secondary-button {
    border-color: rgba(0, 0, 0, 0.3);
}

body.light-mode .secondary-button:hover {
    background: rgba(0, 0, 0, 0.05);
}

.hero-stats {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 3rem;
    margin-top: 1rem;
    padding-top: 3rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    animation: fadeUp 1s ease-out 0.6s both;
}

.stat-item {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.stat-number {
    font-size: 2.5rem;
    font-weight: 800;
    color: var(--accent-color);
    line-height: 1;
    margin-bottom: 0.5rem;
}

.stat-label {
    font-size: 0.9rem;
    color: #888;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.stat-divider {
    width: 1px;
    height: 40px;
    background: rgba(255, 255, 255, 0.1);
}

/* Scroll Indicator */
.scroll-indicator {
    position: absolute;
    bottom: 40px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    opacity: 0.6;
    animation: bounce 2s infinite;
    z-index: 2;
}

.scroll-indicator span {
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 2px;
}

.mouse {
    width: 26px;
    height: 40px;
    border: 2px solid var(--text-color);
    border-radius: 15px;
    position: relative;
}

.mouse::before {
    content: '';
    position: absolute;
    top: 6px;
    left: 50%;
    transform: translateX(-50%);
    width: 4px;
    height: 8px;
    background: var(--accent-color);
    border-radius: 2px;
    animation: scrollMouse 2s infinite;
}

@keyframes bounce {
    0%, 20%, 50%, 80%, 100% { transform: translateY(0) translateX(-50%); }
    40% { transform: translateY(-10px) translateX(-50%); }
    60% { transform: translateY(-5px) translateX(-50%); }
}

@keyframes scrollMouse {
    0% { opacity: 1; transform: translateX(-50%) translateY(0); }
    100% { opacity: 0; transform: translateX(-50%) translateY(15px); }
}

/* Background Design */
.hero-background {
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle at 50% 50%, rgba(197, 168, 128, 0.1) 0%, transparent 40%);
    z-index: 1;
    animation: rotate 40s linear infinite;
    pointer-events: none;
}

/* About */
.about-content {
    max-width: 1100px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: 1.2fr 1fr;
    gap: 4rem;
    align-items: center;
}

.about-image-container {
    position: relative;
    width: 100%;
    max-width: 550px;
    margin: 0 auto;
    aspect-ratio: 1/1;
    padding: 0;
    overflow: hidden;
    display: flex;
    justify-content: center;
    align-items: center;
    border: 3px solid var(--accent-color);
    border-radius: 50%;
    background: transparent;
    box-shadow: 0 10px 30px rgba(0,0,0,0.15);
}

.placeholder-overlay {
    position: absolute;
    text-align: center;
    color: var(--accent-color);
    font-size: 1.2rem;
    font-weight: 300;
    z-index: 1;
}

.about-portrait {
    position: relative;
    z-index: 2;
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
    transform: scale(1.02); /* Fixes subpixel edge bleeding */
}

.about-portrait[src=""] {
    display: none;
}

.about-text h3 {
    color: var(--accent-color);
    font-size: 2rem;
    font-weight: 400;
    margin-bottom: 1.5rem;
}

.about-text p {
    margin-bottom: 1.5rem;
    font-size: 1.1rem;
    color: var(--text-muted);
}

/* Portfolio & Project List */
.project-list-view {
    display: flex;
    flex-direction: column;
    gap: 4rem;
    max-width: 1400px;
    margin: 0 auto;
}

.project-row {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.project-row h3 {
    font-size: 2rem;
    color: var(--text-color);
    padding-left: 1rem;
    border-left: 3px solid var(--accent-color);
    transition: color 0.3s ease;
    cursor: pointer;
}

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

.project-slider {
    display: flex;
    gap: 1.5rem;
    overflow-x: auto;
    padding: 1rem 0 1.5rem 0;
    scroll-behavior: smooth;
    scrollbar-width: thin;
    scrollbar-color: var(--accent-color) transparent;
}

.project-slider::-webkit-scrollbar {
    height: 6px;
}

.project-slider::-webkit-scrollbar-track {
    background: transparent;
}

.project-slider::-webkit-scrollbar-thumb {
    background-color: var(--accent-color);
    border-radius: 10px;
}

.slider-item {
    flex: 0 0 300px;
    height: 200px;
    border-radius: 8px;
    overflow: hidden;
    position: relative;
    transform: scale(0.98);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    cursor: pointer;
}

.slider-item:hover {
    transform: scale(1.08);
    box-shadow: 0 10px 25px rgba(0,0,0,0.6);
    z-index: 2;
}

.slider-item img, .slider-item video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: filter 0.3s ease;
}

/* Under Construction Styles */
.slider-item.under-construction {
    cursor: default;
}

.slider-item.under-construction:hover {
    transform: scale(0.98); /* Disable hover pop */
    box-shadow: none;
}

.slider-item.under-construction img,
.slider-item.under-construction video {
    filter: blur(6px);
}

.slider-item.under-construction::after {
    content: 'Coming Soon';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: var(--text-color);
    font-size: 1.5rem;
    font-weight: bold;
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    padding: 0.5rem 1.5rem;
    border-radius: 8px;
    backdrop-filter: blur(4px);
    z-index: 10;
    pointer-events: none;
    text-transform: uppercase;
    letter-spacing: 2px;
}

/* Project Detail View */
.project-detail-view {
    animation: fadeUp 0.5s ease-out;
}

.back-button {
    background: transparent;
    border: none;
    color: var(--accent-color);
    font-size: 1.1rem;
    font-family: var(--font-main);
    cursor: pointer;
    margin-bottom: 2rem;
    display: inline-flex;
    align-items: center;
    padding: 0.5rem 1rem;
    border-radius: 30px;
    transition: background 0.3s ease, transform 0.3s ease;
}

.back-button:hover {
    background: rgba(197, 168, 128, 0.1);
    transform: translateX(-5px);
}

.detail-layout {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 3rem;
    max-width: 1400px;
    margin: 0 auto;
    height: 75vh;
}

.detail-media-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 2.5rem;
    overflow-y: auto;
    padding: 1rem 2rem 1rem 1rem;
    align-content: start;
    /* Custom Scrollbar */
    scrollbar-width: thin;
    scrollbar-color: var(--accent-color) transparent;
}

.detail-media-list::-webkit-scrollbar {
    width: 6px;
}
.detail-media-list::-webkit-scrollbar-track {
    background: transparent;
}
.detail-media-list::-webkit-scrollbar-thumb {
    background-color: var(--accent-color);
    border-radius: 10px;
}

.detail-item {
    border-radius: 12px;
    overflow: hidden;
    aspect-ratio: 1;
    cursor: pointer;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    position: relative;
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
}

.detail-item:hover {
    transform: scale(1.03);
    box-shadow: 0 8px 25px rgba(0,0,0,0.4);
    z-index: 2;
}

body.light-mode .slider-item:hover,
body.light-mode .detail-item:hover {
    box-shadow: none;
}

.detail-item img, .detail-item video {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.detail-info {
    padding: 3rem;
    position: sticky;
    top: 0;
    height: fit-content;
    max-height: 100%;
    overflow-y: auto;
}

#detail-title {
    font-size: 2.5rem;
    color: var(--text-color);
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--glass-border);
}

.detail-desc-content {
    color: var(--text-muted);
    font-size: 1.1rem;
    line-height: 1.8;
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    z-index: 2000;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.95);
    backdrop-filter: blur(10px);
    justify-content: center;
    align-items: center;
}

.modal.active {
    display: flex;
}

.modal-content-wrapper {
    display: flex;
    max-width: 90vw;
    width: auto;
    height: 90vh;
    background: transparent;
    border-radius: 8px;
    overflow: hidden;
    animation: fadeUp 0.4s ease-out;
}

.modal-media {
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
}

.modal-media img, .modal-media video {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}



.close-modal {
    position: absolute;
    top: 30px;
    right: 50px;
    color: white;
    font-size: 3rem;
    font-weight: 300;
    cursor: pointer;
    transition: color 0.3s ease;
    z-index: 2001;
}

.close-modal:hover {
    color: var(--accent-color);
}

/* Contact */
.contact-container {
    display: grid;
    grid-template-columns: 1fr 1.5fr;
    gap: 4rem;
    max-width: 1100px;
    margin: 0 auto;
}

.contact-info h3 {
    margin-bottom: 2rem;
    color: var(--text-color);
    font-weight: 300;
    font-size: 2rem;
}

.contact-info p {
    margin-bottom: 1.5rem;
    font-size: 1.1rem;
    color: var(--text-muted);
}
.contact-info strong {
    color: var(--accent-color);
    font-weight: 400;
    display: block;
    margin-bottom: 0.3rem;
}

.contact-form {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.contact-form input, .contact-form textarea {
    width: 100%;
    padding: 1.2rem;
    background: transparent;
    border: 1px solid var(--glass-border);
    border-radius: 8px;
    color: var(--text-color);
    font-family: var(--font-main);
    font-size: 1rem;
    transition: all 0.3s ease;
}

.contact-form input:focus, .contact-form textarea:focus {
    outline: none;
    border-color: var(--accent-color);
    background: var(--glass-bg);
}

/* Footer */
footer {
    text-align: center;
    padding: 5rem 2rem 3rem 2rem;
    border-top: 1px solid var(--glass-border);
    margin-top: 0;
    color: var(--text-muted);
}

/* Animations */
@keyframes fadeUp {
    from {
        opacity: 0;
        transform: translateY(40px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes rotate {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* Responsive */
@media (max-width: 900px) {
    .contact-container {
        grid-template-columns: 1fr;
    }
    
    .about-content {
        display: flex;
        flex-direction: column-reverse;
        gap: 2rem;
    }
    
    .about-image-container {
        width: 80%;
        max-width: 500px;
        margin: 0 auto;
    }
    
    .modal-content-wrapper {
        flex-direction: column;
        height: 90vh;
    }
    .modal-media {
        flex: 1.5;
    }
    .modal-description {
        flex: 1;
        overflow-y: auto;
        border-left: none;
        border-top: 1px solid var(--glass-border);
        padding: 2rem;
    }
}

@media (max-width: 768px) {
    .modal-description {
        display: none;
    }
    
    body.project-active header,
    body.project-active footer,
    body.project-active section:not(#portfolio),
    body.project-active #portfolio .section-header {
        display: none !important;
    }
    
    body.project-active section#portfolio {
        padding-top: 1rem;
    }

    section {
        border-bottom: 1px solid var(--glass-border);
    }
    section:last-of-type {
        border-bottom: none;
    }
    .nav-links {
        display: none;
    }
    .detail-layout {
        display: flex;
        flex-direction: column-reverse;
        height: auto;
        gap: 2rem;
    }
    .detail-media-list {
        overflow-y: visible;
        padding: 0;
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
        gap: 1.5rem;
    }
    .detail-info {
        position: static;
        padding: 1.5rem 0;
    }
    .hero-content h1 {
        font-size: 3rem;
    }
    .hero-actions {
        flex-direction: column;
        gap: 1rem;
        margin-bottom: 3rem;
    }
    .hero-stats {
        gap: 1.5rem;
        padding-top: 2rem;
    }
    .stat-number {
        font-size: 1.8rem;
    }
    .stat-label {
        font-size: 0.75rem;
    }
}
