/* ========================================
   RESPONSIVE — Media Queries
   ======================================== */

/* --- Tablet --- */
@media (max-width: 1024px) {
  .toolbox-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .projects-track {
    padding-left: 40px;
    padding-right: 40px;
  }

  .hero-floating-code {
    opacity: 0.03;
  }

  .status-bar-right {
    display: none;
  }
}

/* --- Mobile --- */
@media (max-width: 768px) {
  :root {
    --space-xs: 0.6rem;
    --space-sm: 1rem;
    --space-md: 1.5rem;
    --space-lg: 2.5rem;
    --space-xl: 4rem;
  }

  .nav-links {
    display: none;
  }

  .hamburger {
    display: flex;
  }

  .mobile-menu.open {
    transform: translateX(0);
  }

  /* Hero */
  .hero {
    min-height: 100dvh;
    min-height: -webkit-fill-available;
    padding: var(--nav-height) var(--space-md) 0;
  }

  .hero-inner {
    grid-template-columns: 1fr;
    text-align: center;
    gap: var(--space-lg);
  }

  .hero-photo-wrap {
    width: 150px;
    height: 150px;
    justify-self: center;
    animation: heroPhotoIn 0.6s ease-out 0.3s both;
  }

  .hero-photo {
    width: 100%;
    height: 100%;
    object-fit: cover;
  }

  .hero-name {
    font-size: clamp(1.6rem, 7vw, 2.4rem);
  }

  .hero-name-glitch::before,
  .hero-name-glitch::after {
    font-size: clamp(1.6rem, 7vw, 2.4rem);
  }

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

  .hero-greeting {
    padding-left: 0;
    animation: heroFadeIn 0.5s ease-out 0.5s both;
  }

  .hero-greeting::before {
    display: none;
  }

  .hero-actions {
    justify-content: center;
    animation: heroFadeIn 0.5s ease-out 1s both;
  }

  .hero-role {
    min-height: 1.5rem;
    animation: heroFadeIn 0.5s ease-out 0.9s both;
  }

  /* About */
  .about-grid {
    grid-template-columns: 1fr;
    gap: var(--space-lg);
  }

  .about-photo-wrap {
    width: 160px;
    height: 200px;
    margin: 0 auto;
  }

  .about-photo {
    width: 100%;
    height: 100%;
    object-fit: cover;
    aspect-ratio: auto;
  }

  .about-stats {
    gap: var(--space-xl);
  }

  .stat-number {
    font-size: 1.8rem;
  }

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

  /* Toolbox */
  .toolbox-grid {
    grid-template-columns: 1fr;
  }

  .toolbox-row {
    padding: var(--space-md);
  }

  /* Projects */
  .projects-track {
    padding-left: 16px;
    padding-right: 16px;
    gap: 16px;
  }

  .project-slide {
    min-width: 280px;
    max-width: 85vw;
    min-height: 400px;
  }

  .project-text-card {
    min-width: 280px;
    max-width: 85vw;
    min-height: 400px;
    padding: var(--space-lg);
  }

  /* Sections — tighter padding */
  .section {
    padding: var(--space-3xl) var(--space-md);
  }

  .section-heading {
    font-size: clamp(2rem, 8vw, 3rem);
    margin-bottom: var(--space-xl);
  }

  /* Contact */
  .contact-heading {
    font-size: clamp(1.8rem, 8vw, 3rem);
  }

  .contact-email {
    font-size: 0.85rem;
    padding: var(--space-sm) var(--space-lg);
  }

  .contact-email svg {
    width: 18px;
    height: 18px;
  }

  /* Footer */
  .footer {
    padding: var(--space-md) var(--space-sm);
    padding-bottom: 50px;
  }

  /* Terminal output - lighter on mobile */
  .terminal-output {
    opacity: 0.06;
  }
  .terminal-chrome {
    padding: 4px 10px;
  }
  .terminal-body {
    height: calc(100vh - 28px);
    font-size: 13px;
    padding: 14px 16px;
  }

  /* Floating code - hide on mobile */
  .hero-floating-code {
    display: none;
  }

  /* Pulse rings - hide on mobile */
  .hero-pulse-ring {
    display: none;
  }

  /* Binary floats - reduce on mobile */
  .binary-float {
    opacity: 0.02 !important;
  }

  /* Status bar - simplified on mobile */
  .status-bar {
    font-size: 0.65rem;
    height: 24px;
    padding: 0 var(--space-sm);
  }

  .status-bar-left .status-item:last-child {
    display: none;
  }

  .status-bar-right {
    display: none;
  }

  .section-divider {
    padding: 0 var(--space-md);
  }

  /* Cursor elements hidden on touch */
  .cursor-dot,
  .cursor-trail,
  .cursor-image,
  .cursor-trail-dot {
    display: none !important;
  }

  body, body * {
    cursor: auto !important;
  }

  .card-scan-line {
    display: none;
  }

  .project-slide,
  .project-text-card {
    will-change: auto;
  }
}

/* --- Small Mobile --- */
@media (max-width: 500px) {
  .about-stats {
    grid-template-columns: 1fr;
    gap: var(--space-md);
    text-align: center;
  }

  .hero-greeting {
    font-size: 0.9rem;
  }

  .hero-name {
    font-size: clamp(1.4rem, 7vw, 2rem);
  }

  .hero-name-glitch::before,
  .hero-name-glitch::after {
    font-size: clamp(1.4rem, 7vw, 2rem);
  }

  .toolbox-tag {
    font-size: 0.7rem;
    padding: 0.35rem 0.7rem;
  }

  .project-title {
    font-size: 1rem;
  }

  .nav-logo::before,
  .nav-logo::after {
    display: none;
  }

  .status-bar {
    display: none;
  }

  .footer {
    padding-bottom: var(--space-md);
  }

  .hero-photo-wrap {
    width: 130px;
    height: 130px;
  }

  .contact-subtext {
    font-size: 0.9rem;
  }

  .section {
    padding: var(--space-xl) var(--space-sm);
  }
}

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

  .scanlines,
  .grain,
  .crt-glow,
  .hero-floating-code,
  .hero-pulse-ring,
  .section-scan-line,
  .status-bar,
  .binary-float {
    display: none !important;
  }
}
