/*
 * The home page (site/DESIGN.md, "The system"). Paper first: the app is dark, so it is the dark
 * object on the page, always set on one of Clario's paintings and cropped large enough to read.
 *
 * - Space: a 4px base, steps 4 8 12 16 24 32 48 64 96 128.
 * - Type, with peaks: chapter 96/92, hero 88/84, section 52/56, row 40/44,
 *   card 24/32, lede 22/32, body 18/28, small 16/24, label 15/20 (sentence case, never mono).
 * - Surfaces: paper and white, alternating. The page is light everywhere; the only dark things on it
 *   are the app itself and the glass cards beside it.
 * - Colour: none of our own. Actions are ink; every colour on the page comes from the six paintings.
 *
 * Motion is keyed on `.js` (things arrive as they are scrolled to), `.stories` (wide screens: the
 * phone pins and steps) and `.scrolled` (the bar becomes a capsule); `home.js` sets all three.
 */
@font-face {
  font-family: 'Mona Sans';
  src: url('/type/mona-sans-latin.woff2') format('woff2');
  font-weight: 200 900;
  font-display: swap;
}

@font-face {
  font-family: 'EMIAC Display';
  src: url('/type/emiac-display-360.woff2') format('woff2');
  font-weight: 300 429;
  font-display: swap;
}

@font-face {
  font-family: 'Geist Mono';
  src: url('/type/geist-mono-latin.woff2') format('woff2');
  font-weight: 100 900;
  font-display: swap;
}

@font-face {
  font-family: Poppins;
  src: url('/type/poppins-600.woff2') format('woff2');
  font-weight: 600;
  font-display: swap;
}

:root {
  /* Space */
  --s1: 4px;
  --s2: 8px;
  --s3: 12px;
  --s4: 16px;
  --s5: 24px;
  --s6: 32px;
  --s7: 48px;
  --s8: 64px;
  --s9: 96px;
  --s10: 128px;
  --section: var(--s10);

  /* Type: size / line height */
  --chapter: 96px;
  --chapter-lh: 92px;
  --display: 88px;
  --display-lh: 84px;
  --h2: 52px;
  --h2-lh: 56px;
  --h3: 40px;
  --h3-lh: 44px;
  --h4: 24px;
  --h4-lh: 32px;
  --lede: 22px;
  --lede-lh: 32px;
  --body: 18px;
  --body-lh: 28px;
  --small: 16px;
  --small-lh: 24px;
  --label: 15px;
  --label-lh: 20px;
  --font-sans: 'Mona Sans', system-ui, sans-serif;
  --font-display: 'EMIAC Display', georgia, serif;
  --font-mono: 'Geist Mono', ui-monospace, monospace;
  --font-wordmark: poppins, var(--font-sans);

  /* Radius */
  --r-sm: 8px;
  --r-win: 12px;
  --r-md: 16px;
  --r-pill: 999px;

  /* Grid */
  --container: 1200px;
  --gutter: 24px;
  --measure: 600px;
  --edge-x: max(var(--gutter), calc((100vw - var(--container)) / 2));

  /* Surfaces */
  --paper: #f5f4f0;
  --white: #fff;
  --night: #121215;
  --ink: #16161a;
  --ink-hover: #34343b;

  /* The surface a section is on: paper by default */
  --bg: var(--paper);
  --text: #16161a;
  --text-2: #45454d;
  --text-3: #6b6b73;
  --line: rgb(22 22 26 / 9%);
  --line-2: rgb(22 22 26 / 16%);

  /* Depth */
  --lift-shadow: 0 30px 80px rgb(0 0 0 / 42%);
  --cut-shadow: drop-shadow(0 28px 48px rgb(0 0 0 / 40%));
  --glass: rgb(22 22 26 / 82%);
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --grain: url('/art/grain.png');
  --p: 1;
}

/* A white section, between paper ones */
.white {
  --bg: var(--white);
}

* {
  box-sizing: border-box;
  margin: 0;
}

html {
  background: var(--paper);
  scroll-behavior: smooth;
}

body {
  background: var(--bg);
  color: var(--text);
  font: var(--body) / var(--body-lh) var(--font-sans);
  -webkit-font-smoothing: antialiased;
  overflow-x: clip;
}

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

a {
  color: inherit;
}

figure {
  margin: 0;
}

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

.defs {
  position: absolute;
  width: 0;
  height: 0;
}

.skip {
  position: absolute;
  left: -9999px;
}

.skip:focus {
  left: var(--s4);
  top: var(--s4);
  z-index: 10;
}

.wrap {
  width: 100%;
  max-width: calc(var(--container) + 2 * var(--gutter));
  margin: 0 auto;
  padding: 0 var(--gutter);
}

/* ─── Type ────────────────────────────────────────────────────────────── */
h1,
h2,
h3 {
  font-family: var(--font-display);
  font-weight: 370;
  text-wrap: balance;
}

h1 {
  font-size: var(--display);
  line-height: var(--display-lh);
  letter-spacing: -0.025em;
}

h2 {
  font-size: var(--h2);
  line-height: var(--h2-lh);
  letter-spacing: -0.025em;
}

