/* budgetloop.io
 *
 * Few words, large pictures: one headline and one line per block, and the app's own
 * screens for the rest. Colours and type are the app's. Pictures sit on soft washes of
 * the app's green and of its paper, and each block fades in as it is reached.
 * The @font-face rule is written into each page by build.mjs (its URL is fingerprinted).
 */

:root {
  /* The app's paper theme (apps/ios/BudgetLoop/Theme.swift). */
  --paper: #f5f2ec;
  --ink: #1e1a15;
  --ink-2: #5f584e;
  --rule: #e2dcd0;
  /* The green of the app icon. */
  --green: #0f8c63;
  --green-deep: #0b7556;
  --night: #16120b;
  /* The app's own colours for money in and money owed. */
  --gain: #2c7652;
  --debt: #c2412a;
  /* Soft washes behind the pictures: the icon's green and the paper, thinned out. */
  --wash-mint: linear-gradient(145deg, #d5ecdf 0%, #e5f1e6 52%, #f1f0e6 100%);
  --wash-sand: linear-gradient(145deg, #f0e2cb 0%, #f4ead8 52%, #f6f0e4 100%);

  --gutter: 20px;
  /* A screenshot is 1320 × 2868; the bezel is 3% of the phone's width on each side. */
  --screen-ratio: 2.1727;
  --ease: cubic-bezier(0.2, 0.7, 0.2, 1);
}

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

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-behavior: smooth;
  /* The flash under a finger on a phone: the page's green, not the browser's grey. */
  -webkit-tap-highlight-color: rgba(15, 140, 99, 0.16);
}

body {
  margin: 0;
  overflow-x: clip;
  background: var(--paper);
  color: var(--ink);
  /* Manrope carries Latin and figures; Chinese falls to the system face, as in the app. */
  font-family: "Manrope", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans SC", system-ui, sans-serif;
  font-size: 1.0625rem;
  font-weight: 500;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

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

ul,
ol {
  padding: 0;
  list-style: none;
}

img,
svg,
video {
  display: block;
  max-width: 100%;
  height: auto;
}

a {
  color: inherit;
}

/* A tap counts at once, without the wait for a possible double-tap. */
a,
button,
label,
input {
  touch-action: manipulation;
}

:focus-visible {
  outline: 3px solid var(--green);
  outline-offset: 3px;
  border-radius: 6px;
}

.wrap {
  width: min(100% - 2 * var(--gutter), 70rem);
  margin-inline: auto;
}

.skip {
  position: absolute;
  left: var(--gutter);
  top: -100px;
  z-index: 10;
  padding: 10px 16px;
  border-radius: 10px;
  background: var(--ink);
  color: #fff;
  font-weight: 700;
}

.skip:focus {
  top: 12px;
}

/* ---------- Buttons and links ---------- */

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 54px;
  padding: 0 28px;
  border-radius: 999px;
  background: var(--green-deep);
  color: #fff;
  font-size: 1.0625rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  text-decoration: none;
}

.button:hover {
  background: #085c44;
}

.button--small {
  min-height: 40px;
  padding: 0 18px;
  font-size: 0.9375rem;
}

.button--light {
  background: #fff;
  color: var(--ink);
}

.button--light:hover {
  background: #e3f6ec;
}

.link {
  font-weight: 700;
  text-decoration: underline;
  text-decoration-color: var(--green);
  text-decoration-thickness: 2px;
  text-underline-offset: 6px;
}

.link:hover {
  text-decoration-color: currentColor;
}

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

.top__in {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding-block: 18px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
}

.brand__icon {
  width: 32px;
  height: 32px;
}

.brand__name {
  font-size: 1.25rem;
  font-weight: 800;
  letter-spacing: -0.03em;
}

.brand--small .brand__icon {
  width: 24px;
  height: 24px;
}

.brand--small .brand__name {
  font-size: 1.0625rem;
}

.top__links {
  display: flex;
  align-items: center;
  gap: 20px;
  white-space: nowrap;
}

/* On a phone the same button is the first thing in the hero, just below. */
.top__links .button {
  display: none;
}

.top__lang {
  padding: 8px 2px;
  font-size: 0.9375rem;
  font-weight: 700;
  text-decoration: none;
}

.top__lang:hover {
  text-decoration: underline;
  text-underline-offset: 5px;
}

/* ---------- The phone ---------- */

.phone {
  position: relative;
  flex: none;
  width: var(--phone-w);
  padding: calc(var(--phone-w) * 0.03);
  border-radius: calc(var(--phone-w) * 0.165);
  background: #14110d;
  box-shadow:
    0 44px 70px -40px rgba(22, 18, 11, 0.6),
    0 14px 26px -16px rgba(22, 18, 11, 0.35);
}

.phone__glass {
  position: relative;
  overflow: hidden;
  border-radius: calc(var(--phone-w) * 0.135);
  background: var(--paper);
}

.phone__screen {
  width: 100%;
}

/* The camera cut-out: part of the device, not of the screenshot. */
.phone__island {
  position: absolute;
  top: 1.1%;
  left: 36%;
  width: 28%;
  height: 3.75%;
  border-radius: 999px;
  background: #000;
}

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

.hero {
  /* flow-root keeps the stage's negative margin inside this box, so the box ends where
     the phone is meant to be cut; clip then cuts it. */
  display: flow-root;
  overflow: clip;
  text-align: center;
}

.hero__words {
  position: relative;
  z-index: 3;
  padding-top: clamp(32px, 6.5vw, 72px);
}

.hero__title {
  max-width: 13em;
  margin-inline: auto;
  font-size: clamp(2.75rem, 1.2rem + 6.6vw, 5rem);
  font-weight: 800;
  letter-spacing: -0.04em;
  line-height: 1;
  text-wrap: balance;
}

.hero__lead {
  max-width: 34rem;
  margin: 22px auto 0;
  color: var(--ink-2);
  font-size: clamp(1.125rem, 1rem + 0.6vw, 1.3125rem);
  line-height: 1.5;
  text-wrap: balance;
}

.hero__acts {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 16px 28px;
  margin-top: 30px;
}

.hero__note {
  margin-top: 16px;
  color: var(--ink-2);
  font-size: 0.9375rem;
}

.hero__stage {
  --phone-w: min(68vw, 290px);
  --phone-h: calc(var(--phone-w) * 0.94 * var(--screen-ratio) + var(--phone-w) * 0.06);
  position: relative;
  display: flex;
  justify-content: center;
  margin-top: clamp(40px, 6vw, 64px);
  /* The phone rises out of the film band below: its lower part is cut off. */
  margin-bottom: calc(var(--phone-h) * -0.42);
}

/* A soft green light behind the phone. */
.hero__stage::before {
  content: "";
  position: absolute;
  top: calc(var(--phone-h) * -0.14);
  left: 50%;
  width: calc(var(--phone-w) * 3.6);
  height: calc(var(--phone-h) * 0.92);
  border-radius: 50%;
  background: radial-gradient(closest-side, rgba(15, 140, 99, 0.3), rgba(15, 140, 99, 0.11) 55%, rgba(15, 140, 99, 0));
  transform: translateX(-50%);
  pointer-events: none;
}

.hero__stage .phone {
  z-index: 1;
}

/* Two pieces of other screens beside the phone: only where there is room. */
.hero__float {
  display: none;
}

.hero__piece {
  width: 100%;
}

/* The top of the page arrives in order: the words, the phone, then the two pieces. */
@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(22px);
  }
}

