@media (max-width: 980px) {
  .hero {
    min-height: 72vh;
  }

  .hero-copy {
    font-size: 1.1rem;
  }

  .hero-shade {
    background:
      var(--hero-shade-h),
      var(--hero-shade-v);
  }

  /* Tablet Optimized Grids (581px - 980px) */
  .intro {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

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

  .feature-card.wide {
    grid-template-columns: 1fr;
  }

  .feature-card.wide img {
    border-right: 0;
    border-bottom: 1px solid var(--line);
    height: 300px;
  }

  .split {
    grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
    gap: 2.5rem;
  }

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

  .gallery-item.large {
    grid-row: span 2;
  }

  .gallery-item.large img {
    min-height: 380px;
  }

  .gallery-item.large img,
  .gallery-item img {
    height: 200px;
  }

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

  .legal-layout {
    grid-template-columns: 1fr;
  }

  .legal-toc {
    position: static;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 768px) {
  .site-header {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    gap: 0.8rem;
  }

  .brand {
    order: 1;
  }

  .header-controls {
    order: 2;
    margin-left: auto;
  }

  .nav-links {
    order: 3;
    width: 100%;
    justify-content: center;
    margin-top: 0.2rem;
    gap: 0.15rem;
  }

  .nav-links a {
    padding-inline: 0.5rem;
  }
}

@media (max-width: 580px) {
  .hero-content {
    margin-inline: 1rem;
  }

  .button {
    width: 100%;
  }

  .site-footer {
    align-items: flex-start;
    flex-direction: column;
    gap: 1rem;
  }

  /* Mobile Single-Column Overrides */
  .install-strip,
  .intro,
  .feature-grid,
  .gallery-grid,
  .download-grid,
  .split {
    grid-template-columns: 1fr;
  }

  .install-strip a {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .install-strip a:last-child {
    border-bottom: 0;
  }

  .gallery-item.large {
    grid-row: auto;
  }

  .gallery-item.large img,
  .gallery-item img {
    height: auto;
    min-height: 0;
  }

  .legal-toc {
    grid-template-columns: 1fr;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition: none !important;
  }
}
