/* --- FOR DEBUGGING: REMOVE OR COMMENT OUT AFTER TESTING --- */
/*
body {
    border: 5px solid red !important; 
}
*/
/* --- END DEBUGGING RULE --- */


/* --- Base & Variables --- */
:root {
    --font-primary: 'Syne', sans-serif;
    --font-secondary: 'Inter', sans-serif;

    --color-bg: #0A0F1A; /* Deep space blue */
    --color-bg-light: #1E293B; /* Lighter shade for surfaces */
    --color-surface: #161E2D; /* Card backgrounds, popups */
    --color-primary-accent: #FF006A; /* Vibrant pink/magenta */
    --color-secondary-accent: #00F2EA; /* Bright cyan/teal */
    --color-text: #E0E0E0; /* Main text color, off-white */
    --color-text-muted: #94A3B8; /* Subdued text, subtitles */
    --color-text-dark: #0A0F1A; /* Text on light backgrounds (e.g., buttons) */
    --color-border: rgba(255, 255, 255, 0.1); /* Subtle borders */
    --color-white: #FFFFFF;
    --color-black: #000000;

    --header-height: 80px;
    --border-radius: 8px;
    --transition-smooth: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    --transition-bounce: all 0.5s cubic-bezier(0.68, -0.55, 0.27, 1.55);
    --shadow-soft: 0 4px 15px rgba(0, 0, 0, 0.2);
    --shadow-medium: 0 8px 25px rgba(0, 0, 0, 0.3);
    --shadow-hard: 0 12px 35px rgba(0, 0, 0, 0.4);
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; font-size: 16px; }
body {
    background-color: var(--color-bg);
    color: var(--color-text);
    font-family: var(--font-secondary), -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    line-height: 1.6;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    cursor: none; /* Managed by JS for custom cursor */
}
body.no-scroll { overflow: hidden; }
a { text-decoration: none; color: var(--color-secondary-accent); transition: var(--transition-smooth); }
a:hover { color: var(--color-primary-accent); }
img { max-width: 100%; height: auto; display: block; }
.container { width: 90%; max-width: 1200px; margin: 0 auto; padding: 0 20px; }

.section-title {
    font-family: var(--font-primary);
    font-size: clamp(2.5rem, 5vw, 3.5rem);
    font-weight: 800;
    color: var(--color-white);
    margin-bottom: 1rem;
    line-height: 1.2;
    text-align: center;
}
.section-title .highlight { color: var(--color-primary-accent); }
.section-subtitle {
    font-size: clamp(1rem, 2.5vw, 1.1rem);
    color: var(--color-text-muted);
    max-width: 700px;
    margin: 0 auto 3rem auto;
    text-align: center;
    line-height: 1.6;
}

/* --- Custom Cursor --- */
.cursor-dot, .cursor-outline { pointer-events: none; position: fixed; top: 50%; left: 50%; border-radius: 50%; opacity: 0; transform: translate(-50%, -50%); transition: opacity 0.3s ease-in-out, transform 0.2s ease-in-out; z-index: 9999; }
.cursor-dot { width: 8px; height: 8px; background-color: var(--color-primary-accent); }
.cursor-outline { width: 30px; height: 30px; border: 2px solid var(--color-secondary-accent); mix-blend-mode: difference; }
body:hover .cursor-dot, body:hover .cursor-outline { opacity: 1; } /* Only show if JS is running and body is hovered */
body.cursor-hover .cursor-dot { transform: translate(-50%, -50%) scale(1.5); background-color: var(--color-secondary-accent); }
body.cursor-hover .cursor-outline { transform: translate(-50%, -50%) scale(1.8); border-color: var(--color-primary-accent); }
body.cursor-text-hover .cursor-outline { transform: translate(-50%, -50%) scale(2.2); border-width: 1px; }