h2.chapter {
  font-size: var(--chapter);
  line-height: var(--chapter-lh);
  letter-spacing: -0.03em;
}

h3 {
  font-size: var(--h3);
  line-height: var(--h3-lh);
  letter-spacing: -0.02em;
}

.label {
  font: 560 var(--label) / var(--label-lh) var(--font-sans);
  color: var(--text-3);
}

.lede {
  max-width: 480px;
  margin-top: var(--s5);
  font-size: var(--lede);
  line-height: var(--lede-lh);
  color: var(--text-2);
}

/* ─── Buttons ─────────────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: var(--s2);
  border-radius: var(--r-pill);
  font-weight: 560;
  text-decoration: none;
  transition:
    transform 160ms var(--ease),
    background-color 160ms var(--ease),
    box-shadow 160ms var(--ease);
}

.btn:active {
  transform: scale(0.97);
}

.btn svg {
  width: 14px;
  height: 17px;
  fill: currentcolor;
}

.btn-lg {
  height: 56px;
  padding: 0 28px;
  font-size: var(--small);
}

.btn-sm {
  height: 40px;
  padding: 0 var(--s5);
  font-size: 14px;
}

.btn-ink {
  background: var(--ink);
  color: var(--white);
}

.btn-ink:hover {
  background: var(--ink-hover);
}

.btn-ghost {
  box-shadow: inset 0 0 0 1px var(--line-2);
}

.btn-ghost:hover {
  box-shadow: inset 0 0 0 1px var(--text-3);
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s3);
  margin-top: var(--s7);
}

/* ─── The bar: full width at the top, a floating capsule once the page moves ─ */
.nav {
  position: fixed;
  inset: 0 0 auto;
  z-index: 5;
  padding: 0 var(--gutter);
  transition: padding 300ms var(--ease);
}

.nav-in {
  display: flex;
  align-items: center;
  gap: var(--s6);
  max-width: var(--container);
  height: var(--s8);
  margin: 0 auto;
  padding: 0 var(--s2) 0 var(--s4);
  border-radius: var(--r-pill);
  transition:
    background-color 300ms var(--ease),
    box-shadow 300ms var(--ease),
    height 300ms var(--ease);
}

.scrolled .nav {
  padding-top: var(--s2);
}

.scrolled .nav-in {
  height: 56px;
  background: rgb(255 255 255 / 84%);
  backdrop-filter: blur(16px) saturate(160%);
  box-shadow:
    0 0 0 1px rgb(22 22 26 / 8%),
    0 8px 24px rgb(22 22 26 / 8%);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: var(--s2);
  text-decoration: none;
  font: 600 18px var(--font-wordmark);
  color: #16161a;
}

.brand svg {
  width: 26px;
  height: auto;
}

.nav nav {
  display: flex;
  gap: var(--s5);
  margin-left: auto;
  font-size: 15px;
}

.nav nav a {
  color: #45454d;
  text-decoration: none;
  transition: color 160ms var(--ease);
}

.nav nav a:hover,
.nav nav a[aria-current='page'] {
  color: #16161a;
}

/* ─── A painting that holds the product ───────────────────────────────── */
.art {
  position: relative;
  overflow: hidden;
  border-radius: var(--r-md);
  background: var(--night) center / cover no-repeat;
  isolation: isolate;
}

.art::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: -1;
  background: var(--grain);
  opacity: 0.35;
  mix-blend-mode: overlay;
  border-radius: inherit;
  pointer-events: none;
}

.art-dusk {
  background-image: url('/art/dusk.webp');
}

.art-meadow {
  background-image: url('/art/meadow.webp');
}

.art-tide {
  background-image: url('/art/tide.webp');
}

.art-grass {
  background-image: url('/art/grass.webp');
}

.art-glacier {
  background-image: url('/art/glacier.webp');
}

.art-horizon {
  background-image: url('/art/horizon.webp');
}

/* A crop of the app, cut out with its own corners. It may be wider than its painting, which
   cuts it off at the edge, so the page-wide image cap does not apply. */
.cutout {
  position: absolute;
  max-width: none;
  filter: var(--cut-shadow);
}

/* Live cards: dark glass on a painting, overlapping the product's edge */
.float {
  --depth: 12px;

  position: absolute;
  z-index: 2;
  padding: var(--s3) var(--s4);
  border-radius: var(--r-md);
  background: var(--glass);
  backdrop-filter: blur(16px) saturate(140%);
  color: #ededef;
  box-shadow:
    0 0 0 1px rgb(255 255 255 / 14%),
    0 16px 40px rgb(0 0 0 / 30%);
  translate: calc(var(--mx, 0) * var(--depth)) calc(var(--my, 0) * var(--depth));
  transition: translate 600ms var(--ease);
}

.float > * {
  animation: drift 5200ms ease-in-out infinite alternate;
}

.float .k {
  font: 560 var(--label) / var(--label-lh) var(--font-sans);
  color: #a6a6ae;
}

.float .v {
  display: flex;
  align-items: center;
  gap: var(--s2);
  margin-top: var(--s1);
  font-size: 15px;
  line-height: 20px;
}

.dot {
  width: var(--s2);
  height: var(--s2);
  border-radius: 50%;
  background: #e5484d;
  animation: pulse 1600ms ease-in-out infinite;
}

