/* ==========================================================================
   PREMIUM TEMPLATE 1 - CORE STYLES
   Inspired by modern, high-end design systems (e.g., Stripe, Linear).
   Features: Glassmorphism, Fluid Typography, Bento Grids, Layered Gradients.
   ========================================================================== */

/* ==========================================================================
   1. CSS VARIABLES (DESIGN TOKENS)
   ========================================================================== */
:root {
    /* --------------------------------------------------------
     Colors: Backgrounds & Surfaces
     -------------------------------------------------------- */
    --bg-primary: #EEEEEE;
    /* Main App Canvas (Very light grey as requested) */
    --bg-card: #F9FAFB;
    /* Primary Content Blocks (Slightly lighter to lift off background) */
    --bg-elevated: #FFFFFF;
    /* Floating Elements (Modals, Dropdowns - Pure white for highest elevation) */
    --bg-surface: #E5E7EB;
    /* Subtle highlight areas */

    /* Glassmorphism Backgrounds (Requires backdrop-filter: blur, optimized for light mode) */
    --bg-glass: rgba(255, 255, 255, 0.5);
    --bg-glass-medium: rgba(255, 255, 255, 0.7);
    --bg-glass-heavy: rgba(255, 255, 255, 0.85);

    /* --------------------------------------------------------
     Colors: Text & Content
     -------------------------------------------------------- */
    --text-primary: #111827;
    /* Headings, primary content */
    --text-secondary: #4B5563;
    /* Subtitles, secondary text */
    --text-muted: #6B7280;
    /* Meta text, borders */
    --text-on-accent: #FFFFFF;
    /* Text sitting on primary accent */

    /* --------------------------------------------------------
     Colors: Adaptive Palette
     (The Mortgage Centre Elite Brand Colors)
     -------------------------------------------------------- */
    --primary: #396178;
    /* Mortgage Slate Blue — extracted from logo text */
    --primary-rgb: 57, 97, 120;
    --primary-hover: #2D4F63;
    --primary-soft: rgba(57, 97, 120, 0.1);
    --primary-glow: rgba(57, 97, 120, 0.25);

    --secondary: #EEEEEE;
    /* Light grey canvas */
    --secondary-soft: rgba(238, 238, 238, 0.6);
    --secondary-glow: rgba(57, 97, 120, 0.12);

    --tertiary: #EC1731;
    /* Mortgage Centre Red — extracted from logo icon */
    --tertiary-soft: rgba(236, 23, 49, 0.1);
    --tertiary-glow: rgba(236, 23, 49, 0.25);

    --accent: var(--primary);
    /* Alias for primary to maintain compatibility */

    /* --------------------------------------------------------
     Colors: Functional (Success, Error, Info)
     -------------------------------------------------------- */
    --success: #059669;
    --error: #DC2626;
    --info: #2563EB;

    /* --------------------------------------------------------
     Borders & Dividers
     -------------------------------------------------------- */
    --border-subtle: rgba(0, 0, 0, 0.06);
    /* Minimal division */
    --border-medium: rgba(0, 0, 0, 0.12);
    /* Clearer edges */
    --border-brutal: 2px solid rgba(0, 0, 0, 0.12);
    /* For distinct container outlines */

    /* --------------------------------------------------------
     Typography (Fonts & Fluid Sizing)
     -------------------------------------------------------- */
    --font-family-base: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    --font-family-mono: 'JetBrains Mono', 'Fira Code', Consolas, monospace;

    /* Fluid Typographic Scale using clamp() */
    --text-xs: clamp(0.75rem, 0.7rem + 0.25vw, 0.875rem);
    --text-sm: clamp(0.875rem, 0.83rem + 0.22vw, 0.95rem);
    --text-base: clamp(1rem, 0.95rem + 0.25vw, 1.125rem);
    --text-lg: clamp(1.125rem, 1.05rem + 0.375vw, 1.3125rem);
    --text-xl: clamp(1.25rem, 1.15rem + 0.5vw, 1.5rem);
    --text-2xl: clamp(1.5rem, 1.35rem + 0.75vw, 1.875rem);
    --text-3xl: clamp(1.875rem, 1.6rem + 1.375vw, 2.5rem);
    --text-4xl: clamp(2.25rem, 1.8rem + 2.25vw, 3rem);
    --text-5xl: clamp(3rem, 2.2rem + 4vw, 4.5rem);
    --text-6xl: clamp(3.75rem, 2.5rem + 6.25vw, 6rem);

    --font-weight-regular: 400;
    --font-weight-medium: 500;
    --font-weight-semibold: 600;
    --font-weight-bold: 700;

    --line-height-tight: 1.1;
    --line-height-base: 1.5;
    --line-height-relaxed: 1.7;

    --letter-spacing-tight: -0.02em;
    --letter-spacing-base: 0;
    --letter-spacing-wide: 0.05em;

    /* --------------------------------------------------------
     Spacing System
     -------------------------------------------------------- */
    --space-1: 0.25rem;
    --space-2: 0.5rem;
    --space-3: 0.75rem;
    --space-4: 1rem;
    --space-6: 1.5rem;
    --space-8: 2rem;
    --space-12: 3rem;
    --space-16: 4rem;
    --space-24: 6rem;
    --space-32: 8rem;
    --space-section: clamp(4rem, 8vw, 8rem);

    /* Layout & Spacing */
    --container-max-width: 1200px;
    --container-padding: 2rem;
    --nav-height: 140px;
    --footer-height: 400px;

    /* Layout & Geometry */
    --radius-sm: 0.375rem;
    --radius-md: 0.5rem;
    --radius-lg: 1rem;
    --radius-xl: 1.5rem;
    --radius-2xl: 2.5rem;
    --radius-3xl: 3.5rem;
    --radius-full: 9999px;

    /* --------------------------------------------------------
     Shadows (Subtle, optimized for light mode depth)
     -------------------------------------------------------- */
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.08), 0 2px 4px -2px rgba(0, 0, 0, 0.04);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.08), 0 4px 6px -4px rgba(0, 0, 0, 0.04);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.05);

    /* Inner shadow for glassmorphism pop */
    --shadow-glass-inner: inset 0 1px 1px rgba(255, 255, 255, 0.8);

    /* --------------------------------------------------------
     Transitions
     -------------------------------------------------------- */
    --transition-fast: 0.15s ease;
    --transition-base: 0.25s ease;
    --transition-slow: 0.4s ease;
    --transition-elastic: 0.5s cubic-bezier(0.68, -0.55, 0.265, 1.55);

    /* --------------------------------------------------------
     Missing Spacing
     -------------------------------------------------------- */
    --space-5: 1.25rem;

    /* Theme Control */
    color-scheme: light;
}

/* Base Dark Mode Variables (Allows switching back to dark mode via customizer) */
[data-theme-type="dark"] {
    --bg-primary: #0E0E11;
    --bg-card: #17171C;
    --bg-elevated: #1F1F26;
    --bg-surface: #272730;

    --bg-glass: rgba(255, 255, 255, 0.04);
    --bg-glass-medium: rgba(255, 255, 255, 0.06);
    --bg-glass-heavy: rgba(255, 255, 255, 0.09);

    --text-primary: #FFFFFF;
    --text-secondary: #A1A1AA;
    --text-muted: #71717A;

    --border-subtle: rgba(255, 255, 255, 0.08);
    --border-medium: rgba(255, 255, 255, 0.14);
    --border-brutal: 2px solid rgba(255, 255, 255, 0.14);

    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.4);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.3), 0 2px 4px -2px rgba(0, 0, 0, 0.3);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.5), 0 4px 6px -4px rgba(0, 0, 0, 0.4);

    --shadow-glass-inner: inset 0 1px 1px rgba(255, 255, 255, 0.15);
    color-scheme: dark;
}


/* ==========================================================================
   2. CSS RESET & GLOBAL STYLES
   ========================================================================== */
*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    /* Prevent horizontal scroll issues */
    overflow-x: hidden;
    /* Native smooth scrolling for anchor links — premium Apple-style feel */
    scroll-behavior: smooth;
    font-family: var(--font-family-base);
    font-size: 16px;
    /* Clean minimal scrollbar */
    scrollbar-width: thin;
    scrollbar-color: rgba(0, 0, 0, 0.2) transparent;
}

body {
    background-color: var(--bg-primary);
    color: var(--text-primary);
    line-height: var(--line-height-base);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    /* NOTE: Do NOT add overflow-x:hidden here — html already has it.
       Having it on BOTH html and body creates competing scroll containers
       in Chromium, breaking wheel/keyboard scroll entirely. */
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    transition: background-color var(--transition-slow), color var(--transition-slow);
    /* iOS momentum scrolling — native rubber-band physics */
    -webkit-overflow-scrolling: touch;
    /* Prevent scroll chaining to parent/browser chrome */
    overscroll-behavior-y: none;
}

