/* ============================================================
   HRSS — Dynamic enhancements (counters, particles, tilt,
   scroll progress, scroll-spy, live dashboard, chat, bento, tour)
   ============================================================ */

/* 4 · Scroll progress bar */
#hrss-progress {
    position: fixed;
    top: 0; left: 0;
    height: 3px; width: 0;
    z-index: 2000;
    background: linear-gradient(90deg, var(--primary), var(--secondary));
    transition: width .12s linear;
    pointer-events: none;
}

/* 2 · Hero particle network */
#hrss-particles {
    position: absolute;
    inset: 0;
    width: 100%; height: 100%;
    z-index: 2;
    pointer-events: none;
}

/* 7 · Scroll-spy active nav */
.nav-links a.active { color: var(--accent); }
.navbar.scrolled .nav-links a.active { color: var(--primary); }

/* 5 · 3D tilt */
.feature-card, .pricing-plan-card { transform-style: preserve-3d; }

/* 8 · Live dashboard scan overlay */
.dashboard-screenshot .screenshot-body { position: relative; overflow: hidden; }
.hrss-scan {
    position: absolute; left: 0; right: 0; top: 0;
    height: 45%;
    background: linear-gradient(to bottom,
        rgba(6,182,212,0) 0%,
        rgba(6,182,212,.10) 70%,
        rgba(6,182,212,.22) 100%);
    pointer-events: none;
    mix-blend-mode: screen;
    animation: hrssScan 4.5s ease-in-out infinite;
}
@keyframes hrssScan {
    0%   { transform: translateY(-110%); opacity: 0; }
    12%  { opacity: 1; }
    88%  { opacity: 1; }
    100% { transform: translateY(240%); opacity: 0; }
}

/* 3 · AI chat reveal */
.ai-chat-preview.hrss-chat .chat-bubble {
    opacity: 0;
    transform: translateY(14px);
    transition: opacity .45s ease, transform .45s ease;
}
.ai-chat-preview.hrss-chat .chat-bubble.show { opacity: 1; transform: none; }
.hrss-dots { display: inline-flex; gap: 4px; align-items: center; }
.hrss-dots i {
    width: 7px; height: 7px; border-radius: 50%;
    background: var(--gray-400); display: inline-block;
    animation: hrssDot 1s infinite;
}
.hrss-dots i:nth-child(2) { animation-delay: .15s; }
.hrss-dots i:nth-child(3) { animation-delay: .30s; }
@keyframes hrssDot {
    0%, 60%, 100% { transform: translateY(0); opacity: .4; }
    30%           { transform: translateY(-5px); opacity: 1; }
}

/* 6 · Bento features grid (desktop only) */
@media (min-width: 1025px) {
    .features-grid {
        grid-template-columns: repeat(4, 1fr) !important;
        grid-auto-rows: 1fr;
    }
    .features-grid .feature-card:nth-child(1),
    .features-grid .feature-card:nth-child(6) {
        grid-column: span 2;
        background: linear-gradient(135deg, rgba(29,78,216,.07), rgba(8,145,178,.07));
        border-color: var(--primary-light);
    }
}

/* 11 · Product tour (scrollytelling) */
.product-tour { padding: 6rem 0; background: var(--white); }
.tour-wrap { display: grid; grid-template-columns: 1fr 1fr; gap: 3rem; align-items: start; }
.tour-sticky { position: sticky; top: 110px; }
.tour-visual {
    background: var(--gray-900);
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 30px 70px rgba(0,0,0,.25);
}
.tour-screenshot-header { display: flex; gap: .5rem; padding: .75rem 1rem; background: var(--gray-800); }
.tour-dot { width: 11px; height: 11px; border-radius: 50%; }
.tour-dot.red { background: #ef4444; } .tour-dot.yellow { background: #f59e0b; } .tour-dot.green { background: #22c55e; }
.tour-img { width: 100%; display: block; }
.tour-visual { animation: tourFloat 6s ease-in-out infinite; }
@keyframes tourFloat { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-10px); } }

/* varied scroll-swap animations */
.hrss-a-slide { animation: hrssSlide .6s cubic-bezier(.2,.7,.2,1); }
@keyframes hrssSlide { from { opacity: 0; transform: translateX(55px); } to { opacity: 1; transform: none; } }
.hrss-a-zoom  { animation: hrssZoom .6s ease; }
@keyframes hrssZoom  { from { opacity: 0; transform: scale(.8); } to { opacity: 1; transform: none; } }
.hrss-a-flip  { animation: hrssFlip .65s ease; }
@keyframes hrssFlip  { from { opacity: 0; transform: perspective(1000px) rotateY(24deg); } to { opacity: 1; transform: none; } }
.hrss-a-blur  { animation: hrssBlur .6s ease; }
@keyframes hrssBlur  { from { opacity: 0; filter: blur(16px); transform: scale(1.05); } to { opacity: 1; filter: blur(0); transform: none; } }

