/* Custom CSS Extensions for BOTO3 TECH */

@layer utilities {
    /* Glassmorphism Styles */
    .glass-card {
        background: rgba(10, 16, 32, 0.65);
        backdrop-filter: blur(16px);
        -webkit-backdrop-filter: blur(16px);
        border: 1px solid rgba(255, 255, 255, 0.08);
    }

    .glass-card:hover {
        background: rgba(10, 16, 32, 0.8);
        box-shadow: 0 10px 40px -10px rgba(0, 240, 255, 0.15);
    }

    /* Mask Gradients for Smooth Marquee */
    .mask-gradient {
        mask-image: linear-gradient(to right, transparent, black 10%, black 90%, transparent);
        -webkit-mask-image: linear-gradient(to right, transparent, black 10%, black 90%, transparent);
    }
}

/* Keyframe Animations */
@keyframes marquee {
    0% { transform: translateX(0%); }
    100% { transform: translateX(-50%); }
}

.animate-marquee {
    animation: marquee 30s linear infinite;
}

.animate-marquee:hover {
    animation-play-state: paused;
}

@keyframes marquee-reverse {
    0% { transform: translateX(-50%); }
    100% { transform: translateX(0%); }
}

.animate-marquee-reverse {
    animation: marquee-reverse 24s linear infinite;
}

.animate-marquee-reverse:hover {
    animation-play-state: paused;
}

/* ---------- Scroll Reveal ---------- */
.reveal {
    opacity: 0;
    transform: translateY(28px);
    transition: opacity 0.8s cubic-bezier(0.16, 1, 0.3, 1), transform 0.8s cubic-bezier(0.16, 1, 0.3, 1);
    will-change: opacity, transform;
}

.reveal.is-visible {
    opacity: 1;
    transform: translateY(0);
}

@media (prefers-reduced-motion: reduce) {
    .reveal {
        opacity: 1;
        transform: none;
        transition: none;
    }
}

/* ---------- Tilt Cards ---------- */
.tilt-card {
    transform-style: preserve-3d;
    transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1), border-color 0.5s;
    will-change: transform;
}

.tilt-card::after {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: inherit;
    padding: 1px;
    background: linear-gradient(120deg, transparent 30%, rgba(0, 240, 255, 0.5), rgba(139, 92, 246, 0.5) 70%, transparent);
    background-size: 250% 250%;
    background-position: 0% 0%;
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    opacity: 0;
    transition: opacity 0.4s ease, background-position 1.2s ease;
    pointer-events: none;
}

.tilt-card:hover::after {
    opacity: 1;
    background-position: 100% 100%;
}

/* ---------- Magnetic Buttons ---------- */
.magnetic-btn {
    transition: transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.3s;
    will-change: transform;
}

/* ---------- Custom Cursor ---------- */
#cursor-dot, #cursor-ring {
    transform: translate(-50%, -50%);
}

#cursor-ring {
    transition: transform 0.15s ease-out, opacity 0.3s, border-color 0.3s, width 0.25s, height 0.25s;
}

#cursor-dot {
    transition: opacity 0.3s;
}

.cursor-hover #cursor-ring {
    width: 3rem;
    height: 3rem;
    border-color: rgba(0, 240, 255, 0.9);
}

/* ---------- Stat Bars ---------- */
.stat-bar-fill {
    width: 0%;
    transition: width 1.6s cubic-bezier(0.16, 1, 0.3, 1);
}

.stat-bar-fill.filled {
    width: var(--fill, 0%);
}

/* ---------- Terminal ---------- */
#terminal-body .term-line {
    opacity: 0;
    animation: term-in 0.3s forwards;
}

@keyframes term-in {
    to { opacity: 1; }
}

.term-cursor {
    display: inline-block;
    width: 7px;
    height: 1em;
    background: #00F0FF;
    margin-left: 2px;
    vertical-align: middle;
    animation: blink 1s step-end infinite;
}

@keyframes blink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0; }
}

