/* ============================================
   RESPONSIVE -- All breakpoints, all pages
   ============================================ */

/* ===== LARGE TABLET (max 1100px) ===== */
@media (max-width: 1100px) {
    .footer-top {
        grid-template-columns: 1fr 1fr;
        gap: 30px;
    }

    .about-layout {
        grid-template-columns: 1fr;
        gap: 24px;
    }

    .packages-grid {
        grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    }

    .rush-grid {
        grid-template-columns: 1fr 1fr 1fr;
        gap: 16px;
    }

    .contact-info-grid {
        grid-template-columns: 1fr 1fr 1fr;
        gap: 16px;
    }
}

/* ===== TABLET (max 900px) ===== */
@media (max-width: 900px) {
    /* NAV MOBILE MENU */
    .nav-links {
        position: fixed;
        top: 0;
        right: -100%;
        width: 280px;
        height: 100vh;
        height: 100dvh;
        background: rgba(5, 5, 5, 0.98);
        flex-direction: column;
        padding: 100px 24px 40px;
        border-left: 1px solid var(--border);
        transition: right 0.4s var(--ease-out);
        z-index: var(--z-menu);
        gap: 4px;
        overflow-y: auto;
    }

    .nav-links.open {
        right: 0;
    }

    .hamburger {
        display: flex;
    }

    .nav-status {
        display: none;
    }

    /* Make nav links bigger on mobile for touch */
    .nav-link {
        font-size: 1rem;
        padding: 14px 16px;
        width: 100%;
    }

    /* GRIDS */
    .templates-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .packages-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .rush-grid {
        grid-template-columns: 1fr;
        gap: 16px;
    }

    .contact-info-grid {
        grid-template-columns: 1fr;
        gap: 16px;
    }

    /* HERO ADJUSTMENTS */
    .hero-stats {
        gap: 16px;
    }

    .stat-divider {
        display: none;
    }

    .hero-stats {
        justify-content: space-around;
    }

    /* FOOTER */
    .footer-top {
        grid-template-columns: 1fr;
        gap: 30px;
    }

    /* CTA OPTIONS */
    .cta-option {
        font-size: 0.85rem;
        padding: 12px 14px;
    }

    /* COMPARISON TABLE - make scrollable hint */
    .comparison-wrapper {
        position: relative;
    }

    .comparison-wrapper::after {
        content: '<< SCROLL >>';
        position: absolute;
        bottom: -28px;
        left: 50%;
        transform: translateX(-50%);
        font-family: var(--font-pixel);
        font-size: 0.6rem;
        color: var(--text-dark);
        letter-spacing: 3px;
    }

    .comparison-section {
        margin-bottom: 40px;
    }
}