.tour-steps { display: flex; flex-direction: column; gap: .75rem; }
.tour-step {
    min-height: 40vh;
    display: flex; flex-direction: column; justify-content: center;
    opacity: .4;
    padding: 1.6rem 1.6rem 1.6rem 1.8rem;
    border-radius: 18px;
    transition: opacity .45s ease, background .45s ease, box-shadow .45s ease, transform .45s ease;
}
.tour-step.is-active {
    opacity: 1;
    background: linear-gradient(135deg, rgba(29,78,216,.06), rgba(8,145,178,.05));
    box-shadow: 0 18px 44px rgba(29,78,216,.10);
    transform: translateX(6px);
}
.tour-num {
    display: inline-flex; align-items: center; justify-content: center;
    width: 46px; height: 46px; border-radius: 14px;
    background: var(--gray-100); color: var(--gray-400);
    font-weight: 800; font-size: 1rem; letter-spacing: 1px;
    margin-bottom: .9rem; transition: all .4s ease;
}
.tour-step.is-active .tour-num {
    background: var(--gradient); color: #fff;
    box-shadow: 0 10px 24px rgba(29,78,216,.3);
    transform: scale(1.05) rotate(-3deg);
}
.tour-step h3 { font-size: 1.7rem; font-weight: 800; color: var(--gray-900); margin: 0 0 .75rem; }
.tour-step p { font-size: 1.08rem; color: var(--gray-600); line-height: 1.7; max-width: 440px; }
@media (max-width: 900px) {
    .tour-wrap { grid-template-columns: 1fr; }
    .tour-sticky { position: static; margin-bottom: 2rem; }
    .tour-step { min-height: auto; padding: 1.25rem; opacity: 1; }
}

/* ===== Mobile & Tablet app showcase ===== */
.app-section { padding: 6rem 0; background: #203377; position: relative; overflow: hidden; }
.app-section::before {
    content: ''; position: absolute; top: -40%; left: -15%; width: 55%; height: 140%;
    background: radial-gradient(circle, rgba(6,182,212,.18) 0%, transparent 70%);
}
.app-grid { position: relative; display: grid; grid-template-columns: 0.9fr 1.5fr; gap: 2.5rem; align-items: center; }
.app-text { color: #fff; }
.app-text .section-badge { background: rgba(6,182,212,.2); color: var(--secondary); }
.app-text h2 { font-size: 2.5rem; font-weight: 800; line-height: 1.2; margin: 1rem 0; }
.app-text h2 span { background: linear-gradient(135deg, var(--secondary), var(--accent)); -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text; }
.app-text > p { font-size: 1.1rem; color: rgba(255,255,255,.8); line-height: 1.8; margin-bottom: 1.5rem; max-width: 500px; }
.app-list { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: 1fr 1fr; gap: .75rem 1.25rem; }
.app-list li { display: flex; align-items: center; gap: .6rem; color: rgba(255,255,255,.92); font-size: .95rem; }
.app-list li i { color: var(--secondary); }
/* devices — side by side, one slightly lower than the other */
.app-devices { display: flex; justify-content: center; align-items: center; gap: 1rem; flex-wrap: wrap; }
.device-tablet { flex: 0 0 auto; width: 420px; max-width: 100%; transform: translateY(-16px); }
.device-phone  { flex: 0 0 auto; width: 200px; transform: translateY(16px); }
.device-tablet video, .device-tablet img,
.device-phone video, .device-phone img { display: block; width: 100%; height: auto; }
@media (max-width: 900px) {
    .app-grid { grid-template-columns: 1fr; gap: 2rem; }
    .app-list { grid-template-columns: 1fr 1fr; }
    .device-tablet { width: 340px; transform: none; }
    .device-phone { width: 165px; transform: none; }
}
@media (max-width: 480px) {
    .device-tablet { width: 270px; }
    .device-phone { width: 140px; }
    .app-list { grid-template-columns: 1fr; }
}

/* ===== FAQ live search ===== */
.faq-search { position: relative; max-width: 560px; margin: 0 auto 2.5rem; }
.faq-search i { position: absolute; left: 1.25rem; top: 50%; transform: translateY(-50%); color: var(--primary); pointer-events: none; }
.faq-search-input {
    width: 100%; padding: 1.1rem 1.3rem 1.1rem 3.1rem;
    border: 1px solid var(--gray-200); border-radius: 16px;
    font-size: 1.05rem; font-family: inherit; color: var(--gray-800);
    background: var(--white); box-shadow: 0 10px 30px rgba(17,24,39,.06);
    transition: border-color .25s, box-shadow .25s, transform .25s;
}
.faq-search-input::placeholder { color: var(--gray-400); }
.faq-search-input:focus { outline: none; border-color: var(--primary); box-shadow: 0 12px 34px rgba(29,78,216,.15); transform: translateY(-1px); }
.faq-item.faq-hidden { display: none; }
.faq-noresult { text-align: center; color: var(--gray-500); padding: 1rem; font-size: .95rem; }

/* Accessibility — respect reduced motion */
@media (prefers-reduced-motion: reduce) {
    #hrss-particles, .hrss-scan { display: none !important; }
    .ai-chat-preview.hrss-chat .chat-bubble { opacity: 1 !important; transform: none !important; }
    .tour-visual, .device-tablet, .device-phone { animation: none !important; }
}
