/* Keep the home hero actions in normal flow on tablet and phone screens. */
@media (max-width: 850px) {
  .hero {
    height: auto;
    min-height: 0;
    padding: 54px 20px 25px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 30px;
  }

  .hero-center { padding-bottom: 0; }

  .hero .stats {
    position: relative;
    inset: auto;
    width: min(100%, 560px);
    margin: 0 auto;
    transform: none;
    animation: none;
  }

  /* Mobile browsers can resize the visible viewport as their browser chrome moves. */
  .hero { min-height: 0; }
}

/* Make the expanded navigation usable on short landscape screens. */
@media (max-width: 850px) {
  .mobile-nav-toggle {
    width: 44px;
    height: 44px;
    flex: 0 0 44px;
  }
}

@media (max-width: 360px) {
  .hero .stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    column-gap: 12px;
    row-gap: 16px;
    padding: 18px 12px;
  }

  .hero .stat,
  .hero .stat:nth-child(4),
  .hero .stat:nth-child(5) {
    grid-column: auto;
    margin-top: 0;
    padding: 0 6px;
    border-right: 1px solid #f9a839;
  }

  .hero .stat:nth-child(even),
  .hero .stat:last-child { border-right: 0; }
  .hero .stat:last-child { grid-column: 1 / -1; }
  .hero .stat span { line-height: 1.5; }

  .gallery-heading {
    flex-direction: column;
    align-items: flex-start;
    gap: 14px;
  }

  .gallery-heading h2 { max-width: 100%; }
  .gallery-more { flex: 0 0 auto; white-space: nowrap; }

  /* Keep reveal animations from shifting the page sideways during mobile scroll. */
  .about-motion-ready .about-card,
  .about-motion-ready .about-copy-reveal > *,
  .about-motion-ready.about-in-view .about-card,
  .about-motion-ready.about-in-view .about-copy-reveal > * {
    opacity: 1;
    transform: none;
    transition: none;
    will-change: auto;
  }
}

/* The three-photo strip must shrink to the viewport instead of forcing 900px. */
@media (min-width: 561px) and (max-width: 899px) {
  .gallery-stage {
    width: calc(100% - 40px);
    min-width: 0;
    margin-inline: auto;
  }

  .side-photo { width: 40%; }
  .left-photo { left: 0; }
  .right-photo { right: 0; }
  .focus-photo { width: min(72vw, 500px); }
}

/* Let the century orbit and its year labels fit narrow phones. */
@media (max-width: 780px) {
  .century,
  .century-inner,
  .century-copy,
  .century-copy h2,
  .century-copy > p {
    box-sizing: border-box;
    min-width: 0;
    max-width: 100%;
  }

  .century { padding-inline: clamp(12px, 4vw, 24px); }
  .century-inner { width: 100%; }
  .century-copy h2,
  .century-copy > p:not(.century-years) { overflow-wrap: anywhere; }
}

@media (max-width: 400px) {
  .century { width: 100%; max-width: 100%; padding-right: 12px; padding-left: 12px; overflow: clip; }
  .century-inner, .century-copy, .century-art { width: 100%; max-width: 100%; min-width: 0; }
  .century-art { height: 260px; overflow: clip; }
  .time-ring-outer { width: min(220px, 78vw); height: min(220px, 78vw); }
  .orbit-progress { width: min(100%, 270px); height: auto; max-width: 100%; }
  .century-number { width: 122px; height: 122px; }
  .century-number b { font-size: 40px; }
  .year-start { left: 4px; max-width: calc(100% - 8px); font-size: 14px; }
  .year-end { right: 4px; max-width: calc(100% - 8px); font-size: 14px; }
  .year-now { right: 8px; }
}
