/* Homepage — mobile-first responsive polish */

body.page-home {
    overflow-x: clip;
}

/* ── Mobile header logo center + hide footer ── */
@media (max-width: 1023px) {
    body.page-home .site-header .container > div {
        justify-content: center;
    }

    body.page-home .site-header .site-logo-img {
        object-position: center center;
    }

    body.page-home .site-footer {
        display: none !important;
    }
}

/* ── Section rhythm ── */
@media (max-width: 767px) {
    body.page-home .premium-section,
    body.page-home .premium-section-alt,
    body.page-home .premium-section-dark,
    body.page-home .system-showcase-section {
        padding-top: 3rem !important;
        padding-bottom: 3rem !important;
    }

    body.page-home .section-header {
        margin-bottom: 2rem !important;
    }

    body.page-home .section-title {
        font-size: clamp(1.35rem, 5.5vw, 1.75rem) !important;
        line-height: 1.25;
    }

    body.page-home .section-subtitle {
        font-size: 0.875rem;
        line-height: 1.6;
    }
}

/* ── Hero banner — mobile aspect ratio ── */
@media (max-width: 767px) {
    .home-banner-picture {
        display: block;
        aspect-ratio: 2 / 1;
        overflow: hidden;
        background: #000;
    }

    .home-banner-img {
        width: 100%;
        height: 100%;
        object-fit: cover;
        object-position: center top;
    }
}

/* ── Hero banner controls ── */
@media (max-width: 767px) {
    .home-banner-inner {
        padding-bottom: 0.75rem;
    }

    .home-banner-arrow {
        width: 2rem;
        height: 2rem;
        min-height: 0 !important;
        min-width: 0 !important;
        top: auto;
        bottom: 0.45rem;
        transform: none;
        background: rgba(3, 5, 8, 0.72);
    }

    .home-banner-arrow i {
        width: 1.125rem !important;
        height: 1.125rem !important;
    }

    .home-banner-prev { left: 0.5rem; }
    .home-banner-next { right: 0.5rem; }

    .home-banner-counter {
        top: 0.5rem;
        right: 0.5rem;
        font-size: 0.625rem;
        padding: 0.2rem 0.45rem;
        border-radius: 9999px;
    }

    .home-banner-dots {
        bottom: 0.55rem;
        left: 50%;
        transform: translateX(-50%);
        max-width: calc(100% - 5.25rem);
        gap: 0.45rem;
        padding: 0.35rem 0.55rem;
        border-radius: 9999px;
    }

    .home-banner-dot {
        width: 0.4rem;
        height: 0.4rem;
        min-height: 0 !important;
        min-width: 0 !important;
        flex-shrink: 0;
        border-radius: 9999px;
        position: relative;
    }

    .home-banner-dot::before {
        content: '';
        position: absolute;
        inset: -0.65rem;
    }

    .home-banner-dot.active {
        width: 0.4rem;
        height: 0.4rem;
        transform: scale(1.35);
        box-shadow: 0 0 8px rgba(0, 255, 136, 0.55);
    }

    .home-banner-label {
        bottom: 2.85rem;
        left: 0.65rem;
        font-size: 0.625rem;
        max-width: calc(100% - 1.5rem);
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        padding: 0.3rem 0.6rem;
    }
}

/* ── Features — 2 columns, readable on mobile ── */
@media (max-width: 767px) {
    .features-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 0.65rem;
    }

    .features-grid .premium-feature-card {
        padding: 0.85rem 0.65rem 0.95rem;
    }

    .features-grid .ref-feature-icon-wrap {
        width: 2.35rem !important;
        height: 2.35rem !important;
        margin-bottom: 0.55rem !important;
        border-radius: 0.65rem !important;
    }

    .features-grid .ref-feature-icon-wrap i {
        width: 1.15rem !important;
        height: 1.15rem !important;
    }

    .features-grid .premium-feature-card h3 {
        font-size: 0.75rem !important;
        margin-bottom: 0.25rem !important;
        line-height: 1.35;
    }

    .features-grid .premium-feature-card p {
        font-size: 0.6875rem !important;
        line-height: 1.45;
        display: -webkit-box;
        -webkit-line-clamp: 3;
        -webkit-box-orient: vertical;
        overflow: hidden;
    }
}

