/* ============================================
   MOTION TOKENS — Premium Personality
   Duration: 350-600ms | Easing: decelerate
   ============================================ */
:root {
    --duration-fast: 180ms;
    --duration-normal: 350ms;
    --duration-slow: 700ms;
    --easing-premium: cubic-bezier(0.16, 1, 0.3, 1);
    --easing-soft: cubic-bezier(0.22, 1, 0.36, 1);
    --timeline-progress: 0;
}

html,
body {
    max-width: 100%;
    overflow-x: hidden;
}

/* BRAND GRADIENTS */
.bg-brand-gradient {
    background: linear-gradient(135deg, #e6007e 0%, #ffb800 50%, #0067b1 100%);
}
.text-brand-gradient {
    background: linear-gradient(135deg, #e6007e 0%, #ffb800 50%, #0067b1 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}
.border-brand-gradient {
    border: 2px solid transparent;
    background: linear-gradient(#fff, #fff) padding-box, linear-gradient(135deg, #e6007e 0%, #ffb800 50%, #0067b1 100%) border-box;
}
.dark .border-brand-gradient {
    background: linear-gradient(#1d1b20, #1d1b20) padding-box, linear-gradient(135deg, #e6007e 0%, #ffb800 50%, #0067b1 100%) border-box;
}

/* GLASS CARDS — Premium hover with layered motion */
.glass-card {
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.4);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.04);
    transition: transform var(--duration-normal) var(--easing-premium),
                box-shadow var(--duration-normal) var(--easing-premium),
                border-color var(--duration-normal) var(--easing-premium);
    cursor: pointer;
}
.dark .glass-card {
    background: rgba(30, 41, 59, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.05);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
}
.glass-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.08);
    border-color: rgba(255, 255, 255, 0.8);
}
.dark .glass-card:hover {
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4);
    border-color: rgba(255, 255, 255, 0.15);
}

/* SATURNO STYLES */
.saturno-bg {
    background-color: #050a15;
    background-image:
        radial-gradient(circle at 50% 0%, rgba(0, 103, 177, 0.15) 0%, transparent 50%),
        radial-gradient(circle at 100% 100%, rgba(230, 0, 126, 0.1) 0%, transparent 50%);
}
.saturno-grid {
    background-size: 60px 60px;
    background-image:
        linear-gradient(to right, rgba(255, 255, 255, 0.03) 1px, transparent 1px),
        linear-gradient(to bottom, rgba(255, 255, 255, 0.03) 1px, transparent 1px);
    mask-image: radial-gradient(ellipse at center, black 40%, transparent 80%);
    -webkit-mask-image: radial-gradient(ellipse at center, black 40%, transparent 80%);
}
.saturno-card {
    background: rgba(15, 23, 42, 0.6);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    border: 1px solid rgba(255, 255, 255, 0.05);
    transition: transform var(--duration-normal) var(--easing-premium),
                background var(--duration-normal) var(--easing-premium),
                border-color var(--duration-normal) var(--easing-premium),
                box-shadow var(--duration-normal) var(--easing-premium);
    cursor: pointer;
}
.saturno-card:hover {
    background: rgba(30, 41, 59, 0.8);
    border-color: rgba(255, 255, 255, 0.15);
    transform: translateY(-4px);
    box-shadow: 0 10px 30px rgba(0, 103, 177, 0.1);
}

/* ============================================
   KEYFRAME ANIMATIONS — Ambient & Hero Layers
   ============================================ */
.hero-glow {
    position: absolute;
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, rgba(230,0,126,0.15) 0%, rgba(0,103,177,0.15) 50%, rgba(255,255,255,0) 70%);
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    filter: blur(60px);
    z-index: 0;
    animation: pulseGlow 8s ease-in-out infinite alternate;
}
@keyframes pulseGlow {
    0% { transform: translate(-50%, -50%) scale(1); opacity: 0.8; }
    100% { transform: translate(-50%, -50%) scale(1.1); opacity: 1; }
}

.floating-logo {
    animation: float 6s ease-in-out infinite;
    filter: drop-shadow(0 20px 40px rgba(0,0,0,0.1));
}
@keyframes float {
    0% { transform: translateY(0px); }
    50% { transform: translateY(-20px); }
    100% { transform: translateY(0px); }
}

