/* Base Styles */
:root {
    --primary-color: #2a2a2a;        /* Dark grey for dark sections */
    --secondary-color: #5a5a5a;      /* Medium grey accent */
    --text-color: #3c3c3c;           /* Dark grey for text */
    --light-bg: #f5f5f5;             /* Off-white background */
    --white: #ffffff;
    --dark-gray: #404040;
    --medium-gray: #707070;
    --light-gray: #e8e8e8;
    
    /* Dynamic Transition (Snappy effect) */
    --transition: all 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    
    /* Force light mode - override system dark mode */
    color-scheme: light only;
}

/* ==================== LAYERING SYSTEM ==================== */
/* Moved from inline styles in index.html for better organization */

/* Layer 1: NO background on body */
body {
    background: none;
    margin: 0;
    padding: 0;
}

/* NO background on html either - let layers show */
html {
    background: none;
    /* Force light mode color scheme */
    color-scheme: light only;
}

/* Force light mode on body and prevent dark mode filters */
body {
    color-scheme: light only;
    background-color: #f5f5f5 !important;
}

/* Prevent dark mode from affecting canvas and containers */
canvas, #intro-container, #project-content, #background-layer {
    color-scheme: light only;
}

/* Layer 3: Page content (z-index 5, SCROLLABLE) */
#project-content {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    overflow-y: auto;
    z-index: 5;
    pointer-events: none; /* Start disabled, enabled by JS when content loads */
    background: #f5f5f5;
    opacity: 0;
    /* DOM Content: Slow, elegant fade-in/out with cubic-bezier */
    /* Slower start, quick finish for professional feel */
    transition: opacity 0.6s cubic-bezier(0.23, 1, 0.32, 1);
}

#project-content.visible {
    opacity: 1;
    pointer-events: auto; /* Enable when visible */
}

/* Layer 0 (TOP): Canvas/Menu - FORCE transparency */
#intro-canvas {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    width: 100% !important;
    height: 100% !important;
    z-index: 10 !important;
    pointer-events: none !important;
    background: none !important;
    background-color: transparent !important;
    opacity: 1 !important;
}

/* Override any conflicting rules */
#intro-canvas, #grid-canvas {
    display: block !important;
    background: transparent !important;
}

/* CRITICAL: Make intro-container transparent! */
#intro-container {
    background: none !important;
    background-color: transparent !important;
    z-index: 10 !important;
    pointer-events: none !important; /* Container doesn't block */
}

/* Enable pointer events on canvas when menu is active */
#intro-canvas.menu-active {
    pointer-events: auto !important; /* Canvas becomes clickable */
}

/* When navigated, canvas should allow menu interaction but not block content */
#intro-canvas.navigated {
    pointer-events: auto !important; /* Keep menu clickable */
    z-index: 10 !important; /* Keep above content for menu */
}

/* Project container styles */
.project-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 80px 40px 80px 40px; /* Grid-aligned: 2 units top/bottom, 1 unit sides */
    position: relative;
    background: transparent; /* Transparent to show grid underneath */
}

/* Project meta positioned top-right, grid-aligned */
.project-meta-top {
    position: fixed;
    top: 40px;
    right: 40px; /* Grid-aligned: 1 unit from edge */
    font-size: 10px; /* Type scale: 10px */
    font-weight: 300;
    letter-spacing: 2px;
    text-transform: uppercase;
    color: var(--medium-gray);
    z-index: 9998;
    opacity: 0.7;
    line-height: 1.6;
    /* Rotate 90 degrees counter-clockwise */
    transform: rotate(-90deg);
    transform-origin: top right;
    white-space: nowrap;
}

/* Hero image and content alignment - Option B: 40px symmetric margins */
.hero-image,
.project-description,
.image-grid {
    margin-left: 40px; /* Grid-aligned: 1 unit from menu */
    margin-right: 40px; /* Grid-aligned: symmetric spacing */
    max-width: calc(100% - 80px); /* Total: 40px + 40px margins */
}

