/* 
   =============================================
   Clínica Veterinaria Cristo de la Epidemia
   =============================================
*/

:root {
    /* Colors */
    --c-bg: #FFFFFF; /* Blanco */
    --c-text: #4A151C; /* Granate oscuro */
    --c-muted: #9E7A7F; /* Granate mutado */
    --c-accent: #E8CCD1; /* Rosado ligero */
    --c-border: rgba(74, 21, 28, 0.12); /* Borde basado en el granate */

    /* Typography */
    --font-primary: 'Inter Tight', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    
    /* Layout */
    --padding-container: clamp(1.5rem, 5vw, 4rem);
    --section-padding-y: clamp(5rem, 15vw, 10rem);
    
    /* Easing */
    --ease-out-expo: cubic-bezier(0.16, 1, 0.3, 1);
}

/* ================= Reset & Base ================= */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    background-color: var(--c-bg);
    color: var(--c-text);
    font-family: var(--font-primary);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    /* Lenis relies on html scroll behavior auto */
    scroll-behavior: auto !important;
}

body {
    background-color: var(--c-bg);
    color: var(--c-text);
    line-height: 1.6;
    font-size: clamp(1rem, 1.2vw, 1.125rem); /* 16-18px */
    overflow-x: hidden;
}

a {
    color: inherit;
    text-decoration: none;
}

ul {
    list-style: none;
}

button {
    background: none;
    border: none;
    color: inherit;
    font: inherit;
    cursor: pointer;
}

img, video {
    max-width: 100%;
    display: block;
}

/* ================= Typography System ================= */
h1, .hero__title, .kinetic__headline, .footer__wordmark {
    font-size: clamp(3rem, 8vw, 7.5rem);
    font-weight: 500;
    letter-spacing: -0.03em;
    line-height: 0.95;
    text-transform: uppercase;
}

h2, .manifesto__statement {
    font-size: clamp(2rem, 5vw, 4rem);
    font-weight: 500;
    letter-spacing: -0.02em;
    line-height: 1.1;
}

h3 {
    font-size: clamp(1.5rem, 2.5vw, 2rem);
    font-weight: 500;
    letter-spacing: -0.01em;
}

.eyebrow {
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: var(--c-muted);
    font-weight: 600;
}
.eyebrow::first-letter {
    color: var(--c-accent);
}

.small-caps {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--c-muted);
}

/* Utilities */
.container {
    width: 100%;
    max-width: 1440px;
    margin: 0 auto;
    padding: 0 var(--padding-container);
}

.section-padding {
    padding-block: var(--section-padding-y);
}

.mt-2 { margin-top: 1rem; }
.mt-4 { margin-top: 2rem; }
.mt-8 { margin-top: 4rem; }
.mb-4 { margin-bottom: 2rem; }

/* Masking for split text reveals */
.line-mask {
    overflow: hidden;
    display: block;
}

/* ================= Components ================= */

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.75rem 1.5rem;
    border-radius: 100px;
    font-size: 0.875rem;
    font-weight: 500;
    transition: all 0.3s var(--ease-out-expo);
    position: relative;
    overflow: hidden;
    white-space: nowrap;
}

.btn--large {
    padding: 1rem 2rem;
    font-size: 1rem;
}

.btn--primary {
    background-color: var(--c-text);
    color: var(--c-bg);
}

.btn--primary:hover {
    background-color: var(--c-accent);
    color: var(--c-bg);
    transform: scale(1.02);
}

.btn--ghost {
    background-color: transparent;
    color: var(--c-text);
    border: 1px solid var(--c-border);
}

.btn--ghost:hover {
    border-color: var(--c-text);
    background-color: rgba(255,255,255,0.05);
}

/* Links */
.link-underline {
    position: relative;
    display: inline-block;
}
.link-underline::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 100%;
    height: 1px;
    background-color: currentColor;
    transform: scaleX(0);
    transform-origin: right;
    transition: transform 0.4s var(--ease-out-expo);
}
.link-underline:hover::after {
    transform: scaleX(1);
    transform-origin: left;
}

/* Cursor Dot */
@media (pointer: fine) {
    .cursor-dot {
        position: fixed;
        top: 0;
        left: 0;
        width: 12px;
        height: 12px;
        background-color: var(--c-text);
        border-radius: 50%;
        pointer-events: none;
        z-index: 9999;
        transform: translate(-50%, -50%);
        transition: width 0.3s, height 0.3s, background-color 0.3s;
    }
    .cursor-dot.is-active {
        width: 40px;
        height: 40px;
        background-color: var(--c-accent);
    }
}

