/* ==========================================================================
   Responsive Styles - War 2050
   ========================================================================== */

/* ==========================================================================
   Large screens (max-width: 1280px)
   ========================================================================== */
@media (max-width: 1280px) {
    :root {
        --font-size-7xl: 4rem;
        --font-size-6xl: 3.25rem;
        --font-size-5xl: 2.5rem;
    }

    .hero-stats {
        gap: var(--space-8);
    }
}

/* ==========================================================================
   Medium screens / Tablets (max-width: 1024px)
   ========================================================================== */
@media (max-width: 1024px) {
    /* Navigation */
    .nav-menu {
        position: fixed;
        top: 0;
        right: -100%;
        width: 280px;
        height: 100vh;
        flex-direction: column;
        align-items: flex-start;
        gap: var(--space-4);
        padding: var(--space-24) var(--space-6);
        background: var(--color-primary-900);
        border-left: 1px solid var(--border-color);
        transition: right var(--transition-base);
        z-index: var(--z-modal);
    }

    .nav-menu.active {
        right: 0;
    }

    .nav-actions {
        display: none;
    }

    .mobile-menu-toggle {
        display: flex;
    }

    /* Show auth buttons in mobile menu */
    .nav-menu-auth {
        display: flex;
    }

    /* Hero */
    .hero-stats {
        gap: var(--space-6);
    }

    .stat-number {
        font-size: var(--font-size-3xl);
    }

    /* Ranks Timeline — badge moves into a real left gutter and every card
       reads left-to-right. The badge stays a grid item (it used to become
       `position: absolute; left: 0`, which is what put it on top of the rank
       titles between 769px and 1024px); the line is derived from the gutter
       width so the two cannot drift apart. */
    .ranks-timeline {
        --rank-gutter: 104px;
        --rank-col-gap: var(--space-5);
    }

    .timeline-line {
        left: calc(var(--rank-gutter) / 2);
    }

    .rank-card {
        grid-template-columns: var(--rank-gutter) 1fr;
    }

    .rank-card .rank-badge,
    .rank-card:nth-of-type(even) .rank-badge {
        grid-column: 1;
    }

    .rank-card .rank-content,
    .rank-card:nth-of-type(even) .rank-content {
        grid-column: 2;
        text-align: left;
        align-items: flex-start;
    }

    .rank-card .rank-ladder,
    .rank-card:nth-of-type(even) .rank-ladder,
    .rank-card .rank-unlocks,
    .rank-card:nth-of-type(even) .rank-unlocks {
        justify-content: flex-start;
    }

    .rank-description {
        max-width: none;
    }

    /* Gameplay */
    .gameplay-thumbnails {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* ==========================================================================
   Small screens / Mobile (max-width: 768px)
   ========================================================================== */
@media (max-width: 768px) {
    :root {
        --font-size-7xl: 3rem;
        --font-size-6xl: 2.5rem;
        --font-size-5xl: 2rem;
        --font-size-4xl: 1.75rem;
        --font-size-3xl: 1.5rem;
    }

    /* Spacing adjustments */
    .section-container {
        padding: 0 var(--space-4);
    }

    /* Hero Section */
    .hero {
        padding: var(--space-20) var(--space-4);
        min-height: auto;
        padding-top: calc(var(--space-20) + 60px);
    }

    .hero-badge {
        margin-bottom: var(--space-6);
    }

    .title-main {
        font-size: var(--font-size-5xl);
        flex-direction: column;
    }

    .title-year {
        display: block;
        margin-left: 0;
        margin-top: var(--space-2);
    }

    .title-tagline {
        font-size: var(--font-size-lg);
        letter-spacing: 0.1em;
    }

    .hero-subtitle {
        font-size: var(--font-size-base);
        margin-bottom: var(--space-8);
    }

    .hero-cta {
        flex-direction: column;
        align-items: center;
        gap: var(--space-3);
        margin-bottom: var(--space-12);
    }

    .btn-large {
        width: 100%;
        max-width: 280px;
        justify-content: center;
    }

    .hero-stats {
        flex-direction: column;
        gap: var(--space-6);
        padding-top: var(--space-6);
    }

    .stat-number {
        font-size: var(--font-size-3xl);
    }

    .hero-scroll-indicator {
        display: none;
    }

    /* Section Headers */
    .section-header {
        margin-bottom: var(--space-10);
    }

    .section-title {
        font-size: var(--font-size-4xl);
    }

    .section-subtitle {
        font-size: var(--font-size-base);
    }

    /* Features */
    .features {
        padding: var(--space-16) 0;
    }

    .features-grid {
        grid-template-columns: 1fr;
        gap: var(--space-6);
    }

    .feature-card {
        padding: var(--space-6);
    }

    /* Ranks */
    .ranks-section {
        padding: var(--space-16) 0;
    }

    /* Phone: one column, badge stacked above its content as a horizontal
       chip. No line — with nothing to hang off, a rule down the left of a
       single column is decoration that costs 60px of width. */
    .timeline-line {
        display: none;
    }

    .rank-card {
        grid-template-columns: 1fr;
        row-gap: var(--space-3);
        padding: var(--space-5) 0;
    }

    .rank-card .rank-badge,
    .rank-card:nth-of-type(even) .rank-badge,
    .rank-card .rank-content,
    .rank-card:nth-of-type(even) .rank-content {
        grid-column: 1;
    }

    .rank-card .rank-badge {
        grid-row: 1;
        flex-direction: row;
        justify-content: flex-start;
        /* justify-self, not align-self: the badge is alone in a 1fr column and
           would otherwise stretch the full width and read as a section banner
           rather than a badge. */
        justify-self: start;
        align-self: start;
        gap: var(--space-3);
        padding: var(--space-2) var(--space-4);
    }

    .rank-insignia-badge {
        width: 44px;
        height: 44px;
    }

    .rank-card .rank-content {
        grid-row: 2;
    }

    /* The rung chips are the widest thing in the card at 360px, so they lose
       the threshold number before they lose the name or the insignia. */
    .rung-points {
        display: none;
    }

    /* Gameplay */
    .gameplay-section {
        padding: var(--space-16) 0;
    }

    .gameplay-thumbnails {
        grid-template-columns: repeat(2, 1fr);
        gap: var(--space-3);
    }

    /* 10px was the only hard-coded sub-12px size on the whole marketing site.
       The base rule is already var(--font-size-xs) = 12px, so this override
       existed purely to fit two thumbnails per row — and the caption is two
       words. The tighter padding is what buys the room; the size does not
       have to. */
    .thumbnail-label {
        font-size: var(--font-size-xs);
        padding: var(--space-1);
    }

    /* Community */
    .community-section {
        padding: var(--space-16) 0;
    }

    .testimonials-grid {
        grid-template-columns: 1fr;
        gap: var(--space-4);
    }

    .testimonial-card {
        padding: var(--space-5);
    }

    .community-links {
        flex-direction: column;
        gap: var(--space-3);
    }

    .community-btn {
        width: 100%;
        justify-content: center;
    }

    /* CTA */
    .cta-section {
        padding: var(--space-16) 0;
    }

    .cta-title {
        font-size: var(--font-size-4xl);
    }

    .form-group {
        flex-direction: column;
        gap: var(--space-3);
    }

    .form-input {
        text-align: center;
    }

    .signup-form .btn {
        width: 100%;
    }

    /* Footer */
    .main-footer {
        padding: var(--space-12) 0 var(--space-6);
    }

    .footer-nav {
        grid-template-columns: repeat(2, 1fr);
        gap: var(--space-6);
    }

    .footer-bottom {
        flex-direction: column;
        gap: var(--space-4);
        text-align: center;
    }

    /* Notifications */
    #notification-container {
        left: var(--space-4);
        right: var(--space-4);
        top: auto;
        bottom: var(--space-4);
    }

    .notification {
        max-width: 100%;
        transform: translateY(120%);
    }

    .notification.show {
        transform: translateY(0);
    }
}

/* ==========================================================================
   Extra small screens (max-width: 480px)
   ========================================================================== */
@media (max-width: 480px) {
    :root {
        --font-size-7xl: 2.5rem;
        --font-size-6xl: 2rem;
        --font-size-5xl: 1.75rem;
        --font-size-4xl: 1.5rem;
    }

    .logo-text {
        font-size: var(--font-size-lg);
    }

    .hero {
        padding-top: calc(var(--space-16) + 60px);
    }

    .title-main {
        font-size: var(--font-size-4xl);
    }

    .title-tagline {
        font-size: var(--font-size-base);
        letter-spacing: 0.05em;
    }

    .features-grid,
    .testimonials-grid {
        grid-template-columns: 1fr;
    }

    .gameplay-thumbnails {
        grid-template-columns: repeat(2, 1fr);
    }

    .footer-nav {
        grid-template-columns: 1fr;
        text-align: center;
    }

    .footer-column {
        padding-bottom: var(--space-4);
        border-bottom: 1px solid var(--border-color);
    }

    .footer-column:last-child {
        border-bottom: none;
    }
}

/* ==========================================================================
   Height-based adjustments (short viewports)
   ========================================================================== */
@media (max-height: 700px) {
    .hero {
        min-height: auto;
        padding-top: calc(var(--space-16) + 60px);
        padding-bottom: var(--space-16);
    }

    .hero-scroll-indicator {
        display: none;
    }
}

/* ==========================================================================
   High DPI / Retina displays
   ========================================================================== */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
    /* Ensure crisp borders on retina displays */
    .feature-card,
    .testimonial-card,
    .rank-badge,
    .form-input {
        border-width: 0.5px;
    }
}

/* ==========================================================================
   Print styles
   ========================================================================== */
@media print {
    /* Hide non-essential elements */
    .main-header,
    .hero-scroll-indicator,
    #particle-canvas,
    .hero-cta,
    .community-links,
    .signup-form,
    .main-footer {
        display: none !important;
    }

    /* Reset colors for print */
    body {
        background: white;
        color: black;
    }

    .hero-backdrop,
    .hero-overlay,
    .cta-backdrop {
        display: none;
    }

    /* Ensure text is readable */
    .text-gradient {
        -webkit-text-fill-color: black;
        background: none;
    }
}

/* ==========================================================================
   Landscape orientation on mobile
   ========================================================================== */
@media (max-height: 500px) and (orientation: landscape) {
    .hero {
        min-height: auto;
        padding: var(--space-8) var(--space-4);
        padding-top: calc(var(--space-8) + 60px);
    }

    .hero-badge {
        margin-bottom: var(--space-4);
    }

    .hero-subtitle {
        margin-bottom: var(--space-6);
    }

    .hero-cta {
        flex-direction: row;
        margin-bottom: var(--space-6);
    }

    .hero-stats {
        flex-direction: row;
        gap: var(--space-8);
    }
}
