/* =========================================================
   True Voice Hub — Custom Styles
   Layered on top of Tailwind utilities for non-utility needs:
   • Hero / CTA banner mesh-gradient background
   • Scroll-reveal animations
   • Brand micro-details (focus rings, scrollbar, gradients)
   ========================================================= */

/* ---------- Base layer ---------- */
html {
    scroll-behavior: smooth;
}

body {
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
}

/* Brand-tinted scrollbar */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: #f1f5f9; }
.dark ::-webkit-scrollbar-track { background: #061a2e; }
::-webkit-scrollbar-thumb { background: #0a2540; border-radius: 6px; }
::-webkit-scrollbar-thumb:hover { background: #2dd4bf; }

/* Accessible focus state — keyboard users */
:focus-visible {
    outline: 3px solid #2dd4bf;
    outline-offset: 3px;
    border-radius: 4px;
}

/* ---------- Hero / CTA mesh-gradient background ---------- */
/* Used ONLY on hero sections and final CTA banner per brief */
.hero-bg {
    background-color: #0a2540;
    background-image:
        radial-gradient(at 20% 0%,   rgba(45, 212, 191, 0.25) 0px, transparent 50%),
        radial-gradient(at 80% 0%,   rgba(45, 212, 191, 0.15) 0px, transparent 55%),
        radial-gradient(at 0% 50%,   rgba(20, 184, 166, 0.20) 0px, transparent 50%),
        radial-gradient(at 80% 80%,  rgba(45, 212, 191, 0.18) 0px, transparent 55%),
        radial-gradient(at 0% 100%,  rgba(10, 37, 64, 0.40)   0px, transparent 50%);
    position: relative;
}

.hero-bg::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(rgba(255, 255, 255, 0.03) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.03) 1px, transparent 1px);
    background-size: 60px 60px;
    pointer-events: none;
    z-index: 0;
}

.hero-bg > * { position: relative; z-index: 1; }

/* ---------- Scroll-reveal animation (CSS-only via IO toggling) ---------- */
.reveal {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.8s ease-out, transform 0.8s ease-out;
}

.reveal.is-visible {
    opacity: 1;
    transform: translateY(0);
}

/* Stagger helpers */
.reveal[data-delay="1"] { transition-delay: 0.1s; }
.reveal[data-delay="2"] { transition-delay: 0.2s; }
.reveal[data-delay="3"] { transition-delay: 0.3s; }
.reveal[data-delay="4"] { transition-delay: 0.4s; }
.reveal[data-delay="5"] { transition-delay: 0.5s; }

@media (prefers-reduced-motion: reduce) {
    .reveal { opacity: 1; transform: none; transition: none; }
    .animate-pulse-slow, .animate-fade-up, .animate-fade-in { animation: none; }
}

/* ---------- Card hover lift (used across service/feature cards) ---------- */
.card-lift {
    transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
}
.card-lift:hover {
    transform: translateY(-6px);
    box-shadow: 0 20px 40px -15px rgba(10, 37, 64, 0.25);
}

/* ---------- Section dividers — subtle primary-tint variants ---------- */
.section-tint-1 { background-color: #ffffff; }
.section-tint-2 { background-color: #f7f9fc; }   /* slight lighter primary-tinted off-white */
.section-tint-3 { background-color: #eef2f7; }
.dark .section-tint-1 { background-color: #061a2e; }
.dark .section-tint-2 { background-color: #0a2540; }
.dark .section-tint-3 { background-color: #143358; }

/* ---------- Decorative accent bar (used under section eyebrows) ---------- */
.accent-bar {
    width: 64px;
    height: 4px;
    background: linear-gradient(90deg, #2dd4bf, #14b8a6);
    border-radius: 999px;
}

/* ---------- Form polish ---------- */
.form-input {
    width: 100%;
    padding: 0.875rem 1rem;
    border: 2px solid rgba(10, 37, 64, 0.12);
    border-radius: 0.5rem;
    background: #ffffff;
    color: #0a2540;
    font-family: 'DM Sans', sans-serif;
    font-size: 1rem;
    transition: border-color 0.2s, box-shadow 0.2s;
}
.dark .form-input {
    background: #143358;
    color: #d9d9d9;
    border-color: rgba(217, 217, 217, 0.15);
}
.form-input:focus {
    outline: none;
    border-color: #2dd4bf;
    box-shadow: 0 0 0 4px rgba(45, 212, 191, 0.15);
}
.form-input::placeholder { color: rgba(10, 37, 64, 0.4); }
.dark .form-input::placeholder { color: rgba(217, 217, 217, 0.4); }

/* ---------- Prose styles for legal pages ---------- */
.legal-prose h2 {
    font-family: 'Open Sans', sans-serif;
    font-weight: 700;
    font-size: 1.5rem;
    color: #0a2540;
    margin-top: 2.5rem;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid #2dd4bf;
}
.dark .legal-prose h2 { color: #ffffff; }
.legal-prose h3 {
    font-family: 'Open Sans', sans-serif;
    font-weight: 600;
    font-size: 1.15rem;
    color: #143358;
    margin-top: 1.75rem;
    margin-bottom: 0.75rem;
}
.dark .legal-prose h3 { color: #2dd4bf; }
.legal-prose p { margin-bottom: 1rem; line-height: 1.75; }
.legal-prose ul { list-style: disc; padding-left: 1.5rem; margin-bottom: 1rem; }
.legal-prose ul li { margin-bottom: 0.5rem; line-height: 1.7; }
.legal-prose strong { color: #0a2540; font-weight: 600; }
.dark .legal-prose strong { color: #2dd4bf; }
.legal-prose a { color: #2dd4bf; text-decoration: underline; }

/* ---------- Page banner background (small hero on inner pages) ---------- */
.page-banner-bg {
    background-color: #0a2540;
    background-image:
        radial-gradient(at 20% 30%, rgba(45, 212, 191, 0.18) 0, transparent 50%),
        radial-gradient(at 80% 70%, rgba(20, 184, 166, 0.12) 0, transparent 50%);
}

/* ---------- Min hero height ---------- */
.hero-min { min-height: 90vh; }
@media (max-width: 767px) {
    .hero-min { min-height: 75vh; }
}

/* ---------- Responsive headline scale (matches brief) ---------- */
.h1-display {
    font-size: 2.25rem;       /* mobile */
    line-height: 1.15;
}
@media (min-width: 768px)  { .h1-display { font-size: 3rem; } }
@media (min-width: 1280px) { .h1-display { font-size: 3.75rem; } }   /* 60px */

/* ---------- Stats counter style ---------- */
.stat-num {
    font-family: 'Open Sans', sans-serif;
    font-weight: 800;
    background: linear-gradient(135deg, #2dd4bf 0%, #14b8a6 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* ---------- Enquiry slider popup ---------- */
/* Desktop default: slides DOWN from the top edge, centered, NOT full width */
.enquiry-popup {
    left: 50%;
    top: 0;
    width: calc(100% - 3rem);
    max-width: 760px;
    max-height: 90vh;
    max-height: 90dvh;
    transform: translate(-50%, -110%);
    transition: transform 0.5s cubic-bezier(0.22, 1, 0.36, 1),
                visibility 0s linear 0.5s;
    visibility: hidden;
    border-bottom-left-radius: 1.5rem;
    border-bottom-right-radius: 1.5rem;
    overflow: hidden; /* keeps rounded corners clean while inner scrolls */
}

.enquiry-popup.is-open {
    transform: translate(-50%, 0);
    visibility: visible;
    transition: transform 0.5s cubic-bezier(0.22, 1, 0.36, 1),
                visibility 0s linear 0s;
}

/* Scrollable inner content (flex child) */
.enquiry-popup__scroll {
    flex: 1 1 auto;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
}

#enquiryOverlay.is-open {
    opacity: 1;
    visibility: visible;
}

/* Mobile: full-width sheet that slides UP from the bottom edge */
@media (max-width: 767px) {
    .enquiry-popup {
        top: auto;
        bottom: 0;
        width: 100%;
        max-width: 100%;
        max-height: 92vh;
        max-height: 92dvh;
        transform: translate(-50%, 110%);
        border-bottom-left-radius: 0;
        border-bottom-right-radius: 0;
        border-top-left-radius: 1.5rem;
        border-top-right-radius: 1.5rem;
    }
    .enquiry-popup.is-open {
        transform: translate(-50%, 0);
    }
    /* Respect iPhone home-indicator + give the submit button breathing room */
    .enquiry-popup__scroll {
        padding-bottom: calc(1.25rem + env(safe-area-inset-bottom));
    }
    /* Tighter form inputs on mobile so the full form fits without forced scrolling */
    .enquiry-popup .form-input {
        padding: 0.7rem 0.85rem;
        font-size: 0.95rem;
    }
}

/* Lock page scroll when popup is open */
body.popup-open {
    overflow: hidden;
}

@media (prefers-reduced-motion: reduce) {
    .enquiry-popup,
    #enquiryOverlay {
        transition: opacity 0.15s linear, visibility 0s !important;
    }
    .enquiry-popup { transform: translate(-50%, 0) !important; }
}
