/* ============================================
   RESPONSIVE
   ============================================ */

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

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

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

    .free-tier-copy {
        text-align: center;
    }

    .free-tier-copy p {
        margin-left: auto;
        margin-right: auto;
    }

}

@media (max-width: 768px) {
    body.nav-open .site-header {
        background: rgba(255, 255, 255, 0.96);
        backdrop-filter: blur(14px);
        -webkit-backdrop-filter: blur(14px);
        box-shadow: 0 1px 12px rgba(15, 20, 25, 0.08);
    }

    .nav-toggle {
        display: inline-flex;
    }

    .nav-toggle[aria-expanded="true"] {
        background: rgba(255, 255, 255, 0.94);
        border-color: rgba(var(--accent-dark-rgb), 0.14);
        box-shadow: 0 10px 24px rgba(15, 20, 25, 0.12);
    }

    .nav-links {
        position: fixed;
        top: 72px;
        left: 1rem;
        right: 1rem;
        bottom: auto;
        height: auto;
        max-height: min(calc(100dvh - 88px), 34rem);
        display: flex;
        flex-direction: column;
        align-items: stretch;
        gap: 0.5rem;
        padding: 0.75rem;
        background: linear-gradient(180deg, #ffffff 0%, #fcfdfd 100%);
        border: 1px solid var(--border-light-default);
        border-radius: 1.25rem;
        box-shadow: 0 22px 48px rgba(15, 20, 25, 0.14);
        z-index: 999;
        overflow-y: auto;
        overscroll-behavior: contain;
        -webkit-overflow-scrolling: touch;
        opacity: 0;
        visibility: hidden;
        pointer-events: none;
        transform: translateY(12px) scale(0.985);
        transition:
            opacity 0.24s ease,
            transform 0.24s ease,
            visibility 0s linear 0.24s;
        scrollbar-width: none;
    }

    .nav-links::-webkit-scrollbar {
        display: none;
    }

    .nav-links.is-open {
        opacity: 1;
        visibility: visible;
        pointer-events: auto;
        transform: translateY(0) scale(1);
        transition-delay: 0s;
    }

    .nav-group {
        flex-direction: column;
        align-items: stretch;
        gap: 0.15rem;
    }

    .nav-group > a,
    .nav-dropdown {
        width: 100%;
        border: 1px solid transparent;
        border-radius: 1rem;
        background: transparent;
    }

    .nav-group > a {
        display: flex;
        align-items: center;
        min-height: 3.15rem;
        padding: 0 0.95rem;
        font-size: 1rem;
        font-weight: 600;
        color: var(--text-dark);
    }

    .nav-group > a:hover {
        background: var(--bg-light-surface);
        color: var(--text-dark);
        border-color: var(--border-light-subtle);
    }

    /* Mobile dropdown styles */
    .nav-dropdown {
        overflow: hidden;
    }

    .nav-dropdown::after {
        display: none !important;
    }

    .nav-dropdown-trigger {
        width: 100%;
        justify-content: space-between;
        padding: 0.95rem;
        font-size: 1rem;
        font-weight: 600;
        color: var(--text-dark);
    }

    .nav-dropdown.is-open {
        background: var(--bg-light-surface);
        border-color: var(--border-light-default);
    }

    .nav-dropdown.is-open .nav-dropdown-trigger {
        color: var(--accent-dark);
    }

    .nav-dropdown-menu {
        position: static;
        opacity: 1;
        visibility: visible;
        pointer-events: auto;
        display: none;
        margin: 0;
        padding: 0 0.75rem 0.75rem;
        justify-content: flex-start;
    }

    .nav-dropdown.is-open .nav-dropdown-menu {
        display: block;
    }

    /* Disable hover on mobile */
    .nav-dropdown:hover .nav-dropdown-menu {
        display: none;
    }

    .nav-dropdown.is-open:hover .nav-dropdown-menu {
        display: block;
    }

    .mega-menu {
        width: 100%;
        max-width: none;
        padding: 0.45rem 0 0;
        border: none;
        border-top: 1px solid var(--border-light-subtle);
        box-shadow: none;
        background: transparent;
        border-radius: 0;
    }

    .mega-menu-grid {
        grid-template-columns: 1fr;
        gap: 0.3rem;
    }

    .mega-menu-item {
        gap: 0.75rem;
        padding: 0.75rem;
        border: 1px solid var(--border-light-subtle);
        border-radius: 0.9rem;
        background: var(--bg-light);
    }

    .mega-menu-icon {
        width: 32px;
        height: 32px;
    }

    .mega-menu-icon svg {
        width: 18px;
        height: 18px;
    }

    .mega-menu-title {
        font-size: 0.92rem;
    }

    .mega-menu-desc {
        font-size: 0.8rem;
        line-height: 1.35;
    }

    .simple-menu {
        width: 100%;
        max-width: none;
        padding: 0.45rem 0 0;
        border: none;
        border-top: 1px solid var(--border-light-subtle);
        box-shadow: none;
        background: transparent;
        border-radius: 0;
        flex-direction: column;
    }

    .simple-menu a {
        padding: 0.75rem;
        border: 1px solid var(--border-light-subtle);
        border-radius: 0.9rem;
        background: var(--bg-light);
        color: var(--text-dark-secondary);
    }

    .nav-cta {
        position: static;
        display: flex;
        align-items: center;
        gap: 0.75rem;
        margin-top: 0.5rem;
        margin-left: 0;
        padding-top: 0.85rem;
        padding-bottom: 0;
        background: none;
        border-top: 1px solid var(--border-light-subtle);
    }

    .nav-cta .button {
        min-height: 3rem;
        font-size: 0.95rem;
    }

    .nav-cta .button.primary {
        flex: 1 1 auto;
        order: 0;
        box-shadow: none;
    }

    .nav-cta .button.ghost {
        flex: 0 0 auto;
        background: var(--bg-light);
        border-color: var(--border-light-default);
        white-space: nowrap;
        padding-inline: 1.05rem;
    }

    body.nav-open {
        overflow: hidden;
    }

    body.nav-open::before {
        content: '';
        position: fixed;
        inset: 0;
        background: var(--overlay-scrim);
        z-index: 998;
    }

    .hero {
        min-height: auto;
        padding: 3rem 0 4rem;
    }

    .hero-subtitle {
        font-size: 1.1rem;
    }

    .trust-strip {
        flex-direction: column;
        gap: 1.5rem;
    }

    .feature-tabs-section {
        padding: 2.5rem 1.5rem;
    }

    .section-light.section-full .container {
        max-width: min(1600px, 94vw);
        padding: 0 1rem;
    }

    .section-light .tab-navigation {
        display: none;
    }

    .tab-icon {
        width: 20px;
        height: 20px;
    }

    .section-light .tab-panels {
        display: grid;
        gap: 0.75rem;
        min-height: 0;
    }

    .section-light .tab-panel {
        display: block;
        border: 1px solid var(--border-light-default);
        border-radius: var(--radius-lg);
        background: var(--bg-light);
        overflow: hidden;
        box-shadow: 0 8px 18px rgba(15, 20, 25, 0.04);
    }

    .section-light .tab-panel.active {
        animation: none;
        border-color: rgba(var(--accent-dark-rgb), 0.14);
        box-shadow: 0 16px 32px rgba(15, 20, 25, 0.08);
    }

    .section-light .mobile-feature-trigger {
        display: flex;
        color: var(--text-dark);
    }

    .section-light .tab-panel.active .mobile-feature-trigger {
        background: linear-gradient(180deg, rgba(var(--accent-dark-rgb), 0.05), rgba(var(--accent-dark-rgb), 0.02));
    }

    .section-light .mobile-feature-trigger-label {
        color: var(--text-dark);
    }

    .section-light .mobile-feature-trigger .tab-icon {
        color: var(--accent-dark);
    }

    .section-light .mobile-feature-trigger-arrow {
        color: var(--text-dark-muted);
    }

    .section-light .tab-panel .panel-content {
        display: none;
        grid-template-columns: 1fr;
        gap: 1rem;
        padding: 0 1rem 1rem;
        border-top: 1px solid var(--border-light-subtle);
    }

    .section-light .tab-panel.active .panel-content {
        display: grid;
    }

    .section-light .panel-text {
        display: contents;
    }

    .section-light .panel-text h3 {
        order: 1;
        margin: 0;
        font-size: clamp(1.35rem, 5.2vw, 1.75rem);
        line-height: 1.15;
    }

    .section-light .panel-visual {
        order: 2;
        position: relative;
        width: 100%;
        padding: 0.55rem;
        background: linear-gradient(180deg, var(--bg-light), var(--bg-light-surface));
        border: 1px solid var(--border-light-default);
        border-radius: var(--radius-lg);
        box-shadow: 0 12px 28px rgba(15, 20, 25, 0.08);
    }

    .section-light .panel-visual::before {
        content: 'Demo preview';
        position: absolute;
        top: 0.8rem;
        left: 0.8rem;
        z-index: 1;
        padding: 0.35rem 0.65rem;
        border: 1px solid var(--border-light-subtle);
        border-radius: 999px;
        background: rgba(255, 255, 255, 0.94);
        color: var(--text-dark-secondary);
        font-size: 0.7rem;
        font-weight: 700;
        letter-spacing: 0.04em;
        text-transform: uppercase;
    }

    .section-light .feature-checklist {
        order: 3;
        gap: 0.85rem;
        margin-bottom: 0;
    }

    .section-light .panel-text .button.ghost {
        order: 4;
        width: 100%;
    }

    .section-light .panel-visual {
        width: 100%;
    }

    .section-light .feature-mockup {
        display: block;
        min-height: auto;
        aspect-ratio: 3 / 2;
        width: 100%;
        height: auto;
        border-radius: calc(var(--radius-lg) - 8px);
        background: var(--bg-light);
    }

    .advantage-grid {
        grid-template-columns: 1fr;
    }

    .mobile-showcase {
        grid-template-columns: 1fr;
        padding: 2.5rem;
        gap: 3rem;
    }

    .mobile-visual {
        order: -1;
    }

    .testimonials-section {
        padding: 2.5rem 1.5rem;
    }

    .testimonial-slide blockquote {
        font-size: 1.25rem;
    }

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

    .security-section {
        padding: 2.5rem 1.5rem;
    }

    .security-grid {
        grid-template-columns: 1fr 1fr;
    }

    .support-banner {
        padding: 2.5rem 1.5rem;
    }

    .support-banner__items {
        grid-template-columns: 1fr;
    }

    .support-banner__item {
        border-right: none;
        border-bottom: 1px solid var(--border-light-default);
        padding: 1.5rem 0;
    }

    .support-banner__item:last-child {
        border-bottom: none;
        padding-bottom: 0;
    }

    .support-banner__item:first-child {
        padding-top: 0;
    }

    .callout {
        padding: 3rem 2rem;
    }

    .site-footer {
        padding: 2.5rem 0 1.5rem;
    }

    .footer-grid {
        grid-template-columns: 1fr;
        gap: 2.5rem;
    }

    .footer-links {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 2rem 1.5rem;
    }

    .footer-col {
        gap: 0.5rem;
    }

    .app-store-badges {
        flex-wrap: wrap;
    }

    .industry-text-list {
        display: flex;
        flex-wrap: wrap;
        justify-content: center;
        gap: 0.75rem 0.5rem;
        line-height: 1.1;
    }

    .industry-text-list br,
    .industry-text-list__separator {
        display: none;
    }

    .industry-text-list a {
        font-size: 1rem;
        line-height: 1;
        padding: 0.55rem 0.8rem;
        border: 1px solid var(--border-light-default);
        border-radius: 999px;
        background: var(--bg-light-surface);
    }

    .platform-showcase {
        gap: 2rem;
    }

    .platform-showcase__visual {
        order: -1;
    }

    .platform-showcase--reversed .platform-showcase__content {
        order: 0;
    }

    .platform-showcase__content h2 {
        font-size: clamp(1.9rem, 8vw, 2.5rem);
    }

    .platform-showcase__subtitle {
        max-width: none;
        margin-top: 0.75rem;
    }

    .platform-showcase__list {
        margin-top: 1.75rem;
    }

    .platform-showcase__list-item {
        padding: 1rem 0;
    }

    .platform-showcase--reversed {
        margin-top: 3rem;
    }

    .free-tier-row {
        gap: 2rem;
    }

    .free-tier-copy p {
        font-size: 1rem;
        margin-bottom: 1.5rem;
    }

    .browser-content {
        min-height: 360px;
    }

    /* Tighten 8rem desktop padding on text-only page headers so content
       isn't pushed below the fold on phones. Still clears the ~70px fixed
       site-header with breathing room. */
    .page-header,
    .seo-article-header,
    .learn-page,
    .faq-page,
    .contact-page {
        padding-top: 5rem;
    }
}

@media (max-width: 480px) {
    .container {
        width: 94vw;
    }

    h1 {
        font-size: clamp(2rem, 8vw, 2.5rem);
    }

    .hero-subtitle {
        font-size: 1rem;
    }

    .hero-cta {
        flex-direction: column;
        align-items: stretch;
    }

    .browser-content {
        min-height: 300px;
    }

    .browser-toolbar {
        padding: 0.75rem 0.875rem;
        gap: 0.5rem;
    }

    .browser-address {
        padding: 0.35rem 0.75rem;
        font-size: 0.7rem;
    }

    .section-light.section-full .container {
        padding: 0 0.75rem;
    }

    .section-light .mobile-feature-trigger {
        padding: 0.9rem;
        gap: 0.75rem;
    }

    .section-light .mobile-feature-trigger-label {
        gap: 0.625rem;
        font-size: 0.95rem;
    }

    .section-light .tab-panel .panel-content {
        gap: 1.25rem;
        padding: 0 0.9rem 0.9rem;
    }

    .section-light .panel-visual {
        padding: 0.45rem;
    }

    .section-light .panel-visual::before {
        top: 0.65rem;
        left: 0.65rem;
        padding: 0.3rem 0.55rem;
        font-size: 0.64rem;
    }

    .section-light .feature-mockup {
        aspect-ratio: 4 / 3;
    }

    .section-light,
    .section-dark,
    .section-light-alt {
        padding: 3.5rem 0;
    }

    .testimonial-card__quote {
        font-size: 0.9rem;
    }

    .testimonial-card__name {
        font-size: 0.875rem;
    }

    .testimonial-card__position {
        font-size: 0.8rem;
    }

    .industry-grid {
        gap: 1rem;
    }

    .industry-text-list {
        gap: 0.6rem 0.45rem;
    }

    .industry-text-list a {
        width: calc(50% - 0.3rem);
        padding: 0.7rem 0.5rem;
        font-size: 0.95rem;
        text-align: center;
    }

    .platform-showcase {
        gap: 1.5rem;
    }

    .platform-showcase__list-item h3 {
        font-size: 1.05rem;
    }

    .platform-showcase__list-item p {
        font-size: 0.875rem;
    }

    .support-banner {
        padding: 2rem 1.25rem;
    }

    .support-banner__item {
        gap: 0.85rem;
    }

    .free-tier-copy h2 {
        font-size: 1.35rem;
    }

    .free-tier-visual {
        max-width: 320px;
    }

    .security-grid {
        grid-template-columns: 1fr;
    }

    .footer-links {
        gap: 1.5rem 1rem;
    }

    .footer-col a {
        font-size: 0.875rem;
    }
}

/* ============================================
   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;
    }

    .animate-on-scroll {
        opacity: 1;
        transform: none;
    }
}

.reduce-motion .animate-on-scroll {
    opacity: 1;
    transform: none;
    transition: none;
}