.project-header {
    margin-bottom: 60px;
}

.project-title {
    font-size: 12px; /* Type scale: 12px */
    font-weight: 500;
    letter-spacing: 2px;
    text-transform: uppercase;
    color: var(--medium-gray);
    margin-bottom: 20px;
}

/* ==================== END LAYERING SYSTEM ==================== */

/* Intro Animation Container */
#intro-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: #f5f5f5;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    /* Hardware acceleration for smooth animations */
    will-change: transform, opacity;
    transform: translateZ(0);
    /* Canvas: Fast, sharp exit to reveal content */
    transition: opacity 0.4s ease-out;
}

#intro-canvas {
    display: block;
    cursor: pointer;
    touch-action: none; /* Prevent default touch behaviors */
    -webkit-tap-highlight-color: transparent; /* Remove tap highlight on mobile */
    /* Hardware acceleration for canvas */
    will-change: transform;
    transform: translateZ(0);
}

#grid-canvas {
    /* Hardware acceleration for grid animations */
    will-change: transform;
    transform: translateZ(0);
}

/* Mobile-friendly adjustments */
@media (max-width: 768px) {
    #intro-canvas {
        width: 100vw;
        height: 100vh;
    }
}

/* Landing Animation Overlay */
.landing-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: var(--light-bg);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity 0.8s ease, visibility 0.8s ease;
}

.landing-overlay.hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

/* Skip Intro Button */
.skip-intro {
    position: fixed;
    bottom: 40px;
    right: 30px;
    background: transparent;
    border: none;
    color: rgba(90, 90, 90, 0.7);
    font-size: 1.2rem;
    cursor: pointer;
    z-index: 10001;
    display: flex;
    align-items: center;
    padding: 0;
    transition: all 0.3s ease;
    animation: fadeInUp 1s ease 1.5s both, pulse 2s ease-in-out 2.5s infinite;
    outline: none;
}

.skip-intro:hover {
    color: rgba(60, 60, 60, 1);
    transform: scale(1.2);
}

.skip-intro:focus {
    outline: none;
}

.skip-intro i {
    transition: all 0.3s ease;
}

/* Landing Hint */
.landing-hint {
    position: fixed;
    bottom: 40px;
    left: 30px;
    display: flex;
    gap: 15px;
    align-items: center;
    z-index: 10001;
    animation: fadeInUp 1s ease 1.5s both;
}

.landing-hint span {
    display: flex;
    gap: 15px;
    align-items: center;
}

.landing-hint i {
    color: rgba(90, 90, 90, 0.7);
    font-size: 1.2rem;
    transition: all 0.3s ease;
    animation: pulse 2s ease-in-out infinite;
}

.landing-hint i:hover {
    color: rgba(60, 60, 60, 1);
    transform: scale(1.2);
}

@keyframes pulse {
    0%, 100% { opacity: 0.6; }
    50% { opacity: 1; }
}

/* 3D Canvas for Landing Animation */
.landing-canvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 10001;
    cursor: pointer;
}

/* Interactive Area Overlay (for click detection) */
.interactive-area {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 10002;
    cursor: pointer;
    outline: none;
}

.interactive-area.captured {
    cursor: default;
    pointer-events: none;
}

.menu-container {
    position: absolute;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    z-index: 10003; 
    transform: translate(-50%, -50%) scale(0);
    transition: opacity 0.5s ease 0.4s, transform 0.5s ease 0.4s;
    transform-origin: center center;
}

.menu-container.active {
    opacity: 1;
    visibility: visible;
    transform: translate(-50%, -50%) scale(1);
}

/* Landing Menu Links */
.landing-menu {
    display: flex;
    flex-direction: column;
    gap: 25px;
    text-align: center;
}

.landing-menu .menu-item {
    color: var(--white);
    text-decoration: none;
    font-size: 1.1rem;
    font-weight: 500;
    letter-spacing: 0.5px;
    display: block;
    text-align: center;
    padding: 12px 20px;
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.5s cubic-bezier(0.68, -0.55, 0.27, 1.55);
}

