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

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

body {
  margin: 0;
  background: var(--page);
  color: var(--ink);
  font-family: ui-rounded, "SF Pro Rounded", system-ui, -apple-system, "Segoe UI", sans-serif;
  line-height: 1.45;
  overflow-x: clip;
}

a { color: inherit; }

:focus-visible { outline: 3px solid var(--ink); outline-offset: 2px; }

/* The app's drifting rounded stars. Each loop moves by exactly one tile, so
   the end lines up with the start. Durations keep the speed the same. */
.backdrop {
  --tile: 420px;
  --loop: 26s;
  position: fixed;
  top: calc(-1 * var(--tile));
  left: calc(-1 * var(--tile));
  width: calc(100vw + var(--tile));
  height: calc(100lvh + var(--tile));
  z-index: -1;
  background: url(/assets/stars-light.svg) 0 0 / var(--tile) var(--tile);
  will-change: transform;
  animation: drift var(--loop) linear infinite;
}
@keyframes drift { to { transform: translate3d(var(--tile), var(--tile), 0); } }
@media (min-width: 900px) { .backdrop { --tile: 600px; --loop: 37.5s; } }
@media (prefers-color-scheme: dark) { .backdrop { background-image: url(/assets/stars-dark.svg); } }

/* The app's logo: its letter tiles, each tilted and overlapping the last,
   with every measurement a proportion of the tile size. */
.logo {
  --s: min(calc((100vw - 32px) / 8.04), 42px);
  display: inline-flex;
  padding-block: calc(var(--s) * 0.125);
  font-size: calc(var(--s) / 2);
  font-weight: 900;
  line-height: 1;
  cursor: pointer;
}
.logo i {
  --face: var(--teal-face);
  --edge: var(--teal-border);
  --shine: var(--teal-highlight);
  --label: var(--teal-label);
  position: relative;
  display: grid;
  place-items: center;
  width: var(--s);
  height: var(--s);
  margin-left: calc(var(--s) * -0.12);
  border: calc(var(--s) / 18) solid var(--edge);
  border-radius: calc(var(--s) / 4);
  background: var(--face);
  color: var(--label);
  box-shadow: 0 calc(var(--s) / 16) 0 var(--edge);
  font-style: normal;
  transform-origin: bottom;
  transition: background-color 0.15s ease-in-out, border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
  text-shadow: 0 calc(var(--s) / 24) 0 color-mix(in srgb, var(--edge) 50%, transparent);
}
.logo i:first-child { margin-left: 0; }
.logo i:nth-child(n + 7) {
  --face: var(--orange-face);
  --edge: var(--orange-border);
  --shine: var(--orange-highlight);
  --label: var(--orange-label);
}
.logo i::after {
  content: "";
  position: absolute;
  top: calc(var(--s) / 16);
  right: calc(var(--s) / 16);
  width: calc(var(--s) / 8);
  height: calc(var(--s) / 8);
  border-radius: 50%;
  background: var(--shine);
}
.logo i:nth-child(1) { rotate: 8deg; }
.logo i:nth-child(2) { rotate: -2deg; }
.logo i:nth-child(3) { rotate: 1deg; }
.logo i:nth-child(4) { rotate: 8deg; }
.logo i:nth-child(5) { rotate: -2deg; }
.logo i:nth-child(6) { rotate: 1.5deg; }
.logo i:nth-child(7) { rotate: -8deg; }
.logo i:nth-child(8) { rotate: 1deg; }
.logo i:nth-child(9) { rotate: 4.5deg; }

/* Homepage, phone-first */
.hero {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 28px;
  padding: max(28px, env(safe-area-inset-top)) 0 24px;
}

.intro { padding-inline: 16px; text-align: center; max-width: 460px; }
h1 { margin: 0; }
.headline { margin: 18px 0 6px; font-size: clamp(1.75rem, 7.5vw, 2.5rem); font-weight: 800; line-height: 1.1; letter-spacing: -0.01em; }
.lede { margin: 0 0 20px; font-size: 1.125rem; font-weight: 500; }

.store-badge { display: inline-block; line-height: 0; }
/* Apple asks for at least 40px high and a quarter of the height as clear space. */
.store-badge img { width: auto; height: 48px; }

