:root {
    --bg-color: #0c020f;
    --text-color: #ffffff;
    --accent-color: #ff6600;
    --secondary-bg: #1e1e1e;
}

/* Reset and base styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    scroll-snap-type: y proximity;
    scrollbar-width: none; /* Firefox */
    scrollbar-color: var(--accent-color) var(--bg-color);
}

body {
    font-family: 'Cinzel', serif;
    line-height: 1.6;
    color: var(--text-color);
    background-color: var(--bg-color);
    overflow-y: auto;
}

/* --- Dynamic Scroll Snap Elements --- */
.hero-image, .project-intro, .description-section, .featured {
    scroll-snap-align: start;
}

.social-bar, .news, .masquerade, .contact, .project, footer {
    scroll-snap-align: none !important;
}

/* --- Custom Scrollbar (WebKit) --- */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: #140519; border-left: 1px solid rgba(255, 255, 255, 0.05); }
::-webkit-scrollbar-thumb { background: linear-gradient(180deg, #32174D, var(--accent-color)); border-radius: 5px; border: 2px solid #140519; }
::-webkit-scrollbar-thumb:hover { background: #ffcc00; }

/* ==========================================================================
   FIXED STICKY HEADER & ANIMATION
   ========================================================================== */
.sticky-header {
    position: fixed;
    top: 40px;
    left: 0;
    right: 0;
    width: 100%;
    z-index: 1000;
    padding: 0 40px;
    transition: top 0.6s cubic-bezier(0.4, 0, 0.2, 1), padding 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.sticky-header .container-xl {
    max-width: 1000px;
    margin: 0 auto;
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-radius: 4px;
    padding: 10px 40px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-shadow: 0 4px 15px rgba(0,0,0,0.4);
    transition: all 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.sticky-header.scrolled { top: 0; padding: 0; }
.sticky-header.scrolled .container-xl {
    max-width: 100%;
    border-radius: 0;
    padding: 15px 40px;
    background: rgba(0, 0, 0, 1);
}

.sticky-header .logo {
    display: flex;
    align-items: center;
    gap: 12px;
    transition: all 0.6s cubic-bezier(0.4, 0, 0.2, 1);
    padding: 0 10px;
}

.sticky-header .logo a {
    font-family: 'Cinzel Decorative', serif;
    font-size: 24px;
    font-weight: bold;
    color: white;
    text-decoration: none;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.3);
    text-transform: uppercase;
    letter-spacing: 2px;
    transition: all 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Gives a pointer cue and feedback when standard logo triggers menu */
.sticky-header .logo a {
    cursor: pointer;
}
.sticky-header .logo a:hover {
    color: var(--accent-color);
    text-shadow: 0 0 10px rgba(255, 102, 0, 0.4);
}

.sticky-header.scrolled .logo a {
    font-family: 'Cinzel', serif;
    text-transform: capitalize;
}

#normal-menu ul {
    display: flex;
    gap: 20px;
    list-style: none;
    margin: 0;
    padding: 0;
    align-items: center;
}

#normal-menu li a {
    color: white;
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    padding: 8px 16px;
    border: 2px solid transparent; 
    border-radius: 4px;
    text-transform: uppercase;
    transition: all 0.3s ease;
}

#normal-menu li a:hover {
    border-color: var(--accent-color);
    color: var(--accent-color);
    background: rgba(255, 255, 255, 0.05);
}

/* Dropdowns */
.dropdown { position: relative; display: inline-block; }
.dropdown-menu {
    display: block;
    opacity: 0;
    visibility: hidden;
    position: absolute;
    top: calc(100% + 8px);
    left: 50%;
    transform: translateX(-50%);
    min-width: 180px;
    background: transparent; 
    backdrop-filter: blur(4px);
    border-radius: 6px;
    padding: 6px; 
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
    transition: all 0.3s ease;
    display: flex;            
    flex-direction: column;
    gap: 6px;
}

/* 1. Only allow hover on dropdowns that are NOT the contact dropdown */
.dropdown:not(#contact-dropdown):hover .dropdown-menu { 
    opacity: 1; 
    visibility: visible; 
}

/* 2. Keep this existing rule so your click function still works for Contact */
.dropdown.active .dropdown-menu { 
    opacity: 1; 
    visibility: visible; 
}

#normal-menu .dropdown-item {
    width: 100%;
    padding: 10px 16px;
    color: rgba(255, 255, 255, 0.9);
    background: rgba(25, 25, 25, 0.35); 
    border: 1px solid rgba(255, 255, 255, 0.05); 
    border-radius: 4px;
    text-align: center;
    text-decoration: none;
    transition: all 0.25s ease;
}
#normal-menu .dropdown-item:hover {
    background: rgba(55, 55, 55, 0.35);
    color: var(--accent-color);
    border-color: rgba(255, 255, 255, 0.05);
}

