
@media (min-width: 1500px) {
  :root {
    --content-max: 820px;
  }
}

/* Tablet */
@media (max-width: 900px) {
  :root {
    --maze-w: clamp(110px, 20vw, 170px);
  }

}

/* Mobile */
@media (max-width: 640px) {
  :root {
    --gutter: 20px;
    --maze-w: clamp(50px, 20vw, 170px);
    --maze-bg-w: 190px;
  }

  .page__main {
    padding-inline: 20px 18px;
  }

  .site-header {
    flex-wrap: wrap;
    row-gap: 10px;
    column-gap: 10px;
    padding-top: 22px;
  }

  .brand {
    gap: 8px;
  }

  .header-actions {
    flex-shrink: 0;

    margin-inline-start: auto;
    gap: 8px;
  }

  .icon-btn {
    width: 30px;
    height: 30px;
    font-size: 16px;
  }

  .lang__btn span {
    display: none;
  }

  .lang__btn {
    width: 30px;
    height: 30px;
    justify-content: center;
  }

  .lang__btn .icon {
    font-size: 20px;
  }

  .lang__menu {
    inset-inline-end: -6px;
  }

  /* Hero */
  .hero__title {
    font-size: clamp(2.2rem, 10.6vw, 3.2rem);
  }

  :root[lang="ar"] .hero__title {
    font-size: clamp(1.7rem, 8vw, 2.5rem);
  }

  .eyebrow {
    font-size: 0.78rem;
  }

  /* Signup: stacked, full width, thumb-friendly */
  .signup__row {
    flex-direction: column;
  }

  :root[data-theme="dark"] .signup__row {
    gap: 8px;
  }

  .signup__input,
  .btn-primary {
    width: 100%;
    height: 48px;
  }

  :root[data-theme="light"] .signup__input {
    border-bottom: 0;
  }

  .btn-primary,
  :root[data-theme="dark"] .btn-primary,
  :root[data-theme="light"] .btn-primary {
    min-width: 0;
  }

  .signup__input {
    font-size: 16px; /* prevents iOS zoom on focus */
  }

  /* Video */
  .video-card {
    aspect-ratio: 4 / 3.4;
  }

  .video-card__title {
    max-width: calc(100% - 32px);
    white-space: normal;
    text-align: center;
    line-height: 1.2;
  }

  /* Evidence header: title, lead, then controls */
  .evidence__head {
    grid-template-columns: 1fr;
  }

  .evidence__controls {
    grid-row: 3;
    margin-top: 14px;
  }

  .ctrl-btn {
    flex: 1;
    justify-content: center;
    height: 42px;
  }

  /* Footer */
  .site-footer {
    flex-wrap: wrap;
    gap: 8px 14px;
  }

  :root[data-theme="dark"] .site-footer__rule {
    display: none;
  }

  .site-footer__tagline {
    margin-inline-start: auto;
  }
}

/* Very small phones */
@media (max-width: 380px) {
  .site-footer {
    flex-direction: column;
    align-items: flex-start;
  }

  .site-footer__tagline {
    margin-inline-start: 0;
  }
}

/* Narrow enough that the maze strip + header no longer leave room for the
   logo and the theme/language buttons on one line trim the maze and
   tighten the header's own gaps a bit more here only, so it stops
   wrapping the icons onto a second line. */
@media (max-width: 350px) {
  :root {
    --maze-w: clamp(34px, 13vw, 170px);
  }

  .site-header {
    column-gap: 6px;
  }

  .brand {
    gap: 4px;
  }
}

/* Short landscape screens */
@media (max-height: 480px) and (orientation: landscape) {
  .maze {
    height: 100vh;
  }
}

/* the Login button stays on the same line as the theme and language buttons on a phone */
@media (max-width: 560px) {
  .header-actions { gap: 10px; }
  .login-btn { min-height: 36px; padding: 0 14px; font-size: 0.74rem; letter-spacing: 0.06em; }
}