/* Gradient Flow Background for CTA */
.gradient-flow-bg {
    background: linear-gradient(135deg, #e6007e, #ffb800, #0067b1, #e6007e);
    background-size: 300% 300%;
    animation: gradientFlow 15s ease infinite;
}
@keyframes gradientFlow {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

/* Floating Element — parallax drift */
.floating-element {
    animation: floatSlow 8s ease-in-out infinite;
}
@keyframes floatSlow {
    0% { transform: translateY(0px) translateX(0px); }
    25% { transform: translateY(-10px) translateX(5px); }
    50% { transform: translateY(-15px) translateX(0px); }
    75% { transform: translateY(-5px) translateX(-5px); }
    100% { transform: translateY(0px) translateX(0px); }
}

/* ============================================
   SCROLL REVEAL SYSTEM — Staggered entrances
   ============================================ */
.reveal {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity var(--duration-slow) var(--easing-premium),
                transform var(--duration-slow) var(--easing-premium);
}
.reveal.active {
    opacity: 1;
    transform: translateY(0);
}

.stagger-1 { transition-delay: 0s !important; }
.stagger-2 { transition-delay: 0.05s !important; }
.stagger-3 { transition-delay: 0.1s !important; }
.stagger-4 { transition-delay: 0.15s !important; }
.stagger-5 { transition-delay: 0.2s !important; }
.stagger-6 { transition-delay: 0.25s !important; }
.stagger-7 { transition-delay: 0.3s !important; }

.reveal-scale {
    opacity: 0;
    transform: scale(0.95) translateY(20px);
    transition: opacity var(--duration-slow) var(--easing-premium),
                transform var(--duration-slow) var(--easing-premium);
}
.reveal-scale.active {
    opacity: 1;
    transform: scale(1) translateY(0);
}

.reveal-left {
    opacity: 0;
    transform: translateX(-40px);
    transition: opacity var(--duration-slow) var(--easing-premium),
                transform var(--duration-slow) var(--easing-premium);
}
.reveal-left.active {
    opacity: 1;
    transform: translateX(0);
}

.reveal-right {
    opacity: 0;
    transform: translateX(40px);
    transition: opacity var(--duration-slow) var(--easing-premium),
                transform var(--duration-slow) var(--easing-premium);
}
.reveal-right.active {
    opacity: 1;
    transform: translateX(0);
}

/* ============================================
   HEADER / NAV — Scroll transform
   ============================================ */
header {
    transition: padding var(--duration-normal) var(--easing-premium),
                background-color var(--duration-normal) var(--easing-premium),
                backdrop-filter var(--duration-normal) var(--easing-premium);
}
header.scrolled {
    padding-top: 0;
    padding-bottom: 0;
    background-color: rgba(253, 247, 255, 0.85);
    backdrop-filter: blur(24px);
    border-bottom: 1px solid rgba(203, 196, 210, 0.3);
}
.dark header.scrolled {
    background-color: rgba(50, 47, 53, 0.85);
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}
header.scrolled nav { height: 60px; }

.nav-link { position: relative; }
.nav-link::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 0;
    width: 0;
    height: 2px;
    background: linear-gradient(90deg, #e6007e, #0067b1);
    transition: width var(--duration-normal) var(--easing-premium);
}
.nav-link:hover::after { width: 100%; }

.logo-hover {
    transition: transform var(--duration-normal) var(--easing-premium);
}
.logo-hover:hover { transform: scale(1.05); }

.mobile-menu-panel {
    position: absolute;
    top: calc(100% + 8px);
    left: 24px;
    right: 24px;
    padding: 12px;
    border-radius: 24px;
    background: rgba(253, 247, 255, 0.94);
    border: 1px solid rgba(203, 196, 210, 0.55);
    box-shadow: 0 24px 70px rgba(29, 27, 32, 0.16);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transform: translateY(-8px) scale(0.98);
    transform-origin: top center;
    transition: opacity var(--duration-normal) var(--easing-premium),
                transform var(--duration-normal) var(--easing-premium),
                visibility var(--duration-normal) var(--easing-premium);
}
.mobile-menu-panel.is-open {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transform: translateY(0) scale(1);
}
.mobile-menu-link {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 16px;
    border-radius: 18px;
    font-family: Geist, sans-serif;
    font-size: 13px;
    font-weight: 700;
    line-height: 1;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: #1d1b20;
    transition: background-color var(--duration-fast) var(--easing-premium),
                color var(--duration-fast) var(--easing-premium);
}
.mobile-menu-link:hover,
.mobile-menu-link:focus-visible {
    color: #e6007e;
    background: rgba(230, 0, 126, 0.07);
    outline: none;
}
.mobile-menu-button.is-open .menu-icon-open { display: none; }
.mobile-menu-button.is-open .menu-icon-close { display: block; }

.cta-premium {
    transition: transform var(--duration-fast) var(--easing-premium),
                box-shadow var(--duration-fast) var(--easing-premium);
}
.cta-premium:hover {
    transform: translateY(-2px);
    box-shadow: 0 0 30px rgba(230, 0, 126, 0.4), 0 0 60px rgba(230, 0, 126, 0.15);
}

/* ============================================
   BUTTON / CARD MICROINTERACTIONS
   ============================================ */
.button-premium {
    transition: transform var(--duration-fast) var(--easing-premium),
                box-shadow var(--duration-fast) var(--easing-premium),
                background-color var(--duration-fast) var(--easing-premium);
}
.button-premium:hover { transform: translateY(-2px); }
.button-premium:active { transform: translateY(0) scale(0.98); }

.arrow-hover { transition: transform var(--duration-fast) var(--easing-premium); }
.group:hover .arrow-hover { transform: translateX(8px); }

.card-icon-hover { transition: transform var(--duration-normal) var(--easing-premium); }
.group:hover .card-icon-hover { transform: scale(1.1) rotate(-3deg); }

.gradient-border-glow { position: relative; }
.gradient-border-glow::before {
    content: '';
    position: absolute;
    inset: -2px;
    border-radius: inherit;
    background: linear-gradient(135deg, #e6007e, #ffb800, #0067b1);
    opacity: 0;
    z-index: -1;
    transition: opacity var(--duration-normal) var(--easing-premium);
}
.gradient-border-glow:hover::before { opacity: 0.3; }

/* Shimmer for recommended card */
.shimmer-border { position: relative; overflow: hidden; }
.shimmer-border::after {
    content: '';
    position: absolute;
    top: -50%; left: -50%;
    width: 200%; height: 200%;
    background: linear-gradient(to right, transparent 0%, rgba(230,0,126,0.1) 45%, rgba(255,184,0,0.15) 50%, rgba(0,103,177,0.1) 55%, transparent 100%);
    transform: rotate(30deg);
    animation: shimmer 4s ease-in-out infinite;
}
@keyframes shimmer {
    0% { transform: translateX(-120%) rotate(30deg); }
    100% { transform: translateX(120%) rotate(30deg); }
}

/* ============================================
   TIMELINE PROGRESS — Scroll-driven fill
   ============================================ */
.timeline-line {
    position: absolute;
    left: 50%;
    top: 3rem;
    bottom: 3rem;
    width: 2px;
    transform: translateX(-50%);
    z-index: 0;
    background: rgba(203, 196, 210, 0.2);
}
.timeline-line-fill {
    width: 100%;
    height: calc(var(--timeline-progress) * 1%);
    background: linear-gradient(180deg, #e6007e, #ffb800, #0067b1);
    border-radius: 2px;
    transition: height 0.1s linear;
}
.timeline-step { transition: transform var(--duration-normal) var(--easing-premium); }
.timeline-step.active { animation: stepPulse 2s ease-in-out infinite; }
@keyframes stepPulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(230, 0, 126, 0.3); }
    50% { box-shadow: 0 0 0 8px rgba(230, 0, 126, 0); }
}

/* ============================================
   SATURNO AI FLOW DIAGRAM (WebGL)
   ============================================ */
#ai-flow-canvas { display: block; }
#ai-flow-container { height: 560px; }
.saturn-node-label {
    white-space: nowrap;
    max-width: 220px;
}
.saturn-node-label svg {
    flex: 0 0 auto;
}
.saturn-core-label {
    min-width: 92px;
    text-align: center;
}

@media (max-width: 767px) {
    #ai-flow-container {
        height: min(560px, 132vw);
        min-height: 480px;
        border-radius: 20px;
    }
    .saturn-node-label {
        gap: 6px !important;
        padding: 9px 10px !important;
        max-width: min(46vw, 168px);
    }
    .saturn-node-label svg {
        width: 16px;
        height: 16px;
    }
    .saturn-node-label span:last-child {
        font-size: 11px !important;
        letter-spacing: 0.01em !important;
        overflow: hidden;
        text-overflow: ellipsis;
    }
    .saturn-core-label span:first-child {
        font-size: 16px !important;
    }
    .saturn-core-label span:last-child {
        font-size: 10px !important;
        letter-spacing: 0.1em !important;
    }
}
#ai-flow-labels > div { position: absolute; }

/* ============================================
   FINAL CTA
   ============================================ */
.cta-glow-bg { animation: ctaGlow 6s ease-in-out infinite alternate; }
@keyframes ctaGlow {
    0% { opacity: 0.2; }
    100% { opacity: 0.4; }
}
.floating-shape { animation: shapeFloat 10s ease-in-out infinite; }
@keyframes shapeFloat {
    0% { transform: translateY(0px) rotate(0deg); }
    25% { transform: translateY(-20px) rotate(90deg); }
    50% { transform: translateY(-10px) rotate(180deg); }
    75% { transform: translateY(-25px) rotate(270deg); }
    100% { transform: translateY(0px) rotate(360deg); }
}

/* ============================================
   HERO FLOATING BADGES
   ============================================ */
.hero-badge {
    position: absolute;
    padding: 8px 16px;
    border-radius: 9999px;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.5);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.06);
    font-family: 'Geist', sans-serif;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.05em;
    color: #1d1b20;
    white-space: nowrap;
    z-index: 5;
}
.dark .hero-badge {
    background: rgba(30, 41, 59, 0.8);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #f5eff7;
}