@keyframes appear {
  from {
    opacity: 0;
  }
}

.hero__title,
.hero__lead,
.hero__acts,
.hero__note {
  animation: rise 0.7s var(--ease) both;
}

.hero__lead {
  animation-delay: 0.06s;
}

.hero__acts {
  animation-delay: 0.12s;
}

.hero__note {
  animation-delay: 0.16s;
}

.hero__stage::before {
  animation: appear 1.2s ease 0.1s both;
}

.hero__stage .phone {
  animation: rise 0.9s var(--ease) 0.18s both;
}

.hero__float--left {
  animation: rise 0.9s var(--ease) 0.45s both;
}

.hero__float--right {
  animation: rise 0.9s var(--ease) 0.6s both;
}

/* ---------- The film ---------- */

.film {
  position: relative;
  padding-block: clamp(56px, 8vw, 104px);
  background: var(--night);
  color: #fff;
}

.film__title {
  font-size: clamp(2.25rem, 1.3rem + 4.4vw, 4.25rem);
  font-weight: 800;
  letter-spacing: -0.04em;
  line-height: 1.02;
  text-align: center;
  text-wrap: balance;
}

.player {
  position: relative;
  overflow: hidden;
  aspect-ratio: 16 / 9;
  margin-top: clamp(28px, 4vw, 48px);
  border-radius: clamp(14px, 2vw, 24px);
  background: #000;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.1);
}

