/* ============================================
   Айболить — Ветеринарна клініка
   Aesthetic: Warm organic / editorial
   ============================================ */

:root {
    --forest: #2D5016;
    --forest-deep: #1A3409;
    --terra: #C4733B;
    --terra-light: #D4915E;
    --terra-glow: rgba(196, 115, 59, 0.15);
    --cream: #FDF6EC;
    --cream-dark: #F5EBDA;
    --sage: #E8EDDF;
    --sage-mid: #C5CCBA;
    --bark: #2C1810;
    --bark-soft: #5C4033;
    --mist: #9CA38F;
    --white: #FEFDFB;
    --shadow: rgba(44, 24, 16, 0.08);
    --shadow-lg: rgba(44, 24, 16, 0.14);

    --font-display: 'Playfair Display', 'Georgia', serif;
    --font-body: 'DM Sans', 'Helvetica Neue', sans-serif;

    --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
    --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* Reset */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: var(--font-body);
    font-size: 16px;
    line-height: 1.65;
    color: var(--bark);
    background: var(--cream);
    overflow-x: hidden;
}

img {
    display: block;
    max-width: 100%;
}

a {
    color: inherit;
    text-decoration: none;
}

button {
    font-family: inherit;
    border: none;
    background: none;
    cursor: pointer;
}

address {
    font-style: normal;
}

/* Grain overlay */
.grain-overlay {
    position: fixed;
    inset: 0;
    z-index: 9999;
    pointer-events: none;
    opacity: 0.035;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)'/%3E%3C/svg%3E");
    background-repeat: repeat;
    background-size: 200px 200px;
}

/* Container */
.container {
    max-width: 1180px;
    margin: 0 auto;
    padding: 0 24px;
}

/* ============================================
   HEADER
   ============================================ */
.header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100;
    padding: 0 0;
    transition: background 0.4s var(--ease-out), box-shadow 0.4s var(--ease-out), padding 0.4s var(--ease-out);
}

.header.scrolled {
    background: rgba(253, 246, 236, 0.92);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    box-shadow: 0 1px 0 var(--sage-mid);
}

.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 0;
    transition: padding 0.4s var(--ease-out);
}

.header.scrolled .header-inner {
    padding: 12px 0;
}

.logo {
    display: flex;
    align-items: center;
    gap: 10px;
}

.logo-img {
    height: 44px;
    width: auto;
    object-fit: contain;
    transition: height 0.4s var(--ease-out);
}

.header.scrolled .logo-img {
    height: 36px;
}

.nav {
    display: flex;
    align-items: center;
    gap: 36px;
}

.nav-link {
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--bark-soft);
    letter-spacing: 0.02em;
    position: relative;
    transition: color 0.3s;
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 0;
    width: 0;
    height: 1.5px;
    background: var(--terra);
    transition: width 0.4s var(--ease-out);
}

.nav-link:hover {
    color: var(--bark);
}

.nav-link:hover::after {
    width: 100%;
}

.nav-cta {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 10px 20px;
    background: var(--forest);
    color: var(--cream);
    border-radius: 100px;
    font-size: 0.85rem;
    font-weight: 600;
    letter-spacing: 0.01em;
    transition: background 0.3s, transform 0.3s var(--ease-spring);
}

.nav-cta:hover {
    background: var(--forest-deep);
    transform: translateY(-1px);
}

.menu-toggle {
    display: none;
    flex-direction: column;
    gap: 6px;
    padding: 8px;
    z-index: 110;
}

.menu-toggle span {
    display: block;
    width: 24px;
    height: 2px;
    background: var(--bark);
    border-radius: 2px;
    transition: all 0.35s var(--ease-out);
    transform-origin: center;
}

.menu-toggle.active span:first-child {
    transform: translateY(4px) rotate(45deg);
}

.menu-toggle.active span:last-child {
    transform: translateY(-4px) rotate(-45deg);
}

/* ============================================
   HERO
   ============================================ */
.hero {
    position: relative;
    min-height: 100vh;
    min-height: 100dvh;
    display: flex;
    align-items: flex-end;
    padding-bottom: 60px;
    overflow: hidden;
}

.hero-bg {
    position: absolute;
    inset: 0;
    z-index: -2;
}

