/* ============================================
   Electrolysis By Melody — Custom Styles
   ============================================ */

/* --- Base & Typography --- */
html {
    scroll-behavior: smooth;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    overflow-x: hidden;
}

::selection {
    background: rgba(212, 168, 75, 0.3);
    color: #0A1628;
}

/* --- Custom Scrollbar --- */
::-webkit-scrollbar {
    width: 8px;
}
::-webkit-scrollbar-track {
    background: #FDF8EE;
}
::-webkit-scrollbar-thumb {
    background: #D4A84B;
    border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
    background: #C49A3C;
}

/* --- Header --- */
#site-header {
    background: transparent;
    transition: background 0.4s ease, box-shadow 0.4s ease, padding 0.4s ease;
}

#site-header.scrolled {
    background: rgba(253, 248, 238, 0.95);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    box-shadow: 0 1px 20px rgba(10, 22, 40, 0.08);
}

.nav-link {
    position: relative;
}

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

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

/* --- Mobile Menu --- */
#mobile-menu {
    animation: fadeIn 0.3s ease forwards;
}

#mobile-menu.hidden {
    display: none;
}

.mobile-overlay {
    animation: fadeIn 0.3s ease forwards;
}

.mobile-link {
    position: relative;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* Hamburger animation */
#mobile-menu.open #hamburger span:nth-child(1) {
    transform: translateY(4.5px) rotate(45deg);
}
#mobile-menu.open #hamburger span:nth-child(2) {
    opacity: 0;
    transform: scaleX(0);
}
#mobile-menu.open #hamburger span:nth-child(3) {
    transform: translateY(-4.5px) rotate(-45deg);
}

/* --- Hero --- */
.hero-deco {
    animation: float 8s ease-in-out infinite;
}

.hero-deco:nth-child(2) {
    animation-delay: -2s;
    animation-duration: 10s;
}

.hero-deco:nth-child(3) {
    animation-delay: -4s;
    animation-duration: 12s;
}

@keyframes float {
    0%, 100% { transform: translateY(0px) scale(1); }
    50% { transform: translateY(-20px) scale(1.03); }
}

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

.service-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, #D4A84B, #C49A3C);
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.4s ease;
    border-radius: 3px 3px 0 0;
}

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

/* --- Testimonials --- */
.testimonial-card {
    position: relative;
}

.testimonial-card::before {
    content: '"';
    position: absolute;
    top: 16px;
    right: 24px;
    font-family: 'Cormorant Garamond', Georgia, serif;
    font-size: 6rem;
    font-weight: 700;
    line-height: 1;
    color: rgba(212, 168, 75, 0.1);
    pointer-events: none;
}

/* --- FAQ --- */
.faq-toggle {
    transition: background 0.2s ease;
    border-radius: 12px;
}

.faq-toggle:hover {
    background: rgba(212, 168, 75, 0.04);
}

.faq-item.active .faq-icon {
    transform: rotate(45deg);
    background: rgba(212, 168, 75, 0.15);
}

.faq-item.active .faq-icon svg {
    stroke: #D4A84B;
}

.faq-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.4s ease, padding 0.4s ease;
}

.faq-item.active .faq-content {
    max-height: 300px;
}

/* --- Scroll Reveal (progressive enhancement) --- */
.reveal {
    opacity: 1;
    transform: none;
    transition: opacity 0.7s ease, transform 0.7s ease;
}

.reveal.revealed {
    opacity: 1;
    transform: none;
}

/* Reduced motion preference */
@media (prefers-reduced-motion: no-preference) {
    .reveal {
        opacity: 0;
        transform: translateY(30px);
    }

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

    .reveal-delay-1 { transition-delay: 0.1s; }
    .reveal-delay-2 { transition-delay: 0.2s; }
    .reveal-delay-3 { transition-delay: 0.3s; }
    .reveal-delay-4 { transition-delay: 0.4s; }
}

/* --- Back to Top --- */
#back-to-top {
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: opacity 0.3s ease, visibility 0.3s ease, transform 0.3s ease;
}

#back-to-top.visible {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

#back-to-top:hover {
    transform: translateY(-3px);
}

/* --- Responsive --- */
@media (max-width: 767px) {
    .font-serif {
        line-height: 1.15;
    }
}

@media (min-width: 768px) and (max-width: 1023px) {
    #site-header {
        padding-left: 1rem;
        padding-right: 1rem;
    }
}
</style>
