/* ==========================================================================
   MAHARSHI RAVAL — RESPONSIVE ADAPTIVE SYSTEM
   Breakpoints:
   - Ultra-wide: >= 1440px
   - Laptop / Standard Desktop: 1024px - 1439px
   - Tablet: 768px - 1023px
   - Mobile: <= 767px
   - Small Mobile: <= 480px
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. Laptop & Large Screens (1024px to 1439px)
   -------------------------------------------------------------------------- */
@media screen and (max-width: 1280px) {
  .hero-container {
    grid-template-columns: 1.1fr 0.9fr;
    gap: 2rem;
  }

  .hero-visual-stage {
    height: 460px;
  }

  .hero-3d-scene {
    width: 330px;
    height: 400px;
  }

  .project-card-inner,
  .project-card:nth-child(even) .project-card-inner {
    grid-template-columns: 1fr 1fr;
  }

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

/* --------------------------------------------------------------------------
   2. Tablet Devices (768px to 1023px)
   -------------------------------------------------------------------------- */
@media screen and (max-width: 1023px) {
  :root {
    --header-height: 74px;
  }

  /* Navigation on Tablet/Mobile */
  .hamburger {
    display: flex;
  }

  .nav-menu {
    position: fixed;
    top: 0;
    right: -100%;
    width: 82%;
    max-width: 400px;
    height: 100vh;
    background-color: var(--nav-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-left: 1px solid var(--glass-border);
    flex-direction: column;
    justify-content: center;
    align-items: flex-start;
    padding: 3rem 2.5rem;
    gap: 1.75rem;
    z-index: 940;
    box-shadow: -20px 0 60px rgba(14, 52, 38, 0.12);
    transition: right 0.4s var(--ease-out-expo);
  }

  .nav-menu.open {
    right: 0;
  }

  .nav-link {
    font-size: 1.1rem;
  }

  /* Hero Section Stack */
  .hero-section {
    padding-top: calc(var(--header-height) + 1.5rem);
    min-height: auto;
  }

  .hero-container {
    grid-template-columns: 1fr;
    gap: 3.5rem;
    text-align: left;
  }

  .hero-visual-stage {
    height: 400px;
    margin: 0 auto;
    max-width: 440px;
  }

  /* About Grid */
  .about-grid {
    grid-template-columns: 1fr;
    gap: 3.5rem;
  }

  /* Featured Work */
  .project-card-inner,
  .project-card:nth-child(even) .project-card-inner {
    grid-template-columns: 1fr;
  }

  .project-card:nth-child(even) .project-visual-wrapper {
    order: 1;
  }

  .project-card:nth-child(even) .project-details-wrapper {
    order: 2;
  }

  .project-visual-wrapper {
    min-height: 380px;
  }

  /* Education Grid */
  .education-cards-grid {
    grid-template-columns: 1fr;
  }

  /* Contact Grid */
  .contact-grid {
    grid-template-columns: 1fr;
    gap: 3rem;
  }

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

/* --------------------------------------------------------------------------
   3. Mobile Devices (<= 767px)
   -------------------------------------------------------------------------- */
@media screen and (max-width: 767px) {
  /* Hide Custom Cursor on touch devices for frictionless native scrolling */
  .custom-cursor-dot,
  .custom-cursor-follower {
    display: none !important;
  }

  body {
    cursor: auto !important;
  }

  /* Typography Adjustments */
  .hero-name-heading {
    font-size: clamp(3rem, 13vw, 4.5rem);
    letter-spacing: -0.02em;
  }

  .hero-role-title {
    font-size: 1.25rem;
  }

  .hero-statement {
    font-size: 1rem;
    margin-bottom: 2rem;
  }

  .hero-cta-group {
    flex-direction: column;
    align-items: stretch;
    width: 100%;
  }

  .btn-magnetic {
    width: 100%;
    text-align: center;
    padding: 0.95rem 1.5rem;
  }

  .hero-scroll-indicator {
    display: none;
  }

  /* 3D Scene Mobile Sizing */
  .hero-visual-stage {
    height: 340px;
  }

  .hero-3d-scene {
    width: 290px;
    height: 340px;
  }

  .geometric-ring {
    width: 110px;
    height: 110px;
  }

  .inner-emblem {
    font-size: 2.25rem;
  }

  .float-card-1 {
    width: 105px;
    height: 85px;
    right: -10px;
    padding: 0.75rem;
  }

  .float-sphere-1 {
    width: 55px;
    height: 55px;
    left: -10px;
  }

  /* About Pillars */
  .about-hybrid-pillars {
    grid-template-columns: 1fr;
  }

  /* Creative Process */
  .process-card-panel {
    padding: 1.75rem 1.25rem;
  }

  .process-pipeline::before {
    left: 17px;
  }

  .step-node {
    width: 36px;
    height: 36px;
    font-size: 0.75rem;
  }

  .step-heading {
    font-size: 0.95rem;
  }

  /* Project Cards Mobile */
  .projects-showcase-container {
    gap: 3.5rem;
  }

  .project-visual-wrapper {
    min-height: 280px;
  }

  .project-details-wrapper {
    padding: 1.75rem 1.25rem;
  }

  .project-highlights-grid {
    grid-template-columns: 1fr;
  }

  .project-action-buttons {
    flex-direction: column;
    align-items: stretch;
    width: 100%;
  }

  .tattvam-acrylic-frame {
    width: 92%;
    height: 92%;
    padding: 1.25rem;
  }

  .tattvam-img-asset {
    max-width: 180px;
  }

  /* Timeline */
  .timeline-track::before {
    left: 16px;
  }

  .timeline-marker-dot {
    left: 7px;
    width: 18px;
    height: 18px;
  }

  .timeline-node-card {
    padding-left: 46px;
    margin-bottom: 2.5rem;
  }

  .timeline-card-inner {
    padding: 1.5rem 1.25rem;
  }

  /* Skills Cloud */
  .skills-cloud-grid {
    gap: 0.75rem;
  }

  .skill-card-3d {
    padding: 0.85rem 1.2rem;
  }

  .creative-discipline-grid {
    grid-template-columns: 1fr;
  }

  /* Modal */
  .modal-body {
    padding: 1.75rem 1.25rem;
  }

  .modal-meta-grid {
    grid-template-columns: 1fr;
    gap: 1rem;
  }

  .modal-close-btn {
    top: 1rem;
    right: 1rem;
    width: 38px;
    height: 38px;
  }

  /* Footer */
  .footer-top-row {
    flex-direction: column;
    align-items: flex-start;
    gap: 1.5rem;
  }

  .footer-nav {
    flex-direction: column;
    gap: 1rem;
  }

  .footer-bottom-row {
    flex-direction: column;
    align-items: flex-start;
    gap: 1.25rem;
  }

  .footer-social-placeholders {
    flex-direction: column;
    gap: 0.5rem;
  }
}

/* --------------------------------------------------------------------------
   4. Touch Device Optimization & Reduced Motion
   -------------------------------------------------------------------------- */
@media (hover: none) and (pointer: coarse) {
  /* Disable heavy 3D perspective shifts on touch devices to avoid jitter */
  .project-card-inner,
  .hero-3d-scene,
  .skill-card-3d {
    transform: none !important;
    transition: box-shadow 0.3s ease !important;
  }
}

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