/* ═══════════════════════════════════════════════════════════
   POLYGON FOX — COMPREHENSIVE RESPONSIVE DESIGN
   Mobile-first approach with breakpoints for all devices
   ═══════════════════════════════════════════════════════════ */

/* ─────────────────────────────────────────
   BREAKPOINTS:
   - Mobile: < 768px
   - Tablet: 768px - 1023px
   - Desktop: 1024px+
   ───────────────────────────────────────── */

/* ═══════════════════════════════════════════
   MOBILE OPTIMIZATIONS (< 768px)
   ═══════════════════════════════════════════ */

@media (max-width: 767px) {
    /* ── Global adjustments ── */
    body {
        cursor: auto;
        font-size: 15px;
    }

    .cursor-dot,
    .cursor-outline {
        display: none !important;
    }

    /* ── Container padding ── */
    .container {
        padding-left: 1.25rem;
        padding-right: 1.25rem;
    }

    /* ── Hero Section ── */
    #hero {
        min-height: 85vh;
        padding-top: 5rem;
    }

    .hero-grid {
        grid-template-columns: 1fr;
        gap: 2.5rem;
        padding: 2rem 1.25rem;
    }

    .hero-content {
        text-align: center;
    }

    .hero-title {
        font-size: clamp(2rem, 10vw, 3rem);
        line-height: 1.1;
    }

    .hero-line {
        margin-left: auto;
        margin-right: auto;
    }

    .hero-buttons {
        flex-direction: column;
        gap: 0.75rem;
        width: 100%;
    }

    .hero-buttons .btn {
        width: 100%;
        justify-content: center;
        padding: 1rem 1.5rem;
    }

    .hero-logo-wrap {
        order: -1;
        max-width: 280px;
        margin: 0 auto;
    }

    .scroll-indicator {
        font-size: 0.7rem;
        bottom: 1.5rem;
    }

    /* ── Navbar Mobile ── */
    .navbar-inner {
        padding: 0 1.25rem;
        height: 4rem;
    }

    .navbar-brand img {
        height: 1.75rem;
    }

    .mobile-menu {
        padding: 1.5rem;
    }

    .mobile-menu-inner {
        gap: 0.5rem;
    }

    /* ── Split Sections (About, Why Us, etc.) ── */
    .split-section {
        padding: 3rem 0;
    }

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

    .visual-content {
        order: -1;
        width: 100%;
    }

    .visual-glass {
        padding: 2rem;
        width: 80%;
        max-width: 80%;
        margin: 0 auto;
    }

    .visual-glass img {
        max-width: 100%;
    }

    .text-content__title {
        font-size: clamp(1.75rem, 8vw, 2.5rem);
    }

    .text-content__desc {
        font-size: 0.95rem;
    }

    .text-content__actions {
        flex-direction: column;
        gap: 0.75rem;
    }

    .text-content__actions .btn {
        width: 100%;
        justify-content: center;
    }

    /* ── Services Section ── */
    .service-modules-section {
        padding: 3rem 0;
    }

    .service-modules-header {
        margin-bottom: 2.5rem;
    }

    .service-modules-title {
        font-size: clamp(1.75rem, 8vw, 2.5rem);
    }

    .service-modules-subtitle {
        font-size: 0.85rem;
    }

    .service-modules-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
        padding: 0 0.5rem;
    }

    .service-crate {
        padding: 1.75rem 1.5rem;
    }

    .service-crate-title {
        font-size: 1.1rem;
    }

    .service-desc {
        font-size: 0.9rem;
    }

    .service-crate-footer {
        flex-direction: column;
        gap: 1rem;
        align-items: stretch;
    }

    .service-equip-btn {
        width: 100%;
        justify-content: center;
    }

    /* ── System Soul Section ── */
    .soul-section {
        padding: 3rem 0;
    }

    .soul-two-col {
        grid-template-columns: 1fr;
        gap: 2rem;
    }

    .soul-ide-panel {
        max-height: 400px;
        font-size: 0.7rem;
    }

    .soul-info-col {
        gap: 1rem;
    }

    .soul-info-card {
        padding: 1.25rem;
    }

    .soul-hint-tag {
        font-size: 0.7rem;
    }

    /* ── Stats Section ── */
    .stats-section {
        padding: 3rem 0;
    }

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

    .stat-value {
        font-size: 2rem;
    }

    .stat-label {
        font-size: 0.7rem;
    }

    /* ── Portfolio Section ── */
    .portfolio-preview-grid {
        grid-template-columns: 1fr;
        gap: 1.25rem;
    }

    /* ── Testimonials ── */
    .testimonials-section {
        padding: 3rem 0;
    }

    .testimonials-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }

    .testimonial-card {
        padding: 1.75rem;
    }

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

    /* ── Packages Section ── */
    .service-feature-list {
        font-size: 0.85rem;
    }

    /* ── CTA Section ── */
    .global-cta-section {
        padding: 3rem 0;
    }

    .global-cta-card {
        padding: 3rem 1.5rem;
        margin: 0 1rem;
        border-radius: 24px;
    }

    .global-cta-title {
        font-size: clamp(1.75rem, 9vw, 2.5rem);
        margin-bottom: 1.5rem;
    }

    .global-cta-sub {
        font-size: 0.85rem;
        margin-bottom: 2rem;
    }

    .cta-stats-row {
        gap: 1rem;
        margin-bottom: 2rem;
    }

    .cta-stat__num {
        font-size: 1.5rem;
    }

    .cta-stat__label {
        font-size: 0.55rem;
    }

    .cta-stat-divider {
        display: none;
    }

    .global-cta-actions {
        flex-direction: column;
        gap: 0.75rem;
    }

    .global-cta-btn {
        width: 100%;
        justify-content: center;
        padding: 1rem 1.5rem;
        font-size: 0.7rem;
    }

    .cta-corner {
        width: 16px;
        height: 16px;
    }

    .cta-corner--tl,
    .cta-corner--tr,
    .cta-corner--bl,
    .cta-corner--br {
        top: 12px;
        left: 12px;
        right: 12px;
        bottom: 12px;
    }

    /* ── Footer ── */
    .site-footer {
        padding: 3rem 0 2rem;
    }

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

    .footer-brand {
        text-align: center;
    }

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

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

    .footer-column {
        text-align: center;
    }

    .footer-links,
    .footer-contact {
        align-items: center;
    }

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

    .footer-legal {
        flex-direction: column;
        gap: 0.75rem;
    }

    /* ── Contact Page ── */
    .contact-cards-grid {
        grid-template-columns: 1fr;
        gap: 1.25rem;
    }

    .contact-info-card {
        padding: 1.75rem 1.5rem;
    }

    .cic-icon-wrap {
        width: 3.5rem;
        height: 3.5rem;
        font-size: 1.25rem;
    }

    .terminal {
        padding: 1.5rem;
    }

    .terminal__header {
        padding: 0.75rem 1rem;
    }

    .terminal__body {
        padding: 1.5rem;
    }

    .form-group {
        margin-bottom: 1.25rem;
    }

    .form-input,
    .form-textarea {
        font-size: 0.9rem;
        padding: 0.875rem 1rem;
    }

    /* ── Portfolio Page ── */
    .portfolio-filter-bar {
        gap: 0.5rem;
        justify-content: center;
    }

    .pf-filter-btn {
        font-size: 0.75rem;
        padding: 0.5rem 1rem;
    }

    .portfolio-vault-grid,
    .portfolio-grid {
        grid-template-columns: 1fr;
        gap: 1.25rem;
    }

    .vault-card,
    .portfolio-card {
        max-width: 100%;
    }

    /* ── Arsenal Cards (Services) ── */
    .arsenal-grid {
        grid-template-columns: 1fr;
        gap: 1.25rem;
    }

    .arsenal-card {
        padding: 1.75rem 1.5rem;
    }

    /* ── Tech Stack ── */
    .tech-stack-grid {
        gap: 0.75rem;
    }

    .tech-pill {
        font-size: 0.75rem;
        padding: 0.5rem 1rem;
    }

    /* ── Tilt Features ── */
    .tilt-cards-grid {
        grid-template-columns: 1fr;
        gap: 1.25rem;
    }

    .tilt-card {
        padding: 1.75rem 1.5rem;
    }

    /* ── FAQ Section ── */
    .faq-list {
        gap: 0.875rem;
    }

    .faq-question {
        font-size: 0.95rem;
        padding: 1rem 1.25rem;
    }

    .faq-answer {
        padding: 1rem 1.25rem;
        font-size: 0.875rem;
    }

    /* ── Buttons ── */
    .btn {
        font-size: 0.7rem;
        padding: 0.75rem 1.5rem;
    }

    /* ── Section Numbers ── */
    .section-number {
        font-size: 6rem;
        opacity: 0.03;
    }

    /* ── Decorative Elements ── */
    .deco-blur-circle {
        width: 80vw;
        height: 80vw;
    }

    .section-blur {
        width: 60vw;
        height: 60vw;
    }

}

