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

:root {
    --primary-red: #08b365;
    --dark-red: #069952;
    --dark: #1a1a1a;
    --gray: #666;
    --light-gray: #f5f5f5;
    --white: #ffffff;
    --nav-height: 80px;
    --container-max: 1480px;
    --container-pad: 16px;
    --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
    --shadow-card: 0 5px 20px rgba(0, 0, 0, 0.1);
    --shadow-nav: 0 2px 10px rgba(0, 0, 0, 0.1);
}

html { scroll-behavior: smooth; }

body {
    font-family: 'Open Sans', sans-serif;
    color: var(--dark);
    overflow-x: hidden;
    opacity: 0;
    transition: opacity 0.35s var(--ease-out);
}
body.loaded { opacity: 1; }
body.menu-open { overflow: hidden; }

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

section[id] { scroll-margin-top: calc(var(--nav-height) + 20px); }

.top-bar { background: var(--dark); color: var(--white); padding: 8px 0; font-size: 13px; }
.container {
    max-width: var(--container-max);
    width: min(100% - var(--container-pad) * 2, var(--container-max));
    margin: 0 auto;
    padding: 0 var(--container-pad);
}
.top-bar-content { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 8px; }
.top-bar-left span { margin-right: 20px; }
.top-bar-left i { color: var(--primary-red); margin-right: 5px; }
.top-bar-right a { color: var(--white); margin-left: 15px; text-decoration: none; transition: color 0.3s var(--ease-out); }
.top-bar-right a:hover { color: var(--primary-red); }

nav {
    background: var(--white);
    box-shadow: var(--shadow-nav);
    position: sticky;
    top: 0;
    z-index: 1000;
    transition: box-shadow 0.3s var(--ease-out), padding 0.3s var(--ease-out);
}
nav.nav-scrolled { box-shadow: 0 4px 24px rgba(0, 0, 0, 0.12); }
.nav-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    min-height: var(--nav-height);
    padding: 10px 0;
    transition: min-height 0.3s var(--ease-out);
}
nav.nav-scrolled .nav-content { min-height: 68px; }

.logo { display: flex; align-items: center; gap: 12px; text-decoration: none; cursor: pointer; }
.logo-img { width: 280px; height: auto; object-fit: contain; max-width: 100%; transition: width 0.3s var(--ease-out); }
nav.nav-scrolled .logo-img { width: 220px; }
.logo-icon {
    width: 50px; height: 50px; background: var(--primary-red); border-radius: 50%;
    display: flex; align-items: center; justify-content: center; color: white;
    font-weight: 800; font-size: 20px; font-family: 'Montserrat';
}
.logo-text h1 { font-size: 24px; font-weight: 800; color: var(--dark); line-height: 1; }
.logo-text span { font-size: 12px; color: var(--gray); font-weight: 500; letter-spacing: 2px; }

.nav-links { display: flex; list-style: none; gap: 35px; }
.nav-links a {
    text-decoration: none; color: var(--dark); font-weight: 600; font-size: 14px;
    text-transform: uppercase; letter-spacing: 1px; position: relative;
    transition: color 0.3s var(--ease-out);
}
.nav-links a::after {
    content: ''; position: absolute; bottom: -5px; left: 0; width: 0; height: 2px;
    background: var(--primary-red); transition: width 0.3s var(--ease-out);
}
.nav-links a:hover,
.nav-links a.active { color: var(--primary-red); }
.nav-links a:hover::after,
.nav-links a.active::after { width: 100%; }

.mobile-menu-btn {
    display: none; background: none; border: none; cursor: pointer;
    padding: 8px; z-index: 1101;
}
.hamburger { display: flex; flex-direction: column; gap: 5px; width: 26px; }
.hamburger span {
    display: block; height: 3px; background: var(--dark); border-radius: 2px;
    transition: transform 0.3s var(--ease-out), opacity 0.3s var(--ease-out);
}
.mobile-menu-btn.active .hamburger span:nth-child(1) { transform: translateY(8px) rotate(45deg); }
.mobile-menu-btn.active .hamburger span:nth-child(2) { opacity: 0; }
.mobile-menu-btn.active .hamburger span:nth-child(3) { transform: translateY(-8px) rotate(-45deg); }

