/* =========================================================
   responsive.css — Breakpoints & Adaptive Styles
   =========================================================
   Breakpoints:
     Mobile  :  < 640px
     Tablet  :  640px – 1023px
     Desktop : >= 1024px
   ========================================================= */

/* -------------------------------------------------------
   MOBILE — < 640px
   Single column, reduced effects, essential content only
------------------------------------------------------- */

@media (max-width: 639px) {
    /* Spacing adjustments */
    :root {
        --section-padding-y: var(--space-16);
        --section-padding-x: var(--space-4);
        --nav-height: 56px;
    }

    /* ---- Nav ---- */
    .nav__inner {
        padding: 0 var(--space-4);
    }

    .nav__links {
        gap: var(--space-5);
    }

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

    /* ---- Hero ---- */
    .hero__content {
        padding: 0 var(--space-4);
        gap: var(--space-4);
    }

    .hero__name {
        /* Keep it readable but smaller */
        font-size: clamp(2.8rem, 14vw, 4.5rem);
        letter-spacing: -0.03em;
    }

    .hero__title {
        font-size: var(--fs-lg);
        text-align: center;
    }

    .hero__tagline {
        min-width: 0;
        width: 100%;
        font-size: var(--fs-sm);
    }

    /* Reduce glitch intensity on small screens */
    .hero__name.glitch::before,
    .hero__name.glitch::after {
        display: none;
    }

    /* ---- Terminal ---- */
    .terminal-body {
        padding: var(--space-4);
        font-size: var(--fs-sm);
    }

    /* ---- Skills ---- */
    .skill-tag {
        font-size: var(--fs-xs);
        padding: var(--space-1) var(--space-3);
    }

    /* ---- Contact ---- */
    .contact-grid {
        grid-template-columns: 1fr;
        gap: var(--space-4);
    }

    .contact-card {
        flex-direction: row;
        text-align: left;
        padding: var(--space-5) var(--space-5);
        gap: var(--space-4);
    }

    .contact-card__info {
        flex: 1;
    }

    /* ---- Footer ---- */
    .footer {
        padding: var(--space-10) var(--space-4) var(--space-6);
    }

    .footer__ascii {
        font-size: 0.75rem;
        overflow-x: auto;
    }

    /* ---- Background — hide heavy layers ---- */
    .bg-layer::before {
        display: none;
    }

    #bg-canvas {
        opacity: 0.4;
    }

    /* ---- Section titles ---- */
    .section__title {
        font-size: var(--fs-2xl);
    }
}

/* -------------------------------------------------------
   TABLET — 640px to 1023px
   Two-column grids where appropriate
------------------------------------------------------- */

@media (min-width: 640px) and (max-width: 1023px) {
    :root {
        --section-padding-y: var(--space-20);
        --section-padding-x: var(--space-6);
    }

    /* ---- Nav ---- */
    .nav__inner {
        padding: 0 var(--space-6);
    }

    /* ---- Hero ---- */
    .hero__name {
        font-size: clamp(4rem, 10vw, 6rem);
    }

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

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

    /* Last card spans full width on 2-col layout */
    .contact-card:last-child {
        grid-column: 1 / -1;
        max-width: 360px;
        margin: 0 auto;
    }
}

/* -------------------------------------------------------
   DESKTOP — >= 1024px
   Full experience, all effects enabled
------------------------------------------------------- */

@media (min-width: 1024px) {
    /* ---- Contact — always 3 columns ---- */
    .contact-grid {
        grid-template-columns: repeat(3, 1fr);
    }

    /* ---- Skills — allow more columns ---- */
    .skills-grid {
        /* On wide screens, tags wrap generously */
        max-width: 100%;
    }

    /* Slightly larger hero on large screens */
    .hero__tagline {
        font-size: var(--fs-md);
    }
}

/* -------------------------------------------------------
   LARGE DESKTOP — >= 1440px
   Extra breathing room
------------------------------------------------------- */

@media (min-width: 1440px) {
    :root {
        --section-padding-x: var(--space-12);
    }
}

/* -------------------------------------------------------
   TOUCH DEVICES — remove hover effects
------------------------------------------------------- */

@media (hover: none) and (pointer: coarse) {
    .skill-tag:hover {
        transform: none;
        color: var(--text-secondary);
        background: var(--color-green-05);
        border-color: var(--color-green-20);
        box-shadow: none;
    }

    .contact-card:hover {
        transform: none;
    }

    /* Show full card without hover shimmer */
    .contact-card::before {
        display: none;
    }
}

/* -------------------------------------------------------
   prefers-reduced-motion
   Disable all animations and transitions for accessibility
------------------------------------------------------- */

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

    html {
        scroll-behavior: auto;
    }

    /* Show all reveal elements immediately (observer.js also calls revealAllImmediately) */
    .reveal,
    .reveal-group > * {
        opacity: 1 !important;
        transform: none !important;
        transition: none !important;
    }

    /* Ensure .revealed state is visible even without transition */
    .reveal.revealed {
        opacity: 1 !important;
        transform: none !important;
    }

    /* Show all skill tags immediately */
    .skill-tag,
    .skill-tag.tag-visible {
        opacity: 1 !important;
        transform: none !important;
        animation: none !important;
    }

    /* Show all contact cards immediately */
    .contact-card,
    .contact-card.card-visible {
        opacity: 1 !important;
        transform: none !important;
        animation: none !important;
    }

    /* Hero name — no animation, just display */
    .hero__name {
        opacity: 1 !important;
        animation: none !important;
        text-shadow:
            0 0 10px rgba(0, 255, 65, 0.6),
            0 0 30px rgba(0, 255, 65, 0.3);
    }

    /* Hero meta */
    .hero__meta {
        opacity: 0.6 !important;
        animation: none !important;
        transform: none !important;
    }

    /* No glitch */
    .hero__name.glitch::before,
    .hero__name.glitch::after {
        display: none;
    }

    /* Cursors still blink (very subtle, not distracting) */
    .cursor,
    .hero__cursor,
    .terminal-cursor,
    .nav__logo-cursor {
        animation: none !important;
        opacity: 1;
    }

    /* No bouncing scroll cue */
    .scroll-cue {
        animation: none;
        transform: translateX(-50%);
        opacity: 0.5;
    }

    /* No background motion */
    .bg-layer::before {
        animation: none;
    }

    #bg-canvas {
        opacity: 0.3;
    }

    /* No glow pulse box on terminal */
    .terminal-window {
        animation: none;
    }
}

/* -------------------------------------------------------
   prefers-color-scheme: light
   We force dark mode, but provide a subtle override
   in case forced dark is somehow not applied
------------------------------------------------------- */

@media (prefers-color-scheme: light) {
    /* Force dark regardless — the site is dark-only */
    :root {
        color-scheme: dark only;
    }
}

/* -------------------------------------------------------
   Print styles — minimal, readable
------------------------------------------------------- */

@media print {
    .nav,
    .bg-layer,
    .scroll-cue,
    .footer__ascii {
        display: none;
    }

    body {
        background: white;
        color: black;
        font-size: 12pt;
    }

    .hero__name {
        color: black;
        text-shadow: none;
        animation: none;
    }

    .section {
        padding: 1rem 0;
    }

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

    .contact-card {
        border: 1px solid #ccc;
    }
}
