/* ============================================================
   FileConvert Pro — Mobile-Native UI
   All rules scoped to ≤ 768px (plus base hides for mobile-only elements).
   Desktop (> 768px) is NEVER affected.
   ============================================================ */

/* ============================================================
   DESKTOP: Hide mobile-only elements
   ============================================================ */
.hamburger-btn {
    display: none;
}

.mobile-menu {
    display: none;
}

.mobile-menu-close-row {
    display: none;
}

/* Desktop Restoration: Hide mobile-only elements that might leak via JS */
@media (min-width: 769px) {

    .mobile-recent-tools,
    .mobile-search-container,
    .mobile-category-tabs,
    .hamburger-btn,
    .mobile-menu,
    .mobile-menu-backdrop,
    .mobile-bottom-nav {
        display: none !important;
    }
}


.mobile-bottom-nav {
    display: none;
}

.mobile-search-container {
    display: none;
}

.mobile-recent-tools {
    display: none;
}

.mobile-menu-backdrop {
    display: none;
}

/* ============================================================
   KEYFRAMES (shared)
   ============================================================ */
@keyframes slideUpSheet {
    from {
        transform: translateY(100%);
        opacity: 0;
    }

    to {
        transform: translateY(0);
        opacity: 1;
    }
}

@keyframes catTabIn {
    from {
        opacity: 0;
        transform: translateY(6px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ============================================================
   GLOBAL MOBILE BASE (≤ 768px)
   ============================================================ */
@media (max-width: 768px) {

    /* Eliminate 300ms tap delay on all interactive elements */
    *,
    *::before,
    *::after {
        touch-action: manipulation;
    }

    body,
    html {
        overflow-x: hidden !important;
        width: 100% !important;
        max-width: 100vw !important;
        /* Extra bottom padding so content is not hidden behind bottom nav */
        scroll-padding-bottom: 70px;
        position: relative;
    }

    section,
    header,
    footer,
    main {
        max-width: 100vw !important;
        width: 100% !important;
        overflow-x: hidden !important;
        box-sizing: border-box !important;
        padding-left: 0 !important;
        padding-right: 0 !important;
    }

    .container {
        max-width: 100vw !important;
        width: 100% !important;
        overflow-x: hidden !important;
        padding-left: 1rem !important;
        padding-right: 1rem !important;
        box-sizing: border-box !important;
        margin: 0 auto !important;
    }

    .logo {
        margin-left: 0 !important;
        justify-content: flex-start !important;
    }

    /* Prevent iOS auto-zoom on inputs */
    input,
    select,
    textarea {
        font-size: 16px !important;
    }
}

/* ============================================================
   FIX — Hero: Compact, Action-First
   ============================================================ */
@media (max-width: 768px) {

    .hero {
        padding: 40px 0 20px !important;
        min-height: unset !important;
        text-align: center;
    }

    .hero-title {
        font-size: clamp(2rem, 9vw, 2.5rem) !important;
        margin-bottom: 1rem !important;
        line-height: 1.15 !important;
        font-weight: 800 !important;
        word-break: break-word !important;
        max-width: 100% !important;
    }

    .hero-subtitle {
        font-size: clamp(0.9rem, 4vw, 1.1rem) !important;
        margin-bottom: 2rem !important;
        display: block !important;
        max-width: 100% !important;
        padding: 0 0.5rem;
        line-height: 1.5 !important;
        opacity: 0.9 !important;
    }

    .nav {
        display: none;
    }

    .header .container {
        position: relative;
        display: flex;
        justify-content: space-between;
        align-items: center;
        grid-template-columns: unset;
        min-height: 56px;
    }

    .logo {
        gap: 0.4rem !important;
        margin-left: 0 !important;
        display: flex !important;
        align-items: center !important;
    }

    .logo svg {
        width: 32px !important;
        height: 32px !important;
    }

    .logo span {
        font-size: 1rem !important;
    }

    .header-actions {
        display: none;
    }

    /* Hamburger button */
    .hamburger-btn {
        display: flex;
        align-items: center;
        justify-content: center;
        width: 38px;
        height: 38px;
        min-width: 38px;
        background: rgba(255, 255, 255, 0.05);
        border: 1px solid rgba(255, 255, 255, 0.1);
        border-radius: 8px;
        font-size: 1.1rem;
        cursor: pointer;
        color: var(--text-primary);
        transition: background 0.2s ease;
        -webkit-tap-highlight-color: transparent;
    }

    .hamburger-btn:active {
        background: rgba(58, 134, 255, 0.15);
    }

    /* Mobile dropdown — smooth opacity/transform animation */
    .mobile-menu {
        display: flex;
        flex-direction: column;
        width: 100%;
        position: fixed;
        top: 60px;
        left: 0;
        right: 0;
        bottom: 0;
        background: linear-gradient(160deg, rgba(8, 12, 28, 0.99), rgba(20, 35, 65, 0.99));
        backdrop-filter: blur(24px);
        -webkit-backdrop-filter: blur(24px);
        z-index: 1000;
        border-top: 1px solid rgba(255, 255, 255, 0.08);
        box-shadow: 0 12px 40px rgba(0, 0, 0, 0.5);
        overflow-y: auto;
        /* Smooth show/hide via opacity + transform */
        opacity: 0;
        visibility: hidden;
        transform: translateY(-20px);
        transition: opacity 0.3s cubic-bezier(0.4, 0, 0.2, 1),
                    transform 0.3s cubic-bezier(0.4, 0, 0.2, 1),
                    visibility 0.3s;
        will-change: transform, opacity;
    }

    .mobile-menu.open {
        opacity: 1;
        visibility: visible;
        transform: translateY(0);
    }

    /* Semi-transparent backdrop behind mobile menu */
    .mobile-menu-backdrop {
        display: none;
        position: fixed;
        inset: 0;
        background: rgba(0, 0, 0, 0.5);
        z-index: 999;
        opacity: 0;
        transition: opacity 0.3s ease;
    }

    .mobile-menu-backdrop.visible {
        display: block;
        opacity: 1;
    }

    .mobile-menu-close-row {
        display: flex;
        justify-content: flex-end;
        padding: 0.5rem 1rem 0;
    }

    .mobile-menu-close-btn {
        background: transparent;
        border: none;
        color: var(--text-muted);
        font-size: 1.1rem;
        cursor: pointer;
        min-width: 44px;
        min-height: 44px;
        display: flex;
        align-items: center;
        justify-content: center;
        border-radius: 8px;
        -webkit-tap-highlight-color: transparent;
    }

    .mobile-menu .mobile-nav-link {
        display: flex;
        align-items: center;
        padding: 1rem 1.5rem;
        font-size: 1rem;
        font-weight: 500;
        color: var(--text-secondary);
        text-decoration: none;
        border-bottom: 1px solid rgba(255, 255, 255, 0.05);
        transition: color 0.15s, background 0.15s;
        -webkit-tap-highlight-color: transparent;
    }

    .mobile-menu .mobile-nav-link:active {
        color: var(--text-primary);
        background: rgba(58, 134, 255, 0.1);
    }

    .mobile-menu .mobile-nav-link:last-child {
        border-bottom: none;
    }
}

/* ============================================================
   MOBILE SEARCH BAR
   ============================================================ */
@media (max-width: 768px) {
    .mobile-search-container {
        display: block;
        margin-bottom: 1.25rem;
        animation: catTabIn 0.35s ease;
    }

    .search-box {
        position: relative;
        display: flex;
        align-items: center;
        background: rgba(255, 255, 255, 0.05);
        border: 1.5px solid rgba(255, 255, 255, 0.1);
        border-radius: 14px;
        padding: 0 1rem;
        transition: all 0.2s ease;
    }

    /* Remove Mobile-only features for 1:1 parity with desktop as requested */
    .mobile-search-container,
    .mobile-recent-tools,
    .mobile-category-tabs {
        display: none !important;
    }
}

/* ============================================================
   MOBILE RECENTLY USED
   ============================================================ */
@media (max-width: 768px) {
    .mobile-recent-tools {
        display: block;
        margin-bottom: 1.5rem;
        animation: catTabIn 0.4s ease;
    }

    .recent-header {
        display: flex;
        justify-content: space-between;
        align-items: center;
        margin-bottom: 0.75rem;
        padding: 0 0.25rem;
    }

    .recent-title {
        font-size: 0.85rem;
        font-weight: 700;
        color: var(--text-secondary);
        text-transform: uppercase;
        letter-spacing: 0.05em;
    }

    .recent-clear {
        background: transparent;
        border: none;
        color: var(--text-muted);
        font-size: 0.75rem;
        font-weight: 500;
        cursor: pointer;
        padding: 4px 8px;
        border-radius: 4px;
    }

    .recent-clear:active {
        background: rgba(255, 255, 255, 0.05);
        color: var(--text-primary);
    }

    .recent-scroll {
        display: flex;
        gap: 0.75rem;
        overflow-x: auto;
        padding-bottom: 0.5rem;
        scrollbar-width: none;
        -webkit-overflow-scrolling: touch;
    }

    .recent-scroll::-webkit-scrollbar {
        display: none;
    }

    .recent-item {
        flex: 0 0 120px;
        background: rgba(255, 255, 255, 0.04);
        border: 1px solid rgba(255, 255, 255, 0.08);
        border-radius: 12px;
        padding: 0.85rem;
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 0.5rem;
        text-align: center;
        transition: transform 0.15s ease;
        -webkit-tap-highlight-color: transparent;
    }

    .recent-item:active {
        transform: scale(0.95);
        background: rgba(58, 134, 255, 0.08);
    }

    .recent-item svg {
        width: 32px;
        height: 32px;
        opacity: 0.9;
    }

    .recent-item span {
        font-size: 0.72rem;
        font-weight: 600;
        color: var(--text-primary);
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        width: 100%;
    }
}

/* ============================================================
   CATEGORY FILTER TABS
   ============================================================ */
@media (max-width: 768px) {

    .mobile-category-tabs {
        display: flex;
        gap: 0.5rem;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
        padding: 0.25rem 0 0.75rem;
        margin-bottom: 0.25rem;
        animation: catTabIn 0.3s ease;
    }

    .mobile-category-tabs::-webkit-scrollbar {
        display: none;
    }

    .cat-tab {
        flex-shrink: 0;
        padding: 0.45rem 1rem;
        border-radius: 999px;
        border: 1.5px solid rgba(255, 255, 255, 0.12);
        background: rgba(255, 255, 255, 0.04);
        color: var(--text-secondary);
        font-size: 0.82rem;
        font-weight: 600;
        cursor: pointer;
        white-space: nowrap;
        transition: all 0.18s ease;
        -webkit-tap-highlight-color: transparent;
        min-height: 36px;
        font-family: var(--font-primary);
    }

    .cat-tab:active {
        transform: scale(0.96);
    }

    .cat-tab.active {
        background: linear-gradient(135deg, rgba(58, 134, 255, 0.3), rgba(0, 212, 255, 0.2));
        border-color: rgba(58, 134, 255, 0.6);
        color: #fff;
        box-shadow: 0 0 12px rgba(58, 134, 255, 0.25);
    }

    /* Hidden card (filtered out) */
    .tool-card.cat-hidden {
        display: none !important;
    }
}

/* ============================================================
   2-COLUMN APP-ICON TOOL GRID
   ============================================================ */
@media (max-width: 768px) {

    .tools-grid {
        display: grid !important;
        grid-template-columns: 1fr 1fr !important;
        gap: 0.7rem !important;
        padding: 0 !important;
    }

    .tool-card {
        display: flex !important;
        flex-direction: column !important;
        align-items: center !important;
        justify-content: flex-start !important;
        text-align: center !important;
        padding: 0.8rem 0.25rem !important;
        gap: 0.35rem !important;
        border-radius: 12px !important;
        cursor: pointer;
        transition: transform 0.15s ease, box-shadow 0.15s ease !important;
        -webkit-tap-highlight-color: transparent;
        position: relative;
        overflow: hidden;
        min-width: 0 !important;
    }

    .tool-card:active {
        transform: scale(0.96) !important;
        box-shadow: 0 0 20px rgba(58, 134, 255, 0.2) !important;
    }

    /* Tap ripple */
    .tool-card::after {
        content: '';
        position: absolute;
        inset: 0;
        background: radial-gradient(circle, rgba(58, 134, 255, 0.15) 0%, transparent 70%);
        opacity: 0;
        transition: opacity 0.2s ease;
        pointer-events: none;
    }

    .tool-card:active::after {
        opacity: 1;
    }

    .tool-icon {
        width: 60px !important;
        height: 60px !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        margin-bottom: 0.25rem !important;
        flex-shrink: 0;
    }

    .search-box {
        position: relative;
        display: flex;
        align-items: center;
        justify-content: center !important;
    }

    .search-box svg {
        position: absolute;
        left: 1.2rem !important;
        width: 18px !important;
        height: 18px !important;
        z-index: 2;
    }

    .search-input {
        width: 100% !important;
        text-align: center !important;
        padding: 0.875rem !important;
        font-size: 0.95rem !important;
    }

    .tool-icon svg {
        width: 44px !important;
        height: 44px !important;
    }

    .tool-title {
        font-size: 0.9rem !important;
        font-weight: 700 !important;
        line-height: 1.2 !important;
        color: var(--text-primary) !important;
        margin: 0 !important;
        min-width: 0 !important;
        word-break: break-word !important;
    }

    /* Hide description — saves space, keeps card compact */
    .tool-desc {
        display: block !important;
        font-size: 0.82rem !important;
        line-height: 1.4 !important;
        margin-top: 4px !important;
        color: var(--text-muted) !important;
    }
}

/* ============================================================
   MODALS → BOTTOM SHEETS (smooth animations)
   ============================================================ */
@media (max-width: 768px) {

    .merge-overlay {
        align-items: center !important;
        padding: 1rem !important;
        /* Smooth backdrop fade */
        transition: opacity 0.35s ease, visibility 0.35s !important;
    }

    .merge-modal {
        /* Bottom-sheet slide-up animation */
        transform: translateY(40px);
        opacity: 0;
        transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1),
                    opacity 0.35s ease !important;
        will-change: transform, opacity;
    }

    .merge-overlay.active .merge-modal {
        transform: translateY(0);
        opacity: 1;
    }

    .merge-modal {
        width: 92% !important;
        max-width: 520px !important;
        max-height: 92vh !important;
        padding: 1.5rem 1rem !important;
        box-sizing: border-box !important;
        overflow-y: auto !important;
        border-radius: 20px !important;
        margin: auto !important;
    }

    .merge-header svg {
        transform: scale(0.85) !important;
        margin-bottom: 0.5rem !important;
    }

    .merge-title {
        font-size: 1.5rem !important;
        margin: 0.5rem 0 0.25rem !important;
    }

    .merge-subtitle {
        font-size: 0.85rem !important;
    }

    @keyframes modalFadeIn {
        from {
            opacity: 0;
            transform: scale(0.95);
        }

        to {
            opacity: 1;
            transform: scale(1);
        }
    }

    /* Modal header — tighten */
    .merge-header {
        text-align: center;
        margin-bottom: 1.5rem;
    }

    .merge-header svg {
        width: 60px !important;
        height: 60px !important;
        margin-bottom: 0.75rem;
    }

    .merge-title {
        font-size: 1.3rem !important;
        margin-bottom: 0.25rem !important;
    }

    .merge-subtitle {
        font-size: 0.9rem !important;
        opacity: 0.8;
    }

    /* Standard modal actions (centered layout) */
    .merge-actions {
        display: flex !important;
        flex-direction: column-reverse !important;
        gap: 0.75rem !important;
        margin-top: 1.75rem !important;
        padding-top: 1.25rem !important;
        border-top: 1px solid rgba(255, 255, 255, 0.08) !important;
    }

    /* All buttons in modal full-width */
    .merge-actions .btn {
        width: 100% !important;
        min-height: 50px !important;
        font-size: 1rem !important;
        justify-content: center !important;
        border-radius: 12px !important;
        padding: 0.875rem 1rem !important;
        box-sizing: border-box !important;
    }

    /* Dropzone inside sheet — smooth touch feedback */
    .merge-dropzone {
        min-height: 130px !important;
        display: flex !important;
        flex-direction: column !important;
        align-items: center !important;
        justify-content: center !important;
        gap: 0.5rem !important;
        cursor: pointer !important;
        border: 1.5px dashed rgba(58, 134, 255, 0.45) !important;
        border-radius: 14px !important;
        padding: 1.5rem 1rem !important;
        -webkit-tap-highlight-color: transparent;
        transition: background 0.25s ease, transform 0.25s ease, border-color 0.25s ease;
        box-sizing: border-box !important;
        background: rgba(58, 134, 255, 0.03) !important;
    }

    .merge-dropzone:active,
    .merge-dropzone:focus {
        background: rgba(58, 134, 255, 0.09) !important;
        transform: scale(1.02);
        border-color: var(--primary-electric) !important;
    }

    .merge-dropzone p,
    .merge-dropzone span {
        display: block !important;
        font-size: 0.85rem !important;
    }

    .merge-dropzone svg {
        width: 40px !important;
        height: 40px !important;
        margin-bottom: 0.5rem !important;
    }

    /* Merge files list */
    .merge-file-item {
        flex-wrap: wrap;
        gap: 0.5rem;
    }
}

/* ============================================================
   FIX 5 — Split Options
   ============================================================ */
@media (max-width: 768px) {

    .split-mode-grid {
        display: grid !important;
        grid-template-columns: 1fr 1fr !important;
        gap: 0.6rem !important;
    }

    .split-mode-card {
        min-height: 68px !important;
        padding: 0.75rem 0.5rem !important;
        display: flex !important;
        flex-direction: column !important;
        align-items: center !important;
        justify-content: center !important;
        text-align: center !important;
        border-radius: 12px !important;
        cursor: pointer;
        box-sizing: border-box !important;
        -webkit-tap-highlight-color: transparent;
    }

    .split-mode-content {
        display: flex !important;
        flex-direction: column !important;
        align-items: center !important;
        gap: 0.2rem !important;
    }

    .split-mode-content strong {
        font-size: 0.78rem !important;
    }

    .split-mode-content p {
        display: block !important;
        font-size: 0.7rem !important;
        opacity: 0.8 !important;
    }

    .split-input-area input[type="number"],
    .split-input-area input[type="text"],
    #specificPages,
    #rangeStart,
    #rangeEnd,
    #everyN {
        font-size: 16px !important;
        padding: 0.75rem !important;
        width: 100% !important;
        box-sizing: border-box !important;
    }

    .split-range-inputs {
        flex-direction: column !important;
        gap: 0.5rem !important;
    }

    .split-input-field {
        width: 100% !important;
    }
}

/* ============================================================
   FIX 6 — Compression Levels
   ============================================================ */
@media (max-width: 768px) {

    .compress-options {
        flex-direction: column !important;
        gap: 0.6rem !important;
    }

    .compress-option {
        width: 100% !important;
        box-sizing: border-box !important;
    }

    .compress-option-content {
        min-height: 56px !important;
        padding: 0.875rem 1rem !important;
        display: flex !important;
        align-items: center !important;
        gap: 0.75rem !important;
        border-radius: 12px !important;
        box-sizing: border-box !important;
        width: 100% !important;
    }

    #universalCompressOptions .compress-levels {
        flex-direction: column !important;
        gap: 0.6rem !important;
    }
}