/* ── Process flow — stacked cards on mobile ── */
@media (max-width: 767px) {
    .process-flow-grid {
        grid-template-columns: 1fr;
        gap: 0.75rem;
    }

    .process-flow-wrap .premium-process-card {
        display: grid;
        grid-template-columns: auto 1fr;
        grid-template-rows: auto auto;
        column-gap: 0.85rem;
        row-gap: 0.15rem;
        padding: 1rem 1rem 1rem 0.85rem;
        text-align: left;
        align-items: start;
    }

    .process-flow-wrap .process-step-num {
        grid-column: 1;
        grid-row: 1;
        width: 1.75rem;
        height: 1.75rem;
        margin: 0;
        font-size: 0.75rem;
        align-self: center;
    }

    .process-flow-wrap .process-step-icon {
        grid-column: 1;
        grid-row: 2;
        width: 2.75rem !important;
        height: 2.75rem !important;
        margin: 0 !important;
        border-radius: 0.75rem !important;
    }

    .process-flow-wrap .process-step-icon i {
        width: 1.35rem !important;
        height: 1.35rem !important;
    }

    .process-flow-wrap .premium-process-card h3 {
        grid-column: 2;
        grid-row: 1;
        font-size: 0.9375rem !important;
        margin-bottom: 0 !important;
        line-height: 1.35;
        align-self: center;
    }

    .process-flow-wrap .premium-process-card p {
        grid-column: 2;
        grid-row: 2;
        font-size: 0.8125rem !important;
        line-height: 1.5;
    }
}

/* ── AI tools strip — swipe on mobile ── */
@media (max-width: 767px) {
    .ai-tools-strip-bar {
        padding: 0.75rem 0 0.85rem;
    }

    .ai-tools-strip-bar .container {
        padding-left: 0;
        padding-right: 0;
    }

    .ai-tools-strip-grid {
        flex-direction: row;
        flex-wrap: nowrap;
        overflow-x: auto;
        scroll-snap-type: x mandatory;
        -webkit-overflow-scrolling: touch;
        gap: 0.65rem;
        padding: 0 1rem 0.25rem;
        scrollbar-width: none;
    }

    .ai-tools-strip-grid::-webkit-scrollbar {
        display: none;
    }

    .ai-tools-strip-item {
        flex: 0 0 min(92vw, 22rem);
        scroll-snap-align: center;
    }

    .ai-tools-strip-img {
        border-radius: 0.35rem;
    }
}

/* ── Trust + perks ── */
@media (max-width: 767px) {
    .ref-trust-bar {
        padding: 0.85rem 0;
    }

    .ref-trust-banner-img {
        width: 100%;
        max-width: 100%;
    }

    .premium-trust-strip {
        padding: 1.25rem 0;
    }

    .premium-trust-item {
        gap: 0.5rem;
    }

    .premium-trust-item .text-sm {
        font-size: 0.8125rem;
        line-height: 1.35;
    }
}

/* ── Stats ── */
@media (max-width: 767px) {
    .premium-stats {
        padding: 2rem 0;
    }

    .premium-stat-card {
        padding: 0.85rem 0.5rem;
    }

    .premium-stat-icon {
        width: 2.15rem;
        height: 2.15rem;
        margin-bottom: 0.5rem;
    }

    .premium-stat-value {
        font-size: 1.45rem;
    }

    .premium-stat-label {
        font-size: 0.6875rem;
        line-height: 1.35;
    }
}

/* ── Demo tabs ── */
@media (max-width: 767px) {
    .premium-demo-tabs {
        flex-wrap: nowrap;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        scroll-snap-type: x proximity;
        padding: 0.75rem;
        gap: 0.4rem;
        scrollbar-width: none;
    }

    .premium-demo-tabs::-webkit-scrollbar {
        display: none;
    }

    .demo-tab-btn {
        flex-shrink: 0;
        font-size: 0.75rem;
        padding: 0.45rem 0.85rem;
        white-space: nowrap;
    }

    .premium-demo-panel-inner {
        padding: 1rem;
    }

    .premium-demo-visual {
        min-height: 10rem !important;
    }

    .premium-demo-visual i {
        width: 4rem !important;
        height: 4rem !important;
    }
}

/* ── Packages ── */
@media (max-width: 767px) {
    .ref-product-card {
        padding: 1.25rem;
    }

    .ref-product-visual {
        width: 4.5rem;
        height: 4.5rem;
    }

    .ref-btn-cart {
        width: 100%;
        justify-content: center;
    }
}

