/*
 * The Al Dente landing page. Tokens are copied from src/ui/theme.ts; keep
 * them in step with the app. See DESIGN.md for what each colour means.
 *
 * Fonts are Latin subsets of assets/fonts (Google Sans Flex Rounded, OFL),
 * made with: pyftsubset <ttf> --unicodes="U+0020-007E,U+00A0-00FF,
 * U+2013-2014,U+2018-201A,U+201C-201E,U+2022,U+2026,U+2039-203A,U+20AC,
 * U+2212" --layout-features='kern,liga,calt,tnum,lnum,case,ccmp,locl,mark,mkmk'
 * --flavor=woff2
 *
 * img/ holds WebP copies of public/art, smaller for the page:
 *   cwebp -q 80 -alpha_q 90 [-resize 256 0 for ingredients] <png> -o img/<name>.webp
 * screens/ holds app screenshots at 390 × 844, 2x, made the same way.
 */

@font-face {
  font-family: "AlDenteDisplay";
  src: url("/fonts/GoogleSansFlexRounded-Display.woff2") format("woff2");
  font-display: swap;
}
@font-face {
  font-family: "AlDenteHeading";
  src: url("/fonts/GoogleSansFlexRounded-Heading.woff2") format("woff2");
  font-display: swap;
}

:root {
  color-scheme: light dark;
  --flour: #FFFCF5;
  --cream: #FFF8EA;
  --ink: #2A1A0E;
  --ink2: #6B5640;
  --rule: rgba(42, 26, 14, 0.10);
  --action: #2A1A0E;
  --on-action: #FFF8EA;
  --action-lip: #0E0804;
  --float: 0 16px 28px -14px rgba(42, 26, 14, 0.5);
  --object: 0 1px 1px rgba(80, 50, 10, 0.10), 0 14px 26px -14px rgba(80, 50, 10, 0.50), inset 0 -3px 0 rgba(80, 50, 10, 0.09);

  /* The gingham tablecloth, as in src/ui/Gingham.tsx: solid red where the
     red threads cross, a half tone where one runs, white where none do,
     with a faint weave on top. */
  --check: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='32' height='32'%3E%3Crect width='32' height='32' fill='%23FFFFFF'/%3E%3Crect x='16' width='16' height='16' fill='%23EE7F80'/%3E%3Crect y='16' width='16' height='16' fill='%23EE7F80'/%3E%3Crect width='16' height='16' fill='%23DC2B31'/%3E%3C/svg%3E");
  --weave: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='3' height='3'%3E%3Crect width='3' height='1' fill='%23FFFFFF' opacity='0.16'/%3E%3Crect width='1' height='3' fill='%23000000' opacity='0.06'/%3E%3C/svg%3E");

  /* The sauces, as in src/ui/theme.ts (worlds). */
  --red: #EF5A3C;
  --gold: #F5C542;
  --green: #7DBA52;
  --pepe: #34302B;

  --edge: 20px;
  /* One vertical rhythm: between sections, between a title and what it
     introduces, and between rows that belong together. */
  --space-section: 88px;
  --space-title: 32px;
  --space-row: 28px;
  --top: 64px;
  --ease: cubic-bezier(0.32, 0.72, 0, 1);
  --ease-out: cubic-bezier(0.23, 1, 0.32, 1);
  --ease-in: cubic-bezier(0.55, 0, 1, 0.45);
  /* Overshoot, kept for the plates and Tito: rare moments, not controls. */
  --pop: cubic-bezier(0.34, 1.56, 0.64, 1);
  --ui: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

@media (prefers-color-scheme: dark) {
  :root {
    --flour: #17120D;
    --cream: #2A1D10;
    --ink: #FFF3E2;
    --ink2: #C9B7A0;
    --rule: rgba(255, 243, 226, 0.12);
    --action: #FFF3E2;
    --on-action: #2A1A0E;
    --action-lip: #BFAF98;
    --float: 0 16px 28px -14px rgba(0, 0, 0, 0.7);
    --object: 0 1px 1px rgba(0, 0, 0, 0.4), 0 18px 30px -14px rgba(0, 0, 0, 0.7), inset 0 -3px 0 rgba(0, 0, 0, 0.25);
    /* The cloth is a little dimmer at night so it doesn't glare. */
    --check: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='32' height='32'%3E%3Crect width='32' height='32' fill='%23E9E1D6'/%3E%3Crect x='16' width='16' height='16' fill='%23D46A68'/%3E%3Crect y='16' width='16' height='16' fill='%23D46A68'/%3E%3Crect width='16' height='16' fill='%23C42A2E'/%3E%3C/svg%3E");
  }
}

/* Base */

*, *::before, *::after { box-sizing: border-box; }
/* No transition on the root: it only shows past the page's ends, and the
   browser keeps a colour from part-way through a fade there, a band a
   shade off the hero (landing.js sets it). */
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; background: var(--flour); }
body {
  margin: 0;
  background: var(--flour);
  color: var(--ink);
  font: 400 17px/1.5 var(--ui);
  letter-spacing: -0.01em;
  -webkit-font-smoothing: antialiased;
  overflow-x: clip;
}
img { display: block; max-width: 100%; height: auto; }
p { margin: 0; }
ol, ul { margin: 0; padding: 0; list-style: none; }
h1, h2 {
  margin: 0;
  font-family: "AlDenteDisplay", var(--ui);
  font-weight: 400;
  text-wrap: balance;
}
h2 { font-size: 44px; line-height: 1.02; letter-spacing: -0.035em; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; -webkit-tap-highlight-color: transparent; }