/* ============================================================
   FIX 7 — Button Touch Targets
   ============================================================ */
@media (max-width: 768px) {

    .btn {
        min-height: 50px !important;
        font-size: 1rem !important;
        padding: 0.875rem 1.5rem !important;
        width: 100% !important;
        box-sizing: border-box !important;
        border-radius: 12px !important;
        justify-content: center !important;
    }

    .success-actions {
        flex-direction: column !important;
        gap: 0.75rem !important;
        align-items: stretch !important;
    }

    .success-actions .btn {
        width: 100% !important;
    }

    /* Remove-file & modal-close keep original small size */
    .remove-btn,
    .btn-remove,
    .modal-close {
        min-height: 44px !important;
        width: auto !important;
    }
}

/* ============================================================
   FIX 8 — Features Grid
   ============================================================ */
@media (max-width: 768px) {
    .features-grid {
        grid-template-columns: 1fr 1fr !important;
        gap: 0.875rem !important;
        padding: 0 !important;
    }

    .feature-card {
        padding: 0.85rem !important;
        border-radius: 14px !important;
        min-width: 0 !important;
        overflow: hidden !important;
    }

    .feature-icon {
        width: 44px !important;
        height: 44px !important;
        display: flex;
        align-items: center;
        justify-content: center;
        margin-bottom: 0.75rem !important;
    }

    .feature-card h3 {
        font-size: 0.95rem !important;
        word-break: break-word !important;
        min-width: 0 !important;
    }

    .feature-card p {
        font-size: 0.82rem !important;
        line-height: 1.5 !important;
        word-break: break-word !important;
        opacity: 0.85 !important;
    }
}

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

