@media (max-width: 1080px) {
  .portrait-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (min-width: 761px) {
  .language-switcher--desktop {
    display: flex !important;
  }

  .language-switcher--mobile {
    display: none !important;
  }
}

@media (max-width: 900px) {
  :root {
    --header-height: 82px;
    --section-space: clamp(66px, 11vw, 96px);
  }

  .hero-banner {
    min-height: clamp(620px, 86svh, 860px);
  }

  .hero-banner__content {
    padding-bottom: clamp(48px, 7vh, 76px);
  }

  .hero-banner__message {
    margin-top: clamp(80px, 20vh, 190px);
  }

  .site-footer__inner {
    flex-direction: column;
  }

  .footer-links {
    justify-content: flex-start;
  }
}

@media (max-width: 760px) {
  /* Keep game and playtest content aligned with 24px side gutters on mobile. */
  .world-section > .section-copy--wide,
  .email-section > .updates-content {
    width: calc(100% - 48px);
  }

  .site-header__inner {
    gap: 10px;
  }

  .brand {
    min-width: 0;
  }

  .brand__logo {
    width: 104px;
    max-height: calc(var(--header-height) - 12px);
  }

  .header-actions {
    gap: 7px;
    flex-shrink: 0;
  }

  .header-cta {
    min-height: 40px;
    padding-inline: 14px;
  }

  .language-switcher--desktop {
    display: none !important;
  }

  .language-switcher--mobile {
    position: relative;
    display: block !important;
  }

  .language-switcher--mobile .language-switcher__trigger {
    display: inline-flex !important;
    min-width: 44px;
    min-height: 44px;
    color: var(--color-ink-muted);
    background: rgba(var(--color-bg-deep-rgb), 0.7);
    border: 1px solid rgba(255, 255, 255, 0.2);
  }

  .language-switcher--mobile .language-switcher__options {
    position: absolute;
    top: calc(100% + 9px);
    right: 0;
    z-index: 90;
    display: grid !important;
    min-width: 62px;
    padding: 5px;
    background: rgba(var(--color-bg-deep-rgb), 0.98);
    border: 1px solid var(--color-line-strong);
    box-shadow: var(--shadow-soft);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-7px);
    transition: opacity 140ms ease, transform 140ms ease, visibility 140ms ease;
  }

  .language-switcher--mobile.is-open .language-switcher__options {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
  }

  .language-switcher--mobile a {
    min-width: 48px;
    min-height: 44px;
  }

  .game-title {
    max-width: 100%;
    font-size: 48px;
    letter-spacing: 0;
  }

  .hero-tagline {
    max-width: 17ch;
    font-size: 48px;
  }

  .hero-lead {
    max-width: 36ch;
    font-size: 24px;
  }

  .portrait-grid {
    gap: 12px;
  }

  .portrait-card {
    padding: 20px 14px 22px;
  }

  .portrait-silhouette {
    width: min(118px, 72%);
  }

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

@media (max-width: 560px) {
  :root {
    --gutter: 16px;
  }

  .hero-banner {
    min-height: 720px;
  }

  .hero-banner__content {
    padding-top: calc(var(--header-height) + 44px);
    padding-bottom: 54px;
  }

  .hero-banner__message {
    margin-top: 110px;
  }

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

  .portrait-flag {
    top: 9px;
    right: 9px;
    width: 35px;
    height: 28px;
  }

  .portrait-flag .flag-icon {
    width: 22px;
    height: 15px;
  }

  .portrait-card h3 {
    font-size: 24px;
  }

  .portrait-card p {
    font-size: 24px;
  }

  .signup-card {
    padding: 22px 18px;
  }

  .signup-card .button {
    width: 100%;
  }

  .footer-links {
    flex-direction: column;
    gap: 20px;
  }

  .site-footer__inner,
  .footer-links {
    align-items: center;
    justify-content: center;
    text-align: center;
  }
}

@media (prefers-reduced-motion: reduce) {
  .language-switcher--mobile .language-switcher__options { transition: none; }
}

@media (max-width: 400px) {
  .brand__logo {
    width: 92px;
  }

  .header-cta {
    min-height: 38px;
    padding: 9px 12px;
  }

  .language-switcher a,
  .language-switcher__trigger {
    padding: 7px;
  }

  .flag-icon {
    width: 23px;
    height: 16px;
  }


}

/* Mobile only: the person's centre is 23% across the 2048 x 1157 artwork.
   A plain 23% object-position does NOT put that point in the viewport centre.
   The viewport correction does; min() clamps at the image edge on wider phones
   to avoid empty margins. Preserve the full image height and desktop framing. */
@media (max-width: 760px), (max-width: 960px) and (hover: none) and (pointer: coarse) {
  .hero-banner__image {
    object-position: min(0px, calc(23% + 27vw)) top;
  }
}

@media (max-width: 560px) {
  .portrait-grid {
    grid-template-columns: 1fr;
  }

  .portrait-card {
    display: grid;
    grid-template-columns: 84px 1fr;
    column-gap: 16px;
    align-items: center;
    text-align: left;
  }

  .portrait-silhouette {
    grid-row: 1 / span 2;
    width: 84px;
    margin: 0;
  }

  .portrait-card h3,
  .portrait-card p {
    grid-column: 2;
  }
}
