/* Tripodia — home page.
   Same type and colours as the app: Quicksand, warm ink on warm white,
   dark pill buttons. Few words, real screens, nothing that moves on its own. */

@font-face {
  font-family: "Quicksand";
  src: url("/assets/fonts/quicksand-latin-var.woff2") format("woff2");
  font-weight: 300 700;
  font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
  font-family: "Quicksand";
  src: url("/assets/fonts/quicksand-latin-ext-var.woff2") format("woff2");
  font-weight: 300 700;
  font-display: swap;
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

/* Colours from the app (lib/core/ui/app_colors.dart). */
:root {
  --bg: #fcfaf7;
  --panel: #f3efea;
  --card: #ffffff;
  --ink: #2a2724;
  --muted: #6f6962;
  --line: #ede7df;
  --brand: #2d7ff9;

  /* Plans wear the app's own skies (PremiumSky): Free stays plain paper,
     Premium a dusty dusk with peach clouds rising from below, Premium Plus
     the same sky at night, stars above and the glow left on the horizon. */
  --check-free: #b0a89f;
  --gold: #e7ca89;
  --sky-day:
    radial-gradient(95% 80% at 15% 108%, #eba898, rgba(243, 196, 180, 0)),
    radial-gradient(70% 60% at 95% 88%, #eba898, rgba(243, 196, 180, 0)),
    linear-gradient(rgba(36, 32, 54, .2), rgba(42, 39, 36, 0) 50%),
    linear-gradient(#9ea3b6, #b9b2be);
  --sky-night:
    radial-gradient(1.2px 1.2px at 34% 8%, rgba(255, 255, 255, .7), transparent),
    radial-gradient(1px 1px at 8% 10%, rgba(255, 255, 255, .55), transparent),
    radial-gradient(1px 1px at 21% 30%, rgba(255, 255, 255, .4), transparent),
    radial-gradient(1px 1px at 52% 6%, rgba(255, 255, 255, .5), transparent),
    radial-gradient(1.2px 1.2px at 61% 34%, rgba(255, 255, 255, .45), transparent),
    radial-gradient(1px 1px at 70% 14%, rgba(255, 255, 255, .6), transparent),
    radial-gradient(1.4px 1.4px at 86% 24%, rgba(255, 255, 255, .65), transparent),
    radial-gradient(1px 1px at 93% 8%, rgba(255, 255, 255, .45), transparent),
    linear-gradient(rgba(30, 27, 46, .7) 55%, rgba(30, 27, 46, .25));

  --font: "Quicksand", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --wrap: 1120px;
  --gutter: 24px;
  --section: clamp(72px, 9vw, 112px);
  --ease: cubic-bezier(.22, .61, .36, 1);

  color-scheme: light;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  font-size: 17px;
  font-weight: 500;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  overflow-x: clip;
}

img {
  max-width: 100%;
  display: block;
}

a {
  color: inherit;
}

h1,
h2,
h3,
p,
dl,
dd,
ul {
  margin: 0;
}

.wrap {
  max-width: var(--wrap);
  margin: 0 auto;
  padding: 0 var(--gutter);
}

.skip {
  position: absolute;
  left: -9999px;
  top: 8px;
  background: var(--ink);
  color: #fff;
  padding: 8px 14px;
  border-radius: 999px;
  z-index: 20;
}

.skip:focus {
  left: 16px;
}

:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: 3px;
  border-radius: 8px;
}

.h2 {
  font-size: clamp(30px, 3.6vw, 44px);
  font-weight: 600;
  line-height: 1.12;
  letter-spacing: -.02em;
  text-align: center;
  text-wrap: balance;
}

.sub {
  margin-top: 12px;
  text-align: center;
  color: var(--muted);
}

/* ---------- Button ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 52px;
  padding: 0 26px;
  border-radius: 999px;
  background: var(--ink);
  color: #fff;
  font-size: 16px;
  font-weight: 600;
  text-decoration: none;
  transition: background-color .2s;
}

.btn:hover {
  background: #000;
}

.btn svg {
  width: 20px;
  height: 20px;
  margin-top: -2px;
}

.store-note {
  margin-top: 12px;
  font-size: 14px;
  color: var(--muted);
}

/* ---------- Header ---------- */

.top-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 72px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 19px;
  font-weight: 700;
  text-decoration: none;
}

.brand img {
  width: 28px;
  height: 28px;
  border-radius: 8px;
}

.nav {
  display: flex;
  align-items: center;
  gap: 28px;
  font-size: 15px;
  font-weight: 600;
}

.nav a {
  color: var(--muted);
  text-decoration: none;
  transition: color .2s;
}

.nav a:hover {
  color: var(--ink);
}

/* Language menu: a <details>, so it opens without JS; home.js closes it
   on a click outside or Escape. */
.lang-menu {
  position: relative;
}

.lang-menu summary {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  min-width: 40px;
  padding: 5px 8px 5px 12px;
  border-radius: 999px;
  background: var(--panel);
  color: var(--ink);
  font-size: 13px;
  list-style: none;
  cursor: pointer;
  user-select: none;
}

.lang-menu summary::-webkit-details-marker {
  display: none;
}

.lang-menu summary svg {
  width: 12px;
  height: 12px;
  transition: transform .2s var(--ease);
}

.lang-menu[open] summary svg {
  transform: rotate(180deg);
}

.lang-menu ul {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  z-index: 20;
  min-width: 168px;
  margin: 0;
  padding: 6px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--card);
  box-shadow: 0 12px 32px rgba(42, 39, 36, .12);
  list-style: none;
}

.lang-menu a {
  display: block;
  padding: 8px 12px;
  border-radius: 10px;
  color: var(--ink);
  font-weight: 500;
}

.lang-menu a:hover {
  background: var(--panel);
}

.lang-menu a[aria-current] {
  background: var(--panel);
}

/* Quicksand has no Cyrillic or CJK letters; these use the system's own fonts.
   Russian sets its own too, or inside a CJK page it takes full-width
   Cyrillic from the CJK font. */
:lang(ru) {
  --font: "Quicksand", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  font-family: var(--font);
}

:lang(zh) {
  --font: "Quicksand", -apple-system, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans SC", sans-serif;
  font-family: var(--font);
}

:lang(ja) {
  --font: "Quicksand", -apple-system, "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Yu Gothic", Meiryo, "Noto Sans JP", sans-serif;
  font-family: var(--font);
}

:lang(ko) {
  --font: "Quicksand", -apple-system, "Apple SD Gothic Neo", "Malgun Gothic", "Noto Sans KR", sans-serif;
  font-family: var(--font);
  word-break: keep-all;
}

:is(:lang(zh), :lang(ja), :lang(ko)) :is(h1, h2, h3, dt) {
  letter-spacing: 0;
}

/* Japanese headings break only at the <wbr>s in the copy (or where they must). */
:lang(ja) :is(h1, h2) {
  word-break: keep-all;
  overflow-wrap: anywhere;
}

/* ---------- Hero ---------- */

/* The phones sit on the edge of the next section, cut by it. */
.hero {
  padding-top: clamp(40px, 7vw, 88px);
  overflow: hidden;
  text-align: center;
}

.hero h1 {
  max-width: 15ch;
  margin: 0 auto;
  font-size: clamp(40px, 6vw, 72px);
  font-weight: 600;
  line-height: 1.06;
  letter-spacing: -.03em;
  text-wrap: balance;
}

.hero-lead {
  max-width: 34em;
  margin: 22px auto 34px;
  font-size: clamp(17px, 1.6vw, 20px);
  color: var(--muted);
  text-wrap: balance;
}

.hero-phones {
  display: flex;
  justify-content: center;
  align-items: flex-start;
  gap: clamp(16px, 3vw, 36px);
  margin: clamp(48px, 6vw, 72px) 0 -140px;
}

.phone {
  --pw: 280px;
  width: var(--pw);
  flex: none;
  /* The screen inside the bezel keeps the screenshots' own shape (760:1651),
     so nothing is cropped: .944 W wide → .944 W × 1651/760 + .056 W tall. */
  aspect-ratio: 1 / 2.1067;
  padding: calc(var(--pw) * .028);
  border-radius: calc(var(--pw) * .15);
  background: #1c1a18;
  box-shadow: 0 30px 60px -30px rgba(42, 39, 36, .35);
  position: relative;
}

.phone img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: calc(var(--pw) * .125);
}