/* --- Header Styles --- */
#main-header { display: flex; justify-content: space-between; align-items: center; padding: 0 5%; height: var(--header-height); position: fixed; width: 100%; top: 0; left: 0; z-index: 1000; background-color: transparent; transition: background-color 0.4s ease, box-shadow 0.4s ease; }
#main-header.scrolled { background-color: rgba(10, 15, 26, 0.85); backdrop-filter: blur(10px); box-shadow: 0 2px 10px rgba(0,0,0,0.2); }
.logo { font-family: var(--font-primary); font-weight: 800; font-size: 1.8rem; color: var(--color-white); letter-spacing: -1px; }
#main-nav { display: flex; gap: 40px; }
#main-nav a { color: var(--color-text-muted); font-weight: 600; font-size: 0.9rem; text-transform: uppercase; letter-spacing: 0.05em; position: relative; padding: 10px 0; }
#main-nav a::before { content: attr(data-text); position: absolute; top: 10px; left: 0; height: 100%; overflow: hidden; color: var(--color-primary-accent); transition: var(--transition-smooth); width: 0; }
#main-nav a:hover::before { width: 100%; }
#main-nav a:hover { color: var(--color-text); } /* Keep original text visible slightly for effect */
#main-nav a.active { color: var(--color-primary-accent); }
#main-nav a.active::before { width: 100%; } /* Ensure active link also shows hover effect */

.menu-btn { background: none; border: none; cursor: pointer; display: none; z-index: 1005; padding: 10px; flex-direction: column; justify-content: space-around; width: 30px; height: 24px; }
.menu-btn span { display: block; width: 100%; height: 2px; background-color: var(--color-white); border-radius: 2px; transition: all 0.3s cubic-bezier(0.645, 0.045, 0.355, 1); }
.menu-btn.active span:nth-child(1) { transform: rotate(45deg) translate(5px, 5px); }
.menu-btn.active span:nth-child(2) { opacity: 0; }
.menu-btn.active span:nth-child(3) { transform: rotate(-45deg) translate(5px, -5px); }

/* --- Hero Section --- */
.hero { min-height: 100vh; display: flex; flex-direction: column; align-items: center; justify-content: center; position: relative; overflow: hidden; padding: var(--header-height) 5% 5%; text-align: center; }
.hero-background-canvas { position: absolute; top: 0; left: 0; width: 100%; height: 100%; z-index: -1; background: radial-gradient(ellipse at bottom, var(--color-bg-light) 0%, var(--color-bg) 70%); }
.hero-content-wrapper { position: relative; z-index: 1; }
.hero-main-title-container { position: relative; margin-bottom: 1.5rem; }
.hero-title-background { font-family: var(--font-primary); font-size: clamp(6rem, 20vw, 15rem); font-weight: 800; color: rgba(255, 255, 255, 0.03); line-height: 0.85; letter-spacing: -0.05em; text-transform: uppercase; user-select: none; opacity: 0; transform: scale(1.2); animation: heroBgTextAnim 1.5s 0.5s forwards cubic-bezier(0.16, 1, 0.3, 1); display: inline-block; padding-bottom: 0.05em; }
@keyframes heroBgTextAnim { to { opacity: 1; transform: scale(1); } }
.hero-title-foreground { font-family: var(--font-primary); font-size: clamp(3rem, 8vw, 6rem); font-weight: 800; color: var(--color-white); line-height: 1; letter-spacing: -0.02em; position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); white-space: nowrap; background: linear-gradient(135deg, var(--color-primary-accent), var(--color-secondary-accent)); -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text; text-fill-color: transparent; animation: heroFgTextAnim 1s 1s forwards, gradientShimmer 5s ease infinite alternate; animation-delay: 1s, 2s; opacity: 0; background-size: 200% 100%; /* For gradientShimmer */ }
@keyframes heroFgTextAnim { from { opacity: 0; transform: translate(-50%, -30%); } to { opacity: 1; transform: translate(-50%, -50%); } }
@keyframes gradientShimmer { 0% { background-position: 0% 50%; } 100% { background-position: 100% 50%; } }

/* Keyframe for hero description and list items animations */
@keyframes fadeInUp {
    from { opacity: 0; /* transform will be inherited from element's initial state */ }
    to   { opacity: 1; transform: translateY(0); }
}