/* ===== MOBILE (max 680px) ===== */
@media (max-width: 680px) {
    .container {
        padding: 0 16px;
    }

    .section {
        padding: 60px 0;
    }

    /* HERO */
    .hero {
        padding-top: calc(var(--nav-h) + 20px);
        padding-bottom: 30px;
        min-height: auto;
        min-height: 100dvh;
    }

    .hero-title {
        font-size: clamp(2rem, 10vw, 2.8rem);
    }

    .title-sub {
        font-size: clamp(0.85rem, 3vw, 1.1rem);
        letter-spacing: 3px;
    }

    .hero-subtitle {
        font-size: 0.85rem;
        line-height: 1.9;
    }

    .hero-badge {
        font-size: 0.42rem;
        padding: 6px 12px;
        letter-spacing: 2px;
    }

    /* TERMINAL */
    .hero-terminal {
        margin-bottom: 24px;
    }

    .terminal-body {
        padding: 14px;
        font-size: 0.78rem;
        line-height: 1.7;
        min-height: 80px;
    }

    .terminal-header {
        padding: 8px 12px;
    }

    .terminal-dot {
        width: 8px;
        height: 8px;
    }

    .terminal-title {
        font-size: 0.65rem;
    }

    /* STATS */
    .hero-stats {
        flex-direction: row;
        flex-wrap: wrap;
        justify-content: center;
        gap: 12px;
        margin-bottom: 24px;
    }

    .stat-number {
        font-size: 1.6rem;
    }

    .stat-bracket {
        font-size: 1.2rem;
    }

    .stat-label {
        font-size: 0.35rem;
        letter-spacing: 1px;
    }

    .stat-plus {
        font-size: 1rem;
    }

    /* BUTTONS */
    .hero-buttons {
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
        margin-bottom: 30px;
    }

    .hero-buttons .btn {
        justify-content: center;
        padding: 14px 20px;
        font-size: 0.85rem;
    }

    .btn {
        padding: 12px 20px;
        font-size: 0.85rem;
    }

    .btn-small {
        padding: 8px 12px;
        font-size: 0.72rem;
    }

    /* SCROLL INDICATOR */
    .hero-scroll-indicator {
        margin-top: 10px;
    }

    .scroll-text {
        font-size: 0.35rem;
    }

    /* SECTION HEADERS */
    .section-title {
        font-size: clamp(1.5rem, 5vw, 2.2rem);
    }

    .section-label {
        font-size: 0.45rem;
        letter-spacing: 3px;
    }

    .section-desc {
        font-size: 0.85rem;
    }

    /* DIVIDERS */
    .section-divider {
        padding: 0 16px;
        gap: 12px;
    }

    .divider-text {
        font-size: 0.4rem;
        letter-spacing: 2px;
    }

    /* ABOUT */
    .about-body {
        font-size: 0.8rem;
        line-height: 1.8;
    }

    .about-key {
        font-size: 0.78rem;
    }

    .about-text {
        font-size: 0.8rem;
    }

    .about-card-header {
        font-size: 0.82rem;
        padding: 12px 16px;
    }

    .about-card-body {
        padding: 16px;
    }

    .skill-name {
        font-size: 0.78rem;
    }

    .deliver-item {
        font-size: 0.78rem;
    }

    /* FILTER BAR */
    .filter-bar-inner {
        gap: 6px;
        justify-content: flex-start;
        overflow-x: auto;
        padding-bottom: 8px;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
    }

    .filter-bar-inner::-webkit-scrollbar {
        display: none;
    }

    .filter-label {
        display: none;
    }

    .filter-btn {
        font-size: 0.7rem;
        padding: 8px 10px;
        white-space: nowrap;
        flex-shrink: 0;
    }

    .filter-count {
        font-size: 0.32rem;
        padding: 1px 4px;
    }

    /* TEMPLATE CARDS */
    .templates-grid {
        grid-template-columns: 1fr;
        gap: 16px;
    }

    .template-preview {
        height: 200px;
    }

    .template-info {
        padding: 16px;
    }

    .template-name {
        font-size: 1.1rem;
    }

    .template-desc {
        font-size: 0.75rem;
    }

    .template-category {
        font-size: 0.6rem;
    }

    .template-id {
        font-size: 0.6rem;
    }

    .template-price {
        font-size: 1.1rem;
    }

    .template-delivery {
        font-size: 0.68rem;
    }

    .tag {
        font-size: 0.58rem;
        padding: 2px 5px;
    }

    .template-badge {
        font-size: 0.65rem;
        padding: 4px 8px;
    }

    .preview-btn {
        font-size: 0.75rem;
        padding: 8px 16px;
    }

    /* PACKAGES */
    .package-header,
    .package-body,
    .package-footer {
        padding-left: 16px;
        padding-right: 16px;
    }

    .package-amount {
        font-size: 2.8rem;
    }

    .package-tier-label {
        font-size: 0.8rem;
        letter-spacing: 3px;
    }

    .package-pages {
        font-size: 0.85rem;
        padding: 8px;
    }

    .feature-item {
        font-size: 0.75rem;
        padding: 5px 0;
        gap: 8px;
    }

    .feature-marker {
        font-size: 0.75rem;
    }

    .features-heading {
        font-size: 0.7rem;
    }

    .package-ideal {
        font-size: 0.75rem;
        padding: 10px;
    }

    .package-delivery {
        font-size: 0.72rem;
        padding: 5px 10px;
    }

    .featured-ribbon {
        font-size: 0.6rem;
        padding: 4px 10px;
        right: 14px;
    }

    .btn-package {
        font-size: 0.85rem;
        padding: 12px;
    }

    /* RUSH CARDS */
    .rush-card-amount {
        font-size: 2.5rem;
    }

    .rush-card-tier {
        font-size: 0.85rem;
    }

    .rush-card-body {
        padding: 22px 18px;
    }

    .rush-detail-row {
        font-size: 0.78rem;
    }

    .rush-note {
        font-size: 0.78rem;
        padding: 16px;
    }

    .rush-title {
        font-size: 1.5rem;
    }

    .rush-subtitle {
        font-size: 0.85rem;
    }

    /* COMPARISON TABLE */
    .comparison-title {
        font-size: 1.1rem;
    }

    .comparison-table th {
        font-size: 0.78rem;
        padding: 10px 12px;
    }

    .comparison-table td {
        font-size: 0.72rem;
        padding: 8px 12px;
    }

    .comparison-table tfoot td {
        font-size: 0.9rem;
        padding: 14px 12px;
    }

    /* PAGE HERO (packages + contact pages) */
    .page-hero {
        padding: calc(var(--nav-h) + 30px) 0 24px;
    }

    .page-title {
        font-size: clamp(1.5rem, 6vw, 2rem);
    }

    .page-subtitle {
        font-size: 0.82rem;
        line-height: 1.9;
    }

    .page-breadcrumb {
        font-size: 0.7rem;
        margin-bottom: 16px;
    }

    /* CONTACT PAGE */
    .email-big-body {
        padding: 16px;
    }

    .email-big-address {
        font-size: clamp(1rem, 5vw, 1.5rem);
        letter-spacing: 1px;
    }

    .email-big-copy {
        padding: 24px 14px;
        gap: 14px;
    }

    .email-big-arrow {
        font-size: 1rem;
    }

    .email-big-hint {
        font-size: 0.72rem;
        letter-spacing: 2px;
    }

    .email-big-ascii {
        font-size: 0.4rem;
    }

    .email-cmd-line {
        font-size: 0.78rem;
    }

    .contact-info-header {
        font-size: 0.8rem;
        padding: 12px 16px;
    }

    .contact-info-body {
        padding: 16px;
    }

    .ci-label {
        font-size: 0.78rem;
    }

    .ci-value {
        font-size: 0.78rem;
    }

    .process-step {
        font-size: 0.75rem;
        padding: 8px 0;
    }

    .wti-body {
        padding: 18px;
    }

    .wti-title {
        font-size: 0.95rem;
    }

    .wti-item {
        font-size: 0.8rem;
    }

    .wti-note {
        font-size: 0.8rem;
    }

    .contact-bottom-cta {
        flex-direction: column;
        align-items: stretch;
    }

    .contact-bottom-cta .btn {
        justify-content: center;
    }

    .pkg-bottom-cta .btn {
        font-size: 0.85rem;
    }

    .pkg-cta-text {
        font-size: 0.9rem;
    }

    /* CTA SECTION */
    .cta-body {
        padding: 16px;
    }

    .cta-line {
        font-size: 0.8rem;
    }

    .cta-option {
        font-size: 0.8rem;
        padding: 12px;
        gap: 8px;
    }

    .cta-option-arrow {
        display: none;
    }

    /* NO RESULTS */
    .no-results {
        padding: 40px 16px;
    }

    .no-results-text {
        font-size: 0.85rem;
    }

    /* FOOTER */
    .footer-top {
        grid-template-columns: 1fr;
        gap: 24px;
        padding: 40px 0 30px;
    }

    .footer-bottom {
        flex-direction: column;
        gap: 8px;
        text-align: center;
        padding: 16px 0;
    }

    .footer-logo {
        font-size: 1.2rem;
    }

    .footer-tagline {
        font-size: 0.75rem;
    }

    .footer-nav-title {
        font-size: 0.68rem;
    }

    .footer-link {
        font-size: 0.75rem;
    }

    .footer-copyright {
        font-size: 0.62rem;
    }

    .footer-credit {
        font-size: 0.62rem;
    }

    .footer-email {
        font-size: 0.75rem;
    }

    /* FLOATING UI */
    .beep-indicator {
        display: none;
    }

    .sound-toggle {
        bottom: 14px;
        left: 14px;
        padding: 6px 10px;
        font-size: 0.6rem;
    }

    .scroll-top {
        bottom: 14px;
        right: 14px;
        width: 32px;
        height: 32px;
        font-size: 0.9rem;
    }

    /* BOOT SCREEN */
    .boot-ascii {
        font-size: 0.22rem;
    }

    .boot-tagline {
        font-size: 0.4rem;
        letter-spacing: 3px;
    }

    .boot-text {
        font-size: 0.8rem;
        min-height: 220px;
        line-height: 1.8;
    }

    .boot-progress {
        width: 220px;
    }

    .boot-skip-btn {
        font-size: 0.6rem;
    }

    /* PAYMENT NOTICE */
    .payment-notice {
        font-size: 0.7rem;
        padding: 10px 16px;
        letter-spacing: 1px;
    }
}

