/* ============================================================================
   DipSkip — Cutting-edge enhancement layer
   ----------------------------------------------------------------------------
   A purely ADDITIVE motion + depth + micro-interaction layer that sits on top
   of styles.css. It changes no brand colours, copy, or layout — it elevates
   the *execution*. Inspiration: lemni.com (dark depth, glowing CTAs, tilted
   product UI), journey-digital.com (editorial eyebrows + hairline rhythm),
   flite.bike (marquee, sticky purchase bar, social-proof cadence).

   Principles:
     • Motion is transform/opacity only (GPU-friendly).
     • Reveal classes are added by enhance.js, never hard-coded — so if the JS
       fails to run, nothing is ever left invisible.
     • Everything collapses gracefully under prefers-reduced-motion.
   ========================================================================== */

:root {
    --ds-ease: cubic-bezier(0.16, 1, 0.3, 1);
    --ds-glow: 0 0 0 1px rgba(139, 92, 246, 0.22),
               0 6px 20px -8px rgba(99, 102, 241, 0.30),
               0 2px 8px -3px rgba(139, 92, 246, 0.20);
}

/* ---------------------------------------------------------------------------
   1. SCROLL REVEAL  (classes applied by enhance.js)
   ------------------------------------------------------------------------- */
.ds-reveal {
    opacity: 0;
    transform: translateY(26px);
    transition: opacity 0.8s var(--ds-ease), transform 0.8s var(--ds-ease);
    transition-delay: var(--ds-delay, 0ms);
    will-change: opacity, transform;
}
.ds-reveal.ds-reveal--scale { transform: translateY(26px) scale(0.975); }
.ds-reveal.ds-reveal--left  { transform: translateX(-28px); }
.ds-reveal.ds-reveal--right { transform: translateX(28px); }
.ds-reveal.ds-in {
    opacity: 1;
    transform: none;
}
/* once revealed, drop the hint so hovers/animations aren't pinned */
.ds-reveal.ds-in { will-change: auto; }

/* ---------------------------------------------------------------------------
   2. HERO ENTRANCE  (plays once on load; .ds-loaded set by enhance.js)
   ------------------------------------------------------------------------- */
@keyframes dsRise {
    from { opacity: 0; transform: translateY(30px); }
    to   { opacity: 1; transform: none; }
}
.ds-loaded .hero .trial-badge,
.ds-loaded .hero-title .title-line,
.ds-loaded .hero-description,
.ds-loaded .hero-features .feature-item,
.ds-loaded .hero-cta,
.ds-loaded .hero-visual {
    animation: dsRise 0.9s var(--ds-ease) backwards;
}
.ds-loaded .hero .trial-badge            { animation-delay: 0.05s; }
.ds-loaded .hero-title .title-line:nth-child(1) { animation-delay: 0.15s; }
.ds-loaded .hero-title .title-line:nth-child(2) { animation-delay: 0.25s; }
.ds-loaded .hero-description             { animation-delay: 0.35s; }
.ds-loaded .hero-features .feature-item:nth-child(1) { animation-delay: 0.42s; }
.ds-loaded .hero-features .feature-item:nth-child(2) { animation-delay: 0.48s; }
.ds-loaded .hero-features .feature-item:nth-child(3) { animation-delay: 0.54s; }
.ds-loaded .hero-features .feature-item:nth-child(4) { animation-delay: 0.60s; }
.ds-loaded .hero-features .feature-item:nth-child(5) { animation-delay: 0.66s; }
.ds-loaded .hero-features .feature-item:nth-child(6) { animation-delay: 0.72s; }
.ds-loaded .hero-cta                     { animation-delay: 0.80s; }
.ds-loaded .hero-visual                  { animation-delay: 0.30s; }

/* the highlight word gets a soft animated sheen */
.hero-title .highlight {
    background-size: 200% auto;
}

/* ---------------------------------------------------------------------------
   3. PREMIUM GLOWING CTA  (lemni-style under-glow + sheen sweep)
   ------------------------------------------------------------------------- */