.hero-bg::after {
    content: '';
    position: absolute;
    inset: 0;
    background:
        linear-gradient(180deg,
            rgba(44, 24, 16, 0.15) 0%,
            rgba(44, 24, 16, 0.05) 30%,
            rgba(44, 24, 16, 0.3) 65%,
            rgba(44, 24, 16, 0.85) 100%
        );
    z-index: 1;
}

.hero-image {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center 30%;
    opacity: 0;
    transition: opacity 1.2s ease-in-out;
}

.hero-image.active {
    opacity: 1;
}

.hero-content {
    position: relative;
    z-index: 2;
    color: var(--cream);
    padding-top: 140px;
}

.hero-badge {
    display: inline-block;
    padding: 6px 16px;
    border: 1px solid rgba(253, 246, 236, 0.3);
    border-radius: 100px;
    font-size: 0.8rem;
    font-weight: 500;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    margin-bottom: 28px;
    backdrop-filter: blur(4px);
    background: rgba(253, 246, 236, 0.08);
    opacity: 0;
    animation: fadeUp 0.8s var(--ease-out) 0.2s forwards;
}

.hero-title {
    font-family: var(--font-display);
    font-size: clamp(2.8rem, 6vw, 5rem);
    font-weight: 700;
    line-height: 1.1;
    letter-spacing: -0.02em;
    margin-bottom: 24px;
    opacity: 0;
    animation: fadeUp 0.9s var(--ease-out) 0.35s forwards;
}

.hero-title em {
    font-style: italic;
    color: var(--terra-light);
}

.hero-desc {
    max-width: 520px;
    font-size: 1.1rem;
    line-height: 1.6;
    color: rgba(253, 246, 236, 0.8);
    margin-bottom: 36px;
    opacity: 0;
    animation: fadeUp 0.9s var(--ease-out) 0.5s forwards;
}

.hero-actions {
    display: flex;
    gap: 14px;
    flex-wrap: wrap;
    margin-bottom: 56px;
    opacity: 0;
    animation: fadeUp 0.9s var(--ease-out) 0.65s forwards;
}

.hero-stats {
    display: flex;
    align-items: center;
    gap: 32px;
    opacity: 0;
    animation: fadeUp 0.9s var(--ease-out) 0.8s forwards;
}

.hero-stat-num {
    display: block;
    font-family: var(--font-display);
    font-size: 2rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    color: var(--cream);
}

.hero-stat-label {
    display: block;
    font-size: 0.8rem;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: rgba(253, 246, 236, 0.55);
    font-weight: 500;
}

.hero-stat-divider {
    width: 1px;
    height: 40px;
    background: rgba(253, 246, 236, 0.2);
}

.hero-scroll-hint {
    position: absolute;
    bottom: 28px;
    left: 50%;
    transform: translateX(-50%);
    color: rgba(253, 246, 236, 0.4);
    animation: bobDown 2s ease-in-out infinite;
}

@keyframes bobDown {
    0%, 100% { transform: translateX(-50%) translateY(0); }
    50% { transform: translateX(-50%) translateY(8px); }
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 14px 28px;
    border-radius: 100px;
    font-size: 0.95rem;
    font-weight: 600;
    letter-spacing: 0.01em;
    transition: all 0.35s var(--ease-out);
    white-space: nowrap;
}

.btn-warm {
    background: var(--terra);
    color: var(--cream);
}

.btn-warm:hover {
    background: #B5642F;
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(196, 115, 59, 0.35);
}

.btn-ghost {
    background: rgba(253, 246, 236, 0.12);
    color: var(--cream);
    border: 1px solid rgba(253, 246, 236, 0.25);
    backdrop-filter: blur(4px);
}

.btn-ghost:hover {
    background: rgba(253, 246, 236, 0.2);
    transform: translateY(-2px);
}

/* ============================================
   SECTION COMMON
   ============================================ */
section {
    padding: 100px 0;
}

.section-tag {
    display: inline-block;
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--terra);
    margin-bottom: 14px;
}

.section-tag--light {
    color: var(--terra-light);
}

.section-title {
    font-family: var(--font-display);
    font-size: clamp(2.2rem, 4.5vw, 3.4rem);
    font-weight: 700;
    line-height: 1.15;
    letter-spacing: -0.02em;
    color: var(--bark);
}