/* ============================================================
   FIX 9 — Footer Stack
   ============================================================ */
@media (max-width: 768px) {

    .footer-grid {
        display: flex !important;
        flex-direction: column !important;
        gap: 0 !important;
    }

    .footer-col {
        width: 100% !important;
        box-sizing: border-box !important;
        padding: 1rem 0 !important;
        border-bottom: 1px solid rgba(255, 255, 255, 0.06) !important;
    }

    .footer-col:last-child {
        border-bottom: none !important;
    }

    .footer-bottom-modern {
        text-align: center !important;
        padding: 1rem 0 !important;
        font-size: 0.75rem !important;
        /* Extra bottom padding for bottom nav bar */
        padding-bottom: calc(1rem + 64px) !important;
    }
}

/* ============================================================
   FIX 10 — Progress & Success UI
   ============================================================ */
@media (max-width: 768px) {

    .progress-section,
    .progress-content {
        padding: 1.5rem 0.5rem !important;
        text-align: center !important;
        width: 100% !important;
        box-sizing: border-box !important;
    }

    .progress-ring {
        display: flex !important;
        justify-content: center !important;
    }

    .progress-ring svg {
        width: 110px !important;
        height: 110px !important;
    }

    .progress-title {
        font-size: 1.2rem !important;
    }

    .success-section,
    .success-content {
        padding: 1.5rem 0.5rem !important;
        text-align: center !important;
        width: 100% !important;
        box-sizing: border-box !important;
    }

    .success-icon svg {
        width: 72px !important;
        height: 72px !important;
    }

    .success-title {
        font-size: 1.3rem !important;
    }
}

