:root {
    --glacial-blue: #E6F0FF;
    --pearl-gray: #F5F7FA;
    --mint-green: #D4F1E6;
    --terracotta: #E07A5F;
    --honey-yellow: #F9C88D;
    --night-blue: #0F1A2C;
    --lunar-white: #ECEFF1;
    --text-dark: #1a2a3a;
    --text-light: #6b7b8b;
}

[data-theme="dark"] {
    --glacial-blue: #0F1A2C;
    --pearl-gray: #162030;
    --mint-green: #1a3040;
    --text-dark: #ECEFF1;
    --text-light: #a0b0c0;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'DM Sans', sans-serif;
    background: var(--glacial-blue);
    color: var(--text-dark);
    overflow-x: hidden;
    transition: background 0.5s ease, color 0.5s ease;
}

h1, h2, h3, h4, h5, h6 {
    font-family: 'Outfit', sans-serif;
}

/* Canvas 3D */
#hero-canvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    pointer-events: none;
}

.hero-media {
    display: block;
    border-radius: 24px;
    background: #cdeee3;
}

/* Parallax layers */
.parallax-layer {
    position: absolute;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

/* Animated gradient background */
.hero-gradient {
    background: linear-gradient(135deg, var(--glacial-blue) 0%, var(--pearl-gray) 50%, var(--mint-green) 100%);
    background-size: 400% 400%;
    animation: gradientShift 15s ease infinite;
}

@keyframes gradientShift {
    0%, 100% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
}

/* Floating elements */
.float-element {
    animation: float 6s ease-in-out infinite;
}

.float-element:nth-child(2) { animation-delay: -2s; }
.float-element:nth-child(3) { animation-delay: -4s; }

@keyframes float {
    0%, 100% { transform: translateY(0) rotate(0deg); }
    50% { transform: translateY(-20px) rotate(5deg); }
}

/* Paw print pattern */
.paw-pattern {
    position: absolute;
    opacity: 0.03;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='60' height='60' viewBox='0 0 60 60'%3E%3Cpath fill='%23E07A5F' d='M30 20c-2.5 0-4.5 2-4.5 4.5s2 4.5 4.5 4.5 4.5-2 4.5-4.5-2-4.5-4.5-4.5zm-10 5c-2 0-3.5 1.5-3.5 3.5s1.5 3.5 3.5 3.5 3.5-1.5 3.5-3.5-1.5-3.5-3.5-3.5zm20 0c-2 0-3.5 1.5-3.5 3.5s1.5 3.5 3.5 3.5 3.5-1.5 3.5-3.5-1.5-3.5-3.5-3.5zm-15 8c-2 0-3.5 1.5-3.5 3.5s1.5 3.5 3.5 3.5 3.5-1.5 3.5-3.5-1.5-3.5-3.5-3.5zm10 0c-2 0-3.5 1.5-3.5 3.5s1.5 3.5 3.5 3.5 3.5-1.5 3.5-3.5-1.5-3.5-3.5-3.5z'/%3E%3C/svg%3E");
    background-size: 60px 60px;
    pointer-events: none;
}

/* Card hover effects */
.service-card {
    background: var(--pearl-gray);
    border: 1px solid rgba(224, 122, 95, 0.1);
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.service-card:hover {
    transform: translateY(-12px) scale(1.02);
    box-shadow: 0 25px 50px -12px rgba(224, 122, 95, 0.25);
    border-color: var(--terracotta);
}

/* CTA Button */
.cta-btn {
    background: var(--terracotta);
    color: white;
    position: relative;
    overflow: hidden;
    transition: all 0.3s ease;
}

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

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

.cta-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 15px 30px -10px rgba(224, 122, 95, 0.5);
}

/* Team cards neumorphism */
.team-card {
    background: var(--pearl-gray);
    border-radius: 20px;
    box-shadow: 8px 8px 16px rgba(0,0,0,0.05), -8px -8px 16px rgba(255,255,255,0.8);
    transition: all 0.4s ease;
}

[data-theme="dark"] .team-card {
    box-shadow: 8px 8px 16px rgba(0,0,0,0.3), -8px -8px 16px rgba(255,255,255,0.02);
}

.team-card:hover {
    transform: translateY(-8px);
}

/* Chatbot */
.chatbot-container {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 1000;
}

.chatbot-btn {
    width: 64px;
    height: 64px;
    background: linear-gradient(135deg, var(--terracotta) 0%, #c96a52 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 8px 24px rgba(224, 122, 95, 0.4);
    transition: all 0.3s ease;
    animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { box-shadow: 0 8px 24px rgba(224, 122, 95, 0.4); }
    50% { box-shadow: 0 8px 40px rgba(224, 122, 95, 0.6); }
}

.chatbot-btn:hover {
    transform: scale(1.1);
}

.chatbot-window {
    position: absolute;
    bottom: 80px;
    right: 0;
    width: 360px;
    max-height: 500px;
    background: var(--pearl-gray);
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.2);
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px) scale(0.9);
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    overflow: hidden;
}

