/* ============================================
   SPIRE AI - TAILWIND CSS + CUSTOM ANIMATIONS
   Minimal CSS - Most styles handled by Tailwind
   ============================================ */

/* ============================================
   HERO SECTION - MOBILE VIEWPORT FIX
   ============================================ */
/* Use dvh (dynamic viewport height) on mobile to account for browser chrome */
@supports (height: 100dvh) {
    section.h-screen {
        height: 100dvh;
    }
}

/* Fallback for older browsers - use standard vh with max-height */
@supports not (height: 100dvh) {
    section.h-screen {
        height: 100vh;
        max-height: 100vh;
    }
}

/* ============================================
   SCROLL-TRIGGERED ANIMATIONS
   ============================================ */
.fade-in,
.slide-in-left,
.slide-in-right,
.slide-in-up {
    opacity: 0;
    transition: opacity 0.8s cubic-bezier(0.4, 0, 0.2, 1),
                transform 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

.fade-in {
    transform: translateY(40px);
}

.slide-in-left {
    transform: translateX(-50px);
}

.slide-in-right {
    transform: translateX(50px);
}

.slide-in-up {
    transform: translateY(50px);
}

/* Animated state - triggered when in viewport */
.fade-in.animate-in,
.slide-in-left.animate-in,
.slide-in-right.animate-in,
.slide-in-up.animate-in {
    opacity: 1;
    transform: translate(0, 0);
}

/* Ensure sections with overflow-hidden don't clip animations */
section.overflow-hidden.fade-in {
    transform: translateY(20px);
}

/* ============================================
   HERO SECTION ANIMATIONS - PROFESSIONAL
   ============================================ */
/* Hero background image - subtle zoom in */
.hero-image {
    animation: heroZoom 1.2s cubic-bezier(0.4, 0, 0.2, 1) forwards;
    transform-origin: center center;
    object-position: 70% 40%;
}

@media (min-width: 768px) {
    .hero-image {
        object-position: center 40%;
    }
}

@keyframes heroZoom {
    from {
        transform: scale(1.08);
    }
    to {
        transform: scale(1);
    }
}

/* Hero heading - fade up */
.hero-heading {
    opacity: 0;
    transform: translateY(30px);
    animation: heroFadeUp 0.8s cubic-bezier(0.4, 0, 0.2, 1) 0.3s forwards;
}

/* Hero text - fade up with slight delay */
.hero-text {
    opacity: 0;
    transform: translateY(30px);
    animation: heroFadeUp 0.8s cubic-bezier(0.4, 0, 0.2, 1) 0.45s forwards;
}

@keyframes heroFadeUp {
    to {
        opacity: 0.9;
        transform: translateY(0);
    }
}

/* Hero CTA button - subtle pop in */
.hero-cta {
    opacity: 0;
    transform: translateY(20px) scale(0.95);
    animation: heroCTA 0.6s cubic-bezier(0.4, 0, 0.2, 1) 0.6s forwards;
}

@keyframes heroCTA {
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* ============================================
   STAGGER CHILDREN ANIMATIONS
   ============================================ */
.stagger-children > * {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.5s cubic-bezier(0.4, 0, 0.2, 1),
                transform 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.stagger-children.animate-in > *:nth-child(1) { transition-delay: 0.1s; }
.stagger-children.animate-in > *:nth-child(2) { transition-delay: 0.2s; }
.stagger-children.animate-in > *:nth-child(3) { transition-delay: 0.3s; }
.stagger-children.animate-in > *:nth-child(4) { transition-delay: 0.4s; }
.stagger-children.animate-in > *:nth-child(5) { transition-delay: 0.5s; }
.stagger-children.animate-in > *:nth-child(6) { transition-delay: 0.6s; }

.stagger-children.animate-in > * {
    opacity: 1;
    transform: translateY(0);
}

/* ============================================
   INFINITE SCROLL CAROUSEL
   ============================================ */
.integrations-wrapper {
    position: relative;
    overflow: hidden;
    -webkit-mask-image: linear-gradient(to right, transparent 0%, black 5%, black 95%, transparent 100%);
    mask-image: linear-gradient(to right, transparent 0%, black 5%, black 95%, transparent 100%);
}

/* ============================================
   USP CAROUSEL IMAGE SCALING
   ============================================ */
.usp-carousel-img {
    height: 240px;
}

@media (min-width: 640px) {
    .usp-carousel-img {
        height: 350px;
    }
}

/* Scale down on smaller viewports */
@media (min-width: 640px) and (max-height: 800px) {
    .usp-carousel-img {
        height: 300px;
    }
}

@media (min-width: 640px) and (max-height: 700px) {
    .usp-carousel-img {
        height: 270px;
    }
}

@media (min-width: 640px) and (max-height: 600px) {
    .usp-carousel-img {
        height: 240px;
    }
}

/* ============================================
   ORBIT ANIMATION
   ============================================ */
.orbit-container {
    width: 100%;
    height: 240px;
    min-height: 240px;
    max-height: 240px;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    background: radial-gradient(circle at center, #2a3d52, #1d2a38);
    border-radius: 32px;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.08);
    overflow: hidden;
}

@media (min-width: 640px) {
    .orbit-container {
        height: 350px;
        min-height: 350px;
        max-height: 350px;
    }
}

/* Scale down orbit container on smaller viewports */
@media (min-width: 640px) and (max-height: 800px) {
    .orbit-container {
        height: 300px;
        min-height: 300px;
        max-height: 300px;
    }
}

@media (min-width: 640px) and (max-height: 700px) {
    .orbit-container {
        height: 270px;
        min-height: 270px;
        max-height: 270px;
    }
}

@media (min-width: 640px) and (max-height: 600px) {
    .orbit-container {
        height: 240px;
        min-height: 240px;
        max-height: 240px;
    }
}

.orbit-wrap {
    position: relative;
    width: 200px;
    height: 200px;
    list-style: none;
    padding: 0;
    margin: 0;
}

@media (min-width: 640px) {
    .orbit-wrap {
        width: 280px;
        height: 280px;
    }
}

.orbit-wrap > li {
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
}

.orbit-center {
    z-index: 10;
    width: 50px;
    height: 50px;
    background: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
}

@media (min-width: 640px) {
    .orbit-center {
        width: 60px;
        height: 60px;
    }
}

.orbit-center img {
    width: 32px;
    height: 32px;
}

@media (min-width: 640px) {
    .orbit-center img {
        width: 38px;
        height: 38px;
    }
}

.orbit-ring {
    position: relative;
    padding: 0;
    margin: 0;
    border-radius: 0;
    list-style: none;
    border: 0 !important;
    outline: 0 !important;
    box-shadow: none !important;
    background: transparent !important;
}

.ring-1 {
    width: 120px;
    height: 120px;
    animation: clockwiseRotate 60s linear infinite;
    animation-delay: 0s;
    border: 0 !important;
    box-shadow: none !important;
}

.ring-2 {
    width: 200px;
    height: 200px;
    animation: clockwiseRotate 80s linear infinite;
    animation-delay: -40s;
    border: 0 !important;
    box-shadow: none !important;
}

@media (min-width: 640px) {
    .ring-1 {
        width: 170px;
        height: 170px;
    }

    .ring-2 {
        width: 280px;
        height: 280px;
    }
}

.orbit-icon-wrapper {
    display: block;
    position: absolute;
    top: 50%;
    left: 50%;
    width: 30px;
    height: 30px;
    margin: -15px 0 0 -15px;
}

@media (min-width: 640px) {
    .orbit-icon-wrapper {
        width: 36px;
        height: 36px;
        margin: -18px 0 0 -18px;
    }
}

.ring-1 .orbit-icon-wrapper {
    animation: keepUpright 60s linear infinite;
    animation-delay: 0s;
}

.ring-2 .orbit-icon-wrapper {
    animation: keepUpright 80s linear infinite;
    animation-delay: -40s;
}

.orbit-icon {
    width: 30px;
    height: 30px;
    background: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    transition: all 0.3s ease;
    border: 1px solid #E5E7EB;
}

.orbit-icon:hover {
    transform: scale(1.15);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
    border-color: #00a19b;
}

.orbit-icon img {
    width: 18px;
    height: 18px;
    object-fit: contain;
}

@media (min-width: 640px) {
    .orbit-icon {
        width: 36px;
        height: 36px;
    }

    .orbit-icon img {
        width: 22px;
        height: 22px;
    }
}

/* Ring positioning - 10 items on ring-1 */
.ring-1 > li {
    position: absolute;
    top: 50%;
    left: 50%;
    margin: 0;
}
.ring-1 > li:nth-child(1) { transform: rotate(0deg) translate(60px) rotate(0deg); }
.ring-1 > li:nth-child(2) { transform: rotate(36deg) translate(60px) rotate(-36deg); }
.ring-1 > li:nth-child(3) { transform: rotate(72deg) translate(60px) rotate(-72deg); }
.ring-1 > li:nth-child(4) { transform: rotate(108deg) translate(60px) rotate(-108deg); }
.ring-1 > li:nth-child(5) { transform: rotate(144deg) translate(60px) rotate(-144deg); }
.ring-1 > li:nth-child(6) { transform: rotate(180deg) translate(60px) rotate(-180deg); }
.ring-1 > li:nth-child(7) { transform: rotate(216deg) translate(60px) rotate(-216deg); }
.ring-1 > li:nth-child(8) { transform: rotate(252deg) translate(60px) rotate(-252deg); }
.ring-1 > li:nth-child(9) { transform: rotate(288deg) translate(60px) rotate(-288deg); }
.ring-1 > li:nth-child(10) { transform: rotate(324deg) translate(60px) rotate(-324deg); }

/* Ring positioning - 12 items on ring-2 */
.ring-2 > li {
    position: absolute;
    top: 50%;
    left: 50%;
    margin: 0;
}
.ring-2 > li:nth-child(1) { transform: rotate(0deg) translate(100px) rotate(0deg); }
.ring-2 > li:nth-child(2) { transform: rotate(30deg) translate(100px) rotate(-30deg); }
.ring-2 > li:nth-child(3) { transform: rotate(60deg) translate(100px) rotate(-60deg); }
.ring-2 > li:nth-child(4) { transform: rotate(90deg) translate(100px) rotate(-90deg); }
.ring-2 > li:nth-child(5) { transform: rotate(120deg) translate(100px) rotate(-120deg); }
.ring-2 > li:nth-child(6) { transform: rotate(150deg) translate(100px) rotate(-150deg); }
.ring-2 > li:nth-child(7) { transform: rotate(180deg) translate(100px) rotate(-180deg); }
.ring-2 > li:nth-child(8) { transform: rotate(210deg) translate(100px) rotate(-210deg); }
.ring-2 > li:nth-child(9) { transform: rotate(240deg) translate(100px) rotate(-240deg); }
.ring-2 > li:nth-child(10) { transform: rotate(270deg) translate(100px) rotate(-270deg); }
.ring-2 > li:nth-child(11) { transform: rotate(300deg) translate(100px) rotate(-300deg); }
.ring-2 > li:nth-child(12) { transform: rotate(330deg) translate(100px) rotate(-330deg); }

@media (min-width: 640px) {
    .ring-1 > li:nth-child(1) { transform: rotate(0deg) translate(85px) rotate(0deg); }
    .ring-1 > li:nth-child(2) { transform: rotate(36deg) translate(85px) rotate(-36deg); }
    .ring-1 > li:nth-child(3) { transform: rotate(72deg) translate(85px) rotate(-72deg); }
    .ring-1 > li:nth-child(4) { transform: rotate(108deg) translate(85px) rotate(-108deg); }
    .ring-1 > li:nth-child(5) { transform: rotate(144deg) translate(85px) rotate(-144deg); }
    .ring-1 > li:nth-child(6) { transform: rotate(180deg) translate(85px) rotate(-180deg); }
    .ring-1 > li:nth-child(7) { transform: rotate(216deg) translate(85px) rotate(-216deg); }
    .ring-1 > li:nth-child(8) { transform: rotate(252deg) translate(85px) rotate(-252deg); }
    .ring-1 > li:nth-child(9) { transform: rotate(288deg) translate(85px) rotate(-288deg); }
    .ring-1 > li:nth-child(10) { transform: rotate(324deg) translate(85px) rotate(-324deg); }

    .ring-2 > li:nth-child(1) { transform: rotate(0deg) translate(140px) rotate(0deg); }
    .ring-2 > li:nth-child(2) { transform: rotate(30deg) translate(140px) rotate(-30deg); }
    .ring-2 > li:nth-child(3) { transform: rotate(60deg) translate(140px) rotate(-60deg); }
    .ring-2 > li:nth-child(4) { transform: rotate(90deg) translate(140px) rotate(-90deg); }
    .ring-2 > li:nth-child(5) { transform: rotate(120deg) translate(140px) rotate(-120deg); }
    .ring-2 > li:nth-child(6) { transform: rotate(150deg) translate(140px) rotate(-150deg); }
    .ring-2 > li:nth-child(7) { transform: rotate(180deg) translate(140px) rotate(-180deg); }
    .ring-2 > li:nth-child(8) { transform: rotate(210deg) translate(140px) rotate(-210deg); }
    .ring-2 > li:nth-child(9) { transform: rotate(240deg) translate(140px) rotate(-240deg); }
    .ring-2 > li:nth-child(10) { transform: rotate(270deg) translate(140px) rotate(-270deg); }
    .ring-2 > li:nth-child(11) { transform: rotate(300deg) translate(140px) rotate(-300deg); }
    .ring-2 > li:nth-child(12) { transform: rotate(330deg) translate(140px) rotate(-330deg); }
}

@keyframes clockwiseRotate {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

@keyframes keepUpright {
    from { transform: rotate(0deg); }
    to { transform: rotate(-360deg); }
}

@keyframes counterClockwiseRotate {
    from { transform: rotate(0deg); }
    to { transform: rotate(-360deg); }
}

/* ============================================
   AI AGENTS CAROUSEL - SIMPLE 3-CARD LAYOUT
   ============================================ */
/* GPU-accelerated carousel container */
#agentCarousel {
    will-change: transform;
    transform: translateZ(0);
    backface-visibility: hidden;
    perspective: 1000px;
}

.agent-card {
    flex-shrink: 0;
    width: 380px;
    margin-right: 24px;
    transform: translateZ(0);
    will-change: transform;
    contain: layout style paint;
}

.agent-card img {
    content-visibility: auto;
    contain-intrinsic-size: 380px 450px;
    height: 450px;
}

/* Scale down card height on smaller viewports */
@media (max-height: 800px) {
    .agent-card img {
        height: 380px;
    }
}

@media (max-height: 700px) {
    .agent-card img {
        height: 340px;
    }
}

@media (max-height: 600px) {
    .agent-card img {
        height: 300px;
    }
}

/* Default state: compact title-only card, fixed at bottom */
.agent-card-overlay {
    bottom: 24px;
    transform: translateZ(0);
}

/* Hover state: expand upward by increasing bottom position (desktop only) */
@media (min-width: 640px) {
    .agent-card-wrapper:hover .agent-card-overlay {
        bottom: 32px !important;
        padding-top: 28px !important;
        padding-bottom: 28px !important;
        padding-left: 28px !important;
        padding-right: 28px !important;
        box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15) !important;
        transition: all 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    }

    /* Reveal content on hover - faster animation */
    .agent-card-wrapper:hover .agent-card-content {
        max-height: 300px !important;
        opacity: 1 !important;
        margin-top: 8px !important;
        transition: max-height 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94),
                    opacity 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94),
                    margin-top 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    }

    /* Slightly increase title size on hover */
    .agent-card-wrapper:hover .agent-card-overlay h3 {
        font-size: 1.25rem !important;
        margin-bottom: 4px !important;
        transition: font-size 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    }
}