@keyframes drift {
  to {
    translate: 0 calc(-1 * var(--s2));
  }
}

@keyframes pulse {
  50% {
    opacity: 0.35;
  }
}

/* ─── Hero: the words on paper, the app on dusk running off the page ──── */
.hero {
  display: grid;
  grid-template-columns: minmax(0, 620px) minmax(0, 1fr);
  align-items: center;
  min-height: 880px;
  padding: 112px 0 var(--s8) var(--edge-x);
}

.hero-copy {
  padding-right: var(--s7);
}


.hero-art {
  height: 740px;
  border-radius: var(--r-md) 0 0 var(--r-md);
}

.hero-window {
  position: absolute;
  left: 72px;
  top: 88px;
  width: 1100px;
  overflow: hidden;
  border-radius: var(--r-win);
  box-shadow:
    0 0 0 1px rgb(255 255 255 / 14%),
    var(--lift-shadow);
  animation: rise 1100ms var(--ease) 240ms both;
}

.f-decided {
  --depth: 22px;

  left: 24px;
  top: 440px;
}

.f-rec {
  --depth: 14px;

  left: 360px;
  top: 40px;
}

.f-rec > * {
  animation-delay: -2600ms;
}

.rise {
  animation: rise 900ms var(--ease) both;
}

.hero h1.rise {
  animation-delay: 60ms;
}

.hero .lede.rise {
  animation-delay: 120ms;
}

.hero .actions.rise {
  animation-delay: 180ms;
}

@keyframes rise {
  from {
    opacity: 0;
    translate: 0 var(--s5);
  }
}

/* ─── Works with ──────────────────────────────────────────────────────── */
.works {
  padding: var(--s7) 0;
  box-shadow:
    0 -1px 0 var(--line),
    0 1px 0 var(--line);
}

.works-in {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: var(--s5) var(--s9);
}

.works p {
  display: flex;
  align-items: center;
  gap: var(--s3);
  font-size: var(--small);
  color: var(--text-2);
}

.icons {
  display: flex;
  gap: var(--s2);
}

.icons img {
  width: 24px;
  height: 24px;
}

/* ─── Recap, on white: the heading, then one window on dusk that shows a Recap being made in three
   steps (`data-at` / `data-only`, set by home.js): the hour as it was recorded, the moments cut
   from it while the app's own steps run, and the film those moments became, playing. ───────── */
.recap-film {
  padding: var(--s10) 0 0;
  background: var(--white);
}

.recap-head {
  max-width: 920px;
}

/* Clipped, so the painting running off the right never widens the page where the margin beside it
   is narrower than its overhang (1024 px scrolled 48 px sideways) */
.recap-story {
  --bg: var(--white);

  overflow-x: clip;
  background: var(--white);
}

/* The real app's Recap pane, a screen per step, cut off by its painting like every other crop:
   Make a recap, the recap being made, and the finished recap, whose player plays the film itself
   (`.app-film`, over the frame's place in the crop: 32 74 643x272 of 736x730, above the app's
   own controls). The crops are 704 170 736x730 of a 1440x900 capture of the app. */
.recap-steps {
  margin-top: 0;
}

.js:not(.stories) .recap-steps li:not(.now) {
  opacity: 0.45;
}

/* The steps: the one being read is ink, the others fade, and an ink line fills across each as it
   is scrolled through (where nothing pins, across the 3.6 s a step is shown). */
.app-steps.recap-steps li {
  --k: 0;

  position: relative;
  transition: opacity 900ms var(--ease);
}

.recap-steps li:nth-child(2) {
  --k: 1;
}

.recap-steps li:nth-child(3) {
  --k: 2;
}

.recap-steps li::before {
  content: '';
  position: absolute;
  top: -1px;
  left: 0;
  width: 100%;
  height: 2px;
  background: var(--ink);
  transform-origin: 0 50%;
  scale: 0 1;
}

.stories .recap-steps li::before {
  scale: clamp(0, calc(var(--through, 0) - var(--k)), 1) 1;
}

.js:not(.stories) .recap-steps li.now::before {
  animation: fill 3600ms linear both;
}

@keyframes fill {
  to {
    scale: 1 1;
  }
}

.recap-stage {
  position: relative;
  height: min(680px, calc(100vh - var(--s9)));
  margin-right: calc(-1 * var(--s8));
  overflow: hidden;
}

.recap-shot {
  position: absolute;
  top: var(--s8);
  left: 40px;
  width: 700px;
  aspect-ratio: 736 / 730;
  margin: 0;
  overflow: hidden;
  border-radius: var(--r-win);
  box-shadow:
    0 0 0 1px rgb(255 255 255 / 12%),
    var(--lift-shadow);
}

/* Each screen fades in over the one before, which stays solid beneath it, so the painting never
   shows through mid-change; going back, the later screen fades away off the earlier one. */
.recap-shot > * {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  transition:
    opacity 900ms var(--ease),
    scale 900ms var(--ease);
}

.js .recap-shot > :not(.on) {
  opacity: 0;
  scale: 1.02;
}