.chatbot-window.active {
    opacity: 1;
    visibility: visible;
    transform: translateY(0) scale(1);
}

/* Counter animation */
.counter {
    font-family: 'Outfit', sans-serif;
    font-weight: 800;
    background: linear-gradient(135deg, var(--terracotta) 0%, var(--honey-yellow) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Testimonial cards */
.testimonial-card {
    background: var(--pearl-gray);
    border-radius: 24px;
    overflow: hidden;
    transition: all 0.4s ease;
}

.testimonial-card:hover {
    transform: scale(1.03);
}

.testimonial-avatar {
    position: relative;
    flex-shrink: 0;
    overflow: hidden;
}

.testimonial-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.testimonial-avatar-fallback {
    width: 100%;
    height: 100%;
    border-radius: 9999px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-dark);
}

/* Exit popup */
.exit-popup {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(15, 26, 44, 0.9);
    backdrop-filter: blur(10px);
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: all 0.4s ease;
}

.exit-popup.active {
    opacity: 1;
    visibility: visible;
}

.exit-popup-content {
    background: var(--pearl-gray);
    border-radius: 24px;
    max-width: 500px;
    padding: 40px;
    transform: scale(0.8);
    transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.exit-popup.active .exit-popup-content {
    transform: scale(1);
}

/* Scroll animations */
.reveal {
    opacity: 0;
    transform: translateY(40px);
    transition: all 0.8s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

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

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

/* Navigation */
.nav-link {
    position: relative;
    color: var(--text-dark);
    transition: color 0.3s ease;
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--terracotta);
    transition: width 0.3s ease;
}

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

/* Dark mode toggle */
.theme-toggle {
    width: 50px;
    height: 28px;
    background: var(--mint-green);
    border-radius: 14px;
    position: relative;
    cursor: pointer;
    transition: background 0.3s ease;
}

.theme-toggle::before {
    content: '';
    position: absolute;
    top: 2px;
    left: 2px;
    width: 24px;
    height: 24px;
    background: var(--terracotta);
    border-radius: 50%;
    transition: transform 0.3s ease;
}

[data-theme="dark"] .theme-toggle::before {
    transform: translateX(22px);
}

/* Blog layout */
.blog-layout {
    display: flex;
    flex-direction: column;
    gap: 32px;
}

.blog-featured-wrapper {
    min-height: 260px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.blog-featured {
    display: grid;
    grid-template-columns: 1fr;
    gap: 24px;
    width: 100%;
    max-width: 960px;
}

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

.blog-card {
    border-radius: 24px;
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease, opacity 0.3s ease;
}

.blog-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 14px 35px rgba(15, 26, 44, 0.12);
}

.blog-list-wrapper {
    border-top: 1px solid rgba(15, 26, 44, 0.08);
    padding-top: 24px;
}

.blog-list-grid {
    margin-top: 16px;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 320px));
    gap: 24px;
    justify-content: center;
}

@media (min-width: 640px) {
    .blog-list-grid {
        grid-template-columns: repeat(auto-fit, minmax(260px, 320px));
    }
}

@media (min-width: 1024px) {
    .blog-list-grid {
        grid-template-columns: repeat(auto-fit, minmax(260px, 320px));
    }
}

.blog-cards-source {
    display: none;
}

.blog-card-transition {
    opacity: 0;
    transform: translateY(16px);
}

.blog-card-transition-active {
    opacity: 1;
    transform: translateY(0);
}

/* Focus states */
button:focus-visible, a:focus-visible, input:focus-visible, textarea:focus-visible {
    outline: 3px solid var(--terracotta);
    outline-offset: 3px;
}

/* Loading animation */
.page-loader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--glacial-blue);
    z-index: 3000;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity 0.5s ease;
}

.page-loader.hidden {
    opacity: 0;
    pointer-events: none;
}

.loader-paw {
    width: 60px;
    height: 60px;
    animation: loaderBounce 1s ease-in-out infinite;
}

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