/* ============================================
   REDUCED MOTION ACCESSIBILITY
   ============================================ */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
    .hero-glow, .floating-logo, .floating-element, .parallax-drift,
    .floating-shape, .cta-glow-bg { animation: none !important; }
    .reveal, .reveal-scale, .reveal-left, .reveal-right {
        opacity: 1 !important;
        transform: none !important;
    }
    .hero-badge { animation: none !important; }
    .nav-link::after { transition: none !important; }
    .shimmer-border::after { animation: none !important; }
    .timeline-line-fill { height: 100% !important; }
    .timeline-step.active { animation: none !important; }
    .gradient-flow-bg { animation: none !important; }
}

/* ============================================
   SATURNO PRODUCT PAGE — Interactive workflows
   ============================================ */
.saturno-product-hero {
    background:
        radial-gradient(circle at 20% 15%, rgba(230, 0, 126, 0.2), transparent 34%),
        radial-gradient(circle at 82% 10%, rgba(0, 103, 177, 0.24), transparent 38%),
        radial-gradient(circle at 55% 78%, rgba(255, 184, 0, 0.11), transparent 30%),
        #050a15;
}

.saturno-product-hero::after {
    content: '';
    position: absolute;
    inset: 0;
    pointer-events: none;
    background-image:
        linear-gradient(rgba(255,255,255,0.025) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255,255,255,0.025) 1px, transparent 1px);
    background-size: 64px 64px;
    mask-image: linear-gradient(to bottom, black, transparent 92%);
    -webkit-mask-image: linear-gradient(to bottom, black, transparent 92%);
}

