/* ===============================================
   yilanfangtrade.com - Responsive Stylesheet
   Mobile, Tablet, Desktop Breakpoints
   =============================================== */

/* ============ Large Desktop (1440px+) ============ */
@media (min-width: 1440px) {
    :root {
        --container-padding: 2.5rem;
    }
    .container { max-width: 1500px; }
    .hero-title { font-size: clamp(4rem, 8vw, 10rem); }
}

/* ============ Desktop (1200px - 1440px) ============ */
@media (max-width: 1440px) {
    .container { max-width: 1200px; }
}

/* ============ Tablet Landscape (1024px - 1200px) ============ */
@media (max-width: 1200px) {
    :root {
        --container-padding: 1.5rem;
    }

    h1 { font-size: var(--fs-6xl); }
    h2 { font-size: var(--fs-4xl); }
    h3 { font-size: var(--fs-2xl); }

    .section { padding: var(--space-24) 0; }
    .section-lg { padding: var(--space-24) 0; }

    .hero { min-height: 90vh; }

    .navbar-menu a {
        padding: var(--space-2) var(--space-4);
        font-size: var(--fs-sm);
    }
}

/* ============ Tablet Portrait (768px - 1024px) ============ */
@media (max-width: 1024px) {
    :root {
        --fs-7xl: 3.5rem;
        --fs-6xl: 3rem;
        --fs-5xl: 2.5rem;
        --fs-4xl: 2rem;
        --space-32: 6rem;
        --space-20: 4rem;
    }

    .navbar-menu {
        display: none;
    }

    .navbar-toggle {
        display: flex;
    }

    .navbar-cta {
        display: none;
    }

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

    .footer-grid {
        grid-template-columns: 1fr 1fr;
        gap: var(--space-8);
    }

    .footer-brand {
        grid-column: 1 / -1;
        max-width: none;
    }

    .feature-grid,
    .app-showcase,
    .news-grid {
        grid-template-columns: repeat(2, 1fr);
    }

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

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

    .service-detail {
        grid-template-columns: 1fr;
        gap: var(--space-8);
    }

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

    .principles-list {
        grid-template-columns: 1fr;
    }

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

    .contact-grid {
        grid-template-columns: 1fr;
        gap: var(--space-12);
    }

    .legal-layout {
        grid-template-columns: 1fr;
    }

    .legal-sidebar {
        position: static;
        max-height: none;
    }

    .news-featured {
        grid-template-columns: 1fr;
    }

    .hero-device {
        width: 260px;
        height: 520px;
    }

    .hero-visual {
        height: 480px;
    }
}

/* ============ Mobile Landscape (640px - 768px) ============ */
@media (max-width: 768px) {
    :root {
        --fs-7xl: 2.75rem;
        --fs-6xl: 2.5rem;
        --fs-5xl: 2.25rem;
        --fs-4xl: 1.75rem;
        --fs-3xl: 1.5rem;
        --space-32: 5rem;
        --space-24: 4rem;
        --space-20: 3rem;
        --space-16: 2.5rem;
        --container-padding: 1.25rem;
    }

    body {
        font-size: 0.95rem;
    }

    .hero {
        min-height: 80vh;
        padding-top: calc(var(--nav-height) + 2rem);
    }

    .hero-title {
        font-size: clamp(2.5rem, 12vw, 4rem) !important;
    }

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

    .hero-actions .btn {
        width: 100%;
        justify-content: center;
    }

    .hero-stats {
        grid-template-columns: 1fr 1fr;
        gap: var(--space-4);
    }

    .hero-stat {
        padding-left: var(--space-4);
    }

    .hero-stat-value {
        font-size: var(--fs-3xl);
    }

    .section {
        padding: var(--space-16) 0;
    }

    .section-header {
        margin-bottom: var(--space-12);
    }

    .feature-grid,
    .app-showcase,
    .news-grid,
    .stats-grid,
    .value-grid,
    .principles-list,
    .advantage-grid {
        grid-template-columns: 1fr;
    }

    .footer-grid {
        grid-template-columns: 1fr;
        gap: var(--space-8);
    }

    .footer-bottom {
        flex-direction: column;
        text-align: center;
    }

    .footer-legal {
        flex-wrap: wrap;
        justify-content: center;
    }

    .marquee-item {
        font-size: var(--fs-2xl);
    }

    .code-block {
        font-size: var(--fs-xs);
        padding: var(--space-4);
    }

    .process-steps {
        grid-template-columns: 1fr;
    }

    .timeline {
        padding-left: var(--space-8);
    }

    .quote-block {
        padding: var(--space-6);
        font-size: var(--fs-base);
    }

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

    .cta-actions .btn {
        width: 100%;
    }

    .page-header {
        padding: calc(var(--nav-height) + var(--space-12)) 0 var(--space-12);
    }

    .filter-pills {
        overflow-x: auto;
        flex-wrap: nowrap;
        justify-content: flex-start;
        padding-bottom: var(--space-4);
        scrollbar-width: thin;
    }

    .filter-pill {
        white-space: nowrap;
        flex-shrink: 0;
    }

    .newsletter-form {
        flex-direction: column;
        padding: var(--space-3);
        border-radius: var(--radius-lg);
    }

    .newsletter-form button {
        width: 100%;
        padding: var(--space-4);
    }

    .hero-device {
        width: 220px;
        height: 440px;
    }

    .hero-visual {
        height: 400px;
    }

    .legal-content h2 {
        font-size: var(--fs-2xl);
    }

    .legal-content h3 {
        font-size: var(--fs-lg);
    }
}