.hero-subtitle { font-size: clamp(1.1rem, 3vw, 1.5rem); color: var(--color-text-muted); max-width: 600px; margin: 0 auto 1.5rem auto; line-height: 1.6; font-weight: 400; }
.hero-services-list { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px 25px; margin: 2rem auto 2.5rem auto; max-width: 800px; }
.hero-service-item { font-family: var(--font-primary); font-size: clamp(1.2rem, 2.8vw, 1.8rem); font-weight: 700; color: var(--color-text); opacity: 0; transform: translateY(15px); animation: fadeInUp 0.6s forwards cubic-bezier(0.16, 1, 0.3, 1); position: relative; padding: 5px 0; }
.hero-services-list .hero-service-item:nth-child(1) { animation-delay: 1.3s; }
.hero-services-list .hero-service-item:nth-child(2) { animation-delay: 1.45s; }
.hero-services-list .hero-service-item:nth-child(3) { animation-delay: 1.6s; }
.hero-services-list .hero-service-item:nth-child(4) { animation-delay: 1.75s; }
.hero-service-item:not(:last-child)::after { content: '•'; color: var(--color-primary-accent); position: absolute; right: -15px; top: 50%; transform: translateY(-50%); font-size: 0.9em; }

.animated-text { opacity: 0; transform: translateY(20px); animation: fadeInUp 0.8s forwards cubic-bezier(0.16, 1, 0.3, 1); }
.hero-subtitle.animated-text { animation-delay: 1.2s; }
.hero-cta.animated-text { animation-delay: 1.9s; }

/* --- CTA Button --- */
.cta-button { display: inline-flex; align-items: center; gap: 10px; font-family: var(--font-primary); font-weight: 700; font-size: 1rem; padding: 12px 28px; border-radius: 50px; color: var(--color-bg); background: linear-gradient(135deg, var(--color-primary-accent), var(--color-secondary-accent)); background-size: 200% 100%; border: none; cursor: pointer; transition: var(--transition-smooth), background-position 0.5s ease, transform 0.2s ease; box-shadow: 0 4px 15px rgba(255, 0, 106, 0.3); position: relative; overflow: hidden; }
.cta-button::before { content: ''; position: absolute; top: 0; left: -100%; width: 50%; height: 100%; background: linear-gradient(90deg, transparent, rgba(255,255,255,0.4), transparent); transition: left 0.7s ease; }
.cta-button:hover::before { left: 150%; }
.cta-button:hover { background-position: right center; transform: translateY(-3px) scale(1.02); box-shadow: 0 8px 20px rgba(0, 242, 234, 0.3); color: var(--color-bg); }
.cta-button .arrow { transition: transform 0.3s ease; font-size: 1.2em; }
.cta-button:hover .arrow { transform: translateX(5px); }
.cta-button.large { padding: 18px 40px; font-size: 1.2rem; }

/* --- Stats Section --- */
.stats-section { padding: 100px 0; background-color: var(--color-bg-light); }
.stats-heading { display: flex; justify-content: space-between; align-items: center; margin-bottom: 80px; flex-wrap: wrap; gap: 20px;}
.stats-section-title { text-align: left; flex-grow: 1; margin-bottom: 0; font-size: clamp(2rem, 4vw, 2.5rem); color: var(--color-white); }
.stats-container { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 40px; }
.stat-item { padding: 20px; text-align: left; }
.stat-number { font-family: var(--font-primary); font-size: clamp(3rem, 7vw, 4rem); font-weight: 800; color: var(--color-secondary-accent); line-height: 1; margin-bottom: 10px; }
.stat-label { font-family: var(--font-secondary); font-weight: 600; font-size: 1.1rem; color: var(--color-white); margin-bottom: 8px; }
.stat-desc { font-size: 0.9rem; color: var(--color-text-muted); line-height: 1.6; }

/* --- Philosophy Section --- */
.philosophy-section { padding: 120px 0; overflow: hidden; text-align: center; }
.philosophy-title { font-family: var(--font-primary); font-size: clamp(3rem, 7vw, 4.5rem); font-weight: 800; color: var(--color-white); line-height: 1.1; margin-bottom: 60px; }
.philosophy-title span { display: block; }
.philosophy-visual-wrapper { max-width: 750px; margin: 0 auto; border-radius: var(--border-radius); overflow: hidden; box-shadow: var(--shadow-medium); }
.philosophy-img { width: 100%; display: block; }

