/**
 * Ethos R43 mobile refinement.
 *
 * Homepage-only visual edits that reduce first-screen density while preserving
 * the approved desktop layout, hero photographs, masks, and motion treatment.
 */

@media (max-width: 820px) {
  body.home .site-header,
  body.home .site-header.is-scrolled {
    height: 80px;
  }

  body.home .site-header__inner,
  body.home .site-header.is-scrolled .site-header__inner {
    min-height: 80px;
  }

  body.home .site-header .site-brand--ethos,
  body.home .site-header .site-brand--ethos img,
  body.home .site-header.is-scrolled .site-brand--ethos,
  body.home .site-header.is-scrolled .site-brand--ethos img {
    height: 56px;
    width: 56px;
  }

  body.home .site-header.is-scrolled {
    height: 72px;
  }

  body.home .site-header.is-scrolled .site-header__inner {
    min-height: 72px;
  }

  body.home .site-header.is-scrolled .site-brand--ethos,
  body.home .site-header.is-scrolled .site-brand--ethos img {
    height: 46px;
    width: 46px;
  }

  .ethos-home-hero.home-hero,
  .ethos-home-hero__inner {
    min-height: max(720px, 100svh);
  }

  .ethos-home-hero__inner,
  body.home .ethos-home-hero__inner {
    padding-bottom: 64px;
    padding-top: 124px;
  }

  .ethos-home-hero .ethos-home-hero__eyebrow {
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.13em;
    line-height: 1.45;
    margin-bottom: 18px;
  }

  .ethos-home-hero h1 {
    font-size: clamp(2.65rem, 11.2vw, 3.2rem);
    letter-spacing: -0.04em;
    line-height: 1.01;
    max-width: 11ch;
  }

  .ethos-home-hero__actions {
    gap: 8px;
    margin-top: 28px;
    width: min(100%, 340px);
  }

  .ethos-home-hero__advisor-link {
    display: none;
  }

  .has-js .ethos-home-hero__film-toggle.hero-film-toggle {
    border-color: rgba(255, 255, 255, 0.42);
    font-size: 0;
    gap: 0;
    height: 44px;
    min-height: 44px;
    opacity: 0.78;
    padding: 0;
    right: 16px;
    top: 92px;
    width: 44px;
  }

  .ethos-home-hero__film-toggle.hero-film-toggle::before {
    font-size: 12px;
    line-height: 1;
  }

  .ethos-home-hero__film-toggle.hero-film-toggle[aria-pressed="true"]::before {
    font-size: 10px;
  }

  .ethos-home-hero__film-toggle [data-ethos-cinemagraph-label] {
    border: 0;
    clip: rect(0 0 0 0);
    clip-path: inset(50%);
    height: 1px;
    margin: -1px;
    overflow: hidden;
    padding: 0;
    position: absolute;
    white-space: nowrap;
    width: 1px;
  }

  .ethos-home-proof {
    padding: 30px 0 26px;
  }

  .ethos-home-proof__grid {
    width: min(100% - 24px, 680px) !important;
  }

  .ethos-home-proof__item {
    min-height: 88px;
    padding: 0 8px;
  }

  .ethos-home-proof__item strong {
    font-size: clamp(2.9rem, 12.4vw, 3.65rem);
    line-height: 0.92;
  }

  .ethos-home-proof__item span {
    font-size: 9.5px;
    letter-spacing: 0.08em;
    line-height: 1.45;
    margin-top: 14px;
  }

  .ethos-home-proof__source {
    font-size: 10px;
    gap: 12px;
    line-height: 1.45;
    margin-top: 18px;
    padding: 0 20px;
  }

  .ethos-home-proof__source::before {
    height: 22px;
  }

  .ethos-home-manifesto {
    padding: 74px 0 76px;
  }

  .ethos-home-manifesto__heading h2 {
    font-size: clamp(2.65rem, 10.9vw, 3.35rem);
    line-height: 1.04;
  }

  .ethos-home-rule {
    margin-bottom: 24px;
    width: 64px;
  }

  .ethos-home-manifesto__copy {
    padding-top: 34px;
  }

  .ethos-home-manifesto__copy p {
    font-size: 0.98rem;
    line-height: 1.68;
    margin-bottom: 22px;
  }

  .ethos-home-manifesto__copy .ethos-button {
    margin-top: 8px;
  }
}

@media (max-width: 700px) {
  body.home .mobile-action-rail {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    opacity: 0;
    pointer-events: none;
    transform: translate3d(0, 110%, 0);
    transition:
      opacity 180ms ease,
      transform 240ms ease,
      visibility 0s linear 240ms;
    visibility: hidden;
  }

  body.home .mobile-action-rail a:nth-child(2) {
    display: none;
  }

  body.home .mobile-action-rail a:last-child {
    background: var(--gold);
    color: var(--ink);
  }

  body.home.ethos-mobile-refinement-ready.ethos-mobile-rail-visible:not(.menu-open):not(.ethos-quiz-open):not(.ethos-properties-fit-open) .mobile-action-rail {
    opacity: 1;
    pointer-events: auto;
    transform: translate3d(0, 0, 0);
    transition:
      opacity 220ms ease,
      transform 320ms cubic-bezier(0.22, 1, 0.36, 1),
      visibility 0s linear 0s;
    visibility: visible;
  }

  body.home.ethos-mobile-refinement-ready:not(.ethos-mobile-rail-visible) .mobile-action-rail,
  body.menu-open .mobile-action-rail,
  body.ethos-quiz-open .mobile-action-rail,
  body.ethos-properties-fit-open .mobile-action-rail {
    opacity: 0;
    pointer-events: none;
    transform: translate3d(0, 110%, 0);
    transition:
      opacity 180ms ease,
      transform 240ms ease,
      visibility 0s linear 240ms;
    visibility: hidden;
  }
}

@media (max-width: 782px) {
  body.admin-bar.home .ethos-home-hero__film-toggle.hero-film-toggle {
    top: 138px;
  }
}

@media (max-width: 430px) {
  .ethos-home-hero__inner,
  body.home .ethos-home-hero__inner {
    padding-bottom: calc(58px + env(safe-area-inset-bottom));
  }

  .ethos-home-hero h1 {
    font-size: clamp(2.62rem, 11.2vw, 3.02rem);
  }
}

@media (prefers-reduced-motion: reduce) {
  body.home .mobile-action-rail {
    transition: none !important;
  }
}
