/* ==========================================================================
   Responsive Styles - Mobile First
   ========================================================================== */

/* ==========================================================================
   Tablet - 768px and up
   ========================================================================== */

@media (min-width: 768px) {
  
  /* Container */
  .container {
    padding: 0 var(--container-padding-tablet);
  }
  
  /* Typography */
  h1 {
    font-size: var(--text-5xl);
  }
  
  h2 {
    font-size: var(--text-4xl);
  }
  
  h3 {
    font-size: var(--text-3xl);
  }
  
  /* Hero */
  .hero__description {
    font-size: var(--text-xl);
  }
  
  .hero__cta {
    font-size: var(--text-lg);
  }
  
  /* Project Grid - 2 columns */
  .projects-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: var(--space-2xl);
  }
  
  .project-card__content {
    padding: var(--space-xl);
  }
  
  .project-card__title {
    font-size: var(--text-2xl);
  }
  
  .project-card__description {
    font-size: var(--text-lg);
  }
  
  /* Footer */
  .footer__content {
    flex-direction: row;
    justify-content: space-between;
  }
  
  .footer__bottom {
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
  }
  
  .footer__copyright {
    text-align: left;
  }
  
  /* Utilities */
  .hide-mobile {
    display: block !important;
  }
  
  .hide-tablet {
    display: none !important;
  }
  
  /* About Page */
  .about-hero__grid {
    grid-template-columns: 1fr 1fr;
    gap: var(--space-4xl);
  }
  
  .skills-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  
  .cta-box {
    padding: var(--space-4xl) var(--space-2xl);
  }
  
  .cta-box__actions {
    flex-direction: row;
    justify-content: center;
  }
  
  /* Project Detail Page */
  .project-info-grid {
    grid-template-columns: repeat(4, 1fr);
  }
  
  .project-links {
    flex-direction: row;
  }
  
  .results-grid {
    grid-template-columns: repeat(4, 1fr);
  }
  
  .image-gallery {
    grid-template-columns: repeat(2, 1fr);
    gap: var(--space-xl);
  }
  
  .project-nav-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: var(--space-2xl);
  }
  
  /* Contact Page */
  .faq-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* ==========================================================================
   Desktop - 1024px and up
   ========================================================================== */

@media (min-width: 1024px) {
  
  /* Container */
  .container {
    padding: 0 var(--container-padding-desktop);
  }
  
  /* Navigation - Desktop Layout */
  .nav__container {
    height: 80px;
  }
  
  .nav__toggle {
    display: none; /* Hide hamburger on desktop */
  }
  
  .nav__menu {
    position: static;
    transform: none;
    width: auto;
    background-color: transparent;
    overflow: visible;
  }
  
  .nav__list {
    flex-direction: row;
    align-items: center;
    min-height: auto;
    padding: 0;
    gap: var(--space-xl);
  }
  
  .nav__item {
    margin-bottom: 0;
    opacity: 1;
    transform: none;
  }
  
  .nav__link {
    font-size: var(--text-base);
    font-weight: var(--font-medium);
  }
  
  .nav__link::after {
    bottom: -8px;
  }
  
  /* Theme Toggle - Show on desktop */
  .theme-toggle.hide-mobile {
    display: flex;
  }
  
  /* Hero */
  .hero {
    padding: var(--space-4xl) 0;
  }
  
  .hero__title {
    font-size: clamp(3.5rem, 8vw, 6rem);
  }
  
  /* Section */
  .section {
    padding: var(--space-4xl) 0;
  }
  
  .section--large {
    padding: var(--space-6xl) 0;
  }
  
  .section__title {
    font-size: var(--text-4xl);
  }
  
  /* Project Grid - 3 columns */
  .projects-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: var(--space-3xl);
  }
  
  /* Custom Cursor - Show on desktop */
  .cursor {
    display: block;
  }
  
  /* Utilities */
  .hide-mobile {
    display: flex !important; /* Use flex for buttons */
  }
  
  .hide-desktop {
    display: none !important;
  }
  
  /* About Page */
  .about-hero {
    padding: calc(80px + var(--space-4xl)) 0 var(--space-6xl);
  }
  
  .skills-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: var(--space-3xl);
  }
  
  .timeline::before {
    left: 50%;
    transform: translateX(-50%);
  }
  
  .timeline-item {
    width: 50%;
    padding-left: 0;
    padding-right: var(--space-2xl);
  }
  
  .timeline-item:nth-child(even) {
    margin-left: 50%;
    padding-right: 0;
    padding-left: var(--space-2xl);
  }
  
  .timeline-item__marker {
    left: auto;
    right: -7px;
  }
  
  .timeline-item:nth-child(even) .timeline-item__marker {
    right: auto;
    left: -7px;
  }
  
  .timeline-item__content {
    text-align: right;
  }
  
  .timeline-item:nth-child(even) .timeline-item__content {
    text-align: left;
  }
  
  .timeline-item__tags {
    justify-content: flex-end;
  }
  
  .timeline-item:nth-child(even) .timeline-item__tags {
    justify-content: flex-start;
  }
  
  /* Project Detail Page */
  .project-content__grid {
    grid-template-columns: 1fr 350px;
    gap: var(--space-4xl);
  }
  
  .project-hero__description {
    font-size: var(--text-xl);
  }
  
  .lightbox__prev {
    left: 2rem;
  }
  
  .lightbox__next {
    right: 2rem;
  }
  
  /* Contact Page */
  .contact-grid {
    grid-template-columns: 1fr 400px;
    gap: var(--space-4xl);
  }
  
  .contact-form-container {
    order: 1;
  }
  
  .contact-info {
    order: 2;
  }

  /* Hide mobile tech section on desktop */
  .mobile-tech-section {
    display: none;
  }
}