/* ================= Preloader ================= */
.preloader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    background-color: var(--c-bg);
    z-index: 9000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.preloader__content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
}

.preloader__text {
    font-size: clamp(1.5rem, 3vw, 2.5rem);
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: -0.02em;
}

.preloader__icon {
    width: 32px;
    height: 32px;
    color: var(--c-accent);
}

/* ================= Navbar ================= */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    padding: 1.5rem var(--padding-container);
    display: flex;
    justify-content: space-between;
    align-items: center;
    z-index: 1000;
    transition: transform 0.4s var(--ease-out-expo), background-color 0.4s;
}

.navbar.is-hidden {
    transform: translateY(-100%);
}

.navbar__logo {
    display: flex;
    flex-direction: column;
    font-weight: 500;
    line-height: 1.2;
}

.navbar__links {
    display: none;
    gap: 2rem;
}

@media (min-width: 1024px) {
    .navbar__links {
        display: flex;
    }
}

.nav-link {
    font-size: 0.875rem;
    font-weight: 500;
    position: relative;
}
.nav-link::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 0;
    width: 100%;
    height: 1px;
    background-color: currentColor;
    transform: scaleX(0);
    transform-origin: right;
    transition: transform 0.3s var(--ease-out-expo);
}
.nav-link:hover::after {
    transform: scaleX(1);
    transform-origin: left;
}

.navbar__ctas {
    display: none;
    gap: 1rem;
}

@media (min-width: 1024px) {
    .navbar__ctas {
        display: flex;
    }
}

.navbar__toggle {
    display: block;
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-weight: 500;
}
@media (min-width: 1024px) {
    .navbar__toggle {
        display: none;
    }
}

/* Overlay Menu */
.menu-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    background-color: var(--c-bg);
    z-index: 900;
    display: flex;
    align-items: center;
    padding: var(--padding-container);
    clip-path: inset(0 0 100% 0);
}

.menu-overlay__nav {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.menu-link {
    font-size: clamp(2.5rem, 6vw, 4rem);
    font-weight: 500;
    letter-spacing: -0.02em;
    line-height: 1;
    text-transform: uppercase;
    transform: translateY(100%);
    opacity: 0;
}

/* ================= Hero ================= */
.hero {
    position: relative;
    padding-top: calc(7rem + var(--section-padding-y)/2);
    padding-bottom: calc(var(--section-padding-y) / 2);
    background-color: var(--c-bg);
}

.hero__grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 4rem;
    align-items: center;
}

@media (min-width: 1024px) {
    .hero__grid {
        grid-template-columns: 1.2fr 1fr;
        gap: 6rem;
    }
}

.hero__content {
    position: relative;
    z-index: 2;
    max-width: 800px;
}

.hero__title {
    font-size: clamp(2.5rem, 5vw, 4.5rem);
    text-transform: none;
    line-height: 1.05;
    letter-spacing: -0.02em;
}

.hero__subtitle {
    margin-top: 1.5rem;
    max-width: 50ch;
    color: var(--c-muted);
    font-size: clamp(1rem, 1.5vw, 1.125rem);
}

.hero__cta {
    margin-top: 2.5rem;
}

.hero__visual {
    position: relative;
    width: 100%;
}

.hero__visual-inner {
    position: relative;
    width: 100%;
    aspect-ratio: 4/5;
    border-radius: 24px;
    overflow: hidden;
}

.hero__image {
    width: 100%;
    height: 100%;
    object-fit: cover;
}



/* ================= Marquee ================= */
.marquee {
    overflow: hidden;
    white-space: nowrap;
    width: 100%;
}

.marquee__inner {
    display: flex;
    width: fit-content;
}

.marquee__track {
    display: flex;
    gap: 2rem;
    padding-right: 2rem;
}

.marquee span:not(.separator) {
    font-size: 1.5rem;
    text-transform: uppercase;
    font-weight: 500;
    letter-spacing: -0.01em;
}

.separator {
    display: inline-block;
    width: 8px;
    height: 8px;
    background-color: var(--c-accent);
    border-radius: 50%;
    margin: 0 2rem;
    align-self: center;
}