/* ============================================================
   STICKY BOTTOM NAVIGATION BAR
   ============================================================ */
@media (max-width: 768px) {

    .mobile-bottom-nav {
        display: flex !important;
        position: fixed !important;
        bottom: 0 !important;
        left: 0;
        right: 0;
        height: 60px;
        padding-bottom: env(safe-area-inset-bottom, 0px);
        background: linear-gradient(135deg, rgba(8, 12, 28, 0.97), rgba(18, 28, 55, 0.97)) !important;
        backdrop-filter: blur(24px) !important;
        -webkit-backdrop-filter: blur(24px) !important;
        border-top: 1px solid rgba(255, 255, 255, 0.08) !important;
        z-index: 200 !important;
        align-items: stretch !important;
        box-shadow: 0 -4px 24px rgba(0, 0, 0, 0.4) !important;
    }

    .mobile-bn-item {
        flex: 1 !important;
        display: flex !important;
        flex-direction: column !important;
        align-items: center !important;
        justify-content: center !important;
        gap: 3px !important;
        color: var(--text-muted) !important;
        text-decoration: none !important;
        font-size: 0.62rem !important;
        font-weight: 600 !important;
        letter-spacing: 0.02em !important;
        /* Smooth active-state transitions */
        transition: color 0.3s cubic-bezier(0.4, 0, 0.2, 1),
                    transform 0.2s ease !important;
        -webkit-tap-highlight-color: transparent !important;
        cursor: pointer;
        padding-bottom: 4px;
    }

    .mobile-bn-item svg {
        width: 20px !important;
        height: 20px !important;
        stroke-width: 2 !important;
        transition: filter 0.3s ease, transform 0.3s ease !important;
    }

    .mobile-bn-item.active {
        color: var(--primary-electric) !important;
    }

    .mobile-bn-item.active svg {
        filter: drop-shadow(0 0 6px rgba(58, 134, 255, 0.6)) !important;
        transform: scale(1.1);
    }

    .mobile-bn-item:active {
        transform: scale(0.92) !important;
    }

    /* Push page content above the bottom nav */
    body {
        padding-bottom: 64px !important;
    }
}