.recap-shot > .app-film {
  inset: 10.14% auto auto 4.35%;
  width: 87.36%;
  height: 37.26%;
  overflow: hidden;
  border-radius: var(--s2) var(--s2) 0 0;
  mask-image: linear-gradient(#000 72%, transparent);
}

.app-film video {
  display: block;
  width: 100%;
}

.rf {
  top: var(--s5);
  right: var(--s5);
  transition:
    opacity 600ms var(--ease),
    translate 600ms var(--ease);
}

.js .rf:not(.now) {
  opacity: 0;
  translate: 0 var(--s4);
}

/* Without the script: the finished recap, playing */
:root:not(.js) .recap-shot > [data-at]:not([data-at='3']),
:root:not(.js) .rf:not([data-only='3']) {
  display: none;
}

/* Where nothing pins, the painting comes first and its step is the lit one */
:root:not(.stories) .recap-story {
  padding-top: var(--s7);
}

:root:not(.stories) .recap-stage {
  order: -1;
  margin-right: 0;
}

.metrics {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--s6);
  margin-top: var(--s9);
}

.metrics li {
  position: relative;
  padding-top: var(--s5);
}

.metrics li::before {
  content: '';
  position: absolute;
  inset: 0 0 auto;
  height: 1px;
  background: var(--line-2);
  transform-origin: left;
  transition: scale 1100ms var(--ease) calc(var(--i, 0) * 140ms);
}

.js .metrics:not(.in) li::before {
  scale: 0 1;
}

.metrics p:not(.big) {
  max-width: 320px;
  margin-top: var(--s4);
  color: var(--text-2);
}

.big {
  display: flex;
  align-items: baseline;
  font: 370 112px / 112px var(--font-display);
  letter-spacing: -0.04em;
  color: var(--text);
}

.big span {
  margin-left: var(--s2);
  font-size: var(--h3);
  line-height: var(--h3-lh);
  letter-spacing: -0.015em;
  color: var(--text-3);
}

/* ─── Sections ────────────────────────────────────────────────────────── */
.section {
  padding: var(--section) 0;
  background: var(--bg);
  color: var(--text);
}

.head {
  max-width: 820px;
}

.head h2 {
  margin-top: var(--s4);
}

.head > p:last-child:not(.label) {
  max-width: var(--measure);
  margin-top: var(--s5);
  font-size: var(--lede);
  line-height: var(--lede-lh);
  color: var(--text-2);
}

.head-center {
  margin: 0 auto;
  text-align: center;
}

.head-center > p:last-child:not(.label) {
  margin-inline: auto;
}

.head + * {
  margin-top: var(--s8);
}

.head .more {
  color: var(--text);
  text-decoration: underline;
  text-decoration-color: var(--line-2);
  text-underline-offset: 4px;
  white-space: nowrap;
}

.head .more:hover {
  text-decoration-color: currentcolor;
}

/* ─── How it works: three rows, each a crop on its own painting ────────── */
.rows {
  display: grid;
  gap: var(--s9);
}

.row {
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
  align-items: center;
  gap: var(--s8);
}

.row.flip {
  grid-template-columns: minmax(0, 7fr) minmax(0, 5fr);
}

.row.flip .row-copy {
  order: 2;
}

.row-copy .n {
  font: 560 var(--label) / var(--label-lh) var(--font-sans);
  color: var(--text-3);
}

.row-copy h3 {
  margin-top: var(--s4);
}

.row-copy p:last-child {
  max-width: 420px;
  margin-top: var(--s4);
  font-size: 20px;
  line-height: 30px;
  color: var(--text-2);
}

.row-art {
  height: 560px;
}

.sheet {
  left: 50%;
  top: 64px;
  width: 540px;
  margin-left: -270px;
}

.lines {
  left: 56px;
  top: 64px;
  width: 760px;
}

.popover {
  left: 50%;
  top: 72px;
  width: 500px;
  margin-left: -250px;
}

/* ─── Clario's face: the round stone, tilted, with two eyes, drawn in parts so it blinks,
   listens and watches (the geometry is tauri-desktop's `ui/icons/mark-shape.ts`, in its 100 box) ── */
.face {
  display: block;
  overflow: visible;
}

.face-echo {
  fill: none;
  stroke: currentcolor;
  stroke-width: 5.2;
}

.face-head {
  fill: currentcolor;
}

.face-eyes {
  translate: calc(var(--mx, 0) * 3px) calc(var(--my, 0) * 2px);
  transition: translate 300ms var(--ease);
}

.eye {
  fill: var(--bg);
  transform-box: fill-box;
  transform-origin: center;
  animation: blink 5200ms infinite;
}

.face-echo {
  opacity: 0;
  transform-box: fill-box;
  transform-origin: center;
  animation: echo 2400ms ease-out infinite;
}

@keyframes echo {
  0% {
    opacity: 0.5;
    scale: 1;
  }

  100% {
    opacity: 0;
    scale: 1.45;
  }
}

@keyframes blink {
  0%,
  90%,
  96%,
  100% {
    scale: 1 1;
  }

  93% {
    scale: 1 0.1;
  }
}

/* ─── Ask ─────────────────────────────────────────────────────────────── */
.wide-art {
  height: 620px;
}