.term-prompt { color: #00F0FF; }
.term-ok { color: #4ade80; }
.term-dim { color: #64748B; }

/* ---------- Form Success Check ---------- */
.success-check {
    animation: check-pop 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
    box-shadow: 0 0 0 0 rgba(0, 240, 255, 0.5);
}

@keyframes check-pop {
    0% { transform: scale(0); opacity: 0; }
    100% { transform: scale(1); opacity: 1; }
}

/* ---------- Flow Line / Dot ---------- */
#flow-line {
    animation: dash-flow 2s linear infinite;
}

@keyframes dash-flow {
    to { stroke-dashoffset: -24; }
}

/* Submit button loading state */
.btn-loading .btn-spinner {
    animation: spin 0.7s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* ---------- Boot Sequence Overlay ---------- */
#boot-overlay {
    transition: opacity 0.6s ease, visibility 0.6s ease;
}

#boot-overlay.boot-done {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.boot-ring {
    animation: boot-spin 1.4s linear infinite;
}

@keyframes boot-spin {
    0% { transform: rotate(0deg) scale(1); opacity: 1; }
    50% { opacity: 0.4; }
    100% { transform: rotate(360deg) scale(1); opacity: 1; }
}

/* ---------- Nav Link Underline ---------- */
.nav-link {
    position: relative;
}

.nav-link::after {
    content: '';
    position: absolute;
    left: 0;
    bottom: -4px;
    width: 100%;
    height: 1px;
    background: linear-gradient(90deg, #00F0FF, #8B5CF6);
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

.nav-link:hover::after {
    transform: scaleX(1);
}

/* ---------- Shimmer Headline Text ---------- */
.shimmer-text {
    background-size: 200% auto;
    animation: shimmer-move 5s linear infinite;
}

@keyframes shimmer-move {
    0% { background-position: 0% center; }
    100% { background-position: 200% center; }
}

/* ---------- Floating Hero Orbs ---------- */
.hero-orb {
    animation: orb-float 9s ease-in-out infinite;
}

.hero-orb:nth-of-type(2) {
    animation-duration: 12s;
    animation-delay: -3s;
}

@keyframes orb-float {
    0%, 100% { transform: translate(var(--px, 0px), var(--py, 0px)) scale(1); }
    50% { transform: translate(calc(var(--px, 0px) + 20px), calc(var(--py, 0px) - 25px)) scale(1.06); }
}

/* ---------- Rotating Scan Ring on Icons ---------- */
.scan-ring::before {
    content: '';
    position: absolute;
    inset: -3px;
    border-radius: inherit;
    background: conic-gradient(from 0deg, transparent 0%, currentColor 8%, transparent 20%);
    opacity: 0;
    transition: opacity 0.4s;
    animation: scan-spin 2.8s linear infinite;
    pointer-events: none;
}

.group:hover .scan-ring::before {
    opacity: 0.55;
}

@keyframes scan-spin {
    to { transform: rotate(360deg); }
}

/* ---------- Ripple Buttons ---------- */
.ripple-btn {
    position: relative;
    overflow: hidden;
}

.ripple {
    position: absolute;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.5);
    transform: scale(0);
    animation: ripple-out 0.65s ease-out;
    pointer-events: none;
}

@keyframes ripple-out {
    to {
        transform: scale(3.5);
        opacity: 0;
    }
}

/* ---------- FAQ Open State ---------- */
.faq-item.open .faq-content {
    grid-template-rows: 1fr;
}

.faq-item.open .faq-toggle i {
    color: #00F0FF;
    filter: drop-shadow(0 0 6px rgba(0, 240, 255, 0.6));
}

/* ---------- Digit Glitch (stat counters) ---------- */
.counter.glitching {
    animation: digit-flicker 0.08s steps(1) infinite;
}

@keyframes digit-flicker {
    0% { opacity: 1; }
    50% { opacity: 0.55; }
    100% { opacity: 1; }
}

@media (prefers-reduced-motion: reduce) {
    .boot-ring, .shimmer-text, .hero-orb, .scan-ring::before, .counter.glitching {
        animation: none !important;
    }
}

/* ---------- Ambient Global Particle Field ---------- */
#ambient-canvas {
    position: fixed;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    opacity: 0.5;
}

/* ---------- Header Scroll State ---------- */
header {
    position: relative;
}

header::after {
    content: '';
    position: absolute;
    left: 0;
    bottom: -1px;
    width: 100%;
    height: 1px;
    background: linear-gradient(90deg, transparent, #00F0FF, #8B5CF6, transparent);
    background-size: 200% auto;
    opacity: 0;
    transition: opacity 0.4s ease;
    animation: shimmer-move 4s linear infinite;
}

header.scrolled {
    background-color: rgba(5, 7, 15, 0.92) !important;
    box-shadow: 0 8px 30px -12px rgba(0, 240, 255, 0.15);
}

header.scrolled::after {
    opacity: 1;
}

/* ---------- Logo Breathing Glow ---------- */
.logo-box {
    animation: logo-pulse 3.2s ease-in-out infinite;
}

@keyframes logo-pulse {
    0%, 100% { box-shadow: 0 0 12px rgba(0, 240, 255, 0.15); }
    50% { box-shadow: 0 0 22px rgba(0, 240, 255, 0.45); }
}

/* ---------- Mobile Menu Stagger ---------- */
#mobile-menu.open .mobile-link {
    animation: mobile-in 0.45s cubic-bezier(0.16, 1, 0.3, 1) backwards;
}

#mobile-menu.open .mobile-link:nth-child(1) { animation-delay: 0.05s; }
#mobile-menu.open .mobile-link:nth-child(2) { animation-delay: 0.1s; }
#mobile-menu.open .mobile-link:nth-child(3) { animation-delay: 0.15s; }
#mobile-menu.open .mobile-link:nth-child(4) { animation-delay: 0.2s; }
#mobile-menu.open .mobile-link:nth-child(5) { animation-delay: 0.25s; }
#mobile-menu.open .mobile-link:nth-child(6) { animation-delay: 0.3s; }

@keyframes mobile-in {
    from { opacity: 0; transform: translateX(-16px); }
    to { opacity: 1; transform: translateX(0); }
}

/* ---------- Marquee Icon Pulse ---------- */
.animate-marquee i, .animate-marquee-reverse i {
    animation: icon-pulse 2.4s ease-in-out infinite;
}

@keyframes icon-pulse {
    0%, 100% { opacity: 0.7; transform: scale(1); }
    50% { opacity: 1; transform: scale(1.18); }
}

/* ---------- Checklist Stagger Reveal ---------- */
.tilt-card li {
    opacity: 0;
    transform: translateX(-8px);
    transition: opacity 0.45s ease, transform 0.45s ease;
}

.tilt-card.is-visible li:nth-child(1) { transition-delay: 0.15s; }
.tilt-card.is-visible li:nth-child(2) { transition-delay: 0.28s; }

.tilt-card.is-visible li {
    opacity: 1;
    transform: translateX(0);
}

/* ---------- Eyebrow Blink Dot ---------- */
.eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.eyebrow::before {
    content: '';
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #00F0FF;
    box-shadow: 0 0 8px rgba(0, 240, 255, 0.8);
    animation: eyebrow-blink 1.6s ease-in-out infinite;
    flex-shrink: 0;
}

@keyframes eyebrow-blink {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.3; transform: scale(0.7); }
}