.phone.side {
  --pw: 240px;
  margin-top: 64px;
}

/* A screen whose pages take turns: the next card comes in from the right,
   the old one leaves to the left. */
.phone-screen {
  position: absolute;
  inset: calc(var(--pw) * .028);
  overflow: hidden;
  border-radius: calc(var(--pw) * .125);
  background: var(--panel);
}

.phone-screen img {
  position: absolute;
  inset: 0;
  border-radius: 0;
  opacity: 0;
  transform: translateX(14%);
  transition: opacity .7s var(--ease), transform .7s var(--ease);
}

.phone-screen img.on {
  opacity: 1;
  transform: none;
}

.phone-screen img.out {
  opacity: 0;
  transform: translateX(-14%);
}

/* The phones rise into place once, the middle one first. */
.hero-phones .phone {
  animation: rise 1s var(--ease) both;
}

.hero-phones .phone.side {
  animation-delay: .18s;
}

.hero-phones .phone.side:last-child {
  animation-delay: .3s;
}

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(56px);
  }
}

/* ---------- Features ---------- */

.features {
  position: relative;
  padding: calc(var(--section) + 40px) 0 var(--section);
  background: var(--panel);
}

.feature-list {
  list-style: none;
  padding: 0;
  margin-top: clamp(40px, 5vw, 64px);
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 64px 40px;
}

.feature {
  text-align: center;
}

.shot {
  width: min(220px, 100%);
  margin: 0 auto 24px;
}

.shot-in {
  transition: transform .4s var(--ease);
}

.shot img {
  width: 100%;
  height: auto;
  border-radius: 28px;
  box-shadow: 0 1px 2px rgba(42, 39, 36, .06), 0 20px 40px -24px rgba(42, 39, 36, .3);
  transition: transform .4s var(--ease), box-shadow .4s var(--ease);
}

@media (hover: hover) {
  .feature:hover .shot > img,
  .feature:hover .shot-in {
    transform: translateY(-6px);
    box-shadow: 0 1px 2px rgba(42, 39, 36, .06), 0 28px 48px -24px rgba(42, 39, 36, .36);
  }
}

/* Features come in one after another as they reach the screen. */
.js .feature {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity .7s var(--ease), transform .7s var(--ease);
  transition-delay: calc(var(--i, 0) * 90ms);
}

.js .feature.in {
  opacity: 1;
  transform: none;
}

.feature h3 {
  font-size: 20px;
  font-weight: 700;
  line-height: 1.25;
  letter-spacing: -.01em;
}

