/* ================================
   YRUG CODERS - RESPONSIVE DESIGN
   Mobile-First Approach
   ================================ */

/* Base Mobile Styles (320px and up) */
@media screen and (max-width: 480px) {
  /* Typography Adjustments */
  html {
    font-size: 14px;
  }

  h1 {
    font-size: 2.5rem;
  }
  h2 {
    font-size: 2rem;
  }
  h3 {
    font-size: 1.5rem;
  }
  h4 {
    font-size: 1.2rem;
  }

  .container {
    padding: 0 1rem;
  }

  /* Navigation */
  .nav-menu {
    position: fixed;
    top: 80px;
    left: -100%;
    width: 100%;
    height: calc(100vh - 80px);
    background: rgba(10, 10, 10, 0.98);
    flex-direction: column;
    justify-content: flex-start;
    align-items: center;
    gap: 2rem;
    padding-top: 3rem;
    transition: left 0.3s ease;
    z-index: 999;
  }

  .nav-menu.active {
    left: 0;
  }

  .hamburger {
    display: flex;
  }

  .hamburger.active span:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
  }

  .hamburger.active span:nth-child(2) {
    opacity: 0;
  }

  .hamburger.active span:nth-child(3) {
    transform: rotate(-45deg) translate(7px, -6px);
  }

  .nav-link {
    font-size: 1.2rem;
    padding: 1rem 2rem;
    width: 200px;
    text-align: center;
    border-radius: 10px;
  }

  /* Hero Section */
  .hero {
    min-height: 90vh;
    padding: 8rem 0 2rem 0;
  }

  .hero-content {
    padding: 1rem;
  }

  .hero-title {
    font-size: 2rem;
    margin-bottom: 1.5rem;
    line-height: 1.2;
  }

  .typing-text {
    font-size: 1.2rem;
    display: block;
    margin-bottom: 0.5rem;
  }

  .hero-subtitle {
    font-size: 1.2rem;
    margin-bottom: 1rem;
  }

  .hero-description {
    font-size: 1rem;
    margin-bottom: 2rem;
  }

  .cta-button {
    padding: 0.8rem 1.5rem;
    font-size: 1rem;
  }

  /* Background SVG Adjustments */
  .background-svg {
    transform: scale(0.7);
    opacity: 0.4;
  }

  /* Section Spacing */
  .about,
  .services,
  .projects,
  .tech-stack,
  .testimonials,
  .contact {
    padding: 4rem 0;
  }

  .section-header {
    margin-bottom: 3rem;
  }

  .section-title {
    font-size: 2rem;
  }

  .section-subtitle {
    font-size: 1rem;
  }

  /* About Section */
  .about-content {
    grid-template-columns: 1fr;
    gap: 3rem;
    text-align: center;
  }

  .about-stats {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }

  .stat-item {
    padding: 1.5rem 1rem;
  }

  .stat-number {
    font-size: 2rem;
  }

  .about-svg {
    max-width: 280px;
  }

  /* Services Section */
  .services-grid {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }

  .service-card {
    padding: 2rem 1.5rem;
  }

  .service-icon {
    width: 60px;
    height: 60px;
    margin-bottom: 1.5rem;
  }

  /* Projects Section */
  .projects-grid {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }

  .project-image {
    height: 150px;
  }

  .project-content {
    padding: 1.5rem;
  }

  .project-tech {
    justify-content: center;
  }

  /* Tech Stack Section */
  .tech-orbit {
    width: 300px;
    height: 300px;
    transform: scale(0.8);
  }

  .orbit-1 {
    width: 150px;
    height: 150px;
    top: 75px;
    left: 75px;
  }

  .orbit-2 {
    width: 200px;
    height: 200px;
    top: 50px;
    left: 50px;
  }

  .orbit-3 {
    width: 250px;
    height: 250px;
    top: 25px;
    left: 25px;
  }

  .tech-item {
    width: 40px;
    height: 40px;
  }

  .tech-item svg {
    width: 25px;
    height: 25px;
  }

  /* Testimonials */
  .testimonials-grid {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }

  .testimonial-card {
    padding: 2rem 1.5rem;
  }

  .testimonial-avatar {
    width: 60px;
    height: 60px;
  }

  /* Contact Section */
  .contact-content {
    grid-template-columns: 1fr;
    gap: 3rem;
  }

  .contact-form {
    order: -1;
  }

  .form-group input,
  .form-group select,
  .form-group textarea {
    padding: 0.8rem;
    font-size: 0.9rem;
  }

  .submit-button {
    padding: 0.8rem 1.5rem;
    font-size: 1rem;
  }

  /* Footer */
  .footer-content {
    grid-template-columns: 1fr;
    gap: 2rem;
    text-align: center;
  }

  .footer-section:first-child {
    order: -1;
  }

  .social-links {
    justify-content: center;
  }
}