a { color: inherit; }
:focus-visible { outline: 3px solid currentColor; outline-offset: 3px; border-radius: 8px; }

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

.wrap {
  width: 100%;
  max-width: 1160px;
  margin-inline: auto;
  padding-inline: max(var(--edge), env(safe-area-inset-left)) max(var(--edge), env(safe-area-inset-right));
}

/* The primary button: a pill with a lower lip that compresses when pressed. */
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 60px;
  padding: 0 34px;
  margin-bottom: 4px;
  border-radius: 999px;
  background: var(--action);
  color: var(--on-action);
  font: 400 20px/1 "AlDenteDisplay", var(--ui);
  letter-spacing: -0.01em;
  text-decoration: none;
  white-space: nowrap;
  box-shadow: 0 4px 0 var(--action-lip), var(--float);
  transition: transform 160ms var(--ease-out), box-shadow 160ms var(--ease-out), background-color 700ms var(--ease), color 700ms var(--ease);
}
.button:active { transform: translateY(3px); box-shadow: 0 1px 0 var(--action-lip); }
.button:focus-visible { border-radius: 999px; outline-offset: 5px; }
@media (hover: hover) and (pointer: fine) {
  .button:hover { transform: translateY(-1px); }
  .button:active { transform: translateY(3px); }
}

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

