/* DESIGN TOKENS */
:root {
    --accent: #666868;
    --bg-main: #e5e5e5;
    --text-primary: #1a1a1a;
    --text-secondary: #4b5563; /* gray-600 */
    --text-muted: #6b7280;    /* gray-500 */
    --transition-slow: 0.9s cubic-bezier(0.65, 0, 0.35, 1);
    --transition-mid: 0.6s cubic-bezier(0.85, 0, 0.15, 1);
    --transition-fast: 0.3s ease;
    --paper-texture: linear-gradient(rgba(255, 255, 255, 0.6), rgba(255, 255, 255, 0.6)), url('../crumpled_grey_paper.png');
}

.text-accent { color: var(--accent) !important; }
.bg-accent { background-color: var(--accent) !important; }
.border-accent { border-color: var(--accent) !important; }

/* CORE STYLES */
html {
    font-size: 105%;
}

body {
    font-family: 'Montserrat', sans-serif;
    overflow: hidden;
    background-color: var(--bg-main);
    background-image: var(--paper-texture);
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
    color: var(--text-primary);
    height: 100vh;
    height: 100dvh;
    width: 100%;
    touch-action: pan-y;
}

/* SECTION TRANSITIONS */
.section-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    transition: transform var(--transition-slow);
    background-color: var(--bg-main);
    background-image: var(--paper-texture);
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
}

/* Performance fix: Disable fixed background on mobile */
@media (max-width: 768px) {
    body, .section-container {
        background-attachment: scroll;
    }
}

#section-hero {
    z-index: 10;
    transform: translate(0, 0);
    display: flex;
    align-items: center;
    justify-content: center;
}

#section-about {
    z-index: 20;
    transform: translate(0, 100%);
    overflow-y: auto;
    scroll-behavior: smooth;
}

#section-projects {
    z-index: 20;
    transform: translate(0, 100%);
    display: flex;
    flex-direction: column;
    overflow: hidden; /* Changed from overflow-y: auto */
}

@media (min-width: 768px) {
    #section-projects {
        flex-direction: row;
    }
}



#project-detail-view {
    z-index: 50;
    transform: translate(0, 100%);
    transition: transform var(--transition-mid);
}

/* DOOR LIGHT GLOW NAVIGATION */
.nav-hint {
    position: fixed;
    top: 50%;
    transform: translateY(-50%);
    z-index: 60;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 15px;
    cursor: pointer;
    height: 60vh;
    width: 80px;
    background: transparent;
    -webkit-tap-highlight-color: transparent;
    transition: background var(--transition-mid);
}

.nav-hint-left {
    left: 0;
    border-top-right-radius: 100px;
    border-bottom-right-radius: 100px;
}

.nav-hint-left:hover,
.nav-hint-left:active {
    background: radial-gradient(ellipse at left, rgba(230, 0, 0, 0.15) 0%, transparent 70%);
    box-shadow: inset 10px 0 20px -5px rgba(230, 0, 0, 0.1);
}

.nav-hint-right {
    right: 0;
    border-top-left-radius: 100px;
    border-bottom-left-radius: 100px;
}

.nav-hint-right:hover,
.nav-hint-right:active {
    background: radial-gradient(ellipse at right, rgba(230, 0, 0, 0.15) 0%, transparent 70%);
    box-shadow: inset -10px 0 20px -5px rgba(230, 0, 0, 0.1);
}

.nav-text, .nav-hint i {
    opacity: 0;
    transform: scale(0.9);
    transition: all 0.5s ease;
    color: var(--accent);
}

/* UX: Pulse hint for discoverability on touch */
@keyframes hint-pulse {
    0%, 100% { opacity: 0; }
    50% { opacity: 0.3; }
}

@media (max-width: 768px) {
    .nav-hint i {
        animation: hint-pulse 3s infinite;
    }
    #section-projects {
        transform: translate(0, 100%);
    }
    .mobile-slide-up-page {
        animation: mobileSlideUp 0.6s cubic-bezier(0.23, 1, 0.32, 1) forwards;
    }
}

@keyframes mobileSlideUp {
    0% { transform: translateY(100vh); opacity: 0; }
    100% { transform: translateY(0); opacity: 1; }
}

@media (max-width: 768px) {
    .mobile-scroll {
        overflow-y: auto !important;
        height: auto !important;
    }
}

.nav-text {
    writing-mode: vertical-rl;
    text-orientation: mixed;
    text-transform: uppercase;
    font-size: 10px;
    letter-spacing: 0.3em;
    font-weight: 700;
}

.nav-hint:hover .nav-text,
.nav-hint:hover i,
.nav-hint:active .nav-text,
.nav-hint:active i {
    opacity: 1;
    transform: scale(1);
}

/* ANIMATIONS */
.bar {
    border-radius: 2px;
}

@keyframes equalizer {
    0%, 100% { height: 60px; }
    50% { height: 85px; }
}

