/* The walkthrough: one dinner through the app, pinned while you scroll.
   landing.js sets --e (0 to 1) as the stage arrives, which tips the frame
   from a tilted card flat and full-bleed, and moves data-step from 1 to 4
   through the rest of the track; everything marked data-at the current step
   gets .on, earlier ones .past. Without the script the stage sits flat on
   step 1 and the track is one screen tall. Inside the phone every size is in
   em, and the phone's font-size follows the stage's height, so the whole
   drawing scales as one. */
.walk { --e: 1; }
.walk-intro {
  max-width: var(--measure);
  margin: 0 auto;
  padding: 48px 0 40px;
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr);
  align-items: end;
  gap: 20px 56px;
}
.walk-intro h2 {
  font-size: clamp(40px, 5.6vw, 76px);
  line-height: 1;
  font-weight: 800;
  letter-spacing: -0.02em;
  text-wrap: balance;
}
.walk-intro p { margin: 0; max-width: 22em; font-size: clamp(17px, 1.4vw, 20px); color: var(--ink-secondary); }

.walk.is-live .walk-track { height: 440vh; }
.walk-stage {
  position: relative;
  height: 100svh;
  min-height: 560px;
  perspective: 1400px;
  container-type: size;
}
.walk.is-live .walk-stage { position: sticky; top: 0; }
.walk-frame {
  position: absolute;
  inset: 10px;
  overflow: hidden;
  border-radius: calc(40px - 16px * var(--e));
  background: var(--jade-wash);
  color: var(--ink);
  transform-origin: 50% 0;
  transform:
    translateY(calc((1 - var(--e)) * 7vh))
    scale(calc(0.84 + 0.16 * var(--e)))
    rotateX(calc((1 - var(--e)) * 24deg));
}
.walk-scene {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
}

/* The step's word, set huge and faint behind the phone. */
.walk-words {
  position: absolute;
  inset: 0;
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  place-items: center;
  pointer-events: none;
}
.walk-words li {
  grid-area: 1 / 1;
  font-family: inherit;
  font-weight: 800;
  font-size: 19cqw;
  line-height: 1;
  letter-spacing: -0.03em;
  color: var(--jade-edge);
  opacity: 0;
  transform: translateY(12%);
  transition: opacity 0.5s ease, transform 0.8s cubic-bezier(0.2, 0.7, 0.2, 1);
}
.walk-words li.past { transform: translateY(-12%); }
.walk-words li.on { opacity: 1; transform: none; }

/* The phone. 18.75em x 38.75em is 300 x 620 at 16px. */
.phone-wrap {
  position: relative;
  font-size: min(18px, 1.72cqh);
  transform: translateY(calc((1 - var(--e)) * 3em));
}
.phone {
  width: 18.75em;
  height: 38.75em;
  padding: 0.5em;
  border-radius: 2.9em;
  background: var(--bezel);
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--soft) 16%, transparent), 0 2em 4em rgba(0, 0, 0, 0.12);
}
.phone-screen {
  position: relative;
  height: 100%;
  overflow: hidden;
  border-radius: 2.4em;
  background: var(--canvas);
  color: var(--ink);
}
.phone-status {
  height: 2.9em;
  padding: 0 1.9em;
  display: flex;
  align-items: center;
  font-size: 0.8em;
  font-weight: 700;
}
.island {
  position: absolute;
  top: 0.7em;
  left: 50%;
  width: 6.4em;
  height: 1.9em;
  margin-left: -3.2em;
  border-radius: 1em;
  background: var(--bezel);
}
.screen {
  position: absolute;
  inset: 3em 1.1em 1em;
  opacity: 0;
  transform: translateY(2.5em) scale(0.97);
  transition: opacity 0.45s ease, transform 0.6s cubic-bezier(0.2, 0.7, 0.2, 1);
}
.screen.past { transform: translateY(-2.5em) scale(0.97); }
.screen.on { opacity: 1; transform: none; }
.screen p { margin: 0; }
.screen img { border-radius: 0.9em; object-fit: cover; }
.bar {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  height: 2.4em;
  margin-bottom: 0.8em;
  font-size: 0.85em;
  color: var(--ink-secondary);
}
.bar b { color: var(--ink); font-weight: 700; }
.bar > :last-child { justify-self: end; }
.bar-pill { padding: 0.35em 0.9em; border-radius: 1em; background: var(--action); color: var(--on-action); font-weight: 700; }
.bar-title { grid-column: 1 / -1; font-family: inherit; font-size: 1.6em; }
.bar-back { font-size: 1.5em; color: var(--ink); }
.face {
  flex-shrink: 0;
  width: 2em;
  height: 2em;
  border-radius: 50%;
  display: inline-grid;
  place-items: center;
  background: var(--band);
  color: var(--ink);
  font-size: 0.85em;
  font-style: normal;
  font-weight: 700;
}
.face.t { background: var(--soft); }
.face.s { background: var(--jade-edge); }