.answer {
  left: 72px;
  top: 80px;
  width: 1180px;
}

/* ─── Share: the real page and two of its panels ──────────────── */
.share {
  overflow-x: clip;
}

.share-orbit {
  --mx: 0;
  --my: 0;

  position: relative;
  isolation: isolate;
  margin-top: var(--s9);
  padding: var(--s8) 0 var(--s9);
}

/* The page it opens on, set on a painting like every other piece of the product */
.share-art {
  position: absolute;
  inset: 0;
  z-index: -1;
}

.browser {
  position: relative;
  width: min(100%, 1040px);
  margin: 0 auto;
  overflow: hidden;
  border-radius: var(--r-win);
  box-shadow:
    0 0 0 1px rgb(255 255 255 / 12%),
    var(--lift-shadow);
}

.browser .bar {
  display: flex;
  align-items: center;
  gap: var(--s2);
  height: 44px;
  padding: 0 var(--s4);
  background: #f4f4f5;
  box-shadow: inset 0 -1px 0 #e6e6ea;
}

.browser .bar i {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #d4d4d8;
}

.url {
  display: inline-flex;
  align-items: center;
  gap: var(--s2);
  height: 28px;
  margin: 0 auto;
  padding: 0 var(--s4);
  border-radius: var(--r-sm);
  background: var(--white);
  box-shadow: inset 0 0 0 1px #e6e6ea;
  font-size: 13px;
  color: #5f5f66;
  translate: calc(-1 * var(--s6)) 0;
}

.url svg {
  width: 10px;
  height: 12px;
  fill: #86868f;
  color: #86868f;
}

.card {
  --depth: 14px;
  --from: -1;

  position: absolute;
  z-index: 1;
  width: 360px;
  border-radius: 20px;
  box-shadow:
    0 0 0 1px rgb(255 255 255 / 12%),
    0 24px 56px rgb(0 0 0 / 50%);
  translate: calc(var(--mx) * var(--depth) + var(--from) * (1 - var(--p, 1)) * 160px)
    calc(var(--my) * var(--depth));
  opacity: clamp(0, calc(var(--p, 1) * 2 - 0.6), 1);
  transition: translate 600ms var(--ease);
}

.card-ask {
  left: -24px;
  bottom: var(--s5);
}

.card-comments {
  --depth: 22px;
  --from: 1;

  right: -24px;
  top: 30%;
}

/* ─── Phones: one iPhone on horizon, the app a screen at a time ─────────── */
.story {
  padding: var(--section) 0;
}

.story-in {
  display: grid;
  gap: var(--s8);
}

.stories .story {
  height: 180vh;
  padding: 0;
}

.stories .story .sticky {
  position: sticky;
  top: 0;
  display: grid;
  align-items: center;
  height: 100vh;
}

.stories .story-in {
  grid-template-columns: 5fr 7fr;
  align-items: center;
  gap: var(--s9);
}

.app-steps {
  margin-top: var(--s7);
}

.app-steps li {
  display: grid;
  gap: var(--s1);
  padding: var(--s5) 0;
  box-shadow: 0 -1px 0 var(--line-2);
  font-size: var(--small);
  line-height: var(--small-lh);
  color: var(--text-2);
  transition: opacity 600ms var(--ease);
}

.app-steps b {
  font-size: 20px;
  line-height: 28px;
  font-weight: 560;
  color: var(--text);
}

.stories .app-steps li:not(.now) {
  opacity: 0.45;
}

.phone-stage {
  --mx: 0;
  --my: 0;

  display: grid;
  place-items: center;
  justify-self: center;
  overflow: visible;
  width: 560px;
  height: min(760px, calc(100vh - var(--s9)));
}