/* ============================================================
   HEADINGS — Fluid Mobile Typography
   ============================================================ */
@media (max-width: 768px) {
    h1 {
        font-size: clamp(1.6rem, 5.5vw, 2.4rem) !important;
    }

    h2 {
        font-size: clamp(1.2rem, 4vw, 1.8rem) !important;
    }

    h3 {
        font-size: clamp(0.88rem, 3.5vw, 1.2rem) !important;
    }
}

/* ============================================================
   SECTION SPACING — Tightened for Mobile
   ============================================================ */
@media (max-width: 768px) {

    .features-section {
        padding: 2rem 0 !important;
    }

    .section-title {
        font-size: 1.2rem !important;
        margin-bottom: 1rem !important;
    }
}

/* ============================================================
   SCROLL-REVEAL ANIMATIONS
   ============================================================ */
.reveal-on-scroll {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.6s cubic-bezier(0.4, 0, 0.2, 1),
                transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

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

/* Staggered delays for grid items */
.reveal-on-scroll:nth-child(2) { transition-delay: 0.05s; }
.reveal-on-scroll:nth-child(3) { transition-delay: 0.1s; }
.reveal-on-scroll:nth-child(4) { transition-delay: 0.15s; }
.reveal-on-scroll:nth-child(5) { transition-delay: 0.2s; }
.reveal-on-scroll:nth-child(6) { transition-delay: 0.25s; }