/* 1 · Cook: New post. */
.cook-photo { width: 100%; aspect-ratio: 1; }
.s-cook .cook-photo { transform: scale(0.9) rotate(-2deg); transition: transform 0.7s cubic-bezier(0.2, 0.8, 0.2, 1.2) 0.1s; }
.s-cook.on .cook-photo { transform: none; }
.screen .cook-title { margin-top: 0.8em; font-weight: 700; }
.screen .cook-note { color: var(--ink-secondary); font-size: 0.9em; }
.rows { list-style: none; margin: 0.8em 0 0; padding: 0; font-size: 0.85em; }
.rows li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 2.6em;
  border-top: 1px solid var(--divider);
  opacity: 0;
  transform: translateX(1em);
  transition: opacity 0.4s ease, transform 0.4s ease;
}
.rows li span:first-child { color: var(--ink-secondary); }
.s-cook.on .rows li { opacity: 1; transform: none; }
.s-cook.on .rows li:nth-child(1) { transition-delay: 0.35s; }
.s-cook.on .rows li:nth-child(2) { transition-delay: 0.45s; }
.s-cook.on .rows li:nth-child(3) { transition-delay: 0.55s; }

/* 2 · Remember: the diary. */
.cal-head { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 0.6em; }
.cal-head b { font-family: inherit; font-size: 1.1em; }
.cal-head span { font-size: 0.75em; color: var(--ink-secondary); }
.cal { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 0.28em; }
.cal-names li { font-size: 0.62em; font-weight: 700; text-align: center; color: var(--ink-tertiary); padding-bottom: 0.3em; }
.cal-days li { aspect-ratio: 1; display: grid; place-items: center; font-size: 0.68em; color: var(--ink-secondary); border-radius: 0.6em; }
.cal-days .later { opacity: 0.45; }
.cal-days .c img { width: 100%; height: 100%; border-radius: 0.55em; }
.cal-days .today { outline: 0.14em solid var(--ink); outline-offset: 0.12em; }
.s-diary .today img { transform: scale(0); transition: transform 0.55s cubic-bezier(0.3, 1.6, 0.5, 1) 0.45s; }
.s-diary.on .today img { transform: none; }
.today-row {
  display: flex;
  align-items: center;
  gap: 0.7em;
  margin-top: 1em;
  padding: 0.6em;
  border-radius: 1em;
  background: var(--soft);
  border: 1px solid var(--divider);
}
.today-row img { width: 3em; height: 3em; border-radius: 0.6em; }
.today-row p { display: flex; flex-direction: column; font-size: 0.85em; line-height: 1.3; }
.today-row span { color: var(--ink-secondary); }

/* 3 · Improve: next time, and the ranking question. */
.improve-photo { width: 100%; height: 9.5em; }
.screen .improve-meta { font-size: 0.78em; color: var(--ink-secondary); margin-top: 0.5em; }
.note {
  margin-top: 0.7em;
  padding: 0.7em 0.9em;
  border-radius: 1em;
  background: var(--soft);
  border: 1px solid var(--divider);
}
.note b { font-size: 0.8em; }
.note p {
  font-family: inherit;
  font-style: normal;
  font-size: 1.25em;
  clip-path: inset(0 100% 0 0);
  transition: clip-path 0.9s steps(22, end) 0.35s;
}
.s-improve.on .note p { clip-path: inset(0 0 0 0); }
.pair { margin-top: 0.8em; }
.screen .pair > p { font-family: inherit; font-weight: 700; font-size: 1em; margin-bottom: 0.5em; }
.pair-row { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 0.4em; }
.pair-row > i {
  width: 1.9em;
  height: 1.9em;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--ink);
  color: var(--canvas);
  font-size: 0.72em;
  font-style: normal;
  font-weight: 700;
}
.pick img { width: 100%; aspect-ratio: 1; border-radius: 0.8em; transition: box-shadow 0.3s ease 1.1s; }
.pick em { display: block; font-style: normal; font-weight: 600; font-size: 0.72em; margin-top: 0.3em; }
.s-improve.on .pick.win img { box-shadow: 0 0 0 0.22em var(--jade-edge); }

