/* Home page only — loaded after styles.css via meta.stylesheets.
   The page is a sequence of full-width "stages": a mono kicker, one large
   headline, at most one sentence, then imagery. Shared pages keep using the
   800px .wrap; stages manage their own width so imagery can breathe. */

.stage {
  padding: 96px 24px;
  border-top: 1px solid var(--line);
}

.stage-inner {
  max-width: 1140px;
  margin: 0 auto;
}

.stage-inner.narrow {
  max-width: 760px;
  text-align: center;
}

/* Stays in the accessibility tree (unlike `hidden`) so screen-reader heading
   navigation still finds sections whose heading is visual noise. */
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  clip-path: inset(50%);
  overflow: hidden;
  white-space: nowrap;
}

/* Typography */

.big {
  font-size: clamp(38px, 6.5vw, 84px);
  line-height: 1.03;
  font-weight: 700;
  letter-spacing: -0.025em;
  margin: 14px 0 18px;
  text-wrap: balance;
}

/* --accent-text, not --accent: identical in dark, but light-mode --accent is
   2.6:1 on the page background — under the 3:1 large-text minimum (WCAG 1.4.3).
   The hero h1's em is overridden below for the same reason; styles.css keeps
   the old colour for the unlisted tech/architecture pages. */
.big em {
  font-style: normal;
  color: var(--accent-text);
}

.home-hero h1 em {
  color: var(--accent-text);
}

.line {
  font-size: clamp(17px, 2vw, 21px);
  line-height: 1.55;
  color: var(--text-secondary);
  max-width: 44ch;
  text-wrap: pretty;
}

.stage-inner.narrow .line {
  margin-inline: auto;
}

.line a {
  color: var(--text);
  text-decoration: none;
  border-bottom: 1px solid var(--accent);
}

.line a:hover {
  color: var(--accent-text);
}

/* Hero */

.home-hero {
  border-top: none;
  padding-top: 88px;
  padding-bottom: 0;
  text-align: center;
  overflow: clip;
}

.home-hero .badge {
  margin-top: 20px;
}

.home-hero a.badge {
  text-decoration: none;
}

.home-hero a.badge:hover {
  background: color-mix(in srgb, var(--accent) 24%, transparent);
}

.hero-platform {
  margin-top: 18px;
}

.home-hero h1 {
  font-size: clamp(44px, 8vw, 108px);
  line-height: 1.02;
  letter-spacing: -0.03em;
  font-weight: 700;
  margin: 26px auto 20px;
  max-width: 14ch;
  text-wrap: balance;
}

.home-hero .line {
  margin: 0 auto;
}

.hero-phone {
  margin: 64px auto -160px;
  width: min(420px, 82vw);
}

/* A gradient floor so the hero phone appears to sink into the next stage. */
.hero-floor {
  height: 240px;
  background: linear-gradient(to bottom, transparent, var(--background-element));
}

/* No hairline where the floor gradient meets the stats band. */
.hero-floor + .stage {
  border-top: none;
}

/* Phones */

.phone {
  margin: 0;
}

.phone img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: clamp(28px, 4.5vw, 44px);
  border: 7px solid var(--background-element);
  outline: 1px solid var(--line);
  box-shadow: 0 32px 80px rgb(0 0 0 / 0.35);
}

@media (prefers-color-scheme: light) {
  .phone img {
    border-color: #0b111c;
    box-shadow: 0 32px 80px rgb(11 17 28 / 0.22);
  }
}

.phone figcaption {
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--text-secondary);
  text-align: center;
  margin-top: 14px;
}

/* Stat strip */

.stats {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 40px 72px;
  text-align: center;
}

.stat .n {
  display: block;
  font-family: var(--mono);
  font-size: clamp(40px, 6vw, 76px);
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text);
  font-variant-numeric: tabular-nums;
}

.stat .n.hot {
  color: var(--accent-text);
}