.section-title em {
    font-style: italic;
    color: var(--terra);
}

.section-title--light {
    color: var(--cream);
}

.section-title--light em {
    color: var(--terra-light);
}

.section-header-center {
    text-align: center;
    margin-bottom: 64px;
}

/* Scroll animation */
.reveal {
    opacity: 0;
    transform: translateY(32px);
    transition: opacity 0.7s var(--ease-out), transform 0.7s var(--ease-out);
}

.reveal.visible {
    opacity: 1;
    transform: translateY(0);
}

/* ============================================
   ABOUT
   ============================================ */
.about {
    background: var(--cream);
    position: relative;
}

.about::before {
    content: '';
    position: absolute;
    top: -1px;
    left: 0;
    right: 0;
    height: 120px;
    background: linear-gradient(to bottom, var(--cream), transparent);
    z-index: 1;
    pointer-events: none;
}

.about-grid {
    display: grid;
    grid-template-columns: 1fr 1.3fr;
    gap: 80px;
    align-items: start;
    margin-bottom: 80px;
}

.about-right {
    font-size: 1.05rem;
    color: var(--bark-soft);
}

.about-right p {
    margin-bottom: 18px;
}

.about-lead {
    font-size: 1.2rem;
    font-weight: 500;
    color: var(--bark);
    line-height: 1.5;
}

.about-right strong {
    color: var(--terra);
    font-weight: 600;
}

.features-row {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 28px;
}

.feature-card {
    background: var(--white);
    border: 1px solid var(--sage);
    border-radius: 16px;
    padding: 36px 28px;
    transition: all 0.4s var(--ease-out);
    position: relative;
    overflow: hidden;
}

.feature-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--terra);
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.5s var(--ease-out);
}

.feature-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 40px var(--shadow);
    border-color: var(--sage-mid);
}

.feature-card:hover::before {
    transform: scaleX(1);
}

.feature-icon {
    width: 52px;
    height: 52px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--terra-glow);
    border-radius: 14px;
    color: var(--terra);
    margin-bottom: 20px;
}

.feature-card h3 {
    font-family: var(--font-display);
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 8px;
    color: var(--bark);
}

.feature-card p {
    font-size: 0.92rem;
    color: var(--mist);
    line-height: 1.55;
}

/* ============================================
   LOCATIONS
   ============================================ */
.locations {
    background: var(--sage);
    position: relative;
}

.locations-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
}

.loc-card {
    background: var(--white);
    border-radius: 20px;
    padding: 32px 28px;
    border: 1px solid rgba(197, 204, 186, 0.6);
    transition: all 0.4s var(--ease-out);
    display: flex;
    flex-direction: column;
}

.loc-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 16px 48px var(--shadow-lg);
}

.loc-card--primary {
    background: var(--forest);
    color: var(--cream);
    border-color: var(--forest);
}

.loc-card--primary .loc-type {
    background: rgba(253, 246, 236, 0.15);
    color: var(--terra-light);
}

.loc-card--primary .loc-address {
    color: rgba(253, 246, 236, 0.7);
}

.loc-card--primary .loc-phone a {
    color: var(--cream);
}

.loc-card--primary .loc-schedule {
    border-color: rgba(253, 246, 236, 0.15);
}

.loc-card--primary .loc-schedule-row span:first-child {
    color: rgba(253, 246, 236, 0.5);
}

.loc-card--primary .loc-schedule-row span:last-child {
    color: var(--cream);
}

.loc-card--primary .loc-break span {
    color: rgba(253, 246, 236, 0.4) !important;
}

.loc-card--primary .loc-map-link {
    color: var(--terra-light);
}

.loc-type {
    display: inline-block;
    align-self: flex-start;
    padding: 4px 14px;
    background: var(--terra-glow);
    color: var(--terra);
    border-radius: 100px;
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    margin-bottom: 16px;
}

.loc-name {
    font-family: var(--font-display);
    font-size: 1.35rem;
    font-weight: 600;
    margin-bottom: 8px;
}

.loc-address {
    font-size: 0.95rem;
    color: var(--mist);
    margin-bottom: 16px;
    line-height: 1.5;
}

.loc-address small {
    font-size: 0.8rem;
    opacity: 0.7;
}

