:root {
    --bg-color: #06090e;
    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    --accent: #38bdf8;
    --accent-hover: #7dd3fc;
    --border-radius: 20px;
    --transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

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

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--bg-color);
    color: var(--text-primary);
    line-height: 1.6;
    overflow-x: hidden;
}

body.locked {
    overflow: hidden;
}

h1, h2, h3, h4 {
    font-family: 'Montserrat', sans-serif;
}

/* Base text shadow class to ensure legibility when floating over images */
.floating-text {
    text-shadow: 0 2px 10px rgba(0,0,0,0.9), 0 4px 20px rgba(0,0,0,0.5);
}

/* =========================================
   GLOBAL HEADER (PERSISTENT)
========================================= */
.global-header {
    position: fixed;
    top: 0;
    right: 0; /* Moved back to right */
    width: 100%;
    padding: 4rem 5rem;
    display: flex;
    flex-direction: column;
    align-items: flex-end; /* Align right */
    text-align: right;
    z-index: 1000;
    pointer-events: none;
}

.landing-name {
    font-size: 3.5rem; /* Reduced size as requested */
    font-weight: 700;
    letter-spacing: -2px;
    line-height: 1;
    margin-bottom: 0;
    background: linear-gradient(135deg, #fff, #94a3b8);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    text-shadow: 0 2px 20px rgba(0,0,0,0.8);
    pointer-events: auto;
}

.landing-title {
    font-size: 1.3rem; /* Slightly smaller to match name */
    font-weight: 700;
    color: var(--accent);
    margin-bottom: 3rem;
    letter-spacing: 2px;
    text-transform: uppercase;
    pointer-events: auto;
    text-shadow: 0 2px 10px rgba(0,0,0,0.8);
}

/* =========================================
   VIDEO PORTFOLIO GALLERY
========================================= */
.video-gallery {
    display: flex;
    flex-direction: column;
    gap: 3rem;
    margin-top: 2rem;
    padding-bottom: 2rem;
}

.gallery-card {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: var(--border-radius);
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
}

.gallery-card h3 {
    font-size: 1.4rem;
    color: var(--accent);
    margin: 0;
}

.gallery-item {
    position: relative;
    width: 100%;
    margin: 0 auto;
    aspect-ratio: 16/9;
    border-radius: var(--border-radius);
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);
    transition: var(--transition);
}

.gallery-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 40px rgba(0,0,0,0.8);
}

.gallery-info p {
    color: var(--text-secondary);
    font-size: 0.95rem;
    margin-bottom: 1rem;
    line-height: 1.5;
}

.gallery-links {
    display: flex;
    gap: 0.8rem;
    align-items: center;
}

.gallery-links a {
    color: #fff;
    text-decoration: none;
    font-size: 0.85rem;
    font-weight: 600;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    transition: color 0.3s ease;
}

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

.gallery-links .divider {
    color: rgba(255,255,255,0.3);
}

.video-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

.unlock-zone {
    position: absolute;
    top: 1.5rem;
    left: 1.5rem;
    z-index: 10;
    color: #2563eb;
    background: rgba(255, 255, 255, 0.9);
    border-radius: 50%;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.5);
    cursor: pointer;
    transition: opacity 0.3s ease, transform 0.3s ease;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
}

@keyframes sonarPulse {
    0% {
        transform: translate(-50%, -50%) scale(1);
        opacity: 0.8;
    }
    100% {
        transform: translate(-50%, -50%) scale(2.5);
        opacity: 0;
    }
}

.unlock-zone::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: 2px solid #2563eb;
    z-index: -1;
    animation: sonarPulse 2s infinite ease-out;
}

.unlock-zone span {
    display: none;
}

.unlock-zone svg {
    width: 22px;
    height: 22px;
    filter: none;
    position: relative;
    z-index: 2;
}

.video-container.unlocked .unlock-zone {
    opacity: 0;
    transform: scale(0.9);
    pointer-events: none;
}