.availability { margin: 18px 0 2px; font-weight: 700; }
.trust { margin: 0; font-size: 0.9375rem; color: var(--ink); font-weight: 600; }

.phone {
  position: relative;
  width: min(70vw, 300px);
  aspect-ratio: 1350 / 2760;
  flex: none;
  /* Vertical scrolling still works; sideways swipes go to the script. */
  touch-action: pan-y;
}
.phone-bezel { position: absolute; inset: 0; width: 100%; height: 100%; z-index: 1; pointer-events: none; }
/* Apple's frame has a 1206x2622 opening at (72, 69). */
.phone-screen {
  position: absolute;
  left: 5.333%;
  top: 2.5%;
  width: 89.333%;
  height: 95%;
  overflow: hidden;
  border-radius: 14.1% / 6.48%;
  background: var(--video-bg);
}

.screen {
  position: absolute;
  inset: 0;
  background: var(--video-bg);
  opacity: 0;
  transition: opacity 0.3s ease;
}
.screen.is-active { opacity: 1; }
.screen video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }

/* Mobile: a swipeable row of cards under the phone. Positioned so the script
   can centre a card in it. */
.features {
  position: relative;
  display: flex;
  gap: 12px;
  width: 100%;
  margin: 0;
  --card: min(86vw, 350px);
  padding: 4px calc(50% - var(--card) / 2) 10px;
  list-style: none;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
}
.features::-webkit-scrollbar { display: none; }
.features li { flex: 0 0 var(--card); scroll-snap-align: center; display: flex; }

.feature {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  width: 100%;
  padding: 14px;
  border: 0;
  border-radius: 18px;
  background: rgb(255 255 255 / 0.5);
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
  transition: background-color 0.2s ease;
}
.feature[aria-pressed="true"] { background: #fff; color: #111525; }

/* The app's chunky tile at 44pt: border and drop in the edge colour, a shine
   dot in the top-right corner, and the icon's own hard shadow. */
.tile {
  position: relative;
  flex: none;
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  margin-bottom: 3px;
  border: 2.5px solid var(--edge);
  border-radius: 11px;
  background: var(--face);
  color: var(--label);
  box-shadow: 0 3px 0 var(--edge);
}
.tile::after {
  content: "";
  position: absolute;
  top: 2.5px;
  right: 2.5px;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--shine);
}
.icon {
  width: 24px;
  height: 24px;
  filter: drop-shadow(0 2px 0 color-mix(in srgb, var(--edge) 50%, transparent));
}
.feature strong { display: block; font-size: 1.0625rem; font-weight: 800; line-height: 1.2; }
.feature small { display: block; margin-top: 3px; font-size: 0.9375rem; line-height: 1.3; opacity: 0.8; }

.closing { padding-inline: 16px; }

.site-footer { padding: 20px 16px max(28px, env(safe-area-inset-bottom)); text-align: center; font-size: 0.9375rem; }
.site-footer nav { display: flex; justify-content: center; gap: 22px; font-weight: 700; }
.site-footer nav a { padding: 8px 2px; }
.site-footer p { margin: 8px 0 0; }

/* Desktop: the pitch, then the phone in the centre, then the features. */
@media (min-width: 900px) {
  .hero {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
    grid-template-areas: "intro phone features";
    align-items: center;
    gap: clamp(28px, 4vw, 64px);
    max-width: 1320px;
    min-height: calc(100svh - 110px);
    margin-inline: auto;
    padding: 32px clamp(24px, 3vw, 48px) 16px;
  }
  .intro { grid-area: intro; text-align: left; padding: 0; }
  .phone { grid-area: phone; width: auto; height: min(82svh, 780px); }

  .features { grid-area: features; flex-direction: column; padding: 0; overflow: visible; }
  .features li { flex: none; }
  .feature { align-items: center; }

  .closing { display: none; }
  .headline { font-size: clamp(2rem, 3.2vw, 2.75rem); }
}