.landing-menu .menu-item:hover {
    color: var(--primary-color);
    transform: translateY(20px) scale(1.05);
}

/* Individual link fade in effect */
.menu-container.active .menu-item {
    opacity: 1;
    transform: translateY(0);
}

.menu-container.active .menu-item:nth-child(1) { transition-delay: 0.6s; }
.menu-container.active .menu-item:nth-child(2) { transition-delay: 0.7s; }
.menu-container.active .menu-item:nth-child(3) { transition-delay: 0.8s; }
.menu-container.active .menu-item:nth-child(4) { transition-delay: 0.9s; }


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

html {
    scroll-behavior: smooth;
}

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

.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

a {
    text-decoration: none;
    color: inherit;
    transition: var(--transition);
}

ul {
    list-style: none;
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

.btn {
    display: inline-block;
    padding: 12px 30px;
    background: var(--secondary-color);
    color: var(--white);
    text-decoration: none;
    border-radius: 4px;
    transition: var(--transition);
    border: 2px solid var(--secondary-color);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    box-shadow: 0 4px 10px rgba(90, 90, 90, 0.3);
}

.btn:hover {
    background: var(--dark-gray);
    transform: translateY(-2px);
    box-shadow: 0 6px 15px rgba(90, 90, 90, 0.5);
}

.btn-outline {
    background-color: transparent;
    color: var(--secondary-color);
    border: 2px solid var(--secondary-color);
    box-shadow: none;
}

.btn-outline:hover {
    background-color: var(--secondary-color);
    color: var(--white);
}

.text-center {
    text-align: center;
}

section {
    padding: 100px 0;
}

/* Staggered Animation Classes */
.animate-item {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

.animate-item.visible {
    opacity: 1;
    transform: translateY(0);
}

/* Stagger delays for grid items */
.projects-grid .project-card:nth-child(1) { animation-delay: 0.1s; }
.projects-grid .project-card:nth-child(2) { animation-delay: 0.2s; }
.projects-grid .project-card:nth-child(3) { animation-delay: 0.3s; }

.services-grid .service-card:nth-child(1) { animation-delay: 0.1s; }
.services-grid .service-card:nth-child(2) { animation-delay: 0.2s; }
.services-grid .service-card:nth-child(3) { animation-delay: 0.3s; }

h1, h2, h3, h4, h5, h6 {
    font-weight: 700;
    line-height: 1.3;
    margin-bottom: 20px;
}

h1 {
    font-size: 3.5rem;
}

h2 {
    font-size: 2.5rem;
    margin-bottom: 50px;
    position: relative;
    display: inline-block;
}

h2:after {
    content: '';
    position: absolute;
    bottom: -15px;
    left: 0;
    width: 60px;
    height: 3px;
    background-color: var(--medium-gray);
}

p {
    margin-bottom: 20px;
    color: #666;
}

/* Navigation */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    padding: 20px 0;
    background-color: var(--white);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    z-index: 1000;
    transition: var(--transition);
}

.navbar.scrolled {
    padding: 15px 0;
    background-color: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(10px);
}

.navbar .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-size: 24px;
    font-weight: 700;
    color: var(--primary-color);
    letter-spacing: 2px;
}

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

.nav-links a {
    font-weight: 500;
    color: var(--text-color);
    position: relative;
}

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

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

.hamburger {
    display: none;
    flex-direction: column;
    justify-content: space-between;
    width: 30px;
    height: 20px;
    cursor: pointer;
}

.hamburger span {
    display: block;
    width: 100%;
    height: 2px;
    background-color: var(--primary-color);
    transition: var(--transition);
}