.gallery-vid {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    background: #000;
}

.gallery-item h3 {
    position: absolute;
    bottom: 1.5rem;
    left: 1.5rem;
    font-size: 1.2rem;
    color: #fff;
    margin: 0;
    text-shadow: 0 2px 10px rgba(0,0,0,0.8);
    pointer-events: none;
    z-index: 5;
}

/* =========================================
   TRANSITION SCREEN
========================================= */
.black-transition {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-color: #000;
    z-index: 90;
    opacity: 0;
    pointer-events: none;
    transition: opacity 1s cubic-bezier(0.4, 0, 0.2, 1);
}

.black-transition.active {
    opacity: 1;
    pointer-events: all;
}

/* =========================================
   LANDING PAGE (CINEMATIC)
========================================= */
.landing-page {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    height: 100dvh;
    z-index: 50;
}

.video-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    z-index: -1;
    background: #000;
}

.bg-video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0.9;
}

.video-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle, rgba(0,0,0,0.1) 0%, rgba(6,9,14,0.6) 100%);
}

.landing-content {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    padding: 4rem 5rem;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    align-items: flex-end; /* Moved button back to right */
    z-index: 1;
}

.enter-btn {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--accent);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    color: #fff;
    padding: 1rem 3rem;
    font-size: 1.1rem;
    font-family: 'Montserrat', sans-serif;
    font-weight: 500;
    border-radius: 50px;
    cursor: pointer;
    transition: var(--transition);
    text-transform: uppercase;
    letter-spacing: 2px;
}

.enter-btn:hover {
    background: rgba(56, 189, 248, 0.15);
    border-color: var(--accent-hover);
    color: #fff;
    transform: translateY(-3px);
    box-shadow: 0 0 20px rgba(56, 189, 248, 0.6), inset 0 0 10px rgba(56, 189, 248, 0.3);
}

/* Animations for landing text */
.fade-in-delay { opacity: 0; animation: fadeInUp 1.2s ease-out 0.5s forwards; }
.fade-in-delay-2 { opacity: 0; animation: fadeInUp 1.2s ease-out 0.8s forwards; }
.fade-in-delay-3 { opacity: 0; animation: fadeInUp 1.2s ease-out 1.2s forwards; }

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

/* =========================================
   CV INTERACTIVE MENU VIEW
========================================= */
.cv-content {
    opacity: 0;
    transition: opacity 1s cubic-bezier(0.16, 1, 0.3, 1);
    min-height: 100vh;
    background-color: transparent;
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    height: 100dvh;
    z-index: 40;
}

.cv-content.active {
    opacity: 1;
}

.cv-content.hidden {
    display: none;
    pointer-events: none;
}

.cv-bg {
    position: absolute;
    top: -5%;
    left: -5%;
    width: 110%;
    height: 110%;
    background: url('menu-bg-2.jpg') center/cover no-repeat;
    filter: brightness(0.3);
    z-index: -1;
}

/* Vertical Sidebar Menu - RIGHT ALIGNED */
.menu-container {
    position: absolute;
    top: 14rem; /* Sits beneath the right-aligned global header */
    right: 5rem; /* Anchored to right */
    width: 350px; /* Increased to allow text on one line */
    z-index: 10;
}

.menu-grid {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    align-items: flex-end; /* Align icons right */
}

.menu-btn {
    background: transparent;
    border: none;
    padding: 0;
    display: flex;
    flex-direction: row; /* Layout is Label -> Icon */
    justify-content: flex-end;
    align-items: center;
    gap: 1.5rem;
    cursor: pointer;
    transition: var(--transition);
    color: var(--text-secondary);
    text-shadow: 0 2px 10px rgba(0,0,0,0.8);
}

.menu-btn:hover, .menu-btn.active {
    color: #fff;
    transform: translateX(-10px); /* Push to left on hover */
}