/* Tablet Styles (481px to 768px) */
@media screen and (min-width: 481px) and (max-width: 768px) {
  html {
    font-size: 15px;
  }

  .container {
    padding: 0 1.5rem;
  }

  /* Navigation adjustments for tablet */
  .nav-menu {
    gap: 1.5rem;
  }

  .nav-link {
    font-size: 1rem;
  }

  /* Hero adjustments */
  .hero-title {
    font-size: 3rem;
  }

  .hero-subtitle {
    font-size: 1.3rem;
  }

  /* About Section */
  .about-content {
    grid-template-columns: 1fr;
    gap: 3rem;
  }

  .about-stats {
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
  }

  /* Services */
  .services-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
  }

  /* Projects */
  .projects-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
  }

  /* Tech Stack */
  .tech-orbit {
    width: 400px;
    height: 400px;
  }

  .orbit-1 {
    width: 200px;
    height: 200px;
    top: 100px;
    left: 100px;
  }

  .orbit-2 {
    width: 280px;
    height: 280px;
    top: 60px;
    left: 60px;
  }

  .orbit-3 {
    width: 360px;
    height: 360px;
    top: 20px;
    left: 20px;
  }

  /* Testimonials */
  .testimonials-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
  }

  /* Contact */
  .contact-content {
    grid-template-columns: 1fr;
    gap: 3rem;
  }

  /* Footer */
  .footer-content {
    grid-template-columns: repeat(2, 1fr);
    gap: 2rem;
  }
}

/* Small Desktop/Large Tablet (769px to 1024px) */
@media screen and (min-width: 769px) and (max-width: 1024px) {
  .container {
    max-width: 960px;
    padding: 0 2rem;
  }

  /* Services */
  .services-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 2rem;
  }

  /* Projects */
  .projects-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 2rem;
  }

  /* Tech Stack */
  .tech-orbit {
    width: 500px;
    height: 500px;
  }

  .orbit-1 {
    width: 250px;
    height: 250px;
    top: 125px;
    left: 125px;
  }

  .orbit-2 {
    width: 350px;
    height: 350px;
    top: 75px;
    left: 75px;
  }

  .orbit-3 {
    width: 450px;
    height: 450px;
    top: 25px;
    left: 25px;
  }

  /* Testimonials */
  .testimonials-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
  }

  .testimonial-card {
    padding: 2.5rem 1.5rem;
  }

  /* Footer */
  .footer-content {
    grid-template-columns: repeat(4, 1fr);
    gap: 2rem;
  }
}

/* Large Desktop (1025px to 1440px) */
@media screen and (min-width: 1025px) and (max-width: 1440px) {
  .container {
    max-width: 1200px;
  }

  /* Hero fine-tuning */
  .hero-title {
    font-size: 3.5rem;
  }

  /* Services */
  .services-grid {
    grid-template-columns: repeat(4, 1fr);
    gap: 2rem;
  }

  /* Projects */
  .projects-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 2rem;
  }

  /* Tech Stack full size */
  .tech-orbit {
    width: 600px;
    height: 600px;
  }
}

/* Extra Large Desktop (1441px and up) */
@media screen and (min-width: 1441px) {
  .container {
    max-width: 1400px;
  }

  /* Hero scaling */
  .hero-title {
    font-size: 4.5rem;
  }

  .hero-subtitle {
    font-size: 1.8rem;
  }

  .hero-description {
    font-size: 1.3rem;
  }

  /* Section padding increase */
  .about,
  .services,
  .projects,
  .tech-stack,
  .testimonials,
  .contact {
    padding: 10rem 0;
  }

  /* Services grid 4 columns maintained */
  .services-grid {
    grid-template-columns: repeat(4, 1fr);
    gap: 2.5rem;
  }

  /* Projects can go 3 columns on very large screens */
  .projects-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 2.5rem;
  }

  /* Tech Stack larger */
  .tech-orbit {
    width: 700px;
    height: 700px;
  }

  .orbit-1 {
    width: 350px;
    height: 350px;
    top: 175px;
    left: 175px;
  }

  .orbit-2 {
    width: 480px;
    height: 480px;
    top: 110px;
    left: 110px;
  }

  .orbit-3 {
    width: 600px;
    height: 600px;
    top: 50px;
    left: 50px;
  }

  .tech-item {
    width: 70px;
    height: 70px;
  }

  .tech-item svg {
    width: 45px;
    height: 45px;
  }
}