/* Premium minimal scrollbar — WebKit (Chrome, Safari, Edge) */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, 0.15);
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(0, 0, 0, 0.3);
}

img,
picture,
video,
canvas,
svg {
    display: block;
    max-width: 100%;
    height: auto;
}

button,
input,
textarea,
select {
    font: inherit;
    color: inherit;
    background: transparent;
    border: none;
}

button {
    cursor: pointer;
}

a {
    color: inherit;
    text-decoration: none;
    transition: color var(--transition-fast);
}

ul,
ol {
    list-style: none;
}

/* ==========================================================================
   3. TYPOGRAPHY
   ========================================================================== */
h1,
h2,
h3,
h4,
h5,
h6 {
    font-weight: var(--font-weight-bold);
    line-height: var(--line-height-tight);
    color: var(--text-primary);
    letter-spacing: var(--letter-spacing-tight);
    margin-bottom: var(--space-4);
}

h1,
.text-6xl {
    font-size: var(--text-6xl);
}

h2,
.text-5xl {
    font-size: var(--text-5xl);
}

h3,
.text-4xl {
    font-size: var(--text-4xl);
}

h4,
.text-3xl {
    font-size: var(--text-3xl);
}

h5,
.text-2xl {
    font-size: var(--text-2xl);
}

h6,
.text-xl {
    font-size: var(--text-xl);
}

p {
    color: var(--text-secondary);
    font-size: var(--text-base);
    margin-bottom: var(--space-4);
}

.text-lg {
    font-size: var(--text-lg);
}

.text-sm {
    font-size: var(--text-sm);
}

.text-xs {
    font-size: var(--text-xs);
}

/* Gradient Text Utility */
.text-gradient {
    background: linear-gradient(135deg, var(--text-primary) 0%, var(--text-muted) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    display: inline-block;
}

/* Primary Accent Gradient Text */
.text-gradient-primary {
    background: linear-gradient(135deg, var(--primary) 25%, var(--tertiary) 75%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    display: inline-block;
}

/* Label / Eyebrow Text */
.label,
.eyebrow {
    display: inline-block;
    font-size: var(--text-sm);
    font-weight: var(--font-weight-semibold);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--primary);
    margin-bottom: var(--space-2);
}

/* ==========================================================================
   4. LAYOUT & CONTAINERS
   ========================================================================== */
.container {
    width: 100%;
    max-width: var(--container-max-width);
    margin-left: auto;
    margin-right: auto;
    padding-left: var(--container-padding);
    padding-right: var(--container-padding);
}

.section {
    padding-top: var(--space-section);
    padding-bottom: var(--space-section);
    position: relative;
}

/* Standard Flex/Grid Utilities */
.flex {
    display: flex;
}

.flex-col {
    flex-direction: column;
}

.items-center {
    align-items: center;
}

.justify-center {
    justify-content: center;
}

.justify-between {
    justify-content: space-between;
}

.gap-2 {
    gap: var(--space-2);
}

.gap-3 {
    gap: var(--space-3);
}

.gap-4 {
    gap: var(--space-4);
}

.gap-8 {
    gap: var(--space-8);
}

.gap-12 {
    gap: var(--space-12);
}

.grid {
    display: grid;
}

.grid-cols-1 {
    grid-template-columns: repeat(1, minmax(0, 1fr));
}

.grid-cols-2 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.grid-cols-3 {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.grid-cols-4 {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

@media (max-width: 1024px) {
    .lg\:grid-cols-2 {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .lg\:grid-cols-3 {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 768px) {
    .md\:grid-cols-1 {
        grid-template-columns: repeat(1, minmax(0, 1fr));
    }

    .md\:grid-cols-2 {
        grid-template-columns: repeat(1, minmax(0, 1fr));
    }

    .md\:flex-col {
        flex-direction: column;
    }

    .md\:text-center {
        text-align: center;
    }
}

/* ==========================================================================
   5. BUTTONS & UI COMPONENTS
   ========================================================================== */

/* Base Button Style */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-2);
    padding: 0.875rem 1.5rem;
    font-size: var(--text-base);
    font-weight: var(--font-weight-medium);
    border-radius: var(--radius-full);
    /* Pill shape is modern */
    transition: all var(--transition-base);
    text-align: center;
    position: relative;
    overflow: hidden;
    z-index: 1;
}

/* Hover FX for all buttons: slight lift */
.btn:hover {
    transform: translateY(-2px);
}

.btn:active {
    transform: translateY(0);
}

/* Focus states for keyboard navigation (WCAG 2.1 AA) */
.btn:focus-visible,
a:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible,
[role="button"]:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
}

/* Primary Button (Solid Accent) */
.btn-primary {
    background-color: var(--primary);
    color: var(--text-on-accent);
    box-shadow: 0 4px 14px 0 var(--primary-glow);
}

/* Stripe-style hover effect (gradient slide) */
.btn-primary::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(to right, rgba(255, 255, 255, 0), rgba(255, 255, 255, 0.2), rgba(255, 255, 255, 0));
    transform: translateX(-100%);
    transition: transform 0.6s ease;
    z-index: -1;
}

.btn-primary:hover::before {
    transform: translateX(100%);
}

.btn-primary:hover {
    background-color: var(--primary-hover);
    box-shadow: 0 6px 20px 0 var(--primary-glow);
}

/* Secondary Button (Glass/Border) */
.btn-secondary {
    background-color: var(--bg-glass);
    color: var(--text-primary);
    border: 1px solid var(--border-medium);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}

.btn-secondary:hover {
    background-color: var(--bg-glass-heavy);
    border-color: var(--text-secondary);
}

/* Ghost Button (Text only, hover bg) */
.btn-ghost {
    background-color: transparent;
    color: var(--text-primary);
}

.btn-ghost:hover {
    background-color: var(--bg-glass);
}

/* Outline Button (Border only) */
.btn-outline {
    background: transparent;
    border: 1px solid var(--border-medium);
    color: var(--text-primary);
}

.btn-outline:hover {
    border-color: var(--primary);
    color: var(--primary);
    background: var(--primary-soft);
}

/* Sizes */
.btn-sm {
    padding: 0.5rem 1rem;
    font-size: var(--text-sm);
}

.btn-lg {
    padding: 1rem 2rem;
    font-size: var(--text-lg);
}

/* Arrow attached to link */
.link-arrow {
    display: inline-flex;
    align-items: center;
    color: var(--primary);
    font-weight: var(--font-weight-medium);
}

.link-arrow span {
    display: inline-block;
    transition: transform var(--transition-fast);
    margin-left: 0.25rem;
}

.link-arrow:hover span {
    transform: translateX(4px);
}

/* ==========================================================================
   6. CARDS & BENTO GRID
   ========================================================================== */

/* Modern Glass Card */
.card-glass {
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-xl);
    padding: var(--space-8);
    position: relative;
    overflow: hidden;
    /* Inner shadow and slight blur for a premium feel */
    box-shadow: var(--shadow-glass-inner), var(--shadow-md);
    transition: transform var(--transition-base), box-shadow var(--transition-base), border-color var(--transition-base);
}

.card-glass:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-glass-inner), var(--shadow-lg), 0 0 20px var(--primary-soft);
    border-color: var(--border-medium);
}

/* Abstract gradient ambient background inside the card */
.card-glass::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    right: -50%;
    bottom: -50%;
    background: radial-gradient(circle at top right, var(--card-accent, var(--primary-soft)) 0%, transparent 50%);
    opacity: 0;
    transition: opacity var(--transition-slow);
    z-index: 0;
    pointer-events: none;
}

.card-glass:hover::before {
    opacity: 1;
}

/* Bring content above the ambient gradient */
.card-glass>* {
    position: relative;
    z-index: 1;
}

/* Bento Grid System */
.bento-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    grid-auto-rows: minmax(min-content, auto);
    gap: var(--space-6);
}

/* Spanning classes for Bento layouts */
.bento-col-span-2 {
    grid-column: span 2;
}

.bento-col-span-3 {
    grid-column: span 3;
}

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

@media (max-width: 1024px) {
    .bento-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .bento-col-span-3 {
        grid-column: span 2;
    }
}

@media (max-width: 768px) {
    .bento-grid {
        grid-template-columns: 1fr;
    }

    .bento-col-span-2,
    .bento-col-span-3 {
        grid-column: span 1;
    }

    .bento-row-span-2 {
        grid-row: span 1;
    }
}

