/* ==========================================================================
   RESONATE LABS - Responsive Styles
   Mobile-first breakpoints and layout adjustments
   ========================================================================== */

/* ===== Mobile Base (Default) ===== */
/* Styles in other files are mobile-first */

/* ===== Small Mobile (up to 374px) ===== */
@media (max-width: 374px) {
  :root {
    --text-5xl: 2rem;
    --text-4xl: 1.75rem;
    --text-3xl: 1.5rem;
    --space-3xl: 2rem;
    --space-4xl: 3rem;
  }

  .container {
    padding: 0 var(--space-sm);
  }

  .hero__ctas {
    flex-direction: column;
    width: 100%;
  }

  .hero__ctas .btn {
    width: 100%;
  }

  .brainwave-grid {
    grid-template-columns: 1fr;
  }

  .brainwave-grid > :nth-child(5) {
    grid-column: span 1;
    max-width: 100%;
  }
}

/* ===== Small Screens (576px+) ===== */
@media (min-width: 576px) {
  .hero__badges {
    gap: var(--space-lg);
  }

  .demo-player__visualizer {
    max-width: 350px;
  }

  .store-badges {
    flex-direction: row;
  }
}

/* ===== Tablet (640px+) ===== */
@media (min-width: 640px) {
  .hero__title {
    font-size: clamp(3rem, 8vw, 4.5rem);
  }

  .hero__subtitle {
    font-size: var(--text-xl);
  }

  .brainwave-grid {
    grid-template-columns: repeat(3, 1fr);
  }

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

/* ===== Tablet Landscape (768px+) ===== */
@media (min-width: 768px) {
  :root {
    --text-5xl: 3rem;
    --text-4xl: 2.25rem;
    --text-3xl: 1.875rem;
    --blur-lg: 20px;
    --blur-xl: 40px;
  }

  .header__inner {
    padding: 0;
  }

  .hero {
    padding: var(--space-4xl) var(--space-xl);
  }

  .hero__title {
    font-size: var(--text-5xl);
  }

  .section {
    padding: calc(var(--space-4xl) * 1.5) 0;
  }

  .section__header {
    margin-bottom: var(--space-3xl);
  }

  .demo-player {
    max-width: 700px;
  }

  .demo-player__visualizer {
    max-width: 400px;
  }

  .transport__progress {
    flex-direction: row;
  }

  .transport__volume {
    width: auto;
  }

  .footer__links {
    gap: var(--space-2xl);
  }

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

  .glass-card,
  .brainwave-card {
    padding: var(--space-xl);
  }
}

/* ===== Small Desktop (992px+) ===== */
@media (min-width: 992px) {
  .section__title {
    font-size: var(--text-5xl);
  }

  .brainwave-grid {
    grid-template-columns: repeat(5, 1fr);
  }
}

/* ===== Desktop (1024px+) ===== */
@media (min-width: 1024px) {
  :root {
    --text-5xl: 3.5rem;
    --text-4xl: 2.5rem;
    --blur-plasma: 60px;
  }

  .hero__title {
    font-size: var(--text-5xl);
  }

  .hero__content {
    max-width: 900px;
  }

  .section__header {
    max-width: 800px;
  }

  .glass-card,
  .brainwave-card {
    padding: var(--space-2xl);
  }

  .glass-panel {
    padding: var(--space-3xl);
  }

  .demo-player__controls {
    padding: var(--space-2xl);
  }

  /* Enable all plasma blobs on desktop */
  .plasma__blob--3,
  .plasma__blob--4 {
    display: block;
  }
}

/* ===== Large Desktop (1200px+) ===== */
@media (min-width: 1200px) {
  :root {
    --text-5xl: 4rem;
    --text-4xl: 3rem;
  }
}

/* ===== Extra Large Desktop (1280px+) ===== */
@media (min-width: 1280px) {
  :root {
    --text-6xl: 4.5rem;
    --text-5xl: 4rem;
  }

  .container {
    max-width: var(--container-xl);
  }

  .hero__content {
    max-width: 1000px;
  }

  .demo-player__visualizer {
    max-width: 450px;
  }
}

/* ===== Ultra Wide (1536px+) ===== */
@media (min-width: 1536px) {
  .container {
    max-width: var(--container-2xl);
  }

  :root {
    --text-7xl: 5rem;
  }
}

/* ===== Height-based Adjustments ===== */

/* Short viewports */
@media (max-height: 700px) {
  .hero {
    min-height: auto;
    padding: var(--space-3xl) var(--space-md);
  }

  .hero__scroll-hint {
    display: none;
  }
}

/* Very short viewports (landscape phones) */
@media (max-height: 500px) and (orientation: landscape) {
  .hero {
    padding: var(--space-2xl) var(--space-md);
  }

  .hero__title {
    font-size: var(--text-4xl);
  }

  .hero__subtitle {
    font-size: var(--text-base);
    margin-bottom: var(--space-lg);
  }

  .demo-player__visualizer {
    max-width: 200px;
  }

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

/* ===== Touch Device Adjustments ===== */
@media (hover: none) and (pointer: coarse) {
  /* Remove hover states that won't work on touch */
  .glass-card:hover,
  .brainwave-card:hover,
  .brainwave-btn:hover {
    transform: none;
  }

  .btn:hover {
    transform: none;
  }

  .glass-button:hover {
    transform: none;
  }

  /* Increase tap targets for better touch interaction */
  .transport__btn {
    min-width: 48px;
    min-height: 48px;
  }

  .footer__link {
    padding: var(--space-sm) var(--space-md);
  }

  .brainwave-btn {
    padding: var(--space-xl);
  }

  /* Make buttons slightly larger on touch devices */
  .btn {
    padding: var(--space-lg) var(--space-xl);
  }
}

/* ===== High DPI Screens (Retina) ===== */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
  /* Use sharper shadows on retina displays */
  .glass-card,
  .brainwave-card,
  .glass-panel {
    box-shadow:
      0 4px 24px rgba(0, 0, 0, 0.3),
      0 1px 2px rgba(0, 0, 0, 0.1);
  }
}

/* ===== Dark Mode (site is dark-themed by default) ===== */
@media (prefers-color-scheme: dark) {
  /* Site is already dark-themed, no changes needed */
  /* This is here for future light mode support if needed */
}

/* ===== Light Mode (future-proofing) ===== */
@media (prefers-color-scheme: light) {
  /* Optional: Add light mode overrides in the future */
}

/* ===== Print Styles ===== */
@media print {
  /* Hide non-essential elements */
  .hero__background,
  .plasma,
  .visualizer-glow,
  .header,
  .hero__scroll-hint,
  .demo-player,
  .store-badge::before,
  .glass-edge-light::after {
    display: none !important;
  }

  /* Adjust colors for print */
  body {
    background: white;
    color: black;
  }

  .glass-card,
  .brainwave-card,
  .glass-panel,
  .glass-button {
    background: #f5f5f5;
    border: 1px solid #ddd;
    backdrop-filter: none;
    box-shadow: none;
  }

  a {
    color: #0066cc;
    text-decoration: underline;
  }

  .section {
    page-break-inside: avoid;
  }

  h1, h2, h3 {
    page-break-after: avoid;
  }

  /* Show URLs for links */
  a[href^="http"]::after {
    content: " (" attr(href) ")";
    font-size: 0.8em;
  }
}

/* ===== High Contrast Mode ===== */
@media (prefers-contrast: high) {
  :root {
    --glass-light: rgba(255, 255, 255, 0.2);
    --glass-medium: rgba(255, 255, 255, 0.3);
    --glass-strong: rgba(255, 255, 255, 0.4);
    --glass-stroke: rgba(255, 255, 255, 0.4);
    --text-secondary: rgba(255, 255, 255, 0.95);
    --text-muted: rgba(255, 255, 255, 0.85);
  }

  .glass-card,
  .brainwave-card,
  .glass-panel,
  .glass-button {
    border-width: 2px;
  }

  a:focus-visible,
  button:focus-visible {
    outline-width: 3px;
  }

  .btn {
    border-width: 2px;
  }
}

/* ===== Reduced Transparency (Accessibility) ===== */
@media (prefers-reduced-transparency: reduce) {
  .glass,
  .glass-card,
  .glass-panel,
  .glass-button,
  .glass-badge,
  .brainwave-card,
  .glass-input {
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    background: rgba(26, 32, 40, 0.95);
  }
}

/* ===== Responsive Grid Utilities ===== */

/* Hide elements at specific breakpoints */
.hide-mobile {
  display: none;
}

@media (min-width: 768px) {
  .hide-mobile {
    display: initial;
  }

  .hide-tablet {
    display: none;
  }
}

@media (min-width: 1024px) {
  .hide-tablet {
    display: initial;
  }

  .hide-desktop {
    display: none;
  }
}

/* Show elements at specific breakpoints */
.show-mobile {
  display: initial;
}

@media (min-width: 768px) {
  .show-mobile {
    display: none;
  }

  .show-tablet {
    display: initial;
  }
}

@media (min-width: 1024px) {
  .show-tablet {
    display: none;
  }

  .show-desktop {
    display: initial;
  }
}

/* ===== Container Adjustments ===== */
@media (max-width: 576px) {
  .container {
    padding: 0 var(--space-md);
  }
}

@media (min-width: 577px) and (max-width: 768px) {
  .container {
    padding: 0 var(--space-lg);
  }
}

@media (min-width: 769px) {
  .container {
    padding: 0 var(--space-xl);
  }
}