.menu-icon {
    width: 2rem;
    height: 2rem;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: var(--transition);
}

.menu-icon svg {
    width: 100%;
    height: 100%;
}

.menu-btn:hover .menu-icon, .menu-btn.active .menu-icon {
    filter: drop-shadow(0 0 10px rgba(255,255,255,0.6));
    color: var(--accent);
}

.menu-label {
    font-family: 'Montserrat', sans-serif;
    font-size: 1.1rem;
    font-weight: 600;
    letter-spacing: 1px;
    text-transform: uppercase;
    white-space: nowrap;
}

/* =========================================
   FLOATING CONTENT PANES (Boxless) - LEFT ALIGNED
========================================= */
.content-pane {
    position: absolute;
    top: 13rem;
    left: 5rem;
    width: calc(100% - 350px - 10rem);
    max-width: 900px;
    max-height: calc(100vh - 16rem);
    overflow-y: auto;
    z-index: 100;
    opacity: 1;
    transition: all 0.5s cubic-bezier(0.16, 1, 0.3, 1);
    padding-right: 2rem; /* Prevents text from hiding under the scrollbar */
    
    /* Scrollbar styling for sleekness */
    scrollbar-width: thin;
    scrollbar-color: var(--accent) transparent;
}

.content-pane::-webkit-scrollbar {
    width: 6px;
}
.content-pane::-webkit-scrollbar-track {
    background: transparent;
}
.content-pane::-webkit-scrollbar-thumb {
    background-color: var(--text-secondary);
    border-radius: 10px;
}

.content-pane.hidden {
    opacity: 0;
    transform: translateX(-30px); /* Slide in from left */
    pointer-events: none;
}

/* Apply legibility shadow to all text in pane */
.content-pane h2, 
.content-pane h3, 
.content-pane h4, 
.content-pane p, 
.content-pane span, 
.content-pane li,
.content-pane strong,
.content-pane .date {
    text-shadow: 0 2px 10px rgba(0,0,0,0.9), 0 4px 20px rgba(0,0,0,0.5);
}

.section-title {
    font-size: 2.2rem;
    font-weight: 600;
    margin-bottom: 2rem;
    color: var(--text-primary);
}

.sub-title {
    font-size: 1.2rem;
    color: var(--accent);
    margin-bottom: 1rem;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.contact-info-horizontal {
    display: flex;
    flex-wrap: wrap;
    gap: 1.5rem;
    margin-bottom: 2rem;
    color: var(--accent);
    font-size: 0.95rem;
}

.contact-info-horizontal a {
    color: inherit;
    text-decoration: none;
    transition: var(--transition);
}

.contact-info-horizontal a:hover {
    color: #fff;
    text-decoration: underline;
}

.content-text {
    font-size: 1.1rem;
    line-height: 1.8;
    color: var(--text-primary);
    font-weight: 300;
}

.divider {
    border: 0;
    height: 1px;
    background: rgba(255, 255, 255, 0.2);
    margin: 2rem 0;
    box-shadow: 0 2px 10px rgba(0,0,0,0.8);
}

/* Skills inside Pane */
.skills-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 2.5rem;
}

.skill-item h4 {
    font-size: 1.2rem;
    margin-bottom: 0.5rem;
    color: #fff;
}

.skill-item p {
    font-size: 0.95rem;
    color: var(--text-secondary);
}

/* Experience inside Pane */
.experience-item {
    margin-bottom: 2rem;
}

.experience-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 1rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.role {
    font-size: 1.4rem;
    font-weight: 600;
    color: #fff;
}

.promo {
    font-size: 0.9rem;
    font-weight: 400;
    color: var(--text-secondary);
}

.company {
    font-size: 1.1rem;
    color: var(--accent);
    margin-top: 0.25rem;
}

.date {
    font-size: 0.85rem;
    color: #fff;
    background: rgba(255, 255, 255, 0.1);
    padding: 0.3rem 0.8rem;
    border-radius: 20px;
    border: 1px solid rgba(255,255,255,0.2);
}

