/* --------------------------------------------------------------------------
   MEDIA QUERIES & RESPONSIVE LAYOUTS
   -------------------------------------------------------------------------- */

/* TABLET LAYOUTS (Large Screen adjustments) */
@media (max-width: 1024px) {
    .hero-main-title {
        font-size: 4.2rem;
        letter-spacing: 8px;
        padding: 0.5px;
    }

    .hero-tagline {
        font-size: 1.2rem;
        letter-spacing: 2.5px;
    }

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

    .footer-grid {
        grid-template-columns: 1.2fr 0.8fr;
    }
}

/* PORTRAIT TABLETS & SMARTPHONES (768px and below) */
@media (max-width: 768px) {

    /* Disable custom cursor elements on mobile / touch devices */
    #cur,
    #cur-ring {
        display: none !important;
    }

    .site-header {
        top: 0;
        left: 0;
        transform: none;
        width: 100%;
        height: 70px !important;
        border-radius: 0;
        border: none;
        background: rgba(7, 5, 15, 0.9);
    }

    /* Transition header outline to a bottom border line on mobile */
    .site-header::before {
        top: auto;
        left: 0;
        right: 0;
        bottom: -1px;
        height: 1px;
        border-radius: 0;
        padding: 0;
        -webkit-mask: none;
        mask-composite: select;
        opacity: 0.75;
    }

    .site-header.scrolled {
        top: 0;
        height: 70px !important;
    }

    .section {
        padding: 70px 20px;
    }

    .section-title {
        font-size: 2rem;
    }

    /* Navigation Menu */
    .nav-menu {
        position: fixed;
        top: 70px !important;
        left: -100%;
        width: 100%;
        height: calc(100vh - 70px) !important;
        background: rgba(7, 5, 15, 0.96);
        backdrop-filter: blur(20px);
        flex-direction: column;
        justify-content: center;
        gap: 40px;
        transition: 0.5s ease-in-out;
        border-top: 1px solid var(--border-color);
        padding-bottom: 50px;
    }

    .nav-menu.active {
        left: 0;
    }

    .nav-toggle {
        display: block;
    }

    /* Hero Section */
    .hero-grid {
        grid-template-columns: 1fr;
        text-align: center;
        gap: 50px;
    }

    .hero-main-title {
        font-family: 'Orbitron', sans-serif !important;
        font-weight: 900 !important;
        font-size: 2.6rem !important;
        letter-spacing: 6px !important;
        padding: 0.5px;
        filter: none !important; /* Disable SVG glitch smear on mobile viewports for clean rendering */
    }

    .hero-tagline {
        font-size: 1rem !important;
        letter-spacing: 1.5px !important;
    }

    .hero-desc {
        font-size: 0.95rem !important;
        line-height: 1.5 !important;
        max-width: 540px;
        margin: 0 auto 25px !important;
    }

    .hero-body-container {
        max-width: 320px !important;
        margin: 0 auto !important;
        display: flex !important;
        flex-direction: column !important;
        align-items: center !important;
    }

    .hero-btns {
        display: flex !important;
        flex-direction: column !important;
        align-items: center !important;
        gap: 10px !important;
        width: 100% !important;
    }

    .hero-btns .glass-btn {
        width: 100% !important;
        max-width: 250px !important;
        justify-content: center !important;
    }

    .hero-art-container {
        order: -1;
        display: flex;
        justify-content: center;
        align-items: center;
        width: 100%;
    }

    #gate-canvas-wrap {
        width: 100%;
        max-width: 320px;
        height: 320px;
    }

    /* About Section */
    .about-grid {
        grid-template-columns: 1fr;
    }

    .about-section-title {
        font-size: 1.8rem !important;
        margin-bottom: 15px !important;
    }

    .about-p {
        font-size: 0.92rem !important;
        line-height: 1.55 !important;
        margin-bottom: 20px !important;
    }

    .about-features {
        margin: 25px 0 !important;
        gap: 10px !important;
    }

    .about-feature-item {
        padding: 14px 8px !important;
        gap: 6px !important;
    }

    .about-feature-item i {
        font-size: 1.15rem !important;
    }

    .about-feature-item span {
        font-size: 0.72rem !important;
    }

    .vision-section-title {
        font-size: 1.05rem !important;
        margin-bottom: 12px !important;
    }

    .vision-content-text {
        font-size: 1.15rem !important;
        line-height: 1.5 !important;
    }

    /* Pillars & Sub-Teams Overrides */
    .team-structure-layout {
        gap: 35px;
    }

    .subteams-grid {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 20px !important;
        margin-top: 20px !important;
    }

    .tinkers-grid-content {
        grid-template-columns: 1fr !important;
        gap: 30px !important;
    }

    .tinkers-roadmap {
        border-left: none !important;
        padding-left: 0 !important;
        border-top: 1px solid rgba(255, 255, 255, 0.08) !important;
        padding-top: 30px !important;
    }

    .roadmap-list {
        grid-template-columns: 1fr !important;
        gap: 20px !important;
    }

    /* AMU Vault Sizing and Positioning adjustments on Mobile */
    .vault-layout {
        grid-template-columns: 1fr;
        gap: 30px;
    }

    .vault-graphic-side {
        min-height: 280px !important;
    }

    .vault-svg-container {
        max-width: 280px !important;
    }

    .vault-shadow {
        margin-top: 15px !important;
        height: 15px !important;
    }

    /* Floating range adjustment for smaller heights */
    @keyframes floatUpDown {
        0% {
            transform: translateY(0);
        }

        50% {
            transform: translateY(-12px);
        }

        100% {
            transform: translateY(0);
        }
    }

    /* Events */
    .event-highlight-card {
        grid-template-columns: 1fr;
        gap: 30px;
        padding: 30px;
    }

    .evt-gallery-grid {
        grid-template-columns: 1fr;
    }

    /* Footer */
    .footer-grid {
        grid-template-columns: 1fr;
        gap: 40px;
    }

    /* Circular Return Back Button Mobile Positioning */
    .main-back-btn {
        top: 13px !important;
        left: 15px !important;
        width: 44px !important;
        height: 44px !important;
        background: rgba(7, 5, 15, 0.6) !important;
        border-color: rgba(255, 255, 255, 0.1) !important;
    }

    .main-back-btn + .site-header .logo-link {
        margin-left: 55px !important;
    }

    /* --- Compact Spacing & Font Adjustments for mobile --- */
    .glass-btn {
        font-size: 0.82rem !important;
        padding: 9px 20px !important;
    }

    .section-subtitle {
        font-size: 0.9rem !important;
        line-height: 1.5 !important;
        margin-bottom: 25px !important;
    }

    /* Projects & Events Slider & Cards scaling */
    .project-slide-card,
    .event-slide-card {
        flex: 0 0 280px !important;
        min-height: 220px !important;
        padding: 24px 20px !important;
    }

    .event-static-card {
        flex: none !important;
        width: 100% !important;
        min-height: 280px !important;
        padding: 30px 24px 44px 24px !important; /* Increased bottom padding to prevent button frame overlap */
    }

    /* Events Static Grid on mobile */
    .events-static-grid {
        grid-template-columns: 1fr !important;
        gap: 20px !important;
        max-width: 600px !important;
        margin: 0 auto !important;
    }

    .event-card-inner {
        flex-direction: column !important;
        align-items: center !important;
        text-align: center !important;
        gap: 15px !important;
    }

    .event-poster-col {
        flex: 0 0 145px !important;
        max-width: 145px !important;
    }

    .event-info-col {
        align-items: center !important;
        text-align: center !important;
    }

    .event-card-details {
        text-align: center !important;
    }

    .event-info-col .glass-btn {
        align-self: center !important;
    }

    .event-info-col .project-status-bar {
        justify-content: center !important;
    }

    .event-info-col .timeline-desc {
        text-align: center !important;
    }

    .timeline-item-title {
        font-size: 1.1rem !important;
    }

    .timeline-desc {
        font-size: 0.8rem !important;
        line-height: 1.45 !important;
    }

    .project-status-bar {
        margin-bottom: 8px !important;
    }

    .project-status-text {
        font-size: 0.65rem !important;
    }

    .project-status-indicator {
        width: 12px !important;
        height: 12px !important;
    }

    .coming-soon-title {
        font-size: 1.1rem !important;
    }

    .coming-soon-icon {
        font-size: 1.5rem !important;
        margin-bottom: 10px !important;
    }

    /* Event Highlight Cards scaling */
    .event-highlight-card {
        padding: 24px 20px !important;
        gap: 20px !important;
    }

    .evt-title {
        font-size: 1.35rem !important;
    }

    .evt-desc {
        font-size: 0.85rem !important;
        line-height: 1.45 !important;
    }

    .winners-title-row {
        font-size: 1.2rem !important;
        margin-bottom: 20px !important;
    }

    .winner-card {
        padding: 20px 15px !important;
    }

    .winner-name {
        font-size: 1rem !important;
    }

    .winner-desc {
        font-size: 0.8rem !important;
    }
}