.animate-red-bar {
    animation: equalizer 2s infinite ease-in-out;
}

@keyframes text-cycle {
    0%, 20% { transform: translateY(0); }
    25%, 45% { transform: translateY(-1.3em); }
    50%, 70% { transform: translateY(-2.6em); }
    75%, 95% { transform: translateY(-3.9em); }
    100% { transform: translateY(0); }
}

.animate-text-cycle {
    animation: text-cycle 8s linear infinite;
}

/* Reduced GPU Load */
.stylized-team-photo {
    filter: grayscale(100%) contrast(110%);
    -webkit-mask-image: linear-gradient(to bottom, black 80%, transparent 100%);
    mask-image: linear-gradient(to bottom, black 80%, transparent 100%);
}

.scroll-page {
    overflow-x: hidden !important;
    overflow-y: auto !important;
    height: auto !important;
    scroll-behavior: smooth;
}

.scroll-page::-webkit-scrollbar {
    width: 4px;
}

.scroll-page::-webkit-scrollbar-track {
    background: transparent;
}

.scroll-page::-webkit-scrollbar-thumb {
    background: var(--accent);
    border-radius: 10px;
}

.hide-scrollbar::-webkit-scrollbar {
    display: none;
}

.nav-item:hover {
    color: var(--accent);
    transition: color var(--transition-fast);
}

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

.animate-fade-in {
    animation: fadeIn 0.5s ease-out forwards;
}

/* MOBILE MENU */
#mobile-menu {
    transition: transform 0.4s ease-in-out;
    will-change: transform;
}

/* CLIENT REVIEW SCROLLER */
.scrolling-text-container {
    height: 40px;
    overflow: hidden;
    position: relative;
}

.scrolling-text-track {
    display: flex;
    flex-direction: column;
    animation: scroll-vertical 12s cubic-bezier(0.4, 0, 0.2, 1) infinite;
}

.review-item {
    height: 40px;
    display: flex;
    align-items: center;
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 0.15em;
    color: var(--text-secondary);
    text-transform: uppercase;
    white-space: nowrap;
}

@keyframes scroll-vertical {
    0%, 15% { transform: translateY(0); }
    20%, 35% { transform: translateY(-40px); }
    40%, 55% { transform: translateY(-80px); }
    60%, 75% { transform: translateY(-120px); }
    80%, 100% { transform: translateY(-160px); }
}

/* UTILITIES */
.big-number {
    position: absolute;
    top: 0;
    left: 0;
    font-size: 4rem;
    font-weight: 900;
    color: rgba(0,0,0,0.03);
    line-height: 1;
    z-index: 0;
}

.process-img {
    transition: transform var(--transition-mid);
}

.process-img:hover {
    transform: scale(1.02);
}

/* ACCESSIBILITY FIXES */
button, a {
    outline-color: var(--accent);
}



/* PRESENTATION FLOW */
.presentation-container {
    scroll-snap-type: y mandatory;
}

.presentation-section {
    scroll-snap-align: start;
    height: 100vh;
    height: 100dvh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    position: relative;
    overflow: hidden;
}

@media (max-width: 768px) {
    .presentation-section {
        padding: 1rem;
    }
}

/* Contrast fixes for text-gray-400/500 */
.text-contrast-fix {
    color: var(--text-secondary) !important;
}

/* SLIDESHOW VIDEO EFFECT */
.ken-burns {
    animation: kenburns 6s ease-in-out infinite alternate;
}

@keyframes kenburns {
    from { transform: scale(1.0); }
    to { transform: scale(1.08); }
}

#lightbox-img {
    transition: transform 0.8s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.6s ease-in-out;
}

.lightbox-transitioning {
    opacity: 0;
    transform: scale(0.98) !important;
}

.discovery-nudge {
    position: fixed;
    bottom: 120px;
    left: 50%;
    transform: translateX(-50%) translateY(30px);
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(10px);
    padding: 1rem 2rem;
    border-radius: 100px;
    box-shadow: 0 20px 40px rgba(0,0,0,0.1);
    display: flex;
    align-items: center;
    gap: 15px;
    opacity: 0;
    pointer-events: none;
    transition: all 0.8s cubic-bezier(0.23, 1, 0.32, 1);
    z-index: 100;
    border: 1px solid rgba(0,0,0,0.05);
}

.discovery-nudge.active {
    opacity: 1;
    pointer-events: auto;
    transform: translateX(-50%) translateY(0);
}

.discovery-dot {
    width: 8px;
    height: 8px;
    background: var(--accent);
    border-radius: 50%;
    animation: pulse-dot 2s infinite;
}

@keyframes pulse-dot {
    0% { transform: scale(1); box-shadow: 0 0 0 0 rgba(102, 104, 104, 0.4); }
    70% { transform: scale(1.2); box-shadow: 0 0 0 10px rgba(102, 104, 104, 0); }
    100% { transform: scale(1); box-shadow: 0 0 0 0 rgba(102, 104, 104, 0); }
}