.feature p {
  max-width: 30ch;
  margin: 8px auto 0;
  font-size: 15.5px;
  color: var(--muted);
}

/* ---------- Live play button ----------
   Drawn over the app's own play button on the Eiffel Tower screen; it
   plays the story sample (home.js). */

.shot-in {
  position: relative;
}

.shot-in img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* A live button over the app's own play button (centre 49.9%, 92.4%;
   14.6% of the screen wide), with a pulsing ring and a hint above it. */
.screen-play {
  position: absolute;
  left: 49.93%;
  top: 92.43%;
  width: 14.6%;
  aspect-ratio: 1;
  translate: -50% -50%;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: var(--ink);
  cursor: pointer;
}

.screen-play::before {
  content: "";
  position: absolute;
  left: 38%;
  top: 31%;
  width: 32%;
  height: 38%;
  background: #fff;
  clip-path: polygon(0 0, 100% 50%, 0 100%);
}

.screen-play[aria-pressed="true"]::before {
  left: 33%;
  width: 34%;
  clip-path: none;
  background: linear-gradient(90deg, #fff 0 34%, transparent 34% 66%, #fff 66%);
}

.screen-play::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 50%;
  animation: ring 1.8s ease-out infinite;
}

.screen-play[aria-pressed="true"]::after {
  animation: none;
}

@keyframes ring {
  from {
    box-shadow: 0 0 0 0 rgba(45, 127, 249, .55);
  }

  to {
    box-shadow: 0 0 0 calc(var(--fw, 233px) * .06) rgba(45, 127, 249, 0);
  }
}

.tap-hint {
  position: absolute;
  bottom: calc(100% + var(--fw, 233px) * .045);
  left: 50%;
  translate: -50% 0;
  padding: .45em .9em;
  border-radius: 999px;
  background: var(--brand);
  color: #fff;
  font-size: max(12px, calc(var(--fw, 233px) * .042));
  font-weight: 700;
  white-space: nowrap;
  box-shadow: 0 8px 18px -8px rgba(45, 127, 249, .7);
  animation: bob 1.8s ease-in-out infinite;
  transition: opacity .3s;
}

.tap-hint::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 100%;
  translate: -50% -1px;
  border: 6px solid transparent;
  border-top-color: var(--brand);
}

.screen-play[aria-pressed="true"] .tap-hint {
  opacity: 0;
}

@keyframes bob {
  50% {
    transform: translateY(-4px);
  }
}

/* ---------- Facts ---------- */

.facts {
  padding: var(--section) 0;
}

.fact-list {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 24px;
  text-align: center;
}

.fact-list dt {
  font-size: clamp(44px, 5vw, 64px);
  font-weight: 600;
  line-height: 1;
  letter-spacing: -.03em;
}

.fact-list dd {
  margin-top: 10px;
  color: var(--muted);
}

/* The app's languages, each in its own script. */
.lang-list {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px 28px;
  max-width: 880px;
  margin: 56px auto 0;
  padding: 28px 0 0;
  border-top: 1px solid var(--line);
  list-style: none;
  color: var(--muted);
  font-size: 16px;
}

/* The system fonts for these look heavier at 500. */
:is(.lang-list, .lang-menu) :is(:lang(ru), :lang(zh), :lang(ja), :lang(ko)) {
  font-weight: 400;
}

/* ---------- Plans ---------- */

.plans-section {
  padding: 0 0 var(--section);
}

.plans {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  max-width: 960px;
  margin: 40px auto 0;
}

.plan {
  padding: 28px;
  border-radius: 24px;
  background: var(--card);
  border: 1px solid var(--line);
}

.plan h3 {
  margin-bottom: 18px;
  font-size: 20px;
  font-weight: 700;
}

.plan ul {
  list-style: none;
  padding: 0;
  display: grid;
  gap: 10px;
  font-size: 15.5px;
}

.plan li {
  position: relative;
  padding-left: 26px;
}

.plan li::before {
  content: "";
  position: absolute;
  left: 2px;
  top: .42em;
  width: 11px;
  height: 6px;
  border-left: 2px solid var(--check, var(--check-free));
  border-bottom: 2px solid var(--check, var(--check-free));
  rotate: -45deg;
}

.plan-premium {
  --check: #fff;
  background: var(--sky-day);
  border-color: transparent;
  color: #fff;
}

.plan-plus {
  --check: var(--gold);
  background: var(--sky-night), var(--sky-day);
  border-color: transparent;
  color: #fff;
}

.plans-note {
  margin-top: 20px;
  text-align: center;
  font-size: 14px;
  color: var(--muted);
}

/* ---------- Plans: the growing card ----------
   With JS the section is tall and its stage sticks while one card turns
   from Free into Premium and Premium Plus (home.js sets --in, --out, --k
   and --dark). The three cards stay for screen readers and no-JS. */

.plan-tour {
  display: none;
}

.js .plans-section {
  height: calc(100svh + 180svh);
  padding: 0;
}

.js .plans-section > .wrap {
  position: sticky;
  top: 0;
  height: 100svh;
  height: 100lvh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
}