/* --- Services Section --- */
.services-section { padding: 100px 0; background-color: var(--color-bg-light); }
.services-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 30px; margin-top: 60px; }
.service-card { background-color: var(--color-surface); padding: 35px; border-radius: var(--border-radius); border: 1px solid var(--color-border); transition: transform 0.4s var(--transition-bounce), box-shadow 0.4s ease; display: flex; flex-direction: column; align-items: center; text-align: center; }
.service-card:hover { transform: translateY(-10px) scale(1.02); box-shadow: 0 0 40px rgba(0, 242, 234, 0.15); border-color: var(--color-secondary-accent); }
.service-card-image { width: 100%; max-width: 300px; margin-bottom: 20px; border-radius: 5px; object-fit: cover; }
.service-icon { color: var(--color-secondary-accent); margin-bottom: 20px; display: inline-block; }
.service-icon svg { width: 40px; height: 40px; }
.service-title { font-family: var(--font-primary); font-size: 1.5rem; font-weight: 700; color: var(--color-primary-accent); margin-bottom: 15px; }
.service-desc { font-size: 0.95rem; color: var(--color-text-muted); line-height: 1.6; margin-bottom: 20px; flex-grow: 1; }
.service-feature-list { list-style: none; padding-left: 0; margin-top: auto; text-align: left; width: 100%; align-self: flex-start; }
.service-feature-list li { font-size: 0.9rem; color: var(--color-text); margin-bottom: 10px; display: flex; align-items: center; }
.service-feature-list li::before { content: "✓"; color: var(--color-primary-accent); font-weight: bold; margin-right: 10px; font-size: 1.1em; }

/* --- Projects Section --- */
.projects-section { padding: 100px 0; }
.projects-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 40px; flex-wrap: wrap; gap: 20px; }
.projects-section-title { text-align: left; flex-grow: 1; margin-bottom: 0; font-size: clamp(2rem, 4vw, 3rem); color: var(--color-white); }
.project-filter-pills { display: flex; gap: 10px; }
.filter-pill { background-color: transparent; border: 1px solid var(--color-border); color: var(--color-text-muted); padding: 8px 18px; border-radius: 20px; font-size: 0.85rem; font-weight: 500; cursor: pointer; transition: var(--transition-smooth); }
.filter-pill:hover { background-color: var(--color-secondary-accent); border-color: var(--color-secondary-accent); color: var(--color-bg); }
.filter-pill.active { background-color: var(--color-primary-accent); border-color: var(--color-primary-accent); color: var(--color-white); }
.projects-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 35px; }
.project-card { background-color: var(--color-surface); border-radius: var(--border-radius); overflow: hidden; position: relative; cursor: pointer; box-shadow: var(--shadow-soft); transition: transform 0.4s var(--transition-bounce), box-shadow 0.4s ease; aspect-ratio: 4 / 3; }
.project-card:hover { transform: translateY(-10px) scale(1.03); box-shadow: var(--shadow-hard); }
.project-card-image-wrapper { width: 100%; height: 100%; overflow: hidden; }
.project-card img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.8s cubic-bezier(0.165, 0.84, 0.44, 1); }
.project-card:hover img { transform: scale(1.1); }
.project-card-overlay { position: absolute; bottom: 0; left: 0; right: 0; padding: 25px; background: linear-gradient(to top, rgba(10, 15, 26, 0.95) 20%, rgba(10, 15, 26, 0.7) 60%, transparent); color: var(--color-white); transform: translateY(30%); opacity: 0; transition: transform 0.4s ease, opacity 0.4s ease; }
.project-card:hover .project-card-overlay { transform: translateY(0); opacity: 1; }
.project-card-title { font-family: var(--font-primary); font-weight: 700; font-size: 1.3rem; margin-bottom: 5px; }
.project-card-category { font-size: 0.85rem; color: var(--color-text-muted); margin-bottom: 15px; text-transform: uppercase; letter-spacing: 0.05em; }
.project-card-cta { font-weight: 600; color: var(--color-secondary-accent); display: inline-flex; align-items: center; gap: 5px; }
.project-card-cta .arrow { transition: transform 0.3s ease; }
.project-card:hover .project-card-cta .arrow { transform: translateX(3px); }