/* The sauce on the table sets the colours, light and dark, as in the app. */
.hero { --field: var(--gold); --on: #2A1A0E; --soft: rgba(42, 26, 14, 0.09); }
.hero[data-sauce="red"] { --field: var(--red); --soft: rgba(255, 248, 234, 0.28); }
.hero[data-sauce="green"] { --field: var(--green); --soft: rgba(42, 26, 14, 0.10); }
.hero[data-sauce="pepe"] { --field: var(--pepe); --on: #FFF8EA; --soft: rgba(255, 248, 234, 0.12); }
@media (prefers-color-scheme: dark) {
  .hero { --field: #7A4C08; --on: #FFF3E2; --soft: rgba(255, 243, 226, 0.12); }
  .hero[data-sauce="red"] { --field: #4A1A10; }
  .hero[data-sauce="green"] { --field: #1E3512; }
  .hero[data-sauce="pepe"] { --field: #141210; }
}

.hero {
  display: flex;
  flex-direction: column;
  min-height: 100svh;
  overflow-x: clip;
  background: var(--field);
  color: var(--on);
  transition: background-color 700ms var(--ease), color 700ms var(--ease);
  /* --p is how far the hero has scrolled away, 0 to 1 (landing.js). */
  --p: 0;
}

.top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: calc(var(--top) + env(safe-area-inset-top));
  padding-top: env(safe-area-inset-top);
}
.wordmark {
  font: 400 26px/1 "AlDenteDisplay", var(--ui);
  letter-spacing: -0.03em;
  text-decoration: none;
}
.signin {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  padding: 0 16px;
  border-radius: 999px;
  background: var(--soft);
  font: 600 15px/1 var(--ui);
  text-decoration: none;
  transition: background-color 700ms var(--ease);
}

.hero-in {
  flex: 1;
  display: grid;
  grid-template-rows: auto 1fr auto;
  grid-template-columns: minmax(0, 1fr);
  justify-items: start;
  gap: 8px;
  padding-bottom: max(24px, env(safe-area-inset-bottom));
}

.hero h1 {
  display: grid;
  padding-top: 8px;
  line-height: 0.95;
  letter-spacing: -0.04em;
  translate: 0 calc(var(--p) * -60px);
}
.h1-lead { font-size: 30px; letter-spacing: -0.03em; margin-bottom: 6px; }

/* The dish's name: every name in one cell, so the line never jumps. Letters
   drop in one after another (landing.js wraps them). */
/* Sized so the longest name ("cacio e pepe.", about 6.2em) fits the column. */
.slot { display: grid; font-size: min(60px, 14vw); }
.word { grid-area: 1 / 1; white-space: nowrap; visibility: hidden; }
.word.is-on, .word.is-out { visibility: visible; }
.word > span { display: inline-block; white-space: pre; }
/* The new name waits for the old one to clear. */
.word.is-on > span { animation: letter-in 520ms var(--pop) both; animation-delay: calc(170ms + var(--i) * 22ms); }
.word.is-out > span { animation: letter-out 200ms var(--ease-in) both; animation-delay: calc(var(--i) * 8ms); }
/* The first name is there from the start. */
.word.is-on.first > span { animation: none; }

@keyframes letter-in {
  from { opacity: 0; transform: translateY(0.45em) rotate(8deg); }
}
@keyframes letter-out {
  to { opacity: 0; transform: translateY(-0.35em) rotate(-6deg); }
}

/* The table: a round of tablecloth, the plate on it, what goes in it
   around it, steam on top, and Tito leaning in. */
.stage {
  --size: min(100vw + 16px, 58svh, 480px);
  position: relative;
  align-self: center;
  justify-self: start;
  width: var(--size);
  /* Centred, even when it's wider than the column. */
  margin-inline: calc((100% - var(--size)) / 2);
  aspect-ratio: 1;
  margin-block: 8px;
  border-radius: 50%;
  cursor: pointer;
  -webkit-user-select: none;
  user-select: none;
}
.stage:focus-visible { outline-offset: 10px; border-radius: 50%; }
.mat {
  position: absolute;
  inset: 13%;
  border-radius: 50%;
  background-image: var(--weave), var(--check);
  background-size: 3px 3px, 26px 26px;
  background-position: 0 0, center;
  box-shadow: 0 24px 40px -24px rgba(40, 10, 0, 0.55);
  scale: calc(1 - var(--p) * 0.12);
}
.plate { position: absolute; inset: 0; visibility: hidden; }
.plate.is-on, .plate.is-out { visibility: visible; }
.plate .dish {
  position: absolute;
  left: 4%;
  top: 19%;
  width: 92%;
  filter: drop-shadow(0 16px 14px rgba(60, 20, 5, 0.32));
  rotate: calc(var(--p) * -14deg);
  scale: calc(1 - var(--p) * 0.12);
}
.plate.is-on .dish { animation: plate-in 760ms var(--pop) both; }
.plate.is-out .dish { animation: plate-out 380ms var(--ease-in) both; }
.plate.first .dish, .plate.first .bit { animation: none; }
@keyframes plate-in {
  from { opacity: 0; transform: translateX(55%) rotate(40deg) scale(0.7); }
}
@keyframes plate-out {
  to { opacity: 0; transform: translateX(-55%) rotate(-40deg) scale(0.7); }
}

.bit {
  position: absolute;
  left: var(--x);
  top: var(--y);
  width: 22%;
  rotate: var(--r);
  /* Scrolling away scatters them. */
  translate: calc(var(--dx) * var(--p) * 90px) calc(var(--dy) * var(--p) * 90px);
}
.bit img { filter: drop-shadow(0 8px 8px rgba(60, 20, 5, 0.22)); }
.plate.is-on .bit { animation: bit-in 560ms var(--pop) both; }
.plate.is-on .bit:nth-of-type(2) { animation-delay: 240ms; }
.plate.is-on .bit:nth-of-type(3) { animation-delay: 300ms; }
.plate.is-on .bit:nth-of-type(4) { animation-delay: 360ms; }
.plate.is-on .bit:nth-of-type(5) { animation-delay: 420ms; }
.plate.is-out .bit { animation: bit-out 220ms var(--ease-in) both; }
@keyframes bit-in { from { opacity: 0; transform: scale(0.3) translateY(30%); } }
@keyframes bit-out { to { opacity: 0; transform: scale(0.5); } }

/* Steam off the plate. */
.steam {
  position: absolute;
  z-index: 1;
  left: 33%;
  top: 8%;
  width: 34%;
  height: 34%;
  display: flex;
  justify-content: space-between;
  pointer-events: none;
}
.steam i {
  width: 24%;
  height: 100%;
  opacity: 0;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 60'%3E%3Cpath d='M10 58c-8-8 8-14 0-22s8-14 0-22 4-10 2-12' fill='none' stroke='white' stroke-width='5' stroke-linecap='round'/%3E%3C/svg%3E") center / contain no-repeat;
}

/* Tito, built like the app's rig: the body, and a face drawn on top. */
.tito { position: absolute; display: block; aspect-ratio: 1; }
.tito > img { width: 100%; height: 100%; object-fit: contain; }
.face { position: absolute; left: 25%; top: 36.5%; width: 50%; height: 18%; overflow: visible; }
.face circle { fill: #2B1D14; }
.face .eyes { transform-box: fill-box; transform-origin: center; }
.face .smile { fill: none; stroke: #2B1D14; stroke-width: 3.5; stroke-linecap: round; }
.face .grin { fill: #2B1D14; opacity: 0; }
.tito.excited .smile { opacity: 0; }
.tito.excited .grin { opacity: 1; }

.stage .tito {
  z-index: 2;
  right: -6%;
  bottom: -2%;
  width: 34%;
  rotate: -8deg;
  transform-origin: 50% 90%;
  translate: calc(var(--p) * 60px) calc(var(--p) * 30px);
}
.stage .tito.excited { animation: hop 520ms var(--pop); }
@keyframes hop {
  30% { transform: translateY(-14%) scale(0.96, 1.05); }
}

.hero .button {
  justify-self: stretch;
  background: var(--on);
  color: var(--field);
  box-shadow: 0 4px 0 rgba(0, 0, 0, 0.35), 0 16px 28px -14px rgba(0, 0, 0, 0.45);
}
.hero .button:active { box-shadow: 0 1px 0 rgba(0, 0, 0, 0.35); }

/* ---------------------------------------------------------------- The app */

.show {
  display: grid;
  justify-items: center;
  gap: var(--space-title);
  padding-top: var(--space-section);
  /* --s is how far the section has come into view, 0 to 1 (landing.js). */
  --s: 1;
}

/* On a phone only the current title shows, above the phone. */
.show-list { display: grid; justify-items: center; text-align: center; }
.show-list li { grid-area: 1 / 1; }
.show-item {
  display: grid;
  font: 400 36px/1.05 "AlDenteDisplay", var(--ui);
  letter-spacing: -0.035em;
  text-wrap: balance;
  opacity: 0;
  transform: translateY(12px);
  pointer-events: none;
  transition: opacity 150ms var(--ease-out), transform 150ms var(--ease-out);
}
/* The new title waits for the old one to go. */
.show-item.is-on { opacity: 1; transform: none; pointer-events: auto; transition-duration: 300ms, 400ms; transition-delay: 140ms; }
.show-item .bar { display: none; }

.phone-wrap {
  position: relative;
  display: grid;
  justify-items: center;
  gap: 22px;
  width: min(72vw, 300px);
}
.blob {
  position: absolute;
  top: 8%;
  left: 50%;
  width: 150%;
  aspect-ratio: 1;
  border-radius: 50%;
  background: var(--blob, var(--gold));
  translate: -50% 0;
  scale: calc(0.6 + var(--s) * 0.4);
  transition: background-color 600ms var(--ease);
}
.show[data-screen="1"] { --blob: var(--red); }
.show[data-screen="2"] { --blob: var(--green); }
.show[data-screen="3"] { --blob: var(--red); }
@media (prefers-color-scheme: dark) {
  .blob { opacity: 0.55; }
}
.phone {
  position: relative;
  display: grid;
  width: 100%;
  aspect-ratio: 390 / 844;
  padding: 9px;
  border-radius: 46px;
  background: #1A120B;
  box-shadow: inset 0 0 0 2px #3A2B1F, 0 40px 60px -30px rgba(40, 15, 0, 0.6);
  /* It stands up as it comes into view. */
  translate: 0 calc((1 - var(--s)) * 90px);
  rotate: calc((1 - var(--s)) * -7deg);
}
/* Screens push in from the right, as they do in the app. */
.screen { display: grid; overflow: hidden; border-radius: 37px; background: #FFFCF5; }
.shot {
  grid-area: 1 / 1;
  width: 100%;
  height: 100%;
  object-fit: cover;
  visibility: hidden;
}
.shot.is-on, .shot.is-out { visibility: visible; }
.shot.is-on { z-index: 1; animation: shot-in 620ms var(--ease) both; }
.shot.is-out { animation: shot-out 620ms var(--ease) both; }
.shot.first { animation: none; }
@keyframes shot-in { from { transform: translateX(100%); box-shadow: -12px 0 30px rgba(40, 15, 0, 0.25); } to { box-shadow: -12px 0 30px rgba(40, 15, 0, 0); } }
@keyframes shot-out { to { transform: translateX(-28%); filter: brightness(0.8); } }

/* The bars: the current one fills, and when it's full the next screen comes. */
.ticks { position: relative; display: flex; gap: 6px; }
.ticks i { display: block; width: 28px; height: 5px; border-radius: 3px; background: var(--rule); overflow: hidden; }
.ticks b, .bar i { display: block; height: 100%; border-radius: inherit; background: var(--ink); transform-origin: left; transform: scaleX(0); }
.show [data-on] b, .show-item.is-on .bar i { animation: fill 4.2s linear both; }
.show [data-done] b, .show-item[data-done] .bar i { transform: none; }
.show:not(.playing) [data-on] b, .show:not(.playing) .show-item.is-on .bar i,
.show:has(.phone:hover) [data-on] b, .show:has(.phone:hover) .show-item.is-on .bar i { animation-play-state: paused; }
@keyframes fill { to { transform: scaleX(1); } }

/* ---------------------------------------------------------------- Ready */

/* The app's checks: what ready looks like on cream, what it doesn't on the
   app's wrong-look tint (LookCard in src/ui/Cook.tsx), its words in danger. */
.ready { display: grid; gap: var(--space-title); padding-top: var(--space-section); }
.ready h2 { text-align: center; font-size: 52px; }
.checks { display: grid; gap: 16px; width: 100%; max-width: 520px; justify-self: center; }
.check {
  display: grid;
  grid-template-columns: 1fr 1fr;
  overflow: hidden;
  border-radius: 26px;
  background: var(--cream);
  box-shadow: var(--object);
}
.look { display: grid; justify-items: center; gap: 4px; margin: 0; padding: 16px 12px 20px; }
.look img { width: 100%; max-width: 180px; aspect-ratio: 1; }
.look figcaption { font: 400 19px/1.1 "AlDenteHeading", var(--ui); letter-spacing: -0.015em; }
.look.no { background: #FBE3DB; }
.look.no figcaption { color: #A3301C; }
@media (prefers-color-scheme: dark) {
  .look.no { background: #3A1A12; }
  .look.no figcaption { color: #FF8E78; }
}

/* ---------------------------------------------------------------- Hungry yet? */

/* The belt's top padding leaves room for plates lifted on hover; overflow
   is clipped only sideways. */

/* A dish's own page (site/landing/dish, made by src/logic/dishPage.ts). */
.dish-hero { min-height: 0; padding-bottom: 40px; }
.dish-in { display: grid; gap: 24px; align-items: center; padding-top: 16px; }
.dish-words { display: grid; gap: 20px; justify-items: start; }
.dish-hero h1 { font-size: 48px; line-height: 0.98; letter-spacing: -0.04em; }
.dish-lede { max-width: 560px; font-size: 19px; line-height: 1.45; }
.dish-plate { width: min(100%, 460px); justify-self: center; transform: rotate(-8deg); }
.dish-section { display: grid; gap: var(--space-row); padding-top: var(--space-section); }
.dish-note { max-width: 640px; color: var(--ink2); font-size: 18px; }
.needs { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; }
.needs li { display: flex; align-items: center; gap: 12px; padding: 12px 16px; border-radius: 22px; background: var(--cream); box-shadow: var(--object); }
.needs img { width: 48px; height: 48px; }
.tricky { display: grid; gap: 16px; counter-reset: step; }
.tricky li { display: grid; gap: 6px; padding: 22px 24px; border-radius: 26px; background: var(--cream); }
.tricky h3 { margin: 0; font: 400 26px/1.1 "AlDenteDisplay", var(--ui); letter-spacing: -0.03em; }
.tricky .q { font-weight: 700; }
.dish-last { padding-bottom: var(--space-section); }
@media (min-width: 720px) {
  .dish-hero h1 { font-size: 72px; }
  .tricky { grid-template-columns: 1fr 1fr; }
}
@media (min-width: 960px) {
  .dish-in { grid-template-columns: 1.1fr 1fr; gap: 40px; padding-top: 40px; }
}

.hungry { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--space-title); padding-top: var(--space-section); overflow-x: clip; }
.hungry h2 { text-align: center; font-size: 52px; }
.belt { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--space-row); }
.row { display: flex; width: max-content; }
.row > li { flex: none; }
.dishes > li {
  position: relative;
  display: grid;
  align-content: end;
  width: 168px;
  height: 196px;
  margin-right: 14px;
  padding: 0 16px 16px;
  border-radius: 28px;
  box-shadow: var(--object);
  color: #2A1A0E;
}
.dishes img {
  position: absolute;
  top: 12px;
  left: 50%;
  width: 150px;
  translate: -50% 0;
  filter: drop-shadow(0 10px 10px rgba(60, 20, 5, 0.25));
  transition: transform 500ms var(--pop);
}
.dishes span { font: 400 19px/1.1 "AlDenteHeading", var(--ui); letter-spacing: -0.015em; }
.dishes .red { background: var(--red); }
.dishes .gold { background: var(--gold); }
.dishes .green { background: var(--green); }
.dishes .pepe { background: var(--pepe); color: #FFF8EA; }
@media (hover: hover) and (pointer: fine) {
  .dishes > li:hover img { transform: rotate(-8deg) scale(1.08) translateY(-6px); }
}
.bits > li { width: 64px; margin-right: 34px; }
.bits img { filter: drop-shadow(0 6px 6px rgba(60, 20, 5, 0.18)); }

/* ---------------------------------------------------------------- The water's on */

/* The steam rises above the pot; the extra 40px keeps it off the row above. */
.last { display: grid; padding-top: calc(var(--space-section) + 40px); }
.last-in { display: grid; justify-items: center; gap: 24px; text-align: center; }
.last h2 { font-size: 52px; }
.last .button { margin-top: 4px; }

/* The pot, built like the app's TitoPot: back, Tito, bubbles, front. */
.pot { --u: calc(220px / 240); position: relative; width: 220px; height: calc(210 * var(--u)); margin-bottom: 16px; }
.pot-back, .pot-front { position: absolute; left: 0; top: calc(-16 * var(--u)); width: 100%; }
.pot .tito { left: calc(35 * var(--u)); top: 0; width: calc(170 * var(--u)); }
.pot .steam { left: 34%; top: -22%; width: 32%; height: 26%; }
/* On the cream page white steam would vanish; it takes the ink, faintly. */
.pot .steam i { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 60'%3E%3Cpath d='M10 58c-8-8 8-14 0-22s8-14 0-22 4-10 2-12' fill='none' stroke='%23B9A68E' stroke-width='5' stroke-linecap='round'/%3E%3C/svg%3E"); }
@media (prefers-color-scheme: dark) {
  .pot .steam i { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 60'%3E%3Cpath d='M10 58c-8-8 8-14 0-22s8-14 0-22 4-10 2-12' fill='none' stroke='%236B5A46' stroke-width='5' stroke-linecap='round'/%3E%3C/svg%3E"); }
}
.bubbles i {
  position: absolute;
  top: calc(125 * var(--u));
  width: 8px;
  height: 8px;
  border: 1.5px solid #89B6C9;
  border-radius: 50%;
  background: #D8EBEE;
  opacity: 0;
}
.bubbles i:nth-child(1) { left: 22%; }
.bubbles i:nth-child(2) { left: 36%; width: 10px; height: 10px; }
.bubbles i:nth-child(3) { left: 50%; }
.bubbles i:nth-child(4) { left: 62%; width: 6px; height: 6px; }
.bubbles i:nth-child(5) { left: 72%; width: 10px; height: 10px; }
.bubbles i:nth-child(6) { left: 84%; width: 6px; height: 6px; }

.cloth {
  height: 64px;
  margin-top: calc(var(--space-section) * 0.75);
  background-image: var(--weave), var(--check);
  background-size: 3px 3px, 32px 32px;
  background-position: 0 0, center top;
}

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

.foot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 24px;
  padding-block: 16px max(28px, env(safe-area-inset-bottom));
  color: var(--ink2);
  font-size: 15px;
}
.foot nav { display: flex; gap: 4px 20px; flex-wrap: wrap; }
.foot nav a { display: inline-block; padding-block: 12px; text-underline-offset: 3px; }
.maker { display: flex; align-items: center; gap: 8px; }
.maker img { width: 140px; height: auto; }

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

@media (min-width: 720px) {
  :root { --edge: 32px; --space-section: 112px; --space-title: 44px; --space-row: 36px; }
  .h1-lead { font-size: 40px; }
  .slot { font-size: 88px; }
  .stage { --size: min(100%, 58svh, 620px); }
  .hero .button { justify-self: start; }
  h2, .ready h2, .hungry h2, .last h2 { font-size: 64px; }
  .dishes > li { width: 200px; height: 230px; margin-right: 18px; }
  .dishes img { width: 180px; }
  .bits > li { width: 80px; margin-right: 48px; }
  .pot { --u: calc(280px / 240); width: 280px; }
  .cloth { height: 96px; background-size: 3px 3px, 40px 40px; }
}

/* Side by side: the words and button on the left, the table on the right;
   the titles beside the phone, each with its own bar. */
@media (min-width: 960px) {
  .hero-in {
    grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr);
    grid-template-rows: 1fr auto 1fr;
    column-gap: 40px;
    padding-bottom: 32px;
  }
  .hero h1 { grid-area: 2 / 1; align-self: end; }
  .hero .button { grid-area: 3 / 1; align-self: start; margin-top: 32px; }
  .stage { grid-area: 1 / 2 / 4 / 3; --size: min(100% + 120px, 76svh, 640px); }
  .h1-lead { font-size: 48px; }
  .slot { font-size: clamp(72px, 6vw, 86px); }

  .show {
    grid-template-columns: 1fr auto;
    align-items: center;
    column-gap: 64px;
    padding-top: calc(var(--space-section) + 24px);
  }
  .show-list { justify-items: start; text-align: start; gap: 6px; }
  .show-list li { grid-area: auto; }
  .show-item {
    gap: 14px;
    padding-block: 14px;
    font-size: 48px;
    text-align: start;
    opacity: 0.28;
    transform: none;
    pointer-events: auto;
    transition: opacity 300ms var(--ease-out);
    transition-delay: 0ms;
  }
  .show-item.is-on { opacity: 1; }
  .show-item .bar { display: block; width: 120px; height: 4px; border-radius: 2px; background: var(--rule); overflow: hidden; }
  .ticks { display: none; }
  .phone-wrap { width: 320px; margin-right: 40px; }

  .checks { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 24px; max-width: none; }

  .dishes > li { width: 230px; height: 260px; margin-right: 22px; }
  .dishes img { top: 18px; width: 210px; }
}
@media (min-width: 960px) and (hover: hover) and (pointer: fine) {
  .show-item:not(.is-on):hover { opacity: 0.6; }
}

/* ---------------------------------------------------------------- Motion */

/* Things that keep going. All of it stops when the cook asks for less motion. */
@media (prefers-reduced-motion: no-preference) {
  .steam i { animation: steam 2.8s var(--ease) infinite; }
  .steam i:nth-child(2) { animation-delay: -0.9s; }
  .steam i:nth-child(3) { animation-delay: -1.8s; }
  .bit img { animation: float 3.4s ease-in-out infinite alternate; }
  .bit:nth-of-type(odd) img { animation-duration: 4.1s; animation-delay: -1s; }
  .face .eyes { animation: blink 4.6s infinite; }
  .stage .tito > img, .stage .tito .face { animation: breathe 2.4s ease-in-out infinite alternate; transform-origin: 50% 90%; }

  /* The belt; landing.js speeds it up while you scroll. */
  .dishes { animation: belt 46s linear infinite; }
  .bits { animation: belt 38s linear infinite reverse; }

  /* Tito pops up out of the pot and bobs; the water bubbles. */
  .js .pot .tito { transform: translateY(42%); }
  .pot .tito { transition: transform 760ms var(--pop) 250ms; }
  .js .last.in-view .pot .tito { transform: none; }
  .last.in-view .pot .tito > img, .last.in-view .pot .tito .face { animation: bob 2.2s ease-in-out 1s infinite alternate; }
  .bubbles i { animation: bubble 1.8s var(--ease-out) infinite; }
  .bubbles i:nth-child(2) { animation-delay: -0.3s; }
  .bubbles i:nth-child(3) { animation-delay: -1.1s; }
  .bubbles i:nth-child(4) { animation-delay: -0.7s; }
  .bubbles i:nth-child(5) { animation-delay: -1.5s; }
  .bubbles i:nth-child(6) { animation-delay: -0.5s; }

  /* Things that arrive once, as their section comes into view. */
  [data-reveal] h2, .show-list { transition: opacity 600ms var(--ease-out), translate 700ms var(--ease-out); }
  .js [data-reveal]:not(.in-view) h2, .js [data-reveal]:not(.in-view) .show-list { opacity: 0; translate: 0 24px; }
  .last .button { transition: opacity 600ms var(--ease-out) 150ms, translate 700ms var(--ease-out) 150ms, transform 160ms var(--ease-out), box-shadow 160ms var(--ease-out); }
  .js .last:not(.in-view) .button { opacity: 0; translate: 0 16px; }
  /* The checks deal in one after another. */
  .check { transition: opacity 500ms var(--ease-out), translate 600ms var(--ease-out); }
  .check:nth-child(2) { transition-delay: 90ms; }
  .check:nth-child(3) { transition-delay: 180ms; }
  .js .ready:not(.in-view) .check { opacity: 0; translate: 0 24px; }
}

@keyframes steam {
  0% { opacity: 0; transform: translateY(30%) scaleX(0.8); }
  35% { opacity: 0.9; }
  100% { opacity: 0; transform: translateY(-40%) scaleX(1.2); }
}
@keyframes float { to { transform: translateY(-9%) rotate(5deg); } }
@keyframes blink { 0%, 94%, 100% { transform: scaleY(1); } 96% { transform: scaleY(0.1); } }
@keyframes breathe { to { transform: translateY(-2%) scale(1.012, 0.988); } }
@keyframes bob { to { transform: translateY(-6%) rotate(3deg); } }
@keyframes belt { to { transform: translateX(-50%); } }
@keyframes bubble {
  0% { opacity: 0; transform: translateY(0) scale(0.6); }
  20% { opacity: 1; }
  100% { opacity: 0; transform: translateY(-34px) scale(1.1); }
}

/* Less motion: dishes change with a fade, the screens and the belt stay put
   and scroll by hand, nothing loops. */
@media (prefers-reduced-motion: reduce) {
  .button { transition: none; }
  .hero, .signin, .blob { transition-duration: 0ms; }
  .hero h1, .mat, .plate .dish, .bit, .stage .tito, .phone, .blob { translate: none; rotate: none; scale: none; }
  .stage .tito { rotate: -8deg; }
  .bit { rotate: var(--r); }
  .word.is-on > span, .plate.is-on .dish, .plate.is-on .bit, .shot.is-on { animation: fade-in 200ms linear both; }
  .word.is-out > span, .plate.is-out .dish, .plate.is-out .bit, .shot.is-out { animation: fade-out 150ms linear both; }
  .stage .tito.excited { animation: none; }
  .show-item { transition: opacity 200ms linear; transform: none; }
  .ticks, .show-item .bar { display: none !important; }
  .belt { overflow-x: auto; padding: 8px var(--edge) 16px; scrollbar-width: none; }
  .bits { display: none; }
}
@keyframes fade-in { from { opacity: 0; } }
@keyframes fade-out { to { opacity: 0; } }