/* ---------- Badge Pulse Glow ---------- */
.badge-pulse {
    animation: badge-glow 2.2s ease-in-out infinite;
}

@keyframes badge-glow {
    0%, 100% { box-shadow: 0 0 0 rgba(0, 240, 255, 0); }
    50% { box-shadow: 0 0 14px rgba(0, 240, 255, 0.35); }
}

/* ---------- Process Number Scale-In ---------- */
.process-num {
    display: inline-block;
    transition: transform 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.workflow-step.is-visible .process-num {
    animation: num-pop 0.6s cubic-bezier(0.34, 1.56, 0.64, 1) backwards;
}

@keyframes num-pop {
    from { transform: scale(0.3) rotate(-15deg); opacity: 0; }
    to { transform: scale(1) rotate(0deg); opacity: 1; }
}

/* ---------- Contact Icon Pulse Ring ---------- */
.icon-ring-wrap {
    position: relative;
    display: inline-flex;
}

.icon-ring-wrap::before {
    content: '';
    position: absolute;
    inset: -6px;
    border-radius: 50%;
    border: 1px solid rgba(0, 240, 255, 0.4);
    opacity: 0;
    transition: opacity 0.3s;
}

.icon-ring-wrap:hover::before {
    opacity: 1;
    animation: ring-expand 0.9s ease-out infinite;
}

@keyframes ring-expand {
    0% { transform: scale(0.8); opacity: 0.8; }
    100% { transform: scale(1.6); opacity: 0; }
}

/* ---------- Secondary Button Chevron Nudge ---------- */
.nudge-icon {
    animation: nudge 1.4s ease-in-out infinite;
}

@keyframes nudge {
    0%, 100% { transform: translateX(0); }
    50% { transform: translateX(4px); }
}

/* ---------- Laser Scan Sweep (Architecture Section) ---------- */
.laser-scan {
    position: absolute;
    inset: 0;
    overflow: hidden;
    pointer-events: none;
}

.laser-scan::before {
    content: '';
    position: absolute;
    left: 0;
    top: -10%;
    width: 100%;
    height: 40%;
    background: linear-gradient(180deg, transparent, rgba(0, 240, 255, 0.06), transparent);
    animation: laser-sweep 6s ease-in-out infinite;
}

@keyframes laser-sweep {
    0% { transform: translateY(-100%); }
    100% { transform: translateY(350%); }
}

/* ---------- Confetti Burst ---------- */
.confetti-piece {
    position: absolute;
    width: 6px;
    height: 6px;
    border-radius: 1px;
    top: 50%;
    left: 50%;
    pointer-events: none;
    animation: confetti-burst 1s cubic-bezier(0.2, 0.8, 0.3, 1) forwards;
}

@keyframes confetti-burst {
    to {
        transform: translate(var(--cx), var(--cy)) rotate(var(--cr));
        opacity: 0;
    }
}

/* ---------- Back-to-Top Idle Pulse ---------- */
#back-to-top::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 50%;
    border: 1px solid rgba(0, 240, 255, 0.5);
    animation: ring-expand 2.2s ease-out infinite;
}