.iphone {
  position: relative;
  padding: 10px;
  border-radius: 54px;
  background: linear-gradient(150deg, #4a4a50 0%, #18181b 30%, #0e0e10 60%, #3a3a40 100%);
  box-shadow:
    inset 0 0 0 1px rgb(255 255 255 / 16%),
    inset 0 0 0 3px #050506,
    0 0 0 1px rgb(0 0 0 / 70%),
    var(--lift-shadow);
}

.iphone::before,
.iphone::after {
  content: '';
  position: absolute;
  right: -3px;
  width: 3px;
  border-radius: 0 2px 2px 0;
  background: linear-gradient(90deg, #2a2a2e, #55555c);
}

.iphone::before {
  top: 24%;
  height: 12%;
}

.iphone::after {
  top: 40%;
  height: 6%;
}

.solo {
  width: min(320px, calc((100vh - var(--s10) - var(--s7)) * 0.46));
}

.screen {
  position: relative;
  overflow: hidden;
  border-radius: 44px;
  background: #000;
}

.screen::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(118deg, rgb(255 255 255 / 8%) 0%, transparent 32%);
  pointer-events: none;
}

.solo .screen img + img {
  position: absolute;
  inset: 0;
}

.stories .solo .screen img {
  transition:
    translate 800ms var(--ease),
    filter 800ms var(--ease);
}

.stories .solo .screen img:not(.on) {
  translate: 100% 0;
}

.stories .solo .screen img.on:not(.now) {
  translate: -30% 0;
  filter: brightness(0.45);
}

.js:not(.stories) .solo .screen img {
  animation: screen-cycle 12s var(--ease) infinite;
}

.js:not(.stories) .solo .screen img:nth-child(2) {
  animation-delay: -8s;
}

.js:not(.stories) .solo .screen img:nth-child(3) {
  animation-delay: -4s;
}

@keyframes screen-cycle {
  0%,
  30% {
    opacity: 1;
  }

  36%,
  94% {
    opacity: 0;
  }

  100% {
    opacity: 1;
  }
}

.status {
  position: absolute;
  inset: 0 0 auto;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  height: var(--s7);
  padding: var(--s2) var(--s6) 0;
  color: #fff;
  font: 600 14px var(--font-sans);
}

.status svg {
  justify-self: end;
  width: 46px;
  height: 11px;
  fill: currentcolor;
}

.island {
  width: 92px;
  height: 28px;
  border-radius: var(--r-pill);
  background: #000;
}

.pf {
  white-space: nowrap;
  transition:
    opacity 600ms var(--ease),
    translate 600ms var(--ease);
}

.pf.left {
  --depth: 18px;

  right: calc(50% + 120px);
  top: 30%;
}

.pf.right {
  --depth: 26px;

  left: calc(50% + 120px);
  top: 60%;
}

.pf.right > * {
  animation-delay: -2600ms;
}

/* Below this the right-hand card, on one line, ran past the screen's edge and widened the page
   (48 px at 1024): it wraps, and starts nearer the phone, ending 288 px right of its centre */
@media (width <= 1279px) {
  .pf {
    max-width: 200px;
    white-space: normal;
  }

  .pf.right {
    left: calc(50% + 88px);
  }
}

.stories .pf:not(.now) {
  opacity: 0;
  translate: 0 var(--s4);
}

:root:not(.stories) .pf {
  display: none;
}

.play {
  flex: none;
  width: 0;
  height: 0;
  border-left: 10px solid #8ea2ff;
  border-top: 6px solid transparent;
  border-bottom: 6px solid transparent;
}

/* ─── Close: the face says goodbye, on white ──────────────────────────── */
.close {
  --bg: var(--white);

  position: relative;
  overflow: hidden;
  padding: var(--s10) 0;
  background: var(--bg);
}

.close-in {
  position: relative;
  display: grid;
  justify-items: center;
  text-align: center;
}

.close-face {
  width: 88px;
  color: var(--text);
}

.close h2 {
  margin-top: var(--s6);
  font-size: var(--display);
  line-height: var(--display-lh);
}

.close .lede {
  margin-inline: auto;
}

.close .actions {
  justify-content: center;
}


/* ─── Goodbye: the horizon painting, as Ask has it in dark mode, and a Clario window rising out
   of it. The window is paper and runs off the section's foot, so it and the footer are one
   surface. `--p` lifts it as the section comes up; the sky drifts the other way. ──────────── */
.goodbye {
  position: relative;
  height: 760px;
  overflow: hidden;
  background: var(--paper);
}

/* The app's own Ask sky: blue above, the horizon's orange, night below the window */
.goodbye-sky {
  position: absolute;
  inset: 0;
  border-radius: 0;
  background-position: center calc(18% + (1 - var(--p, 1)) * 20%);
}

.goodbye-window {
  position: absolute;
  left: 50%;
  top: 112px;
  margin-left: calc(-1 * min(380px, 50% - var(--gutter)));
  bottom: 0;
  width: min(760px, calc(100% - 2 * var(--gutter)));
  padding: var(--s5) var(--s8) 0;
  border-radius: 24px 24px 0 0;
  background: var(--paper);
  box-shadow: 0 -24px 80px rgb(0 0 0 / 22%);
  translate: 0 calc((1 - var(--p, 1)) * 160px);
}

.window-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 32px;
}

.lights {
  display: flex;
  gap: var(--s2);
}

.lights i {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #ff5f57;
}

.lights i:nth-child(2) {
  background: #febc2e;
}

.lights i:nth-child(3) {
  background: #28c840;
}

.window-face {
  --bg: var(--paper);

  width: 30px;
  color: var(--text);
}

.goodbye-window h2 {
  max-width: 600px;
  margin-top: var(--s9);
  font-size: var(--display);
  line-height: var(--display-lh);
  letter-spacing: -0.03em;
}

.goodbye-window .lede {
  max-width: 520px;
}

/* ─── Footer ──────────────────────────────────────────────────────────── */
.foot {
  padding-top: var(--s8);
  overflow: hidden;
}

.foot-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--s4);
  font-size: 14px;
  color: var(--text-3);
}

.foot nav {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s2) var(--s5);
}

.foot a {
  text-decoration: none;
}

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

/* The sign-off: the painted wordmark rising out of the page's bottom edge, Clario's face on its
   last letter. Sized in the wordmark's own em, so it holds its place at every width. */
.sign {
  position: relative;
  margin-top: var(--s7);
  font: 600 min(24vw, 336px) / 1.1 var(--font-wordmark);
  translate: 0 calc(16% + (1 - var(--p, 1)) * 40%);
}

.wordmark {
  letter-spacing: -0.04em;
  text-align: center;
  color: var(--text);
}