.mobile-menu-overlay {
    position: fixed; inset: 0; background: rgba(0, 0, 0, 0.5);
    opacity: 0; visibility: hidden; transition: opacity 0.35s var(--ease-out), visibility 0.35s;
    z-index: 1098;
}
.mobile-menu-overlay.open { opacity: 1; visibility: visible; }

.mobile-menu-panel {
    position: fixed; top: 0; right: 0; width: min(320px, 85vw); height: 100vh;
    background: var(--white); box-shadow: -8px 0 30px rgba(0, 0, 0, 0.15);
    transform: translateX(100%); transition: transform 0.4s var(--ease-out);
    z-index: 1099; padding: 100px 30px 30px;
}
.mobile-menu-panel.open { transform: translateX(0); }
.mobile-nav-links { list-style: none; }
.mobile-nav-links li { border-bottom: 1px solid #eee; }
.mobile-nav-links a {
    display: block; padding: 16px 0; text-decoration: none; color: var(--dark);
    font-weight: 600; font-size: 15px; text-transform: uppercase; letter-spacing: 1px;
    transition: color 0.2s, padding-left 0.2s;
}
.mobile-nav-links a:hover,
.mobile-nav-links a.active { color: var(--primary-red); padding-left: 8px; }

.hero-slider { position: relative; height: 85vh; min-height: 480px; overflow: hidden; }
.slide {
    position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; z-index: 0;
    transition: opacity 0.9s var(--ease-out), transform 0.9s var(--ease-out);
    display: flex; align-items: center;
    transform: translateX(30px) scale(1.05);
    pointer-events: none;
    overflow: hidden;
}
.slide-bg {
    position: absolute; inset: 0; z-index: 0;
    background-size: cover; background-position: center center; background-repeat: no-repeat;
    transform-origin: center center;
}
.slide.active {
    opacity: 1; z-index: 2; transform: translateX(0) scale(1);
    pointer-events: auto;
}
.slide.active .slide-bg { animation: kenBurns 8s ease-out forwards; }
.slide.slide-exit {
    opacity: 0; z-index: 1;
    transform: translateX(-20px) scale(1);
    pointer-events: none;
}
.slide.slide-exit .slide-bg { animation: none; }
@keyframes kenBurns {
    from { transform: scale(1); }
    to { transform: scale(1.08); }
}
.slide::before {
    content: ''; position: absolute; inset: 0; z-index: 1;
    background: linear-gradient(to right, rgba(0,0,0,0.75) 0%, rgba(0,0,0,0.35) 55%, transparent 100%);
}
.slide-content { position: relative; z-index: 2; color: var(--white); max-width: 640px; padding: 0 20px; }
.slide-content h2 { font-size: clamp(28px, 5vw, 52px); font-weight: 800; margin-bottom: 20px; line-height: 1.1; }
.slide-content p { font-size: 18px; margin-bottom: 30px; line-height: 1.6; opacity: 0.95; }
.slide-buttons { display: flex; flex-wrap: wrap; gap: 15px; }

.hero-text-animate h2,
.hero-text-animate p,
.hero-text-animate .slide-buttons {
    opacity: 0; transform: translateY(24px);
    animation: heroTextIn 0.7s var(--ease-out) forwards;
}
.hero-text-animate p { animation-delay: 0.15s; }
.hero-text-animate .slide-buttons { animation-delay: 0.3s; }
.slide:not(.active) .hero-text-animate h2,
.slide:not(.active) .hero-text-animate p,
.slide:not(.active) .hero-text-animate .slide-buttons { animation: none; opacity: 0; }
@keyframes heroTextIn {
    to { opacity: 1; transform: translateY(0); }
}

.btn-primary {
    display: inline-block; padding: 15px 40px; background: var(--primary-red); color: var(--white);
    text-decoration: none; font-weight: 600; font-size: 14px; text-transform: uppercase;
    letter-spacing: 2px; border: 2px solid var(--primary-red); transition: all 0.3s var(--ease-out);
}
.btn-primary:hover { background: transparent; color: var(--white); transform: translateY(-2px); }
.btn-outline {
    display: inline-block; padding: 15px 40px; background: transparent; color: var(--white);
    text-decoration: none; font-weight: 600; font-size: 14px; text-transform: uppercase;
    letter-spacing: 2px; border: 2px solid var(--white); transition: all 0.3s var(--ease-out);
}
.btn-outline:hover { background: var(--white); color: var(--dark); transform: translateY(-2px); }

.slider-dots {
    position: absolute; bottom: 30px; left: 50%; transform: translateX(-50%);
    display: flex; gap: 10px; z-index: 10;
}
.dot {
    width: 12px; height: 12px; border-radius: 50%; background: rgba(255,255,255,0.5);
    cursor: pointer; transition: all 0.3s var(--ease-out);
}
.dot.active { background: var(--primary-red); width: 30px; border-radius: 6px; }

.stats-section { background: var(--primary-red); padding: 50px 0; color: var(--white); }
.stats-grid { display: flex; flex-wrap: wrap; justify-content: space-evenly; align-items: flex-start; gap: 20px; text-align: center; }
.stat-item { flex: 1 1 0px; min-width: 140px; padding: 0 10px; }
.stat-item h3 { font-size: 38px; font-weight: 800; margin-bottom: 5px; }
.stat-item p { font-size: 13px; font-weight: 600; text-transform: uppercase; letter-spacing: 1px; line-height: 1.6; }

.section { padding: clamp(48px, 8vw, 80px) 0; }
.section-alt { background-color: #fcfcfc; }
.section-header { text-align: center; margin-bottom: 60px; }
.section-header h2 { font-size: 36px; font-weight: 800; margin-bottom: 15px; color: var(--dark); }
.section-header p { color: var(--gray); font-size: 16px; max-width: 600px; margin: 0 auto; }
.section-header .line { width: 60px; height: 3px; background: var(--primary-red); margin: 20px auto; }

.projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 24px;
    padding: 40px 0;
}
.project-card {
    position: relative; overflow: hidden; border-radius: 12px; box-shadow: var(--shadow-card);
    cursor: pointer; height: 400px;
    transition: transform 0.45s var(--ease-out), box-shadow 0.45s var(--ease-out);
}
.project-card:hover {
    transform: translateY(-10px) scale(1.02);
    box-shadow: 0 20px 48px rgba(0, 0, 0, 0.18);
    will-change: transform;
}
.project-card img {
    width: 100%; height: 100%; object-fit: cover;
    transition: transform 0.5s var(--ease-out), filter 0.5s var(--ease-out);
}
.project-card:hover img { transform: scale(1.1); filter: brightness(0.85); }
.project-overlay {
    position: absolute; bottom: 0; left: 0; right: 0;
    background: linear-gradient(to top, rgba(0,0,0,0.92) 0%, rgba(0,0,0,0.4) 55%, transparent 100%);
    padding: 30px; color: var(--white);
    transform: translateY(24px); opacity: 0.85;
    transition: transform 0.45s var(--ease-out), opacity 0.45s var(--ease-out);
}
.project-card:hover .project-overlay { transform: translateY(0); opacity: 1; }
.project-overlay h3 { font-size: 22px; margin-bottom: 8px; }
.project-overlay p { font-size: 14px; opacity: 0.9; margin-bottom: 15px; }
.project-tag {
    display: inline-block; padding: 5px 15px; background: var(--primary-red);
    font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: 1px;
    transform: translateY(8px); opacity: 0;
    transition: transform 0.4s var(--ease-out) 0.05s, opacity 0.4s var(--ease-out) 0.05s;
}
.project-card:hover .project-tag { transform: translateY(0); opacity: 1; }

.projects-grid.single-layout { display: flex; justify-content: center; align-items: center; }
.projects-grid.single-layout .project-card { width: 100%; max-width: 100%; height: min(600px, 55vw); }
.projects-grid.single-layout .project-overlay { padding: 40px; }
.projects-grid.single-layout .project-overlay h3 { font-size: 32px; margin-bottom: 12px; }
.projects-grid.single-layout .project-overlay p { font-size: 16px; }
.projects-grid.single-layout .project-tag { font-size: 14px; padding: 8px 20px; margin-bottom: 15px; }

.catalog-wrapper { position: relative; display: flex; align-items: center; gap: 12px; width: 100%; }
.catalog-nav {
    flex-shrink: 0; width: 48px; height: 48px; border-radius: 50%; border: none;
    background: var(--primary-red); color: var(--white); cursor: pointer;
    display: flex; align-items: center; justify-content: center; font-size: 18px;
    transition: transform 0.2s, background 0.2s; box-shadow: var(--shadow-card);
}
.catalog-nav:hover { background: var(--dark-red); transform: scale(1.05); }
.catalog-nav:disabled { opacity: 0.35; cursor: not-allowed; transform: none; }

.catalog-slider {
    flex: 1; display: flex; overflow-x: auto; gap: 20px;
    padding: 20px 0 40px 0; scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch; scroll-behavior: smooth;
    scrollbar-width: thin; scrollbar-color: var(--primary-red) rgba(0,0,0,0.05);
}
.catalog-slider::-webkit-scrollbar { height: 10px; }
.catalog-slider::-webkit-scrollbar-track { background: rgba(0,0,0,0.05); border-radius: 10px; }
.catalog-slider::-webkit-scrollbar-thumb { background: var(--primary-red); border-radius: 10px; }
.catalog-item {
    flex: 0 0 min(420px, 85vw);
    scroll-snap-align: center;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0,0,0,0.15);
    aspect-ratio: 2386 / 2410;
    padding: 8px;
    background: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
}
.catalog-item img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
}