/* ==========================================================================
   7. NAVIGATION AND HEADER
   ========================================================================== */

/* Handled heavily via JS component, but core styles here */
.nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: var(--nav-height, 100px);
    /* Can be modified by JS */
    z-index: 100;
    transition: background-color var(--transition-base), border-color var(--transition-base), backdrop-filter var(--transition-base);
    border-bottom: 1px solid transparent;
}

.nav.scrolled {
    background-color: var(--bg-glass-heavy);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-bottom: 1px solid var(--border-subtle);
    box-shadow: var(--shadow-sm);
}

/* User toggle for solid background nav */
.nav.solid-bg {
    background-color: var(--nav-solid-color, var(--bg-primary));
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
}

.nav-inner {
    max-width: 1600px;
    margin: 0 auto;
    padding: 0 var(--container-padding);
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.nav-links {
    display: flex;
    gap: var(--space-6);

    @media (max-width: 1024px) {
        display: none;
    }
}

.nav-links a {
    font-size: var(--text-sm);
    font-weight: var(--font-weight-medium);
    color: var(--text-secondary);
    position: relative;
    padding: var(--space-2) 0;
}

.nav-links a:hover,
.nav-links a.active {
    color: var(--text-primary);
}

/* Modern underline indicator for active/hover */
.nav-links a::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background-color: var(--primary);
    transition: width var(--transition-fast);
    border-radius: 2px;
}

.nav-links a:hover::after,
.nav-links a.active::after {
    width: 100%;
}

/* ── Services Mega-Dropdown ────────────────────────────── */
.nav-dropdown {
    position: relative;
}

.nav-dropdown-trigger {
    display: inline-flex;
    align-items: center;
    gap: 2px;
    cursor: pointer;
}

.nav-dropdown-trigger svg {
    transition: transform var(--transition-fast);
}

.nav-dropdown:hover .nav-dropdown-trigger svg {
    transform: rotate(180deg);
}

.nav-dropdown-menu {
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%) translateY(8px);
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--space-6);
    min-width: 520px;
    padding: var(--space-6);
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s ease, visibility 0.2s ease, transform 0.2s ease;
    z-index: 200;
}

/* Invisible bridge so hover doesn't break between trigger and menu */
.nav-dropdown-menu::before {
    content: '';
    position: absolute;
    top: -12px;
    left: 0;
    right: 0;
    height: 12px;
}

.nav-dropdown:hover .nav-dropdown-menu {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(0);
}

.nav-dropdown-col {
    display: flex;
    flex-direction: column;
    gap: var(--space-5);
}

.nav-dropdown-group {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.nav-dropdown-label {
    font-size: 11px;
    font-weight: var(--font-weight-bold);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--primary);
    padding: 0 var(--space-2);
    margin-bottom: 4px;
}

.nav-dropdown-menu a {
    display: block;
    padding: 6px var(--space-2);
    font-size: var(--text-sm);
    color: var(--text-secondary);
    border-radius: 4px;
    transition: background var(--transition-fast), color var(--transition-fast);
    white-space: nowrap;
    text-decoration: none;
    position: relative;
}

.nav-dropdown-menu a::after {
    display: none;
}

.nav-dropdown-menu a:hover {
    background: rgba(var(--primary-rgb, 37, 99, 235), 0.08);
    color: var(--primary);
}

.nav-dropdown-viewall {
    display: block;
    margin-top: var(--space-3);
    padding-top: var(--space-3);
    border-top: 1px solid var(--border-subtle);
    font-size: var(--text-sm);
    font-weight: var(--font-weight-semibold);
    color: var(--primary) !important;
    text-align: center;
}

.nav-dropdown-viewall:hover {
    background: transparent !important;
    text-decoration: underline;
}

/* Compact single-column dropdown (About, etc.) */
.nav-dropdown-menu.nav-dropdown-compact {
    grid-template-columns: 1fr;
    min-width: 240px;
    gap: 2px;
    padding: var(--space-3);
}

.nav-dropdown-compact a {
    display: flex !important;
    align-items: center;
    gap: 10px;
    padding: 10px 12px !important;
    border-radius: var(--radius-sm);
}

.nav-dropdown-compact a svg {
    color: var(--primary);
    flex-shrink: 0;
    opacity: 0.7;
    transition: opacity var(--transition-fast);
}

.nav-dropdown-compact a:hover svg {
    opacity: 1;
}

/* Hide dropdown on mobile — mobile menu handles services */
@media (max-width: 1023px) {
    .nav-dropdown-menu {
        display: none !important;
    }
}

.nav-right {
    display: flex;
    align-items: center;
    gap: var(--space-4);
}

.nav-phone {
    display: inline-flex;
    align-items: center;
    gap: var(--space-2);
    font-weight: var(--font-weight-bold);
    color: var(--text-primary);
    transition: color var(--transition-fast);
}

.nav-phone:hover {
    color: var(--primary);
}

/* Logo specific styles */
.nav-logo {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    font-weight: var(--font-weight-bold);
    font-size: var(--text-lg);
    color: var(--text-primary);
    z-index: 102;
    /* Above mobile menu */
}

/* Ensure larger logo image has vertical breathing room in nav */
.nav-logo img {
    padding-top: 10px;
    padding-bottom: 10px;
}

/* ==========================================================================
   8. FOOTER
   ========================================================================== */
.footer {
    background: var(--bg-card);
    border-top: 1px solid var(--border-subtle);
    padding: var(--space-16) 0 var(--space-8);
    margin-top: auto;
}

.footer-grid {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1fr 1fr;
    gap: var(--space-8) var(--space-6);
    margin-bottom: var(--space-12);
}

@media (max-width: 1100px) {
    .footer-grid {
        grid-template-columns: 1fr 1fr 1fr;
    }
    .footer-brand {
        grid-column: 1 / -1;
    }
}

@media (max-width: 640px) {
    .footer-grid {
        grid-template-columns: 1fr 1fr;
    }
    .footer-brand {
        grid-column: 1 / -1;
    }
}

@media (max-width: 420px) {
    .footer-grid {
        grid-template-columns: 1fr;
    }
}

.footer-col h4 {
    font-size: var(--text-base);
    margin-bottom: var(--space-6);
    color: var(--text-primary);
}

.footer-col a {
    display: block;
    color: var(--text-secondary);
    font-size: var(--text-sm);
    margin-bottom: var(--space-3);
}

.footer-col a:hover {
    color: var(--primary);
}

.footer-bottom {
    padding-top: var(--space-8);
    border-top: 1px solid var(--border-subtle);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    color: var(--text-muted);
    font-size: var(--text-sm);
    text-align: center;
}

.footer-legal-links {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    margin-top: 2px;
}

.footer-legal-links a {
    color: var(--text-muted);
    text-decoration: none;
    font-size: var(--text-xs, 0.75rem);
    transition: color 0.2s;
}

.footer-legal-links a:hover {
    color: var(--primary);
}

.footer-dot {
    color: var(--text-muted);
    opacity: 0.4;
    font-size: 10px;
}

.powered-by-myna {
    display: inline-block;
    text-decoration: none;
    opacity: 0.45;
    transition: opacity 0.3s;
    margin-top: 4px;
}

.powered-by-myna:hover {
    opacity: 0.8;
}

.myna-footer-logo {
    height: 22px;
    width: auto;
}

@media (max-width: 640px) {
    .footer-bottom {
        gap: var(--space-3);
    }
}

/* ── Footer Social Icons ── */
.footer-social-icons {
    display: flex;
    gap: 10px;
    margin-top: 16px;
    padding-top: 14px;
    border-top: 1px solid var(--border-subtle);
    flex-wrap: wrap;
}

.footer-social-link {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    border-radius: 8px;
    background: var(--bg-surface);
    color: var(--text-muted);
    transition: all 0.22s ease;
}

.footer-social-link svg {
    width: 16px;
    height: 16px;
}

.footer-social-link:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
}