/* The bot is the dot on the i: a dotless ı, with the face where Poppins draws the dot (its
   centre 0.145em across the ı and 0.702em above the baseline, read from the font's outlines) */
.dotless {
  position: relative;
}

.perch {
  /* Where the jump starts, in the face's own widths: sitting on top of the "o" */
  --from-x: 155%;
  --from-y: 19%;

  position: absolute;
  left: 0.015em;
  top: 0.215em;
  width: 0.26em;
}

.perched {
  width: 100%;
  color: var(--text);
  animation: hop 2600ms ease-in-out infinite alternate;
}

/* Once the wordmark is reached (`.in`, home.js) the face jumps onto the ı, as the launch film
   ends: it pops up sitting on the "o", crouches, leaps in one arc with a tilt, squashes
   as it lands on the dot, settles, then hops and blinks. Without the script it is simply there. */
.js .sign:not(.in) .perch {
  opacity: 0;
}

.js .sign.in .perch {
  transform-origin: 50% 85%;
  animation: jump 1900ms linear both;
}

.js .sign.in .perched {
  animation-delay: 1900ms;
}

@keyframes jump {
  0% {
    translate: var(--from-x) var(--from-y);
    scale: 0.4;
    opacity: 0;
    animation-timing-function: cubic-bezier(0.34, 1.56, 0.64, 1);
  }

  14% {
    translate: var(--from-x) var(--from-y);
    scale: 1;
    opacity: 1;
  }

  32% {
    translate: var(--from-x) var(--from-y);
    scale: 1;
    animation-timing-function: ease-in;
  }

  40% {
    translate: var(--from-x) var(--from-y);
    scale: 1.16 0.8;
  }

  43% {
    translate: calc(var(--from-x) * 0.9) calc(var(--from-y) * 0.9 - 50%);
    scale: 0.92 1.12;
    rotate: -12deg;
  }

  48% {
    translate: calc(var(--from-x) * 0.7) calc(var(--from-y) * 0.7 - 112%);
    rotate: -6deg;
  }

  54% {
    translate: calc(var(--from-x) * 0.48) calc(var(--from-y) * 0.48 - 140%);
    scale: 0.94 1.1;
    rotate: 0deg;
  }

  60% {
    translate: calc(var(--from-x) * 0.26) calc(var(--from-y) * 0.26 - 108%);
    rotate: 5deg;
  }

  65% {
    translate: calc(var(--from-x) * 0.08) calc(var(--from-y) * 0.08 - 40%);
    scale: 0.96 1.06;
    rotate: 8deg;
  }

  68% {
    translate: 0 0;
    scale: 1.18 0.78;
    rotate: 0deg;
    animation-timing-function: ease-out;
  }

  76% {
    translate: 0 0;
    scale: 0.94 1.06;
  }

  86% {
    scale: 1.03 0.97;
  }

  100% {
    translate: 0 0;
    scale: 1;
    opacity: 1;
  }
}

@keyframes hop {
  to {
    translate: 0 -6%;
  }
}

/* ─── Arrivals ────────────────────────────────────────────────────────── */
/* A `[data-reveal]` block arrives part by part as it is scrolled to: its children rise in turn
   (`--i`, from home.js), and a heading in it rises a word at a time (`.w`, `--w`). */
.js [data-reveal] > :not(.split),
.js [data-reveal] .w {
  transition:
    opacity 800ms var(--ease),
    translate 800ms var(--ease);
  transition-delay: calc(var(--i, 0) * 110ms + var(--w, 0) * 45ms);
}

.js [data-reveal]:not(.in) > :not(.split) {
  opacity: 0;
  translate: 0 var(--s6);
}

.js [data-reveal]:not(.in) .w {
  opacity: 0;
  translate: 0 0.45em;
}

.w {
  display: inline-block;
}

/* A painting opens from a smaller frame as it comes up the screen (`--p`) */
.js .row-art,
.js .wide-art {
  clip-path: inset(
    calc((1 - var(--p, 1)) * 10%) calc((1 - var(--p, 1)) * 7%) round var(--r-md)
  );
}

/* Drawn by the scroll: `--p` (home.js) runs 0 → 1 as the nearest `[data-progress]` comes up the
   screen, so a product shot rises and settles while it is being looked at. */
.js .lift {
  translate: 0 calc((1 - var(--p, 1)) * var(--rise, 96px));
  scale: calc(0.94 + 0.06 * var(--p, 1));
  opacity: clamp(0, calc(var(--p, 1) * 1.6 - 0.2), 1);
}

/* From the hero to Recap, one move on the same dusk painting. The hero's window drifts up and
   back as the hero leaves (`--out`); then Recap's painting opens from a smaller card to its full
   size and the app tilts up into it, like a lid opening, and settles (`--pe`, eased). */
.js .hero-copy {
  translate: 0 calc(var(--out, 0) * -64px);
  opacity: calc(1 - var(--out, 0) * 1.4);
}

.js .hero-window {
  translate: 0 calc(var(--out, 0) * -120px);
  scale: calc(1 - var(--out, 0) * 0.06);
}