.btn-primary {
    position: relative;
    isolation: isolate;
    overflow: hidden;
}
/* moving sheen */
.btn-primary::after {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 1;
    background: linear-gradient(110deg, transparent 40%, rgba(255, 255, 255, 0.06) 50%, transparent 60%);
    background-size: 220% 100%;
    background-position: 200% 0;
    transition: background-position 0.7s var(--ds-ease);
    pointer-events: none;
}
.btn-primary:hover::after { background-position: -120% 0; }
.btn-primary > * { position: relative; z-index: 2; }

/* soft ambient glow that draws the eye, brand-coloured (kept subtle) */
.btn-primary.btn-large {
    box-shadow: 0 6px 16px -10px rgba(99, 102, 241, 0.22);
}
.btn-primary.btn-large:hover {
    box-shadow: var(--ds-glow);
}

/* tactile press feedback everywhere */
.btn { transition: transform 0.18s var(--ds-ease), box-shadow 0.25s var(--ds-ease), background 0.3s ease, color 0.3s ease; }
.btn:active { transform: scale(0.97); }

/* ---------------------------------------------------------------------------
   4. CREDIBILITY TICKER  (the existing .trust-strip becomes a streaming tape —
      a scrolling credibility bar, lemni/flite flavour, on-brand for markets)
   ------------------------------------------------------------------------- */
.trust-strip {
    position: relative;
    overflow: hidden;
    /* strictly isolate the wide marquee track so it can never widen the page
       or expand the mobile layout viewport */
    contain: content;
    max-width: 100%;
    padding: 18px 0;
    border-top: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
    background: linear-gradient(180deg, rgba(99, 102, 241, 0.06), rgba(15, 23, 42, 0) 70%), var(--background);
}
/* break out of the centring container into a full-bleed tape */
.trust-strip .container { max-width: none; padding: 0; }

/* edge fades so items dissolve at both ends */
.trust-strip::before,
.trust-strip::after {
    content: "";
    position: absolute;
    top: 0; bottom: 0;
    width: 72px;
    z-index: 2;
    pointer-events: none;
}
.trust-strip::before { left: 0;  background: linear-gradient(90deg, var(--background), transparent); }
.trust-strip::after  { right: 0; background: linear-gradient(270deg, var(--background), transparent); }

.trust-row {
    display: flex;
    flex-wrap: nowrap;
    width: max-content;
    align-items: center;
    gap: 0;
    animation: dsMarquee 42s linear infinite;
}
.trust-strip:hover .trust-row { animation-play-state: paused; }

.trust-item {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 0 28px;
    font-size: 0.92rem;
    font-weight: 500;
    color: var(--text-secondary);
    white-space: nowrap;
}
.trust-item strong { color: var(--text-primary); font-weight: 700; }
.trust-item i {
    color: var(--primary-light);
    font-size: 0.95rem;
}
.trust-dot {
    flex-shrink: 0;
    width: 5px; height: 5px;
    border-radius: 50%;
    background: var(--primary-light);
    opacity: 0.55;
}

@keyframes dsMarquee {
    from { transform: translateX(0); }
    to   { transform: translateX(-50%); }
}

/* ---------------------------------------------------------------------------
   5. STICKY MOBILE CTA BAR  (flite-style, glassy, appears past the hero)
   ------------------------------------------------------------------------- */
.ds-sticky-cta {
    position: fixed;
    left: 12px;
    right: 12px;
    bottom: 12px;
    z-index: 1200;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 10px 10px 18px;
    border-radius: 18px;
    border: 1px solid rgba(148, 163, 184, 0.22);
    background: rgba(17, 24, 39, 0.72);
    -webkit-backdrop-filter: blur(16px) saturate(140%);
    backdrop-filter: blur(16px) saturate(140%);
    box-shadow: 0 16px 40px -12px rgba(0, 0, 0, 0.7);
    transform: translateY(160%);
    opacity: 0;
    transition: transform 0.55s var(--ds-ease), opacity 0.4s ease;
}
.ds-sticky-cta.ds-show { transform: none; opacity: 1; }
.ds-sticky-cta__text { display: flex; flex-direction: column; line-height: 1.25; min-width: 0; }
.ds-sticky-cta__text strong { font-size: 0.9rem; color: var(--text-primary); font-weight: 700; }
.ds-sticky-cta__text span { font-size: 0.72rem; color: var(--text-muted); }
.ds-sticky-cta__btn {
    margin-left: auto;
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 11px 16px;
    border-radius: 12px;
    font-size: 0.85rem;
    font-weight: 700;
    color: #fff;
    text-decoration: none;
    background: linear-gradient(135deg, var(--primary), var(--primary-light));
    box-shadow: 0 6px 18px -6px rgba(99, 102, 241, 0.7);
    white-space: nowrap;
}
.ds-sticky-cta__btn:active { transform: scale(0.96); }
.ds-sticky-cta__close {
    flex-shrink: 0;
    width: 26px; height: 26px;
    display: grid;
    place-items: center;
    border: none;
    border-radius: 8px;
    background: transparent;
    color: var(--text-muted);
    font-size: 0.95rem;
    cursor: pointer;
}
.ds-sticky-cta__close:active { background: rgba(148, 163, 184, 0.15); }
@media (min-width: 769px) { .ds-sticky-cta { display: none !important; } }