/* --- CTA Banner Section --- */
.cta-banner-section { padding: 100px 0; background: linear-gradient(rgba(10,15,26,0.8), rgba(10,15,26,0.8)), url('https://images.unsplash.com/photo-1519681393784-d120267933ba?ixlib=rb-4.0.3&ixid=M3wxMjA3fDB8MHxzZWFyY2h8MTJ8fGFic3RyYWN0JTIwZGFyayUyMGJhY2tncm91bmR8ZW58MHx8MHx8fDA%3D&auto=format&fit=crop&w=1500&q=80') no-repeat center center; background-size: cover; background-attachment: fixed; }
.cta-banner-content { text-align: center; max-width: 800px; margin: 0 auto; }
.cta-banner-content h2 { font-family: var(--font-primary); font-size: clamp(2.5rem, 5vw, 3.5rem); font-weight: 800; color: var(--color-white); margin-bottom: 1.5rem; }
.cta-banner-content p { font-size: 1.1rem; color: var(--color-text-muted); margin-bottom: 2.5rem; }

/* --- Footer --- */
footer { padding: 80px 0 30px; background-color: var(--color-bg); border-top: 1px solid var(--color-border); }
.footer-content { display: flex; flex-direction: column; align-items: center; gap: 30px; text-align: center; }
.footer-logo-tagline { margin-bottom: 20px; }
.footer-logo { font-family: var(--font-primary); font-weight: 800; font-size: 2rem; color: var(--color-white); margin-bottom: 8px; }
.footer-tagline { font-size: 0.9rem; color: var(--color-text-muted); }
.footer-nav-social { display: flex; flex-direction: column; align-items: center; gap: 30px; }
.footer-nav { display: flex; gap: 30px; flex-wrap: wrap; justify-content: center; }
.footer-nav a { color: var(--color-text-muted); font-weight: 500; font-size: 0.9rem; }
.footer-nav a:hover { color: var(--color-primary-accent); }
.social-links { display: flex; gap: 20px; }
.social-icon svg { width: 22px; height: 22px; fill: var(--color-text-muted); transition: var(--transition-smooth); }
.social-icon:hover svg { fill: var(--color-primary-accent); transform: scale(1.1) translateY(-2px); }
.copyright-footer { margin-top: 40px; padding-top: 30px; border-top: 1px solid var(--color-border); width: 100%; text-align: center; font-size: 0.85rem; color: var(--color-text-muted); }