.about-section { background: var(--light-gray); }
.about-content { display: grid; grid-template-columns: 1fr 1fr; gap: 60px; align-items: center; }
.about-image { position: relative; }
.about-image img { width: 100%; border-radius: 12px; box-shadow: 0 20px 40px rgba(0,0,0,0.2); }
.about-image .experience-badge {
    position: absolute; bottom: -20px; right: -20px; background: var(--primary-red);
    color: var(--white); padding: 30px; border-radius: 8px; text-align: center;
    box-shadow: 0 10px 30px rgba(8, 179, 101, 0.35);
}
.experience-badge h4 { font-size: 42px; font-weight: 800; line-height: 1; }
.experience-badge span { font-size: 14px; font-weight: 500; }
.about-text h2 { font-size: 36px; font-weight: 800; margin-bottom: 20px; color: var(--dark); }
.about-text p { color: var(--gray); line-height: 1.8; margin-bottom: 20px; }
.features-list { list-style: none; margin-top: 30px; }
.features-list li { padding: 10px 0; display: flex; align-items: center; gap: 10px; font-weight: 600; }
.features-list i { color: var(--primary-red); font-size: 18px; }

.services-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 24px;
}
.service-card {
    text-align: center; padding: 40px 30px; background: var(--white); border-radius: 12px;
    box-shadow: 0 5px 20px rgba(0,0,0,0.08); transition: all 0.3s var(--ease-out);
    border-bottom: 3px solid transparent;
}
.service-card:hover { transform: translateY(-10px); border-bottom-color: var(--primary-red); box-shadow: 0 15px 40px rgba(0,0,0,0.15); }
.service-icon {
    width: 80px; height: 80px; background: var(--light-gray); border-radius: 50%;
    display: flex; align-items: center; justify-content: center; margin: 0 auto 20px;
    font-size: 32px; color: var(--primary-red); transition: all 0.3s;
}
.service-card:hover .service-icon { background: var(--primary-red); color: var(--white); }
.service-card h3 { font-size: 20px; margin-bottom: 15px; color: var(--dark); }
.service-card p { color: var(--gray); font-size: 14px; line-height: 1.6; }