.stat .what {
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-secondary);
}

/* Split stages: copy one side, phone the other. */

.split {
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 4fr);
  align-items: center;
  gap: clamp(32px, 6vw, 96px);
}

.split .phone {
  width: min(360px, 100%);
  justify-self: center;
}

.split.flip > .split-copy {
  order: 2;
}

.split.flip > .phone {
  order: 1;
}

@media (max-width: 800px) {
  .split {
    grid-template-columns: 1fr;
  }

  .split.flip > .split-copy {
    order: 1;
  }

  .split.flip > .phone {
    order: 2;
  }

  .split .phone {
    width: min(320px, 88vw);
  }
}

/* Full-bleed stage: tinted band with a row of phones. */

.bleed {
  background: var(--background-element);
}

.trio {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(18px, 3vw, 44px);
  align-items: start;
  margin-top: 64px;
}

.trio .phone:nth-child(2) {
  transform: translateY(36px);
}

@media (max-width: 800px) {
  .trio {
    grid-template-columns: 1fr;
    justify-items: center;
    gap: 44px;
  }

  .trio .phone {
    width: min(320px, 88vw);
  }

  .trio .phone:nth-child(2) {
    transform: none;
  }
}

/* Pair of phones sharing one stage. */

.duo {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: clamp(24px, 4vw, 64px);
  margin-top: 64px;
}

.duo .phone {
  width: min(340px, 100%);
  justify-self: center;
}

@media (max-width: 700px) {
  .duo {
    grid-template-columns: 1fr;
    justify-items: center;
  }

  .duo .phone {
    width: min(320px, 88vw);
  }
}

/* Typographic-only stage */

.quiet {
  text-align: center;
  padding-block: 128px;
}

.quiet .big {
  max-width: 18ch;
  margin-inline: auto;
}

.quiet .line {
  margin-inline: auto;
}

/* Beta CTA */

.cta-mail {
  display: inline-block;
  margin-top: 28px;
  font-weight: 650;
  font-size: 17px;
  color: var(--on-accent);
  background: var(--accent);
  padding: 14px 28px;
  border-radius: 999px;
  text-decoration: none;
}

.cta-mail:hover {
  background: var(--accent-hot);
}

/* The shared focus ring is --accent-text, which in dark mode equals the
   button's own fill — visible only via the offset gap. Make it explicit. */
.cta-mail:focus-visible {
  outline-color: var(--text);
}

.beta-faq {
  margin-top: 24px;
  font-size: 15px;
}

/* Gallery reuses .shots-scroll/.shots-container/.shot from styles.css. */

.home-disclaimer {
  font-size: 13px;
  color: var(--text-secondary);
  max-width: 68ch;
  margin: 28px auto 0;
  text-align: center;
}

/* Motion — only when the tiny inline script has confirmed IntersectionObserver
   and the visitor has not asked for reduced motion (html.anim). Without it the
   page is fully visible and static, so no-JS visitors lose nothing. */

html.anim .reveal {
  opacity: 0;
  transform: translateY(28px);
}

html.anim .reveal.in {
  opacity: 1;
  transform: none;
  transition:
    opacity 0.7s ease,
    transform 0.7s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Scroll-linked float for phones where the browser supports it natively —
   the Apple-style "images travel as you scroll" effect, zero JS. */
@supports (animation-timeline: view()) {
  html.anim .phone {
    animation: phone-rise linear both;
    animation-timeline: view();
    animation-range: entry 0% cover 45%;
  }

  @keyframes phone-rise {
    from {
      transform: translateY(56px) scale(0.965);
    }

    to {
      transform: none;
    }
  }

  /* The trio keeps its staggered offset by animating only the img inside. */
  html.anim .trio .phone {
    animation: none;
  }

  html.anim .trio .phone img {
    animation: phone-rise linear both;
    animation-timeline: view();
    animation-range: entry 0% cover 45%;
  }
}