/* Brand colors on hover */
.footer-social-link[data-platform="facebook"]:hover { background: #1877F2; color: #fff; }
.footer-social-link[data-platform="instagram"]:hover { background: linear-gradient(135deg, #f09433, #e6683c, #dc2743, #cc2366, #bc1888); color: #fff; }
.footer-social-link[data-platform="linkedin"]:hover { background: #0A66C2; color: #fff; }
.footer-social-link[data-platform="youtube"]:hover { background: #FF0000; color: #fff; }
.footer-social-link[data-platform="tiktok"]:hover { background: #111; color: #fff; }
.footer-social-link[data-platform="twitter"]:hover { background: #111; color: #fff; }
.footer-social-link[data-platform="googleBusiness"]:hover { background: #4285F4; color: #fff; }
.footer-social-link[data-platform="yelp"]:hover { background: #D32323; color: #fff; }

/* ==========================================================================
   9. FORMS & INPUTS
   ========================================================================== */
.input-group {
    margin-bottom: var(--space-4);
}

.input-label {
    display: block;
    font-size: var(--text-sm);
    font-weight: var(--font-weight-medium);
    margin-bottom: var(--space-2);
    color: var(--text-secondary);
}

.input-field {
    width: 100%;
    padding: 0.875rem 1rem;
    background-color: var(--bg-elevated);
    border: 1px solid var(--border-medium);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
    font-size: var(--text-base);
}

.input-field:hover {
    border-color: var(--primary-soft, rgba(57, 97, 120, 0.3));
}

.input-field:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-soft);
}

.input-field::placeholder {
    color: var(--text-muted);
}

textarea.input-field {
    min-height: 120px;
    resize: vertical;
}

/* ==========================================================================
   10. SCROLL REVEAL UTILITIES (JS TRIGGERED)
   ========================================================================== */
.reveal {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity var(--transition-elastic), transform var(--transition-elastic);
    will-change: opacity, transform;
}

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

/* Delay classes for staggered animations */
.reveal-delay-1 {
    transition-delay: 100ms;
}

.reveal-delay-2 {
    transition-delay: 200ms;
}

.reveal-delay-3 {
    transition-delay: 300ms;
}

.reveal-delay-4 {
    transition-delay: 400ms;
}

.reveal-delay-5 {
    transition-delay: 500ms;
}

/* ==========================================================================
   11. AMBIENT BACKGROUND EFFECTS (The "Stripe" Glows)
   ========================================================================== */
.ambient-glow {
    position: absolute;
    border-radius: 50%;
    filter: blur(100px);
    z-index: -1;
    pointer-events: none;
    opacity: 0.5;
}

.glow-primary {
    background: var(--primary);
}

.glow-tertiary {
    background: var(--tertiary);
}

/* Example usage in a relative container: 
   <div class="ambient-glow glow-primary" style="width:400px; height:400px; top:-10%; left:-10%"></div>
*/

/* ==========================================================================
   12. MOBILE MENU SUPPLEMENTARY STYLES
   ========================================================================== */
/* The hamburger icon and mobile menu drawer logic is largely tied to components.js
   but these are the core structural styles needed. */

.hamburger {
    display: none;
    flex-direction: column;
    justify-content: space-around;
    width: 44px;
    height: 44px;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 6px;
    z-index: 102;
    /* Above the menu overlay */
}

.hamburger span {
    width: 2rem;
    height: 0.15rem;
    background: var(--text-primary);
    border-radius: 10px;
    transition: all 0.3s linear;
    position: relative;
    transform-origin: 1px;
}

@media (max-width: 1024px) {
    .hamburger {
        display: flex;
    }

    .nav-cta {
        display: none;
    }

    /* Show phone in nav-right on tablet, hide on phone (shown below logo instead) */
    .nav-phone {
        display: none;
    }
}

/* Active animation for hamburger */
.hamburger.active span:first-child {
    transform: rotate(45deg);
}

.hamburger.active span:nth-child(2) {
    opacity: 0;
    transform: translateX(20px);
}

.hamburger.active span:nth-child(3) {
    transform: rotate(-45deg);
}

/* ── Mobile Menu Backdrop Overlay ── */
.mobile-menu-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 100;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.3s ease, visibility 0.3s ease;
    -webkit-tap-highlight-color: transparent;
}

.mobile-menu-overlay.open {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

/* ── Mobile Menu Drawer ── */
.mobile-menu {
    position: fixed;
    top: 0;
    right: 0;
    height: 100vh;
    height: 100dvh;
    width: 85%;
    max-width: 360px;
    background-color: var(--bg-elevated, #FFFFFF);
    z-index: 101;
    padding: 0 var(--space-6) var(--space-6);
    transform: translateX(100%);
    transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    flex-direction: column;
    gap: 0;
    border-left: 1px solid var(--border-medium, rgba(0, 0, 0, 0.1));
    overflow-y: auto;
    overscroll-behavior: contain;
    box-shadow: -8px 0 30px rgba(0, 0, 0, 0.15);
}

.mobile-menu.open {
    transform: translateX(0);
}

/* ── Close Button Header ── */
.mobile-menu-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--space-4) 0;
    border-bottom: 1px solid var(--border-subtle);
    margin-bottom: var(--space-2);
    position: sticky;
    top: 0;
    background: var(--bg-elevated, #FFFFFF);
    z-index: 2;
}

.mobile-menu-header .menu-title {
    font-size: var(--text-sm, 0.875rem);
    font-weight: var(--font-weight-semibold, 600);
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.mobile-menu-close {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    background: var(--bg-surface, #E5E7EB);
    border-radius: 50%;
    cursor: pointer;
    color: var(--text-primary);
    transition: background 0.15s ease, transform 0.15s ease;
    -webkit-tap-highlight-color: transparent;
}

.mobile-menu-close:hover,
.mobile-menu-close:active {
    background: var(--primary-soft, rgba(57, 97, 120, 0.1));
    transform: scale(1.05);
}

.mobile-menu-close svg {
    width: 20px;
    height: 20px;
    stroke-width: 2.5;
}

/* ── Menu Links ── */
.mobile-menu a {
    font-size: 1rem;
    font-weight: var(--font-weight-medium, 500);
    padding: 14px 12px;
    color: var(--text-primary);
    border-bottom: 1px solid var(--border-subtle);
    display: flex;
    align-items: center;
    gap: var(--space-3, 12px);
    text-decoration: none;
    border-radius: 8px;
    transition: background 0.15s ease;
    min-height: 48px;
}

.mobile-menu a:hover,
.mobile-menu a:active {
    background: var(--primary-soft, rgba(57, 97, 120, 0.08));
    border-bottom-color: transparent;
}

.mobile-menu a svg {
    flex-shrink: 0;
    opacity: 0.7;
}

/* ── Mobile Accordion Sub-Menus ── */
.mobile-menu-accordion {
    border-bottom: 1px solid var(--border-subtle);
}

.mobile-menu-toggle {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    padding: 14px 12px;
    background: none;
    border: none;
    cursor: pointer;
    font-size: 1rem;
    font-weight: var(--font-weight-medium, 500);
    color: var(--text-primary);
    border-radius: 8px;
    min-height: 48px;
    transition: background 0.15s ease;
    -webkit-tap-highlight-color: transparent;
}

.mobile-menu-toggle:hover,
.mobile-menu-toggle:active {
    background: var(--primary-soft, rgba(57, 97, 120, 0.08));
}

.mobile-menu-toggle-left {
    display: flex;
    align-items: center;
    gap: var(--space-3, 12px);
}

.mobile-menu-toggle-left svg {
    flex-shrink: 0;
    opacity: 0.7;
}

.mobile-menu-chevron {
    transition: transform 0.25s ease;
    opacity: 0.5;
    flex-shrink: 0;
}

.mobile-menu-accordion.open .mobile-menu-chevron {
    transform: rotate(180deg);
}

.mobile-menu-sub {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
    padding-left: 20px;
}

.mobile-menu-accordion.open .mobile-menu-sub {
    max-height: 1000px;
}

.mobile-menu-sub a {
    font-size: 0.9rem;
    font-weight: var(--font-weight-normal, 400);
    padding: 10px 12px;
    min-height: 40px;
    border-bottom: none;
    color: var(--text-secondary, #4B5563);
}

.mobile-menu-sub a:hover,
.mobile-menu-sub a:active {
    color: var(--primary);
    background: var(--primary-soft, rgba(57, 97, 120, 0.06));
}

.mobile-menu-label {
    display: block;
    font-size: 0.7rem;
    font-weight: var(--font-weight-semibold, 600);
    color: var(--text-muted, #9CA3AF);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    padding: 12px 12px 4px;
    margin-top: 4px;
}

.mobile-menu-label:first-child {
    margin-top: 0;
    padding-top: 8px;
}

.mobile-menu-viewall {
    font-weight: var(--font-weight-semibold, 600) !important;
    color: var(--primary) !important;
    margin-top: 4px;
    border-top: 1px solid var(--border-subtle) !important;
    padding-top: 12px !important;
}

/* ── Menu Footer ── */
.mobile-menu-footer {
    margin-top: auto;
    padding-top: var(--space-6);
}

/* ==========================================================================
   13. EMERGENCY BANNER
   ========================================================================== */
.emergency-banner {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background-color: var(--error, #ef4444);
    color: white;
    padding: var(--space-2) var(--space-8);
    display: none;
    align-items: center;
    justify-content: center;
    gap: var(--space-3);
    z-index: 1000;
    font-size: var(--text-sm);
    font-weight: var(--font-weight-medium);
}

.emergency-banner.show {
    display: flex;
    animation: slideDown 0.3s ease-out;
}

@keyframes slideDown {
    from {
        transform: translateY(-100%);
    }

    to {
        transform: translateY(0);
    }
}

.emergency-pulse {
    width: 8px;
    height: 8px;
    background: white;
    border-radius: 50%;
    animation: emergencyPing 1.5s cubic-bezier(0, 0, 0.2, 1) infinite;
}

@keyframes emergencyPing {

    75%,
    100% {
        transform: scale(2.5);
        opacity: 0;
    }
}

.emergency-close {
    background: transparent;
    border: none;
    color: white;
    cursor: pointer;
    position: absolute;
    right: var(--space-4);
    min-width: 44px;
    min-height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* ==========================================================================
   14. SERVICE MODAL
   ========================================================================== */
.service-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(10px);
    z-index: 2000;
    display: none;
    align-items: center;
    justify-content: center;
    padding: var(--space-4);
}

.service-modal-overlay.open {
    display: flex;
    animation: fadeIn 0.3s forwards;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.service-modal {
    background: var(--bg-card);
    border: 1px solid var(--border-medium);
    border-radius: var(--radius-xl);
    width: 100%;
    max-width: 500px;
    padding: var(--space-8);
    position: relative;
    box-shadow: var(--shadow-xl);
    transform: scale(0.95);
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.service-modal-overlay.open .service-modal {
    transform: scale(1);
}

.service-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--space-4);
}

.service-modal-close {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    min-width: 44px;
    min-height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.service-modal-close:hover {
    color: var(--text-primary);
}

.service-modal-desc {
    color: var(--text-secondary);
    margin-bottom: var(--space-6);
    line-height: 1.6;
}

.service-features {
    margin-bottom: var(--space-6);
}

.service-features ul {
    padding: 0;
    list-style: none;
}

.service-features li {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    margin-bottom: var(--space-2);
    color: var(--text-primary);
}

.service-features li::before {
    content: "";
    display: inline-block;
    width: 14px;
    height: 14px;
    margin-right: 6px;
    vertical-align: middle;
    background-color: var(--primary);
    -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 6 9 17l-5-5'/%3E%3C/svg%3E") center/contain no-repeat;
    mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 6 9 17l-5-5'/%3E%3C/svg%3E") center/contain no-repeat;
}

/* ==========================================================================
   15. AI VOICE RECEPTIONIST (Futuristic UI)
   ========================================================================== */
@property --fab-angle {
    syntax: '<angle>';
    initial-value: 0deg;
    inherits: false;
}

.voice-fab {
    position: fixed;
    bottom: var(--space-6);
    right: var(--space-6);
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: conic-gradient(
        from var(--fab-angle),
        #396178,
        #4a8fa8,
        #6b3a5c,
        #c23d5e,
        #dc2626,
        #c23d5e,
        #6b3a5c,
        #4a8fa8,
        #396178
    );
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow:
        0 0 20px rgba(57, 97, 120, 0.3),
        0 0 40px rgba(194, 61, 94, 0.15);
    z-index: 1000;
    border: none;
    cursor: pointer;
    transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275), box-shadow 0.4s;
    animation: fabSpin 16s linear infinite, fabGlowPulse 3s ease-in-out infinite;
}

@keyframes fabSpin {
    to { --fab-angle: 360deg; }
}

@keyframes fabGlowPulse {
    0%, 100% { box-shadow: 0 0 20px rgba(57, 97, 120, 0.3), 0 0 40px rgba(194, 61, 94, 0.15); }
    50% { box-shadow: 0 0 30px rgba(57, 97, 120, 0.45), 0 0 60px rgba(220, 38, 38, 0.25), 0 0 90px rgba(57, 97, 120, 0.1); }
}

.voice-fab:hover {
    transform: scale(1.1) translateY(-4px);
    box-shadow:
        0 0 35px rgba(57, 97, 120, 0.5),
        0 0 70px rgba(220, 38, 38, 0.3);
}

.voice-fab-inner {
    position: relative;
    z-index: 2;
    display: flex;
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.3));
}

.voice-fab-ring {
    position: absolute;
    top: -5px;
    left: -5px;
    right: -5px;
    bottom: -5px;
    border-radius: 50%;
    border: 1px dashed rgba(255, 255, 255, 0.25);
    animation: fabRingRotate 20s linear infinite;
}

@keyframes fabRingRotate {
    to { transform: rotate(360deg); }
}

.voice-fab:hover .voice-fab-ring {
    border-color: rgba(255, 255, 255, 0.5);
}

/* Radiating glow pulse rings */
.voice-fab::before {
    content: '';
    position: absolute;
    inset: -3px;
    border-radius: 50%;
    background: conic-gradient(
        from var(--fab-angle),
        rgba(57, 97, 120, 0.2),
        rgba(194, 61, 94, 0.15),
        rgba(220, 38, 38, 0.2),
        rgba(194, 61, 94, 0.15),
        rgba(57, 97, 120, 0.2)
    );
    filter: blur(8px);
    z-index: -1;
    animation: fabSpin 16s linear infinite, fabOuterPulse 3s ease-in-out infinite;
}

@keyframes fabOuterPulse {
    0%, 100% { inset: -3px; opacity: 0.6; }
    50% { inset: -10px; opacity: 1; }
}

.voice-panel {
    position: fixed;
    bottom: calc(var(--space-24) + 10px);
    right: var(--space-6);
    width: 380px;
    max-height: calc(100vh - 120px);
    background: #0e0e11;
    backdrop-filter: blur(32px) saturate(180%);
    -webkit-backdrop-filter: blur(32px) saturate(180%);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 24px;
    box-shadow: 0 30px 60px rgba(0, 0, 0, 0.7), 0 0 0 1px rgba(255,255,255,0.05);
    z-index: 1001;
    display: none;
    flex-direction: column;
    overflow: hidden;
    transform-origin: bottom right;
    transform: scale(0.9) translateY(20px);
    opacity: 0;
    transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.4s;
    color: #fff;
}

.voice-panel.open {
    display: flex;
    transform: scale(1) translateY(0);
    opacity: 1;
}

.voice-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px 14px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(255, 255, 255, 0.02);
    flex-shrink: 0;
}

.voice-header-left {
    display: flex;
    align-items: center;
    gap: 12px;
}

.voice-avatar {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary, #3b82f6), var(--tertiary, #8b5cf6));
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    flex-shrink: 0;
}

.voice-header-title h4 {
    margin: 0;
    font-size: 15px;
    font-weight: 600;
    letter-spacing: -0.01em;
    color: #fff;
    line-height: 1.3;
}

.voice-header-role {
    font-weight: 400;
    color: rgba(255, 255, 255, 0.5);
    font-size: 13px;
}

.voice-live-badge {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: #10b981;
    margin-top: 2px;
}

.voice-live-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #10b981;
    animation: pulseLive 2s infinite;
}

@keyframes pulseLive {
    0% {
        box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.4);
    }

    70% {
        box-shadow: 0 0 0 6px rgba(16, 185, 129, 0);
    }

    100% {
        box-shadow: 0 0 0 0 rgba(16, 185, 129, 0);
    }
}

.voice-close {
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.08);
    width: 44px;
    height: 44px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: rgba(255, 255, 255, 0.5);
    cursor: pointer;
    transition: all 0.2s;
    padding: 0;
    flex-shrink: 0;
}

.voice-close:hover {
    background: rgba(255, 255, 255, 0.12);
    color: #fff;
    transform: rotate(90deg);
}

.voice-orb-container {
    padding: 32px 24px 24px;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    position: relative;
    overflow: hidden;
    flex: 1;
    min-height: 0;
}

/* Subtle ambient background glow in the container */
.voice-orb-container::before {
    content: '';
    position: absolute;
    top: 10%;
    left: 50%;
    transform: translateX(-50%);
    width: 200px;
    height: 200px;
    background: var(--primary);
    filter: blur(120px);
    opacity: 0.15;
    border-radius: 50%;
    pointer-events: none;
    transition: opacity 0.5s, background 0.5s;
}

.voice-orb-wrapper:has(.active)~* .voice-orb-container::before {
    opacity: 0.3;
    background: var(--tertiary);
}

.voice-orb-wrapper {
    position: relative;
    width: 120px;
    height: 120px;
    margin-bottom: var(--space-6);
    cursor: pointer;
}

/* ── Smooth Orb Rotation via @property ── */
@property --popup-orb-angle {
    syntax: '<angle>';
    initial-value: 0deg;
    inherits: false;
}

/* The Orb itself — new conic-gradient design */
.voice-orb {
    position: absolute;
    inset: 0;
    border-radius: 50%;
    background: conic-gradient(
        from var(--popup-orb-angle),
        #396178,
        #4a8fa8,
        #6b3a5c,
        #c23d5e,
        #dc2626,
        #c23d5e,
        #6b3a5c,
        #4a8fa8,
        #396178
    );
    box-shadow:
        0 0 40px rgba(57, 97, 120, 0.35),
        0 0 80px rgba(194, 61, 94, 0.2),
        inset 0 0 30px rgba(255, 255, 255, 0.08);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275), box-shadow 0.3s ease;
    overflow: hidden;
    z-index: 10;
    animation:
        popupOrbSpin 11s linear infinite,
        popupOrbBreath 3.7s ease-in-out infinite,
        popupOrbWobble 7.3s ease-in-out infinite;
}

@keyframes popupOrbSpin {
    to { --popup-orb-angle: 360deg; }
}

@keyframes popupOrbBreath {
    0%, 100% { box-shadow: 0 0 35px rgba(57, 97, 120, 0.3), 0 0 70px rgba(194, 61, 94, 0.15), inset 0 0 25px rgba(255, 255, 255, 0.06); }
    50% { box-shadow: 0 0 55px rgba(57, 97, 120, 0.5), 0 0 95px rgba(220, 38, 38, 0.3), inset 0 0 35px rgba(255, 255, 255, 0.12); }
}

@keyframes popupOrbWobble {
    0%, 100% { transform: scale(1); }
    30% { transform: scale(1.03); }
    60% { transform: scale(0.98); }
    80% { transform: scale(1.01); }
}

.voice-orb-wrapper:hover .voice-orb {
    transform: scale(1.05);
    box-shadow:
        0 0 55px rgba(57, 97, 120, 0.5),
        0 0 90px rgba(220, 38, 38, 0.28),
        inset 0 0 40px rgba(255, 255, 255, 0.15);
}

/* The dynamic rotating gradient inside the orb (kept for backwards compat, now subtle) */
.voice-orb-gradient {
    position: absolute;
    inset: -50%;
    background: conic-gradient(from 0deg, var(--primary), var(--tertiary), var(--secondary), var(--primary));
    animation: spinRing 8s linear infinite;
    opacity: 0;
    filter: blur(8px);
    mix-blend-mode: screen;
    transition: opacity 0.4s;
}

/* Glass overlay — wandering specular highlight */
.voice-orb-glass {
    position: absolute;
    inset: 3px;
    background:
        radial-gradient(circle at 30% 25%, rgba(255,255,255,0.22), transparent 45%),
        radial-gradient(circle at 70% 75%, rgba(194, 61, 94, 0.06), transparent 50%);
    border-radius: 50%;
    z-index: 2;
    pointer-events: none;
    animation: popupOrbHighlight 13s ease-in-out infinite;
}

@keyframes popupOrbHighlight {
    0%, 100% { background: radial-gradient(circle at 30% 25%, rgba(255,255,255,0.22), transparent 45%), radial-gradient(circle at 70% 75%, rgba(194, 61, 94, 0.06), transparent 50%); }
    25% { background: radial-gradient(circle at 60% 20%, rgba(255,255,255,0.28), transparent 45%), radial-gradient(circle at 30% 80%, rgba(57, 97, 120, 0.08), transparent 50%); }
    50% { background: radial-gradient(circle at 70% 50%, rgba(255,255,255,0.18), transparent 45%), radial-gradient(circle at 20% 40%, rgba(194, 61, 94, 0.08), transparent 50%); }
    75% { background: radial-gradient(circle at 40% 70%, rgba(255,255,255,0.24), transparent 45%), radial-gradient(circle at 65% 25%, rgba(57, 97, 120, 0.06), transparent 50%); }
}

.voice-orb-icon {
    position: relative;
    z-index: 3;
    transition: transform 0.3s;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.3));
}

/* Expansion Rings — dashed futuristic style matching contact page orb */
.voice-orb-ring {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    border-radius: 50%;
    border: 1px dashed rgba(57, 97, 120, 0.25);
    opacity: 0.2;
    z-index: 1;
    pointer-events: none;
}

.voice-orb-ring.ring-1 {
    width: 130%;
    height: 130%;
    animation: popupRingRotate 25s linear infinite;
}

.voice-orb-ring.ring-2 {
    width: 150%;
    height: 150%;
    border-color: rgba(194, 61, 94, 0.15);
    animation: popupRingRotate 35s linear infinite reverse;
}

@keyframes popupRingRotate {
    to { transform: translate(-50%, -50%) rotate(360deg); }
}

/* Active State (Listening/Speaking) */
.voice-orb.listening,
.voice-orb.speaking,
.voice-orb.processing {
    box-shadow:
        0 0 60px rgba(57, 97, 120, 0.5),
        0 0 100px rgba(220, 38, 38, 0.25),
        inset 0 0 40px rgba(255, 255, 255, 0.15);
    animation:
        popupOrbSpin 4s linear infinite,
        popupOrbBreath 2s ease-in-out infinite,
        popupOrbWobble 3s ease-in-out infinite;
}

.voice-orb.listening .voice-orb-gradient,
.voice-orb.speaking .voice-orb-gradient,
.voice-orb.processing .voice-orb-gradient {
    opacity: 0;
}

.voice-orb.listening~.voice-orb-icon,
.voice-orb.speaking~.voice-orb-icon,
.voice-orb.processing~.voice-orb-icon {
    transform: scale(1.15);
}

.voice-orb-wrapper:has(.listening) .ring-1,
.voice-orb-wrapper:has(.speaking) .ring-1,
.voice-orb-wrapper:has(.processing) .ring-1 {
    width: 100%;
    height: 100%;
    animation: rippleWave 1.5s cubic-bezier(0.2, 0, 0.2, 1) infinite;
}

.voice-orb-wrapper:has(.listening) .ring-2,
.voice-orb-wrapper:has(.speaking) .ring-2,
.voice-orb-wrapper:has(.processing) .ring-2 {
    width: 100%;
    height: 100%;
    animation: rippleWave 1.5s cubic-bezier(0.2, 0, 0.2, 1) infinite 0.75s;
}

@keyframes spinRing {
    100% {
        transform: rotate(360deg);
    }
}

@keyframes rippleWave {
    0% {
        transform: translate(-50%, -50%) scale(1);
        opacity: 0.6;
        border-width: 2px;
    }

    100% {
        transform: translate(-50%, -50%) scale(2.5);
        opacity: 0;
        border-width: 0px;
        box-shadow: inset 0 0 20px var(--primary-glow);
    }
}

.voice-status-text {
    display: block;
    font-weight: 600;
    font-size: 18px;
    margin-bottom: 6px;
    color: #fff;
    letter-spacing: -0.02em;
}

.voice-status-sub {
    color: rgba(255, 255, 255, 0.5);
    font-size: 13px;
    line-height: 1.5;
    max-width: 260px;
    margin: 0 auto;
}

.voice-transcript {
    margin-top: 20px;
    font-size: 13px;
    color: rgba(255, 255, 255, 0.85);
    max-height: 140px;
    overflow-y: auto;
    width: 100%;
    text-align: left;
    scrollbar-width: thin;
    scrollbar-color: rgba(255,255,255,0.15) transparent;
}

.voice-transcript-line {
    padding: 6px 12px;
    border-radius: 10px;
    margin-bottom: 6px;
    line-height: 1.4;
}

.voice-transcript-line.user {
    background: rgba(255, 255, 255, 0.08);
    color: #fff;
}

.voice-transcript-line.assistant {
    background: rgba(var(--primary-rgb, 59, 130, 246), 0.15);
    color: rgba(255, 255, 255, 0.9);
}

.voice-transcript-line.system {
    color: rgba(255, 255, 255, 0.4);
    font-style: italic;
    font-size: 12px;
    padding: 4px 12px;
}

.voice-fallback {
    padding: 12px 16px;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
    display: flex;
    gap: 8px;
    background: rgba(0, 0, 0, 0.25);
}

.voice-fallback input {
    flex-grow: 1;
    min-width: 0;
    background: rgba(255, 255, 255, 0.06);
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    padding: 10px 16px;
    font-size: 16px; /* >=16px prevents iOS auto-zoom on focus */
    transition: border-color 0.2s, background 0.2s;
}

.voice-fallback input:focus {
    outline: none;
    border-color: var(--primary, #3b82f6);
    background: rgba(255, 255, 255, 0.1);
}

.voice-fallback input::placeholder {
    color: rgba(255, 255, 255, 0.3);
}

.voice-fallback-send {
    background: linear-gradient(135deg, var(--primary, #3b82f6), var(--tertiary, #8b5cf6));
    color: white;
    border: none;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    padding: 0;
    flex-shrink: 0;
}

.voice-fallback-send:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 15px rgba(59, 130, 246, 0.3);
}

/* Voice-First UI: Keyboard Fallback Toggle */
.voice-keyboard-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 16px;
    color: rgba(255, 255, 255, 0.35);
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-weight: 600;
    cursor: pointer;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
    background: rgba(0, 0, 0, 0.15);
    transition: all 0.2s;
    flex-shrink: 0;
}

.voice-keyboard-toggle:hover {
    color: rgba(255, 255, 255, 0.7);
    background: rgba(0, 0, 0, 0.25);
}

.voice-fallback-container {
    max-height: 0;
    overflow: hidden;
    opacity: 0;
    transition: max-height 0.3s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.3s;
    flex-shrink: 0;
}

.voice-fallback-container.show {
    max-height: 100px;
    opacity: 1;
}

/* ── Desktop FAB Label ── */
.voice-fab-label {
    position: absolute;
    right: calc(100% + 12px);
    top: 50%;
    transform: translateY(-50%);
    background: var(--bg-card);
    color: var(--text-primary);
    font-size: 13px;
    font-weight: 600;
    padding: 8px 14px;
    border-radius: 10px;
    white-space: nowrap;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    border: 1px solid var(--border-medium);
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.voice-fab-label::after {
    content: '';
    position: absolute;
    right: -6px;
    top: 50%;
    transform: translateY(-50%) rotate(45deg);
    width: 10px;
    height: 10px;
    background: var(--bg-card);
    border-right: 1px solid var(--border-medium);
    border-bottom: 1px solid var(--border-medium);
}

.voice-fab:hover .voice-fab-label {
    opacity: 1;
}

/* Desktop: larger FAB */
@media (min-width: 769px) {
    .voice-fab {
        width: 72px;
        height: 72px;
    }

    .voice-fab svg {
        width: 28px;
        height: 28px;
    }

    /* Radiating wave pulse every 4s */
    .voice-fab::after {
        content: '';
        position: absolute;
        inset: 0;
        border-radius: 50%;
        border: 2px solid rgba(194, 61, 94, 0.4);
        z-index: -2;
        animation: fabWavePulse 4s ease-out infinite;
    }
}

@keyframes fabWavePulse {
    0% { transform: scale(1); opacity: 0.6; }
    60% { transform: scale(2); opacity: 0; }
    100% { transform: scale(2); opacity: 0; }
}

/* ── Mobile Sticky Bottom Bar ── */
.voice-sticky-bar {
    display: none; /* Hidden on desktop */
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 999;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
}

.voice-sticky-inner {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    background: linear-gradient(135deg, var(--primary), var(--tertiary));
    color: white;
    box-shadow: 0 -4px 24px rgba(0, 0, 0, 0.3);
}

.voice-sticky-orb {
    flex-shrink: 0;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    animation: stickyPulse 2.5s ease-in-out infinite;
}

@keyframes stickyPulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(255, 255, 255, 0.3); }
    50% { box-shadow: 0 0 0 8px rgba(255, 255, 255, 0); }
}

.voice-sticky-text {
    flex: 1;
    min-width: 0;
}

.voice-sticky-title {
    display: block;
    font-size: 14px;
    font-weight: 700;
    letter-spacing: -0.01em;
    line-height: 1.2;
}

.voice-sticky-sub {
    display: block;
    font-size: 11px;
    opacity: 0.85;
    margin-top: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.voice-sticky-arrow {
    flex-shrink: 0;
    opacity: 0.7;
}

.voice-sticky-bar.hidden {
    display: none !important;
}

@media (max-width: 768px) {
    /* Show sticky bar, hide FAB on mobile */
    .voice-sticky-bar {
        display: block;
    }
    .voice-fab {
        display: none;
    }

    /* Voice panel adjustments when sticky bar is present */
    .voice-panel {
        bottom: 72px;
    }

    /* Footer needs bottom padding to not be hidden behind sticky bar */
    .footer {
        padding-bottom: calc(var(--space-8) + 64px);
    }
}

/* ── AI Gradient Button (for mobile menu CTA) ── */
.btn-ai-gradient {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 24px;
    background: linear-gradient(135deg, var(--primary), var(--tertiary));
    color: white;
    border: none;
    border-radius: var(--radius-md, 8px);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    min-height: 48px;
    transition: transform 0.2s, box-shadow 0.2s;
    -webkit-tap-highlight-color: transparent;
}

.btn-ai-gradient:hover {
    transform: translateY(-1px);
    box-shadow: 0 8px 24px rgba(57, 97, 120, 0.3);
}

/* ==========================================================================
   16. CUSTOMIZER PANEL (For Myna AI Studio)
   ========================================================================== */
.customizer-backdrop {
    display: none;
}

.customizer-trigger {
    display: none;
}

/* Only shown inside builder via studio-bridge, or if configured */
body[data-builder="true"] .customizer-trigger {
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: var(--bg-surface);
    border: 1px solid var(--border-subtle);
    color: var(--text-primary);
    transition: all 0.2s;
}

body[data-builder="true"] .customizer-trigger:hover {
    background: var(--bg-card);
    border-color: var(--border-medium);
}

.customizer-panel {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    width: 340px;
    background: var(--bg-card);
    border-left: 1px solid var(--border-medium);
    box-shadow: -10px 0 30px rgba(0, 0, 0, 0.5);
    z-index: 9999;
    transform: translateX(100%);
    transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    font-family: var(--font-fallback, sans-serif);
}

.customizer-panel.open {
    transform: translateX(0);
}

.customizer-panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    border-bottom: 1px solid var(--border-subtle);
}

.customizer-panel-header h3 {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
}

.customizer-close {
    background: none;
    border: none;
    font-size: 24px;
    color: var(--text-secondary);
    cursor: pointer;
    line-height: 1;
    min-width: 44px;
    min-height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.customizer-section {
    border-bottom: 1px solid var(--border-subtle);
}

.customizer-section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    cursor: pointer;
    background: var(--bg-elevated);
    transition: background 0.2s;
}

.customizer-section-header:hover {
    background: var(--bg-surface);
}

.customizer-section-header h4 {
    margin: 0;
    font-size: 14px;
    font-weight: 500;
}

.customizer-section-header .chevron {
    width: 16px;
    height: 16px;
    transition: transform 0.2s;
}

.customizer-section.collapsed .customizer-section-header .chevron {
    transform: rotate(-90deg);
}

.customizer-section-body {
    padding: 20px;
    display: grid;
    gap: 12px;
}

.customizer-section.collapsed .customizer-section-body {
    display: none;
}

.theme-option {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    background: var(--bg-surface);
    border: 1px solid var(--border-subtle);
    border-radius: 8px;
    color: var(--text-primary);
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s;
    width: 100%;
    text-align: left;
}

.theme-option:hover {
    border-color: var(--border-medium);
    background: var(--bg-elevated);
}

.theme-option.active {
    border-color: var(--primary);
    background: var(--primary-soft);
}

.theme-swatches {
    display: flex;
    border-radius: 50%;
    overflow: hidden;
    width: 24px;
    height: 24px;
    border: 1px solid var(--border-subtle);
}

.theme-swatch {
    flex: 1;
    height: 100%;
}

@media (max-width: 640px) {
    .customizer-panel {
        width: 100%;
    }
}

/* ==========================================================================
   REVIEWS CAROUSEL
   ========================================================================== */

.reviews-track-container {
    width: 100%;
    overflow: hidden;
    position: relative;
    padding: 1rem 0;
    mask-image: linear-gradient(to right, transparent, black 5%, black 95%, transparent);
    -webkit-mask-image: linear-gradient(to right, transparent, black 10%, black 90%, transparent);
}

.reviews-track {
    display: flex;
    align-items: stretch;
    gap: var(--space-6);
    overflow-x: auto;
    scrollbar-width: none;
    /* Firefox */
    -ms-overflow-style: none;
    /* Internet Explorer 10+ */
    padding-top: var(--space-8);
    padding-bottom: var(--space-8);
}

.reviews-track::-webkit-scrollbar {
    display: none;
    /* Safari and Chrome */
}

.review-card {
    position: relative;
    overflow: hidden;
    flex: 0 0 350px;
    min-width: 300px;
    height: auto;
    align-self: stretch;
    background: rgba(var(--bg-card-rgb, 255, 255, 255), 0.7);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--border-medium);
    border-radius: var(--radius-xl);
    padding: var(--space-6);
    display: flex;
    flex-direction: column;
    gap: var(--space-4);
    transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275), border-color 0.4s ease, box-shadow 0.4s ease;
    box-shadow: var(--shadow-sm);
    /* Subtle jiggle effect as they move */
    animation: floating-jiggle 4s ease-in-out infinite alternate;
}

/* Stagger the jiggle so they don't all move identically */
.review-card:nth-child(even) {
    animation-delay: -2s;
}

@keyframes floating-jiggle {
    0% {
        transform: translateY(0px);
    }

    100% {
        transform: translateY(-4px);
    }
}

/* Premium Mouse-Tracking Spotlight via JS variables */
.review-card-spotlight {
    position: absolute;
    inset: 0;
    opacity: 0;
    transition: opacity 0.5s ease;
    background: radial-gradient(800px circle at var(--mouse-x, center) var(--mouse-y, center), rgba(var(--primary-rgb), 0.12), transparent 40%);
    pointer-events: none;
    z-index: 0;
    border-radius: inherit;
}

.review-card:hover .review-card-spotlight {
    opacity: 1;
}

.review-card:hover {
    transform: translateY(-8px) scale(1.02);
    border-color: rgba(var(--primary-rgb), 0.6);
    box-shadow: 0 10px 40px -10px var(--primary-glow), 0 0 20px rgba(var(--primary-rgb), 0.4);
    /* Pause jiggle gracefully on hover */
    animation-play-state: paused;
}

.review-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
}