/* ===== SMALL MOBILE (max 400px) ===== */
@media (max-width: 400px) {
    .container {
        padding: 0 12px;
    }

    .hero-title {
        font-size: 1.8rem;
    }

    .title-sub {
        font-size: 0.8rem;
        letter-spacing: 2px;
    }

    .nav-logo {
        font-size: 1rem;
    }

    .nav-inner {
        padding: 0 12px;
    }

    .package-amount {
        font-size: 2.2rem;
    }

    .rush-card-amount {
        font-size: 2rem;
    }

    .email-big-address {
        font-size: 0.95rem;
    }

    .page-title {
        font-size: 1.4rem;
    }

    .stat-number {
        font-size: 1.4rem;
    }

    .stat-bracket {
        font-size: 1rem;
    }

    .hero-buttons .btn {
        font-size: 0.78rem;
        padding: 12px 16px;
    }

    .template-preview {
        height: 170px;
    }

    .boot-ascii {
        display: none;
    }

    .boot-tagline {
        font-size: 0.38rem;
        margin-bottom: 20px;
    }
}

/* ===== TOUCH DEVICE IMPROVEMENTS ===== */
@media (hover: none) and (pointer: coarse) {
    /* Show preview button always on touch (no hover) */
    .preview-hover-actions {
        opacity: 1;
        transform: translateY(0);
    }

    /* Remove hover transforms that feel janky on touch */
    .template-card:hover {
        transform: none;
    }

    .package-card:hover {
        transform: none;
    }

    .rush-card:hover {
        transform: none;
    }

    .btn:hover {
        transform: none;
    }

    /* Make touch targets bigger */
    .nav-link {
        min-height: 44px;
        display: flex;
        align-items: center;
    }

    .filter-btn {
        min-height: 40px;
    }

    .btn {
        min-height: 44px;
    }

    .cta-option {
        min-height: 48px;
    }

    .quick-pkg-btn {
        min-height: 44px;
    }

    /* Active states instead of hover for touch */
    .btn:active {
        border-color: var(--green);
        box-shadow: 0 0 15px var(--green-glow);
    }

    .template-card:active {
        border-color: var(--border-hover);
    }

    .filter-btn:active {
        color: var(--green);
        border-color: var(--green);
        background: var(--green-glow);
    }

    .cta-option:active {
        border-color: var(--green);
        background: var(--green-glow);
        color: var(--green);
    }

    .email-big-copy:active {
        border-color: var(--green);
        background: rgba(0, 255, 65, 0.08);
        box-shadow: 0 0 30px var(--green-glow);
    }

    /* Prevent text selection on interactive elements */
    .email-big-copy,
    .cta-option,
    .filter-btn,
    .btn {
        -webkit-user-select: none;
        user-select: none;
    }
}