.trust-marquee {
    padding: 4rem 0;
    border-bottom: 1px solid var(--c-border);
}

.marquee--fast .marquee__track span:not(.separator) {
    font-size: clamp(1.2rem, 2vw, 2rem);
    color: var(--c-muted);
}

/* ================= Stats Grid ================= */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 3rem 2rem;
    border-top: 1px solid var(--c-border);
    padding-top: 3rem;
}

@media (min-width: 768px) {
    .stats-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

.stat-value {
    font-size: clamp(3rem, 5vw, 5rem);
    font-weight: 500;
    line-height: 1;
    margin-bottom: 0.5rem;
    letter-spacing: -0.03em;
}

.stat-label {
    color: var(--c-muted);
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* ================= Reviews ================= */
.reviews__carousel {
    display: flex;
    gap: 2rem;
    overflow-x: auto;
    padding-bottom: 2rem;
    scrollbar-width: none; /* Firefox */
}
.reviews__carousel::-webkit-scrollbar {
    display: none; /* Safari/Chrome */
}

.review-card {
    flex: 0 0 300px;
    background: rgba(74, 21, 28, 0.03);
    border: 1px solid var(--c-border);
    border-radius: 16px;
    padding: 2rem;
    transition: background 0.3s;
}

@media (min-width: 768px) {
    .review-card {
        flex: 0 0 400px;
    }
}

.review-card:hover {
    background: rgba(74, 21, 28, 0.06);
}

.review-card__header {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.avatar {
    width: 48px;
    height: 48px;
    background-color: var(--c-muted);
    color: var(--c-bg);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 0.875rem;
}

.review-card__name {
    font-weight: 500;
}

.review-card__pet {
    font-size: 0.875rem;
    color: var(--c-muted);
}

.review-card__quote {
    font-size: 1.125rem;
    line-height: 1.5;
}

/* ================= Services ================= */
.services__grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 2rem;
}

@media (min-width: 768px) {
    .services__grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

.service-card {
    border-radius: 16px;
    overflow: hidden;
    position: relative;
    background: var(--c-bg);
}

.service-card__image {
    width: 100%;
    height: 300px;
    overflow: hidden;
    border-radius: 16px;
}

.service-card__image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transform: scale(1.1);
    transition: transform 0.6s var(--ease-out-expo);
}

.service-card:hover .service-card__image img {
    transform: scale(1.05);
}

.service-card__content {
    padding: 2rem 0;
}

.service-card__title {
    margin-bottom: 1rem;
}

.service-card__list {
    margin-bottom: 1.5rem;
    color: var(--c-muted);
}

.service-card__list li {
    position: relative;
    padding-left: 1.5rem;
    margin-bottom: 0.5rem;
}

.service-card__list li::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0.6em;
    width: 6px;
    height: 6px;
    background-color: var(--c-accent);
    border-radius: 50%;
}

.services__note {
    font-size: 0.875rem;
    color: var(--c-muted);
    border-top: 1px solid var(--c-border);
    padding-top: 1.5rem;
}

/* ================= Pillars ================= */
.pillars__layout {
    display: grid;
    grid-template-columns: 1fr;
    gap: 4rem;
}

@media (min-width: 1024px) {
    .pillars__layout {
        grid-template-columns: 1fr 1fr;
        gap: 6rem;
    }
}

.pillars__sticky-wrapper {
    position: sticky;
    top: calc(5rem + var(--padding-container));
    height: 60vh;
    border-radius: 16px;
    overflow: hidden;
}

.pillars__image-container {
    width: 100%;
    height: 100%;
}

.pillars__image-container img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.pillars__list {
    display: flex;
    flex-direction: column;
    gap: 4rem;
}

.pillar-item {
    padding-left: 2rem;
    border-left: 1px solid var(--c-border);
    transition: opacity 0.4s;
    opacity: 0.3; /* dim inactive ones */
}

.pillar-item.is-active {
    opacity: 1;
    border-left-color: var(--c-text);
}

.pillar-title {
    margin-bottom: 1rem;
}

.pillar-desc {
    color: var(--c-muted);
    max-width: 40ch;
}

/* ================= Kinetic ================= */
.kinetic {
    height: 300vh; /* space for pinning */
    position: relative;
}

.kinetic__wrapper {
    position: sticky;
    top: 0;
    height: 100vh;
    width: 100%;
    overflow: hidden;
    display: flex;
    align-items: center;
}

.kinetic__bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    z-index: -1;
}