/* ==========================================================================
   Large Desktop - 1280px and up
   ========================================================================== */

@media (min-width: 1280px) {
  
  /* Hero 
  .hero__title {
    font-size: clamp(4rem, 8vw, 7rem);
  }*/
  
  /* Project Grid - Can go to 3 columns */
  .projects-grid--three-col {
    grid-template-columns: repeat(3, 1fr);
  }
}

/* ==========================================================================
   Extra Large - 1536px and up
   ========================================================================== */

@media (min-width: 1536px) {
  
  /* Typography */
  h1 {
    font-size: var(--text-7xl);
  }
  
  /* Projects Grid */
  .projects-grid {
    gap: var(--space-4xl);
  }
}

/* ==========================================================================
   Hover Media Query - Only apply hover effects on devices that support it
   ========================================================================== */

@media (hover: hover) and (pointer: fine) {
  
  /* Enhanced hover effects for desktop */
  .project-card:hover {
    transform: translateY(-4px);
  }
  
  .nav__link:hover {
    opacity: 0.7;
  }
  
  .footer__social-link:hover {
    transform: translateY(-4px);
  }
}

/* ==========================================================================
   Landscape Orientation
   ========================================================================== */

@media (max-height: 600px) and (orientation: landscape) {
  
  /* Reduce hero height on landscape mobile */
  .hero {
    min-height: auto;
    padding: var(--space-3xl) 0;
  }
  
  /* Reduce section padding */
  .section {
    padding: var(--space-2xl) 0;
  }
}

/* ==========================================================================
   High Resolution Displays
   ========================================================================== */

@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
  
  /* Optimize for retina displays */
  body {
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
  }
}

/* ==========================================================================
   Print Styles
   ========================================================================== */

@media print {
  
  /* Hide unnecessary elements */
  .nav,
  .footer,
  .loading-screen,
  .page-transition,
  .cursor,
  .scroll-progress,
  .theme-toggle {
    display: none !important;
  }
  
  /* Optimize for print */
  body {
    background: white;
    color: black;
  }
  
  .project-card {
    page-break-inside: avoid;
  }
  
  a {
    text-decoration: underline;
  }
  
  /* Show URLs after links */
  a[href]::after {
    content: " (" attr(href) ")";
    font-size: 0.8em;
  }
}

/* ==========================================================================
   Accessibility - Reduced Motion
   ========================================================================== */

@media (prefers-reduced-motion: reduce) {
  
  /* Disable animations for users who prefer reduced motion */
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
  
  .hero__label,
  .hero__title,
  .hero__description,
  .hero__cta {
    animation: none;
    opacity: 1;
  }
  
  .scroll-reveal,
  .scroll-fade-up,
  .scroll-fade-down,
  .scroll-fade-left,
  .scroll-fade-right,
  .scroll-scale {
    opacity: 1;
    transform: none;
  }
}

/* ==========================================================================
   Dark Mode Media Query
   ========================================================================== */

@media (prefers-color-scheme: dark) {
  
  /* Automatically apply dark theme if user prefers dark mode */
  body:not(.light-theme) {
    --color-bg-primary: var(--color-bg-primary-dark);
    --color-bg-secondary: var(--color-bg-secondary-dark);
    --color-bg-tertiary: var(--color-bg-tertiary-dark);
    
    --color-text-primary: var(--color-text-primary-dark);
    --color-text-secondary: var(--color-text-secondary-dark);
    --color-text-muted: var(--color-text-muted-dark);
    
    --color-border: var(--color-border-dark);
    --color-border-hover: var(--color-border-hover-dark);
    
    --color-accent: var(--color-accent-dark);
    --color-accent-hover: var(--color-accent-hover-dark);
  }
}

/* ==========================================================================
   Container Queries (Future-proofing)
   ========================================================================== */

@supports (container-type: inline-size) {
  
  .project-card {
    container-type: inline-size;
    container-name: card;
  }
  
  @container card (min-width: 400px) {
    .project-card__title {
      font-size: var(--text-2xl);
    }
  }
}