/* Cursor hints for draggable carousels */
#uspCarousel,
#agentCarousel {
    cursor: grab;
    user-select: none;
}

#uspCarousel:active,
#agentCarousel:active {
    cursor: grabbing;
}

/* ============================================
   MOBILE MENU
   ============================================ */
/* Hamburger Icon */
.hamburger-icon {
    width: 22px;
    height: 16px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    cursor: pointer;
}

.hamburger-line {
    width: 100%;
    height: 2px;
    background: #1A1A1A;
    border-radius: 2px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Hamburger to X animation */
.hamburger-icon.active .hamburger-line:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
}

.hamburger-icon.active .hamburger-line:nth-child(2) {
    opacity: 0;
}

.hamburger-icon.active .hamburger-line:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
}

/* Mobile Menu Overlay */
.mobile-menu-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.4s cubic-bezier(0.4, 0, 0.2, 1),
                visibility 0.4s cubic-bezier(0.4, 0, 0.2, 1),
                backdrop-filter 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 1100;
}

.mobile-menu-overlay.active {
    opacity: 1;
    visibility: visible;
}

/* Mobile Menu Drawer */
.mobile-menu {
    position: fixed;
    top: 0;
    right: -100%;
    width: 85%;
    max-width: 400px;
    height: 100%;
    background: white;
    box-shadow: -8px 0 40px rgba(0, 0, 0, 0.2);
    transition: right 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 1200;
}