/* --- Popups (Contact & Project) --- */
.popup-overlay { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background-color: rgba(10, 15, 26, 0.85); backdrop-filter: blur(8px); display: flex; justify-content: center; align-items: center; z-index: 2000; opacity: 0; pointer-events: none; transition: opacity 0.4s ease; }
.popup-overlay.active { opacity: 1; pointer-events: auto; }
.popup-content { background-color: var(--color-surface); padding: 40px; border-radius: var(--border-radius); box-shadow: var(--shadow-hard); width: 90%; max-width: 600px; position: relative; transform: scale(0.95) translateY(20px); transition: transform 0.4s var(--transition-bounce), opacity 0.3s ease; opacity: 0; }
.popup-overlay.active .popup-content { transform: scale(1) translateY(0); opacity: 1; }
.popup-close-btn { position: absolute; top: 15px; right: 15px; font-size: 2rem; color: var(--color-text-muted); background: none; border: none; cursor: pointer; line-height: 1; transition: color 0.3s ease, transform 0.3s ease; }
.popup-close-btn:hover { color: var(--color-primary-accent); transform: rotate(90deg); }
.popup-content h3 { font-family: var(--font-primary); font-size: 1.8rem; margin-bottom: 10px; color: var(--color-white); text-align: center; }
.popup-content > p { /* Direct child p for subtitle in contact popup */ text-align: center; color: var(--color-text-muted); margin-bottom: 30px; font-size: 0.95rem; }
.popup-form .form-group { margin-bottom: 25px; position: relative; }
.popup-form label { position: absolute; top: 14px; left: 15px; font-size: 1rem; color: var(--color-text-muted); pointer-events: none; transition: all 0.2s ease; }
.popup-form input[type="text"], .popup-form input[type="email"], .popup-form textarea { width: 100%; padding: 14px 15px; background-color: var(--color-bg); border: 1px solid var(--color-border); border-radius: 6px; font-size: 1rem; font-family: var(--font-secondary); color: var(--color-text); transition: border-color 0.3s ease, box-shadow 0.3s ease; }
.popup-form input:focus, .popup-form textarea:focus { border-color: var(--color-secondary-accent); box-shadow: 0 0 0 3px rgba(0, 242, 234, 0.2); outline: none; }
.popup-form input:focus + label, .popup-form input:not(:placeholder-shown) + label, .popup-form textarea:focus + label, .popup-form textarea:not(:placeholder-shown) + label { top: -10px; left: 10px; font-size: 0.75rem; color: var(--color-secondary-accent); background-color: var(--color-surface); padding: 0 5px; }
.popup-form textarea { min-height: 120px; resize: vertical; }
.popup-form button[type="submit"].cta-button { display: block; width: 100%; }
.project-popup-content { max-width: 900px; padding: 50px; }
.project-popup-grid { display: grid; grid-template-columns: 1fr; gap: 30px; }
@media (min-width: 768px) { .project-popup-grid { grid-template-columns: 1fr 1fr; gap: 40px; } }
.project-popup-image-container { border-radius: var(--border-radius); overflow: hidden; box-shadow: var(--shadow-soft); max-height: 450px; }
.project-popup-image-container img { width: 100%; height: 100%; object-fit: cover; }
.project-popup-info h3 { text-align: left; font-size: 2rem; margin-bottom: 5px; }
.project-popup-client, .project-popup-year { font-size: 0.9rem; color: var(--color-text-muted); margin-bottom: 5px; text-align: left; }
.project-popup-year { margin-bottom: 20px; }
.project-popup-client span, .project-popup-year span { font-style: italic; color: var(--color-text); }
.project-popup-description { font-size: 0.95rem; line-height: 1.7; color: var(--color-text); margin-bottom: 25px; text-align: left;}
.project-popup-info h4 { font-family: var(--font-primary); font-size: 1.1rem; color: var(--color-white); margin-bottom: 10px; margin-top: 20px; text-align: left;}
.project-popup-tech-stack { list-style: none; padding-left: 0; display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 30px; justify-content: flex-start; }
.project-popup-tech-stack li { background-color: var(--color-bg-light); padding: 5px 12px; border-radius: 4px; font-size: 0.8rem; color: var(--color-text-muted); border: 1px solid var(--color-border); }
.project-popup-info .cta-button { font-size: 0.9rem; padding: 10px 20px; align-self: flex-start;}

/* --- Floating Action Badge --- */
.floating-action-badge { position: fixed; bottom: 30px; right: 30px; background-color: var(--color-primary-accent); color: var(--color-white); border-radius: 50px; padding: 12px 18px; display: inline-flex; align-items: center; gap: 8px; font-size: 0.9rem; font-weight: 600; box-shadow: var(--shadow-medium); z-index: 900; transition: var(--transition-smooth), opacity 0.3s, visibility 0.3s, transform 0.3s; opacity: 0; visibility: hidden; transform: translateY(20px); }
.floating-action-badge.visible { opacity: 1; visibility: visible; transform: translateY(0); }
.floating-action-badge:hover { background-color: var(--color-secondary-accent); color: var(--color-bg); transform: translateY(-3px) scale(1.05); }
.floating-action-badge .arrow { transition: transform 0.3s ease; }
.floating-action-badge:hover .arrow { transform: translateX(3px); }

/* --- Scroll-triggered Animations (Intersection Observer driven) --- */
[data-animation] { 
    opacity: 0; /* Start all animated elements as invisible */
    transition-property: opacity, transform; 
    transition-duration: 0.8s; 
    transition-timing-function: cubic-bezier(0.175, 0.885, 0.32, 1.275); 
}
[data-animation].is-visible { opacity: 1; transform: none !important; } /* Make them visible when class is added */