/* 4 · Share: the post on a friend's Home. */
.share-head { display: flex; align-items: center; gap: 0.6em; margin-bottom: 0.7em; }
.share-head p { font-size: 0.85em; color: var(--ink-secondary); }
.share-head b { color: var(--ink); font-weight: 600; }
.share-photo { width: 100%; aspect-ratio: 4 / 4.4; }
.acts { display: flex; gap: 1.2em; margin-top: 0.7em; }
.acts span { display: inline-flex; align-items: center; gap: 0.35em; font-variant-numeric: tabular-nums; }
.acts svg { width: 1.4em; height: 1.4em; fill: none; stroke: var(--ink); stroke-width: 1.8; stroke-linejoin: round; }
.acts .yum svg { transition: fill 0.2s ease 0.5s, transform 0.4s cubic-bezier(0.3, 1.8, 0.5, 1) 0.5s; }
.s-share.on .yum svg { fill: var(--yum); stroke: var(--yum); transform: scale(1.12); }
.screen .share-line { font-size: 0.78em; color: var(--ink-secondary); margin-top: 0.3em; }

/* The cards that step out of the phone. */
.float {
  position: absolute;
  z-index: 2;
  margin: 0;
  background: var(--soft);
  color: var(--ink);
  border-radius: 1.1em;
  box-shadow: 0 1.2em 2.6em rgba(0, 0, 0, 0.10);
  opacity: 0;
  transition: opacity 0.4s ease, transform 0.6s cubic-bezier(0.2, 0.8, 0.2, 1.1);
}
.float.on { opacity: 1; transform: none; }
.float-memory {
  top: 9em;
  right: -12.5em;
  width: 12em;
  padding: 0.6em;
  transform: translate(3em, 1em) rotate(6deg);
  transition-delay: 0.25s;
}
.float-memory.on { transform: rotate(3deg); }
.float-memory img { width: 100%; aspect-ratio: 1.3; border-radius: 0.7em; object-fit: cover; }
.float-memory p { display: flex; flex-direction: column; margin: 0.5em 0.2em 0.1em; font-size: 0.82em; line-height: 1.3; }
.float-memory span { color: var(--ink-secondary); }
.float-order {
  list-style: none;
  counter-reset: place;
  top: 14em;
  left: -13em;
  width: 13em;
  padding: 0.5em;
  font-size: 0.9em;
  transform: translate(-3em, 1em) rotate(-5deg);
  transition-delay: 0.2s;
}
.float-order.on { transform: rotate(-3deg); }
.float-order li {
  counter-increment: place;
  display: grid;
  grid-template-columns: 1.2em 2.2em 1fr;
  align-items: center;
  gap: 0.5em;
  padding: 0.35em 0.4em;
  border-radius: 0.6em;
  font-weight: 600;
  font-size: 0.85em;
}
.float-order li::before { content: counter(place); font-family: inherit; font-weight: 700; text-align: center; }
.float-order img { width: 2.2em; height: 2.2em; border-radius: 0.45em; object-fit: cover; }
.float-order .new { background: var(--jade-edge); transform: translateY(2.6em); opacity: 0; transition: transform 0.5s cubic-bezier(0.2, 0.8, 0.2, 1.1) 0.9s, opacity 0.3s ease 0.9s; }
.float-order.on .new { transform: none; opacity: 1; }
.float-reply {
  display: flex;
  align-items: center;
  gap: 0.6em;
  padding: 0.6em 1em 0.6em 0.6em;
  border-radius: 1.6em;
  white-space: nowrap;
  font-size: 0.9em;
}
.float-reply p { margin: 0; }
.float-reply b { margin-right: 0.3em; }
.float-reply.r1 { top: 20em; right: -10em; transform: translate(2em, 1em); transition-delay: 0.7s; }
.float-reply.r2 { top: 24em; right: -12.5em; transform: translate(2em, 1em); transition-delay: 1.1s; }