.saturno-header .saturno-nav-text {
    color: rgba(255, 255, 255, 0.76);
}

.saturno-header .saturno-nav-text:hover,
.saturno-header .saturno-nav-text[aria-current="page"] {
    color: #fff;
}

.saturno-header.scrolled .saturno-nav-text {
    color: #494551;
}

.saturno-header.scrolled .saturno-nav-text:hover,
.saturno-header.scrolled .saturno-nav-text[aria-current="page"] {
    color: #e6007e;
}

.saturno-header.scrolled .saturno-mobile-toggle {
    color: #1d1b20;
}

.saturno-focus:focus-visible,
.workflow-selector:focus-visible {
    outline: 3px solid rgba(255, 184, 0, 0.75);
    outline-offset: 4px;
}

.workflow-shell {
    background: linear-gradient(145deg, rgba(11, 18, 35, 0.98), rgba(5, 10, 21, 0.96));
    box-shadow: 0 36px 90px rgba(0, 0, 0, 0.34), inset 0 1px 0 rgba(255,255,255,0.06);
}

.workflow-stage {
    position: relative;
    height: 560px;
    isolation: isolate;
}

.workflow-stage::before {
    content: '';
    position: absolute;
    inset: 0;
    z-index: -1;
    background:
        radial-gradient(circle at center, rgba(103, 80, 164, 0.13), transparent 45%),
        linear-gradient(rgba(255,255,255,0.02) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255,255,255,0.02) 1px, transparent 1px);
    background-size: auto, 40px 40px, 40px 40px;
}