/* ── Homepage services — 2 columns on mobile ── */
@media (max-width: 767px) {
    .home-svc-body {
        padding: 0.65rem 0.7rem 0.75rem;
    }

    .home-svc-title {
        font-size: 0.8125rem;
        margin-bottom: 0.35rem;
    }

    .home-svc-desc {
        font-size: 0.6875rem;
        line-height: 1.45;
        -webkit-line-clamp: 2;
        margin-bottom: 0.45rem;
    }

    .home-svc-cta {
        font-size: 0.6875rem;
    }

    .home-svc-num {
        font-size: 0.5625rem;
        top: 0.45rem;
        left: 0.45rem;
        padding: 0.1rem 0.35rem;
    }

    .home-svc-icon-badge {
        bottom: 0.45rem;
        right: 0.45rem;
        width: 1.5rem;
        height: 1.5rem;
    }
}

/* ── Course catalog (homepage compact) ── */
@media (max-width: 767px) {
    body.page-home #courseCatalog #courseGrid {
        gap: 0.65rem;
    }

    body.page-home #courseCatalog .course-catalog-controls--compact {
        margin-left: -0.15rem;
        margin-right: -0.15rem;
        padding: 0.9rem 0.85rem;
    }

    body.page-home #courseCatalog .course-filter-scroll--compact {
        margin-left: -0.35rem;
        margin-right: -0.35rem;
        padding-left: 0.35rem;
        padding-right: 0.35rem;
    }

    body.page-home #courseCatalog .course-filter-bar--compact .course-filter-btn {
        min-height: 2.85rem;
        padding: 0.65rem 0.95rem;
    }

    body.page-home #courseCatalog .course-card--compact .course-card-title {
        font-size: 0.8125rem;
    }

    body.page-home #courseCatalog .course-card--compact .course-card-body {
        padding: 0.4rem 0.55rem 0.45rem;
    }

    body.page-home #courseCatalog .course-card--compact .course-card-cta {
        font-size: 0.6875rem;
        padding: 0.35rem 0.5rem;
    }
}

/* ── Gallery ── */
@media (max-width: 767px) {
    .premium-gallery-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 0.65rem;
    }

    .gallery-item {
        border-radius: 0.75rem;
    }

    .gallery-overlay {
        opacity: 1;
        background: linear-gradient(to top, rgba(3, 5, 8, 0.85), transparent 55%);
    }

    .gallery-lightbox-content {
        width: 100%;
        padding: 0 0.75rem;
    }

    .gallery-lightbox-close {
        position: fixed;
        top: calc(0.75rem + env(safe-area-inset-top));
        right: 0.75rem;
        z-index: 110;
        background: rgba(3, 5, 8, 0.75);
        border: 1px solid rgba(255, 255, 255, 0.12);
        border-radius: 9999px;
        padding: 0.35rem;
    }

    .gallery-lightbox-prev,
    .gallery-lightbox-next {
        top: auto;
        bottom: 5.5rem;
        transform: none;
        padding: 0.4rem;
    }

    .gallery-lightbox-prev { left: 0.75rem; }
    .gallery-lightbox-next { right: 0.75rem; }

    .gallery-lightbox-img {
        max-height: 62vh;
        width: 100%;
    }

    .gallery-lightbox-info {
        padding-bottom: calc(4.5rem + env(safe-area-inset-bottom));
    }
}

/* ── Schedule + seats ── */
@media (max-width: 1023px) {
    .premium-seats-widget {
        margin-top: 0.5rem;
    }

    .premium-btn-cta {
        width: 100%;
        justify-content: center;
    }
}

/* ── Promo banner ── */
@media (max-width: 639px) {
    .promo-banner-section {
        padding: 1.25rem 0;
    }

    .promo-banner-link {
        border-radius: 0;
        border-left: none;
        border-right: none;
    }

    .promo-banner-img {
        border-radius: 0;
    }
}

/* ── FAQ ── */
@media (max-width: 767px) {
    .faq-answer {
        padding-left: 1rem !important;
    }

    .faq-toggle {
        padding: 0.85rem 1rem !important;
    }
}