/* ---------------------------------------------------------------------------
   6. AURORA DEPTH  (slow drift on the existing gradient orbs)
   ------------------------------------------------------------------------- */
@keyframes dsDrift1 { 0%,100% { transform: translate3d(0,0,0) scale(1); } 50% { transform: translate3d(6%, -4%, 0) scale(1.08); } }
@keyframes dsDrift2 { 0%,100% { transform: translate3d(0,0,0) scale(1); } 50% { transform: translate3d(-5%, 5%, 0) scale(1.12); } }
@keyframes dsDrift3 { 0%,100% { transform: translate3d(0,0,0) scale(1); } 50% { transform: translate3d(4%, 6%, 0) scale(0.92); } }
.hero .gradient-orb.orb-1 { animation: dsDrift1 18s ease-in-out infinite; }
.hero .gradient-orb.orb-2 { animation: dsDrift2 22s ease-in-out infinite; }
.hero .gradient-orb.orb-3 { animation: dsDrift3 26s ease-in-out infinite; }

/* ---------------------------------------------------------------------------
   7. HEADER — glass + condense on scroll  (.scrolled toggled by script.js)
   ------------------------------------------------------------------------- */
.navbar {
    transition: background 0.35s ease, backdrop-filter 0.35s ease,
                border-color 0.35s ease, box-shadow 0.35s ease, padding 0.3s ease;
}
.navbar.scrolled {
    background: rgba(15, 23, 42, 0.72) !important;
    -webkit-backdrop-filter: blur(14px) saturate(150%);
    backdrop-filter: blur(14px) saturate(150%);
    border-bottom: 1px solid rgba(148, 163, 184, 0.14);
    box-shadow: 0 8px 30px -16px rgba(0, 0, 0, 0.8);
}

/* ---------------------------------------------------------------------------
   8. SCROLL PROGRESS BAR  (thin brand-gradient line, width set by enhance.js)
   ------------------------------------------------------------------------- */
.ds-progress {
    position: fixed;
    top: 0; left: 0;
    height: 3px;
    width: 100%;
    transform: scaleX(0);
    transform-origin: 0 50%;
    background: linear-gradient(90deg, var(--primary), var(--primary-light), var(--secondary));
    z-index: 2000;
    pointer-events: none;
}

/* ---------------------------------------------------------------------------
   9. SUBTLE 3D TILT / PARALLAX on product mockups (set via CSS var by JS)
   ------------------------------------------------------------------------- */
.ds-tilt {
    transform: perspective(1400px) rotateX(var(--ds-rx, 0deg)) rotateY(var(--ds-ry, 0deg)) translateY(var(--ds-py, 0px));
    transition: transform 0.2s linear;
    transform-style: preserve-3d;
    will-change: transform;
}

/* ---------------------------------------------------------------------------
   10. MICRO-INTERACTIONS — card lift on tap/hover (generic, brand-safe)
   ------------------------------------------------------------------------- */
.path-card, .feature-card, .support-card, .ai-capability, .pricing-card, .monitor-item {
    transition: transform 0.3s var(--ds-ease), box-shadow 0.3s var(--ds-ease), border-color 0.3s ease;
}
.path-card:active, .feature-card:active, .support-card:active { transform: translateY(-2px) scale(0.995); }