.js .recap-stage {
  clip-path: inset(
    calc((1 - var(--pe, 1)) * 9%) calc((1 - var(--pe, 1)) * 12%) calc((1 - var(--pe, 1)) * 9%)
      calc((1 - var(--pe, 1)) * 12%) round var(--r-md)
  );
}

.js .recap-shot {
  transform-origin: 50% 100%;
  transform: perspective(1800px) rotateX(calc((1 - var(--pe, 1)) * 22deg));
  translate: 0 calc((1 - var(--pe, 1)) * 140px);
  scale: calc(0.9 + var(--pe, 1) * 0.1);
  opacity: clamp(0, calc(var(--p, 1) * 5 - 0.2), 1);
}

/* The step's card lands last, once the screen has */
.js .rf.now {
  opacity: clamp(0, calc(var(--p, 1) * 5 - 4), 1);
}

.js .recap-steps {
  translate: 0 calc((1 - var(--pe, 1)) * 48px);
  opacity: clamp(0, calc(var(--p, 1) * 1.8 - 0.4), 1);
}

/* ─── Tablet ──────────────────────────────────────────────────────────── */
@media (width <= 1100px) {
  :root {
    --chapter: 72px;
    --chapter-lh: 72px;
    --display: 72px;
    --display-lh: 70px;
  }

  .hero {
    grid-template-columns: 1fr;
    gap: var(--s8);
    min-height: 0;
    padding: 136px 0 var(--s8);
  }

  .hero-copy {
    padding: 0 var(--gutter);
  }

  .hero-art {
    height: 560px;
    margin-left: var(--gutter);
  }

  .row,
  .row.flip {
    grid-template-columns: 1fr;
    gap: var(--s6);
  }

  .row.flip .row-copy {
    order: 0;
  }

  /* A crop wider than its painting runs off the screen's edge, as the hero's does, rather than
     stopping mid-word inside a rounded card */
  .art:has(> .lines, > .answer, > .use-shot, > .picker) {
    margin-right: calc(-1 * var(--gutter));
    border-radius: var(--r-md) 0 0 var(--r-md);
  }

  /* With no margin beside the page, the two panels sit inside the painting, not off the screen */
  .card {
    width: 320px;
  }

  .card-ask {
    left: var(--s4);
  }

  .card-comments {
    right: var(--s4);
  }
}

/* ─── Phone ───────────────────────────────────────────────────────────── */
@media (width <= 720px) {
  :root {
    --section: var(--s9);
    --chapter: 48px;
    --chapter-lh: 50px;
    --display: 48px;
    --display-lh: 48px;
    --h2: 36px;
    --h2-lh: 40px;
    --h3: 30px;
    --h3-lh: 34px;
    --lede: 19px;
    --lede-lh: 28px;
  }

  .nav nav {
    display: none;
  }

  .nav-in {
    justify-content: space-between;
  }

  /* Scrolled, the bar spans the screen: on a phone a capsule leaves the page showing round its
     ends and above it. The padding keeps the mark and the button where they were. */
  .scrolled .nav {
    padding: 0;
  }

  .scrolled .nav-in {
    height: 56px;
    padding: 0 calc(var(--gutter) + var(--s2)) 0 calc(var(--gutter) + var(--s4));
    border-radius: 0;
    box-shadow: 0 1px 0 rgb(22 22 26 / 8%);
  }

  .hero-art {
    height: 400px;
  }

  .hero-window {
    left: 20px;
    top: 32px;
    width: 860px;
  }

  .float {
    display: none;
  }

  .works-in {
    flex-direction: column;
    align-items: flex-start;
  }

  .recap-stage {
    height: 420px;
  }

  .recap-shot {
    top: var(--s5);
    left: var(--s3);
    width: 360px;
  }

  .metrics {
    grid-template-columns: 1fr;
    margin-top: var(--s8);
  }

  .big {
    font-size: 80px;
    line-height: 80px;
  }

  .row-art {
    height: 380px;
  }

  .sheet {
    width: 320px;
    margin-left: -160px;
    top: 32px;
  }

  .lines {
    left: 16px;
    top: 32px;
    width: 680px;
  }

  .popover {
    width: 300px;
    margin-left: -150px;
    top: 32px;
  }

  .wide-art {
    height: 340px;
  }

  .answer {
    left: 16px;
    top: 32px;
    width: 860px;
  }

  .share-orbit {
    display: grid;
    gap: var(--s4);
    padding: var(--s5) var(--s4);
  }

  .card {
    position: static;
    width: 100%;
    translate: none;
  }

  .phone-stage {
    width: 100%;
    height: 620px;
  }

  .solo {
    width: 260px;
  }

  .goodbye {
    height: 600px;
  }


  .goodbye-window {
    left: var(--gutter);
    margin-left: 0;
    top: 64px;
    padding: var(--s4) var(--s5) 0;
  }

  .goodbye-window h2 {
    margin-top: var(--s7);
  }

  .close h2 {
    font-size: 44px;
    line-height: 46px;
  }

}

@media (prefers-reduced-motion: reduce) {
  .rise,
  .hero-window,
  .float > *,
  .dot,
  .perched,
  .eye,
  .face-echo {
    animation: none;
  }

  html {
    scroll-behavior: auto;
  }
}