.contact-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 60px; align-items: center; }
.contact-info h3 { font-size: 28px; margin-bottom: 30px; color: var(--dark); }
.contact-item { display: flex; gap: 20px; margin-bottom: 25px; align-items: flex-start; }
.contact-item i {
    width: 50px; height: 50px; background: var(--primary-red); color: var(--white);
    border-radius: 50%; display: flex; align-items: center; justify-content: center;
    font-size: 20px; flex-shrink: 0;
}
.contact-item div h4 { margin-bottom: 5px; font-size: 16px; color: var(--dark); }
.contact-item div p { color: var(--gray); font-size: 14px; line-height: 1.6; }

.contact-map { width: 100%; height: 400px; border-radius: 12px; overflow: hidden; box-shadow: 0 10px 40px rgba(0,0,0,0.1); background: #eee; }
.contact-map iframe { width: 100% !important; height: 100% !important; border: none; }

footer { background: #111; color: var(--white); padding: 60px 0 20px; }
.footer-grid { display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: 40px; margin-bottom: 40px; }
.footer-about h3 { font-size: 24px; margin-bottom: 20px; display: flex; align-items: center; gap: 10px; }
.footer-about p { color: #999; line-height: 1.8; margin-bottom: 20px; }
.social-links { display: flex; gap: 15px; }
.social-links a {
    width: 40px; height: 40px; background: rgba(255,255,255,0.1); border-radius: 50%;
    display: flex; align-items: center; justify-content: center; color: var(--white);
    text-decoration: none; transition: all 0.3s var(--ease-out);
}
.social-links a:hover { background: var(--primary-red); transform: translateY(-3px); }
.footer-links h4 { font-size: 18px; margin-bottom: 20px; color: var(--white); }
.footer-links ul { list-style: none; }
.footer-links li { margin-bottom: 12px; }
.footer-links a { color: #999; text-decoration: none; transition: color 0.3s, padding-left 0.3s; font-size: 14px; cursor: pointer; }
.footer-links a:hover { color: var(--primary-red); padding-left: 5px; }
.footer-bottom { border-top: 1px solid #333; padding-top: 20px; text-align: center; color: #666; font-size: 14px; }

.scroll-top {
    position: fixed; bottom: 30px; right: 30px; width: 50px; height: 50px;
    background: var(--primary-red); color: var(--white); border-radius: 50%;
    display: flex; align-items: center; justify-content: center; cursor: pointer;
    opacity: 0; visibility: hidden; transition: all 0.3s var(--ease-out); z-index: 999;
    box-shadow: 0 5px 20px rgba(8, 179, 101, 0.4);
}
.scroll-top.visible { opacity: 1; visibility: visible; }
.scroll-top:hover { background: var(--dark-red); transform: translateY(-5px); }

.legal-modal-overlay {
    position: fixed; inset: 0; background: rgba(0,0,0,0.6); display: none;
    align-items: center; justify-content: center; z-index: 2000; opacity: 0; transition: opacity 0.3s;
}
.legal-modal-overlay.active { display: flex; opacity: 1; }
.legal-modal {
    background: #fff; border-radius: 12px; width: 90%; max-width: 800px; max-height: 85vh;
    display: flex; flex-direction: column; box-shadow: 0 15px 50px rgba(0,0,0,0.2);
    transform: translateY(-20px); transition: transform 0.3s var(--ease-out);
}
.legal-modal-overlay.active .legal-modal { transform: translateY(0); }
.legal-modal-header { padding: 20px 25px; border-bottom: 1px solid #eee; display: flex; justify-content: space-between; align-items: center; }
.legal-modal-header h3 { font-size: 22px; font-weight: 700; color: var(--dark); margin: 0; }
.legal-modal-close { background: none; border: none; font-size: 28px; cursor: pointer; color: #999; transition: color 0.3s; }
.legal-modal-close:hover { color: var(--primary-red); }
.legal-modal-body { padding: 25px; overflow-y: auto; font-size: 15px; line-height: 1.8; color: #444; }

/* Reveal animations */
.reveal {
    opacity: 0; transform: translateY(32px);
    transition: opacity 0.75s var(--ease-out), transform 0.75s var(--ease-out);
}
.reveal.visible { opacity: 1; transform: translateY(0); }

.reveal-stagger > * {
    opacity: 0; transform: translateY(28px);
    transition: opacity 0.6s var(--ease-out), transform 0.6s var(--ease-out);
}
.reveal-stagger.visible > *:nth-child(1) { transition-delay: 0.05s; }
.reveal-stagger.visible > *:nth-child(2) { transition-delay: 0.12s; }
.reveal-stagger.visible > *:nth-child(3) { transition-delay: 0.19s; }
.reveal-stagger.visible > *:nth-child(4) { transition-delay: 0.26s; }
.reveal-stagger.visible > *:nth-child(5) { transition-delay: 0.33s; }
.reveal-stagger.visible > *:nth-child(6) { transition-delay: 0.4s; }
.reveal-stagger.visible > * { opacity: 1; transform: translateY(0); }

.fade-in { opacity: 0; transform: translateY(30px); transition: all 0.8s var(--ease-out); }
.fade-in.visible { opacity: 1; transform: translateY(0); }

/* Skeleton loading */
.skeleton-text.skeleton-loading {
    display: inline-block; min-width: 180px; min-height: 1em;
    background: linear-gradient(90deg, #e8e8e8 25%, #f5f5f5 50%, #e8e8e8 75%);
    background-size: 200% 100%; animation: skeletonPulse 1.4s ease-in-out infinite;
    border-radius: 4px; color: transparent !important;
}
@keyframes skeletonPulse {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

@media (max-width: 1200px) {
    :root { --container-pad: 14px; }
    .catalog-item { flex: 0 0 min(360px, 80vw); }
}

@media (max-width: 992px) {
    .stats-grid { justify-content: center; }
    .stat-item { flex: 0 0 40%; margin-bottom: 15px; }
    .projects-grid, .services-grid { grid-template-columns: repeat(2, 1fr); }
    .about-content, .contact-grid { grid-template-columns: 1fr; }
    .footer-grid { grid-template-columns: repeat(2, 1fr); }
    .catalog-nav { display: none; }
}
@media (max-width: 768px) {
    .nav-links { display: none; }
    .mobile-menu-btn { display: block; }
    .hero-slider { min-height: 420px; height: 75vh; }
    .slide::before {
        background: linear-gradient(to bottom, rgba(0,0,0,0.55) 0%, rgba(0,0,0,0.35) 100%);
    }
    .slide.active .slide-bg { animation: none; }
    .slide-buttons { flex-direction: column; align-items: stretch; }
    .slide-buttons .btn-primary,
    .slide-buttons .btn-outline { width: 100%; max-width: 280px; text-align: center; }
    .btn-outline { margin-left: 0; }
    .stat-item { flex: 0 0 100%; margin-bottom: 20px; }
    .projects-grid, .services-grid { grid-template-columns: 1fr; }
    .projects-grid.single-layout .project-card { height: 400px; }
    .projects-grid.single-layout .project-overlay h3 { font-size: 24px; }
    .catalog-item { flex: 0 0 min(92vw, 420px); }
    .footer-grid { grid-template-columns: 1fr; }
    .about-image .experience-badge { right: 10px; bottom: -10px; padding: 20px; }
}

@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
    .reveal, .reveal-stagger > * { opacity: 1; transform: none; }
    body { opacity: 1; }
}