.player__video {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.player__play {
  position: absolute;
  inset: 0;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  width: fit-content;
  height: fit-content;
  min-height: 60px;
  margin: auto;
  padding: 0 28px 0 20px;
  border: 0;
  border-radius: 999px;
  background: #fff;
  color: var(--ink);
  font: inherit;
  font-size: 1.0625rem;
  font-weight: 800;
  letter-spacing: -0.01em;
  cursor: pointer;
  box-shadow: 0 18px 44px -14px rgba(0, 0, 0, 0.6);
  transition: transform 0.15s ease;
}

.player__play:hover {
  transform: scale(1.04);
}

.player__play[hidden] {
  display: none;
}

/* ---------- The tour: one large card per screen, in a strip ---------- */

.tour {
  padding-top: clamp(64px, 9vw, 112px);
  padding-bottom: clamp(48px, 7vw, 88px);
}

.tour__head {
  text-align: center;
}

.tour__title,
.try__title,
.facts__title {
  font-size: clamp(2rem, 1.35rem + 3vw, 3.25rem);
  font-weight: 800;
  letter-spacing: -0.04em;
  line-height: 1.04;
  text-wrap: balance;
}

/* One tab per card. A row that scrolls sideways where it is wider than the screen. */
.tour__tabs {
  position: relative;
  display: flex;
  gap: 2px;
  width: fit-content;
  max-width: 100%;
  margin: clamp(22px, 3vw, 32px) auto 0;
  padding: 4px;
  overflow-x: auto;
  border-radius: 999px;
  background: #ece7de;
  overscroll-behavior-x: contain;
  scrollbar-width: none;
}

.tour__tabs::-webkit-scrollbar {
  display: none;
}

.tour__tabs[hidden] {
  display: none;
}

.tour__tabs li {
  flex: none;
}

.tour__tab {
  padding: 9px 16px;
  border: 0;
  border-radius: 999px;
  background: none;
  color: var(--ink-2);
  font: inherit;
  font-size: 0.9375rem;
  font-weight: 700;
  line-height: 1.25;
  white-space: nowrap;
  cursor: pointer;
}

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

.tour__tab[aria-current="true"] {
  background: #fff;
  color: var(--ink);
  box-shadow: 0 1px 3px rgba(30, 26, 21, 0.16);
}

/* Inside the row's own edge, which would cut a ring drawn outside the tab. */
.tour__tab:focus-visible {
  outline-offset: -3px;
}

.reel {
  /* The strip runs edge to edge; its first card lines up with the rest of the page. */
  --side: max(var(--gutter), calc((100% - 70rem) / 2));
  display: grid;
  /* A little narrower than the page, so the next card shows at the edge. */
  grid-auto-columns: min(100% - 14px, 68rem);
  grid-auto-flow: column;
  gap: 12px;
  margin-top: clamp(22px, 3.2vw, 36px);
  overflow-x: auto;
  padding: 4px var(--side) 20px;
  overscroll-behavior-x: contain;
  scroll-padding-inline: var(--side);
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
  /* Cards leaving at the left fade out in the page margin instead of being cut. */
  -webkit-mask-image: linear-gradient(to right, transparent 0, #000 var(--side));
  mask-image: linear-gradient(to right, transparent 0, #000 var(--side));
}

.reel::-webkit-scrollbar {
  display: none;
}

.reel:focus-visible {
  outline-offset: -3px;
}

.slide {
  display: grid;
  /* The words at the top; the picture in the middle of what is left (the cards are
     all as tall as the tallest, so a short picture has room to spare). */
  grid-template-rows: auto 1fr;
  gap: 24px;
  padding: 28px 22px 24px;
  border-radius: 28px;
  background: var(--wash-mint);
  scroll-snap-align: start;
  /* For a link straight to one card (/#wealth): a little air above it. */
  scroll-margin-top: 24px;
}

.slide--sand {
  background: var(--wash-sand);
}

.slide__title {
  font-size: clamp(1.75rem, 1.35rem + 1.9vw, 2.75rem);
  font-weight: 800;
  letter-spacing: -0.035em;
  line-height: 1.08;
  text-wrap: balance;
}

.slide__body {
  margin-top: 10px;
  color: #4e483f;
  text-wrap: balance;
}

.slide__shot {
  display: grid;
  place-items: center;
  align-self: center;
}

.slide__img {
  width: 100%;
  border-radius: 18px;
  box-shadow:
    0 28px 48px -30px rgba(22, 18, 11, 0.45),
    0 10px 22px -14px rgba(22, 18, 11, 0.2);
}

.tour__sample {
  color: var(--ink-2);
  font-size: 0.8125rem;
  text-align: center;
}

/* ---------- Two things to try ---------- */

/* Each example is a card of its own, like the cards of the tour above. */
.try {
  padding-top: clamp(12px, 2vw, 20px);
}

/* On a phone the white card fills the tinted one from side to side, under the words:
   the table inside it needs every pixel of the width. */
.try__in {
  display: grid;
  gap: 22px;
  padding-top: 26px;
  border-radius: 28px;
  background: var(--wash-sand);
}

.try__words {
  padding-inline: 22px;
}

.try--homes .try__in {
  background: var(--wash-mint);
}

.try__lead {
  max-width: 31rem;
  margin-top: 14px;
  color: #4e483f;
  text-wrap: pretty;
}

/* A worked example you can change, drawn like one of the app's cards. */
.widget {
  /* As a grid item it may be narrower than its widest line of words. */
  min-width: 0;
  padding: clamp(20px, 3.2vw, 32px);
  border-radius: 28px;
  background: #fff;
  box-shadow: 0 26px 50px -36px rgba(22, 18, 11, 0.35);
}

.widget__button {
  display: inline-block;
  margin-top: 18px;
  padding: 0;
  border: 0;
  background: none;
  color: var(--ink);
  font: inherit;
  font-size: 0.875rem;
  font-weight: 700;
  text-decoration: underline;
  text-decoration-color: var(--green);
  text-decoration-thickness: 2px;
  text-underline-offset: 4px;
  cursor: pointer;
}

.widget__button:hover {
  text-decoration-color: currentColor;
}

.widget__button[hidden] {
  display: none;
}

/* The app's segmented control. */
.segmented {
  display: inline-grid;
  grid-auto-columns: 1fr;
  grid-auto-flow: column;
  max-width: 100%;
  margin: 0;
  padding: 4px;
  border: 0;
  border-radius: 999px;
  background: #ece7de;
}

.segmented__option {
  position: relative;
  display: grid;
  cursor: pointer;
}

.segmented__option input {
  position: absolute;
  inset: 0;
  margin: 0;
  opacity: 0;
  cursor: pointer;
}

.segmented__option > span {
  display: grid;
  place-items: center;
  padding: 9px 12px;
  border-radius: 999px;
  color: var(--ink-2);
  font-size: 0.9375rem;
  font-weight: 700;
  line-height: 1.25;
  text-align: center;
}

.segmented__option:hover > span {
  color: var(--ink);
}

.segmented__option input:checked + span {
  background: #fff;
  color: var(--ink);
  box-shadow: 0 1px 3px rgba(30, 26, 21, 0.16);
}

.segmented__option input:focus-visible + span {
  outline: 3px solid var(--green);
  outline-offset: 2px;
}

.calc__table {
  width: 100%;
  margin-top: 22px;
  border-collapse: collapse;
  font-size: 0.9375rem;
  font-variant-numeric: tabular-nums;
}

.calc__table thead th {
  padding: 0 0 10px 4px;
  color: var(--ink-2);
  font-size: 0.8125rem;
  font-weight: 600;
  text-align: right;
  vertical-align: bottom;
  white-space: nowrap;
}

/* "Next month" may take two lines on the narrowest phones; a Chinese heading must not
   break between characters. */
html:lang(en) .calc__table thead th {
  white-space: normal;
}

.calc__table thead th:first-child {
  padding-left: 0;
  text-align: left;
}

.calc__table tbody th,
.calc__table tbody td {
  padding-block: 13px;
  border-top: 1px solid var(--rule);
  vertical-align: middle;
}

.calc__table tbody th {
  font-weight: 700;
  text-align: left;
}

.calc__table tbody td {
  padding-left: 6px;
  text-align: right;
}

.calc__name {
  display: block;
  white-space: nowrap;
}

.calc__carried {
  display: block;
  margin-top: 2px;
  color: var(--gain);
  font-size: 0.8125rem;
  font-weight: 600;
}

.calc__carried--debt {
  color: var(--debt);
}

.calc__field {
  display: inline-flex;
  align-items: center;
  gap: 1px;
  height: 42px;
  padding: 0 8px;
  border-radius: 12px;
  background: #f1ede6;
  font-weight: 700;
}

.calc__field:focus-within {
  outline: 3px solid var(--green);
  outline-offset: 1px;
}

.calc__field input {
  width: 4ch;
  padding: 0;
  border: 0;
  background: none;
  color: inherit;
  font: inherit;
  text-align: right;
  appearance: textfield;
  -moz-appearance: textfield;
}

.calc__field input::-webkit-outer-spin-button,
.calc__field input::-webkit-inner-spin-button {
  margin: 0;
  -webkit-appearance: none;
}

.calc__field input:focus {
  outline: none;
}

/* Until site.js wakes the fields they are a worked example, not a broken form. */
.calc__field input:disabled {
  opacity: 1;
  -webkit-text-fill-color: currentColor;
}

.calc__next {
  font-weight: 800;
  white-space: nowrap;
}

.calc__result {
  padding-top: 20px;
  border-top: 1px solid var(--rule);
}

.calc__total-label {
  color: var(--ink-2);
  font-size: 0.9375rem;
  font-weight: 600;
}

.calc__total,
.story__metric strong {
  font-size: clamp(2.5rem, 2rem + 2vw, 3.25rem);
  font-weight: 800;
  letter-spacing: -0.04em;
  line-height: 1.12;
}

.calc__explain {
  margin-top: 4px;
  color: var(--ink-2);
}

.story {
  margin-top: 26px;
}

.story__kicker {
  color: var(--ink-2);
  font-size: 0.8125rem;
  font-weight: 700;
}

.story__title {
  margin-top: 4px;
  font-size: 1.5rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.18;
  text-wrap: balance;
}

.story__metric {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 2px 12px;
  margin-top: 16px;
}

.story__metric span {
  color: var(--ink-2);
  font-weight: 600;
}

.story__rows {
  margin-top: 14px;
}

.story__rows div {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding-block: 13px;
  border-top: 1px solid var(--rule);
}

.story__rows dt {
  font-weight: 600;
}

.story__rows dd {
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

/* The three households are a choice of one; without :has() they are simply all shown. */
@supports selector(:has(*)) {
  .stories:has(input[value="solo"]:checked) .story:not([data-story="solo"]),
  .stories:has(input[value="partners"]:checked) .story:not([data-story="partners"]),
  .stories:has(input[value="family"]:checked) .story:not([data-story="family"]) {
    display: none;
  }
}

@supports not selector(:has(*)) {
  .stories .segmented {
    display: none;
  }

  .story + .story {
    margin-top: 44px;
  }
}

/* ---------- Before you connect a bank ---------- */

.facts {
  padding-block: clamp(64px, 9vw, 112px);
}

.facts__title {
  text-align: center;
}

.facts__list {
  display: grid;
  column-gap: 48px;
  margin-top: clamp(32px, 5vw, 56px);
}

.fact {
  padding-block: 20px 22px;
  border-top: 1px solid var(--rule);
}

.fact dt {
  font-size: 1.125rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.3;
}

.fact dd {
  margin-top: 6px;
  color: var(--ink-2);
  font-size: 1rem;
  line-height: 1.5;
  text-wrap: pretty;
}

.facts__more {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 16px 36px;
  margin-top: 36px;
}

/* ---------- Join the beta ---------- */

.beta {
  position: relative;
  overflow: clip;
  padding-block: clamp(72px, 11vw, 136px);
  background: #0a6b4f;
  color: #fff;
  text-align: center;
}

.beta::before {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: max(74vw, 560px);
  aspect-ratio: 1;
  border-radius: 50%;
  background: radial-gradient(closest-side, #12906b, #0f8463 62%, rgba(15, 132, 99, 0));
  transform: translate(-50%, -50%);
}

.beta__in {
  position: relative;
  display: grid;
  justify-items: center;
  gap: 44px;
}

.beta__title {
  font-size: clamp(2.5rem, 1.4rem + 5vw, 4.75rem);
  font-weight: 800;
  letter-spacing: -0.04em;
  line-height: 1;
  text-wrap: balance;
}

.beta__lead {
  max-width: 36rem;
  margin: 20px auto 0;
  color: #eefaf3;
  font-size: 1.125rem;
  font-weight: 600;
  text-wrap: pretty;
}

.beta .button {
  margin-top: 30px;
}

/* The QR code is for someone reading on a computer; on a phone it is no use. */
.beta__scan {
  display: none;
}

.beta__qr {
  width: 136px;
  padding: 10px;
  border-radius: 18px;
  background: #fff;
  color: var(--ink);
}

.beta__qr svg {
  width: 100%;
}

.beta__scan figcaption {
  max-width: 17rem;
  color: #d8f3e5;
  font-size: 0.875rem;
  font-weight: 600;
  text-wrap: balance;
}

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

.foot {
  padding-block: 30px 40px;
  color: var(--ink-2);
  font-size: 0.9375rem;
}

.foot__in {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 14px 32px;
}

.foot__links {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 24px;
}

.foot__links a {
  color: var(--ink);
  font-weight: 600;
  text-decoration: none;
}

.foot__links a:hover {
  text-decoration: underline;
  text-underline-offset: 5px;
}

/* ---------- Small helpers ---------- */

/* A headline given as phrases breaks between them, never inside one. */
.phrase {
  display: inline-block;
}

/* Read aloud by a screen reader, not shown. */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

/* A block that fades in when it is scrolled to. site.js adds .reveal only to blocks
   that start below the screen, and .is-in when they arrive; without it nothing hides. */
.reveal {
  opacity: 0;
  transform: translateY(20px);
  transition:
    opacity 0.7s ease,
    transform 0.7s var(--ease);
  transition-delay: var(--reveal-delay, 0s);
}

.reveal.is-in {
  opacity: 1;
  transform: none;
}

/* On paper nothing waits to be scrolled to. */
@media print {
  .reveal {
    opacity: 1;
    transform: none;
  }
}

/* ---------- Chinese ---------- */

/* Chinese headlines are set by the system face: no tight tracking, more leading. */
html:lang(zh-Hans) body {
  line-height: 1.75;
}

html:lang(zh-Hans) :is(.hero__title, .film__title, .tour__title, .try__title, .facts__title, .beta__title) {
  letter-spacing: -0.01em;
  line-height: 1.16;
}

html:lang(zh-Hans) :is(.slide__title, .story__title, .fact dt) {
  letter-spacing: 0;
  line-height: 1.22;
}

html:lang(zh-Hans) :is(.hero__lead, .slide__body, .try__lead, .fact dd, .beta__lead) {
  line-break: strict;
}

html:lang(zh-Hans) .fact dd {
  line-height: 1.65;
}

/* ---------- Wider screens ---------- */

@media (min-width: 720px) {
  :root {
    --gutter: 40px;
  }

  .top__links .button {
    display: inline-flex;
  }

  .segmented__option > span {
    padding-inline: 16px;
  }

  .calc__table {
    font-size: 1.0625rem;
  }

  .calc__table tbody td {
    padding-left: 10px;
  }

  .calc__field {
    height: 44px;
    padding: 0 11px;
  }

  .calc__field input {
    width: 5ch;
  }

  .try__in {
    gap: 28px;
    padding: 40px;
    border-radius: 36px;
  }

  .try__words {
    padding-inline: 0;
  }

  .facts__list {
    grid-template-columns: 1fr 1fr;
  }
}

/* Room for the words and the picture side by side on each card. */
@media (min-width: 860px) {
  .reel {
    gap: 20px;
  }

  .slide {
    grid-template-columns: minmax(0, 5fr) minmax(0, 6fr);
    grid-template-rows: none;
    align-content: center;
    align-items: center;
    gap: 56px;
    min-height: 31rem;
    padding: 48px 64px;
    border-radius: 36px;
  }

  .slide__body,
  .try__lead {
    font-size: 1.1875rem;
  }

  .slide__img {
    width: auto;
    max-width: 100%;
    max-height: 25rem;
    border-radius: 22px;
  }
}

@media (min-width: 960px) {
  .try__in {
    grid-template-columns: minmax(0, 5fr) minmax(0, 6fr);
    align-items: center;
    gap: 56px;
    padding: 56px 64px;
  }

  /* The second example mirrors the first: its card on the left, its words on the right. */
  .try--homes .try__words {
    order: 2;
  }
}

@media (min-width: 1040px) {
  .hero__stage {
    --phone-w: 330px;
    margin-bottom: calc(var(--phone-h) * -0.36);
  }

  .hero__float {
    position: absolute;
    z-index: 2;
    display: block;
    width: 292px;
    overflow: hidden;
    border-radius: 22px;
    background: var(--paper);
    box-shadow:
      0 34px 60px -30px rgba(22, 18, 11, 0.5),
      0 12px 24px -14px rgba(22, 18, 11, 0.24);
  }

  .hero__float--left {
    top: 150px;
    right: calc(50% + var(--phone-w) / 2 - 34px);
  }

  .hero__float--right {
    top: 48px;
    left: calc(50% + var(--phone-w) / 2 - 34px);
  }

  .facts__list {
    grid-template-columns: repeat(3, 1fr);
  }
}

/* A computer with a pointer: show the QR code under the button. */
@media (min-width: 960px) and (hover: hover) and (pointer: fine) {
  .beta__scan {
    display: grid;
    justify-items: center;
    gap: 12px;
  }
}

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

  .hero__title,
  .hero__lead,
  .hero__acts,
  .hero__note,
  .hero__stage::before,
  .hero__stage .phone,
  .hero__float {
    animation: none;
  }

  .player__play {
    transition: none;
  }

  .reveal {
    opacity: 1;
    transform: none;
    transition: none;
  }
}