/* Hero Section */
.hero {
    background-color: var(--light-bg);
    color: var(--text-color);
    min-height: 80vh;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding-top: 100px;
    /* Subtle background pattern for texture */
    background-image: radial-gradient(#d5d5d5 1px, transparent 1px);
    background-size: 20px 20px;
}

.hero-content {
    max-width: 800px;
    margin: 0 auto;
    padding: 0 20px;
}

.hero-content h1 {
    font-size: 3.5rem;
    font-weight: 700;
    position: relative;
    padding-bottom: 20px;
    margin-bottom: 15px;
    animation: fadeInUp 1s ease;
}

/* Dynamic Divider */
.hero-content h1::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 3px;
    background-color: var(--medium-gray);
    transition: width 0.5s var(--transition);
}

/* Subtle Hover Effect on Title */
.hero-content:hover h1::after {
    width: 150px;
}

.hero p {
    font-size: 1.2rem;
    margin-bottom: 40px;
    color: var(--text-color);
    opacity: 0.9;
    animation: fadeInUp 1s ease 0.2s;
    animation-fill-mode: both;
}

.hero .btn {
    animation: fadeInUp 1s ease 0.4s;
    animation-fill-mode: both;
}

/* Featured Projects */
.featured-projects {
    background-color: var(--light-gray);
}

.projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
    margin-bottom: 50px;
}

.project-card {
    background: var(--white);
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
    transition: var(--transition);
    text-align: left;
    transform-style: preserve-3d;
    will-change: transform, box-shadow;
    position: relative;
}

.project-card:hover {
    transform: perspective(1000px) rotateX(1deg) translateY(-8px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15);
}

.project-card img {
    width: 100%;
    height: auto;
    display: block;
    transition: transform 0.8s ease-out;
}

.project-card:hover img {
    transform: scale(1.05);
}

.project-info {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    padding: 30px;
    background: linear-gradient(transparent, rgba(0, 0, 0, 0.8));
    color: var(--white);
}

.project-info h3 {
    margin-bottom: 5px;
    font-size: 1.5rem;
}

.project-info p {
    margin: 0;
    color: rgba(255, 255, 255, 0.8);
}

/* About Preview */
.about-preview {
    background-color: var(--primary-color);
    overflow: hidden;
    color: var(--white);
}

.about-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0;
    align-items: center;
    position: relative;
}

.about-content::before {
    content: '';
    position: absolute;
    top: -50%;
    left: 50%;
    width: 3px;
    height: 200%;
    background: linear-gradient(to bottom, transparent, var(--accent-vibrant), transparent);
    transform: translateX(-50%) rotate(15deg);
    opacity: 0.6;
    box-shadow: 0 0 20px var(--accent-vibrant);
}

.about-text {
    padding: 60px;
    background: var(--primary-color);
    position: relative;
    z-index: 1;
    color: var(--white);
}

.about-text h2 {
    margin-bottom: 30px;
    color: var(--white);
}

.about-text p {
    margin-bottom: 30px;
    font-size: 1.1rem;
    line-height: 1.8;
    color: rgba(255, 255, 255, 0.9);
}

.about-text .btn {
    margin-top: 10px;
}

.about-image {
    position: relative;
    overflow: visible;
    padding: 40px;
    background: var(--dark-gray);
}

.about-image img {
    width: 100%;
    height: auto;
    transition: all 0.5s ease;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    transform: perspective(1000px) rotateY(-5deg);
}

.about-image:hover img {
    transform: perspective(1000px) rotateY(0deg) translateX(-10px);
    box-shadow: 0 30px 80px rgba(0, 0, 0, 0.4);
}

/* Services */
.services {
    background-color: var(--light-bg);
    text-align: center;
}

.services-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 30px;
    margin-top: 50px;
}

.service-card {
    position: relative;
    overflow: hidden;
    padding: 40px;
    z-index: 1;
    border: 1px solid rgba(0, 0, 0, 0.1);
    border-radius: 8px;
    background-color: var(--light-bg);
    transition: var(--transition);
    text-align: left;
}

.service-card i {
    font-size: 30px;
    color: var(--medium-gray);
    margin-bottom: 15px;
    transition: var(--transition);
    position: relative;
    z-index: 2;
}