.loc-phone {
    margin-bottom: 20px;
}

.loc-phone a {
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--bark);
    letter-spacing: 0.01em;
    transition: color 0.3s;
}

.loc-phone a:hover {
    color: var(--terra);
}

.loc-schedule {
    border-top: 1px solid var(--sage);
    padding-top: 16px;
    margin-bottom: 20px;
    flex-grow: 1;
}

.loc-schedule-row {
    display: flex;
    justify-content: space-between;
    padding: 5px 0;
    font-size: 0.88rem;
}

.loc-schedule-row span:first-child {
    color: var(--mist);
    font-weight: 500;
}

.loc-schedule-row span:last-child {
    font-weight: 600;
    color: var(--bark);
}

.loc-break span {
    color: var(--mist) !important;
    font-weight: 400 !important;
    font-size: 0.82rem;
}

.loc-map-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.88rem;
    font-weight: 600;
    color: var(--terra);
    transition: gap 0.3s var(--ease-out);
    margin-top: auto;
}

.loc-map-link:hover {
    gap: 10px;
}

/* ============================================
   GALLERY
   ============================================ */
.gallery {
    background: var(--forest-deep);
    color: var(--cream);
    overflow: hidden;
}

.gallery-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    margin-bottom: 40px;
}

.gallery-controls {
    display: flex;
    align-items: center;
    gap: 16px;
}

.gallery-btn {
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid rgba(253, 246, 236, 0.2);
    border-radius: 50%;
    color: var(--cream);
    transition: all 0.3s var(--ease-out);
}

.gallery-btn:hover {
    background: rgba(253, 246, 236, 0.1);
    border-color: rgba(253, 246, 236, 0.4);
    transform: scale(1.05);
}

.gallery-counter {
    font-family: var(--font-display);
    font-size: 0.95rem;
    color: rgba(253, 246, 236, 0.5);
    min-width: 50px;
    text-align: center;
}

.gallery-viewport {
    overflow: hidden;
    border-radius: 16px;
    cursor: grab;
}

.gallery-viewport:active {
    cursor: grabbing;
}

.gallery-track {
    display: flex;
    transition: transform 0.6s var(--ease-out);
    will-change: transform;
}

.gallery-slide {
    min-width: 100%;
    aspect-ratio: 16 / 10;
    overflow: hidden;
}

.gallery-slide img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.6s var(--ease-out);
}

.gallery-slide:hover img {
    transform: scale(1.03);
}

.gallery-progress {
    margin-top: 24px;
    height: 2px;
    background: rgba(253, 246, 236, 0.1);
    border-radius: 2px;
    overflow: hidden;
}

.gallery-progress-bar {
    height: 100%;
    background: var(--terra);
    border-radius: 2px;
    transition: width 0.6s var(--ease-out);
}

/* ============================================
   FOOTER
   ============================================ */
.footer {
    background: var(--bark);
    color: rgba(253, 246, 236, 0.65);
    padding: 72px 0 32px;
}

.footer-top {
    display: grid;
    grid-template-columns: 1fr 2fr;
    gap: 60px;
    padding-bottom: 48px;
    border-bottom: 1px solid rgba(253, 246, 236, 0.08);
}

.footer-logo {
    width: 160px;
    margin-bottom: 16px;
    opacity: 0.9;
}

.footer-brand p {
    font-size: 0.9rem;
    line-height: 1.6;
}

.footer-cols {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 40px;
}

.footer-col h4 {
    font-family: var(--font-display);
    font-size: 1rem;
    font-weight: 600;
    color: var(--cream);
    margin-bottom: 16px;
}

.footer-col ul {
    list-style: none;
}

.footer-col li {
    padding: 4px 0;
    font-size: 0.88rem;
}

.footer-col li a {
    color: rgba(253, 246, 236, 0.75);
    transition: color 0.3s;
}

.footer-col li a:hover {
    color: var(--terra-light);
}

.footer-col li span {
    color: rgba(253, 246, 236, 0.35);
    font-size: 0.8rem;
    margin-left: 6px;
}

.footer-social {
    display: flex;
    gap: 10px;
}

.social-link {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid rgba(253, 246, 236, 0.12);
    border-radius: 10px;
    color: rgba(253, 246, 236, 0.6);
    transition: all 0.3s var(--ease-out);
}