/* SMARTPHONES (480px and below) */
@media (max-width: 480px) {
    .hero-main-title {
        font-size: 1.8rem !important;
        letter-spacing: 3px !important;
        filter: none !important;
    }

    .hero-tagline {
        font-size: 0.85rem !important;
        letter-spacing: 1px !important;
    }

    .hero-desc {
        font-size: 0.85rem !important;
        line-height: 1.45 !important;
    }

    .about-section-title {
        font-size: 1.5rem !important;
    }

    .about-p {
        font-size: 0.85rem !important;
        line-height: 1.5 !important;
    }

    .vision-content-text {
        font-size: 0.95rem !important;
        line-height: 1.45 !important;
    }

    .hero-btns {
        gap: 10px !important;
    }

    .hero-btns .glass-btn {
        max-width: 230px !important;
    }

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

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

    .tab-btn {
        width: 100%;
        text-align: center;
    }

    .tab-panel {
        padding: 20px;
    }

    .timeline-wrap::before {
        left: 15px;
    }

    .timeline-item {
        padding-left: 45px;
    }

    .timeline-node {
        left: 4px;
    }

    .timeline-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 5px;
    }

    /* THINK • COMMIT • SOLVE Sizing for phones */
    .hero-motto {
        font-size: 0.85rem !important;
        letter-spacing: 4px !important;
        margin-bottom: 20px !important;
        gap: 2px !important;
    }

    .motto-dot {
        font-size: 1.1rem !important;
        margin: 0 4px !important;
    }

    /* Subteams Grid Stack on Phones */
    .subteams-grid {
        grid-template-columns: 1fr !important;
        gap: 12px !important;
    }

    /* Tinkers Details Spacing */
    .tinkers-detail-card {
        padding: 20px !important;
    }

    .tinkers-main-desc {
        font-size: 0.9rem !important;
        margin-bottom: 20px !important;
    }

    .tinkers-roadmap {
        padding-top: 20px !important;
    }

    .roadmap-title {
        font-size: 0.95rem !important;
        margin-bottom: 15px !important;
    }

    /* Preloader container scaling for smallest viewports to prevent overflow */
    .glow-arc-container {
        width: 275px !important;
        height: 145px !important;
    }
}