.service-card h3 {
    margin-bottom: 15px;
    font-size: 1.5rem;
    position: relative;
    z-index: 2;
}

.service-card p {
    margin-bottom: 0;
    position: relative;
    z-index: 2;
}

/* Ghost Icon Logic */
.service-card::before {
    content: attr(data-icon);
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
    position: absolute;
    top: -10px;
    right: -10px;
    font-size: 160px;
    color: rgba(44, 62, 80, 0.05);
    z-index: 0;
    transition: var(--transition);
    transform: rotate(10deg);
}

.service-card:hover {
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.1);
    transform: translateY(-5px);
    background-color: var(--white);
}

.service-card:hover::before {
    color: rgba(112, 112, 112, 0.15);
    transform: rotate(0deg) scale(1.05);
}

/* Testimonials */
.testimonials {
    background-color: var(--white);
    text-align: center;
}

.testimonial-slider-wrapper {
    position: relative;
    max-width: 900px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    gap: 20px;
}

.testimonial-slider {
    flex: 1;
    position: relative;
    overflow: hidden;
    min-height: 300px;
}

.testimonial {
    padding: 40px;
    background-color: var(--light-bg);
    border-radius: 8px;
    position: absolute;
    width: 100%;
    opacity: 0;
    visibility: hidden;
    transform: translateX(100%);
    transition: all 0.5s ease;
}

.testimonial.active {
    opacity: 1;
    visibility: visible;
    transform: translateX(0);
    position: relative;
}

.testimonial.prev {
    transform: translateX(-100%);
}

.testimonial p {
    font-size: 1.2rem;
    font-style: italic;
    margin-bottom: 30px;
    position: relative;
}

.testimonial p:before {
    content: '"\201C"';
    font-size: 5rem;
    color: var(--medium-gray);
    position: absolute;
    left: -30px;
    top: -30px;
    font-family: serif;
    opacity: 0.3;
}

.client h4 {
    color: var(--primary-color);
    margin-bottom: 5px;
}

.client p {
    color: #777;
    margin: 0;
    font-size: 0.9rem;
}

/* Testimonial Navigation */
.testimonial-nav {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    border: 2px solid var(--medium-gray);
    background: var(--white);
    color: var(--medium-gray);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    flex-shrink: 0;
}

.testimonial-nav:hover {
    background: var(--medium-gray);
    color: var(--white);
    transform: scale(1.1);
}

.testimonial-nav:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

.testimonial-nav:disabled:hover {
    background: var(--white);
    color: var(--medium-gray);
    transform: scale(1);
}

/* Testimonial Dots */
.testimonial-dots {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-top: 30px;
}

.testimonial-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: #ddd;
    border: none;
    cursor: pointer;
    transition: all 0.3s ease;
    padding: 0;
}

.testimonial-dot.active {
    background: var(--medium-gray);
    width: 30px;
    border-radius: 6px;
}

.testimonial-dot:hover {
    background: var(--medium-gray);
    opacity: 0.7;
}

/* Contact CTA */
.contact-cta {
    background: linear-gradient(rgba(0, 0, 0, 0.7), rgba(0, 0, 0, 0.7)), url('../images/cta-bg.jpg') center/cover no-repeat;
    color: var(--white);
    text-align: center;
    padding: 100px 0;
}

.contact-cta h2 {
    color: var(--white);
    margin-bottom: 20px;
}

.contact-cta p {
    max-width: 700px;
    margin: 0 auto 40px;
    color: rgba(255, 255, 255, 0.9);
    font-size: 1.1rem;
}

/* Footer */
.footer {
    background-color: #1a1a1a;
    color: #999;
    padding: 80px 0 0;
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 40px;
    margin-bottom: 60px;
}

.footer-about h3 {
    color: var(--white);
    font-size: 24px;
    margin-bottom: 20px;
}

.footer-about p {
    color: #999;
    margin-bottom: 20px;
}

