/* ─── Custom Styles for Legal Cantabria ─── */

/* ── Scrollbar ── */
::-webkit-scrollbar {
    width: 8px;
}
::-webkit-scrollbar-track {
    background: #1f2937;
}
::-webkit-scrollbar-thumb {
    background: #F97066;
    border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
    background: #e8554a;
}

/* ── Smooth scroll ── */
html {
    scroll-behavior: smooth;
}

/* ── Scroll indicator animation ── */
@keyframes scrollLine {
    0% { transform: scaleY(0); transform-origin: top; opacity: 0; }
    50% { opacity: 1; }
    100% { transform: scaleY(1); transform-origin: top; opacity: 1; }
}
.scroll-indicator {
    animation: scrollPulse 2s ease-in-out infinite;
}
@keyframes scrollPulse {
    0%, 100% { opacity: 0.5; transform: translateY(0); }
    50% { opacity: 1; transform: translateY(6px); }
}

/* ── Hero animations ── */
.hero-eyebrow {
    animation: fadeUp 0.8s ease forwards 0.3s;
}
.hero-title {
    animation: fadeUp 0.8s ease forwards 0.5s;
    opacity: 0;
    transform: translateY(24px);
}
.hero-subtitle {
    animation: fadeUp 0.8s ease forwards 0.7s;
    opacity: 0;
    transform: translateY(24px);
}
.hero-cta {
    animation: fadeUp 0.8s ease forwards 0.9s;
    opacity: 0;
    transform: translateY(24px);
}
@keyframes fadeUp {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ── Section animations ── */
.section-eyebrow,
.section-title,
.section-subtitle {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.7s ease, transform 0.7s ease;
}
.section-eyebrow.visible,
.section-title.visible,
.section-subtitle.visible {
    opacity: 1;
    transform: translateY(0);
}
.section-eyebrow { transition-delay: 0.1s; }
.section-title { transition-delay: 0.2s; }
.section-subtitle { transition-delay: 0.3s; }

/* ── Service cards ── */
.service-card {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}
.service-card.visible {
    opacity: 1;
    transform: translateY(0);
}
.service-card:nth-child(1) { transition-delay: 0.1s; }
.service-card:nth-child(2) { transition-delay: 0.2s; }
.service-card:nth-child(3) { transition-delay: 0.3s; }
.service-card:nth-child(4) { transition-delay: 0.4s; }
.service-card:nth-child(5) { transition-delay: 0.5s; }
.service-card:nth-child(6) { transition-delay: 0.6s; }

/* ── Value cards ── */
.value-card {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}
.value-card.visible {
    opacity: 1;
    transform: translateY(0);
}
.value-card:nth-child(1) { transition-delay: 0.1s; }
.value-card:nth-child(2) { transition-delay: 0.2s; }
.value-card:nth-child(3) { transition-delay: 0.3s; }
.value-card:nth-child(4) { transition-delay: 0.4s; }

/* ── Stat items ── */
.stat-item {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}
.stat-item.visible {
    opacity: 1;
    transform: translateY(0);
}
.stat-item:nth-child(1) { transition-delay: 0.2s; }
.stat-item:nth-child(2) { transition-delay: 0.3s; }
.stat-item:nth-child(3) { transition-delay: 0.4s; }

/* ── Navbar ── */
#navbar {
    transition: background-color 0.4s ease, padding 0.4s ease, box-shadow 0.4s ease;
}
#navbar.scrolled {
    background-color: rgba(31, 41, 55, 0.97);
    backdrop-filter: blur(12px);
    box-shadow: 0 1px 20px rgba(0, 0, 0, 0.3);
}
#navbar.scrolled .nav-link,
#navbar.scrolled #nav-logo-box,
#navbar.scrolled #nav-brand-name,
#navbar.scrolled #nav-brand-sub,
#navbar.scrolled .menu-line {
    color: white;
    border-color: white;
}
#navbar.scrolled .nav-link {
    color: rgba(255, 255, 255, 0.8);
}
#navbar.scrolled .nav-link:hover {
    color: #F97066;
}

/* ── Nav links hover ── */
.nav-link::after {
    content: '';
    display: block;
    width: 0;
    height: 1px;
    background: #F97066;
    transition: width 0.3s ease;
    margin-top: 2px;
}
.nav-link:hover::after {
    width: 100%;
}

/* ── Mobile menu ── */
#mobile-menu.open {
    opacity: 1;
    pointer-events: all;
}
#mobile-menu.closed {
    opacity: 0;
    pointer-events: none;
}
.menu-line:nth-child(1) {
    transform: rotate(0deg);
}
.menu-line.active:nth-child(1) {
    transform: rotate(45deg) translate(3px, 3px);
}
.menu-line.active:nth-child(2) {
    opacity: 0;
}
.menu-line.active:nth-child(3) {
    transform: rotate(-45deg) translate(3px, -3px);
}
.mobile-nav-link {
    position: relative;
}
.mobile-nav-link::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 1px;
    background: #F97066;
    transition: width 0.3s ease;
}
.mobile-nav-link:hover::after {
    width: 100%;
}

/* ── Form focus states ── */
input:focus,
select:focus,
textarea:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(249, 112, 102, 0.15);
}

/* ── Selection ── */
::selection {
    background: #F97066;
    color: white;
}

/* ── Responsive ── */
@media (max-width: 767px) {
    .hero-title {
        font-size: 2.75rem;
    }
    .section-title {
        font-size: 2.5rem;
    }
}
@media (min-width: 768px) {
    .hero-title {
        font-size: 4rem;
    }
}
@media (min-width: 1024px) {
    .hero-title {
        font-size: 5rem;
    }
}