/* Legal and contact pages */
.contact-form { display: grid; gap: 16px; margin-top: 20px; }
.contact-form label { display: grid; gap: 6px; font-weight: 700; }
.contact-form input, .contact-form select, .contact-form textarea {
  width: 100%;
  padding: 12px 14px;
  border: 2px solid var(--panel-border);
  border-radius: 12px;
  background: transparent;
  color: inherit;
  font: inherit;
  font-weight: 400;
}
.contact-form textarea { min-height: 150px; resize: vertical; }
.contact-form .trap { position: absolute; left: -9999px; }
.contact-form button {
  justify-self: start;
  padding: 14px 26px;
  border: 3px solid var(--button-border);
  border-radius: 16px;
  background: var(--button-face);
  color: var(--button-label);
  box-shadow: 0 4px 0 var(--button-border);
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}
.contact-form button:disabled { opacity: 0.6; }
.form-status { margin: 0; font-weight: 700; }

.page-header { padding: 28px 16px 20px; text-align: center; }
.page-header .logo { --s: 32px; }
.page-header a { text-decoration: none; }

.document {
  max-width: 720px;
  margin: 0 auto;
  padding: clamp(20px, 5vw, 44px);
  background: var(--panel);
  border-radius: 22px;
}
@media (max-width: 760px) { .document { margin-inline: 12px; } }
.document h1 { font-size: 2rem; line-height: 1.15; font-weight: 800; }
.document h2 { margin: 1.6em 0 0.3em; font-size: 1.25rem; font-weight: 800; }
.document .updated { margin-top: 8px; color: var(--ink-secondary); }
.document ul { padding-left: 1.2em; }
.document li { margin-bottom: 0.35em; }

/* Invite page, /f/<code> */
.invite [hidden] { display: none; }
.invite { max-width: 520px; margin-inline: 16px; text-align: center; }
@media (min-width: 552px) { .invite { margin-inline: auto; } }
.invite h1 { margin-bottom: 10px; }
.invite-code { text-align: center; margin: 20px 0 0; padding: 14px 16px; border: 2px dashed var(--panel-border); border-radius: 16px; }
.invite-steps .invite-label { margin: 0 0 4px; font-size: 0.9375rem; font-weight: 600; color: var(--ink-secondary); }
.invite-steps .invite-value { margin: 0; font-size: 1.75rem; font-weight: 900; letter-spacing: 0.08em; }
.invite-copy {
  padding: 4px 8px;
  border: 0;
  background: none;
  color: inherit;
  font: inherit;
  font-size: 0.9375rem;
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
}
.invite-open {
  display: inline-block;
  padding: 12px 24px;
  border: 3px solid var(--button-border);
  border-radius: 16px;
  background: var(--button-face);
  color: var(--button-label);
  box-shadow: 0 4px 0 var(--button-border);
  font: inherit;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
}
.invite-steps { margin: 0; padding: 0; list-style: none; counter-reset: step; display: grid; gap: 14px; }
/* Each step a box one shade darker than the panel, no outline. */
.invite-steps li {
  --step: color-mix(in srgb, var(--panel), black 6%);
  counter-increment: step;
  display: grid;
  grid-template-columns: auto 1fr;
  column-gap: 12px;
  align-items: center;
  padding: 18px 16px 20px;
  border-radius: 18px;
  background: var(--step);
  text-align: left;
}
/* The number and the step's title share the first row; the rest go below. */
.invite-steps li > * { grid-column: 1 / -1; justify-self: start; }
.invite-steps li > p:first-child { grid-column: 2; margin: 0; }
.invite-steps li > :nth-child(n + 2) { margin-top: 14px; }
.invite-steps .invite-code { justify-self: stretch; }
.invite-steps .store-badge, .invite-steps .invite-open { justify-self: center; }
.invite-code-row { display: flex; align-items: center; justify-content: center; gap: 12px; }
.invite-code-row .invite-copy { flex: none; white-space: nowrap; padding-inline: 4px 0; }
@media (prefers-color-scheme: dark) { .invite-steps li { --step: color-mix(in srgb, var(--panel), black 22%); } }
.invite-steps li::before {
  content: counter(step);
  display: inline-grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 10px;
  background: var(--teal-face);
  color: var(--teal-label);
  font-weight: 900;
}
.invite-steps li > p { margin-bottom: 0; }
.invite-fallback { color: var(--ink-secondary); font-size: 0.9375rem; }

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; }
  .backdrop { animation: none; }
}