/* ═══════════════════════════════════════════
   TABLET OPTIMIZATIONS (768px - 1023px)
   ═══════════════════════════════════════════ */

@media (min-width: 768px) and (max-width: 1023px) {
    /* ── Container ── */
    .container {
        padding-left: 2rem;
        padding-right: 2rem;
    }

    /* ── Hero ── */
    .hero-grid {
        grid-template-columns: 1fr;
        gap: 3rem;
        padding: 3rem 2rem;
    }

    .hero-content {
        text-align: center;
    }

    .hero-line {
        margin-left: auto;
        margin-right: auto;
    }

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

    .hero-logo-wrap {
        max-width: 400px;
        margin: 0 auto;
    }

    /* ── Services Grid ── */
    .service-modules-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 2rem;
    }

    /* ── Stats Grid ── */
    .stats-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 2rem;
    }

    /* ── Portfolio Grid ── */
    .portfolio-preview-grid,
    .portfolio-vault-grid,
    .portfolio-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 1.5rem;
    }

    /* ── Testimonials ── */
    .testimonials-grid {
        grid-template-columns: 1fr;
        gap: 2rem;
    }

    /* ── Split Sections ── */
    .split-section__inner {
        gap: 3rem;
    }

    .visual-content {
        width: 100%;
    }

    .visual-glass {
        width: 80%;
        max-width: 80%;
        margin: 0 auto;
    }

    /* ── Soul Section ── */
    .soul-two-col {
        gap: 2.5rem;
    }

    /* ── Footer ── */
    .footer-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 3rem;
    }

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

    /* ── Contact Cards ── */
    .contact-cards-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    /* ── Arsenal Cards ── */
    .arsenal-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 1.5rem;
    }

    /* ── Tilt Cards ── */
    .tilt-cards-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 1.5rem;
    }
}