.footer-links h4,
.footer-contact h4 {
    color: var(--white);
    font-size: 18px;
    margin-bottom: 25px;
    position: relative;
    padding-bottom: 10px;
}

.footer-links h4:after,
.footer-contact h4:after {
    content: '';
    position: absolute;
    left: 0;
    bottom: 0;
    width: 40px;
    height: 2px;
    background-color: var(--medium-gray);
}

.footer-links ul li {
    margin-bottom: 10px;
}

.footer-links a {
    color: #999;
    transition: var(--transition);
}

.footer-links a:hover {
    color: var(--medium-gray);
    padding-left: 5px;
}

.footer-contact p {
    display: flex;
    align-items: center;
    margin-bottom: 15px;
    color: #999;
}

.footer-contact i {
    margin-right: 10px;
    color: var(--medium-gray);
    width: 20px;
    text-align: center;
}

.footer-bottom {
    border-top: 1px solid #333;
    padding: 20px 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
}

.footer-bottom p {
    margin: 0;
    font-size: 14px;
}

.social-links {
    display: flex;
    gap: 15px;
}

.social-links a {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background-color: #333;
    color: var(--white);
    transition: var(--transition);
}

.social-links a:hover {
    background-color: var(--medium-gray);
    transform: translateY(-3px);
}

/* Back to Top Button */
.back-to-top {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 50px;
    height: 50px;
    background-color: var(--medium-gray);
    color: white;
    border: none;
    border-radius: 50%;
    font-size: 20px;
    cursor: pointer;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 999;
}

.back-to-top:hover {
    background-color: var(--primary-color);
    transform: translateY(-5px);
}

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

/* Responsive Styles */
@media (max-width: 992px) {
    h1 {
        font-size: 3rem;
    }
    
    h2 {
        font-size: 2.2rem;
    }
    
    .about-content {
        grid-template-columns: 1fr;
    }
    
    .about-image {
        order: -1;
    }
}

/* ==================== STUDIO SIGNATURE ==================== */
/* Architectural Monograph Stamp - High-detail metadata element */
#studio-signature {
    position: fixed;
    bottom: 30px;
    right: 30px;
    padding: 0;
    font-family: 'Montserrat', sans-serif;
    font-size: 0.7rem;
    font-weight: 300; /* Lightest weight for subtlety */
    letter-spacing: 0.3em; /* High letter spacing for architectural feel */
    color: var(--light-gray); /* Incredibly subtle but legible */
    z-index: 15; /* Above canvas but below any modals */
    pointer-events: none; /* Non-interactive watermark */
    user-select: none; /* Cannot be selected */
    opacity: 1; /* Full opacity, color provides subtlety */
    text-transform: uppercase;
    line-height: 1.6;
}

@media (max-width: 768px) {
    .nav-links {
        position: fixed;
        top: 80px;
        left: -100%;
        width: 100%;
        height: calc(100vh - 80px);
        background-color: var(--white);
        flex-direction: column;
        align-items: center;
        justify-content: center;
        transition: var(--transition);
        z-index: 999;
    }
    
    .nav-links.active {
        left: 0;
    }
    
    .hamburger {
        display: flex;
    }
    
    .hamburger span {
        transition: all 0.3s ease;
    }
    
    .hamburger.active span:nth-child(1) {
        transform: translateY(9px) rotate(45deg);
    }
    
    .hamburger.active span:nth-child(2) {
        opacity: 0;
    }
    
    .hamburger.active span:nth-child(3) {
        transform: translateY(-9px) rotate(-45deg);
    }
    
    .hero h1 {
        font-size: 2.5rem;
    }
    
    .hero p {
        font-size: 1rem;
    }
    
    section {
        padding: 70px 0;
    }
    
    .project-info {
        padding: 20px;
    }
    
    .project-info h3 {
        font-size: 1.2rem;
    }
    
    .project-info p {
        font-size: 0.9rem;
    }
    
    /* Testimonial slider mobile adjustments */
    .testimonial-slider-wrapper {
        flex-direction: column;
        gap: 15px;
    }
    
    .testimonial-nav {
        display: none; /* Hide arrows on mobile, use swipe instead */
    }
    
    /* Studio signature mobile adjustment */
    #studio-signature {
        font-size: 10px !important; /* Type scale: 10px */
        letter-spacing: 0.2em !important;
        bottom: 20px !important;
        right: 20px !important;
    }
    
    .testimonial {
        padding: 30px 20px;
    }
    
    .testimonial p:before {
        font-size: 3rem;
        left: -10px;
        top: -20px;
    }
    
    /* Landing overlay mobile */
    .skip-intro {
        bottom: 20px;
        right: 20px;
        font-size: 1rem;
    }
    
    .landing-hint {
        bottom: 20px;
        left: 20px;
        gap: 10px;
    }
    
    .landing-hint i {
        font-size: 1rem;
    }
    
    .footer-content {
        grid-template-columns: 1fr;
        text-align: center;
    }
    
    .footer-links h4:after,
    .footer-contact h4:after {
        left: 50%;
        transform: translateX(-50%);
    }
    
    .footer-contact p {
        justify-content: center;
    }
    
    .footer-bottom {
        flex-direction: column;
        text-align: center;
        gap: 20px;
    }
    
    .social-links {
        margin-top: 20px;
    }
}