/* ===== LANDSCAPE PHONE ===== */
@media (max-height: 500px) and (orientation: landscape) {
    .hero {
        min-height: auto;
        padding-top: calc(var(--nav-h) + 16px);
        padding-bottom: 20px;
    }

    .hero-scroll-indicator {
        display: none;
    }

    .hero-terminal {
        display: none;
    }

    .hero-stats {
        margin-bottom: 16px;
    }

    .boot-screen {
        display: none !important;
    }

    .page-hero {
        padding: calc(var(--nav-h) + 20px) 0 16px;
    }
}

/* ===== SAFE AREA (notch devices) ===== */
@supports (padding: env(safe-area-inset-bottom)) {
    .nav {
        padding-left: env(safe-area-inset-left);
        padding-right: env(safe-area-inset-right);
    }

    .footer-bottom {
        padding-bottom: calc(16px + env(safe-area-inset-bottom));
    }

    .beep-indicator {
        bottom: calc(20px + env(safe-area-inset-bottom));
    }

    .sound-toggle {
        bottom: calc(14px + env(safe-area-inset-bottom));
    }

    .scroll-top {
        bottom: calc(14px + env(safe-area-inset-bottom));
    }

    .nav-links {
        padding-bottom: calc(40px + env(safe-area-inset-bottom));
    }
}

/* ===== REDUCE MOTION ===== */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }

    .reveal {
        opacity: 1;
        transform: none;
        transition: none;
    }

    .cursor-blink {
        animation: none;
        opacity: 1;
    }

    .preview-scanline {
        display: none;
    }

    .matrix-canvas {
        display: none;
    }

    .particle-canvas {
        display: none;
    }

    html {
        scroll-behavior: auto;
    }
}

/* ===== PRINT ===== */
@media print {
    body::before,
    body::after,
    .matrix-canvas,
    .particle-canvas,
    .nav,
    .boot-screen,
    .beep-indicator,
    .sound-toggle,
    .scroll-top,
    .hero-grid,
    .footer-grid-bg,
    .preview-scanline,
    .preview-crt-flicker,
    .preview-overlay,
    .cursor-blink {
        display: none !important;
    }

    body {
        background: white;
        color: black;
    }

    .glow,
    .glow-intense {
        text-shadow: none;
    }

    * {
        color: black !important;
        border-color: #ccc !important;
        background: white !important;
        box-shadow: none !important;
    }
}