/* Ultra-wide screens (1920px and up) */
@media screen and (min-width: 1920px) {
  .container {
    max-width: 1600px;
  }

  /* Background SVG full resolution */
  .background-svg {
    transform: scale(1.2);
  }

  /* Hero ultra-wide scaling */
  .hero-title {
    font-size: 5rem;
  }

  /* Tech Stack ultra-wide */
  .tech-orbit {
    width: 800px;
    height: 800px;
  }
}

/* Landscape orientation adjustments for mobile */
@media screen and (max-height: 500px) and (orientation: landscape) {
  .hero {
    min-height: 100vh;
    padding: 7rem 0 1rem 0;
  }

  .hero-title {
    font-size: 2.5rem;
    margin-bottom: 1rem;
  }

  .hero-subtitle {
    font-size: 1.1rem;
    margin-bottom: 0.8rem;
  }

  .hero-description {
    font-size: 0.9rem;
    margin-bottom: 1.5rem;
  }

  .section-header {
    margin-bottom: 2rem;
  }

  .about,
  .services,
  .projects,
  .tech-stack,
  .testimonials,
  .contact {
    padding: 3rem 0;
  }
}

/* High DPI displays */
@media screen and (-webkit-min-device-pixel-ratio: 2),
  screen and (min-resolution: 192dpi) {
  /* Enhance SVG rendering */
  svg {
    shape-rendering: geometricPrecision;
  }

  /* Sharper text rendering */
  body {
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
  }
}

/* Reduced motion preferences */
@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }

  .typing-text {
    width: 100% !important;
    border-right: none !important;
  }

  .particle,
  .node,
  .connection {
    animation: none !important;
  }

  .tech-orbit .orbit {
    animation: none !important;
  }

  .tech-item {
    animation: none !important;
  }
}

/* Dark mode support (if user prefers dark) */
@media (prefers-color-scheme: dark) {
  /* Already optimized for dark theme */
  body {
    background: #000;
  }
}

/* Light mode fallback (if needed) */
@media (prefers-color-scheme: light) {
  /* Keep dark theme as it's part of the design */
  body {
    background: #0a0a0a;
    color: #e0e0e0;
  }
}

/* Print styles */
@media print {
  * {
    background: white !important;
    color: black !important;
    animation: none !important;
    transition: none !important;
  }

  .navbar,
  .hero-background,
  .contact-background,
  .footer-background {
    display: none !important;
  }

  .container {
    max-width: none !important;
    padding: 0 !important;
  }

  .section-header {
    page-break-after: avoid;
  }

  .service-card,
  .project-card,
  .testimonial-card {
    page-break-inside: avoid;
    border: 1px solid #ccc !important;
    margin-bottom: 1rem !important;
  }
}

/* Accessibility improvements */
@media (prefers-contrast: high) {
  .nav-link,
  .cta-button,
  .submit-button {
    border: 2px solid currentColor;
  }

  .service-card,
  .project-card,
  .testimonial-card {
    border-width: 2px;
  }

  .highlight {
    background: #ffff00;
    color: #000;
    -webkit-text-fill-color: #000;
  }
}

/* Focus improvements for keyboard navigation */
a:focus,
button:focus,
input:focus,
select:focus,
textarea:focus {
  outline: 3px solid var(--primary-amber);
  outline-offset: 2px;
}

/* Hover states disabled on touch devices */
@media (hover: none) {
  .service-card:hover,
  .project-card:hover,
  .testimonial-card:hover,
  .tech-item:hover,
  .social-link:hover {
    transform: none;
    box-shadow: none;
  }

  .service-overlay {
    display: none;
  }

  /* Touch-friendly button sizes */
  .cta-button,
  .submit-button,
  .nav-link {
    min-height: 44px;
    min-width: 44px;
  }
}