@media (max-width: 576px) {
    h1 {
        font-size: 2.2rem;
    }
    
    h2 {
        font-size: 1.8rem;
    }
    
    .btn {
        padding: 10px 20px;
        font-size: 12px;
    }
    
    .projects-grid {
        grid-template-columns: 1fr;
    }
    
    .service-card {
        padding: 30px 20px;
    }
    
    .testimonial {
        padding: 30px 20px;
    }
    
    .testimonial p:before {
        font-size: 4rem;
        left: -10px;
        top: -20px;
    }
}

/* ==================== ENHANCED RESPONSIVE & MOBILE OPTIMIZATION ==================== */

/* Lazy loading styles */
.lazy-load {
    position: relative;
    background-color: #e8e8e8;
    background-size: cover;
    background-position: center;
    min-height: 200px;
    transition: opacity 0.3s ease;
}

.lazy-load .image-loader {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: #999;
    font-size: 12px; /* Type scale: 12px */
}

.lazy-load.loaded .image-loader {
    display: none;
}

.lazy-load.error {
    background-color: #f0f0f0;
}

.lazy-load .image-error {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: #999;
    font-size: 12px; /* Type scale: 12px */
}

/* Hero image specific */
.hero-image.lazy-load {
    min-height: 400px;
}

/* Project navigation */
.project-navigation {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 60px;
    padding-top: 40px;
    border-top: 1px solid #e8e8e8;
}

.nav-button {
    padding: 12px 24px;
    background: var(--primary-color);
    color: white;
    border-radius: 4px;
    font-size: 12px; /* Type scale: 12px */
    font-weight: 500;
    letter-spacing: 0.5px;
    transition: all 0.3s ease;
}

.nav-button:hover {
    background: var(--secondary-color);
    transform: translateY(-2px);
}

/* Error message */
.error-message {
    text-align: center;
    padding: 100px 20px;
}

.error-message h2 {
    font-size: 20px; /* Type scale: 20px */
    margin-bottom: 20px;
    color: var(--text-color);
}

.error-message p {
    font-size: 14px; /* Type scale: 14px */
    margin-bottom: 30px;
    color: var(--medium-gray);
}

.error-message .button {
    display: inline-block;
    padding: 12px 30px;
    background: var(--primary-color);
    color: white;
    border-radius: 4px;
    transition: all 0.3s ease;
}

.error-message .button:hover {
    background: var(--secondary-color);
}

/* Loading state */
.loading {
    text-align: center;
    padding: 80px 40px; /* Grid-aligned */
    font-size: 14px; /* Type scale: 14px */
    color: var(--medium-gray);
}