.kinetic__overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255,255,255,0.6);
    z-index: 0;
}

.kinetic__content {
    position: relative;
    z-index: 1;
    display: flex;
    gap: 10vw;
    padding-left: 20vw; /* initial offset */
    white-space: nowrap;
}

.kinetic__headline {
    font-size: clamp(4rem, 12vw, 15rem);
    line-height: 0.8;
}

/* ================= FAQ ================= */
.faq__accordion {
    border-top: 1px solid var(--c-border);
}

.faq-item {
    border-bottom: 1px solid var(--c-border);
}

.faq-item__trigger {
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 2rem 0;
    text-align: left;
}

.faq-item__title {
    font-size: clamp(1.25rem, 2vw, 1.75rem);
    font-weight: 500;
    letter-spacing: -0.01em;
}

.faq-item__icon {
    font-size: 2rem;
    font-weight: 300;
    transition: transform 0.4s var(--ease-out-expo);
}

.faq-item.is-open .faq-item__icon {
    transform: rotate(45deg);
}

.faq-item__content {
    height: 0;
    overflow: hidden;
    color: var(--c-muted);
}

.faq-item__content p {
    padding-bottom: 2rem;
    max-width: 60ch;
}

/* ================= Final CTA ================= */
.final-section {
    position: relative;
    z-index: 2;
    background-color: var(--c-bg);
}

.final-cta {
    padding: var(--section-padding-y) 0;
    border-bottom: 1px solid var(--c-border);
}

.final-cta__text {
    max-width: 25ch;
}

.microcopy {
    font-size: 0.75rem;
    color: var(--c-muted);
}

/* ================= Footer ================= */
.footer {
    position: relative;
    background-color: var(--c-bg);
    padding-top: var(--section-padding-y);
    overflow: hidden; /* For parallax wordmark */
}

.footer__grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 3rem;
    margin-bottom: 6rem;
}