/* --- Progress Bar --- */
.progress-container {
    position: fixed; 
    bottom: 0; 
    left: 0; 
    width: 100%; 
    height: 6px; 
    background: #140519; 
    z-index: 2000;
    cursor: pointer;
    transition: height 0.2s ease-in-out;
}
.progress-container:hover {
    height: 16px;
}
.progress-bar {
    height: 100%; 
    width: 0%; 
    background: linear-gradient(90deg, #32174D, var(--accent-color), #ffcc00);
    box-shadow: 0 0 8px var(--accent-color); 
    transition: width 0.1s ease-out;
}
.progress-tooltip {
    position: absolute;
    bottom: 20px;
    transform: translateX(-50%);
    background: rgba(20, 5, 25, 0.95);
    color: #ffffff;
    padding: 6px 14px;
    border-radius: 4px;
    font-size: 12px;
    font-family: 'Segoe UI', sans-serif;
    text-transform: uppercase;
    letter-spacing: 1px;
    white-space: nowrap;
    border: 1px solid var(--accent-color);
    pointer-events: none;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.15s ease, visibility 0.15s ease;
    box-shadow: 0 4px 15px rgba(0,0,0,0.6);
}

/* --- Sitemap Button Trigger Style --- */
.progress-sitemap-trigger {
    position: absolute;
    right: 20px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.7);
    font-size: 12px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    transition: color 0.3s ease, opacity 0.2s ease, transform 0.2s;
    opacity: 0;
}
.progress-container:hover .progress-sitemap-trigger {
    opacity: 1;
}
.progress-sitemap-trigger:hover {
    color: var(--accent-color);
    transform: translateY(-50%) scale(1.2);
}

/* ==========================================================================
   SITEMAP FULLSCREEN NAVIGATION DRAWERS
   ========================================================================== */
.sitemap-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(12, 2, 15, 0.95);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    z-index: 3000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94), visibility 0.4s;
    padding: 40px;
    overflow-y: auto;
    align-items: flex-start;
}
.sitemap-overlay.open {
    opacity: 1;
    visibility: visible;
}
.sitemap-close-btn {
    position: absolute;
    top: 30px;
    right: 40px;
    background: none;
    border: none;
    color: #aaa;
    font-size: 44px;
    cursor: pointer;
    transition: color 0.2s, transform 0.2s;
}
.sitemap-close-btn:hover {
    color: var(--accent-color);
    transform: rotate(90deg);
}
.sitemap-content {
    width: 100%;
    max-width: 900px;
    transform: translateY(40px);
    transition: transform 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    margin: auto 0;
}
.sitemap-overlay.open .sitemap-content {
    transform: translateY(0);
}
.sitemap-brand {
    font-family: 'Cinzel Decorative', serif;
    font-size: 28px;
    text-transform: uppercase;
    letter-spacing: 3px;
    color: #fff;
    margin-bottom: 50px;
    text-align: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    padding-bottom: 20px;
}

/* --- Sitemap Top Social Links (Intro style) --- */
.sitemap-top-socials {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
    margin: -30px 0 40px 0;
    flex-wrap: wrap;
}
.sitemap-top-socials a {
    color: #ccc;
    text-decoration: none;
    font-size: 14px;
    transition: color 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
}
.sitemap-top-socials .divider {
    color: rgba(255, 255, 255, 0.2);
}
.sitemap-top-socials a:hover {
    color: var(--accent-color);
    text-shadow: 0 0 8px rgba(255, 102, 0, 0.4);
}

.sitemap-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 40px;
    text-align: left;
}
.sitemap-column h3 {
    font-size: 16px;
    text-transform: uppercase;
    color: var(--accent-color);
    letter-spacing: 1px;
    margin-bottom: 20px;
}
.sitemap-column ul {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 12px;
}
.sitemap-link {
    font-family: 'Segoe UI', sans-serif;
    color: #ccc;
    text-decoration: none;
    font-size: 15px;
    transition: color 0.2s, padding-left 0.2s;
    display: inline-block;
}
.sitemap-link:hover {
    color: #fff;
    padding-left: 6px;
    text-shadow: 0 0 10px rgba(255,255,255,0.2);
}