.experience-desc {
    color: var(--text-secondary);
    margin-bottom: 1rem;
    font-size: 1rem;
    line-height: 1.6;
}

.experience-bullets {
    list-style-type: none;
}

.experience-bullets li {
    position: relative;
    padding-left: 1.5rem;
    margin-bottom: 0.8rem;
    font-size: 0.95rem;
    color: var(--text-secondary);
    line-height: 1.6;
}

.experience-bullets li::before {
    content: '→';
    position: absolute;
    left: 0;
    color: var(--accent);
}

.experience-bullets li strong {
    color: #fff;
    font-weight: 500;
}

/* Two Column Section */
.two-col-section {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 3rem;
}

/* =========================================
   CASE STUDIES MASTER-DETAIL
========================================= */
#cs-grid-view.hidden,
#cs-detail-view.hidden,
.cs-detail.hidden,
.gallery-folder-content.hidden,
.gallery-prompt-content.hidden,
#gallery-grid.hidden,
#gallery-detail-view.hidden,
#prompt-detail-view.hidden {
    display: none !important;
}

/* Add up/down navigation to case study top bar */
#cs-nav-bar {
    position: absolute;
    top: 9rem;
    left: 5rem;
    z-index: 200;
    display: flex;
    gap: 1rem;
    align-items: center;
}

#cs-nav-bar.hidden {
    display: none !important;
}

#cs-back-btn {
    /* Removed absolute positioning since it's now in the flex nav bar */
    position: relative;
    top: 0;
    left: 0;
}

.cs-nav-arrow {
    background: rgba(10, 15, 26, 0.7);
    backdrop-filter: blur(5px);
    border: 1px solid var(--accent);
    color: var(--accent);
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: var(--transition);
}

.cs-nav-arrow:hover {
    background: rgba(56, 189, 248, 0.1);
    color: #fff;
    box-shadow: 0 0 15px rgba(56, 189, 248, 0.3);
}

.cs-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
    margin-top: 2rem;
}

.cs-card {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.8);
    border-radius: var(--border-radius);
    padding: 2rem;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    flex-direction: column;
}

.cs-card:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.3);
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);
}

.cs-card.has-bg {
    background-size: cover;
    background-position: center;
    position: relative;
    overflow: hidden;
    border-color: rgba(255, 255, 255, 0.8);
}

.gallery-prompt-content img {
    border: 1px solid rgba(255, 255, 255, 0.8) !important;
}

.cs-card.has-bg::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(6, 9, 14, 0.85);
    transition: var(--transition);
    z-index: 1;
}

.cs-card.has-bg:hover::before {
    background: rgba(6, 9, 14, 0.5);
}

.cs-card h3 {
    font-size: 1.2rem;
    color: #fff;
    margin-bottom: 1rem;
    line-height: 1.4;
    position: relative;
    z-index: 2;
}

.cs-card .tags {
    margin-top: auto;
    position: relative;
    z-index: 2;
}

.back-btn {
    background: rgba(10, 15, 26, 0.7);
    backdrop-filter: blur(5px);
    border: 1px solid var(--accent);
    color: var(--accent);
    padding: 0.5rem 1.5rem;
    border-radius: 50px;
    font-family: 'Montserrat', sans-serif;
    font-weight: 600;
    font-size: 0.9rem;
    cursor: pointer;
    transition: var(--transition);
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

}

.back-btn:hover {
    background: rgba(56, 189, 248, 0.1);
    color: #fff;
    border-color: #fff;
}

#mobile-back-to-menu-btn {
    display: none !important;
}

.education-list, .interests-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.education-list li, .interests-list li {
    display: flex;
    flex-direction: column;
    font-size: 0.95rem;
    color: var(--text-secondary);
}

.education-list strong, .interests-list strong {
    color: #fff;
    font-size: 1.05rem;
}

