/* Mobile extension for the existing Greenleaf business card. */
.mobile-dock {
  display: none;
}

@media (max-width: 800px) {
  html {
    scroll-padding-top: calc(var(--mobile-header-height, 120px) + 16px);
  }

  body {
    padding-bottom: calc(var(--mobile-dock-height, calc(74px + env(safe-area-inset-bottom, 0px))) + 16px);
  }

  .site-header {
    position: sticky;
    top: 0;
    z-index: 60;
    background: var(--paper);
    padding-top: env(safe-area-inset-top, 0px);
  }

  /* A small header-only gutter keeps the 240px logo and 48px control usable at 320px. */
  .site-header .container {
    width: calc(100% - 20px);
  }

  .header-inner {
    min-height: 96px;
    padding-block: 10px;
    gap: 12px;
  }

  .site-header .brand {
    gap: 6px;
    max-width: calc(100% - 60px);
  }

  .site-header .brand img {
    width: 240px;
    max-width: 100%;
    height: auto;
  }

  .menu-toggle {
    display: flex;
    flex-shrink: 0;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 6px;
    width: 48px;
    height: 48px;
    padding: 12px;
    border-color: var(--line);
  }

  .menu-toggle span {
    display: block;
    width: 22px;
    height: 2px;
    margin: 0;
    background: var(--forest);
    transition: transform 200ms var(--ease), opacity 160ms var(--ease);
  }

  .menu-toggle[aria-expanded="true"] span:first-child {
    transform: translateY(4px) rotate(45deg);
  }

  .menu-toggle[aria-expanded="true"] span:last-child {
    transform: translateY(-4px) rotate(-45deg);
  }

  .mobile-nav {
    position: absolute;
    top: 100%;
    inset-inline: 0;
    z-index: 1;
    max-height: calc(100vh - var(--mobile-header-height, 120px) - 16px);
    max-height: calc(100dvh - var(--mobile-header-height, 120px) - 16px);
    overflow: auto;
    padding: 8px 20px 16px;
    background: var(--paper);
    border-top: 0;
    border-bottom: 1px solid var(--line);
    box-shadow: 0 10px 24px rgba(32, 61, 44, 0.10);
    -webkit-overflow-scrolling: touch;
  }

  .mobile-nav a {
    display: flex;
    align-items: center;
    min-height: 56px;
    padding-inline: 12px;
    font-size: 20px;
  }

  .mobile-nav a[aria-current="location"] {
    color: var(--brand);
    background: var(--olive);
    background: color-mix(in srgb, var(--brand) 14%, var(--paper));
    border-radius: 12px;
  }

  .mobile-dock {
    position: fixed;
    z-index: 40;
    right: 0;
    bottom: 0;
    left: 0;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 10px;
    padding: 10px 18px calc(10px + env(safe-area-inset-bottom, 0px));
    background: var(--paper);
    border-top: 1px solid var(--line);
    box-shadow: 0 -8px 22px rgba(32, 61, 44, 0.10);
    touch-action: manipulation;
  }

  .mobile-dock .button {
    min-width: 0;
    min-height: 52px;
    padding: 12px 18px;
    gap: 12px;
    font-size: 18px;
    line-height: 1.45;
    white-space: normal;
    text-wrap: balance;
  }

  .mobile-dock .button span {
    font-size: 24px;
    line-height: 1;
  }

  .mobile-dock-top {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    min-width: 86px;
    min-height: 52px;
    padding-inline: 8px;
    font-size: 16px;
    font-weight: 700;
    line-height: 1.3;
    text-align: center;
    white-space: nowrap;
    touch-action: manipulation;
  }

  .text-link,
  .hero-image figcaption > a {
    min-width: 44px;
    min-height: 44px;
    touch-action: manipulation;
  }

  .hero-image figcaption > a {
    width: 44px;
    height: 44px;
  }

  .hero {
    padding-top: 28px;
  }

  .hero-image {
    margin-top: 24px;
  }

  .section-space {
    padding-block: 44px;
  }

  .start-section {
    padding-top: 24px;
  }

  .contact-section {
    padding-block: 52px;
  }

  /* All seven supplied photographs remain naturally proportioned and fully visible. */
  .hero-image > img,
  .benefit-photo {
    height: auto;
    aspect-ratio: auto;
    object-fit: contain;
  }

  .benefit-photo {
    width: 210px;
    max-width: 100%;
  }

  .hero-description,
  .section-heading > p,
  .benefit p,
  .start-intro > p,
  .steps p,
  .contact-inner p {
    font-size: 22px;
  }

  .scroll-progress {
    z-index: 70;
  }

  /* Retain the motion language while reducing mobile compositing work. */
  .contact-sparkles .sparkle:nth-child(n + 7) {
    display: none;
  }

  body.motion-on .hero::before,
  body.motion-on .hero::after {
    filter: none;
  }

  body.motion-on .reveal-ready {
    transition-duration: 450ms;
  }
}

@media (max-width: 800px) and (prefers-reduced-motion: reduce) {
  .menu-toggle span,
  .menu-toggle[aria-expanded="true"] span:first-child,
  .menu-toggle[aria-expanded="true"] span:last-child {
    transform: none !important;
    transition: none !important;
  }
}