#saturno-workflow-canvas {
    display: block;
    width: 100%;
    height: 100%;
    touch-action: pan-y;
}

.workflow-selector {
    cursor: pointer;
    color: rgba(255,255,255,0.66);
    border: 1px solid rgba(255,255,255,0.1);
    background: rgba(255,255,255,0.045);
    transition: color var(--duration-fast) var(--easing-premium),
                border-color var(--duration-fast) var(--easing-premium),
                background var(--duration-fast) var(--easing-premium),
                box-shadow var(--duration-fast) var(--easing-premium);
}

.workflow-selector:hover {
    color: #fff;
    border-color: rgba(255,255,255,0.28);
    background: rgba(255,255,255,0.08);
}

.workflow-selector.is-active {
    color: #fff;
    border-color: rgba(230, 0, 126, 0.65);
    background: linear-gradient(135deg, rgba(230,0,126,0.2), rgba(0,103,177,0.18));
    box-shadow: 0 0 24px rgba(230,0,126,0.12);
}

.workflow-selector .workflow-index {
    color: rgba(255,255,255,0.42);
}

.workflow-selector.is-active .workflow-index {
    color: #ffb800;
}

.workflow-service-card {
    background: rgba(255,255,255,0.055);
    border: 1px solid rgba(255,255,255,0.09);
}

.workflow-service-card img {
    width: 34px;
    height: 34px;
    object-fit: contain;
}

.workflow-fallback {
    position: absolute;
    inset: 0;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 32px;
}

.workflow-fallback.is-visible {
    display: flex;
}

.workflow-fallback-line {
    width: min(64px, 8vw);
    height: 2px;
    background: linear-gradient(90deg, #e6007e, #0067b1);
}

.value-number {
    font-variant-numeric: tabular-nums;
}

.saturno-orbit-mark {
    width: 76px;
    height: 28px;
    border: 1px solid rgba(255, 255, 255, 0.34);
    border-radius: 50%;
    transform: rotate(-12deg);
}

@media (max-width: 767px) {
    .saturno-header:not(.scrolled) .mobile-menu-panel {
        background: rgba(12, 18, 34, 0.97);
        border-color: rgba(255,255,255,0.14);
    }

    .saturno-header:not(.scrolled) .mobile-menu-link {
        color: #fff;
    }

    .saturno-header:not(.scrolled) .mobile-menu-link:hover,
    .saturno-header:not(.scrolled) .mobile-menu-link:focus-visible {
        background: rgba(255,255,255,0.08);
    }

    .workflow-stage {
        height: 480px;
    }

    .workflow-fallback {
        overflow-x: auto;
        justify-content: flex-start;
    }
}

@media (max-width: 420px) {
    .workflow-stage {
        height: 440px;
    }
}

@media (prefers-reduced-motion: reduce) {
    #saturno-workflow-canvas {
        cursor: default !important;
    }
}

/* CLIENT MARQUEE */
.client-marquee-wrapper {
    overflow: hidden;
    padding: 24px 0;
}
.client-marquee-track {
    animation: client-marquee 40s linear infinite;
    will-change: transform;
}
.client-marquee-track:hover {
    animation-play-state: paused;
}
.client-marquee-group {
    gap: 80px;
    padding: 0 40px;
}
.client-marquee-logo {
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0.35;
    filter: grayscale(1);
    transition: opacity 0.5s ease, filter 0.5s ease, transform 0.5s ease;
    transform: scale(1);
}
.client-marquee-logo:hover {
    opacity: 1;
    filter: grayscale(0);
    transform: scale(1.1);
}
.client-marquee-logo img {
    height: 48px;
    width: auto;
    object-fit: contain;
}
@keyframes client-marquee {
    0% { transform: translateX(0); }
    100% { transform: translateX(-50%); }
}