.social-link:hover {
    background: rgba(253, 246, 236, 0.08);
    border-color: rgba(253, 246, 236, 0.25);
    color: var(--cream);
    transform: translateY(-2px);
}

.footer-bottom {
    display: flex;
    justify-content: space-between;
    padding-top: 24px;
    font-size: 0.8rem;
    color: rgba(253, 246, 236, 0.3);
}

/* ============================================
   FAB (Floating Action Button)
   ============================================ */
.fab {
    position: fixed;
    bottom: 28px;
    right: 28px;
    z-index: 90;
    width: 56px;
    height: 56px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--forest);
    color: var(--cream);
    border-radius: 50%;
    box-shadow: 0 4px 20px rgba(45, 80, 22, 0.4);
    transition: all 0.35s var(--ease-spring);
}

.fab:hover {
    transform: scale(1.1) translateY(-2px);
    box-shadow: 0 8px 28px rgba(45, 80, 22, 0.5);
    background: var(--forest-deep);
}

.fab::before {
    content: '';
    position: absolute;
    inset: -6px;
    border-radius: 50%;
    border: 2px solid var(--forest);
    opacity: 0;
    animation: fabRing 3s ease-in-out infinite;
}

@keyframes fabRing {
    0%, 100% { opacity: 0; transform: scale(0.9); }
    50% { opacity: 0.3; transform: scale(1.1); }
}

/* ============================================
   ANIMATIONS
   ============================================ */
@keyframes fadeUp {
    from {
        opacity: 0;
        transform: translateY(24px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 1024px) {
    .about-grid {
        gap: 48px;
    }

    .locations-grid {
        grid-template-columns: 1fr 1fr;
    }

    .loc-card--primary {
        grid-column: 1 / -1;
    }

    .footer-top {
        grid-template-columns: 1fr;
        gap: 40px;
    }
}

@media (max-width: 768px) {
    .container {
        padding: 0 20px;
    }

    section {
        padding: 72px 0;
    }

    /* Header mobile */
    .nav {
        position: fixed;
        inset: 0;
        background: rgba(253, 246, 236, 0.98);
        backdrop-filter: blur(20px);
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 32px;
        opacity: 0;
        pointer-events: none;
        transition: opacity 0.4s var(--ease-out);
        z-index: 100;
    }

    .nav.active {
        opacity: 1;
        pointer-events: all;
    }

    .nav-link {
        font-size: 1.4rem;
        font-family: var(--font-display);
    }

    .nav-cta {
        font-size: 1rem;
        padding: 14px 28px;
    }

    .menu-toggle {
        display: flex;
    }

    /* Hero mobile */
    .hero {
        min-height: 100vh;
        min-height: 100dvh;
        align-items: flex-end;
        padding-bottom: 40px;
    }

    .hero-content {
        padding-top: 100px;
    }

    .hero-title {
        font-size: clamp(2.2rem, 8vw, 3.2rem);
    }

    .hero-stats {
        gap: 20px;
    }

    .hero-stat-num {
        font-size: 1.5rem;
    }

    .hero-scroll-hint {
        display: none;
    }

    /* About mobile */
    .about-grid {
        grid-template-columns: 1fr;
        gap: 32px;
    }

    .features-row {
        grid-template-columns: 1fr;
        gap: 16px;
    }

    .feature-card {
        padding: 28px 24px;
    }

    /* Locations mobile */
    .locations-grid {
        grid-template-columns: 1fr;
    }

    .loc-card--primary {
        grid-column: auto;
    }

    /* Gallery mobile */
    .gallery-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 24px;
    }

    .gallery-slide {
        aspect-ratio: 4 / 3;
    }

    /* Footer mobile */
    .footer-cols {
        grid-template-columns: 1fr;
        gap: 28px;
    }

    .footer-bottom {
        flex-direction: column;
        gap: 4px;
        text-align: center;
    }
}

@media (max-width: 480px) {
    .hero-actions {
        flex-direction: column;
    }

    .hero-actions .btn {
        justify-content: center;
    }

    .hero-stats {
        flex-wrap: wrap;
        justify-content: center;
    }

    .loc-card {
        padding: 24px 20px;
    }
}
