/* ===== Base & Utilities ===== */
*, *::before, *::after {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    overflow-x: hidden;
}

::selection {
    background: #7B2D3B;
    color: white;
}

/* ===== Custom Scrollbar ===== */
::-webkit-scrollbar {
    width: 8px;
}
::-webkit-scrollbar-track {
    background: #fdf8ef;
}
::-webkit-scrollbar-thumb {
    background: #d97088;
    border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
    background: #7B2D3B;
}

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

@keyframes fadeInLeft {
    from {
        opacity: 0;
        transform: translateX(-40px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes fadeInRight {
    from {
        opacity: 0;
        transform: translateX(40px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes scaleIn {
    from {
        opacity: 0;
        transform: scale(0.9);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes float {
    0%, 100% { transform: translateY(0px); }
    50% { transform: translateY(-10px); }
}

/* ===== Hero Animations ===== */
.hero-badge {
    animation: fadeInUp 0.8s ease-out both;
}

.hero-badge:nth-child(1) {
    animation-delay: 0.1s;
}

.hero-title {
    animation: fadeInUp 0.8s ease-out 0.2s both;
}

.hero-text {
    animation: fadeInUp 0.8s ease-out 0.4s both;
}

.hero-cta {
    animation: fadeInUp 0.8s ease-out 0.5s both;
}

.hero-trust {
    animation: fadeInUp 0.8s ease-out 0.6s both;
}

.hero-image {
    animation: fadeInRight 1s ease-out 0.3s both;
}

/* ===== Scroll Reveal ===== */
.reveal {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.8s ease-out, transform 0.8s ease-out;
}

.reveal.revealed {
    opacity: 1;
    transform: translateY(0);
}

.reveal-left {
    opacity: 0;
    transform: translateX(-30px);
    transition: opacity 0.8s ease-out, transform 0.8s ease-out;
}

.reveal-left.revealed {
    opacity: 1;
    transform: translateX(0);
}

.reveal-right {
    opacity: 0;
    transform: translateX(30px);
    transition: opacity 0.8s ease-out, transform 0.8s ease-out;
}

.reveal-right.revealed {
    opacity: 1;
    transform: translateX(0);
}

.reveal-scale {
    opacity: 0;
    transform: scale(0.9);
    transition: opacity 0.8s ease-out, transform 0.8s ease-out;
}

.reveal-scale.revealed {
    opacity: 1;
    transform: scale(1);
}

/* Stagger children */
.stagger-children .reveal:nth-child(1) { transition-delay: 0.05s; }
.stagger-children .reveal:nth-child(2) { transition-delay: 0.1s; }
.stagger-children .reveal:nth-child(3) { transition-delay: 0.15s; }
.stagger-children .reveal:nth-child(4) { transition-delay: 0.2s; }
.stagger-children .reveal:nth-child(5) { transition-delay: 0.25s; }
.stagger-children .reveal:nth-child(6) { transition-delay: 0.3s; }

/* ===== Buttons ===== */
.btn-primary {
    position: relative;
    overflow: hidden;
    transition: all 0.3s ease;
}

.btn-primary::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.15), transparent);
    transition: left 0.5s ease;
}

.btn-primary:hover::before {
    left: 100%;
}

/* ===== Service Cards ===== */
.service-card {
    position: relative;
    overflow: hidden;
}

.service-card::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 3px;
    background: linear-gradient(90deg, #7B2D3B, #f5506e);
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.4s ease;
}

.service-card:hover::after {
    transform: scaleX(1);
}

/* ===== Gallery ===== */
.gallery-item {
    cursor: pointer;
}

.gallery-item::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(123, 45, 59, 0.3), transparent);
    opacity: 0;
    transition: opacity 0.4s ease;
    border-radius: inherit;
}

.gallery-item:hover::after {
    opacity: 1;
}

/* ===== Navbar ===== */
#navbar {
    transition: all 0.4s ease;
}

#navbar.scrolled {
    background: rgba(254, 252, 248, 0.9);
    backdrop-filter: blur(20px);
    box-shadow: 0 1px 0 rgba(123, 45, 59, 0.08);
}

#navbar.scrolled .font-serif {
    color: #7B2D3B !important;
}

/* ===== Nav Links ===== */
.nav-link {
    position: relative;
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 0;
    width: 0;
    height: 2px;
    background: #7B2D3B;
    transition: width 0.3s ease;
}

.nav-link:hover::after {
    width: 100%;
}

/* ===== Mobile Menu ===== */
.mobile-link {
    position: relative;
    padding-left: 0;
    transition: padding-left 0.3s ease, color 0.3s ease;
}

.mobile-link:hover {
    padding-left: 12px;
    color: #7B2D3B;
}

.mobile-link::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 0;
    height: 2px;
    background: #7B2D3B;
    transition: width 0.3s ease;
}

.mobile-link:hover::before {
    width: 6px;
}

/* ===== Testimonial Cards ===== */
.testimonial-card {
    position: relative;
}

.testimonial-card:hover {
    transform: translateY(-4px);
}

/* ===== Process Steps ===== */
.process-step {
    position: relative;
}

.process-step::after {
    content: '';
    position: absolute;
    top: 40px;
    right: -24px;
    width: 48px;
    height: 2px;
    background: linear-gradient(90deg, #7B2D3B, #f5506e);
    opacity: 0.3;
}

.process-step:last-child::after {
    display: none;
}

@media (max-width: 767px) {
    .process-step::after {
        display: none;
    }
}

/* ===== Input Focus ===== */
input:focus, select:focus, textarea:focus {
    outline: none;
    box-shadow: 0 0 0 4px rgba(123, 45, 59, 0.08);
}

/* ===== Responsive adjustments ===== */
@media (max-width: 1023px) {
    .hero-image {
        animation: fadeInUp 0.8s ease-out 0.3s both;
    }
}

@media (max-width: 767px) {
    .hero-title {
        font-size: 2.75rem !important;
    }

    .hero-title span {
        display: inline;
    }

    section {
        padding-left: 1.25rem !important;
        padding-right: 1.25rem !important;
    }

    .max-w-7xl {
        padding-left: 0;
        padding-right: 0;
    }
}

/* ===== Prefers reduced motion ===== */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }

    html {
        scroll-behavior: auto;
    }

    .reveal, .reveal-left, .reveal-right, .reveal-scale {
        opacity: 1;
        transform: none;
    }
}