/* MOBILE PROJECT DETAIL COLLAPSE EFFECT */
@media (max-width: 767px) {
    .detail-info-pane {
        height: 30vh !important;
        transition: all 0.4s cubic-bezier(0.25, 1, 0.5, 1) !important;
    }
    
    .detail-info-inner {
        display: flex;
        flex-direction: column;
        justify-content: center;
        transition: all 0.4s cubic-bezier(0.25, 1, 0.5, 1) !important;
    }
    
    #detail-images {
        height: 70vh !important;
        transition: all 0.4s cubic-bezier(0.25, 1, 0.5, 1) !important;
    }
    
    /* SCROLLED COLLAPSED STATE */
    .project-detail-scrolled .detail-info-pane {
        height: 60px !important;
        padding-top: 0px !important;
        padding-bottom: 0px !important;
        padding-left: 20px !important;
        padding-right: 20px !important;
        display: flex !important;
        align-items: center !important;
        border-bottom: 1px solid rgba(0, 0, 0, 0.05) !important;
        background: rgba(255, 255, 255, 0.95) !important;
        backdrop-filter: blur(10px) !important;
        z-index: 30 !important;
    }
    
    .project-detail-scrolled .detail-info-inner {
        flex-direction: row !important;
        align-items: center !important;
        justify-content: space-between !important;
        width: 100% !important;
        height: auto !important;
    }
    
    .project-detail-scrolled .detail-info-inner button {
        margin: 0 !important;
        flex-shrink: 0 !important;
    }
    
    .project-detail-scrolled .detail-info-inner #detail-title {
        display: none !important;
    }
    
    .project-detail-scrolled .detail-info-inner .space-y-2,
    .project-detail-scrolled .detail-info-inner #detail-play-btn {
        display: none !important;
    }
    
    .project-detail-scrolled #detail-images {
        height: calc(100% - 60px) !important;
        padding-top: 20px !important;
    }
    
    #project-detail-view > .absolute.bottom-4 {
        transition: opacity 0.3s ease-in-out !important;
    }

    /* MOBILE HEADER TOP-STICKY TRANSFORMATION */
    #global-bottom-ui {
        top: 0 !important;
        bottom: auto !important;
        align-items: center !important;
        padding-top: 0.75rem !important;
        padding-bottom: 0.75rem !important;
        background-color: rgba(255, 255, 255, 0.95) !important;
        backdrop-filter: blur(10px) !important;
        border-bottom: 1px solid rgba(0, 0, 0, 0.05) !important;
        z-index: 100 !important;
        transform: none !important;
        pointer-events: auto !important;
    }
    #hero-reviews-container {
        position: fixed !important;
        bottom: 1rem !important;
        left: 1.5rem !important;
        top: auto !important;
        display: flex !important;
        z-index: 90 !important;
    }
    #bottom-logo-container {
        opacity: 1 !important;
        pointer-events: auto !important;
        position: static !important;
        display: flex !important;
        flex-direction: row !important;
        align-items: center !important;
        gap: 12px !important;
    }
    #global-bottom-ui > .flex-col {
        flex-direction: row !important;
        align-items: center !important;
        gap: 0 !important;
    }
}

/* NAVIGATION BUTTON TYPOGRAPHY INHERITANCE */
nav.hidden.md\:flex button {
    font-size: inherit;
    font-weight: inherit;
    letter-spacing: inherit;
    color: inherit;
    transition: color var(--transition-fast);
}
nav.hidden.md\:flex button:hover {
    color: var(--accent);
}

/* INTERACTIVE SERVICES ACCORDION & SHOWCASE */
.service-interactive-row {
    transition: all 0.4s cubic-bezier(0.25, 1, 0.5, 1);
}

.service-mobile-expand {
    transition: max-height 0.4s cubic-bezier(0.25, 1, 0.5, 1), opacity 0.4s ease;
}

#service-showcase-img {
    transition: opacity 0.35s ease-out, transform 0.35s ease-out;
}

/* VISION & MISSION CARDS */
.vm-card {
    transition: background 0.7s ease, border-color 0.7s ease, box-shadow 0.7s ease;
}
.vm-card:hover {
    box-shadow: 0 20px 60px -10px rgba(0,0,0,0.08);
}

/* Animate underline expand on Vision/Mission key text */
@keyframes vm-underline {
    from { width: 0; }
    to   { width: 100%; }
}

.vm-card:hover blockquote span {
    animation: vm-underline 0.4s ease forwards;
}

/* Section entrance fade-up for vm cards */
@keyframes vm-fadein {
    from { opacity: 0; transform: translateY(24px); }
    to   { opacity: 1; transform: translateY(0); }
}

.vm-animate {
    animation: vm-fadein 0.7s cubic-bezier(0.23, 1, 0.32, 1) both;
}
.vm-animate:nth-child(2) {
    animation-delay: 0.15s;
}