.mobile-menu.active {
    right: 0;
}

/* Menu Link Staggered Animation */
.mobile-menu.active .menu-link {
    animation: slideInRight 0.4s cubic-bezier(0.4, 0, 0.2, 1) forwards;
    opacity: 0;
}

.mobile-menu.active .menu-link:nth-child(1) {
    animation-delay: 0.1s;
}

.mobile-menu.active .menu-link:nth-child(2) {
    animation-delay: 0.15s;
}

.mobile-menu.active .menu-link:nth-child(3) {
    animation-delay: 0.2s;
}

.mobile-menu.active .menu-link:nth-child(4) {
    animation-delay: 0.25s;
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Prevent body scroll when menu is open */
body.mobile-menu-open {
    overflow: hidden !important;
}

/* ============================================
   FLOATING CTA BUTTON
   ============================================ */
.floating-cta {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 999;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: #00a19b;
    color: white;
    padding: 14px 20px;
    border-radius: 50px;
    box-shadow: 0 4px 16px rgba(0, 161, 155, 0.4);
    /* Hidden by default, JavaScript controls visibility */
    opacity: 0;
    transform: translateY(200%);
    pointer-events: none;
    transition: transform 0.5s cubic-bezier(0.68, -0.55, 0.265, 1.55),
                opacity 0.3s ease;
}

.floating-cta:hover {
    background: #008c87;
    box-shadow: 0 8px 24px rgba(0, 161, 155, 0.5);
}

/* ============================================
   LEGAL PAGES (PRIVACY & TERMS)
   ============================================ */
.privacy-section {
    padding-top: 140px;
    padding-bottom: 80px;
    background: #FFFFFF;
    min-height: 100vh;
}

@media (max-width: 768px) {
    .privacy-section {
        padding-top: 120px;
        padding-bottom: 60px;
    }
}

.privacy-container {
    max-width: 800px;
    margin: 0 auto;
    padding: 0 40px;
}

@media (max-width: 768px) {
    .privacy-container {
        padding: 0 24px;
    }
}

.privacy-title {
    font-size: 48px;
    font-weight: 700;
    color: #1A1A1A;
    margin-bottom: 12px;
    line-height: 1.2;
}

@media (max-width: 768px) {
    .privacy-title {
        font-size: 36px;
    }
}

.privacy-updated {
    font-size: 15px;
    color: #9CA3AF;
    margin-bottom: 48px;
}

.privacy-content {
    font-size: 16px;
    line-height: 1.75;
}

.privacy-block {
    margin-bottom: 48px;
}

.privacy-block:last-child {
    margin-bottom: 0;
}

.privacy-heading {
    font-size: 24px;
    font-weight: 600;
    color: #1A1A1A;
    margin-bottom: 16px;
    line-height: 1.3;
}

@media (max-width: 768px) {
    .privacy-heading {
        font-size: 20px;
    }
}

.privacy-text {
    font-size: 16px;
    color: #6B7280;
    line-height: 1.75;
    margin-bottom: 16px;
}

.privacy-text:last-child {
    margin-bottom: 0;
}

.privacy-list {
    list-style: none;
    padding: 0;
    margin: 16px 0;
}

.privacy-list li {
    font-size: 16px;
    color: #6B7280;
    line-height: 1.75;
    margin-bottom: 12px;
    padding-left: 24px;
    position: relative;
}

.privacy-list li::before {
    content: "•";
    position: absolute;
    left: 8px;
    color: #00a19b;
    font-weight: 700;
}

.privacy-list li:last-child {
    margin-bottom: 0;
}

.privacy-link {
    color: #00a19b;
    text-decoration: none;
    transition: color 0.2s ease;
    border-bottom: 1px solid transparent;
}

.privacy-link:hover {
    color: #008c87;
    border-bottom-color: #008c87;
}

/* ============================================
   ACCESSIBILITY
   ============================================ */
@media (prefers-reduced-motion: reduce) {
    .fade-in,
    .slide-in-left,
    .slide-in-right,
    .slide-in-up,
    .stagger-children > * {
        opacity: 1 !important;
        transform: none !important;
        transition: none !important;
    }

    .agent-card-overlay {
        transition: none !important;
    }

    .floating-cta {
        animation: none !important;
    }
}