/* ═══════════════════════════════════════════
   LARGE TABLET / SMALL DESKTOP (1024px - 1279px)
   ═══════════════════════════════════════════ */

@media (min-width: 1024px) and (max-width: 1279px) {
    /* ── Services Grid ── */
    .service-modules-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 2rem;
    }

    /* ── Stats Grid ── */
    .stats-grid {
        grid-template-columns: repeat(5, 1fr);
        gap: 1.5rem;
    }

    /* ── Portfolio Grid ── */
    .portfolio-preview-grid,
    .portfolio-vault-grid,
    .portfolio-grid {
        grid-template-columns: repeat(3, 1fr);
    }

    /* ── Testimonials ── */
    .testimonials-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    /* ── Arsenal Grid ── */
    .arsenal-grid {
        grid-template-columns: repeat(3, 1fr);
    }

    /* ── Tilt Cards ── */
    .tilt-cards-grid {
        grid-template-columns: repeat(3, 1fr);
    }

    /* ── Contact Cards ── */
    .contact-cards-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* ═══════════════════════════════════════════
   EXTRA SMALL MOBILE (< 480px)
   ═══════════════════════════════════════════ */

@media (max-width: 479px) {
    /* ── Typography ── */
    .hero-title {
        font-size: 2rem;
        letter-spacing: -0.02em;
    }

    .global-cta-title {
        font-size: 1.6rem;
        letter-spacing: -0.01em;
    }

    .service-modules-title,
    .text-content__title {
        font-size: 1.5rem;
    }

    /* ── Spacing ── */
    .container {
        padding-left: 1rem;
        padding-right: 1rem;
    }

    .hero-grid {
        padding: 1.5rem 1rem;
    }

    /* ── Stats Grid ── */
    .stats-grid {
        grid-template-columns: 1fr;
        gap: 1.25rem;
    }

    /* ── Services ── */
    .service-crate {
        padding: 1.5rem 1.25rem;
    }

    /* ── CTA ── */
    .global-cta-card {
        padding: 2.5rem 1.25rem;
    }

    .cta-stats-row {
        flex-direction: column;
        gap: 1.5rem;
    }

    /* ── Footer ── */
    .footer-social__link {
        width: 2.5rem;
        height: 2.5rem;
        font-size: 0.9rem;
    }

    /* ── Portfolio ── */
    .pf-filter-btn {
        font-size: 0.7rem;
        padding: 0.45rem 0.875rem;
    }

    /* ── Contact ── */
    .terminal__title {
        font-size: 0.7rem;
    }

    .form-submit-btn {
        width: 100%;
        justify-content: center;
    }

    /* ── Arsenal/Tilt Cards ── */
    .arsenal-card__title,
    .tilt-card__title {
        font-size: 1rem;
    }

    .arsenal-card__desc,
    .tilt-card__desc {
        font-size: 0.85rem;
    }
}