@media (min-width: 768px) {
    .footer__grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

.footer__nav {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin-top: 1.5rem;
}

.footer__address {
    font-style: normal;
    color: var(--c-muted);
    margin-top: 1.5rem;
}

.footer__bottom {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 2rem;
    font-size: 0.75rem;
    color: var(--c-muted);
    border-bottom: 1px solid transparent; /* spacing */
}

.footer__wordmark-wrapper {
    width: 100%;
    display: flex;
    justify-content: center;
    overflow: hidden;
}

.footer__wordmark {
    font-size: 15vw;
    line-height: 0.75;
    white-space: nowrap;
    opacity: 0.1;
    transform: translateY(20%);
}

/* ================= Portfolio U-Path Carousel ================= */
.portfolio-u-path {
    position: relative;
    width: 100%;
    height: 100vh;
    background-color: #050505;
    color: #f5f5f5;
    overflow: hidden;
    font-family: 'Inter Tight', sans-serif;
}

.u-path-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

.u-path-header {
    text-align: center;
    z-index: 10;
    margin-bottom: 3rem;
    transition: all 0.6s ease;
}

.u-path-header.dimmed {
    opacity: 0.14;
    filter: blur(5px);
    transform: scale(0.98);
}

.u-path-headline {
    font-size: clamp(26px, 3.4vw, 42px);
    font-weight: 600;
    letter-spacing: -0.02em;
    line-height: 1.1;
}

.u-path-headline-serif {
    font-family: 'Instrument Serif', serif;
    font-style: italic;
    font-size: 0.95em;
    font-weight: 400;
}

/* Funnel */
.u-path-funnel {
    position: relative;
    width: 100%;
    max-width: 600px;
    height: 100px;
    z-index: 20;
}

.funnel-step {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    opacity: 0;
    filter: blur(10px);
    transform: translateY(14px) scale(0.97);
    pointer-events: none;
    transition: opacity 0.55s ease, filter 0.55s ease, transform 0.55s ease;
}

.funnel-step--active {
    opacity: 1;
    filter: blur(0px);
    transform: translateY(0) scale(1);
    pointer-events: auto;
    transition-delay: 0.38s;
}

.funnel-step--exiting {
    opacity: 0;
    filter: blur(10px);
    transform: translateY(-14px) scale(0.97);
    pointer-events: none;
}

.funnel-input-group {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.funnel-icon {
    font-size: 24px;
    font-weight: 600;
    opacity: 0.35;
    transition: opacity 0.3s;
}

.funnel-icon-svg {
    width: 32px;
    height: 24px;
    opacity: 0.35;
    transition: opacity 0.3s;
}

.funnel-input-wrapper {
    position: relative;
    display: inline-block;
}

.funnel-input {
    background: transparent;
    border: none;
    outline: none;
    color: #fff;
    font-family: 'Inter Tight', sans-serif;
    font-size: clamp(30px, 4.4vw, 46px);
    font-weight: 500;
    caret-color: #fff;
    text-align: center;
    width: 100%;
    min-width: 200px;
}

.funnel-input::placeholder {
    color: #3a3a3a;
}

.funnel-input-mirror {
    position: absolute;
    top: 0;
    left: 0;
    visibility: hidden;
    white-space: pre;
    font-size: clamp(30px, 4.4vw, 46px);
    font-weight: 500;
}

.funnel-next-btn, .funnel-submit-btn {
    margin-top: 1.5rem;
    background: #1c1c1e;
    border: 1px solid #2a2a2e;
    color: #fff;
    border-radius: 100px;
    padding: 8px 16px;
    font-size: 13px;
    cursor: pointer;
    transition: opacity 0.3s, transform 0.3s;
}

.funnel-next-btn.hidden, .funnel-submit-btn.hidden {
    opacity: 0;
    pointer-events: none;
    transform: translateY(10px);
}

.funnel-success {
    text-align: center;
}

.success-icon {
    width: 34px;
    height: 34px;
    background: #fff;
    color: #000;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1rem;
}

.success-icon svg {
    width: 20px;
}

.success-text {
    font-size: 34px;
    font-weight: 600;
}

.success-serif {
    font-family: 'Instrument Serif', serif;
    font-style: italic;
    font-weight: 400;
}

.success-subtext {
    color: #7a7a7a;
    font-size: 14px;
    margin-top: 0.5rem;
}

.success-summary {
    margin-top: 2rem;
    font-size: 12px;
}

.summary-row {
    margin-top: 0.5rem;
}

.summary-label {
    color: #5c5c5c;
    margin-right: 0.5rem;
}

.summary-val {
    font-weight: 600;
}

/* 3D Carousel */
.u-path-strip {
    position: absolute;
    bottom: 10vh;
    left: 0;
    width: 100%;
    height: 350px; /* Increased to accommodate larger cards */
    z-index: 5;
    perspective: 700px; /* Lower perspective for more dramatic "zoom" */
    -webkit-mask-image: linear-gradient(90deg, transparent, #000 12%, #000 88%, transparent);
    mask-image: linear-gradient(90deg, transparent, #000 12%, #000 88%, transparent);
    pointer-events: none;
    transition: opacity 0.8s ease, filter 0.8s ease;
}

.u-path-strip.fade-out {
    opacity: 0;
    filter: blur(8px);
}

.u-path-pivot {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    transform-style: preserve-3d;
    transform: translateZ(0); /* Crucial: pivot is spectator position */
}

.u-path-card {
    position: absolute;
    top: 0;
    left: 0;
    width: 320px; /* Increased from 250px */
    height: 200px; /* Increased from 156px */
    margin-left: -160px; /* Center at 0,0 */
    margin-top: -100px;
    background: #0f0f11;
    border: 1px solid #232326;
    border-radius: 8px;
    box-shadow: 0 20px 40px rgba(0,0,0,0.5);
    backface-visibility: hidden;
    will-change: transform, opacity, filter;
    /* Content styling */
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    padding: 1.25rem;
}

.u-path-card-title {
    font-size: 12px;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.u-path-card-skeleton {
    width: 100%;
    height: 4px;
    background: #232326;
    border-radius: 2px;
    margin-bottom: 0.25rem;
}

.u-path-card-skeleton.short {
    width: 60%;
    margin-bottom: 0.75rem;
}

.u-path-card-pill {
    width: 60px;
    height: 12px;
    background: #fff;
    border-radius: 6px;
}

/* Mobile CTA */
.mobile-cta {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    background-color: var(--c-text);
    color: var(--c-bg);
    text-align: center;
    padding: 1rem;
    font-weight: 600;
    z-index: 999;
    display: block;
}

@media (min-width: 768px) {
    .mobile-cta {
        display: none;
    }
}