/* ---------------------------------------------------------------------------
   11. LAYOUT SAFETY — stop the product mockups from widening the page on mobile
   ----------------------------------------------------------------------------
   The .showcase rows put a white-space:pre code mockup in a grid cell. On a
   phone the cell's default min-width:auto refused to shrink below the code's
   natural width, blowing the column (and its paragraph copy) past the viewport
   and expanding the mobile layout viewport. min-width:0 lets it shrink; the
   mock's own overflow handling then scrolls any long code line internally.
   ------------------------------------------------------------------------- */
@media (max-width: 900px) {
    .showcase-row { min-width: 0; }
    .showcase-copy,
    .showcase-visual { min-width: 0; max-width: 100%; }
    .mock { max-width: 100%; }
    .mock-code { max-width: 100%; }
}

/* ============================================================================
   MOBILE HERO — clean gradient backdrop + cinematic "slideshow" entrance
   ----------------------------------------------------------------------------
   On phones the candlestick "ticker" behind the headline hurts readability, so
   we swap it for a solid, brand-matched gradient and stage the headline +
   bullet points in like slides. Desktop keeps the candlestick ticker + drifting
   orbs exactly as they are.
   ========================================================================== */
@media (max-width: 768px) {
    /* 1 — replace the busy ticker with a clean, readable theme gradient */
    .hero .hero-candles { display: none; }
    .hero .gradient-orb { display: none; }
    .hero {
        background:
            radial-gradient(115% 75% at 50% -8%, rgba(99, 102, 241, 0.30), transparent 55%),
            radial-gradient(120% 85% at 85% 108%, rgba(139, 92, 246, 0.20), transparent 58%),
            radial-gradient(95% 65% at 8% 102%, rgba(16, 185, 129, 0.10), transparent 60%),
            linear-gradient(180deg, #0e1530 0%, #0f172a 48%, #0b1020 100%);
    }

    /* 2 — the slideshow reveal: each piece is staged in deliberately ------ */
    .ds-loaded .hero .trial-badge {
        animation: dsBadgeIn 0.7s var(--ds-ease) backwards;
        animation-delay: 0.1s;
    }
    .ds-loaded .hero-title .title-line {
        animation: dsLineReveal 0.9s var(--ds-ease) backwards;
    }
    .ds-loaded .hero-title .title-line:nth-child(1) { animation-delay: 0.30s; }
    .ds-loaded .hero-title .title-line:nth-child(2) { animation-delay: 0.50s; }
    .ds-loaded .hero-description {
        animation: dsRise 0.8s var(--ds-ease) backwards;
        animation-delay: 0.72s;
    }
    .ds-loaded .hero-features .feature-item {
        animation: dsSlideIn 0.65s var(--ds-ease) backwards;
    }
    .ds-loaded .hero-features .feature-item:nth-child(1) { animation-delay: 0.88s; }
    .ds-loaded .hero-features .feature-item:nth-child(2) { animation-delay: 1.01s; }
    .ds-loaded .hero-features .feature-item:nth-child(3) { animation-delay: 1.14s; }
    .ds-loaded .hero-features .feature-item:nth-child(4) { animation-delay: 1.27s; }
    .ds-loaded .hero-features .feature-item:nth-child(5) { animation-delay: 1.40s; }
    .ds-loaded .hero-features .feature-item:nth-child(6) { animation-delay: 1.53s; }
    /* checkmarks pop in just after their row lands */
    .ds-loaded .hero-features .feature-item i {
        animation: dsCheckPop 0.5s var(--ds-ease) backwards;
    }
    .ds-loaded .hero-features .feature-item:nth-child(1) i { animation-delay: 1.02s; }
    .ds-loaded .hero-features .feature-item:nth-child(2) i { animation-delay: 1.15s; }
    .ds-loaded .hero-features .feature-item:nth-child(3) i { animation-delay: 1.28s; }
    .ds-loaded .hero-features .feature-item:nth-child(4) i { animation-delay: 1.41s; }
    .ds-loaded .hero-features .feature-item:nth-child(5) i { animation-delay: 1.54s; }
    .ds-loaded .hero-features .feature-item:nth-child(6) i { animation-delay: 1.67s; }
    .ds-loaded .hero-cta {
        animation: dsRise 0.8s var(--ds-ease) backwards;
        animation-delay: 1.72s;
    }
}

@keyframes dsBadgeIn {
    from { opacity: 0; transform: translateY(-10px) scale(0.9); }
    to   { opacity: 1; transform: none; }
}
@keyframes dsLineReveal {
    from { opacity: 0; transform: translateY(34px); filter: blur(9px); }
    to   { opacity: 1; transform: none; filter: blur(0); }
}
@keyframes dsSlideIn {
    from { opacity: 0; transform: translateY(18px) scale(0.96); }
    to   { opacity: 1; transform: none; }
}
@keyframes dsCheckPop {
    0%   { opacity: 0; transform: scale(0); }
    60%  { transform: scale(1.3); }
    100% { opacity: 1; transform: scale(1); }
}

/* ============================================================================
   MOBILE HERO REFINEMENTS — stacked CTAs + a tidy, aligned bullet column
   ========================================================================== */
.cta-label-m { display: none; }   /* the shorter mobile label, hidden on desktop */

@media (max-width: 768px) {
    /* CTAs stack; the secondary "Find out more" sits above "Start Free Trial" */
    .hero-cta {
        flex-direction: column;
        align-items: stretch;
        gap: 0.75rem;
        max-width: 340px;
        margin-left: auto;
        margin-right: auto;
    }
    .hero-cta .btn { width: 100%; justify-content: center; }
    .hero-cta .hero-cta-secondary { order: -1; }
    .cta-label-d { display: none; }
    .cta-label-m { display: inline; }

    /* bullets become a centred column: checkmarks line up, long lines wrap
       with a clean hanging indent instead of ragged centred text */
    .hero-features {
        width: 100%;
        max-width: 320px;
        margin-left: auto;
        margin-right: auto;
        text-align: left;
        gap: 0.85rem;
    }
    .hero-features .feature-item {
        align-items: flex-start;          /* check aligns to the first line */
        gap: 0.6rem;
    }
    .hero-features .feature-item i {
        margin-top: 0.12em;
        flex-shrink: 0;
    }
    .hero-features .feature-item span {
        flex: 1;
        min-width: 0;
    }
}

/* ============================================================================
   REFINED 30-DAY TRIAL BADGE — on-brand indigo/violet, glassy, animated
   (replaces the old green pill; applies on every breakpoint)
   ========================================================================== */
.trial-badge {
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.22), rgba(139, 92, 246, 0.12));
    border: 1px solid rgba(139, 92, 246, 0.5);
    color: #e2e6ff;
    position: relative;
    overflow: hidden;
    box-shadow: 0 6px 22px -8px rgba(99, 102, 241, 0.55);
    animation: none;   /* drop the green pulse-glow; entrance comes from .ds-loaded */
}
.trial-badge i,
.trial-badge span { position: relative; z-index: 2; }
.trial-badge i {
    color: #a5b4fc;
    animation: dsBadgePulse 3.2s ease-in-out infinite;
}
/* a soft light sheen sweeps across the pill (behind the text, so it stays crisp) */
.trial-badge::after {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 1;
    background: linear-gradient(110deg, transparent 38%, rgba(214, 220, 255, 0.32) 50%, transparent 62%);
    background-size: 260% 100%;
    background-position: 220% 0;
    animation: dsBadgeSheen 4.5s ease-in-out infinite;
    pointer-events: none;
}
@keyframes dsBadgeSheen {
    0%        { background-position: 220% 0; }
    32%, 100% { background-position: -140% 0; }
}
@keyframes dsBadgePulse {
    0%, 100% { transform: scale(1); }
    50%      { transform: scale(1.14); }
}

/* ---------------------------------------------------------------------------
   REDUCED MOTION — honour the user's OS setting: show everything, hold still
   ------------------------------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
    .ds-reveal { opacity: 1 !important; transform: none !important; transition: none !important; }
    .ds-loaded .hero .trial-badge,
    .ds-loaded .hero-title .title-line,
    .ds-loaded .hero-description,
    .ds-loaded .hero-features .feature-item,
    .ds-loaded .hero-features .feature-item i,
    .ds-loaded .hero-cta,
    .ds-loaded .hero-visual { animation: none !important; }
    .trial-badge i,
    .trial-badge::after { animation: none !important; }
    .ds-ticker__track { animation: none !important; transform: none !important; }
    .hero .gradient-orb { animation: none !important; }
    .btn-primary::after { display: none; }
    .ds-tilt { transform: none !important; }
}