/* ═══════════════════════════════════════════
   LANDSCAPE MOBILE FIXES
   ═══════════════════════════════════════════ */

@media (max-height: 600px) and (orientation: landscape) {
    #hero {
        min-height: auto;
        padding: 6rem 0 3rem;
    }

    .hero-grid {
        grid-template-columns: 1fr 1fr;
        gap: 2rem;
    }

    .hero-logo-wrap {
        max-width: 250px;
    }

    .scroll-indicator {
        display: none;
    }
}

/* ═══════════════════════════════════════════
   TOUCH DEVICE OPTIMIZATIONS
   ═══════════════════════════════════════════ */

@media (hover: none) and (pointer: coarse) {
    /* Remove hover effects on touch devices */
    .interactable:hover {
        transform: none;
    }

    .btn:hover {
        transform: none;
    }

    .service-crate:hover,
    .contact-info-card:hover,
    .arsenal-card:hover,
    .tilt-card:hover,
    .vault-card:hover,
    .portfolio-card:hover {
        transform: none;
    }

    /* Increase tap targets */
    .btn,
    .nav-link,
    .mobile-menu-link,
    .footer-link,
    .pf-filter-btn,
    .faq-question {
        min-height: 44px;
        display: inline-flex;
        align-items: center;
    }

    /* Disable custom cursor */
    body {
        cursor: auto !important;
    }

    .cursor-dot,
    .cursor-outline {
        display: none !important;
    }

    /* Better touch feedback */
    .btn:active,
    .pf-filter-btn:active,
    .faq-question:active {
        opacity: 0.7;
    }
}

/* ═══════════════════════════════════════════
   HIGH DPI / RETINA DISPLAYS
   ═══════════════════════════════════════════ */

@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
    /* Sharper borders and shadows */
    .global-cta-card,
    .service-crate,
    .visual-glass {
        border-width: 0.5px;
    }

    /* Optimize text rendering */
    body {
        -webkit-font-smoothing: antialiased;
        -moz-osx-font-smoothing: grayscale;
    }
}

/* ═══════════════════════════════════════════
   PRINT STYLES
   ═══════════════════════════════════════════ */

@media print {
    /* Hide non-essential elements */
    .navbar,
    .mobile-menu,
    .scroll-indicator,
    .global-cta-section,
    .cursor-dot,
    .cursor-outline,
    .deco-blur-circle,
    .section-blur,
    #boot-screen {
        display: none !important;
    }

    /* Optimize for print */
    body {
        background: white;
        color: black;
    }

    .container {
        max-width: 100%;
    }

    /* Ensure readable text */
    h1, h2, h3, h4, h5, h6,
    .text-content__title,
    .hero-title {
        color: black;
        page-break-after: avoid;
    }

    p {
        color: #333;
    }

    /* Remove animations */
    * {
        animation: none !important;
        transition: none !important;
    }
}

/* ═══════════════════════════════════════════
   ACCESSIBILITY ENHANCEMENTS
   ═══════════════════════════════════════════ */

@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;
    }

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

/* High contrast mode */
@media (prefers-contrast: high) {
    :root {
        --fox-cyan: #00ffff;
    }

    .btn,
    .service-crate,
    .global-cta-card,
    .contact-info-card,
    .arsenal-card,
    .tilt-card {
        border-width: 2px;
    }

    .text-content__desc,
    .global-cta-sub,
    p {
        color: rgba(255, 255, 255, 0.9);
    }
}

/* ═══════════════════════════════════════════
   DESKTOP LARGE SCREENS (> 1600px)
   ═══════════════════════════════════════════ */

@media (min-width: 1600px) {
    .container {
        max-width: 1400px;
    }

    .hero-grid {
        max-width: 1400px;
    }

    .portfolio-vault-grid,
    .portfolio-grid {
        grid-template-columns: repeat(4, 1fr);
    }

    .arsenal-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 2rem;
    }

    .tilt-cards-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 2rem;
    }
}