.review-author {
    font-weight: 600;
    color: var(--text-primary);
    font-size: var(--text-lg);
}

.review-date {
    font-size: var(--text-sm);
    color: var(--text-secondary);
}

.review-stars {
    display: flex;
    gap: 2px;
    color: var(--primary);
    /* Theme Color */
}

.review-text {
    color: var(--text-secondary);
    font-size: var(--text-base);
    line-height: var(--line-height-relaxed);
    flex-grow: 1;
}

.carousel-control {
    background: var(--bg-elevated);
    border: 1px solid var(--border-medium);
    color: var(--text-primary);
    width: 48px;
    height: 48px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
}

.carousel-control:hover {
    background: var(--bg-surface);
    border-color: var(--primary);
    color: var(--primary);
    transform: scale(1.05);
}

.carousel-control:active {
    transform: scale(0.95);
}

@media (max-width: 768px) {
    .review-card {
        flex: 0 0 85vw;
    }

    .reviews-track-container {
        mask-image: linear-gradient(to right, transparent, black 2%, black 98%, transparent);
        -webkit-mask-image: linear-gradient(to right, transparent, black 2%, black 98%, transparent);
    }

    .reviews-track {
        padding-left: var(--container-padding, 1rem);
        padding-right: var(--container-padding, 1rem);
        scroll-snap-type: x mandatory;
    }

    .reviews-track .review-card {
        scroll-snap-align: center;
    }
}