/* ============ Mobile Portrait (480px and below) ============ */
@media (max-width: 480px) {
    :root {
        --fs-7xl: 2.25rem;
        --fs-6xl: 2rem;
        --fs-5xl: 1.75rem;
        --fs-4xl: 1.5rem;
        --container-padding: 1rem;
        --space-32: 4rem;
        --space-20: 2.5rem;
        --space-16: 2rem;
    }

    .navbar-logo {
        font-size: var(--fs-base);
    }

    .navbar-logo svg {
        width: 28px;
        height: 28px;
    }

    .hero-eyebrow {
        font-size: var(--fs-xs);
    }

    .hero-stats {
        grid-template-columns: 1fr;
        gap: var(--space-3);
    }

    .hero-stat {
        padding-left: var(--space-3);
    }

    .section-eyebrow {
        font-size: var(--fs-xs);
    }

    .btn {
        padding: var(--space-3) var(--space-6);
        font-size: var(--fs-sm);
    }

    .btn-lg {
        padding: var(--space-4) var(--space-6);
        font-size: var(--fs-base);
    }

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

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

    .hero-device {
        width: 200px;
        height: 400px;
    }

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

    .marquee-item {
        font-size: var(--fs-xl);
    }

    .legal-meta {
        flex-direction: column;
        gap: var(--space-4);
    }
}

/* ============ Touch Device Adjustments ============ */
@media (hover: none) {
    .cursor-dot, .cursor-ring {
        display: none !important;
    }

    .feature-card:hover,
    .app-card:hover,
    .news-card:hover,
    .advantage-card:hover,
    .value-card:hover {
        transform: none;
    }
}

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

    .hero-orb { animation: none; }
    .hero-device { animation: none; }
    .marquee-track { animation: none; }
    .scroll-mouse::before { animation: none; }
}

/* ============ High DPI Screens ============ */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
    body {
        -webkit-font-smoothing: antialiased;
        -moz-osx-font-smoothing: grayscale;
    }
}

/* ============ Landscape Mode on Mobile ============ */
@media (max-height: 500px) and (orientation: landscape) {
    .hero { min-height: 100vh; padding: 6rem 0 2rem; }
    .scroll-indicator { display: none; }
}

/* ============ Dark Mode Forced ============ */
@media (prefers-color-scheme: dark) {
    /* Our theme is already dark by default */
}

/* ============ Print Styles ============ */
@media print {
    .navbar, .footer, .hero-orb, .marquee, .scroll-indicator,
    .notification-bar, .cursor-dot, .cursor-ring {
        display: none !important;
    }

    body {
        background: white !important;
        color: black !important;
    }

    h1, h2, h3, h4, h5, h6, p, a, li {
        color: black !important;
    }

    .section { padding: 1rem 0; }

    a[href]::after {
        content: " (" attr(href) ")";
        font-size: 0.85em;
        color: #666;
    }
}

/* ============ Focus Visible (Accessibility) ============ */
*:focus-visible {
    outline: 2px solid var(--color-accent-primary);
    outline-offset: 4px;
    border-radius: var(--radius-sm);
}

button:focus-visible,
a:focus-visible {
    outline-offset: 2px;
}

/* ============ Skip to Main Content (Accessibility) ============ */
.skip-link {
    position: absolute;
    top: -100px;
    left: 0;
    padding: var(--space-3) var(--space-6);
    background: var(--color-accent-primary);
    color: var(--color-bg-primary);
    z-index: var(--z-modal);
    border-radius: 0 0 var(--radius-md) 0;
    font-weight: 600;
}

.skip-link:focus {
    top: 0;
}

/* ============ Container Queries Support ============ */
@supports (container-type: inline-size) {
    .feature-grid,
    .app-showcase {
        container-type: inline-size;
    }

    @container (max-width: 600px) {
        .feature-card,
        .app-card {
            padding: var(--space-4);
        }
    }
}

/* ============ Wide Ultra Screens (4K) ============ */
@media (min-width: 2000px) {
    :root {
        --fs-7xl: 6rem;
        --fs-8xl: 8rem;
        --fs-9xl: 10rem;
        --container-max: 1800px;
    }

    body {
        font-size: 1.125rem;
    }
}