/* Initial states for specific animations (applied by JS with -init suffix logic) */
.fadeInUp-init { transform: translateY(50px); }
.fadeInLeft-init { transform: translateX(-50px); }
.fadeInRight-init { transform: translateX(50px); }
.scaleIn-init { transform: scale(0.8); }
.zoomIn-init { transform: scale(0.9) translateY(10px); }
.textReveal-init span { display: inline-block; opacity: 0; transform: translateY(100%); transition: opacity 0.6s ease, transform 0.6s ease; }
.textReveal.is-visible span { opacity: 1; transform: translateY(0); }
.pulse-init { transform: scale(0.95); } /* Initial state for pulse animation */
.pulse.is-visible { animation: pulseAnim 1.5s 0.5s infinite cubic-bezier(0.68, -0.55, 0.27, 1.55); opacity: 1 !important; transform: none !important; /* Ensure base visibility styles don't conflict with animation*/ }
@keyframes pulseAnim { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.05); } }

/* --- Responsiveness --- */
@media (max-width: 1024px) {
    .projects-header { flex-direction: column; align-items: flex-start; }
    .projects-section-title { margin-bottom: 20px; }
    .philosophy-visual-wrapper { max-width: 80%; }
    .stats-heading { flex-direction: column; text-align: center; gap: 30px; }
    .stats-section-title { text-align: center; }
}
@media (max-width: 768px) {
    :root { --header-height: 70px; }
    .section-title { font-size: clamp(2rem, 6vw, 2.8rem); }
    .section-subtitle { font-size: clamp(0.9rem, 2.5vw, 1rem); margin-bottom: 2.5rem; }
    .menu-btn { display: flex; }
    #main-nav { display: flex; flex-direction: column; position: fixed; top: 0; left: 0; width: 100%; height: 100vh; background-color: var(--color-bg); padding: calc(var(--header-height) + 40px) 20px 20px; align-items: center; justify-content: center; gap: 25px; transform: translateX(100%); transition: transform 0.5s cubic-bezier(0.77, 0, 0.175, 1); }
    #main-nav.active { transform: translateX(0); }
    #main-nav a { font-size: 1.5rem; color: var(--color-text); opacity: 0; transform: translateY(20px); transition: opacity 0.4s ease, transform 0.4s ease; }
    #main-nav.active a { opacity: 1; transform: translateY(0); }
    #main-nav.active a:nth-child(1) { transition-delay: 0.2s; }
    #main-nav.active a:nth-child(2) { transition-delay: 0.3s; }
    #main-nav.active a:nth-child(3) { transition-delay: 0.4s; }
    .hero-title-background { font-size: clamp(4rem, 15vw, 10rem); }
    .hero-title-foreground { font-size: clamp(2rem, 6vw, 4rem); }
    .hero-subtitle { max-width: 90%; }
    .hero-service-item:not(:last-child)::after { display: none; }
    .hero-services-list { gap: 5px 15px; }
    .stats-container { grid-template-columns: 1fr; gap: 30px; }
    .services-grid { grid-template-columns: 1fr; }
    .projects-grid { grid-template-columns: 1fr; }
    .project-card { aspect-ratio: 16 / 10; }
    .footer-content, .footer-nav-social { gap: 25px; }
    .footer-nav { flex-direction: column; gap: 15px; }
    .popup-content { padding: 30px 25px; }
    .project-popup-content { padding: 40px 25px; }
    .project-popup-grid { grid-template-columns: 1fr; }
    .project-popup-image-container { max-height: 300px; }
    .project-popup-info h3 { font-size: 1.6rem; }
    .floating-action-badge { padding: 10px 15px; font-size: 0.8rem; bottom: 20px; right: 20px; }
}
@media (max-width: 480px) {
    .container { padding: 0 15px; }
    .logo { font-size: 1.5rem; }
    .hero-services-list { flex-direction: column; align-items: center; gap: 10px;}
    .hero-service-item { font-size: 1.1rem; }
    .stats-section-title { font-size: clamp(1.8rem, 5vw, 2.2rem); }
    .projects-section-title { font-size: clamp(1.8rem, 5vw, 2.2rem); }
    .cta-button { padding: 10px 20px; font-size: 0.9rem; }
    .cta-button.large { padding: 15px 30px; font-size: 1rem; }
}