/* --- Sitemap Bottom Social Links (Capsule style) --- */
.sitemap-bottom-socials {
    display: flex;
    justify-content: center;
    gap: 12px;
    margin-top: 50px;
    padding-top: 35px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    flex-wrap: wrap;
}
.sitemap-bottom-socials a {
    color: #aaa;
    text-decoration: none;
    border: 1px solid rgba(255, 255, 255, 0.15);
    padding: 8px 20px;
    border-radius: 20px;
    font-size: 13px;
    font-family: 'Segoe UI', sans-serif;
    transition: all 0.3s ease;
}
.sitemap-bottom-socials a:hover {
    color: #fff;
    background-color: var(--accent-color);
    border-color: var(--accent-color);
    transform: scale(1.05);
    box-shadow: 0 0 12px var(--accent-color);
}

/* --- Sticky Floating Social Sidebar --- */
.floating-social-sidebar {
    position: fixed;
    left: 30px;
    bottom: 40px;
    z-index: 999;
    display: flex;
    flex-direction: column;
    gap: 16px;
    padding: 16px 12px;
    background: rgba(45, 38, 48, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.08);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-radius: 40px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px);
    transition: opacity 0.5s ease, transform 0.5s ease, visibility 0.5s;
}

.floating-social-sidebar.visible {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.sidebar-icon {
    width: 44px;
    height: 44px;
    background-color: #ffffff;
    color: #2d2630;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    font-size: 18px;
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275), background-color 0.3s, color 0.3s;
}

.sidebar-icon:hover {
    transform: scale(1.15);
    background-color: var(--accent-color);
    color: #ffffff;
    box-shadow: 0 0 12px var(--accent-color);
}

/* --- Hero Image Section --- */
.hero-image {
    width: 100%;
    height: 72vh;
    background: linear-gradient(rgba(18, 18, 18, 0.4), rgba(12, 2, 15, 1)), url('https://static.wixstatic.com/media/3e9217_4a0b78b1678f4e5d8eaaa87b5b68996d~mv2.jpg') no-repeat center center/cover;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    padding-top: 50px;
}
.hero-overlay h1 {
    font-family: 'Dancing Script', cursive;
    font-size: 5rem;
    color: white;
    text-shadow: 2px 2px 8px rgba(0, 0, 0, 0.8);
}