/* Scroll Animations */
.fade-in-scroll {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.8s cubic-bezier(0.16, 1, 0.3, 1), transform 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

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

/* =========================================
   AI REPORT TABLE & DYNAMIC LINKING
========================================= */
.report-table {
    width: 100%;
    border-collapse: collapse;
    color: #fff;
    font-size: 0.9rem;
    text-align: left;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 8px;
    overflow: hidden;
}

.report-table th {
    padding: 1.2rem 1rem;
    color: var(--accent);
    background: rgba(10, 15, 26, 0.95);
    backdrop-filter: blur(10px);
    font-weight: 600;
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
    position: sticky;
    top: 0;
    z-index: 10;
}

.report-table td {
    padding: 1.2rem 1rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    vertical-align: top;
    color: rgba(255,255,255,0.8);
}

.report-table tbody tr:hover {
    background: rgba(255, 255, 255, 0.02);
}

.report-table td strong {
    color: #fff;
    display: block;
    margin-bottom: 0.3rem;
}

.return-to-report-btn {
    background: rgba(56, 189, 248, 0.1);
    border: 1px solid var(--accent);
    color: var(--accent);
    padding: 0.3rem 0.8rem;
    border-radius: 50px;
    font-family: 'Inter', sans-serif;
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    white-space: nowrap;
}

.return-to-report-btn:hover {
    background: var(--accent);
    color: #000;
}

.return-to-report-btn.hidden {
    display: none !important;
}

.report-to-video-link {
    transition: var(--transition);
}

.report-to-video-link:hover {
    color: #fff !important;
    text-shadow: 0 0 10px rgba(56, 189, 248, 0.8);
}

/* Responsive */
@media (max-width: 1024px) {
    .global-header {
        padding: 2rem;
    }
    
    .menu-container {
        right: 2rem;
        top: 12rem;
    }
    
    .content-pane {
        top: 12rem;
        left: 2rem;
        width: calc(100% - 300px - 4rem);
    }
}

@media (max-width: 768px) {
    .landing-name {
        font-size: min(2.5rem, 10vw);
    }
    
    .landing-title {
        font-size: 1rem;
        letter-spacing: 1px;
    }

    .landing-content {
        padding: 2rem;
        padding-bottom: 6rem; /* Extra space to ensure the button is above mobile browser bars */
    }

    .global-header {
        align-items: center;
        text-align: center;
        padding: 1rem;
    }
    
    .menu-container {
        position: relative;
        right: 0;
        top: 10rem;
        width: 100%;
        padding: 2rem;
    }
    
    .menu-grid {
        flex-direction: column;
        align-items: center;
        gap: 1.5rem;
        justify-content: center;
    }

    .menu-btn {
        justify-content: center;
        width: 100%;
    }
    
    .content-pane {
        position: relative;
        top: 0;
        left: 0;
        width: 100%;
        padding: 1.5rem 1rem;
        max-height: calc(100vh - 10rem);
        overflow-y: auto;
    }

    .content-pane.hidden {
        display: none !important;
    }

    #cs-nav-bar {
        position: relative;
        top: 0;
        left: 0;
        margin-bottom: 2rem;
        justify-content: center;
        width: 100%;
    }

    .cs-grid, .two-col-section, .skills-grid {
        grid-template-columns: 1fr;
    }
    
    .video-grid {
        grid-template-columns: repeat(auto-fit, minmax(min(100%, 250px), 1fr)) !important;
    }

    /* Mobile specific pane active logic */
    body.mobile-pane-active .menu-container {
        display: none !important;
    }

    body.mobile-pane-active .global-header {
        position: relative; /* So it scrolls away with the content */
    }

    body.mobile-pane-active #mobile-back-to-menu-btn {
        display: flex !important;
        position: relative;
        margin: 8rem auto 1rem auto; /* Increased top margin to clear the global header title */
        z-index: 200;
        justify-content: center;
        width: fit-content;
    }
}

