/* PhoneFlow reusable components — browser/phone frames, icon badges, waveform, CTAs, trusted-by */

/* ============================================================
   ICON BADGE — replaces emoji icon boxes in feature cards
   ============================================================ */
.icon-badge {
    width: 56px;
    height: 56px;
    border-radius: 14px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background:
        linear-gradient(135deg, rgba(255, 107, 43, 0.1) 0%, rgba(59, 130, 246, 0.1) 100%),
        #ffffff;
    border: 1px solid rgba(15, 23, 42, 0.06);
    box-shadow: var(--shadow-sm), inset 0 1px 0 rgba(255, 255, 255, 0.6);
    color: #ff6b2b;
    transition: all 0.35s var(--ease-out);
    flex-shrink: 0;
}

.icon-badge > svg {
    width: 26px;
    height: 26px;
    stroke: currentColor;
    stroke-width: 1.75;
    fill: none;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.feature-card:hover .icon-badge {
    transform: translateY(-2px) scale(1.04);
    background:
        linear-gradient(135deg, rgba(255, 107, 43, 0.18) 0%, rgba(59, 130, 246, 0.18) 100%),
        #ffffff;
    color: #ff6b2b;
    box-shadow: var(--shadow-md), inset 0 1px 0 rgba(255, 255, 255, 0.6);
}

/* Per-card icon hue variants (give the grid visual rhythm) */
.icon-badge.tone-orange { color: #ff6b2b; }
.icon-badge.tone-blue   { color: #3b82f6; }
.icon-badge.tone-indigo { color: #6366f1; }
.icon-badge.tone-violet { color: #8b5cf6; }
.icon-badge.tone-green  { color: #10b981; }
.icon-badge.tone-rose   { color: #ef4444; }

/* ============================================================
   BROWSER FRAME — refined layered shadow, subtle border
   (augments existing .browser-frame styles)
   ============================================================ */
.browser-frame {
    border-radius: 14px !important;
    border: 1px solid rgba(15, 23, 42, 0.08) !important;
    box-shadow: var(--shadow-lg) !important;
    background: #ffffff !important;
    overflow: hidden;
}

.browser-frame:hover {
    box-shadow: var(--shadow-xl) !important;
    transform: translateY(-4px);
}

.browser-frame-header {
    background: #f8fafc !important;
    border-bottom: 1px solid rgba(15, 23, 42, 0.06);
    padding: 0.625rem 0.875rem !important;
}

.browser-dot {
    width: 11px !important;
    height: 11px !important;
}

/* ============================================================
   PHONE FRAME — CSS-only device bezel for softphone/mobile shots
   ============================================================ */
.phone-frame {
    position: relative;
    max-width: 280px;
    margin: 0 auto;
    padding: 10px;
    background: linear-gradient(160deg, #1f2937, #0f172a);
    border-radius: 36px;
    box-shadow:
        var(--shadow-xl),
        inset 0 1px 0 rgba(255, 255, 255, 0.1),
        inset 0 -1px 0 rgba(0, 0, 0, 0.5);
}

.phone-frame::before {
    content: '';
    position: absolute;
    top: 14px;
    left: 50%;
    transform: translateX(-50%);
    width: 80px;
    height: 20px;
    background: #0f172a;
    border-radius: 12px;
    z-index: 2;
}

.phone-frame img {
    width: 100%;
    display: block;
    border-radius: 26px;
}

/* ============================================================
   ANNOTATION PILL — floating callout on screenshots
   ============================================================ */
.annotation-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0.875rem;
    background: #ffffff;
    border: 1px solid rgba(15, 23, 42, 0.08);
    border-radius: 999px;
    box-shadow: var(--shadow-md);
    font-size: 0.8125rem;
    font-weight: 600;
    color: #0f172a;
    white-space: nowrap;
}

.annotation-pill .dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #10b981;
    box-shadow: 0 0 0 4px rgba(16, 185, 129, 0.15);
}

.annotation-pill svg {
    width: 16px;
    height: 16px;
    stroke: #ff6b2b;
    stroke-width: 2;
    fill: none;
}

.annotation-float {
    position: absolute;
    z-index: 4;
    animation: annotationFloat 6s ease-in-out infinite;
}

@keyframes annotationFloat {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-6px); }
}

/* ============================================================
   WAVEFORM — animated bars for voice widget toggle
   ============================================================ */
.waveform {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    height: 20px;
}

.waveform .bar {
    display: block;
    width: 3px;
    background: currentColor;
    border-radius: 3px;
    animation: wavePulse 1.2s ease-in-out infinite;
    transform-origin: center;
}

.waveform .bar:nth-child(1) { animation-delay: 0s;    height: 40%; }
.waveform .bar:nth-child(2) { animation-delay: 0.15s; height: 70%; }
.waveform .bar:nth-child(3) { animation-delay: 0.3s;  height: 100%; }
.waveform .bar:nth-child(4) { animation-delay: 0.45s; height: 70%; }
.waveform .bar:nth-child(5) { animation-delay: 0.6s;  height: 40%; }

@keyframes wavePulse {
    0%, 100% { transform: scaleY(0.5); opacity: 0.6; }
    50%      { transform: scaleY(1); opacity: 1; }
}

.waveform.active .bar {
    animation-duration: 0.6s;
}

/* ============================================================
   CTA BUTTON POLISH — inset highlight + shine on hover
   Targets existing .cta-primary / .hero-cta-primary buttons
   ============================================================ */
.cta-primary,
.hero-cta-primary,
.hero-cta,
button.cta-primary {
    position: relative;
    box-shadow:
        var(--shadow-orange),
        inset 0 1px 0 rgba(255, 255, 255, 0.25) !important;
    overflow: hidden;
    isolation: isolate;
}

.cta-primary::after,
.hero-cta-primary::after,
.hero-cta::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 60%;
    height: 100%;
    background: linear-gradient(
        100deg,
        transparent 0%,
        rgba(255, 255, 255, 0.22) 50%,
        transparent 100%
    );
    transition: left 0.7s var(--ease-out);
    pointer-events: none;
    z-index: 1;
}

.cta-primary:hover::after,
.hero-cta-primary:hover::after,
.hero-cta:hover::after {
    left: 140%;
}

/* ============================================================
   TRUSTED-BY STRIP — grayscale logo row under hero
   ============================================================ */
.trusted-by {
    margin-top: 2.5rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
}

.trusted-by-label {
    font-size: 0.75rem;
    font-weight: 600;
    color: #94a3b8;
    text-transform: uppercase;
    letter-spacing: 0.12em;
}

.trusted-by-logos {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 2.5rem;
    justify-content: center;
    opacity: 0.6;
}

.trusted-by-logos .logo-item {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    color: #64748b;
    font-weight: 600;
    font-size: 0.9rem;
    letter-spacing: -0.01em;
    transition: all 0.3s var(--ease-out);
    filter: grayscale(1);
}

.trusted-by-logos .logo-item svg {
    width: 22px;
    height: 22px;
    stroke: currentColor;
    stroke-width: 1.75;
    fill: none;
    opacity: 0.8;
}

.trusted-by-logos .logo-item:hover {
    color: #0f172a;
    filter: grayscale(0);
    transform: translateY(-2px);
}

@media (max-width: 640px) {
    .trusted-by-logos {
        gap: 1.5rem;
    }
    .trusted-by-logos .logo-item {
        font-size: 0.8rem;
    }
}

/* ============================================================
   SHADOW REFINEMENTS — apply layered shadows to existing cards
   ============================================================ */
.feature-card,
.stat-card,
.demo-box,
.step-card,
.pricing-card {
    box-shadow: var(--shadow-sm) !important;
    border: var(--border-hairline) !important;
    transition: all 0.4s var(--ease-out) !important;
}

.feature-card:hover,
.step-card:hover {
    box-shadow: var(--shadow-lg) !important;
    transform: translateY(-6px) !important;
}

/* ============================================================
   VOICE WIDGET TOGGLE — polished button with waveform
   ============================================================ */
.widget-toggle-button {
    gap: 10px !important;
    padding: 14px 20px !important;
    box-shadow: var(--shadow-orange), inset 0 1px 0 rgba(255,255,255,0.25) !important;
    transition: all 0.3s var(--ease-out) !important;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif !important;
    letter-spacing: -0.005em;
}

.widget-toggle-button:hover {
    transform: translateY(-2px) scale(1.02);
    box-shadow: 0 20px 48px -8px rgba(255, 107, 43, 0.5), inset 0 1px 0 rgba(255,255,255,0.3) !important;
}

.widget-toggle-button .waveform {
    color: #ffffff;
    height: 18px;
}

.widget-toggle-button .waveform .bar {
    width: 2.5px;
}

/* ============================================================
   HERO LOAD-IN ANIMATIONS — smooth staggered fade+rise.
   Longer durations (0.9-1.2s), gentler easing, small Y offset so motion
   reads as a soft settle rather than a snap. Total sequence ~1.6s.
   ============================================================ */
@keyframes heroRise {
    from { opacity: 0; transform: translate3d(0, 10px, 0); }
    to   { opacity: 1; transform: translate3d(0, 0, 0); }
}

@keyframes heroFadeScale {
    from { opacity: 0; transform: scale(0.98) translate3d(0, 12px, 0); }
    to   { opacity: 1; transform: scale(1) translate3d(0, 0, 0); }
}

@keyframes pillFadeIn {
    from { opacity: 0; transform: translate3d(0, 4px, 0); }
    to   { opacity: 1; transform: translate3d(0, 0, 0); }
}

/* Gentle cubic-bezier — easeOutQuint-ish, settles without snapping */
.hero-pro .hero-display,
.hero-pro .hero-subtitle,
.hero-pro .hero-cta-group,
.hero-pro .hero-live-badge,
.hero-pro .screenshot-stage,
.hero-pro .hero-inline-trust-right,
.hero-pro .screenshot-float-bl,
.hero-pro .screenshot-float-tr,
.hero-pro .screenshot-composite .annotation-float {
    will-change: opacity, transform;
    backface-visibility: hidden;
}

.hero-pro .hero-display {
    animation: heroRise 1s cubic-bezier(0.22, 1, 0.36, 1) 0.15s both;
}

.hero-pro .hero-subtitle {
    animation: heroRise 1s cubic-bezier(0.22, 1, 0.36, 1) 0.3s both;
}

.hero-pro .hero-cta-group {
    animation: heroRise 1s cubic-bezier(0.22, 1, 0.36, 1) 0.45s both;
}

.hero-pro .hero-live-badge {
    animation: heroRise 0.9s cubic-bezier(0.22, 1, 0.36, 1) 0.25s both;
}

.hero-pro .screenshot-stage {
    animation: heroFadeScale 1.2s cubic-bezier(0.22, 1, 0.36, 1) 0.3s both;
}

.hero-pro .hero-inline-trust-right {
    animation: heroRise 0.9s cubic-bezier(0.22, 1, 0.36, 1) 0.7s both;
}

/* Floating screenshots — gentle fade-in, then idle float.
   Float animations start at 1.4s so they don't fight the entrance. */
.hero-pro .screenshot-float-bl {
    animation:
        pillFadeIn 0.8s cubic-bezier(0.22, 1, 0.36, 1) both,
        floatBL 8s ease-in-out infinite;
    animation-delay: 0.7s, 1.5s;
}

.hero-pro .screenshot-float-tr {
    animation:
        pillFadeIn 0.8s cubic-bezier(0.22, 1, 0.36, 1) both,
        floatTR 9s ease-in-out infinite;
    animation-delay: 0.85s, 1.6s;
}

.hero-pro .screenshot-float-mr {
    animation:
        pillFadeIn 0.8s cubic-bezier(0.22, 1, 0.36, 1) both,
        floatMR 10s ease-in-out infinite;
    animation-delay: 0.95s, 1.7s;
    will-change: opacity, transform;
}

.hero-pro .screenshot-composite .annotation-float {
    opacity: 0;
}

.hero-pro .screenshot-composite .annot-tl {
    animation:
        pillFadeIn 0.7s cubic-bezier(0.22, 1, 0.36, 1) both,
        annotationFloat 6s ease-in-out infinite;
    animation-delay: 0.95s, 1.7s;
}

.hero-pro .screenshot-composite .annot-mr {
    animation:
        pillFadeIn 0.7s cubic-bezier(0.22, 1, 0.36, 1) both,
        annotationFloat 6s ease-in-out infinite;
    animation-delay: 1.1s, 1.85s;
}

.hero-pro .screenshot-composite .annot-br {
    animation:
        pillFadeIn 0.7s cubic-bezier(0.22, 1, 0.36, 1) both,
        annotationFloat 6s ease-in-out infinite;
    animation-delay: 1.25s, 2s;
}

/* Respect reduced-motion */
@media (prefers-reduced-motion: reduce) {
    .hero-pro .hero-display,
    .hero-pro .hero-subtitle,
    .hero-pro .hero-cta-group,
    .hero-pro .hero-live-badge,
    .hero-pro .screenshot-stage,
    .hero-pro .hero-inline-trust-right,
    .hero-pro .screenshot-float-bl,
    .hero-pro .screenshot-float-tr,
    .hero-pro .screenshot-composite .annotation-float {
        animation: none !important;
        opacity: 1 !important;
        transform: none !important;
    }
}

/* ============================================================
   HERO-PRO — asymmetric two-column layout with product stage
   ============================================================ */
.hero.hero-pro,
.hero-pro {
    /* Enough top padding to clear the fixed nav with a small breathing band;
       enough bottom padding so the next section doesn't peek into the fold.
       Hero fills the viewport and centers its content vertically. */
    padding: clamp(5.5rem, 7vw, 6.5rem) 0 clamp(3.5rem, 5vw, 4.5rem) !important;
    text-align: left !important;
    overflow: visible !important;
    isolation: isolate;
    min-height: 105vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.hero.hero-pro > .container,
.hero-pro > .container {
    width: 100%;
}

.hero.hero-pro::before,
.hero.hero-pro::after {
    display: none !important;
}

.hero-pro .container {
    max-width: 1120px !important;
}

.hero-pro-grid {
    display: grid;
    grid-template-columns: minmax(0, 0.95fr) minmax(0, 1.1fr);
    gap: clamp(2rem, 5vw, 4rem);
    align-items: center;
    text-align: left;
}

.hero-pro-text {
    max-width: 560px;
}

.hero-live-badge {
    display: inline-flex;
    align-self: flex-start;
    margin-bottom: 1rem !important;
    font-size: 0.8125rem !important;
}

.hero-pro-visual {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 1rem;
}

.hero-display {
    font-family: 'Inter Tight', 'Inter', sans-serif !important;
    font-size: clamp(3rem, 6.5vw, 6rem) !important;
    font-weight: 700 !important;
    line-height: 0.98 !important;
    letter-spacing: -0.035em !important;
    margin: 0 0 1.5rem !important;
    color: #0f172a !important;
}

.hero-display .highlight {
    display: inline-block;
    white-space: nowrap;
    /* JS sets --word-scale based on word length; fonts auto-shrink for long phrases.
       `1em` here resolves to the parent H1's computed font-size, then scales down. */
    font-size: calc(1em * var(--word-scale, 1));
    transition: font-size 0.3s var(--ease-out);
    background-image: linear-gradient(135deg, #ff6b2b 0%, #ff8c4d 30%, #3b82f6 70%, #6366f1 100%) !important;
    background-size: 200% 200%;
    background-repeat: no-repeat;
    -webkit-background-clip: text !important;
    background-clip: text !important;
    -webkit-text-fill-color: transparent !important;
    color: transparent !important;
    animation: gradientShift 6s ease infinite;
}

.hero-pro .hero-subtitle {
    font-size: clamp(1.0625rem, 1.3vw, 1.25rem) !important;
    line-height: 1.55 !important;
    color: #475569 !important;
    max-width: 560px !important;
    margin: 0 0 1.75rem !important;
}

.hero-pro .hero-buttons {
    display: flex;
    gap: 0.875rem;
    margin: 0 !important;
    flex-wrap: wrap;
    justify-content: center;
}

.hero-cta-group {
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    gap: 0.75rem;
    margin-top: 2rem;
}

.hero-cta-group .hero-microcopy {
    text-align: center;
    margin: 0 !important;
}

.hero-pro .cta-primary,
.hero-pro .cta-secondary {
    padding: 1rem 1.75rem !important;
    font-size: 1rem !important;
    border-radius: 12px !important;
}

.hero-pro .hero-microcopy {
    font-size: 0.875rem;
    color: #64748b;
    margin: 0.875rem 0 0;
    font-weight: 500;
}

.hero-inline-trust {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
    font-size: 0.8125rem;
    font-weight: 500;
    color: #64748b;
    margin-top: 0.5rem;
}

.hero-inline-trust-right {
    justify-content: center;
}

.hero-inline-trust .sep {
    opacity: 0.4;
}

.hero-inline-trust .item {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
}

.hero-inline-trust svg {
    width: 15px;
    height: 15px;
    stroke: #10b981;
    stroke-width: 2;
    fill: none;
}

/* ============================================================
   SCREENSHOT STAGE — hero product mockup with floating annotations
   ============================================================ */
.screenshot-stage {
    position: relative;
    isolation: isolate;
    padding: 0.5rem;
}

/* Composite: main screenshot with 2 smaller floating screenshot cards for depth */
.screenshot-composite {
    padding: 2rem 1.5rem 3.5rem;
}

.screenshot-composite .screenshot-main {
    position: relative;
    z-index: 2;
    max-width: 100%;
}

.screenshot-composite .screenshot-float {
    position: absolute;
    width: 42%;
    max-width: 240px;
    z-index: 3;
    border-radius: 10px !important;
}

.screenshot-composite .screenshot-float .browser-frame-header {
    padding: 0.375rem 0.5rem !important;
}

.screenshot-composite .screenshot-float .browser-dot {
    width: 8px !important;
    height: 8px !important;
}

.screenshot-composite .screenshot-float img {
    border-radius: 0 0 10px 10px;
}

.screenshot-composite .screenshot-float-bl {
    bottom: 2%;
    left: -4%;
    transform: rotate(-4deg);
    transition: transform 0.6s var(--ease-out);
    animation: floatBL 8s ease-in-out infinite;
}

.screenshot-composite .screenshot-float-tr {
    top: 2%;
    right: -4%;
    transform: rotate(4deg);
    transition: transform 0.6s var(--ease-out);
    animation: floatTR 9s ease-in-out infinite 1s;
}

/* Third float (middle-right) — tools/integrations view; anchors "Lead tagged" pill */
.screenshot-composite .screenshot-float-mr {
    bottom: 6%;
    right: -6%;
    width: 36%;
    max-width: 210px;
    transform: rotate(3deg);
    transition: transform 0.6s var(--ease-out);
    animation: floatMR 10s ease-in-out infinite 2s;
    z-index: 4;
}

@keyframes floatBL {
    0%, 100% { transform: rotate(-4deg) translateY(0); }
    50%      { transform: rotate(-3deg) translateY(-6px); }
}

@keyframes floatTR {
    0%, 100% { transform: rotate(4deg) translateY(0); }
    50%      { transform: rotate(3deg) translateY(-6px); }
}

@keyframes floatMR {
    0%, 100% { transform: rotate(3deg) translateY(0); }
    50%      { transform: rotate(2deg) translateY(-5px); }
}

.screenshot-composite:hover .screenshot-float-bl {
    animation-play-state: paused;
    transform: rotate(-2deg) translateY(-8px) scale(1.03);
}

.screenshot-composite:hover .screenshot-float-tr {
    animation-play-state: paused;
    transform: rotate(2deg) translateY(-8px) scale(1.03);
}

.screenshot-composite:hover .screenshot-float-mr {
    animation-play-state: paused;
    transform: rotate(2deg) translateY(-6px) scale(1.03);
}

/* Floating annotation pill positions + hover motion */
.screenshot-composite .annotation-float {
    animation: annotationFloat 6s ease-in-out infinite;
    transition: transform 0.35s var(--ease-out), box-shadow 0.35s var(--ease-out);
}

/* Pill anchoring:
   - annot-tl (Call auto-booked) → hovers in empty space above the bottom-left Booking float
   - annot-mr (Transcript saved) → overlays the top-right Transcripts float
   - annot-br (Lead tagged)      → overlays the bottom-right Tools/Integrations float */
.screenshot-composite .annot-tl {
    top: 38%;
    left: -2%;
    z-index: 5;
}

.screenshot-composite .annot-mr {
    top: 28%;
    right: -2%;
    z-index: 5;
}

.screenshot-composite .annot-br {
    bottom: 22%;
    right: -4%;
    z-index: 6;
}

.screenshot-composite:hover .annot-tl {
    transform: translate(-4px, -4px) scale(1.05);
    box-shadow: var(--shadow-lg);
}
.screenshot-composite:hover .annot-mr {
    transform: translate(4px, -2px) scale(1.05);
    box-shadow: var(--shadow-lg);
}
.screenshot-composite:hover .annot-br {
    transform: translate(4px, 4px) scale(1.05);
    box-shadow: var(--shadow-lg);
}

@media (max-width: 640px) {
    .screenshot-composite .annotation-float {
        display: none;
    }
}

@media (max-width: 1024px) {
    .screenshot-composite .screenshot-float {
        width: 38%;
        max-width: 200px;
    }
}

@media (max-width: 640px) {
    .screenshot-composite .screenshot-float {
        display: none;
    }
    .screenshot-composite {
        padding: 0.5rem;
    }
}

.screenshot-stage::before {
    content: '';
    position: absolute;
    inset: -10%;
    background:
        radial-gradient(ellipse 60% 50% at 30% 30%, rgba(255, 107, 43, 0.22), transparent 70%),
        radial-gradient(ellipse 50% 60% at 70% 70%, rgba(59, 130, 246, 0.22), transparent 70%),
        radial-gradient(ellipse 40% 40% at 50% 50%, rgba(139, 92, 246, 0.18), transparent 70%);
    filter: blur(40px);
    z-index: -1;
    animation: meshBreathe 18s ease-in-out infinite;
}

@keyframes meshBreathe {
    0%, 100% { transform: scale(1) rotate(0deg); }
    50%      { transform: scale(1.08) rotate(3deg); }
}

.screenshot-stage .screenshot-main {
    transform: perspective(1600px) rotateY(-3deg) rotateX(2deg) rotate(-0.5deg);
    transform-origin: center center;
    box-shadow:
        0 1px 2px rgba(15, 23, 42, 0.06),
        0 10px 30px rgba(15, 23, 42, 0.1),
        0 40px 80px rgba(15, 23, 42, 0.15),
        0 60px 120px rgba(59, 130, 246, 0.12) !important;
    transition: transform 0.6s var(--ease-out), box-shadow 0.6s var(--ease-out);
}

.screenshot-stage:hover .screenshot-main {
    transform: perspective(1600px) rotateY(-1deg) rotateX(0.5deg) rotate(0deg) translateY(-4px);
}

/* Floating annotation pills positioned around the screenshot */
.screenshot-stage .annotation-float {
    position: absolute;
    z-index: 4;
}

.screenshot-stage .float-tl {
    top: 8%;
    left: -8%;
    animation: annotationFloat 6s ease-in-out infinite;
}

.screenshot-stage .float-tr {
    top: 22%;
    right: -10%;
    animation: annotationFloat 7s ease-in-out 0.8s infinite;
}

.screenshot-stage .float-br {
    bottom: 12%;
    right: -4%;
    animation: annotationFloat 8s ease-in-out 1.6s infinite;
}

.screenshot-stage .float-bl {
    bottom: 18%;
    left: -6%;
    animation: annotationFloat 7.5s ease-in-out 2.4s infinite;
}

/* ============================================================
   GRADIENT MESH BACKGROUND — colorful soft blobs, slowly drifting
   ============================================================ */
.gradient-mesh-bg {
    position: relative;
    overflow: hidden;
}

.gradient-mesh-bg::after {
    content: '';
    position: absolute;
    inset: -10%;
    background:
        radial-gradient(ellipse 50% 40% at 10% 20%, rgba(255, 107, 43, 0.14), transparent 60%),
        radial-gradient(ellipse 45% 40% at 90% 30%, rgba(59, 130, 246, 0.12), transparent 60%),
        radial-gradient(ellipse 55% 45% at 50% 90%, rgba(139, 92, 246, 0.1), transparent 60%),
        radial-gradient(ellipse 40% 50% at 80% 80%, rgba(236, 72, 153, 0.08), transparent 60%);
    z-index: -2;
    pointer-events: none;
    animation: meshDrift 24s ease-in-out infinite alternate;
    will-change: transform;
}

@keyframes meshDrift {
    0%   { transform: translate(0, 0) scale(1) rotate(0deg); }
    33%  { transform: translate(2%, -1.5%) scale(1.05) rotate(1.5deg); }
    66%  { transform: translate(-1.5%, 2%) scale(1.03) rotate(-1deg); }
    100% { transform: translate(1%, 1%) scale(1.07) rotate(2deg); }
}

/* Respect reduced-motion */
@media (prefers-reduced-motion: reduce) {
    .gradient-mesh-bg::after,
    .screenshot-stage::before {
        animation: none !important;
    }
}

/* ============================================================
   AMBIENT PAGE BACKGROUND — multi-color orbs + subtle dot grid
   drifting behind content so the page never feels flat
   ============================================================ */
body::before {
    content: '';
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 0;
    background-image: radial-gradient(circle, rgba(15, 23, 42, 0.045) 1px, transparent 1px);
    background-size: 28px 28px;
    mask-image: radial-gradient(ellipse 70% 60% at 50% 40%, rgba(0,0,0,0.7) 0%, rgba(0,0,0,0.2) 70%, transparent 100%);
    -webkit-mask-image: radial-gradient(ellipse 70% 60% at 50% 40%, rgba(0,0,0,0.7) 0%, rgba(0,0,0,0.2) 70%, transparent 100%);
}

body::after {
    content: '';
    position: fixed;
    inset: -10%;
    pointer-events: none;
    z-index: 0;
    background:
        radial-gradient(circle 520px at 8% 12%, rgba(255, 107, 43, 0.11), transparent 65%),
        radial-gradient(circle 480px at 94% 22%, rgba(59, 130, 246, 0.1), transparent 65%),
        radial-gradient(circle 420px at 18% 78%, rgba(139, 92, 246, 0.09), transparent 65%),
        radial-gradient(circle 500px at 86% 82%, rgba(236, 72, 153, 0.07), transparent 65%),
        radial-gradient(circle 380px at 52% 48%, rgba(16, 185, 129, 0.06), transparent 65%);
    animation: ambientDrift 34s ease-in-out infinite alternate;
    will-change: transform;
}

@keyframes ambientDrift {
    0%   { transform: translate(0, 0) rotate(0deg); }
    50%  { transform: translate(2%, -2%) rotate(0.8deg); }
    100% { transform: translate(-2%, 2%) rotate(-0.8deg); }
}

/* BULLETPROOF: restore dark sections. These cards use rgba(255,255,255,0.05)
   backgrounds + white text and DEPEND on the section bg being dark navy.
   Use !important so no cascade/cache situation can break them again. */
.section-dark,
section.section-dark,
section.section.section-dark {
    background: #0f172a !important;
    color: #ffffff !important;
}

.section-dark .use-case-card,
.section-dark .use-case-card h3,
.section-dark .use-case-card p,
.section-dark .section-title,
.section-dark .section-subtitle {
    /* keep legacy white text on dark background */
    color: inherit;
}

/* Let the ambient orbs show through LIGHT sections only. */
.section:not(.section-alt):not(.section-dark):not(.cta-section):not([class*="dark"]):not([style*="background"]) {
    background-color: rgba(255, 255, 255, 0.6);
}

.section-alt:not([style*="background"]):not(.section-dark) {
    background: rgba(248, 250, 252, 0.55) !important;
}

.product-showcase {
    background: rgba(248, 250, 252, 0.55) !important;
}

/* Per-section decorative orbs — soft, static, positioned in opposite corners.
   Only applied to light-background sections. Dark/CTA/colored sections are skipped
   because they have opaque backgrounds and cards that depend on contrast. */
section.section:not(.hero):not(.section-dark):not(.cta-section):not([class*="dark"]):not(#try-ai):not([id="testimonials"]):not([style*="background"]) {
    position: relative;
    overflow: hidden;
}

section.section:not(.hero):not(.section-dark):not(.cta-section):not([class*="dark"]):not(#try-ai):not([id="testimonials"]):not([style*="background"])::before,
section.section:not(.hero):not(.section-dark):not(.cta-section):not([class*="dark"]):not(#try-ai):not([id="testimonials"]):not([style*="background"])::after {
    content: '';
    position: absolute;
    pointer-events: none;
    z-index: 0;
    border-radius: 50%;
    filter: blur(50px);
    opacity: 0.18;
}

/* Default (section): orange top-right + blue bottom-left */
section.section:not(.hero):not(.section-alt):not(.section-dark):not(.cta-section):not([class*="dark"]):not(#try-ai):not([id="testimonials"]):not([style*="background"])::before {
    top: -8%;
    right: -6%;
    width: 320px;
    height: 320px;
    background: radial-gradient(circle, rgba(255, 107, 43, 0.55), transparent 70%);
}

section.section:not(.hero):not(.section-alt):not(.section-dark):not(.cta-section):not([class*="dark"]):not(#try-ai):not([id="testimonials"]):not([style*="background"])::after {
    bottom: -8%;
    left: -6%;
    width: 360px;
    height: 360px;
    background: radial-gradient(circle, rgba(59, 130, 246, 0.5), transparent 70%);
}

/* Alt sections: violet top-left + pink bottom-right (creates visual rhythm section-to-section) */
section.section-alt::before {
    top: -10%;
    left: -6%;
    width: 340px;
    height: 340px;
    background: radial-gradient(circle, rgba(139, 92, 246, 0.5), transparent 70%);
}

section.section-alt::after {
    bottom: -8%;
    right: -6%;
    width: 320px;
    height: 320px;
    background: radial-gradient(circle, rgba(236, 72, 153, 0.4), transparent 70%);
}

/* Make sure section content sits above the decorative orbs */
section > .container,
section > div {
    position: relative;
    z-index: 1;
}

/* Ensure section content paints above the ambient ::after layer,
   but DO NOT touch the header — it needs its own high z-index so the
   dropdown menus can open above other sections. */
section,
footer,
main {
    position: relative;
    z-index: 1;
}

/* Responsive — stack to single column on tablet */
@media (max-width: 1024px) {
    .hero-pro-grid {
        grid-template-columns: 1fr;
        text-align: center;
    }
    .hero-pro-text {
        max-width: 720px;
        margin: 0 auto;
    }
    .hero-pro .hero-buttons {
        justify-content: center;
    }
    .hero-inline-trust {
        justify-content: center;
    }
    .screenshot-stage .browser-frame {
        transform: perspective(1400px) rotateX(3deg);
    }
    .screenshot-stage .float-tl { left: 2%; }
    .screenshot-stage .float-tr { right: 2%; }
    .screenshot-stage .float-br { right: 4%; }
}

@media (max-width: 640px) {
    .screenshot-stage .annotation-float {
        display: none;
    }
    .screenshot-stage {
        padding: 0.5rem;
    }
}

/* ============================================================
   BENTO GRID — asymmetric feature layout
   ============================================================ */
.bento-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    grid-auto-rows: minmax(220px, auto);
    gap: 1rem;
}

.bento-cell {
    position: relative;
    background: #ffffff;
    border: var(--border-hairline);
    border-radius: var(--radius-lg);
    padding: 1.75rem;
    text-decoration: none;
    color: inherit;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    box-shadow: var(--shadow-sm);
    transition: all 0.45s var(--ease-out);
    isolation: isolate;
}

.bento-cell::before {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at var(--mx, 50%) var(--my, 0%), rgba(255, 107, 43, 0.12), transparent 50%);
    opacity: 0;
    transition: opacity 0.5s var(--ease-out);
    z-index: -1;
    pointer-events: none;
}

.bento-cell:hover {
    transform: translateY(-6px);
    border-color: rgba(255, 107, 43, 0.25);
    box-shadow: var(--shadow-lg);
}

.bento-cell:hover::before {
    opacity: 1;
}

.bento-cell .icon-badge {
    margin-bottom: 1.25rem;
}

.bento-cell .feature-title {
    font-size: 1.3125rem !important;
    font-weight: 650 !important;
    margin-bottom: 0.5rem !important;
    letter-spacing: -0.02em;
    color: #0f172a;
}

.bento-cell .feature-description {
    font-size: 0.9375rem !important;
    line-height: 1.55 !important;
    color: #475569 !important;
}

.bento-cell.bento-lg {
    grid-column: span 2;
    grid-row: span 2;
    padding: 2.5rem;
    background:
        radial-gradient(circle at 100% 0%, rgba(255, 107, 43, 0.08), transparent 60%),
        #ffffff;
    border-color: rgba(255, 107, 43, 0.15);
}

.bento-cell.bento-lg .icon-badge {
    width: 72px;
    height: 72px;
    border-radius: 18px;
}

.bento-cell.bento-lg .icon-badge > svg {
    width: 32px;
    height: 32px;
}

.bento-cell.bento-lg .feature-title {
    font-size: clamp(1.5rem, 2.2vw, 2rem) !important;
    line-height: 1.15 !important;
    margin-bottom: 0.75rem !important;
}

.bento-cell.bento-lg .feature-description {
    font-size: 1.0625rem !important;
    max-width: 480px;
}

.bento-cell.bento-lg .bento-decor {
    position: absolute;
    bottom: -30px;
    right: -30px;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 220px;
    height: 220px;
    background: linear-gradient(135deg, rgba(255, 107, 43, 0.12), rgba(59, 130, 246, 0.1));
    border-radius: 50%;
    opacity: 0.9;
    z-index: 0;
}

.bento-cell.bento-lg .bento-decor svg {
    width: 80px;
    height: 80px;
    stroke: rgba(255, 107, 43, 0.6);
    stroke-width: 1.5;
    fill: none;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.bento-cell.bento-wide {
    grid-column: span 2;
}

.bento-cell.bento-tall {
    grid-row: span 2;
}

/* Arrow indicator on bento cells */
.bento-cell::after {
    content: '→';
    position: absolute;
    right: 1.5rem;
    bottom: 1.25rem;
    font-size: 1.25rem;
    color: #cbd5e1;
    transition: all 0.35s var(--ease-out);
    line-height: 1;
}

.bento-cell:hover::after {
    color: #ff6b2b;
    transform: translateX(4px);
}

@media (max-width: 900px) {
    .bento-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    .bento-cell.bento-lg {
        grid-column: span 2;
        grid-row: span 1;
        min-height: 280px;
    }
    .bento-cell.bento-wide {
        grid-column: span 2;
    }
    .bento-cell.bento-tall {
        grid-row: span 1;
    }
}

@media (max-width: 560px) {
    .bento-grid {
        grid-template-columns: 1fr;
    }
    .bento-cell,
    .bento-cell.bento-lg,
    .bento-cell.bento-wide {
        grid-column: span 1;
        grid-row: span 1;
    }
}

/* ============================================================
   HEADER — compact; the inline styles make it unnecessarily tall
   ============================================================ */
header {
    padding: 0.625rem 0 !important;
}

header .phoneflow-logo-img {
    height: 44px !important;
}

header .es-logo-img {
    height: 32px !important;
}

header .logo-text .brand {
    font-size: 1.0625rem !important;
}

header .logo-text .tagline {
    font-size: 0.65rem !important;
}

header .nav {
    gap: 1.25rem !important;
}

header .nav-link {
    font-size: 0.9375rem;
}

/* ============================================================
   PRICING HERO CARD — compact so section fits in one viewport
   ============================================================ */
.pricing-hero-card {
    padding: 1.5rem !important;
    margin-top: 1rem !important;
}

.pricing-hero-content {
    gap: 1.5rem !important;
}

.pricing-hero-main {
    padding: 1.25rem !important;
}

.pricing-hero-price {
    font-size: clamp(2.5rem, 5vw, 3.75rem) !important;
    margin-bottom: 0.5rem !important;
}

.pricing-hero-details h4 {
    margin-bottom: 0.625rem !important;
    font-size: 1rem !important;
}

.pricing-hero-details ul {
    gap: 0.375rem !important;
}

.pricing-hero-details li {
    padding: 0.375rem 0 !important;
    font-size: 0.875rem !important;
}

.pricing-hero-cta {
    padding: 1rem 0 0 !important;
    margin-top: 1rem !important;
}

/* Pricing sub-grid (Only Pay / No Minimums / Enterprise Discounts) compact */
#pricing .value-props,
#pricing .section > div[style*="grid-template-columns"] {
    gap: 0.75rem !important;
    margin-top: 1rem !important;
}

/* ============================================================
   DEMO SECTION — 2-col layout: audio + transcript left, summary right
   so "Hear Your AI in Action" fits in one viewport
   ============================================================ */
.demo-container {
    display: grid !important;
    grid-template-columns: 1fr 1fr;
    gap: 1.25rem;
    align-items: start;
    max-width: none !important;
}

.demo-container > *:nth-child(1),
.demo-container > *:nth-child(2) {
    grid-column: 1;
}

.demo-container > *:nth-child(3) {
    grid-column: 2;
    grid-row: 1 / span 2;
    margin-top: 0 !important;
    align-self: stretch;
    padding: 1.25rem !important;
}

.demo-container > .demo-buttons {
    grid-column: 1 / -1;
    margin-top: 1rem !important;
    justify-content: center;
    display: flex;
    gap: 0.75rem;
}

/* Constrain transcript height so it scrolls inline */
.demo-container .chat-preview {
    max-height: 260px;
    overflow-y: auto;
    padding: 0.875rem !important;
}

.demo-container .audio-player {
    padding: 1rem !important;
}

.demo-container .chat-message {
    padding: 0.625rem 0.75rem !important;
    margin-bottom: 0.5rem !important;
    font-size: 0.875rem;
    line-height: 1.5;
}

/* Call summary panel tightened */
.demo-container > *:nth-child(3) h4 {
    margin-bottom: 0.75rem !important;
}

.demo-container > *:nth-child(3) > div[style*="grid"] {
    grid-template-columns: 1fr 1fr !important;
    gap: 0.75rem !important;
}

.demo-container > *:nth-child(3) h5 {
    margin-bottom: 0.25rem !important;
}

.demo-container > *:nth-child(3) p {
    font-size: 0.8125rem !important;
    line-height: 1.45 !important;
}

@media (max-width: 900px) {
    .demo-container {
        grid-template-columns: 1fr !important;
    }
    .demo-container > *:nth-child(3) {
        grid-column: 1;
        grid-row: auto;
    }
}

/* ============================================================
   ROI CALCULATOR — 2-col compact layout so inputs + results fit
   in one viewport (no scroll to see if numbers moved)
   ============================================================ */
.roi-calculator {
    padding: 1.5rem !important;
    display: grid !important;
    grid-template-columns: 1fr 1fr;
    gap: 1rem 1.25rem;
    align-items: start;
}

/* Children placement:
   1 = .roi-inputs (full-width, 2 groups internally)
   2 = #roiValidationMessages
   3 = .comparison-table (left col)
   4 = .roi-results (right col, next to table)
   5 = caption text (full-width)
   6 = CTA wrapper (full-width) */
.roi-calculator > .roi-inputs {
    grid-column: 1 / -1;
    margin-bottom: 0 !important;
    gap: 1rem !important;
}

.roi-calculator > #roiValidationMessages {
    grid-column: 1 / -1;
}

.roi-calculator > .comparison-table {
    grid-column: 1;
    align-self: stretch;
}

.roi-calculator > .roi-results {
    grid-column: 2;
    grid-row: auto;
    margin-top: 0 !important;
    align-self: stretch;
    display: flex !important;
    flex-direction: column;
    justify-content: center;
    padding: 1.25rem !important;
    border-radius: 12px;
}

.roi-calculator > div[style*="text-align: center"] {
    grid-column: 1 / -1;
    margin-top: 0.75rem !important;
}

/* Tighter roi-groups */
.roi-group {
    padding: 1rem !important;
}

.roi-group h4 {
    font-size: 0.9375rem !important;
    margin-bottom: 0.625rem !important;
}

.roi-group label {
    margin-bottom: 0.375rem !important;
    font-size: 0.8125rem !important;
}

.roi-group input,
.roi-group select {
    padding: 0.5rem 0.625rem !important;
    font-size: 0.875rem !important;
}

.roi-group small {
    font-size: 0.75rem !important;
}

/* Tighter comparison table */
.comparison-table {
    font-size: 0.875rem;
}

.comparison-row,
.comparison-header {
    padding: 0.625rem 0.75rem !important;
}

/* Savings panel — Annual is the hero number, monthly + efficiency support it.
   Keeps the whole block inside the compressed right column of the ROI grid. */
.roi-results {
    padding: 1.25rem 1.25rem 1rem !important;
    text-align: center;
}

.roi-results-eyebrow {
    display: block;
    font-size: 0.6875rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: #059669;
    margin-bottom: 0.5rem;
}

.roi-savings-hero {
    padding: 0.25rem 0 0.75rem;
    border-bottom: 1px dashed rgba(5, 150, 105, 0.35);
    margin-bottom: 0.75rem;
}

.roi-savings-big {
    font-family: 'Inter Tight', 'Inter', sans-serif;
    font-size: clamp(2rem, 3vw, 2.75rem) !important;
    font-weight: 800;
    letter-spacing: -0.025em;
    line-height: 1;
    color: #047857;
    margin-bottom: 0.25rem;
}

.roi-savings-big-label {
    font-size: 0.8125rem;
    color: #475569;
    font-weight: 500;
}

.roi-savings-support {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.support-stat {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.125rem;
    min-width: 0;
}

.support-value {
    font-family: 'Inter Tight', 'Inter', sans-serif;
    font-size: 1.125rem;
    font-weight: 700;
    color: #0f172a;
    letter-spacing: -0.015em;
    line-height: 1.1;
}

.support-label {
    font-size: 0.6875rem;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    font-weight: 600;
}

.support-divider {
    width: 1px;
    align-self: stretch;
    background: rgba(5, 150, 105, 0.25);
    margin: 0.25rem 0;
}

/* Keep legacy .roi-savings class quiet for any other pages using it */
.roi-results .roi-savings {
    font-size: 1.75rem;
    line-height: 1;
}

@media (max-width: 900px) {
    .roi-calculator {
        grid-template-columns: 1fr;
    }
    .roi-calculator > .comparison-table,
    .roi-calculator > .roi-results {
        grid-column: 1;
    }
}

/* ============================================================
   INDUSTRIES BENTO — offset big-CTA anchors the bottom-right
   (visually different from features bento which has big card top-left)
   ============================================================ */
.industries-bento {
    grid-auto-flow: row dense;
    grid-template-columns: repeat(3, 1fr);
}

.bento-cell.bento-industry {
    padding: 1.5rem;
}

.bento-industry .industry-icon {
    width: 24px;
    height: 24px;
    color: #94a3b8;
    margin-bottom: 0.75rem;
    transition: color 0.35s var(--ease-out), transform 0.35s var(--ease-out);
}

.bento-industry:hover .industry-icon {
    color: #ff6b2b;
    transform: translateX(2px);
}

.bento-industry .feature-title {
    font-size: 1.0625rem !important;
    margin-bottom: 0.375rem !important;
    color: #0f172a;
}

.bento-industry .feature-description {
    font-size: 0.875rem !important;
    line-height: 1.5 !important;
}

.bento-industry::after {
    display: none;
}

/* The big CTA card — positioned explicitly at bottom-right (cols 2-3, rows 3-4) */
.bento-cell.bento-cta {
    grid-column: 2 / 4;
    grid-row: 3 / 5;
    padding: 2rem;
    color: #ffffff;
    background:
        radial-gradient(circle at 20% 20%, rgba(255, 255, 255, 0.14), transparent 40%),
        linear-gradient(135deg, #ff6b2b 0%, #f97316 35%, #3b82f6 100%);
    border: none !important;
    justify-content: center;
    overflow: hidden;
    position: relative;
}

.bento-cell.bento-cta:hover {
    transform: translateY(-6px);
    border-color: transparent !important;
    box-shadow:
        0 1px 2px rgba(15, 23, 42, 0.06),
        0 20px 48px -12px rgba(255, 107, 43, 0.45) !important;
}

.bento-cta::after {
    display: none;
}

.bento-cta-pattern {
    position: absolute;
    inset: 0;
    background-image:
        radial-gradient(circle, rgba(255, 255, 255, 0.08) 1px, transparent 1px);
    background-size: 16px 16px;
    opacity: 0.6;
    mask-image: radial-gradient(ellipse 80% 60% at 70% 80%, #000 30%, transparent 80%);
    -webkit-mask-image: radial-gradient(ellipse 80% 60% at 70% 80%, #000 30%, transparent 80%);
    pointer-events: none;
    z-index: 0;
}

.bento-cta > * {
    position: relative;
    z-index: 1;
}

.bento-cta-eyebrow {
    display: inline-block;
    background: rgba(255, 255, 255, 0.18);
    padding: 0.375rem 0.75rem;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    margin-bottom: 1rem;
    color: #ffffff;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

.bento-cta-title {
    font-family: 'Inter Tight', 'Inter', sans-serif;
    font-size: clamp(1.5rem, 2vw, 1.875rem) !important;
    font-weight: 700;
    line-height: 1.15;
    letter-spacing: -0.02em;
    color: #ffffff !important;
    margin-bottom: 0.625rem !important;
    max-width: 520px;
}

.bento-cta-sub {
    color: rgba(255, 255, 255, 0.88) !important;
    font-size: 0.9375rem !important;
    line-height: 1.55 !important;
    max-width: 480px;
    margin-bottom: 1.25rem;
}

.bento-cta-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: #ffffff;
    color: #ff6b2b;
    padding: 0.75rem 1.375rem;
    border-radius: 10px;
    font-weight: 600;
    font-size: 0.9375rem;
    width: fit-content;
    transition: transform 0.25s var(--ease-out), box-shadow 0.25s var(--ease-out);
    box-shadow: 0 4px 16px -4px rgba(0, 0, 0, 0.2);
}

.bento-cta-btn svg {
    width: 16px;
    height: 16px;
    transition: transform 0.25s var(--ease-out);
}

.bento-cta:hover .bento-cta-btn {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px -4px rgba(0, 0, 0, 0.25);
}

.bento-cta:hover .bento-cta-btn svg {
    transform: translateX(3px);
}

@media (max-width: 900px) {
    .bento-cell.bento-cta {
        grid-column: 1 / -1;
        grid-row: auto;
    }
}

/* ============================================================
   SECTION HEADER (eyebrow + title + subtitle centered)
   ============================================================ */
.section-head-pro {
    text-align: center;
    margin-bottom: 3rem;
    max-width: 720px;
    margin-left: auto;
    margin-right: auto;
}

.section-head-pro .section-title {
    margin-top: 0.5rem;
}

.section-head-pro .section-subtitle {
    margin-top: 1rem;
    font-size: 1.125rem;
    color: #64748b;
}