/* ==========================================================================
   MOBILE-FIRST OVERRIDES
   Global responsive adjustments for phones and small tablets.
   These override CSS variables and component styles for mobile viewports.
   ========================================================================== */

/* ── Tap & Touch Behavior ────────────────────────────── */
*,
*::before,
*::after {
    -webkit-tap-highlight-color: transparent;
}

/* Prevent iOS zoom on input focus (font-size ≥ 16px) */
@media (max-width: 768px) {
    input,
    textarea,
    select {
        font-size: max(16px, var(--text-base));
    }
}

/* ── Anchor Scroll Offset (clears fixed nav) ────────── */
html {
    scroll-padding-top: calc(var(--nav-height, 72px) + 16px);
}

/* ── Tablet Breakpoint (≤1024px) ────────────────────── */
@media (max-width: 1024px) {
    :root {
        --nav-height: 72px;
        --container-padding: 1.5rem;
    }
}

/* ── Mobile Breakpoint (≤768px) ─────────────────────── */
@media (max-width: 768px) {
    :root {
        --nav-height: 64px;
        --container-padding: 1rem;
        --space-section: clamp(2.5rem, 6vw, 5rem);
        --text-6xl: clamp(2.25rem, 1.8rem + 4vw, 3.75rem);
        --text-5xl: clamp(1.875rem, 1.5rem + 3vw, 3rem);
    }

    /* Nav logo sizing for mobile */
    .nav-logo img {
        max-height: 48px;
        padding-top: 4px;
        padding-bottom: 4px;
    }

    /* Mobile menu uses header with close button — no extra top padding needed */

    /* Voice panel: full-width on mobile */
    .voice-panel {
        left: var(--space-3);
        right: var(--space-3);
        bottom: calc(var(--space-16) + 10px);
        width: auto;
    }

    /* Ensure small buttons meet 44px touch target */
    .btn-sm {
        min-height: 44px;
        padding: 0.625rem 1rem;
    }

    /* Nav: show phone number below logo row on mobile */
    .nav {
        --nav-height: auto;
        min-height: 64px;
    }

    .nav-inner {
        flex-wrap: wrap;
        height: auto;
        padding-top: 6px;
        padding-bottom: 0;
    }

    /* Phone: full-width row below logo+hamburger */
    .nav-right .nav-phone {
        display: inline-flex !important;
        position: absolute;
        bottom: 0;
        left: 0;
        right: 0;
        justify-content: center;
        padding: 4px 0;
        font-size: 0.8125rem;
        background: var(--bg-surface);
        border-top: 1px solid var(--border-subtle);
    }

    .nav-inner {
        position: relative;
        padding-bottom: 28px;
    }

    /* Pre-approval / "Why Work With a Broker?" banner: single-col + less padding */
    #financing-banner > .grid {
        grid-template-columns: 1fr !important;
        padding: 2rem 1rem !important;
        gap: 2rem !important;
    }

    /* Reduce inner card padding on mobile */
    #financing-banner > .grid > .card-glass {
        padding: 1.5rem 1rem !important;
    }

    /* Hide floating badge on mobile (overlaps content) */
    #pre-approved-badge {
        display: none;
    }

    /* Disable hover transforms on touch (cards, buttons) */
    .card-glass:hover {
        transform: none;
    }

    /* Service modal: full width on mobile */
    .service-modal {
        width: calc(100vw - 2rem);
        max-height: calc(100vh - 4rem);
        margin: 2rem auto;
        padding: var(--space-6) var(--space-4);
    }

    /* Emergency banner: stack text and close button */
    .emergency-banner {
        flex-direction: column;
        text-align: center;
        gap: var(--space-2);
        padding: var(--space-3) var(--space-4);
    }
}

