/*
 * Phone-only layout corrections.
 * Keep every rule inside a narrow media query so desktop and tablet layouts
 * cannot be changed while the compact experience is refined.
 */
@media (max-width: 767px) {
  /* The drawer starts below the persistent header instead of hiding its first
     item behind the brand/navigation bar. */
  .mobile-menu {
    inset: var(--header-height) 0 0;
    overscroll-behavior: contain;
    padding: 0.65rem 20px calc(1rem + env(safe-area-inset-bottom));
  }

  .menu-open .site-header {
    background: var(--ivory);
    border-bottom: 1px solid var(--line);
    position: fixed;
  }

  .mobile-menu nav {
    gap: 0;
    margin: 0;
  }

  .mobile-menu nav a {
    align-items: center;
    display: flex;
    font-size: clamp(1rem, 4.8vw, 1.22rem);
    font-weight: 650;
    line-height: 1.25;
    min-height: 48px;
    padding: 0.68rem 0;
  }

  .mobile-menu .button {
    font-size: 0.78rem;
    margin-top: 0.7rem;
    min-height: 44px;
    padding-block: 0.62rem;
    width: 100%;
  }

  /* JS changes only --mobile-beat-y on phones. These transforms preserve the
     horizontal centering that was previously overwritten by inline styles. */
  .home-hero-content {
    max-width: 100%;
  }

  /* The accessible/low-power fallback gets the same centred first screen,
     while its following story cards remain in normal document flow. */
  .home-hero.is-static-hero .home-hero-stage,
  .home-hero:not(.has-real-3d) .home-hero-stage {
    padding: var(--header-height) 0 4rem;
  }

  .home-hero.is-static-hero .hero-copy,
  .home-hero:not(.has-real-3d) .hero-copy {
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-height: calc(100svh - var(--header-height) - var(--mobile-dock-page-clearance));
    padding-block: 2rem;
  }

  .home-hero.has-real-3d .hero-copy {
    box-sizing: border-box;
    left: 50%;
    margin: 0;
    max-width: none;
    padding-inline: 0;
    right: auto;
    text-align: center;
    transform: translate3d(-50%, calc(-50% + var(--mobile-beat-y, 0px)), 0) !important;
    width: min(100%, 520px);
  }

  .home-hero .hero-copy .eyebrow {
    letter-spacing: 0.1em;
    margin-inline: auto;
    max-width: 100%;
    overflow-wrap: anywhere;
  }

  .home-hero .hero-copy h1 {
    margin-inline: auto;
    max-width: 12ch;
    overflow-wrap: normal;
    text-wrap: balance;
  }

  .home-hero .hero-copy .intro {
    max-width: 36ch;
    overflow-wrap: anywhere;
    width: 100%;
  }

  .home-hero .hero-copy .button-row {
    margin-inline: auto;
    max-width: 360px;
    width: 100%;
  }

  .home-hero.has-real-3d .hero-beat,
  .home-hero.has-real-3d .hero-closing {
    transform: translate3d(0, var(--mobile-beat-y, 0px), 0) !important;
    width: 100%;
  }

  /* User-supplied SVGs keep a consistent optical box in the conversion dock. */
  .mobile-conversion-bar__icon {
    display: block;
    filter: none;
    height: 17px;
    object-fit: contain;
    width: 17px;
  }

  .mobile-conversion-bar__action--primary .mobile-conversion-bar__icon {
    filter: brightness(0) invert(1);
  }

  /* Compact footer composition for phones only. Desktop/tablet footer rules
     remain untouched in components.css and responsive.css. */
  .site-footer {
    padding: 2.5rem 0 calc(1.75rem + env(safe-area-inset-bottom));
  }

  .site-footer .container {
    width: min(100% - 36px, 520px);
  }

  .footer-grid {
    align-items: start;
    gap: 2rem 1.25rem;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .footer-grid > * {
    min-width: 0;
  }

  .footer-grid > .footer-intro {
    border-bottom: 1px solid rgba(255, 255, 255, 0.14);
    grid-column: 1 / -1;
    padding-bottom: 1.75rem;
    text-align: center;
  }

  .footer-logo-block {
    height: 54px;
    margin: 0 auto 1rem;
    width: 158px;
  }

  .footer-logo-block img {
    width: 138px;
  }

  .footer-intro p {
    font-size: 0.88rem;
    line-height: 1.65;
    margin: 0 auto 0.85rem;
    max-width: 36ch;
  }

  .footer-intro .text-link {
    display: inline-flex;
    font-size: 0.84rem;
    min-height: 36px;
    padding: 0.45rem 0;
  }

  .footer-heading {
    font-size: 0.7rem;
    letter-spacing: 0.12em;
    margin-bottom: 0.9rem;
  }

  .footer-links {
    gap: 0.25rem;
  }

  .footer-links a {
    align-items: center;
    display: flex;
    font-size: 0.82rem;
    line-height: 1.45;
    min-height: 34px;
    overflow-wrap: anywhere;
    padding: 0.22rem 0;
  }

  .footer-column--contact .footer-links a {
    word-break: break-word;
  }

  .footer-bottom {
    align-items: center;
    flex-direction: column;
    font-size: 0.72rem;
    gap: 0.65rem;
    margin-top: 2.25rem;
    padding-top: 1.15rem;
    text-align: center;
  }

  .footer-bottom > span {
    line-height: 1.65;
  }
}

@media (max-width: 374px) {
  :root {
    --container: calc(100vw - 32px);
    --reading: calc(100vw - 32px);
  }

  .home-hero .hero-copy h1 {
    font-size: clamp(2rem, 11vw, 2.35rem);
  }

  .home-hero .hero-copy .button-row {
    grid-template-columns: 1fr;
    max-width: 250px;
  }

  .home-hero .hero-copy .button {
    min-height: 42px;
  }

  .site-footer .container {
    width: calc(100% - 28px);
  }

  .footer-grid {
    gap: 1.75rem 1rem;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .footer-grid > .footer-intro {
    grid-column: 1 / -1;
  }

  .footer-links a {
    font-size: 0.78rem;
  }
}