/* ==================== TABLET OPTIMIZATION (768px - 1024px) ==================== */
@media (max-width: 1024px) {
    .project-container {
        padding: 120px 40px 80px 40px; /* Grid-aligned: 1.5x desktop spacing */
    }
    
    .image-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 20px;
    }
    
    .hero-image.lazy-load {
        min-height: 350px;
    }
}

/* ==================== MOBILE OPTIMIZATION (< 768px) ==================== */
@media (max-width: 768px) {
    /* Canvas menu adjustments for mobile */
    #intro-canvas {
        touch-action: none;
    }
    
    /* Project container mobile */
    .project-container {
        padding: 120px 40px 80px 40px; /* Grid-aligned: maintain 40px rhythm */
    }
    
    .project-header {
        margin-bottom: 40px;
    }
    
    .project-title {
        font-size: 10px; /* Type scale: 10px */
    }
    
    .project-name {
        font-size: 24px; /* Type scale: 24px */
    }
    
    .project-meta {
        font-size: 12px; /* Type scale: 12px */
    }
    
    /* Hero image mobile */
    .hero-image {
        height: 300px;
        margin-bottom: 40px;
    }
    
    .hero-image.lazy-load {
        min-height: 300px;
    }
    
    /* Description mobile */
    .project-description {
        margin-bottom: 40px;
    }
    
    .project-description p {
        font-size: 16px; /* Type scale: 16px */
        line-height: 1.6;
    }
    
    /* Image grid mobile - stack vertically */
    .image-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .grid-image {
        height: 250px;
    }
    
    /* Project details mobile */
    .project-details {
        margin-top: 40px;
    }
    
    .detail-row {
        padding: 15px 0;
    }
    
    .detail-label,
    .detail-value {
        font-size: 12px; /* Type scale: 12px */
    }
    
    /* Navigation mobile */
    .project-navigation {
        flex-direction: column;
        gap: 15px;
        margin-top: 40px;
    }
    
    .nav-button {
        width: 100%;
        text-align: center;
    }
    
    /* Touch-friendly tap targets */
    .nav-button,
    .menu-item,
    a {
        min-height: 44px;
        min-width: 44px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
    }
}

/* ==================== SMALL MOBILE (< 480px) ==================== */
@media (max-width: 480px) {
    .project-name {
        font-size: 20px; /* Type scale: 20px */
    }
    
    .hero-image,
    .hero-image.lazy-load {
        height: 250px;
        min-height: 250px;
    }
    
    .grid-image {
        height: 200px;
    }
    
    .project-description p {
        font-size: 14px; /* Type scale: 14px */
    }
    
    #studio-signature {
        font-size: 10px !important; /* Type scale: 10px (consistent) */
        bottom: 20px !important; /* Grid-aligned */
        right: 20px !important; /* Grid-aligned */
    }
}

/* ==================== PERFORMANCE OPTIMIZATIONS ==================== */

/* Reduce motion for users who prefer it */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* Dark mode DISABLED - Site always uses light theme */
/* Commented out to prevent dark mode from affecting the site
@media (prefers-color-scheme: dark) {
    :root {
        --light-bg: #1a1a1a;
        --text-color: #e0e0e0;
        --primary-color: #f5f5f5;
        --light-gray: #2a2a2a;
    }
    
    #background-layer {
        background: #1a1a1a !important;
    }
    
    .project-container {
        background: transparent;
    }
    
    .lazy-load {
        background-color: #2a2a2a;
    }
}
*/

/* High contrast mode */
@media (prefers-contrast: high) {
    .project-title,
    .project-name,
    .project-meta {
        font-weight: 600;
    }
    
    .detail-row {
        border-bottom: 2px solid var(--text-color);
    }
}

/* Print styles */
@media print {
    #intro-canvas,
    #grid-canvas,
    #intro-container,
    #studio-signature,
    .project-navigation {
        display: none !important;
    }
    
    .project-container {
        max-width: 100%;
        padding: 0;
    }
    
    .hero-image,
    .grid-image {
        page-break-inside: avoid;
    }
}