/* ── Small Phone Breakpoint (≤480px) ────────────────── */
@media (max-width: 480px) {
    :root {
        --text-6xl: clamp(1.875rem, 1.4rem + 3.5vw, 2.75rem);
        --text-5xl: clamp(1.5rem, 1.2rem + 2.5vw, 2.25rem);
        --text-4xl: clamp(1.5rem, 1.25rem + 2vw, 2rem);
    }

    /* Tighter container on very small screens */
    :root {
        --container-padding: 0.875rem;
    }
}

/* ── Safe Area Insets (iPhone notch & home indicator) ── */
@supports (padding: env(safe-area-inset-bottom)) {
    .nav {
        padding-left: env(safe-area-inset-left);
        padding-right: env(safe-area-inset-right);
    }

    .mobile-menu {
        padding-bottom: calc(var(--space-6) + env(safe-area-inset-bottom));
    }

    .voice-fab {
        bottom: calc(var(--space-6) + env(safe-area-inset-bottom));
    }

    .voice-sticky-bar .voice-sticky-inner {
        padding-bottom: calc(12px + env(safe-area-inset-bottom));
    }

    .footer {
        padding-bottom: calc(var(--space-8) + env(safe-area-inset-bottom));
    }
}

/* ==========================================================================
   ACCESSIBILITY: Reduced Motion
   ========================================================================== */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }

    .hamburger span {
        transition: none;
    }

    .voice-close:hover {
        transform: none;
    }

    .voice-orb,
    .voice-orb::before,
    .voice-orb::after {
        animation: none;
    }

    .hero-float {
        animation: none;
    }

    .scroll-reveal {
        opacity: 1 !important;
        transform: none !important;
    }
}