/* Responsive Utilities and Touch Device Optimizations */

/* Add touch-friendly hover states */
@media (hover: none) and (pointer: coarse) {
  /* Remove hover effects on touch devices */
  .work-item:hover {
    transform: none;
  }
  
  .cta-button:hover {
    transform: none;
    background: var(--color-accent);
  }
  
  .nav-links a:hover {
    color: var(--color-text);
  }
  
  .footer-links a:hover {
    opacity: 0.8;
    color: var(--color-text);
  }
  
  /* Add touch-friendly active states */
  .cta-button:active {
    transform: scale(0.95);
    background: #005bb7;
  }
  
  .nav-links a:active {
    color: var(--color-accent);
  }
  
  .footer-links a:active {
    color: var(--color-accent);
  }
  
  .work-item:active {
    transform: translateY(-2px);
  }
}

/* Ensure minimum touch target sizes (44px minimum) */
@media (max-width: 768px) {
  .nav-links a {
    min-height: 44px;
    display: flex;
    align-items: center;
    padding: 0.5rem;
  }
  
  .footer-links a {
    min-height: 44px;
    display: flex;
    align-items: center;
    padding: 0.5rem;
  }
  
  .cta-button {
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }
}

/* Improved focus states for accessibility */
a:focus-visible,
button:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 2px;
  border-radius: 2px;
}

/* High contrast mode support */
@media (prefers-contrast: high) {
  :root {
    --color-accent: #0066cc;
  }
  
  .work-item {
    border: 1px solid #000;
  }
  
  .cta-button {
    border: 2px solid #000;
  }
}

/* Reduced motion support */
@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;
  }
  
  .hero-word {
    animation: none;
    opacity: 1;
    transform: none;
  }
  
  .subtitle {
    animation: none;
    opacity: 1;
  }
  
  .subtitle-small {
    transition: none;
    opacity: 1;
    transform: none;
  }
}

/* Landscape orientation optimizations for mobile */
@media (max-width: 768px) and (orientation: landscape) {
  .hero {
    padding: 1.5rem 1rem;
    min-height: 30vh;
    margin: 16rem 0 6rem;
  }
  
  .hero-title {
    font-size: 2rem;
  }
  
  .subtitle {
    font-size: 1.1rem;
  }
  
  nav {
    height: 60px;
  }
  
  main {
    padding-top: 60px;
  }
  
  .nav-content {
    font-size: 1rem;
  }
  
  body[data-page="home"] .about-preview {
    min-height: 100vh;
  }
  
  body[data-page="home"] .contact-preview {
    min-height: 80vh;
    margin: 4rem 0;
  }
}

/* Large screen optimizations */
@media (min-width: 1440px) {
  .content {
    max-width: 1400px;
  }
  
  .hero-title {
    font-size: 4rem;
  }
  
  .subtitle {
    font-size: 1.6rem;
  }
  
  h1 {
    font-size: 4rem;
  }
  
  h2 {
    font-size: 2.8rem;
  }
  
  .work-grid {
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
  }
}

/* Print styles */
@media print {
  * {
    background: transparent !important;
    color: black !important;
    box-shadow: none !important;
    text-shadow: none !important;
  }
  
  nav,
  footer,
  .hero-loading,
  .canvas-interaction-layer,
  canvas#bg {
    display: none !important;
  }
  
  main {
    padding-top: 0 !important;
  }
  
  .content {
    margin: 0 !important;
    padding: 0 !important;
  }
  
  a {
    text-decoration: underline;
  }
  
  h1, h2, h3 {
    page-break-after: avoid;
  }
  
  img {
    max-width: 100% !important;
    height: auto !important;
  }
}
