/* mvmhub.app home page (src/mvmhub/index.html): layout only.
 *
 * The MVMHub theme (the app's colours and fonts, brand bar, footer) comes from
 * /assets/apps/mvmhub.css. This file lays out the locked design, direction C
 * (docs/superpowers/specs/2026-10-15-mvmhub-app-site-design.md): the app's hero
 * card, its onboarding slides as a carousel on phones and a row on desktop, and
 * two app screens. Below 48rem is "phone"; mvmhub-home.js uses the same
 * breakpoint for the page indicator.
 */

body.landing {
  --frame: 66rem;
  font-size: 1rem;
  line-height: 1.5;
}

/* The app's onboarding sits on a flat background, so this page drops the
   theme's radial wash. */
body.landing:has(> .home) {
  background: var(--bg);
}

.home {
  width: min(var(--frame), 100% - 2rem);
  margin: var(--space-6) auto 0;
}

/* The app's highlight markup: brand orange, no change of weight. The text
   shade of it, because primaryBrand fails AA as body text (mvmhub.css). */
.hl {
  color: var(--accent-text);
}

/* Illustrations: a still, swapped for its animation by mvmhub-home.js. */
.home-art {
  aspect-ratio: 1;
}

.home-art picture,
.home-art img,
.home-lottie {
  display: block;
  width: 100%;
  height: 100%;
}

.home-art [hidden] {
  display: none;
}

/* Hero: the app's hero surface (heroSurfaceTop → heroSurfaceBottom, heroBorder). */
.home-hero {
  display: grid;
  justify-items: center;
  gap: var(--space-4);
  padding: var(--space-6) var(--space-5);
  border: 1px solid var(--hero-border);
  border-radius: 1.5rem;
  background: linear-gradient(180deg, var(--hero-top), var(--hero-bottom));
  text-align: center;
}

.home-hero-text {
  display: grid;
  justify-items: center;
  max-width: 34rem;
}

.home-art-hero {
  order: -1;   /* phone: the art sits above the text, as in the app */
  width: 8.25rem;
}

.home-pill {
  margin: 0 0 var(--space-3);
  padding: 0.375rem 0.75rem;
  border-radius: 999px;
  background: var(--surface-sunk);
  color: var(--fg-muted);
  font: 700 0.6875rem/1.3 var(--font-display);
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.home-title {
  margin: 0 0 var(--space-3);
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(1.625rem, 1.2rem + 2.4vw, 2.875rem);
  line-height: 1.1;
  letter-spacing: -0.01em;
}

/* Body copy is tint1Foreground, not iOS secondaryLabel: secondaryLabel is
   3.2–3.4:1 on these backgrounds, below WCAG AA (spec, "The app's theme"). */
.home-lede {
  margin: 0 0 var(--space-5);
  color: var(--fg-muted);
  font-size: 1rem;
  line-height: 1.45;
}

/* The app's primary button: a full-width capsule, Montserrat Bold, white on
   brand orange. 19px, not the app's 16, so the label is large text, where
   white on MVM orange (3.4:1) meets WCAG AA; the beta form's submit button
   does the same. */
.home-cta {
  display: block;
  width: 100%;
  padding: 0.875rem var(--space-5);
  border-radius: 999px;
  background: var(--accent);
  color: var(--accent-fg);
  font: 700 1.1875rem/1.2 var(--font-display);
  text-align: center;
  text-decoration: none;
}

.home-cta:hover {
  filter: brightness(0.95);
}

.home-cta:focus-visible {
  outline: 3px solid var(--fg);
  outline-offset: 3px;
}

.home-note {
  margin: 0.625rem 0 0;
  color: var(--fg-muted);
  font-size: 0.8125rem;
}

.home-note-wide {
  display: none;
}

/* Slides: the app's onboarding pages (OnboardingView) — centred, Montserrat
   Bold titles, secondary body copy. */
.home-why {
  margin-top: var(--space-8);
}

.home-slides {
  display: flex;
  overflow-x: auto;
  overscroll-behavior-x: contain;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
}

.home-slides::-webkit-scrollbar {
  display: none;
}

.home-slides:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 4px;
  border-radius: 1rem;
}

.home-slide {
  flex: 0 0 100%;
  scroll-snap-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-4);
  padding: var(--space-2) 1.75rem var(--space-1);
  text-align: center;
}

.home-slide .home-art {
  width: 8.25rem;
}

.home-slide h3 {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.375rem;
  letter-spacing: -0.01em;
}

.home-slide p {
  margin: 0;
  color: var(--fg-muted);
  font-size: 1.03rem;
  line-height: 1.38;
}

/* The app's page indicator (PageProgressControl): 4px segments 4px apart,
   75% wide, filled cumulatively up to the current page. Shipped hidden;
   mvmhub-home.js shows it at carousel widths. */
.home-progress {
  display: flex;
  gap: 4px;
  width: 75%;
  margin: 0.875rem auto 0;
}

.home-progress[hidden] {
  display: none;
}

.home-progress i {
  flex: 1;
  height: 4px;
  border-radius: 2px;
  background: var(--track);
  transition: background-color 0.3s ease-in-out;
}

.home-progress i.is-on {
  background: var(--accent);
}

@media (prefers-reduced-motion: reduce) {
  .home-progress i {
    transition: none;
  }
}

/* A look inside */
.home-inside {
  margin-top: var(--space-8);
}

.home-inside h2 {
  margin: 0 0 var(--space-2);
  font: 700 1.25rem/1.3 var(--font-display);
}

.home-shots {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.625rem;
}

.home-shots figure {
  margin: 0;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 1.125rem;
  background: var(--surface);
}

.home-shots img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 390 / 520;
  object-fit: cover;
  object-position: top;
}

.home-shots figcaption {
  padding: 0.625rem 0.75rem 0.75rem;
  font: 700 0.8125rem/1.25 var(--font-display);
}

.home + .mvm-footer {
  margin-top: var(--space-8);
}

@media (min-width: 48rem) {
  .home {
    margin-top: var(--space-8);
  }

  .home-hero {
    grid-template-columns: 1.15fr 0.85fr;
    align-items: center;
    justify-items: start;
    gap: var(--space-8);
    padding: var(--space-12) 3.5rem;
    text-align: left;
  }

  .home-hero-text {
    justify-items: start;
  }

  .home-art-hero {
    order: 0;
    justify-self: center;
    width: min(100%, 18.75rem);
  }

  .home-cta {
    display: inline-block;
    width: auto;
    padding: 0.9375rem 2.75rem;
  }

  .home-note-wide {
    display: inline;
  }

  .home-why {
    margin-top: 3.5rem;
  }

  .home-slides {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.75rem;
    overflow: visible;
  }

  .home-slide {
    padding: 0 0.625rem;
  }

  .home-slide .home-art {
    width: 9.375rem;
  }

  .home-progress {
    display: none;
  }

  .home-inside {
    margin-top: var(--space-16);
    text-align: center;
  }

  .home-inside h2 {
    margin-bottom: 1.625rem;
    font-size: 1.625rem;
  }

  .home-shots {
    display: flex;
    justify-content: center;
    gap: 2.75rem;
  }

  .home-shots figure {
    width: 14.375rem;
    overflow: visible;
    border: 0;
    background: none;
  }

  /* Desktop shows the screens in a device frame, as in the mockup. */
  .home-shots img {
    aspect-ratio: auto;
    border: 8px solid #151515;
    border-radius: 2.125rem;
    box-shadow: var(--shadow);
  }

  .home-shots figcaption {
    padding: 0.875rem 0 0;
    font-size: 0.9375rem;
  }
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}
