/* Responsive Design */

/* Symbols Grid 5 columns (1160px and below) */
@media (max-width: 1160px) {
  .symbols-grid {
    grid-template-columns: repeat(5, 1fr);
  }
}

/* Navigation collapse (1060px and below) */
@media (max-width: 1060px) {
  .nav {
    flex-wrap: wrap;
  }

  .nav-menu {
    display: none;
    position: fixed;
    top: 64px;
    left: 0;
    right: 0;
    background: rgba(10, 14, 26, 0.98);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    flex-direction: column;
    padding: var(--spacing-md);
    gap: var(--spacing-sm);
    box-shadow: var(--shadow-lg);
    border-bottom: 1px solid var(--glass-border);
  }

  .nav-menu.active {
    display: flex;
  }

  .nav-toggle {
    display: flex;
  }

  .nav-toggle.active span:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
  }

  .nav-toggle.active span:nth-child(2) {
    opacity: 0;
  }

  .nav-toggle.active span:nth-child(3) {
    transform: rotate(-45deg) translate(5px, -5px);
  }

  /* Symbols Grid */
  .symbols-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

/* Tablet (1024px and below) */
@media (max-width: 1024px) {
  :root {
    --font-size-5xl: 3.5rem;
    --font-size-4xl: 2.5rem;
    --font-size-3xl: 1.75rem;
    --spacing-xl: 4rem;
    --spacing-xxl: 6rem;
  }

  /* Hero */
  .hero .container {
    grid-template-columns: 1fr;
    text-align: center;
  }

  .hero-content {
    max-width: 100%;
  }

  .hero-stats {
    justify-content: center;
  }

  .hero-cta {
    justify-content: center;
  }

  /* Metrics Grid */
  .metrics-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  /* Features Grid */
  .features-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  /* Use Cases */
  .usecase-content {
    grid-template-columns: 1fr;
  }

  .usecase-content .usecase-info {
    margin-top: 0;
  }

  .usecase-code {
    order: 2;
  }

  /* Getting Started */
  .install-steps {
    grid-template-columns: 1fr;
  }

  .resources-links {
    grid-template-columns: 1fr;
  }

  /* Footer */
  .footer-content {
    flex-direction: column;
    align-items: center;
  }

  .footer-brand {
    text-align: center;
  }
}

/* Mobile (768px and below) */
@media (max-width: 768px) {
  :root {
    --font-size-5xl: 2.5rem;
    --font-size-4xl: 2rem;
    --font-size-3xl: 1.5rem;
    --font-size-2xl: 1.25rem;
    --spacing-md: 1.5rem;
    --spacing-lg: 3rem;
    --spacing-xl: 4rem;
    --container-padding: 1.5rem;
  }

  /* Hero */
  .hero {
    min-height: auto;
    padding: var(--spacing-xl) 0;
  }

  .hero-title {
    font-size: var(--font-size-4xl);
  }

  .hero-subtitle {
    font-size: var(--font-size-lg);
  }

  .hero-stats {
    flex-direction: column;
    align-items: center;
    gap: var(--spacing-sm);
  }

  .stat-item {
    align-items: center;
  }

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

  .hero-cta .btn {
    width: 100%;
  }

  /* Code Playground */
  .playground-content {
    grid-template-columns: 1fr;
  }

  .editor-panel {
    border-right: none;
    border-bottom: 1px solid var(--glass-border);
  }

  #code-editor {
    height: 400px;
  }

  .playground-header {
    flex-direction: column;
    align-items: stretch;
  }

  .example-selector {
    justify-content: space-between;
  }

  .playground-actions {
    justify-content: stretch;
  }

  .playground-actions .btn {
    flex: 1;
  }

  /* Metrics Grid */
  .metrics-grid {
    grid-template-columns: 1fr;
  }

  /* Features Grid */
  .features-grid {
    grid-template-columns: 1fr;
  }

  /* Symbols Grid */
  .symbols-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  /* Tabs */
  .tabs-nav {
    flex-direction: column;
  }

  .tab-btn {
    text-align: left;
    border-bottom: none;
    border-left: 2px solid transparent;
  }

  .tab-btn.active {
    border-bottom: none;
    border-left-color: var(--color-accent-primary);
  }

  /* Footer */
  .footer-links {
    flex-direction: column;
    align-items: center;
  }

  /* Sections */
  section {
    padding: var(--spacing-lg) 0;
  }

  .section-title {
    font-size: var(--font-size-3xl);
  }

  .section-subtitle {
    font-size: var(--font-size-base);
  }
}

/* Small Mobile (480px and below) */
@media (max-width: 480px) {
  :root {
    --font-size-5xl: 2rem;
    --font-size-4xl: 1.75rem;
    --spacing-sm: 0.75rem;
    --spacing-md: 1rem;
    --spacing-lg: 2rem;
    --container-padding: 1rem;
  }

  .hero-title {
    font-size: var(--font-size-3xl);
  }

  .stat-number {
    font-size: var(--font-size-2xl);
  }

  .metric-value {
    font-size: var(--font-size-3xl);
  }

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

  .btn-large {
    padding: 0.875rem 1.5rem;
    font-size: var(--font-size-base);
  }

  #code-editor {
    height: 300px;
  }

  .output-content {
    font-size: var(--font-size-xs);
  }
}

/* Desktop (1440px and above) */
@media (min-width: 1440px) {
  .container {
    max-width: 1400px;
  }

  .container-wide {
    max-width: 1600px;
  }
}

/* Landscape Mobile */
@media (max-height: 600px) and (orientation: landscape) {
  .hero {
    min-height: auto;
  }

  .hero-title {
    font-size: var(--font-size-3xl);
  }

  .hero-stats {
    flex-direction: row;
  }
}

/* Touch Device Optimizations */
@media (hover: none) and (pointer: coarse) {
  .btn,
  .nav-link,
  .tab-btn,
  .resource-link {
    min-height: 44px;
    min-width: 44px;
  }

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

  .hover-lift:hover {
    transform: none;
  }

  .btn-primary:hover {
    transform: none;
  }
}

/* High DPI Screens */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
  body {
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
  }
}

/* Print Styles */
@media print {
  .header,
  .footer,
  .hero-cta,
  .playground-actions,
  .copy-btn,
  .nav-toggle {
    display: none;
  }

  body {
    background: white;
    color: black;
  }

  .glass-card {
    border: 1px solid #ccc;
    box-shadow: none;
  }
}