/* --- Project Intro --- */
.project-intro {
    position: relative;
    margin-top: -10vh;
    padding: 45px 40px;
    z-index: 2;
}
.intro-box {
    max-width: 800px;
    margin: 0 auto;
    text-align: center;
    background: rgba(20, 5, 25, 0.95);
    padding: 40px;
    border-radius: 10px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.5);
    border: 1px solid rgba(255,255,255,0.05);
}
.intro-box h2 { margin-bottom: 20px; font-size: 2.5em; color: white; }
.intro-box p { color: #ccc; }
.social-links { display: flex; align-items: center; justify-content: center; gap: 15px; margin: 25px 0; flex-wrap: wrap; }
.social-links a { color: white; text-decoration: none; transition: color 0.3s ease; display: flex; align-items: center; gap: 8px; }
.social-links .divider { color: #666; }
.social-links a:hover { color: var(--accent-color); }

/* --- Description Section --- */
.description-section {
    padding: 60px 20px;
    background: rgba(12, 2, 15, 0.8);
    position: relative;
    z-index: 1;
}
.description-content { max-width: 800px; margin: 0 auto; line-height: 1.8; text-align: center; }
.description-content p { margin-bottom: 20px; font-size: 1.1em; color: #ddd; }

/* --- Featured Concepts Grid --- */
.featured {
    padding: 60px 20px;
    text-align: center;
    background-color: rgba(20, 5, 25, 0.5);
}
.featured h2 {
    font-size: 32px;
    margin-bottom: 40px;
    text-transform: uppercase;
    letter-spacing: 2px;
}
.projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
    max-width: 1100px;
    margin: 0 auto;
}
.project-card {
    font-family: 'Cinzel Decorative', serif;
    background-color: var(--secondary-bg);
    border-radius: 8px;
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    border: 1px solid rgba(255,255,255,0.05);
}
.project-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 10px 20px rgba(255, 102, 0, 0.15);
}
.project-img {
    width: 100%;
    height: 200px;
    background-color: #111;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #555;
    font-family: sans-serif;
}
.project-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.project-content {
    padding: 25px;
    text-align: left;
}
.project-content h3 { margin-top: 0; color: var(--accent-color); font-size: 1.4em; margin-bottom: 10px; }
.project-content p { font-size: 14px; color: #aaa; margin-bottom: 20px; font-family: 'Segoe UI', sans-serif;}
/* --- Find your existing .btn class and update it --- */
.btn {
    display: inline-block;
    padding: 10px 20px;
    /* Create a gradient that transitions into the final solid color */
    background: linear-gradient(90deg, #32174D 0%, var(--accent-color) 50%, var(--accent-color) 100%);
    /* Make the background twice the width of the button */
    background-size: 200% 100%;
    /* Start with the gradient positioned on the left side */
    background-position: left center;
    
    color: #fff;
    text-decoration: none;
    border-radius: 4px;
    text-transform: uppercase;
    font-size: 12px;
    font-weight: bold;
    font-family: 'Segoe UI', sans-serif;
    
    /* CHANGE: Smoothly animate the background position shift */
    transition: background-position 0.8s ease, transform 0.8s ease;
}

/* CHANGE: Shift the background to the left on hover, pulling the solid color into view */
.btn:hover { 
    background-position: right center;
    opacity: 1; /* Keeps the button fully bright */
}

/* --- Social Media Bar --- */
.social-bar {
    display: flex;
    justify-content: center;
    gap: 15px;
    padding: 60px 20px;
    background-color: #08010a;
    flex-wrap: wrap;
    border-top: 1px solid rgba(255,255,255,0.05);
}
.social-bar a {
    color: #fff;
    text-decoration: none;
    border: 1px solid #444;
    padding: 10px 25px;
    border-radius: 25px;
    font-size: 14px;
    font-family: 'Segoe UI', sans-serif;
    transition: all 0.3s;
}
.social-bar a:hover {
    background-color: var(--accent-color);
    border-color: var(--accent-color);
    transform: scale(1.05);
}

/* ==========================================================================
   NEW PLACEHOLDER COMPONENT DESIGN STYLES
   ========================================================================== */
.section-container {
    max-width: 1000px;
    margin: 0 auto;
    padding: 80px 40px;
    text-align: center;
}

.section-container h2 {
    font-size: 28px;
    margin-bottom: 40px;
    text-transform: uppercase;
    letter-spacing: 2px;
}

/* News Section Timeline Style */
.news { background-color: rgba(12, 2, 15, 0.9); }
.news-timeline {
    max-width: 700px;
    margin: 0 auto;
    text-align: left;
    border-left: 2px solid var(--accent-color);
    padding-left: 30px;
}
.news-item {
    position: relative;
    margin-bottom: 40px;
}
.news-item::before {
    content: '';
    position: absolute;
    left: -37px;
    top: 6px;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--accent-color);
    box-shadow: 0 0 8px var(--accent-color);
}
.news-date {
    display: block;
    font-size: 12px;
    color: var(--accent-color);
    margin-bottom: 5px;
    font-family: 'Segoe UI', sans-serif;
    font-weight: 600;
}
.news-item h3 { font-size: 20px; margin-bottom: 8px; color: #fff; }
.news-item p { color: #aaa; font-size: 15px; line-height: 1.7; font-family: 'Segoe UI', sans-serif; }

/* Masquerade Two-Column Split Style */
.masquerade { background-color: rgba(20, 5, 25, 0.3); }
.showcase-split {
    display: flex;
    align-items: center;
    gap: 50px;
    text-align: left;
}
.showcase-text { flex: 1; }
.showcase-text p { color: #ccc; margin: 20px 0 30px 0; line-height: 1.8; font-size: 16px; font-family: 'Segoe UI', sans-serif; }
.showcase-visual { flex: 1; }
.visual-placeholder {
    width: 100%;
    height: 300px;
    background: rgba(255,255,255,0.02);
    border: 1px dashed rgba(255,255,255,0.15);
    border-radius: 8px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 15px;
    color: #555;
    transition: color 0.3s, border-color 0.3s;
}
.visual-placeholder img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 7px;
}
.visual-placeholder i { font-size: 40px; }
.visual-placeholder span { font-size: 13px; letter-spacing: 1px; text-transform: uppercase; font-family: 'Segoe UI', sans-serif;}
.visual-placeholder:hover { color: var(--accent-color); border-color: var(--accent-color); }

/* All Projects Section Minimal List Style */
.project { background-color: rgba(12, 2, 15, 0.7); }
.archive-list {
    max-width: 800px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 12px;
}
.archive-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 18px 25px;
    background: rgba(255,255,255,0.02);
    border: 1px solid rgba(255,255,255,0.05);
    border-radius: 6px;
    transition: all 0.25s ease;
    cursor: pointer;
}
.archive-id { font-family: 'Segoe UI', sans-serif; color: var(--accent-color); font-weight: bold; width: 60px; text-align: left; }
.archive-title { flex-grow: 1; text-align: left; font-size: 16px; font-weight: 500; padding: 0 15px; }
.archive-tag { font-size: 11px; text-transform: uppercase; font-family: 'Segoe UI', sans-serif; color: #777; background: rgba(255,255,255,0.05); padding: 4px 10px; border-radius: 4px; }
.archive-row:hover {
    background: rgba(255,255,255,0.05);
    border-color: rgba(255, 102, 0, 0.4);
    transform: translateX(5px);
}

/* Contact Block Form Box Style */
.contact { background-color: #06010a; }
.contact-card {
    max-width: 600px;
    margin: 0 auto;
    background: var(--secondary-bg);
    border: 1px solid rgba(255,255,255,0.05);
    border-radius: 8px;
    padding: 40px;
}
.contact-card p { color: #aaa; margin-bottom: 30px; font-family: 'Segoe UI', sans-serif; font-size: 15px; }
.contact-methods {
    display: flex;
    justify-content: center;
    gap: 20px;
    flex-wrap: wrap;
}
.method-btn {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 24px;
    border: 1px solid #444;
    border-radius: 4px;
    color: white;
    text-decoration: none;
    font-family: 'Segoe UI', sans-serif;
    font-size: 14px;
    
    /* FIX: Shift the start of the orange color slightly past the 50% mark */
    background: linear-gradient(90deg, transparent 50%, var(--accent-color) 50.1%);
    background-size: 200% 100%;
    
    /* FIX: Set the resting position slightly negative to hide any edge artifacts */
    background-position: -1% center;
    
    transition: background-position .8s ease, border-color 0.1s ease;
}

.method-btn:hover {
    border-color: var(--accent-color);
    /* Pull it all the way to 100% on hover */
    background-position: 100% center;
    color: white; 
}

/* --- Footer --- */
footer {
    background-color: #000;
    text-align: center;
    padding: 40px 20px;
    border-top: 1px solid #111;
}
footer p { margin: 0; color: #666; font-size: 14px; font-family: 'Segoe UI', sans-serif; }
footer .footer-links { margin-top: 15px; display: flex; justify-content: center; gap: 20px; }
footer .footer-links a { color: #888; text-decoration: none; font-size: 13px; font-family: 'Segoe UI', sans-serif; transition: color 0.3s; }
footer .footer-links a:hover { color: var(--accent-color); }

@media (max-width: 768px) {
    .sticky-header .container-xl { flex-direction: column; gap: 15px; }
    #normal-menu ul { flex-wrap: wrap; justify-content: center; }
    .hero-overlay h1 { font-size: 3.5rem; }
    .sticky-header.scrolled .logo { transform: none; }
    .showcase-split { flex-direction: column; text-align: center; gap: 30px; }
    .news-timeline { padding-left: 20px; }
    .floating-social-sidebar { left: 15px; bottom: 20px; gap: 10px; padding: 10px 8px; }
    .sidebar-icon { width: 36px; height: 36px; font-size: 15px; }
    .sitemap-overlay { padding: 20px; }
    .sitemap-grid { grid-template-columns: 1fr; gap: 25px; }
    .sitemap-brand { font-size: 20px; margin-bottom: 30px; }
}

/* --- Expanded Project Card Layout --- */

/* 1. Modify the grid behavior when a card is expanded */
.projects-grid {
    position: relative;
    transition: all 0.5s ease;
}

.projects-grid.has-expanded {
    /* Changes grid behavior to stack items so the expanded card can take full width */
    display: flex;
    flex-direction: column;
}

/* 2. Style for the unselected cards when one is expanded */
.projects-grid.has-expanded .project-card:not(.expanded) {
    max-height: 0;
    padding: 0;
    margin: 0;
    opacity: 0;
    border: none;
    pointer-events: none;
    transform: scale(0.9);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

/* 3. Base layout properties for the expansion animation */
.project-card {
    position: relative;
    cursor: pointer;
    transition: transform 0.3s ease, box-shadow 0.3s ease, max-height 0.5s ease, opacity 0.4s ease, margin 0.5s ease;
    max-height: 800px; /* An upper limit safety bracket for animation height */
}

/* 4. Style for the fully expanded card */
.project-card.expanded {
    width: 100%;
    max-width: 900px;
    margin: 0 auto;
    cursor: default;
    transform: translateY(0) scale(1) !important;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.6), 0 0 20px rgba(255, 102, 0, 0.2);
}

/* Optional tweak to make the layout look great when expanded */
.project-card.expanded .project-img {
    height: 350px; /* Gives the featured image more breathing room */
    transition: height 0.5s ease;
}

/* 5. Close Button Styling inside the card */
.card-close-btn {
    position: absolute;
    top: 15px;
    right: 20px;
    background: rgba(0, 0, 0, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: #fff;
    font-size: 28px;
    width: 36px;
    height: 36px;
    line-height: 32px;
    border-radius: 50%;
    cursor: pointer;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    z-index: 10;
}

.project-card.expanded .card-close-btn {
    opacity: 1;
    visibility: visible;
}

.card-close-btn:hover {
    background: var(--accent-color);
    border-color: var(--accent-color);
    transform: rotate(90deg);
}

/* --- Description Text Clamping Logic --- */

/* Target the description paragraph inside the project card */
.project-card .project-content p {
    display: -webkit-box;
    -webkit-line-clamp: 2; /* Strictly limits the text to 2 lines */
    -webkit-box-orient: vertical;  
    overflow: hidden;
    text-overflow: ellipsis;
    transition: max-height 0.4s ease; /* Smooth layout transition */
}

/* Unclamp the text completely when the card is expanded */
.project-card.expanded .project-content p {
    display: block; /* Removes the webkit-box restrictions */
    overflow: visible;
    -webkit-line-clamp: unset; 
}
.archive-list a.archive-row {
    color: var(--text-color);
    text-decoration: none;
}

/* Widen the non-scrolled header so all tabs fit */
.sticky-header .container-xl {
    max-width: 1000px !important; 
}

/* Make it full width once you scroll */
.sticky-header.scrolled .container-xl {
    max-width: 100% !important;
}

/* Swapping Logo Text Logic */
.sticky-header .logo .logo-concept {
    display: none;
}
.sticky-header .logo .logo-vista {
    display: inline-block;
}
.sticky-header.scrolled .logo .logo-vista {
    display: none;
}
.sticky-header.scrolled .logo .logo-concept {
    display: inline-block;
}

/* Ensure the main normal-menu actually hides when sorter menu is active */
#normal-menu.hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

/* Widen the header specifically for the masquerade page */
.sticky-header .container-xl {
    max-width: 1100px !important; /* Increases width from the original 1000px limit */
}

/* Force the logo text to stay on a single line instead of wrapping */
.sticky-header .logo a {
    white-space: nowrap;
}

/* ==========================================================================
   MOBILE & RESPONSIVE DESIGN STYLES
   ========================================================================== */

/* Mobile Navigation Toggle Default State (Desktop hidden) */
.mobile-nav-toggle {
    display: none;
    background: none;
    border: none;
    color: #ffffff;
    font-size: 1.5rem;
    cursor: pointer;
    padding: 8px;
    align-items: center;
    justify-content: center;
    z-index: 1005;
    transition: transform 0.2s ease, opacity 0.2s ease;
}

.mobile-nav-toggle:active {
    transform: scale(0.9);
    opacity: 0.8;
}

/* Screen widths under 768px (Tablets and Smartphones) */
@media (max-width: 768px) {
    /* Global container padding adjustments */
    .container-xl, .section-container {
        padding-left: 20px !important;
        padding-right: 20px !important;
        width: 100% !important;
        box-sizing: border-box !important;
    }

    /* Sticky Header layout shift */
    .sticky-header .container-xl {
        display: flex !important;
        justify-content: space-between !important;
        align-items: center !important;
        padding-top: 12px !important;
        padding-bottom: 12px !important;
    }

    /* Hide standard inline navigation layout */
    #normal-menu {
        display: none !important;
    }

    /* Expose mobile hamburger button toggle */
    .mobile-nav-toggle {
        display: flex !important;
    }

    /* Hide the intrusive fixed social sidebar on narrow screens */
    .floating-social-sidebar {
        display: none !important;
    }

    /* Intro section wrappers */
    .project-intro .intro-box {
        padding: 30px 15px !important;
        width: 100% !important;
        max-width: 100% !important;
        box-sizing: border-box;
    }

    .project-intro .social-links {
        display: flex !important;
        flex-wrap: wrap !important;
        justify-content: center !important;
        gap: 12px !important;
    }

    /* Hide absolute divider text strings on flexible lines */
    .project-intro .social-links .divider,
    .sitemap-top-socials .divider {
        display: none !important;
    }

    /* Description Box */
    .description-content {
        padding: 35px 15px !important;
    }

    .description-content h1 {
        font-size: 1.85rem !important;
    }

    /* Featured Concepts: Force cards to stack instead of spreading horizontally */
    .projects-grid {
        display: grid !important;
        grid-template-columns: 1fr !important;
        gap: 24px !important;
        width: 100% !important;
    }

    .project-card {
        display: flex !important;
        flex-direction: column !important;
        width: 100% !important;
        max-width: 100% !important;
        margin: 0 auto !important;
    }
    
    .project-img, .project-img img {
        width: 100% !important;
        height: auto !important;
    }

    /* Showcase Split Layout adaptation */
    .showcase-split {
        display: flex !important;
        flex-direction: column !important;
        gap: 25px !important;
        text-align: center !important;
    }

    .showcase-text, .showcase-visual {
        width: 100% !important;
    }

    /* Archive Index Matrix Rows adjustments */
    .archive-row {
        display: flex !important;
        flex-direction: column !important;
        gap: 6px !important;
        padding: 14px 12px !important;
        border-bottom: 1px solid rgba(255, 255, 255, 0.1) !important;
    }

    /* Contact Card button stacks */
    .contact-methods {
        display: flex !important;
        flex-direction: column !important;
        gap: 12px !important;
        width: 100% !important;
    }

    .method-btn {
        width: 100% !important;
        text-align: center !important;
        justify-content: center !important;
        box-sizing: border-box !important;
    }

    /* Horizontal Social Link bar wrapping */
    .social-bar {
        display: flex !important;
        flex-wrap: wrap !important;
        justify-content: center !important;
        gap: 14px !important;
        padding: 22px 10px !important;
    }

    /* Navigation Drawer Overhaul */
    .sitemap-overlay .sitemap-content {
        padding: 40px 20px !important;
        max-height: 85vh !important;
        overflow-y: auto !important; /* Permits vertical reading flow if layout exceeds screen size */
    }

    .sitemap-grid {
        grid-template-columns: 1fr !important;
        gap: 28px !important;
        text-align: center !important;
    }

    .sitemap-brand {
        font-size: 1.6rem !important;
        text-align: center !important;
    }

    .sitemap-top-socials, .sitemap-bottom-socials {
        display: flex !important;
        flex-wrap: wrap !important;
        justify-content: center !important;
        gap: 12px !important;
    }

    /* Footer structure wrap */
    footer {
        display: flex !important;
        flex-direction: column !important;
        gap: 15px !important;
        text-align: center !important;
    }

    .footer-links {
        justify-content: center !important;
    }
}

/* Extra Small Screen Optimization (Phones up to 480px width) */
@media (max-width: 480px) {
    h1 { font-size: 1.65rem !important; }
    h2 { font-size: 1.4rem !important; }
    p { font-size: 0.95rem !important; }

    .btn, .method-btn {
        padding: 12px 18px !important;
        font-size: 0.9rem !important;
    }

    .progress-container {
        height: 5px !important;
    }

    .progress-sitemap-trigger {
        width: 36px !important;
        height: 36px !important;
    }
}

/* --- Mobile Scroll Snapping Deactivation --- */
@media (max-width: 768px) {
    html {
        scroll-snap-type: none !important;
    }
    
    .hero-image, 
    .project-intro, 
    .description-section, 
    .featured, 
    .snap-target, 
    .characters-section, 
    #gallery, 
    #contact, 
    footer {
        scroll-snap-align: none !important;
        scroll-snap-stop: normal !important;
        scroll-margin-top: 0 !important;
    }
}