/* ── Touch targets ── */
@media (max-width: 1023px) {
    body.page-home .course-card-cta,
    body.page-home .course-btn-outline,
    body.page-home .demo-tab-btn,
    body.page-home .course-quick-btn,
    body.page-home .home-banner-arrow {
        min-height: 2.75rem;
        min-width: 2.75rem;
    }
}

/* ── Homepage services section ── */
@media (max-width: 767px) {
    body.page-home .home-services {
        padding-top: 2.5rem !important;
        padding-bottom: 2.5rem !important;
    }

    body.page-home .home-services .section-header {
        margin-bottom: 1.5rem !important;
    }

    body.page-home .home-services .btn-neon-primary {
        width: 100%;
        justify-content: center;
        max-width: 20rem;
        margin-left: auto;
        margin-right: auto;
    }
}

/* ── System showcase — compact 2-col cards ── */
@media (max-width: 767px) {
    body.page-home .system-card-body {
        padding: 0.65rem 0.7rem 0.75rem;
    }

    body.page-home .system-card-title {
        font-size: 0.8125rem;
        line-height: 1.35;
    }

    body.page-home .system-card-desc {
        font-size: 0.6875rem;
        line-height: 1.45;
        display: -webkit-box;
        -webkit-line-clamp: 2;
        -webkit-box-orient: vertical;
        overflow: hidden;
    }

    body.page-home .system-card-tags {
        display: none;
    }

    body.page-home .system-card-title-th {
        display: none;
    }
}

/* ── Testimonials ── */
@media (max-width: 767px) {
    body.page-home .premium-testimonial {
        padding: 1.25rem 1.15rem;
    }

    body.page-home .premium-testimonial .quote-mark + p,
    body.page-home .premium-testimonial > p {
        font-size: 0.875rem;
        line-height: 1.65;
        margin-bottom: 1.25rem !important;
    }
}

/* ── Audience cards ── */
@media (max-width: 767px) {
    body.page-home .premium-audience-card {
        padding: 1rem 0.75rem;
    }

    body.page-home .premium-audience-card .w-16 {
        width: 3rem !important;
        height: 3rem !important;
        margin-bottom: 0.65rem !important;
    }

    body.page-home .premium-audience-card .w-16 i {
        width: 1.35rem !important;
        height: 1.35rem !important;
    }

    body.page-home .premium-audience-card h3 {
        font-size: 0.8125rem;
    }

    body.page-home .premium-audience-card p {
        font-size: 0.6875rem;
        line-height: 1.45;
    }
}

/* ── Marquee ── */
@media (max-width: 767px) {
    body.page-home .premium-marquee {
        padding: 0.65rem 0;
    }

    body.page-home .marquee-item {
        font-size: 0.6875rem;
        padding: 0.35rem 0.75rem;
    }
}

/* ── CTA + Contact ── */
@media (max-width: 767px) {
    body.page-home .cta-banner {
        padding: 2.5rem 0 calc(2.5rem + env(safe-area-inset-bottom));
    }

    body.page-home .cta-banner-title {
        font-size: clamp(1.35rem, 5.5vw, 1.75rem);
    }

    body.page-home .cta-banner-subtitle {
        font-size: 0.8125rem;
        line-height: 1.55;
    }

    body.page-home .cta-banner .flex.flex-wrap {
        flex-direction: column;
        align-items: stretch;
        gap: 0.65rem;
        padding: 0 0.5rem;
    }

    body.page-home .cta-banner .premium-btn-cta,
    body.page-home .cta-banner .cta-banner-ghost,
    body.page-home #contact-vio .btn-neon-primary,
    body.page-home #contact-vio .seo-intro-ghost {
        width: 100%;
        justify-content: center;
        max-width: 20rem;
        margin-left: auto;
        margin-right: auto;
    }

    body.page-home #contact-vio .flex.flex-wrap {
        flex-direction: column;
        align-items: center;
        gap: 0.65rem;
    }

    body.page-home #faq-preview + section .btn-neon-primary,
    body.page-home .premium-section .btn-neon-primary.inline-flex {
        width: 100%;
        max-width: 20rem;
        justify-content: center;
    }
}

/* ── Gallery CTA ── */
@media (max-width: 767px) {
    body.page-home .premium-section .text-center.mt-10 .btn-neon-primary {
        width: 100%;
        max-width: 20rem;
        justify-content: center;
    }
}