@media (prefers-reduced-motion: reduce) {
    .logo-box, .animate-marquee i, .animate-marquee-reverse i, .eyebrow::before,
    .badge-pulse, .laser-scan::before, #back-to-top::before {
        animation: none !important;
    }
}

/* ---------- Hero Word-Rise Entrance ---------- */
.word-in {
    display: inline-block;
    overflow: hidden;
    vertical-align: top;
}

.word-inner {
    display: inline-block;
    transform: translateY(115%);
    animation: word-rise 0.75s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.word-inner.shimmer-text {
    animation: word-rise 0.75s cubic-bezier(0.16, 1, 0.3, 1) forwards, shimmer-move 5s linear infinite;
}

@keyframes word-rise {
    to { transform: translateY(0); }
}

/* ---------- Spin Slow (sparkle icon) ---------- */
.spin-slow {
    animation: spin-slow-kf 3s linear infinite;
}

@keyframes spin-slow-kf {
    to { transform: rotate(360deg); }
}

/* ---------- Scroll Bounce Indicator ---------- */
.scroll-bounce {
    animation: scroll-bounce-kf 2s ease-in-out infinite;
}

@keyframes scroll-bounce-kf {
    0%, 100% { transform: translate(-50%, 0); opacity: 0.6; }
    50% { transform: translate(-50%, 8px); opacity: 1; }
}

/* ---------- Continuous Idle Icon Float ---------- */
.scan-ring, .icon-float {
    animation: icon-bob 3.6s ease-in-out infinite;
}

@keyframes icon-bob {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-6px); }
}

/* ---------- Breathing Card Border (always on, all glass-cards) ---------- */
.glass-card {
    animation: card-breathe 4.5s ease-in-out infinite;
}

@keyframes card-breathe {
    0%, 100% { border-color: rgba(255, 255, 255, 0.08); }
    50% { border-color: rgba(0, 240, 255, 0.22); }
}

@media (prefers-reduced-motion: reduce) {
    .word-inner, .spin-slow, .scroll-bounce, .scan-ring, .icon-float, .glass-card {
        animation: none !important;
    }
}
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: #05070F;
}

::-webkit-scrollbar-thumb {
    background: #1E293B;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #00F0FF;
}