.js .plans {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.js .plan-tour {
  display: block;
  width: min(100%, 460px);
  margin-top: 28px;
}

.pt-tabs {
  display: flex;
  justify-content: center;
  gap: 22px;
  margin-bottom: 16px;
  font-size: 14px;
  font-weight: 600;
  color: var(--muted);
}

.pt-tabs span {
  padding-bottom: 4px;
  border-bottom: 2px solid transparent;
  transition: color .3s, border-color .3s;
}

.pt-tabs span.on {
  color: var(--ink);
  border-bottom-color: var(--ink);
}

.pt-tabs span:nth-child(2).on {
  border-bottom-color: #9ea3b6;
}

.pt-tabs span:nth-child(3).on {
  border-bottom-color: #3a3650;
}

/* The dusk sky comes in for Premium (--prem), then night falls over it for
   Premium Plus (--dark). */
.pt-card {
  --prem: 0;
  --dark: 0;
  position: relative;
  isolation: isolate;
  padding: 28px;
  border-radius: 24px;
  border: 1px solid color-mix(in srgb, transparent calc(var(--prem) * 100%), var(--line));
  background: var(--card);
  /* Text flips to white the moment the sky is more than half in, so it
     never fades into a half-coloured card. */
  color: color-mix(in srgb, #fff clamp(0%, (var(--prem) - .5) * 100000%, 100%), var(--ink));
  box-shadow: 0 30px 60px -36px rgba(42, 39, 36, .2);
}

.pt-card::before,
.pt-card::after {
  content: "";
  position: absolute;
  inset: -1px;
  z-index: -1;
  border-radius: inherit;
}

.pt-card::before {
  background: var(--sky-day);
  opacity: var(--prem);
}

.pt-card::after {
  background: var(--sky-night);
  opacity: var(--dark);
}

/* A cell holds a text's tiers on top of each other and clips them. */
.cell {
  position: relative;
  display: grid;
  overflow: hidden;
}

/* Only the text on show sets the cell's height; the others lie over it,
   so a long Premium Plus line never leaves a gap under Free. */
.cell > .v:not(.cur) {
  position: absolute;
  inset: 0 0 auto;
}

.cell > .v {
  grid-area: 1 / 1;
  translate: 0 calc((var(--in, 0) - var(--out, 0)) * 100%);
  /* The old text is gone by halfway, the new one only appears after it. */
  opacity: calc(1 - (var(--in, 0) + var(--out, 0)) * 2);
}

.pt-title {
  margin-bottom: 18px;
  font-size: 26px;
  font-weight: 700;
  line-height: 1.2;
}

.pt-rows {
  list-style: none;
  padding: 0;
  font-size: 15.5px;
}

/* New rows open from nothing and rise; lower rows rise a little more. */
.pt-rows li {
  --k: 1;
  display: grid;
  grid-template-columns: 26px minmax(0, 1fr);
  align-items: start;
  max-height: calc(var(--k) * 4.2em);
  padding: calc(var(--k) * 5px) 0;
  overflow: hidden;
  opacity: var(--k);
  translate: 0 calc((1 - var(--k)) * 28px);
}

.pt-rows li:nth-child(n + 6) {
  --lag: 44px;
  translate: 0 calc((1 - var(--k)) * 44px);
}

.pt-rows i {
  position: relative;
  height: 1.4em;
  scale: var(--k);
}

.pt-rows i::before {
  content: "";
  position: absolute;
  left: 2px;
  top: .42em;
  width: 11px;
  height: 6px;
  --c: color-mix(in srgb, #fff calc(var(--prem, 0) * 100%), var(--check-free));
  border-left: 2px solid color-mix(in srgb, var(--gold) calc(var(--dark, 0) * 100%), var(--c));
  border-bottom: 2px solid color-mix(in srgb, var(--gold) calc(var(--dark, 0) * 100%), var(--c));
  rotate: -45deg;
}

.js .plans-note {
  max-width: 460px;
}

/* ---------- Scroll-driven plans ----------
   Where the browser can run animations from the scroll itself, the plan
   card does: it moves in the same frame as the page, even while Safari's
   bar grows or shrinks (the JS version, kept as fallback and for reduced
   motion, stalled for a moment then). Same timing as the JS: each tier
   holds, then eases into the next; spans are 75% of the sticky part. */

@supports (animation-timeline: view()) {
  /* Wide screens only: phones snap to a tier and home.js times the move. */
  @media (prefers-reduced-motion: no-preference) and (min-width: 900px) {
    .js .plans-section {
      view-timeline: --plans block;
    }

    .js .plan-tour .v {
      animation: pt-swap linear both;
      animation-timeline: --plans;
    }

    .js .plan-tour .v[data-t="0"] { animation-range: contain -37.5% contain 37.5%; }
    .js .plan-tour .v[data-t="1"] { animation-range: contain 12.5% contain 87.5%; }
    .js .plan-tour .v[data-t="2"] { animation-range: contain 62.5% contain 137.5%; }

    /* A row's last text stays once it is in. */
    .js .plan-tour .v:last-child { animation-name: pt-in; }
    .js .plan-tour .v:last-child[data-t="0"] { animation-range: contain -37.5% contain -12.5%; }
    .js .plan-tour .v:last-child[data-t="1"] { animation-range: contain 12.5% contain 37.5%; }
    .js .plan-tour .v:last-child[data-t="2"] { animation-range: contain 62.5% contain 87.5%; }

    /* Free is shown from the start, the same way. */
    .js .plan-tour .v[data-t="0"]:not(:last-child) { animation-name: pt-swap-first; }
    .js .plan-tour .v[data-t="0"]:last-child { animation: none; }

    .js .pt-rows li[data-from="1"],
    .js .pt-rows li[data-from="2"] {
      animation: pt-row linear both;
      animation-timeline: --plans;
    }

    .js .pt-rows li[data-from="1"] i,
    .js .pt-rows li[data-from="2"] i {
      animation: pt-check linear both;
      animation-timeline: --plans;
    }

    .js .pt-rows li[data-from="1"],
    .js .pt-rows li[data-from="1"] i { animation-range: contain 12.5% contain 37.5%; }
    .js .pt-rows li[data-from="2"],
    .js .pt-rows li[data-from="2"] i { animation-range: contain 62.5% contain 87.5%; }

    .js .pt-card {
      animation: pt-premium linear both;
      animation-timeline: --plans;
      animation-range: contain 12.5% contain 37.5%;
    }

    .js .pt-card::before,
    .js .pt-card::after {
      animation: pt-sky linear both;
      animation-timeline: --plans;
      animation-range: contain 12.5% contain 37.5%;
    }

    .js .pt-card::after {
      animation-range: contain 62.5% contain 87.5%;
    }

    /* The Plus change only takes over once it starts, so the Premium one
       shows before it. */
    .js .pt-rows i::before {
      animation: pt-check-premium linear both, pt-check-plus linear forwards;
      animation-timeline: --plans, --plans;
      animation-range: contain 12.5% contain 37.5%, contain 62.5% contain 87.5%;
    }
  }
}

@keyframes pt-swap-first {
  0%, 66.667% { opacity: 1; translate: 0 0; animation-timing-function: ease-in-out; }
  83.333% { opacity: 0; }
  100% { opacity: 0; translate: 0 -100%; }
}

@keyframes pt-swap {
  0% { opacity: 0; translate: 0 100%; animation-timing-function: ease-in-out; }
  16.667% { opacity: 0; }
  33.333% { opacity: 1; translate: 0 0; }
  66.667% { opacity: 1; translate: 0 0; animation-timing-function: ease-in-out; }
  83.333% { opacity: 0; }
  100% { opacity: 0; translate: 0 -100%; }
}

@keyframes pt-in {
  0% { opacity: 0; translate: 0 100%; animation-timing-function: ease-in-out; }
  50% { opacity: 0; }
  100% { opacity: 1; translate: 0 0; }
}

@keyframes pt-row {
  from {
    max-height: 0;
    padding-block: 0;
    opacity: 0;
    translate: 0 var(--lag, 28px);
    animation-timing-function: ease-in-out;
  }

  to {
    max-height: 4.2em;
    padding-block: 5px;
    opacity: 1;
    translate: 0 0;
  }
}

@keyframes pt-check {
  from { scale: 0; animation-timing-function: ease-in-out; }
  to { scale: 1; }
}

/* The sky comes in; the text flips to white halfway, never grey. */
@keyframes pt-premium {
  0% { border-color: var(--line); color: var(--ink); }
  50% { color: var(--ink); }
  50.01% { color: #fff; }
  100% { border-color: transparent; color: #fff; }
}

@keyframes pt-sky {
  from { opacity: 0; animation-timing-function: ease-in-out; }
  to { opacity: 1; }
}

@keyframes pt-check-premium {
  from { border-color: var(--check-free); }
  to { border-color: #fff; }
}

@keyframes pt-check-plus {
  from { border-color: #fff; }
  to { border-color: var(--gold); }
}

/* ---------- FAQ ---------- */

.narrow {
  max-width: 760px;
}

.faq-section {
  padding: var(--section) 0;
  border-top: 1px solid var(--line);
}

.faq-list {
  margin-top: 36px;
}

.faq-item {
  border-bottom: 1px solid var(--line);
}

.faq-item summary {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
  padding: 20px 0;
  cursor: pointer;
  list-style: none;
  font-size: 17px;
  font-weight: 600;
}

.faq-item summary::-webkit-details-marker {
  display: none;
}

.faq-item summary::after {
  content: "+";
  flex: none;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--panel);
  display: grid;
  place-items: center;
  font-size: 18px;
  line-height: 1;
  transition: rotate .2s;
}

.faq-item[open] summary::after {
  rotate: 45deg;
}

.faq-item p {
  padding: 0 0 22px;
  color: var(--muted);
}

/* ---------- Closing ---------- */

.closing {
  padding: var(--section) 0;
  background: var(--panel);
  text-align: center;
}

.closing .btn {
  margin-top: 32px;
}

/* ---------- Footer ---------- */

.foot {
  padding: 32px 0 40px;
  font-size: 14px;
  color: var(--muted);
}

.foot-grid {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 12px 32px;
}

.foot nav {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 24px;
}

.foot a {
  text-decoration: none;
}

.foot a:hover {
  color: var(--ink);
}

/* ---------- Parallax ----------
   home.js writes --p on each [data-parallax] section: the hero runs 0 → 1
   as it scrolls away, other sections .5 in the middle of the screen. Uses
   `translate`, so it adds to the rise, reveal and hover transforms. */

.hero {
  --amp: 1;
}

.hero-copy {
  translate: 0 calc(var(--p, 0) * 90px * var(--amp));
  opacity: calc(1 - var(--p, 0) * .6 * var(--amp));
}

.hero-phones .phone {
  translate: 0 calc(var(--p, 0) * -40px * var(--amp));
}

.hero-phones .phone:not(.side) {
  translate: 0 calc(var(--p, 0) * -110px * var(--amp));
}

/* Where the browser can drive animations from scrolling itself, the hero
   uses that: it moves in the same frame as the scroll, so the copy and its
   button fade without lagging a frame behind (home.js then leaves the hero
   alone). Same motion as above, over the first 100svh of scrolling. */
@supports (animation-timeline: scroll()) {
  .hero-copy {
    translate: none;
    opacity: 1;
    animation: hero-copy-away linear both;
    animation-timeline: scroll(root);
    animation-range: 0 100svh;
    will-change: translate, opacity;
  }

  .hero-phones .phone {
    translate: none;
    animation: rise 1s var(--ease) both, hero-phone-away linear both;
    animation-timeline: auto, scroll(root);
    animation-range: normal, 0 100svh;
  }

  .hero-phones .phone:not(.side) {
    translate: none;
    animation-name: rise, hero-phone-away-fast;
  }
}

@keyframes hero-copy-away {
  to {
    translate: 0 calc(90px * var(--amp));
    opacity: calc(1 - .6 * var(--amp));
  }
}

@keyframes hero-phone-away {
  to {
    translate: 0 calc(-40px * var(--amp));
  }
}

@keyframes hero-phone-away-fast {
  to {
    translate: 0 calc(-110px * var(--amp));
  }
}

.features {
  --amp: 1;
}

.shot {
  translate: 0 calc((var(--p, .5) - .5) * var(--drift, 0px) * var(--amp));
}

.feature:nth-child(3n + 1 of :not(.feature-intro)) .shot {
  --drift: 60px;
}

.feature:nth-child(3n + 2 of :not(.feature-intro)) .shot {
  --drift: -40px;
}

.feature:nth-child(3n of :not(.feature-intro)) .shot {
  --drift: 90px;
}

/* ---------- Narrow screens ---------- */

@media (max-width: 899px) {
  :root {
    --gutter: 20px;
  }

  .nav .hide-sm {
    display: none;
  }

  .nav {
    gap: 16px;
  }

  .hero-phones {
    margin-bottom: -110px;
  }

  .phone {
    --pw: min(230px, 54vw);
  }

  .phone.side {
    --pw: min(190px, 44vw);
    margin-top: 48px;
  }

  /* Screens stay level beside their text. */
  .features {
    --amp: 0;
  }

  .hero {
    --amp: .6;
  }

  /* Features: one per row, a small screen beside its words. */
  .feature-list {
    grid-template-columns: 1fr;
    gap: 28px;
    max-width: 560px;
    margin-left: auto;
    margin-right: auto;
  }

  .feature {
    display: grid;
    grid-template-columns: clamp(104px, 30vw, 150px) minmax(0, 1fr);
    /* Words sit centred on the screen beside them. */
    grid-template-rows: 1fr auto auto auto 1fr;
    column-gap: 20px;
    align-items: start;
    text-align: left;
  }

  .shot {
    grid-row: 1 / -1;
    width: 100%;
    margin: 0;
  }

  .shot img {
    border-radius: 18px;
  }

  .feature h3 {
    grid-row: 2;
    font-size: 18px;
  }

  .feature p {
    grid-row: 3;
    max-width: none;
    margin: 6px 0 0;
    font-size: 15px;
  }

  .fact-list {
    grid-template-columns: 1fr;
    gap: 32px;
  }

  .plans {
    grid-template-columns: 1fr;
    max-width: 440px;
  }
}

/* ---------- Phones: the scrolling tour ----------
   With JS, the features become one phone that stays on screen while the
   section scrolls past. home.js gives every feature --in (0 → 1: still
   below, sliding up) and --out (0 → 1: covered, drifting up slower), so
   each new screen slides over the last one and its words move at their
   own speed. Without JS the row list above stays. */

.feature-intro,
.tour-dots,
.tour-sides {
  display: none;
}

.tour-dots span {
  width: 6px;
  height: 6px;
  border-radius: 3px;
  background: var(--line);
  transition: width .3s var(--ease), background-color .3s;
}

.tour-dots span.on {
  width: 18px;
  background: var(--ink);
}

/* Snap points home.js puts in the tour and the plans: one per step, and one
   at each end to leave by. The page only snaps (is-snapping) while one of
   those sections is on screen. */
.snap {
  display: none;
}

@media (max-width: 899px) {
  .js .hero-phones {
    display: none;
  }

  html.is-snapping {
    scroll-snap-type: y mandatory;
  }

  .js .features,
  .js .plans-section {
    position: relative;
  }

  .js .snap {
    position: absolute;
    left: 0;
    display: block;
    width: 1px;
    height: 1px;
    pointer-events: none;
    scroll-snap-align: start;
    scroll-snap-stop: always;
  }

  /* Leaving: the section's top at the bottom of the screen, or its end at
     the top. */
  .js .snap-in {
    top: 0;
    scroll-snap-align: end;
  }

  .js .snap-out {
    top: 100%;
  }

  .js .hero {
    padding-bottom: 8px;
  }

  .js .features {
    --n: 7;
    height: calc(100svh + (var(--n) - 1) * 70svh);
    padding: 0;
    background: var(--bg);
  }

  /* The stage is sized for the screen with Safari's bars hidden (100lvh),
     as they are while you scroll down. It never resizes mid-scroll (100dvh
     did when the bars went away, and the phone stuttered as it grew). The
     phone takes the height the words leave; phone, words and dots sit
     centred as one group. */
  .js .features > .wrap {
    /* Room under the phone for the words and the dots. */
    --below: 190px;
    /* Phone height and width (bezel included; inner screen 760:1651): as
       tall as the screen allows after the words, capped by the width. */
    --fh: min(100lvh - var(--below) - 40px, 78vw * 2.1067);
    --fw: calc(var(--fh) / 2.1067);
    --top: max(16px, (100lvh - var(--fh) - var(--below)) / 2);
    position: sticky;
    top: 0;
    height: 100svh;
    height: 100lvh;
  }

  .js .features .h2 {
    display: none;
  }

  .js .feature-list {
    position: relative;
    display: block;
    max-width: none;
    height: 100%;
    margin: 0;
  }

  .js .feature-list::before {
    content: "";
    position: absolute;
    top: var(--top);
    left: 50%;
    width: var(--fw);
    height: var(--fh);
    translate: -50% 0;
    border-radius: calc(var(--fw) * .15);
    background: #1c1a18;
    box-shadow: 0 30px 60px -30px rgba(42, 39, 36, .4);
  }

  .js .feature,
  .js .feature.in {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding-top: calc(var(--top) + var(--fh) + 22px);
    text-align: center;
    opacity: 1;
    transform: none;
    transition: none;
    pointer-events: none;
  }

  .js .feature.is-active {
    pointer-events: auto;
  }

  .js .shot {
    position: absolute;
    top: calc(var(--top) + var(--fw) * .028);
    left: 50%;
    width: calc(var(--fw) * .944);
    height: calc(var(--fh) - var(--fw) * .056);
    margin: 0;
    translate: -50% 0;
    overflow: hidden;
    border-radius: calc(var(--fw) * .125);
  }

  /* Each step is "next" (below, hidden), "on" or "past" (covered).
     home.js sets data-state from the scroll, one step at a time; the moves
     themselves are timed transitions, so a fast scroll never flicks
     through screens and nothing waits on the scroll to draw. */
  .js .shot > img,
  .js .shot > .shot-in {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 0;
    box-shadow: none;
    transform: none;
    translate: 0 100%;
    transition: translate .6s cubic-bezier(.45, 0, .2, 1);
    will-change: translate;
  }

  .js [data-state="on"] .shot > img,
  .js [data-state="on"] .shot > .shot-in {
    translate: 0 0;
  }

  .js [data-state="past"] .shot > img,
  .js [data-state="past"] .shot > .shot-in {
    translate: 0 -28%;
  }

  /* A covered screen dims under a dark layer (a GPU fade, not a filter). */
  .js .shot::after {
    content: "";
    position: absolute;
    inset: 0;
    background: #000;
    opacity: 0;
    transition: opacity .6s ease;
    pointer-events: none;
    will-change: opacity;
  }

  .js [data-state="past"] .shot::after {
    opacity: .45;
  }

  /* Words leave quickly and arrive once the screen is mostly in, the text
     travelling a little further than its heading. */
  .js .feature > :not(.shot) {
    --d: 48px;
    opacity: 0;
    translate: 0 var(--d);
    transition: opacity .25s ease, translate .25s ease;
    will-change: translate, opacity;
  }

  .js .feature > p {
    --d: 76px;
  }

  .js [data-state="past"] > :not(.shot) {
    translate: 0 calc(var(--d) * -1);
  }

  .js [data-state="on"] > :not(.shot) {
    opacity: 1;
    translate: 0 0;
    transition: opacity .4s ease .3s, translate .5s cubic-bezier(.2, .7, .2, 1) .25s;
  }

  /* Placing the steps on load (or after a jump) without playing a move. */
  .js .is-placing .feature *,
  .js .is-placing .feature *::after {
    transition: none !important;
  }

  .js .feature h3,
  .js .feature .tour-title {
    margin: 0;
    color: var(--ink);
    font-size: 20px;
    font-weight: 700;
    line-height: 1.25;
  }

  .js .feature p:not(.tour-title) {
    max-width: 30ch;
    margin: 6px auto 0;
    font-size: 15px;
  }

  .js .feature-intro {
    display: flex;
  }

  /* The steps go down the page, so the dots do too: a column beside the
     phone, the current one long, and an arrow under them until the last. */
  .js .tour-dots {
    position: absolute;
    top: calc(var(--top) + var(--fh) / 2);
    left: calc(50% + var(--fw) / 2 + min(16px, (100vw - var(--fw)) / 4 - 3px));
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    translate: 0 -50%;
  }

  .js .tour-dots span {
    transition: height .3s var(--ease), background-color .3s;
  }

  .js .tour-dots span.on {
    width: 6px;
    height: 18px;
  }

  .js .tour-dots::after {
    content: "";
    width: 6px;
    height: 6px;
    margin-top: 6px;
    border-right: 1.5px solid var(--ink);
    border-bottom: 1.5px solid var(--ink);
    rotate: 45deg;
    opacity: .5;
    transition: opacity .3s;
  }

  .js .tour-dots:has(span:last-child.on)::after {
    opacity: 0;
  }
}

/* ---------- Wide screens: the phone that stays ----------
   With JS the hero's phones move into the features stage: the middle one
   stays while the section scrolls past and its screens run by like a strip
   (home.js sets --t on every step, eased after the scroll), each feature's
   words come in beside it, from the right, then the left (--o), and the
   side phones step aside as the tour starts (--k). */

@media (min-width: 900px) {
  .js .hero-phones {
    display: none;
  }

  .js .features {
    --n: 7;
    /* Phone height and width, bezel included (inner screen 760:1651). */
    --fh: min(100lvh - 112px, 640px);
    --fw: calc(var(--fh) / 2.1067);
    --top: calc((100lvh - var(--fh)) / 2);
    --gap: clamp(40px, 5vw, 80px);
    height: calc(100lvh + (var(--n) - 1) * 80lvh);
    /* Before the stage sticks, the phone sits under the hero's button,
       where the hero's own phones were. */
    margin-top: calc(64px - var(--top));
    padding: 0;
    /* It lies over the hero's foot: no ground of its own, or it would
       cover the button. Nor may it catch the button's clicks: only the
       active screen's play button takes them (.is-active .shot below). */
    background: none;
    pointer-events: none;
  }

  .js .features > .wrap {
    position: sticky;
    top: 0;
    height: 100svh;
    height: 100lvh;
  }

  .js .features .h2 {
    display: none;
  }

  .js .tour-sides {
    display: block;
    position: absolute;
    inset: 0;
    pointer-events: none;
  }

  .js .tour-sides .phone {
    --pw: calc(var(--fw) * .857);
    position: absolute;
    top: calc(var(--top) + var(--fh) * .11);
    margin: 0;
    opacity: calc(1 - var(--k, 0));
    animation: rise 1s var(--ease) .18s both;
  }

  .js .tour-sides .phone:first-child {
    right: calc(50% + var(--fw) / 2 + 36px);
    translate: calc(var(--k, 0) * -140px) 0;
  }

  .js .tour-sides .phone:last-child {
    left: calc(50% + var(--fw) / 2 + 36px);
    translate: calc(var(--k, 0) * 140px) 0;
    animation-delay: .3s;
  }

  .js .feature-list {
    position: relative;
    display: block;
    height: 100%;
    margin: 0;
    animation: rise 1s var(--ease) both;
  }

  .js .feature-list::before {
    content: "";
    position: absolute;
    top: var(--top);
    left: 50%;
    width: var(--fw);
    height: var(--fh);
    translate: -50% 0;
    border-radius: calc(var(--fw) * .15);
    background: #1c1a18;
    box-shadow: 0 30px 60px -30px rgba(42, 39, 36, .4);
  }

  /* Each step fills the stage; its words sit beside the phone, on the
     right for the first feature, then on the left, and so on. */
  .js .feature,
  .js .feature.in {
    --side: 1;
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: flex-start;
    padding: 0 0 0 calc(50% + var(--fw) / 2 + var(--gap));
    text-align: left;
    opacity: 1;
    transform: none;
    transition: none;
    pointer-events: none;
  }

  .js .feature:nth-child(odd) {
    --side: -1;
    align-items: flex-end;
    padding: 0 calc(50% + var(--fw) / 2 + var(--gap)) 0 0;
    text-align: right;
  }

  .js .feature-intro {
    display: flex;
  }

  .js .feature-intro > :not(.shot) {
    visibility: hidden;
  }

  .js .feature.is-active .shot {
    pointer-events: auto;
  }

  .js [data-tour] .shot {
    position: absolute;
    top: calc(var(--top) + var(--fw) * .028);
    left: 50%;
    width: calc(var(--fw) * .944);
    height: calc(var(--fh) - var(--fw) * .056);
    margin: 0;
    translate: -50% 0;
    overflow: hidden;
    border-radius: calc(var(--fw) * .125);
  }

  /* The strip: the next screen waits just below, the last just above. */
  .js [data-tour] .feature .shot > img,
  .js [data-tour] .feature .shot > .shot-in {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 0;
    box-shadow: none;
    transform: none;
    translate: 0 calc(var(--t, 1) * 100%);
    will-change: translate;
  }

  /* Words come in from their side and leave upwards; the line under the
     heading travels further, so the two part a little on the way. */
  .js .feature > :not(.shot) {
    --d: 140px;
    opacity: var(--o, 0);
    translate: calc(max(var(--t, 1), 0) * var(--side) * var(--d)) calc(min(var(--t, 1), 0) * 70px);
    will-change: translate, opacity;
  }

  .js .feature > p {
    --d: 220px;
  }

  .js .feature h3 {
    max-width: 12ch;
    font-size: clamp(30px, 3.4vw, 44px);
    font-weight: 600;
    line-height: 1.1;
    letter-spacing: -.02em;
    text-wrap: balance;
  }

  .js .feature p:not(.tour-title) {
    max-width: 24ch;
    margin: 16px 0 0;
    font-size: 19px;
  }

  .js .tour-dots {
    position: absolute;
    left: 0;
    right: 0;
    top: calc(var(--top) + var(--fh) + 22px);
    display: flex;
    justify-content: center;
    gap: 6px;
  }
}

@media (max-width: 560px) {
  .phone.side {
    display: none;
  }


  .phone {
    --pw: min(250px, 66vw);
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  .btn,
  .nav a,
  .faq-item summary::after,
  .shot img,
  .phone-screen img {
    transition: none;
  }

  .hero-phones .phone,
  .hero-copy {
    animation: none !important;
  }

  .js .feature {
    opacity: 1;
    transform: none;
    transition: none;
  }

  .pt-tabs span {
    transition: none;
  }

  .screen-play::after,
  .tap-hint {
    animation: none;
  }

  .js [data-tour] .feature *,
  .js [data-tour] .feature *::after {
    transition: none !important;
  }

  .screen-play::after {
    box-shadow: 0 0 0 3px rgba(45, 127, 249, .45);
  }

  .hero,
  .features {
    --amp: 0 !important;
  }
}