/* The step card, bottom left, like a caption under a picture. */
.walk-caption {
  position: absolute;
  left: clamp(16px, 4vw, 48px);
  bottom: clamp(16px, 5cqh, 48px);
  width: min(390px, calc(100% - 32px));
  opacity: calc(var(--e) * 2 - 1);
}
.walk-steps { list-style: none; margin: 0; padding: 0; display: grid; }
.walk-steps li {
  grid-area: 1 / 1;
  padding: 18px 20px 20px;
  border-radius: 18px;
  background: var(--canvas);
  border: 1px solid var(--divider);
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 0.35s ease, transform 0.45s ease;
}
.walk-steps li.on { opacity: 1; transform: none; }
.walk-steps h3 {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 6px;
  font-family: inherit;
  font-size: 26px;
  font-weight: 700;
  letter-spacing: -0.01em;
}
.walk-steps h3 svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.walk-steps p { margin: 0; font-size: 15px; line-height: 1.5; color: var(--ink-secondary); }
.walk-count {
  position: absolute;
  top: 22px;
  right: 20px;
  margin: 0;
  font-size: 13px;
  font-variant-numeric: tabular-nums;
  color: var(--ink-secondary);
}
.walk-nav { display: flex; align-items: center; justify-content: space-between; margin-top: 12px; }
.walk-arrow {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  border: 1px solid var(--control-outline);
  background: none;
  color: var(--ink);
  cursor: pointer;
}
.walk-arrow:disabled { opacity: 0.3; cursor: default; }
.walk-arrow:focus-visible { outline-color: var(--ink); }
.walk-arrow svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.walk-dots { display: flex; gap: 8px; }
.walk-dots i { width: 7px; height: 7px; border-radius: 50%; background: var(--control-outline); transition: background 0.3s ease, width 0.3s ease; }
.walk-dots i.on { width: 22px; border-radius: 4px; background: var(--jade-ink); }

/* The original story flow, with the redesigned homepage's light surfaces. */
.walk { padding-bottom: 64px; scroll-margin-top: 24px; }
.walk-nav { display: none; }
.walk.is-live .walk-nav { display: flex; }
.walk:not(.is-live) .walk-caption { position: static; width: auto; padding: 24px; }
.walk:not(.is-live) .walk-stage { height: auto; container-type: normal; }
.walk:not(.is-live) .walk-frame { position: relative; }
.walk:not(.is-live) .walk-scene { position: relative; padding: 40px 0; }
.walk:not(.is-live) .phone-wrap { font-size: 14px; }
.walk:not(.is-live) .walk-words, .walk:not(.is-live) .walk-count { display: none; }
.walk:not(.is-live) .walk-steps { gap: 12px; }
.walk:not(.is-live) .walk-steps li { grid-area: auto; opacity: 1; transform: none; }
@media (min-width: 761px) {
  .walk-scene { padding-left: 32%; }
  .walk-caption { width: min(360px, 38%); }
  .float-memory { right: -7em; }
  .float-order { left: -7em; }
  .float-reply.r1 { right: -4em; }
  .float-reply.r2 { right: -5em; }
}
@media (max-width: 760px) {
  .walk-intro { grid-template-columns: 1fr; padding: 30px 0; gap: 18px; }
  .walk-intro h2 { font-size: 36px; }
  .walk-intro p { font-size: 16px; }
  .walk-stage { min-height: 700px; }
  .walk-frame { inset: 0; }
  .walk-scene { place-items: start center; padding-top: 3cqh; }
  .phone-wrap { font-size: min(14px, 1.20cqh); }
  .walk-caption { left: 12px; right: 12px; bottom: 12px; width: auto; }
  .walk-steps li { padding: 14px 16px 16px; }
  .walk-steps h3 { font-size: 22px; padding-right: 40px; }
  .walk-steps p { font-size: 13px; }
  .walk-count { top: 18px; right: 16px; }
  .walk-nav { margin-top: 8px; }
  .walk-arrow { width: 44px; height: 44px; }
  .float-memory { right: -4em; top: 7em; width: 10em; }
  .float-order { left: -4em; top: 13em; }
  .float-reply.r1 { right: -2em; }
  .float-reply.r2 { right: -3em; }
}
/* A short or zoomed viewport uses ordinary flow so every control is reachable. */
@media (max-height: 699px) {
  .walk.is-live .walk-track { height: auto; }
  .walk.is-live .walk-stage { position: relative; min-height: 760px; }
  .walk-caption { width: auto; left: 16px; right: 16px; bottom: 16px; }
  .walk-scene { padding: 24px 0 0; place-items: start center; }
  .phone-wrap { font-size: 11px; }
}
