/* Ribbon's site. Everything that moves moves by transform or opacity; shadows are baked into the pictures. */

@font-face { font-family: 'Instrument Serif'; src: url('fonts/serif.woff2') format('woff2'); font-display: swap; }
@font-face { font-family: 'Instrument Serif'; font-style: italic; src: url('fonts/serif-italic.woff2') format('woff2'); font-display: swap; }

:root {
  --paper: #f4eee4;
  --card: #fbf8f2;
  --ink: #1d1813;
  --ink-2: #5f564d;
  --red: #c1121f;
  --red-press: #9e0e19;
  --cream: #fff8f1;
  --serif: 'Instrument Serif', 'Iowan Old Style', Georgia, serif;
  --sans: -apple-system, BlinkMacSystemFont, 'SF Pro Text', system-ui, 'Segoe UI', Roboto, sans-serif;
  --t1: clamp(44px, min(8.4vw, 10.2svh), 108px);
  --t2: clamp(40px, 5.2vw, 84px);
  --t3: clamp(22px, 1.9vw, 28px);
  --t4: 18px;
  --t5: 15px;
  --g: clamp(20px, 5vw, 72px);
  --max: 1240px;
  --out: cubic-bezier(0.22, 1, 0.36, 1);
  --press: cubic-bezier(0.3, 0, 0.2, 1);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 400 var(--t4)/1.5 var(--sans);
  -webkit-font-smoothing: antialiased;
  overflow-x: clip;
}
/* The quieter room, grain baked in: one fixed layer that the page slides over. */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  z-index: -1;
  background: url('img/room.webp') center / cover;
  transform: translateZ(0);
  pointer-events: none;
}
/* Safari on an iPhone sizes a fixed layer to the room between its bars, and paints the strip under the time
   itself, in the page's paper. So the room reaches on under the toolbar, and at the top it lightens into that
   paper, so the strip and the page meet without a line. */
@supports (-webkit-touch-callout: none) {
  body::before {
    inset: -160px 0;
    background: linear-gradient(to bottom, var(--paper) 160px, rgba(244, 238, 228, 0) 280px), url('img/room.webp') center / cover; /* taste-skill-ignore: the room lightening into the strip Safari paints, not a fill */
  }
}
h1, h2, h3, p, ul, ol, figure { margin: 0; padding: 0; }
ul, ol { list-style: none; }
img { display: block; max-width: 100%; height: auto; }
a { color: inherit; }
button { font: inherit; color: inherit; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--red); outline-offset: 3px; border-radius: 6px; }
::selection { background: #f6d6d8; }

h2 { font: 400 var(--t2)/1.02 var(--serif); letter-spacing: -0.02em; text-wrap: balance; }
section p { text-wrap: pretty; }

/* ---------- Buttons: satin that presses, never springs back past itself ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 54px;
  padding: 0 28px;
  border: 0;
  border-radius: 999px;
  font: 600 17px/1 var(--sans);
  text-decoration: none;
  cursor: pointer;
  transition: transform 160ms var(--press), filter 160ms var(--press);
  -webkit-tap-highlight-color: transparent;
}
.btn:active { transform: scale(0.96); }
.btn-satin { color: var(--cream); background: var(--red) url('img/satin.webp') 0 0 / 100% 100%; }
.btn-satin:hover { filter: brightness(1.06); }
.btn-ink { color: var(--cream); background: var(--ink); }
.btn-glass { color: var(--ink); background: rgba(29, 24, 19, 0.08); }
.btn-glass:hover { background: rgba(29, 24, 19, 0.12); }
.btn-small { min-height: 40px; padding: 0 18px; font-size: 15px; }

/* ---------- Header ---------- */
.top {
  position: absolute;
  inset: 0 0 auto;
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: max(18px, env(safe-area-inset-top)) var(--g) 0;
}
.brand { display: inline-flex; align-items: center; gap: 9px; text-decoration: none; font: 400 28px/1 var(--serif); letter-spacing: -0.01em; }
.brand svg { fill: var(--red); }
/* The tabs: the site's own pages in one glass pill, the page you're on raised in it like iOS's segmented control,
   and a softer pill that slides to whichever tab the pointer is over. On a phone the footer carries them. */
.top { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); gap: 20px; }
.top > .btn { justify-self: end; }
.tabs { position: relative; display: flex; padding: 4px; border-radius: 999px; background: rgba(255, 252, 246, 0.66); box-shadow: inset 0 0 0 1px rgba(29, 24, 19, 0.07); } /* taste-skill-ignore: the tab bar's own edge */
.tab { position: relative; z-index: 1; display: block; padding: 10px 16px; border-radius: 999px; font-size: 14.5px; font-weight: 500; line-height: 1; letter-spacing: -0.005em; white-space: nowrap; color: var(--ink-2); text-decoration: none; transition: color 200ms ease, transform 160ms var(--press); -webkit-tap-highlight-color: transparent; }
.tab:hover { color: var(--ink); }
.tab:active { transform: scale(0.96); }
.tab:focus-visible { outline: 2px solid var(--red); outline-offset: 2px; }
.tab[aria-current] { color: var(--ink); font-weight: 600; background: #fffdf8; box-shadow: 0 1px 2px rgba(29, 24, 19, 0.1), 0 6px 16px -8px rgba(29, 24, 19, 0.3); } /* taste-skill-ignore: the selected tab is raised, as a segmented control's is */
.tab-mark { position: absolute; left: 0; top: 4px; bottom: 4px; width: var(--w, 0); border-radius: 999px; background: rgba(255, 255, 255, 0.6); opacity: 0; transform: translateX(var(--x, 0)); transition: transform 420ms var(--out), width 420ms var(--out), opacity 220ms ease; pointer-events: none; }
.tabs.hover .tab-mark { opacity: 1; }
/* The header comes back as a bar whenever you scroll up, and steps away as you read down. */
.top { position: fixed; transition: transform 460ms var(--out), padding 300ms var(--out); }
.top.away { transform: translateY(calc(-100% - 56px)); }
.top.float { padding-top: max(10px, env(safe-area-inset-top)); padding-bottom: 10px; }
/* On a phone the bar is paper, thinning to nothing under it: a blur redrawn under a finger's scroll costs frames. */
.top::before {
  content: '';
  position: absolute;
  inset: 0 0 -40px;
  z-index: -1;
  pointer-events: none;
  background: linear-gradient(to bottom, rgba(244, 238, 228, 0.97) calc(100% - 40px), rgba(244, 238, 228, 0)); /* taste-skill-ignore: the bar's paper thinning out, not a fill */
  opacity: 0;
  transition: opacity 300ms ease;
}
.top.float::before { opacity: 1; }
@media (min-width: 901px) {
  /* The glass has no edge: it runs on under the bar and thins to nothing, blur and paper together. */
  .top::before {
    content: '';
    position: absolute;
    inset: 0 0 -48px;
    z-index: -1;
    pointer-events: none;
    background: linear-gradient(to bottom, rgba(244, 238, 228, 0.86) calc(100% - 48px), rgba(244, 238, 228, 0)); /* taste-skill-ignore: the bar's scrim thinning out, not a fill */
    -webkit-backdrop-filter: blur(18px) saturate(1.25);
    backdrop-filter: blur(18px) saturate(1.25);
    -webkit-mask-image: linear-gradient(to bottom, #000 calc(100% - 48px), transparent); /* taste-skill-ignore: the bar's scrim thinning out, not a fill */
    mask-image: linear-gradient(to bottom, #000 calc(100% - 48px), transparent); /* taste-skill-ignore: the bar's scrim thinning out, not a fill */
  }
}
/* The menu button: phones and small tablets only, where the tabs fold into a card under the header. */
.menu-btn { display: none; }
@media (max-width: 900px) {
  .top { grid-template-columns: minmax(0, 1fr) auto auto; gap: 10px; }
  .menu-btn { display: grid; place-items: center; width: 40px; height: 40px; padding: 0; border: 0; border-radius: 50%; background: rgba(255, 252, 246, 0.72); box-shadow: inset 0 0 0 1px rgba(29, 24, 19, 0.08); color: var(--ink); cursor: pointer; transition: transform 160ms var(--press), background-color 200ms ease; -webkit-tap-highlight-color: transparent; } /* taste-skill-ignore: the tabs' glass edge */
  .menu-btn:active { transform: scale(0.92); }
  .menu-btn svg { width: 18px; height: 18px; }
  .menu-btn line { stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; transition: transform 320ms var(--out); transform-origin: 9px 9px; }
  .top.open .menu-btn line:first-child { transform: translateY(3px) rotate(45deg); }
  .top.open .menu-btn line:last-child { transform: translateY(-3px) rotate(-45deg); }
  .tabs { position: absolute; top: calc(100% + 10px); right: var(--g); width: min(400px, calc(100% - var(--g) * 2)); z-index: 30; flex-direction: column; padding: 8px; border-radius: 24px; background: #fbf8f2; box-shadow: inset 0 0 0 1px rgba(29, 24, 19, 0.06), 0 24px 48px -20px rgba(29, 24, 19, 0.45); opacity: 0; visibility: hidden; transform: translateY(-8px) scale(0.98); transform-origin: top right; transition: opacity 220ms ease, transform 320ms var(--out), visibility 0s linear 320ms; } /* taste-skill-ignore: a menu over the page */
  .top.open .tabs { opacity: 1; visibility: visible; transform: none; transition: opacity 220ms ease, transform 320ms var(--out); }
  .tab { padding: 16px 18px; border-radius: 16px; font-size: 18px; }
  .tab[aria-current] { box-shadow: none; background: var(--paper); } /* taste-skill-ignore: takes the raised tab’s shadow away in the menu */
  .tab-mark { display: none; }
}
@media (prefers-reduced-motion: reduce) { .top, .tab-mark { transition: opacity 200ms ease; } }

/* ---------- The garland ---------- */
.hero {
  position: relative;
  min-height: 100svh;
  display: grid;
  grid-template-rows: auto auto;
  align-content: center;
  padding-top: clamp(60px, 7.5svh, 88px);
  overflow: clip;
}
.garland {
  --tw: clamp(210px, min(max(17vw, calc(33vw - 20px)), 26svh), 260px);
  position: relative;
  height: calc(var(--tw) * 1.41 + clamp(44px, 6svh, 80px));
  touch-action: pan-y;
  cursor: grab;
  user-select: none;
  -webkit-user-select: none;
}
.garland.held { cursor: grabbing; }
.cord { position: absolute; inset: 0; pointer-events: none; z-index: 2; }
.seg { position: absolute; left: 0; top: 0; height: var(--cord-h, 13px); overflow: hidden; transform-origin: 0 50%; }
.seg i {
  position: absolute;
  inset: 0 auto 0 0;
  width: calc(100% + 240px);
  background: url('img/cord.webp') 0 50% / auto 100% repeat-x;
  /* Kept on its own layer even at rest: giving the layers up as the garland stops cost WebKit a 200 ms frame. */
  will-change: transform;
}
.tags { position: absolute; inset: 0; }
.g { position: absolute; left: 0; top: 0; width: var(--tw); will-change: transform; }
.g-swing { position: relative; container-type: inline-size; --u: 0.25907cqw; transform-origin: 50% 3.3%; will-change: transform; }
.g-card { width: 100%; pointer-events: none; -webkit-user-drag: none; }
.g-face { position: absolute; left: 13.47%; right: 13.47%; top: calc(var(--u) * 118); }
.g-to {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: calc(var(--u) * 10);
  font: italic 400 calc(var(--u) * 32)/1 var(--serif);
  color: var(--ink);
}
.g-to img { width: calc(var(--u) * 38); height: calc(var(--u) * 38); border-radius: 50%; }
.g-photo {
  position: relative;
  margin-top: calc(var(--u) * 14);
  aspect-ratio: 282 / 196;
  border-radius: calc(var(--u) * 14);
  overflow: hidden;
  background: #ebe3d6;
}
.g-photo > img { width: 100%; height: 100%; object-fit: cover; -webkit-user-drag: none; }
.g-name { margin-top: calc(var(--u) * 16); font: 400 calc(var(--u) * 29)/1.06 var(--serif); letter-spacing: -0.01em; text-wrap: balance; }
.g-meta { margin-top: calc(var(--u) * 8); font-size: calc(var(--u) * 24); line-height: 1.2; color: var(--ink-2); }

/* A bought gift: its photo dims under a warm paper veil, the stamp comes down, the buyer's sticker lands. */
.g-photo::after {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(244, 238, 228, 0.5);
  opacity: 0;
  transition: opacity 260ms ease;
}
.stamp {
  position: absolute;
  left: 50%;
  top: 50%;
  z-index: 1;
  width: 84%;
  aspect-ratio: 444 / 125;
  background: var(--red);
  -webkit-mask: url('img/stamp.webp') center / contain no-repeat;
  mask: url('img/stamp.webp') center / contain no-repeat;
  opacity: 0;
  transform: translate(-50%, -50%) rotate(-9deg) scale(1.5);
}
.sticker {
  position: absolute;
  z-index: 2;
  display: grid;
  grid-template-columns: auto;
  justify-items: center;
  font: 700 calc(var(--u) * 24)/1 var(--sans);
  color: var(--ink);
  opacity: 0;
  transform: translateY(-10%) scale(0.7);
}
.g-face .sticker { right: calc(var(--u) * -14); top: calc(var(--u) * 40); }
.sticker img {
  grid-row: 1;
  width: calc(var(--u) * 66);
  height: calc(var(--u) * 66);
  border-radius: 50%;
  outline: calc(var(--u) * 5) solid #fff;
}
.sticker.two { grid-template-columns: auto auto; }
.sticker.two img:nth-of-type(1) { grid-column: 1; }
.sticker.two img:nth-of-type(2) { grid-column: 2; margin-left: calc(var(--u) * -18); }
.sticker b {
  grid-column: 1 / -1;
  margin-top: calc(var(--u) * 5);
  padding: 0 0.2em;
  -webkit-text-stroke: 0.32em #fff;
  paint-order: stroke fill;
}
.is-bought .g-photo::after,
.bought .ph::after { opacity: 1; }
.is-bought .stamp,
.bought .stamp { opacity: 0.92; transform: translate(-50%, -50%) rotate(-9deg) scale(1); }
.is-bought .sticker,
.bought .sticker { opacity: 1; transform: none; }
.landing .stamp { transition: opacity 120ms ease-out, transform 260ms cubic-bezier(0.3, 0.7, 0.2, 1); }
.landing .sticker { transition: opacity 200ms ease 340ms, transform 360ms var(--out) 340ms; }

/* Before the script lays the garland on its cord, the tags stand in a row under a straight cord. */
html:not(.js) .cord { inset: 18px 0 auto; height: 13px; background: url('img/cord.webp') 0 50% / auto 100% repeat-x; }
html:not(.js) .tags { display: flex; justify-content: center; gap: 24px; padding-top: 14px; overflow: hidden; }
html:not(.js) .g { position: relative; flex: none; }
html:not(.js) [data-bought-later] { --b: 1; }
html:not(.js) [data-bought-later] .stamp { opacity: 0.92; transform: translate(-50%, -50%) rotate(-9deg); }
html:not(.js) [data-bought-later] .sticker { opacity: 1; transform: none; }
.js .g { visibility: hidden; }
.js .garland.laid .g { visibility: visible; }

.hero-words {
  align-self: center;
  justify-self: center;
  display: grid;
  justify-items: center;
  padding: clamp(4px, 1.5svh, 24px) var(--g) clamp(24px, 5svh, 56px);
  text-align: center;
}
.hero h1 { font: italic 400 var(--t1)/0.98 var(--serif); letter-spacing: -0.025em; }
.ln { display: block; overflow: clip; padding: 0 0.06em 0.08em; margin-bottom: -0.08em; }
.ln > span { display: block; }
.lede { margin-top: clamp(14px, 2.4svh, 22px); max-width: 40ch; font-size: clamp(17px, 1.4vw, 20px); color: var(--ink); }
.act { display: grid; justify-items: center; gap: 12px; margin-top: clamp(20px, 3.4svh, 32px); }
.price { font-size: var(--t5); color: var(--ink-2); }
/* On a computer, the App Store link can't install anything: the QR beside it takes the phone straight there. */
.act-row { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 14px 22px; }
.scan { display: none; align-items: center; gap: 12px; padding: 6px 18px 6px 6px; border-radius: 18px; background: rgba(255, 252, 246, 0.66); box-shadow: inset 0 0 0 1px rgba(29, 24, 19, 0.07); color: var(--ink-2); font-size: 13.5px; line-height: 1.35; text-align: left; text-decoration: none; transition: background-color 200ms ease, transform 160ms var(--press); } /* taste-skill-ignore: the same glass edge as the tabs */
.scan b { display: block; margin-bottom: 1px; font-size: 14px; font-weight: 600; color: var(--ink); }
.scan:hover { background: var(--card); }
.scan:active { transform: scale(0.97); }
.scan .qr { flex: none; width: 56px; height: 56px; padding: 5px; border-radius: 12px; background: #fff; fill: var(--ink); }
/* Only where there's a camera-less screen to scan from: a computer with a pointer. */
@media (hover: hover) and (pointer: fine) and (min-width: 901px) { .scan { display: flex; } }
}

.js .hero h1 .ln > span { transform: translateY(105%); }
.js .hero .lede, .js .hero .act { opacity: 0; transform: translateY(14px); }
.js .hero.on h1 .ln > span { transform: none; transition: transform 1000ms var(--out); }
.js .hero.on h1 .ln + .ln > span { transition-delay: 90ms; }
.js .hero.on .lede, .js .hero.on .act { opacity: 1; transform: none; transition: opacity 700ms ease 260ms, transform 900ms var(--out) 260ms; }
.js .hero.on .act { transition-delay: 360ms; }

/* ---------- Shared chapter frame: each chapter is one screen, its object the biggest thing on it ---------- */
.talk, .add, .know, .buy, .flip, .sides, .papers, .games, .remind, .spend, .price-sec, .faq, .ask {
  position: relative;
  max-width: calc(var(--max) + 2 * var(--g));
  margin: 0 auto;
  padding: clamp(44px, 5vw, 76px) var(--g);
  align-content: center;
  /* A change inside a chapter (a button shown, a sentence rewritten) lays out that chapter alone. */
  contain: layout;
}
.add-words p, .know-words p, .buy-words > p, .flip-words > p, .talk-words p, .ask-words > p,
.sides-words p, .papers-words p, .remind-words > p, .spend-words > p, .price-words > p {
  margin-top: 22px;
  max-width: 38ch;
  font-size: clamp(18px, 1.3vw, 20px);
}

/* ---------- Scenes: a chapter that changes holds still for one beat a state while you scroll (site.js, scenes) ---------- */
/* The run is a spacer, not padding: a sticky box only moves within its parent's content box. Its length is the
   engine's (--run); a chapter already seen has none. */
.pin .scene::after { content: ''; display: block; height: var(--run, 0px); }
.pin .scene > section { position: sticky; top: 0; }
/* The rail: a short bar a state in the right-hand margin, filling as you scroll (or, on a touch screen, as the
   state plays), so the next change is in view before it comes. It's in the gutter at every width, clear of
   every chapter. */
.rail { position: fixed; top: 50%; right: max(7px, calc(var(--g) / 2 - 1.5px)); z-index: 4; display: grid; gap: 5px; opacity: 0; transform: translate(6px, -50%); transition: opacity 260ms ease, transform 420ms var(--out); pointer-events: none; }
.rail.on { opacity: 1; transform: translate(0, -50%); }
.rail i { position: relative; width: 3px; height: 24px; border-radius: 2px; overflow: hidden; background: rgba(29, 24, 19, 0.15); }
.rail b { position: absolute; inset: 0; border-radius: 2px; background: var(--red); transform-origin: top; transform: scaleY(0); }

/* The hero's words and the header's name wait for their type (site.js, type), then come in once; without the
   script they show after a moment regardless. */
.js:not(.type) :is(.hero-words, .top .brand span) { opacity: 0; animation: type-late 0s linear 1.6s forwards; }
.type :is(.hero-words, .top .brand span) { transition: opacity 420ms ease; }
@keyframes type-late { to { opacity: 1; } }

/* Shown at once, for a fast scroll or a block already passed (site.js, arrivals): whatever it holds lands in
   one frame, delays and all. */
.js .now, .js .now * { transition: none !important; }

/* Words arrive once: the heading, then what follows it. */
.js .rise > * { opacity: 0; transform: translateY(24px); }
.js .rise.in > * { opacity: 1; transform: none; transition: opacity 700ms ease, transform 900ms var(--out); }
.js .rise.in > :nth-child(2) { transition-delay: 80ms; }
.js .rise.in > :nth-child(3) { transition-delay: 160ms; }
.js .rise.in > :nth-child(4) { transition-delay: 240ms; }

/* ---------- A chat for each of them: the side chats you'd start, then the ones Ribbon starts ---------- */
/* With no script it's Ribbon's side; with one, it opens on the old way (.js .talk:not(.after)) and turns over. */
.talk {
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 6fr);
  grid-template-areas: 'words panel' 'era panel' 'rooms panel';
  grid-template-rows: auto auto 1fr;
  column-gap: clamp(32px, 6vw, 104px);
}
.talk-words { grid-area: words; }
.talk-words p { max-width: 42ch; }
.era { grid-area: era; display: flex; flex-wrap: wrap; gap: 8px; margin-top: 26px; }
.era button {
  min-height: 40px;
  padding: 0 17px;
  border: 0;
  border-radius: 999px;
  background: rgba(255, 252, 246, 0.72);
  font-size: 15px;
  cursor: pointer;
  transition: transform 160ms var(--press), background-color 200ms ease, color 200ms ease;
}
.era button:hover { background: var(--card); }
.era button:active { transform: scale(0.95); }
.era button[aria-pressed='true'] { color: var(--cream); background: var(--ink); }

.rooms-wrap { grid-area: rooms; position: relative; align-self: start; max-width: 470px; margin-top: 14px; }
/* The old way's phone-white sheet; Ribbon's rows sit on the page's own paper. */
/* It ends above the last row: the old way never had a chat for Nana. */
.rooms-sheet { position: absolute; inset: 0 0 calc(var(--rh) + 2px); border-radius: 24px; background: #fff; opacity: 0; transition: opacity 520ms ease 140ms; }
.js .talk:not(.after) .rooms-sheet { opacity: 1; transition-delay: 0ms; }
.rooms { position: relative; display: grid; gap: 2px; padding: 8px; }
.rooms-wrap { --rh: 56px; }
.room { height: var(--rh); perspective: 900px; }
.room-in {
  position: relative;
  height: 100%;
  transform: rotateX(-180deg);
  transform-style: preserve-3d;
  transition: transform 640ms cubic-bezier(0.65, 0, 0.25, 1) calc(var(--i) * 50ms);
}
.js .talk:not(.after) .room-in { transform: none; transition-delay: calc(var(--i) * 45ms); }
.room-old, .room-new {
  position: absolute;
  inset: 0;
  display: grid;
  grid-template-columns: 40px minmax(0, 1fr) auto;
  align-items: center;
  gap: 13px;
  padding: 0 12px;
  border-radius: 18px;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  will-change: transform;
}
.room-new {
  grid-template-columns: 40px minmax(0, 1fr);
  transform: rotateX(180deg);
  border: 0;
  background: transparent;
  text-align: left;
  cursor: pointer;
  transition: background-color 220ms ease;
  -webkit-tap-highlight-color: transparent;
}
/* Safari shows a turned-away face through its back once its pictures get layers of their own, so each face also
   hides at the half-turn, when it's edge-on, timed to its row's own stagger. */
.room-old { visibility: hidden; transition: visibility 0s linear calc(296ms + var(--i) * 50ms); }
.js .talk:not(.after) .room-old { visibility: visible; transition-delay: calc(296ms + var(--i) * 45ms); }
.room-new { transition: background-color 220ms ease, visibility 0s linear calc(296ms + var(--i) * 50ms); }
.js .talk:not(.after) .room-new { visibility: hidden; transition: background-color 220ms ease, visibility 0s linear calc(296ms + var(--i) * 45ms); }
.room-new:hover { background: rgba(255, 252, 246, 0.55); }
.room-new[aria-pressed='true'] { background: var(--card); }
.room-new:active .mark { transform: scale(0.94); }
.r-t { display: grid; min-width: 0; }
.room-old .av { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 50%; background: #c9c9ce; color: #fff; font: 600 15px/1 var(--sans); }
.room-old b { font: 600 15px/1.25 var(--sans); color: #111; }
.room-old i { font-style: normal; font-size: 13.5px; line-height: 1.3; color: #6e6e73; }
.room-old time { align-self: start; margin-top: 9px; font-size: 13px; color: #6e6e73; }
.mark { display: block; width: 40px; height: 40px; transition: transform 160ms var(--press); }
.mark img { width: 40px; height: 40px; border-radius: 50%; }
.mark-all { position: relative; }
.mark-all img { position: absolute; width: 24px; height: 24px; outline: 2px solid var(--paper); }
.mark-all img:nth-child(1) { left: 0; top: 2px; }
.mark-all img:nth-child(2) { right: 0; top: 2px; }
.mark-all img:nth-child(3) { left: 8px; bottom: 0; }
.room-new b { font: 400 21px/1.1 var(--serif); letter-spacing: -0.01em; }
.room-new i { margin-top: 1px; font-style: normal; font-size: 13.5px; color: var(--ink-2); }

/* The open chat: a sheet of card, cold white while it's the old way. */
.panel {
  grid-area: panel;
  position: relative;
  align-self: center;
  display: grid;
  grid-template-rows: auto auto;
  border-radius: 30px;
  background: var(--card);
  overflow: clip;
  isolation: isolate;
  contain: layout paint;
}
.pn-ground { position: absolute; inset: 0; z-index: -1; background: #fff; opacity: 0; transition: opacity 640ms ease 160ms; }
.js .talk:not(.after) .pn-ground { opacity: 1; transition-delay: 0ms; }
.pn-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  grid-template-areas: 'title people' 'line people';
  column-gap: 20px;
  align-items: center;
  padding: 20px 24px 8px;
}
.pn-title, .pn-line { display: grid; align-items: center; }
.pn-title > span, .pn-line > span { grid-area: 1 / 1; transition: opacity 360ms ease 200ms; }
.pn-title { grid-area: title; min-height: 34px; }
.pn-line { grid-area: line; margin-top: 3px; min-height: 22px; }
.t-old { font: 600 18px/1.2 var(--sans); }
.t-new { font: 400 30px/1 var(--serif); letter-spacing: -0.015em; }
.l-old { font-size: 14px; color: #6e6e73; }
.l-new { font: italic 400 18px/1.1 var(--serif); }
.t-old, .l-old { opacity: 0; }
.js .talk:not(.after) .t-old, .js .talk:not(.after) .l-old { opacity: 1; }
.js .talk:not(.after) .t-new, .js .talk:not(.after) .l-new { opacity: 0; transition-delay: 0ms; }
.swapping .t-new, .swapping .l-new { opacity: 0; transition: opacity 140ms ease; }
/* Who reads it: one face a reader. The person it's about steps out to the end and their face goes quiet. */
.pn-people { --pf: 34px; --ps: 40px; --pg: 20px; grid-area: people; position: relative; width: calc(6 * var(--ps) - 6px + var(--pg)); height: var(--pf); }
.pp { position: absolute; left: 0; top: 0; transform: translateX(calc(var(--x, 0) * 1px)); transition: transform 760ms cubic-bezier(0.32, 0.72, 0, 1), opacity 420ms ease 200ms; }
.pp img { width: var(--pf); height: var(--pf); border-radius: 50%; }
.pp.out { opacity: 0.38; }
.pp-hop { display: block; }
.pp-hop.hop { animation: hop 760ms cubic-bezier(0.32, 0.72, 0, 1); }
@keyframes hop {
  0% { transform: none; }
  42% { transform: translateY(-18px) scale(1.14); }
  100% { transform: none; }
}

.pn-body {
  position: relative;
  height: var(--bh, 490px);
  -webkit-mask: linear-gradient(transparent, #000 40px); /* taste-skill-ignore: the chat runs on behind the head and thins, as the app's does */
  mask: linear-gradient(transparent, #000 40px); /* taste-skill-ignore: the chat thins under the head */
}
.thread {
  position: absolute;
  inset: 0 24px 20px;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  gap: 7px;
  visibility: hidden;
  transition: visibility 0s linear 220ms;
}
.thread.on, html:not(.js) [data-chat='maya'] { visibility: visible; transition-delay: 0s; }
.m {
  display: grid;
  grid-template-columns: 30px minmax(0, auto);
  align-items: end;
  gap: 9px;
  align-self: flex-start;
  max-width: 90%;
  opacity: 0;
  transform: translateY(12px);
  transition: opacity 180ms ease, transform 200ms ease;
}
.thread.on .m, html:not(.js) [data-chat='maya'] .m {
  opacity: 1;
  transform: none;
  transition: opacity 420ms ease, transform 640ms var(--out);
  transition-delay: calc(var(--lead, 0ms) + var(--k) * var(--pace, 60ms));
}
.thread.leaving .m { transform: translateY(-10px); }
/* WebKit stalls when a dozen layers are made in one frame: the faces and the chat on show keep theirs. */
.m-face { width: 30px; height: 30px; border-radius: 50%; }
.bub { position: relative; padding: 7px 14px 8px; border-radius: 20px 20px 20px 6px; background: #f0e9dd; }
.bub > b { display: block; font: 600 12.5px/1.25 var(--sans); color: var(--ink-2); }
.bub > p { margin-top: 1px; font-size: 15.5px; line-height: 1.32; }
.at { color: var(--red); font-weight: 600; }
.m.me { align-self: flex-end; grid-template-columns: auto; }
.me .bub { color: var(--cream); background: var(--red) url('img/satin.webp') 0 0 / 100% 100%; border-radius: 20px 20px 6px 20px; }
.me .at { color: #fff; }
.react {
  position: absolute;
  left: -12px;
  bottom: -13px;
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--card);
  opacity: 0;
  transform: scale(0.4);
}
.react img { width: 17px; }
.thread.on .react, html:not(.js) [data-chat='maya'] .react {
  opacity: 1;
  transform: none;
  transition: opacity 200ms ease, transform 420ms var(--out);
  transition-delay: calc(var(--lead, 0ms) + (var(--k) + 1.6) * var(--pace, 60ms));
}
.wish {
  display: grid;
  grid-template-columns: 50px minmax(0, 1fr);
  gap: 11px;
  align-items: center;
  margin-top: 6px;
  padding: 6px 13px 6px 6px;
  border-radius: 14px;
  background: var(--card);
}
.wish img { width: 50px; height: 50px; border-radius: 9px; object-fit: cover; }
.wish b { display: block; font: 400 17px/1.08 var(--serif); }
.wish i { display: block; margin-top: 2px; font-style: normal; font-size: 13px; color: var(--ink-2); }
/* A bought gift lands in the chat as its compact card; the stamp comes down once it's in, the sticker a beat later. */
.m.buyline { align-self: center; grid-template-columns: auto; max-width: 100%; }
.bc { display: grid; grid-template-columns: 76px auto; gap: 14px; align-items: center; padding: 8px 18px 8px 8px; border-radius: 20px; background: #f0e9dd; }
.bc-ph { position: relative; width: 76px; height: 76px; container-type: inline-size; --u: 0.42cqw; }
.bc-ph > img { width: 100%; height: 100%; border-radius: 13px; object-fit: cover; }
.bc-ph::after { content: ''; position: absolute; inset: 0; border-radius: 13px; background: rgba(244, 238, 228, 0.5); opacity: 0; }
.bc .stamp { width: 92%; }
.bc .sticker { right: -9px; top: -9px; }
.bc p b { display: block; font: 400 18px/1.1 var(--serif); }
.bc p span { display: block; margin-top: 1px; font-size: 13px; color: var(--ink-2); }
.bc p i { display: block; margin-top: 4px; font: italic 400 17px/1.15 var(--serif); }
.thread.on .bc-ph::after, html:not(.js) [data-chat='maya'] .bc-ph::after { opacity: 1; transition: opacity 260ms ease calc(var(--lead, 0ms) + var(--k) * var(--pace, 60ms) + 280ms); }
.thread.on .bc .stamp, html:not(.js) [data-chat='maya'] .bc .stamp {
  opacity: 0.92;
  transform: translate(-50%, -50%) rotate(-9deg) scale(1);
  transition: opacity 120ms ease-out, transform 260ms cubic-bezier(0.3, 0.7, 0.2, 1);
  transition-delay: calc(var(--lead, 0ms) + var(--k) * var(--pace, 60ms) + 320ms);
}
.thread.on .bc .sticker, html:not(.js) [data-chat='maya'] .bc .sticker {
  opacity: 1;
  transform: none;
  transition: opacity 200ms ease, transform 380ms var(--out);
  transition-delay: calc(var(--lead, 0ms) + var(--k) * var(--pace, 60ms) + 660ms);
}
.poll .pick { display: grid; grid-template-columns: 1fr 1fr; gap: 7px; width: min(226px, 56vw); margin-top: 8px; }
.pick figure { padding: 6px 6px 9px; border-radius: 14px; background: var(--card); }
.pick .won { outline: 2.5px solid var(--red); outline-offset: -2.5px; }
.pk-ph img { width: 100%; aspect-ratio: 1; border-radius: 9px; object-fit: cover; }
.pick figcaption { margin-top: 5px; padding: 0 3px; font: 400 15px/1.1 var(--serif); }
.votes { display: flex; margin-top: 6px; padding: 0 3px; }
.votes img { width: 20px; height: 20px; border-radius: 50%; outline: 2px solid var(--card); }
.votes img + img { margin-left: -5px; }
.m.quiet { align-self: center; grid-template-columns: auto; }
.quiet p { font: italic 400 17px/1.2 var(--serif); color: var(--ink-2); }
/* The old way's chat: plain grey bubbles, everyone in it, Maya included. */
.thread-old .bub { background: #e9e9eb; border-radius: 19px; }
.thread-old .bub > b { font-weight: 500; color: #5c5c60; }
.thread-old .m-face { width: 28px; height: 28px; }
.thread-old .m { grid-template-columns: 28px minmax(0, auto); }
.thread-old .m.when { align-self: center; grid-template-columns: auto; margin-bottom: 2px; }
.when p { font-size: 13px; font-weight: 500; color: #6e6e73; }

.scene-notes { max-width: calc(var(--max) + 2 * var(--g)); margin: 0 auto; padding: 0 var(--g) clamp(44px, 5vw, 76px); }
.scene-notes .notes { margin-top: clamp(8px, 2vw, 24px); }
/* What's happening, step by step: each step's line fills red as the scene reaches it, the one now in ink. */
.sync-steps { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: clamp(16px, 2.2vw, 36px); margin-top: clamp(26px, 3vw, 40px); }
.sync-steps li { position: relative; display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: baseline; gap: 12px; padding-top: 16px; color: var(--ink-2); opacity: 0.5; transition: opacity 360ms ease; }
.sync-steps li::before, .sync-steps li::after { content: ''; position: absolute; left: 0; right: 0; top: 0; height: 2px; border-radius: 1px; background: rgba(29, 24, 19, 0.14); }
.sync-steps li::after { background: var(--red); transform: scaleX(0); transform-origin: left; transition: transform 620ms var(--out); }
.sync-steps li.done, .sync-steps li.on { opacity: 1; }
.sync-steps li.on { color: var(--ink); }
.sync-steps li.done::after, .sync-steps li.on::after { transform: none; }
.sync-steps b { font: italic 400 clamp(30px, 2.6vw, 40px)/1 var(--serif); color: var(--red); }
.sync-steps span { font: 400 clamp(19px, 1.6vw, 24px)/1.2 var(--serif); letter-spacing: -0.005em; text-wrap: balance; }
/* The gift being acted on wears the red ring; Rosa's face carries the purchase from one group's list to the other's. */
.mt::before { content: ''; position: absolute; left: -5px; top: -5px; width: calc(100% + 10px); aspect-ratio: 1; border: 2.5px solid var(--red); border-radius: 21px; opacity: 0; transform: scale(0.94); transition: opacity 240ms ease, transform 420ms var(--out); pointer-events: none; }
.mt.acting::before { opacity: 1; transform: none; }
.fly-face { position: absolute; z-index: 3; left: 0; top: 0; border-radius: 50%; outline-style: solid; outline-color: #fff; pointer-events: none; will-change: transform; }
.notes { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 28px clamp(24px, 3vw, 44px); margin-top: clamp(48px, 5vw, 76px); }
.note { display: grid; align-content: start; gap: 16px; }
.note p { font-size: 16px; color: var(--ink-2); }
.note b { color: var(--ink); font-weight: 600; }
.nt-art { display: flex; align-items: center; height: 66px; }
.nt-join img { width: 34px; height: 34px; border-radius: 50%; }
.nt-join img + img { margin-left: 5px; }
.nt-join .out { margin-left: 18px; opacity: 0.38; }
.nt-groups { display: grid; align-content: center; gap: 8px; }
.nt-groups span { display: grid; grid-template-columns: 26px auto; column-gap: 9px; align-items: center; }
.nt-groups img { grid-row: span 2; width: 26px; height: 26px; border-radius: 50%; }
.nt-groups b { font: 400 17px/1 var(--serif); }
.nt-groups i { font-style: normal; font-size: 13px; line-height: 1.2; color: var(--ink-2); }
.nt-banner { gap: 11px; justify-self: start; width: max-content; max-width: 100%; height: auto; padding: 11px 16px 11px 11px; border-radius: 20px; background: rgba(255, 252, 246, 0.86); }
.nt-banner img { width: 36px; height: 36px; border-radius: 9px; }
.nt-banner span { display: grid; }
.nt-banner b { font: 600 14px/1.25 var(--sans); }
.nt-banner i { font-style: normal; font-size: 13.5px; line-height: 1.25; color: var(--ink-2); }
.nt-banner time { align-self: start; margin-left: 10px; font-size: 13px; color: var(--ink-2); }
.nt-poll { gap: 8px; }
.nt-poll > span:not(.nt-votes) { width: 54px; height: 54px; border-radius: 11px; overflow: hidden; }
.nt-poll img { width: 100%; height: 100%; object-fit: cover; }
.nt-poll .won { outline: 2.5px solid var(--red); outline-offset: 2px; }
.nt-votes { display: flex; margin-left: 8px; }
.nt-votes img { width: 24px; height: 24px; border-radius: 50%; outline: 2px solid var(--paper); }
.nt-votes img + img { margin-left: -6px; }

/* ---------- Add a wish: the link on one side, the tag filling on the other ---------- */
.add {
  display: grid;
  grid-template-columns: minmax(0, 6fr) minmax(0, 5fr);
  grid-template-areas: 'words tag' 'try tag' 'ways tag';
  column-gap: clamp(32px, 7vw, 120px);
}
.add-words { grid-area: words; align-self: end; }
.try { grid-area: try; margin-top: 34px; max-width: 560px; }
.ways { grid-area: ways; align-self: start; margin-top: 30px; max-width: 560px; }
.a-link {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 54px;
  padding: 13px 18px;
  border-radius: 18px;
  background: var(--card);
  font-size: 16px;
  overflow-wrap: anywhere;
}
.a-link svg { flex: none; color: var(--ink-2); }
.a-link span { min-width: 0; }
.typing [data-link]::after { content: ''; display: inline-block; width: 2px; height: 1.1em; margin-left: 2px; vertical-align: -0.2em; background: var(--red); }
.stores { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 14px; font-size: 15px; color: var(--ink-2); }
.stores span { margin-right: 4px; }
.stores button {
  min-height: 40px;
  padding: 0 16px;
  border: 0;
  border-radius: 999px;
  background: rgba(255, 252, 246, 0.72);
  font-size: 15px;
  cursor: pointer;
  transition: transform 160ms var(--press), background-color 160ms ease, color 160ms ease;
}
.stores button:hover { background: var(--card); }
.stores button:active { transform: scale(0.95); }
.stores button[aria-pressed='true'] { color: var(--cream); background: var(--ink); }

.ways { display: grid; gap: 22px; }
.ways li { display: grid; grid-template-columns: 172px 1fr; gap: 22px; align-items: center; }
.ways li p { font-size: 17px; color: var(--ink-2); }
.ways b { color: var(--ink); font-weight: 600; }
.share-row { display: flex; gap: 10px; align-items: flex-end; }
.app { display: grid; justify-items: center; gap: 6px; }
.app i { width: 30px; height: 30px; border-radius: 8px; background: #d8cdbd; }
.app u { width: 21px; height: 4px; border-radius: 2px; background: #d3c8b8; }
.app-ribbon { gap: 4px; }
.ring { padding: 3px; border-radius: 12px; background: var(--red) url('img/satin.webp') 0 0 / 100% 100%; }
.ring img { width: 34px; height: 34px; border: 2px solid #fbf7f0; border-radius: 9px; }
.app-ribbon b { font: 600 13px/1 var(--sans); }
.paste-chip { display: inline-flex; align-items: center; gap: 7px; justify-self: start; padding: 10px 17px; border-radius: 999px; background: var(--ink); color: var(--cream); font: 600 15px/1 var(--sans); }
.pen { display: inline-flex; align-items: center; gap: 8px; justify-self: start; font: 600 15px/1 var(--sans); }
.pen i { font-style: normal; }

.add-tag { grid-area: tag; position: relative; align-self: center; justify-self: center; width: min(100%, 400px, calc((100svh - 150px) / 1.86)); container-type: inline-size; }
.stub-cord {
  position: absolute;
  left: -60%;
  right: -60%;
  top: 0;
  height: 13px;
  background: url('img/cord.webp') 0 50% / auto 100% repeat-x;
  z-index: 2;
  -webkit-mask: linear-gradient(90deg, transparent, #000 30%, #000 70%, transparent); /* taste-skill-ignore: the cord fades into the room at its ends */
  mask: linear-gradient(90deg, transparent, #000 30%, #000 70%, transparent); /* taste-skill-ignore: the cord fades into the room */
}
.a-swing { position: relative; --u: 0.25907cqw; margin-top: -2px; transform-origin: 50% 2.6%; }
.a-card { width: 100%; }
.a-face { position: absolute; left: 13.47%; right: 13.47%; top: calc(var(--u) * 122); }
.a-photo { aspect-ratio: 282 / 230; border-radius: calc(var(--u) * 14); overflow: hidden; background: #ebe3d6; transition: background-color 300ms ease; }
.a-photo img { width: 100%; height: 100%; object-fit: cover; }
.a-name { margin-top: calc(var(--u) * 18); font: 400 calc(var(--u) * 31)/1.06 var(--serif); letter-spacing: -0.01em; text-wrap: balance; }
.a-meta { margin-top: calc(var(--u) * 8); font-size: calc(var(--u) * 19); color: var(--ink-2); }
.a-meta i { font-family: var(--serif); font-size: 1.12em; }
.a-desc { margin-top: calc(var(--u) * 10); font-size: calc(var(--u) * 17); line-height: 1.35; color: var(--ink-2); }
.a-chips { display: flex; flex-wrap: wrap; gap: calc(var(--u) * 8); margin-top: calc(var(--u) * 18); }
.a-chips span { display: inline-flex; align-items: center; gap: calc(var(--u) * 6); padding: calc(var(--u) * 8) calc(var(--u) * 14); border-radius: 999px; background: #efe8dc; font-size: calc(var(--u) * 16); }
.a-chips img { width: calc(var(--u) * 18); }
.add [data-f] { transition: opacity 320ms ease, transform 520ms var(--out); }
.add .reading [data-f]:not(img) { opacity: 0; transform: translateY(6px); }
.add .reading img[data-f] { opacity: 0.45; }
.add .reading .a-photo { background: #e6ddcf; }
.js .add-tag .a-swing { transform: rotate(7deg); opacity: 0; }
.js .add-tag.in .a-swing { transform: none; opacity: 1; transition: transform 1300ms var(--out), opacity 400ms ease; }

/* ---------- Good to know: her labels and tags, laid out large ---------- */
.know { display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); grid-template-areas: 'table words'; gap: 48px clamp(32px, 6vw, 112px); align-items: center; }
.know-words { grid-area: words; }
.table { grid-area: table; display: grid; gap: 34px; }
.who-card { display: flex; align-items: center; gap: 14px; font: italic 400 38px/1 var(--serif); }
.who-card img { width: 64px; height: 64px; border-radius: 50%; }
.part { display: grid; grid-template-columns: 104px minmax(0, 1fr); gap: 16px; align-items: center; }
.part-name { font: 600 15px/1.2 var(--sans); color: var(--ink-2); }
.part ul { display: flex; flex-wrap: wrap; gap: 14px 16px; }
.sewn {
  position: relative;
  display: grid;
  justify-items: center;
  min-width: 98px;
  padding: 14px 18px 12px;
  background: #fcfaf5 repeating-linear-gradient(180deg, transparent 0 2px, rgba(29, 24, 19, 0.035) 2px 3px); /* taste-skill-ignore: the weave's fine ribs */
  outline: 1px solid rgba(59, 42, 26, 0.16);
  transform: rotate(var(--r));
}
.sewn::before { content: ''; position: absolute; inset: 5px; border: 1px dashed rgba(193, 18, 31, 0.5); pointer-events: none; }
.sewn b { font: 400 42px/1 var(--serif); }
.sewn span { margin-top: 2px; font: 600 13px/1.2 var(--sans); color: #6e645a; }
/* A manila tag: its point cut, a real hole punched through it, and the garland's eyelet round the hole. */
.love {
  position: relative;
  padding: 12px 22px 12px 42px;
  background: #e8d6a8;
  font: italic 400 27px/1.1 var(--serif);
  clip-path: polygon(18px 0, 100% 0, 100% 100%, 18px 100%, 0 50%);
  -webkit-mask: radial-gradient(circle at 21px 50%, transparent 3.6px, #000 4.2px); /* taste-skill-ignore: the punched hole */
  mask: radial-gradient(circle at 21px 50%, transparent 3.6px, #000 4.2px); /* taste-skill-ignore: the punched hole */
  transform: rotate(var(--r));
}
.love::before {
  content: '';
  position: absolute;
  left: 13px;
  top: 50%;
  width: 16px;
  height: 16px;
  margin-top: -8px;
  border-radius: 50%;
  background: url('img/eyelet.webp') center / contain;
}
.love-no { background: #ece4d6; color: var(--ink-2); }
.js .table .sewn, .js .table .love { opacity: 0; transform: translateY(-14px) rotate(calc(var(--r) * 3)) scale(1.04); }
.js .table.in .sewn, .js .table.in .love { opacity: 1; transform: rotate(var(--r)); transition: opacity 500ms ease, transform 900ms var(--out); }
.js .table.in li:nth-child(2) { transition-delay: 70ms; }
.js .table.in li:nth-child(3) { transition-delay: 140ms; }
.js .table.in li:nth-child(4) { transition-delay: 210ms; }
.js .table.in .part-loves li { transition-delay: 260ms; }
.js .table.in .part-loves li:nth-child(2) { transition-delay: 330ms; }
.js .table.in .part-loves li:nth-child(3) { transition-delay: 400ms; }
.js .table.in .part-loves li:nth-child(4) { transition-delay: 470ms; }
.js .table.in .part-no li { transition-delay: 560ms; }
.js .table.in .part-no li:nth-child(2) { transition-delay: 630ms; }

/* ---------- I bought it ---------- */
/* Three columns: what it does, the tag, and the controls that stamp it, so cause and effect sit side by side. */
.buy {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(0, 400px) minmax(300px, 1fr);
  grid-template-areas: 'words tag split';
  gap: 40px clamp(32px, 4.5vw, 72px);
  align-items: center;
}
.buy-words { grid-area: words; }
.buy-tag { grid-area: tag; position: relative; justify-self: center; width: min(100%, 400px, calc((100svh - 170px) / 1.45)); container-type: inline-size; }
.split { grid-area: split; }
.b-swing { position: relative; --u: 0.25907cqw; margin-top: -2px; transform-origin: 50% 3.3%; }
.buy-tag .sticker { right: calc(var(--u) * -18); top: calc(var(--u) * 44); }
.from { font: italic 400 clamp(26px, 2.3vw, 34px)/1.15 var(--serif); }
.faces { display: flex; gap: 16px; margin-top: 18px; }
.face {
  display: grid;
  justify-items: center;
  gap: 7px;
  padding: 0;
  border: 0;
  background: none;
  font-size: 14px;
  color: var(--ink-2);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.face img { width: 62px; height: 62px; border-radius: 50%; opacity: 0.55; transition: opacity 200ms ease, transform 160ms var(--press); }
.face:hover img { opacity: 0.8; }
.face:active img { transform: scale(0.94); }
.face[aria-pressed='true'] { color: var(--ink); }
.face[aria-pressed='true'] img { opacity: 1; outline: 3px solid var(--red); outline-offset: 3px; }
.face:disabled { cursor: default; }
.buy-act { display: flex; gap: 12px; margin-top: 28px; }

/* ---------- The flip ---------- */
/* Stacked and centred: the one chapter where the object runs the full measure. */
.flip { display: grid; justify-items: center; gap: clamp(36px, 5svh, 56px); text-align: center; }
.flip-words { display: grid; justify-items: center; }
.flip-words > p { max-width: 46ch; margin-inline: auto; }
.turn { width: min(100%, 1060px); text-align: left; }
.whose { display: flex; justify-content: center; gap: 28px; margin-top: 28px; }
.who { display: grid; justify-items: center; gap: 8px; padding: 0; border: 0; background: none; font-size: 15px; color: var(--ink-2); cursor: pointer; -webkit-tap-highlight-color: transparent; }
.who img { width: 68px; height: 68px; border-radius: 50%; opacity: 0.6; transition: opacity 200ms ease, transform 160ms var(--press); }
.who:hover img { opacity: 0.85; }
.who:active img { transform: scale(0.94); }
.who[aria-pressed='true'] { color: var(--ink); }
.who[aria-pressed='true'] img { opacity: 1; outline: 3.5px solid var(--red); outline-offset: 3px; }
.turn { position: relative; perspective: 2400px; }
.sheet { position: relative; display: grid; transform-style: preserve-3d; transition: transform 860ms cubic-bezier(0.65, 0, 0.25, 1); }
.flipped .sheet { transform: rotateY(-180deg); }
.side {
  grid-area: 1 / 1;
  padding: clamp(18px, 2.4vw, 32px);
  border-radius: 28px;
  background: var(--card);
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
}
.back { transform: rotateY(180deg); }
/* Both faces keep their own painted layers, so a turn never paints a face mid-move. */
.sheet, .side { will-change: transform; }
/* Safari can paint a face's back through it (the hidden back face, mirrored, over the one in front), so the face
   turned away also goes clear, switching at the moment the sheet is edge on: 46% of the turn on its curve. */
.front, .back { transition: opacity 0s linear 398ms; }
.back, .flipped .front { opacity: 0; }
.flipped .back { opacity: 1; }
.sheet-shadow {
  position: absolute;
  left: 6%;
  right: 6%;
  bottom: -26px;
  height: 60px;
  border-radius: 50%;
  background: url('img/sheet-shadow.webp') center / 100% 100% no-repeat;
  transition: transform 860ms cubic-bezier(0.65, 0, 0.25, 1);
}
.turning .sheet-shadow { transform: scaleX(0.55); }
.side-head { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; align-items: baseline; }
.side-head > span:first-child { font: 400 32px/1 var(--serif); }
.away .side-head > span, .away .tile h3, .away .tile p { opacity: 0; }
.side-head > span:last-child { font-size: 15px; color: var(--ink-2); }
.side-head b { color: var(--ink); }
.tiles { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 18px; margin-top: 22px; }
.tile { position: relative; container-type: inline-size; }
.ph { position: relative; aspect-ratio: 1; border-radius: 16px; overflow: hidden; background: #ebe3d6; }
.ph > img:first-child { width: 100%; height: 100%; object-fit: cover; }
.ph::after { content: ''; position: absolute; inset: 0; background: rgba(244, 238, 228, 0.5); opacity: 0; }
.tile .stamp { width: 86%; }
.tile .sticker { right: -6px; top: -10px; --u: max(0.3cqw, 0.57px); }
.tile h3 { margin-top: 12px; font: 400 20px/1.15 var(--serif); }
.tile p { margin-top: 4px; font-size: 14px; color: var(--ink-2); }
.heart { position: absolute; right: 8px; top: 8px; width: 32px; }

/* ---------- The invite: the card your family gets, with your family's name on it ---------- */
.ask {
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 6fr);
  grid-template-areas: 'words card';
  gap: 48px clamp(32px, 6vw, 104px);
  align-items: center;
  padding-bottom: clamp(64px, 7vw, 112px);
}
.ask-words { grid-area: words; }
.ask h2 { font-size: var(--ask-size, clamp(42px, 5vw, 80px)); font-style: italic; letter-spacing: -0.025em; }
.fam { display: grid; gap: 4px; max-width: 340px; margin-top: 30px; }
.fam span { font-size: 14px; color: var(--ink-2); }
.fam input {
  width: 100%;
  height: 48px;
  padding: 0 0 4px;
  border: 0;
  border-bottom: 2px solid var(--ink); /* taste-skill-ignore: what you type wears a rule under it, red while it's waiting on you */
  border-radius: 0;
  background: none;
  color: var(--ink);
  font: 400 32px/44px var(--serif);
  outline: none;
  transition: border-color 200ms ease;
}
.fam input:focus { border-bottom-color: var(--red); }
.fam input::placeholder { color: rgba(29, 24, 19, 0.36); }
.ask .act { justify-items: start; margin-top: 30px; }
.ask .act-row { justify-content: flex-start; }

.invite { grid-area: card; justify-self: center; width: min(100%, 620px); }
.inv-tilt { position: relative; isolation: isolate; transform: rotate(-2.2deg); }
.inv-shadow { position: absolute; inset: 3% -7% -13% -7%; z-index: -1; background: url('img/card-shadow.webp') center / 100% 100% no-repeat; }
.inv-card {
  position: relative;
  aspect-ratio: 1200 / 628;
  border-radius: 22px 22px 0 0;
  overflow: hidden;
  container-type: inline-size;
  --u: 0.083333cqw;
  color: var(--cream);
}
.inv-paper { position: absolute; inset: 0; width: 100%; height: 100%; }
.inv-band { position: absolute; left: calc(var(--u) * -72); top: calc(var(--u) * 421.2); width: calc(var(--u) * 1344); max-width: none; height: calc(var(--u) * 89.6); }
.inv-bow { position: absolute; left: calc(var(--u) * 745); top: calc(var(--u) * 325.8); width: calc(var(--u) * 370); max-width: none; height: calc(var(--u) * 314); }
.inv-from { position: absolute; left: calc(var(--u) * 72); top: calc(var(--u) * 80); font: 500 calc(var(--u) * 38)/1 var(--sans); opacity: 0.82; }
.inv-title { position: absolute; left: calc(var(--u) * 69); top: calc(var(--u) * 146); font: 400 calc(var(--u) * var(--ts, 176))/1.04 var(--serif); letter-spacing: -0.015em; white-space: nowrap; }
.inv-foot { position: absolute; left: calc(var(--u) * 72); top: calc(var(--u) * 535); display: flex; align-items: center; gap: calc(var(--u) * 16); font: 500 calc(var(--u) * 33)/1 var(--sans); }
.inv-foot .inv-faces { display: flex; }
.inv-faces img { width: calc(var(--u) * 54); height: calc(var(--u) * 54); border-radius: 50%; outline: calc(var(--u) * 3) solid #c1121f; }
.inv-faces img + img { margin-left: calc(var(--u) * -14); }
.inv-foot { color: rgba(255, 248, 241, 0.86); }
.inv-link { display: grid; gap: 2px; padding: 13px 20px 15px; border-radius: 0 0 22px 22px; background: #e9e9eb; }
.inv-link b { font: 600 15.5px/1.3 var(--sans); color: #111; }
.inv-link span { font-size: 13.5px; color: #5c5c60; }
.js .invite .inv-tilt { opacity: 0; transform: translateY(40px) rotate(-7deg); }
.js .invite.in .inv-tilt { opacity: 1; transform: rotate(-2.2deg); transition: opacity 500ms ease, transform 1200ms var(--out); }

/* ---------- The morning after: her list, then what she got and who it's from ---------- */
.who-face { position: relative; display: block; }
.who .who-bow, .who:hover .who-bow { position: absolute; right: -12px; bottom: -6px; width: 36px; height: auto; border-radius: 0; opacity: 1; outline: none !important; }
.sh, .cap { display: grid; }
.sh > span, .cap > span { grid-area: 1 / 1; transition: opacity 320ms ease; }
.sh > .later, .cap > .later, .late .sh > .now, .late .cap > .now { opacity: 0; }
.late .sh > .later, .late .cap > .later { opacity: 1; }
.away .sh > span, .away .cap > span { opacity: 0; }
.from { font: italic 400 18px/1.15 var(--serif); color: var(--ink); }
.back .tile { transition: opacity 420ms ease; }
.late .tile:not(.got) { opacity: 0.32; }
.back .got .sticker { transition: opacity 200ms ease, transform 360ms var(--out); }
.late .got .sticker { opacity: 1; transform: none; transition-delay: 260ms; }

/* ---------- Every side of the family: one list, the same in each group ---------- */
.sides-words { max-width: 780px; }
.groups { position: relative; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: clamp(20px, 2.4vw, 36px); margin-top: clamp(32px, 4vw, 52px); }
/* The Parks comes first: the story runs from Rosa's purchase there to Sam's list in The Hales. */
.grp[data-grp='parks'] { order: -1; }
.grp { display: grid; align-content: start; padding: clamp(18px, 2vw, 28px); border-radius: 28px; background: var(--card); }
.grp-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.grp-head b { font: 400 clamp(28px, 2.4vw, 34px)/1 var(--serif); }
.grp-faces { display: flex; }
.grp-faces img { width: 34px; height: 34px; border-radius: 50%; outline: 2.5px solid var(--card); }
.grp-faces img + img { margin-left: -9px; }
.grp-list { margin-top: 16px; font-size: 15px; color: var(--ink-2); }
.mini { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: clamp(12px, 1.4vw, 18px); margin-top: 10px; }
.mt { position: relative; container-type: inline-size; }
.mt .ph::after { transition: opacity 260ms ease; }
.mt .stamp { width: 88%; }
.mt .sticker { right: -6px; top: -10px; --u: max(0.34cqw, 0.5px); }
.mt-n { display: block; margin-top: 10px; font: 400 clamp(16px, 1.3vw, 19px)/1.15 var(--serif); }
.as-rosa { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-top: 22px; }
.as-who { display: flex; align-items: center; gap: 10px; font-size: 15px; color: var(--ink-2); }
.as-who img { width: 30px; height: 30px; border-radius: 50%; }
.notes.notes-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.nt-keep { gap: 6px; }
.nt-keep img { width: 34px; height: 34px; border-radius: 50%; }
.nt-keep i { margin-left: 8px; font: italic 400 19px/1 var(--serif); }
.nt-hand { gap: 10px; }
.nt-hand span { display: flex; align-items: center; gap: 7px; font-size: 14px; color: var(--ink-2); }
.nt-hand span img { width: 28px; height: 28px; border-radius: 50%; }
.nt-hand span:first-child img { opacity: 0.5; }
.nt-hand i { font: italic 400 17px/1 var(--serif); color: var(--ink-2); }
.notes-3 .nt-groups span { grid-template-columns: 30px auto; }
.notes-3 .nt-groups img { width: 30px; height: 34px; border-radius: 6px; object-fit: cover; object-position: top right; }

/* ---------- Every occasion's paper: Home's card, wrapped afresh ---------- */
.papers { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); grid-template-areas: 'words card' 'words kinds'; gap: 22px clamp(32px, 5vw, 88px); align-items: center; }
.papers-words { grid-area: words; }
.hcard { grid-area: card; position: relative; align-self: end; justify-self: center; width: min(100%, 620px); container-type: inline-size; }
.hc-shadow, .yr-shadow { position: absolute; inset: 4% -6% -12% -6%; background: url('img/card-shadow.webp') center / 100% 100% no-repeat; }
/* Every size is the app's own at a 350-point card, so the card is Home's, larger. */
.hc-sheet {
  --u: calc(100cqw / 350);
  --ink-c: #fffbf3;
  position: relative;
  aspect-ratio: 350 / 232;
  border-radius: calc(var(--u) * 22);
  overflow: hidden;
  isolation: isolate;
  background: #1f3b2d;
  color: var(--ink-c);
}
.hc-sheet[data-k='birthday'] { --ink-c: #2a2118; }
.hc-paper { position: absolute; top: 0; right: 0; width: 100%; height: 100%; max-width: none; object-fit: cover; object-position: top right; opacity: 0; transition: opacity 560ms ease; }
.hc-paper.on { opacity: 1; }
.hc-paper[data-reach] { left: 0; right: auto; width: 135%; }
.hc-band, .hc-bow, .hc-tag { position: absolute; max-width: none; opacity: 0; transition: opacity 360ms ease; }
.hc-band { top: 0; right: calc(var(--u) * 52.2); width: calc(var(--u) * 41.6); height: 100%; object-fit: cover; }
.hc-bow { top: calc(var(--u) * 2); right: calc(var(--u) * 3); width: calc(var(--u) * 140); }
.hc-sheet[data-tie='vermilion'] .hc-vermilion, .hc-sheet[data-tie='ivory'] .hc-ivory,
.hc-sheet[data-tag='manila'] .hc-manila, .hc-sheet[data-tag='star'] .hc-star { opacity: 1; }
/* Each tag hangs from the knot by its own cord, turned a little at rest. */
.hc-tag > img { width: 100%; }
.hc-manila { right: calc(var(--u) * 20); top: calc(var(--u) * 49.6); width: calc(var(--u) * 106.1); transform-origin: 50% 3.1%; transform: rotate(-4deg); }
.hc-star { right: calc(var(--u) * 3.2); top: calc(var(--u) * 54.9); width: calc(var(--u) * 135.3); transform-origin: 48.4% 0; }
.hc-tw { position: absolute; display: grid; place-content: center; justify-items: center; text-align: center; color: #2a2118; }
.hc-manila .hc-tw { left: 17.1%; top: 47.8%; width: 65.8%; height: 41.6%; }
.hc-star .hc-tw { left: calc(51.5% - var(--u) * 31); top: calc(59.3% - var(--u) * 22); width: calc(var(--u) * 62); height: calc(var(--u) * 44); transform: rotate(-4deg); color: #4a3412; }
.hc-tw small { font: 600 calc(var(--u) * 9.5)/1.2 var(--sans); }
.hc-tw b { font: 400 calc(var(--u) * 30)/1 var(--serif); }
.hc-star .hc-tw b { font-size: calc(var(--u) * 16.5); }
.hc-words { position: absolute; left: calc(var(--u) * 22); top: calc(var(--u) * 20); width: calc(var(--u) * var(--ww, 136)); transition: opacity 200ms ease; }
.swap .hc-words { opacity: 0; }
.hc-circle { font: 600 calc(var(--u) * 13)/1.2 var(--sans); opacity: 0.85; }
.hc-count { display: flex; align-items: flex-end; gap: calc(var(--u) * 7); margin-top: calc(var(--u) * 6); }
.hc-count b { font: 400 calc(var(--u) * 62)/0.86 var(--serif); letter-spacing: -0.02em; }
.hc-count span { margin-bottom: calc(var(--u) * 5); font: 600 calc(var(--u) * 12)/1.15 var(--sans); opacity: 0.85; }
.hc-title { margin-top: calc(var(--u) * 6); font: 400 calc(var(--u) * var(--ts, 27))/1.08 var(--serif); letter-spacing: -0.01em; text-wrap: balance; }
.hc-line { margin-top: calc(var(--u) * 3); font: 400 calc(var(--u) * 13.5)/1.3 var(--sans); opacity: 0.8; }
.hc-faces { display: flex; margin-top: calc(var(--u) * 10); }
.hc-faces img { width: calc(var(--u) * 24); height: calc(var(--u) * 24); border-radius: 50%; outline: calc(var(--u) * 1.8) solid rgba(255, 251, 243, 0.9); }
.hc-faces img + img { margin-left: calc(var(--u) * -6); }
.hc-circle:empty, .hc-line:empty, .hc-sheet:not([data-faces]) .hc-faces { display: none; }
/* The choices lie open, each as its own paper; the picked one wears the red ring. */
.kinds { grid-area: kinds; display: flex; gap: 8px; justify-self: center; max-width: 100%; padding: 8px 6px 4px; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; }
.kinds::-webkit-scrollbar { display: none; }
.kinds button { flex: 0 0 68px; display: grid; justify-items: center; align-content: start; gap: 8px; padding: 0; border: 0; background: none; text-align: center; font-size: 13px; line-height: 1.2; color: var(--ink-2); cursor: pointer; scroll-snap-align: start; -webkit-tap-highlight-color: transparent; }
.kinds img { width: 56px; height: 64px; border-radius: 10px; object-fit: cover; object-position: top right; opacity: 0.5; transition: opacity 200ms ease, transform 160ms var(--press); }
.kinds button:hover img { opacity: 0.8; }
.kinds button:active img { transform: scale(0.94); }
.kinds [aria-checked='true'] { color: var(--ink); }
.kinds [aria-checked='true'] img { opacity: 1; outline: 3px solid var(--red); outline-offset: 3px; }

/* ---------- Secret Santa and White Elephant ---------- */
.games { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); grid-template-areas: 'words words' 'santa elephant'; gap: clamp(26px, 3vw, 40px) clamp(28px, 4vw, 72px); align-items: stretch; }
.games-words p { margin-top: 16px; max-width: 58ch; font-size: clamp(18px, 1.3vw, 20px); }
.games-words { grid-area: words; }
.santa { grid-area: santa; }
.elephant { grid-area: elephant; }
/* Each game is its words, its object in the middle, and its one action at the foot, so the two columns end together. */
.game { display: grid; grid-template-rows: auto auto 1fr auto; }
.game h3 { font: 400 clamp(26px, 2.3vw, 34px)/1.1 var(--serif); letter-spacing: -0.01em; text-wrap: balance; }
.game > p { margin-top: 10px; max-width: 44ch; font-size: 16.5px; color: var(--ink-2); }
.env-stage { position: relative; display: grid; align-self: center; justify-self: center; width: min(100%, 470px); margin-top: clamp(20px, 2.4vw, 32px); }
.env, .drawn { grid-area: 1 / 1; }
.env { position: relative; align-self: center; transition: transform 700ms var(--out), opacity 420ms ease; }
.env-face { width: 100%; border-radius: 4px; }
.env-seal { position: absolute; left: 50%; top: 50%; width: 21%; transform: translate(-50%, -50%); transition: transform 560ms var(--out), opacity 360ms ease; }
.env-shadow, .t-shadow { position: absolute; left: 4%; right: 4%; bottom: -16px; height: 44px; background: url('img/sheet-shadow.webp') center / 100% 100% no-repeat; transition: opacity 400ms ease; }
.opened .env-seal { opacity: 0; transform: translate(-50%, -90%) scale(1.12); }
.opened .env { opacity: 0; transform: translateY(10%) scale(0.97); transition-delay: 140ms; }
.opened .env-shadow { opacity: 0.6; }
.drawn { align-self: center; justify-self: center; display: grid; gap: 14px; width: min(100%, 420px); padding: 22px 24px; border-radius: 22px; background: var(--card); opacity: 0; visibility: hidden; transform: translateY(26px); transition: opacity 400ms ease, transform 800ms var(--out), visibility 0s linear 800ms; }
.opened .drawn { opacity: 1; visibility: visible; transform: none; transition-delay: 320ms, 320ms, 0s; }
.drawn-who { display: flex; align-items: center; gap: 14px; font: 400 32px/1 var(--serif); }
.drawn-who img { width: 52px; height: 52px; border-radius: 50%; }
.drawn-who b { font-weight: 400; }
.drawn-wish { display: grid; grid-template-columns: 72px minmax(0, 1fr); gap: 14px; align-items: center; }
.drawn-wish img { width: 72px; height: 72px; border-radius: 12px; object-fit: cover; }
.drawn-wish b { display: block; font: 400 20px/1.15 var(--serif); }
.drawn-wish i { display: block; margin-top: 2px; font-style: normal; font-size: 14px; color: var(--ink-2); }
.drawn-cap { font-size: 14px; color: var(--ink-2); }
.env-act { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 20px; margin-top: 26px; }
.apart { display: flex; align-items: center; gap: 10px; font-size: 15px; color: var(--ink-2); }
.apart span { display: flex; }
.apart img { width: 28px; height: 28px; border-radius: 50%; }
.apart img + img { margin-left: -7px; }
.el-stage { display: grid; align-self: center; justify-items: center; margin-top: clamp(4px, 1vw, 12px); }
/* The elephant stands on the ticket, over its stub. */
.porcelain { position: relative; z-index: 1; justify-self: end; width: min(42%, 220px); margin: 0 clamp(0px, 2vw, 24px) -12px 0; }
.ticket-wrap { position: relative; width: 100%; max-width: 520px; }
/* The house rules ticket: cream on the left, a perforation punched clean through, a stub of the event's paper. */
.ticket {
  --stub: 118px;
  --solid: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1 1' preserveAspectRatio='none'%3E%3Crect width='1' height='1'/%3E%3C/svg%3E");
  --holes: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='13'%3E%3Cpath fill-rule='evenodd' d='M0 0h10v13H0zM2.6 6.5a2.4 2.4 0 1 0 4.8 0a2.4 2.4 0 1 0-4.8 0z'/%3E%3C/svg%3E");
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) var(--stub);
  min-height: 186px;
  border-radius: 14px;
  overflow: hidden;
  -webkit-mask: var(--solid) 0 0 / calc(100% - var(--stub) - 5px) 100% no-repeat, var(--holes) calc(100% - var(--stub) - 5px) 0 / 10px 13px repeat-y, var(--solid) 100% 0 / calc(var(--stub) - 5px) 100% no-repeat;
  mask: var(--solid) 0 0 / calc(100% - var(--stub) - 5px) 100% no-repeat, var(--holes) calc(100% - var(--stub) - 5px) 0 / 10px 13px repeat-y, var(--solid) 100% 0 / calc(var(--stub) - 5px) 100% no-repeat;
}
.t-left { display: grid; background: #fbf3e2; }
.t-rules { display: grid; align-content: center; gap: 9px; padding: 20px 22px 16px; counter-reset: rule; }
.t-rules li { display: grid; grid-template-columns: 26px minmax(0, 1fr); align-items: baseline; font-size: 15.5px; line-height: 1.35; counter-increment: rule; }
.t-rules li::before { content: counter(rule); font: italic 400 24px/1 var(--serif); color: var(--red); }
.t-stub { position: relative; display: grid; background: #2c0e33; }
.t-stub img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: center 30%; }
.t-stub b { position: relative; align-self: end; padding: 10px 6px 12px; background: #1f0a26; color: #fff8f1; font: 400 19px/1 var(--serif); text-align: center; }
/* The draw order is printed on the ticket under the rules: who's playing, then their numbers on the day. */
.t-order { padding: 12px 22px 16px; border-top: 1.5px dashed rgba(29, 24, 19, 0.16); }
.o-cap { font-size: 13.5px; color: var(--ink-2); transition: opacity 200ms ease; }
.o-cap.swap { opacity: 0; }
.order { display: flex; justify-content: space-between; gap: 8px; margin-top: 8px; }
.order li { display: grid; justify-items: center; gap: 4px; font-size: 13px; color: var(--ink-2); }
.order b { font: italic 400 21px/1 var(--serif); color: var(--red); transition: opacity 260ms ease, transform 520ms var(--out); transition-delay: calc(var(--n) * 120ms); }
.js .elephant:not(.is-drawn) .order b { opacity: 0; transform: translateY(-8px) scale(0.6); transition-delay: 0ms; }
.order img, .disc { width: 40px; height: 40px; border-radius: 50%; }
.disc { display: grid; place-items: center; background: #d4a94a; color: #fff8f1; font: 400 22px/1 var(--serif); }

/* ---------- Reminders, and the widgets that keep count ---------- */
.remind { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); grid-template-areas: 'words widgets'; gap: 48px clamp(32px, 6vw, 104px); align-items: center; }
.remind-words { grid-area: words; }
.banners { display: grid; gap: 10px; max-width: 440px; margin-top: 30px; }
.banner { display: grid; grid-template-columns: 38px minmax(0, 1fr) auto; gap: 12px; align-items: start; padding: 12px 16px 13px 12px; border-radius: 22px; background: rgba(255, 252, 246, 0.86); }
.banner img { width: 38px; height: 38px; border-radius: 9px; }
.banner p { display: grid; }
.banner b { font: 600 15px/1.3 var(--sans); }
.banner span { font-size: 14.5px; line-height: 1.3; color: var(--ink-2); }
.banner time { font-size: 13px; color: var(--ink-2); }
.widgets { grid-area: widgets; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: clamp(18px, 2.2vw, 30px); width: min(100%, 500px); justify-self: center; }
.wd { display: grid; justify-items: center; gap: 10px; }
.wd figcaption { font-size: 13px; color: var(--ink-2); }
.wd-box { --u: calc(100cqw / 170); position: relative; width: 100%; aspect-ratio: 1; border-radius: 13% / 13%; overflow: hidden; background: var(--card); container-type: inline-size; }
.wd-shelf { grid-column: 1 / -1; }
.wd-shelf .wd-box { --u: calc(100cqw / 338); aspect-ratio: 338 / 158; border-radius: 6.4% / 13.7%; }
.wd-count .wd-box { background: #1f3b2d; color: #f6efe4; }
.wd-paper { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: top right; }
.wd-band { position: absolute; top: 0; right: calc(var(--u) * 24); width: calc(var(--u) * 24); height: 100%; max-width: none; object-fit: cover; }
.wd-bow { position: absolute; top: calc(var(--u) * 2); right: 0; width: calc(var(--u) * 72); max-width: none; }
.wd-words { position: absolute; left: calc(var(--u) * 14); right: calc(var(--u) * 66); bottom: calc(var(--u) * 13); display: grid; }
.wd-words b { font: 400 calc(var(--u) * 58)/0.85 var(--serif); }
.wd-words span { margin-top: calc(var(--u) * 4); font: 600 calc(var(--u) * 11)/1.2 var(--sans); opacity: 0.85; }
.wd-words i { font: 400 calc(var(--u) * 16)/1.1 var(--serif); }
/* A box sized by its container cannot size its own padding from it: 12 of 170 points, as a share of its width. */
.wd-list .wd-box { display: grid; grid-template-rows: auto minmax(0, 1fr) auto auto; padding: 7%; }
.wl-who { display: flex; align-items: center; gap: calc(var(--u) * 6); margin-bottom: calc(var(--u) * 8); font: 600 calc(var(--u) * 11.5)/1.2 var(--sans); color: var(--ink-2); }
.wl-who img { width: calc(var(--u) * 20); height: calc(var(--u) * 20); border-radius: 50%; }
/* The photo fills its row exactly: a margin on a full-height picture would push it over the name below. */
.wl-ph { width: 100%; height: 100%; min-height: 0; border-radius: calc(var(--u) * 10); object-fit: cover; }
.wl-n { margin-top: calc(var(--u) * 7); font: 400 calc(var(--u) * 15)/1.1 var(--serif); }
.wl-m { margin-top: calc(var(--u) * 1); font-size: calc(var(--u) * 10.5); line-height: 1.3; color: var(--ink-2); }
.wd-shelf ul { position: absolute; inset: calc(var(--u) * 10) calc(var(--u) * 14) calc(var(--u) * 12); display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: calc(var(--u) * 10); }
.wd-shelf li { display: grid; justify-items: center; align-content: center; text-align: center; }
.wd-shelf li img { width: calc(var(--u) * 84); }
.wd-shelf li span { margin-top: calc(var(--u) * 2); font: 400 calc(var(--u) * 13)/1.15 var(--serif); }

/* ---------- Spent on gifts: the year on Ribbon's red paper ---------- */
.spend { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); grid-template-areas: 'words year'; gap: 48px clamp(32px, 6vw, 104px); align-items: center; }
.spend-words { grid-area: words; }
.budgets { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 28px; }
.budgets button { min-height: 44px; padding: 0 18px; border: 0; border-radius: 999px; background: rgba(255, 252, 246, 0.86); font-size: 16px; font-weight: 600; cursor: pointer; transition: transform 160ms var(--press); -webkit-tap-highlight-color: transparent; }
.budgets button:active { transform: scale(0.96); }
.budgets [aria-checked='true'] { color: var(--cream); background: var(--red) url('img/satin.webp') 0 0 / 100% 100%; }
.year { grid-area: year; position: relative; justify-self: center; width: min(100%, 560px); container-type: inline-size; }
.yr-sheet { --u: calc(100cqw / 350); position: relative; aspect-ratio: 350 / 282; border-radius: calc(var(--u) * 22); overflow: hidden; isolation: isolate; background: #6e0a14; color: #fff8f1; }
.yr-paper { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.yr-sheet::after { content: ''; position: absolute; inset: calc(var(--u) * 6); border: 1px solid rgba(255, 225, 170, 0.36); border-radius: calc(var(--u) * 16); pointer-events: none; } /* taste-skill-ignore: the gilded line just inside the card's edge, as the app draws it */
.yr-label { position: absolute; left: calc(var(--u) * 26); right: calc(var(--u) * 26); top: calc(var(--u) * 24); display: flex; justify-content: space-between; align-items: baseline; font: 600 calc(var(--u) * 16)/1.3 var(--sans); color: rgba(255, 244, 228, 0.9); }
.yr-label span:last-child { font: italic 400 calc(var(--u) * 19)/1 var(--serif); color: #ead08f; }
/* The year's number struck in gold foil: a specular band across a gold gradient, cut by the numerals, as the app strikes it. */
/* The figure struck in gold foil, a picture of the stamp: its canvas is the 84-point line box plus 5.6 points all round. */
.yr-num { position: absolute; left: calc(var(--u) * 18.4); top: calc(var(--u) * 44.4); margin: 0; }
.yr-num img { display: block; width: calc(var(--u) * 140); max-width: none; height: auto; }
.yr-of { position: absolute; right: calc(var(--u) * 26); top: calc(var(--u) * 80); display: grid; justify-items: end; text-align: right; font: 500 calc(var(--u) * 15)/1.3 var(--sans); }
.yr-of span:first-child { color: rgba(255, 244, 228, 0.72); }
.yr-of span:last-child { color: #ead08f; }
.yr-satin { position: absolute; left: 0; right: 0; top: calc(var(--u) * 150); height: calc(var(--u) * 48); }
.yr-track, .yr-in img { position: absolute; left: 0; top: 0; width: 100%; height: 100%; max-width: none; }
.yr-track { opacity: 0.2; }
/* The satin runs as far as what's spent: one layer slides out, its picture slides back the same way, so the satin never stretches. */
.yr-fill, .yr-in { position: absolute; inset: 0; transition: transform 900ms var(--out); }
.yr-fill { overflow: hidden; transform: translateX(calc((var(--p, 0.66) - 1) * 100%)); }
.yr-in { transform: translateX(calc((1 - var(--p, 0.66)) * 100%)); }
/* taste-skill-ignore: stitches where one event's gifts end and the next begin */
.yr-seam { position: absolute; left: 0; top: 24%; bottom: 24%; border-left: 1.5px dashed rgba(169, 138, 98, 0.9); transform: translateX(calc(var(--x, 0) * 100cqw)); transition: transform 900ms var(--out); }
.yr-bow { position: absolute; left: 0; top: 50%; width: calc(var(--u) * 64); max-width: none; transform: translate(calc(var(--b, 0.88) * 100cqw - 50%), -52%); transition: transform 900ms var(--out), opacity 300ms ease; }
.no-budget .yr-bow { opacity: 0; }
.yr-split { position: absolute; left: calc(var(--u) * 26); right: calc(var(--u) * 26); top: calc(var(--u) * 212); font: italic 400 calc(var(--u) * 19)/1.32 var(--serif); color: rgba(255, 244, 228, 0.72); }

/* ---------- Price and trust ---------- */
.price-sec { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); grid-template-areas: 'tag words'; gap: 48px clamp(32px, 6vw, 104px); align-items: center; }
.price-words { grid-area: words; }
/* The paywall's present: the welcome's red paper and gold satin from above, the price on the cotton tag tied to its
   bow (the tag's rig is the app's: assets/ribbon/tag.json, its cord's knot at 3.1% of its height, its face below). */
.gift { --u: calc(100cqw / 100); grid-area: tag; position: relative; justify-self: center; width: min(100%, 440px); aspect-ratio: 100 / 122; container-type: inline-size; }
.gift-shadow { position: absolute; left: calc(var(--u) * -20); top: calc(var(--u) * -20); width: calc(var(--u) * 140); max-width: none; }
.gift-lid { position: absolute; left: 0; top: 0; width: 100%; height: auto; }
.js .gift-shadow, .js .gift-lid { opacity: 0; transform: translateY(22px); transition: opacity 600ms ease, transform 1000ms var(--out); }
.js .gift.in .gift-shadow, .js .gift.in .gift-lid { opacity: 1; transform: none; }
/* Hung from the knot, at 50% and 46% of the lid, turned a little at rest. */
.gift-tag { position: absolute; left: calc(var(--u) * 27); top: calc(var(--u) * 43.7); width: calc(var(--u) * 46); transform-origin: 50% 3.1%; transform: rotate(-3deg); }
/* What the tag casts falls only on the lid, a little down and right of it: below the lid it hangs in the air. */
.gift-cast { position: absolute; left: 0; top: 0; width: 100%; aspect-ratio: 1; overflow: hidden; border-radius: 1.8%; }
.gift-cast-tag { position: absolute; left: calc(var(--u) * 29); top: calc(var(--u) * 46.5); width: calc(var(--u) * 46); max-width: none; opacity: 0.5; transform-origin: 50% 3.1%; transform: rotate(-3deg); }
.js .gift-tag, .js .gift-cast-tag { opacity: 0; transform: rotate(-16deg); }
.js .gift.in .gift-tag { opacity: 1; transform: rotate(-3deg); transition: opacity 400ms ease 300ms, transform 1600ms var(--out) 300ms; }
.js .gift.in .gift-cast-tag { opacity: 0.5; transform: rotate(-3deg); transition: opacity 400ms ease 300ms, transform 1600ms var(--out) 300ms; }
.gift-tag-card { position: relative; display: block; width: 100%; max-width: none; }
/* The words are printed on the tag (PriceWords in tag-words.tsx): sized from the tag, never the reader's text size. */
.gift-words { position: absolute; left: 17.1%; top: 47.8%; width: 65.8%; height: 41.6%; margin: 0; display: grid; place-content: center; justify-items: center; text-align: center; }
.gift-words i { padding-inline: 0.12em; font: italic 400 calc(var(--u) * 5.5)/1.04 var(--serif); color: #b0141e; }
.gift-words b { margin-top: calc(var(--u) * 0.6); font: 400 calc(var(--u) * 15.3)/1.02 var(--serif); letter-spacing: -0.03em; color: #211b15; }
.gift-words span { margin-top: calc(var(--u) * 0.6); padding-inline: 0.12em; font: italic 400 calc(var(--u) * 4.9)/1.2 var(--serif); color: #6b5a4c; }
/* Whose tag it is: the answer in words, and every face in view, the picked one in the red ring. */
.give { margin-top: 28px; }
.give-say { font: 400 26px/1.2 var(--serif); color: var(--ink); }
.give-faces { display: flex; flex-wrap: wrap; gap: 16px; margin-top: 16px; }
.give-faces button { display: grid; justify-items: center; gap: 7px; padding: 0; border: 0; background: none; font-size: 14px; color: var(--ink-2); cursor: pointer; -webkit-tap-highlight-color: transparent; }
.give-faces img { width: 54px; height: 54px; border-radius: 50%; opacity: 0.5; transition: opacity 200ms ease, transform 160ms var(--press); }
.give-faces button:hover img { opacity: 0.8; }
.give-faces button:active img { transform: scale(0.94); }
.give-faces [aria-checked='true'] { color: var(--ink); }
.give-faces [aria-checked='true'] img { opacity: 1; outline: 3px solid var(--red); outline-offset: 3px; }
.price-words .trust { margin-top: 34px; }
.trust { display: grid; gap: 18px; max-width: 54ch; margin-top: 30px; }
.trust li { font-size: 16.5px; color: var(--ink-2); }
.trust b { color: var(--ink); font-weight: 600; }

/* ---------- Questions ---------- */
.faq { display: grid; grid-template-columns: minmax(0, 4fr) minmax(0, 7fr); gap: 28px clamp(32px, 6vw, 104px); align-items: start; }
.faq-words p { margin-top: 18px; max-width: 30ch; font-size: 17px; color: var(--ink-2); }
.faq-words a { color: var(--ink); text-decoration-color: rgba(193, 18, 31, 0.5); text-underline-offset: 3px; }
.qs { display: grid; }
.qs { gap: 6px; }
.qs details { padding: 16px 0 18px; }
.qs summary { position: relative; padding-right: 44px; list-style: none; font: 400 clamp(21px, 1.7vw, 25px)/1.25 var(--serif); cursor: pointer; -webkit-tap-highlight-color: transparent; }
.qs summary::-webkit-details-marker { display: none; }
.qs summary::after { content: '+'; position: absolute; right: 4px; top: 50%; font: 300 30px/1 var(--sans); color: var(--red); transform: translateY(-54%); transition: transform 300ms var(--out); }
.qs details[open] summary::after { transform: translateY(-54%) rotate(45deg); }
.qs details p { max-width: 60ch; margin-top: 10px; font-size: 17px; color: var(--ink-2); }

/* ---------- The dock: Get Ribbon, once you're past the first screen ---------- */
.dock {
  position: fixed;
  right: max(20px, env(safe-area-inset-right));
  bottom: max(20px, env(safe-area-inset-bottom));
  z-index: 20;
  transform: translateY(140%);
  transition: transform 500ms var(--out);
}
.docked .dock { transform: none; }
/* While the header floats with its own Get Ribbon, the dock waits out of sight. */
@media (min-width: 901px) { body.bar .dock { transform: translateY(-170%); } }
/* On a wide screen it waits top right, where the header's button was, clear of every chapter's object. A phone
   has none: a bar at the foot of the screen tints Safari's toolbar, and the header carries Get Ribbon. */
@media (min-width: 901px) {
  .dock { top: max(16px, env(safe-area-inset-top)); bottom: auto; transform: translateY(-170%); }
}
@media (max-width: 900px) {
  .dock { display: none; }
}

.foot {
  max-width: calc(var(--max) + 2 * var(--g));
  margin: 0 auto;
  padding: clamp(40px, 4vw, 64px) var(--g) max(110px, env(safe-area-inset-bottom));
  font-size: 15px;
  color: var(--ink-2);
}
/* Where else to go: every occasion, guide and comparison, so each page links to all the others. */
.foot-nav { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 32px clamp(24px, 3vw, 48px); }
.foot-h { font: 400 22px/1.1 var(--serif); color: var(--ink); }
.foot-nav ul { display: grid; gap: 8px; margin-top: 14px; }
.foot-nav a { text-decoration: none; }
.foot-nav a:hover { color: var(--ink); text-decoration: underline; text-decoration-color: rgba(193, 18, 31, 0.5); text-underline-offset: 3px; }
.foot-small { margin-top: clamp(36px, 4vw, 56px); font-size: 14px; }
.vh { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

/* ---------- Narrow screens: each chapter is its own composition ---------- */
@media (max-width: 1100px) {
  .buy { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); grid-template-areas: 'tag words' 'tag split'; row-gap: 32px; }
  .buy-words { align-self: end; }
  .split { align-self: start; }
}
@media (max-width: 900px) {
  .foot-nav { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  /* On a phone the chats, the switch and the open chat stack in one column. */
  .talk { grid-template-columns: 1fr; grid-template-areas: 'words' 'rooms' 'era' 'panel'; grid-template-rows: none; }
  .talk .era { margin-top: 18px; }
  .rooms-wrap { max-width: none; }
  .panel { margin-top: 28px; }
  .notes { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .ask { grid-template-columns: 1fr; grid-template-areas: 'card' 'words'; }
  .invite { width: min(100%, 560px); }
  /* On a phone the ways to add come first and the tag and its links end it, together on one screen; the link
     keeps room for two lines so the page doesn't move as it types. */
  .add { grid-template-columns: 1fr; grid-template-areas: 'words' 'ways' 'tag' 'try'; }
  .add-tag { margin-top: 40px; width: min(100%, 360px, calc((100svh - 280px) * 0.565)); }
  .a-link { min-height: 74px; }
  .know { grid-template-columns: 1fr; grid-template-areas: 'words' 'table'; }
  .buy { grid-template-columns: 1fr; grid-template-areas: 'words' 'tag' 'split'; }
  .buy-tag { width: min(100%, 340px); }
  .tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .papers { grid-template-columns: 1fr; grid-template-areas: 'words' 'card' 'kinds'; }
  .hcard { width: min(100%, 560px); margin-top: 20px; }
  .games { grid-template-columns: minmax(0, 1fr); grid-template-areas: 'words' 'santa' 'elephant'; row-gap: 44px; }
  .remind, .spend { grid-template-columns: 1fr; grid-template-areas: 'words' 'widgets'; }
  .spend { grid-template-areas: 'words' 'year'; }
  .price-sec { grid-template-columns: 1fr; grid-template-areas: 'tag' 'words'; }
  .gift { width: min(100%, 360px); margin-bottom: -16px; }
  .faq { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  :root { --t4: 17px; }
  .garland { --tw: clamp(190px, min(57vw, 31svh), 240px); --cord-h: 11px; }
  .rooms { padding: 4px; }
  .rooms-wrap { --rh: 52px; }
  .room-old, .room-new { gap: 11px; padding: 0 10px; grid-template-columns: 36px minmax(0, 1fr) auto; }
  .room-new { grid-template-columns: 36px minmax(0, 1fr); }
  .room-old .av, .mark, .mark img { width: 36px; height: 36px; }
  .mark-all img { width: 22px; height: 22px; }
  .mark-all img:nth-child(3) { left: 7px; }
  .mark-all img { width: 26px; height: 26px; }
  .room-new b { font-size: 19px; }
  .room-old i, .room-new i { font-size: 13.5px; }
  .panel { border-radius: 26px; }
  .pn-head { grid-template-columns: 1fr; grid-template-areas: 'title' 'line' 'people'; padding: 16px 16px 6px; }
  .pn-people { --pf: 26px; --ps: 31px; --pg: 16px; margin-top: 10px; }
  .t-new { font-size: 29px; }
  .pn-body { --bh: 462px; }
  .panel { scroll-margin-bottom: 96px; }
  .thread { inset: 0 12px 16px; gap: 6px; }
  .m { grid-template-columns: 26px minmax(0, auto); gap: 7px; max-width: 95%; }
  .m-face { width: 26px; height: 26px; }
  .thread-old .m { grid-template-columns: 26px minmax(0, auto); }
  .thread-old .m.when { grid-template-columns: auto; }
  .thread-old .m-face { width: 26px; height: 26px; }
  .bub { padding: 6px 12px 7px; }
  .bub > b { font-size: 13px; }
  .bub > p { font-size: 15px; }
  .wish { grid-template-columns: 44px minmax(0, 1fr); gap: 10px; }
  .wish img { width: 44px; height: 44px; }
  .wish b { font-size: 16px; }
  .bc { grid-template-columns: 68px auto; gap: 12px; padding-right: 16px; }
  .bc-ph { width: 68px; height: 68px; }
  /* On a phone the four notes are one row you swipe, the next one showing at the edge. */
  .notes { display: flex; gap: 22px; margin-inline: calc(-1 * var(--g)); padding: 0 var(--g) 6px; overflow-x: auto; scroll-snap-type: x mandatory; scroll-padding-inline: var(--g); scrollbar-width: none; }
  .notes::-webkit-scrollbar { display: none; }
  .note { flex: 0 0 76%; grid-template-columns: 1fr; gap: 12px; scroll-snap-align: start; }
  .nt-art { height: auto; min-height: 44px; }
  .fam input { font-size: 28px; }
  .invite { width: calc(100% + 16px); margin-inline: -8px; }
  .inv-tilt, .js .invite.in .inv-tilt { transform: rotate(-1.5deg); }
  .inv-from { font-size: calc(var(--u) * 44); }
  .inv-foot { font-size: calc(var(--u) * 43); }
  .ways li { grid-template-columns: 112px 1fr; gap: 14px; }
  .share-row { gap: 6px; }
  .app i { width: 22px; height: 22px; border-radius: 6px; }
  .app u { width: 15px; }
  .ring img { width: 28px; height: 28px; border-radius: 7px; }
  .ring { border-radius: 10px; }
  .app-ribbon b { display: none; }
  .share-row .app:last-child { display: none; }
  .ways li p { font-size: 16px; }
  .faces { gap: 10px; }
  .face img { width: 54px; height: 54px; }
  .who-card { font-size: 32px; }
  .part { grid-template-columns: 1fr; gap: 12px; }
  .part-sizes ul { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
  .sewn { min-width: 0; padding: 12px 6px 10px; }
  .sewn b { font-size: 34px; }
  .love { font-size: 23px; }
  .tile h3 { font-size: 18px; }
  .side-head > span:first-child { font-size: 26px; }
  .groups { grid-template-columns: 1fr; }
  .kinds { justify-self: stretch; max-width: none; margin-inline: calc(-1 * var(--g)); padding-inline: var(--g); scroll-padding-inline: var(--g); }
  .hcard { width: 100%; }
  .widgets { gap: 16px; }
  .drawn { padding: 18px; }
  .drawn-who { font-size: 28px; }
  .ticket { --stub: 96px; }
  .t-rules { padding: 18px 16px 18px 18px; }
  .t-rules li { grid-template-columns: 22px minmax(0, 1fr); font-size: 14.5px; }
  .order img, .disc { width: 34px; height: 34px; }
  .t-order { padding: 10px 16px 14px 18px; }
  .qs summary { font-size: 21px; }
  .gift { width: min(100%, 300px); }
  .give-say { font-size: 23px; }
  .give-faces { gap: 12px; }
  .give-faces img { width: 50px; height: 50px; }
}

@media (prefers-reduced-motion: reduce) {
  .js .hero h1 .ln > span, .js .hero .lede, .js .hero .act, .js .rise > *, .js .add-tag .a-swing, .js .table .sewn, .js .table .love { transform: none !important; transition: opacity 300ms ease !important; }
  .room-in, .js .talk:not(.after) .room-in { transform: none !important; transition: none !important; }
  .room-new { transform: none; }
  .room-old, .room-new { transition: opacity 300ms ease; }
  .talk.after .room-old, .js .talk:not(.after) .room-new { opacity: 0; }
  .js .talk:not(.after) .room-new { visibility: hidden; }
  .m, .thread.on .m, .react, .thread.on .react { transform: none !important; }
  .pp, .pp-hop.hop { transition-duration: 1ms !important; animation: none !important; }
  .js .invite .inv-tilt, .js .invite.in .inv-tilt { transform: rotate(-2.2deg) !important; }
  .sheet, .sheet-shadow, .front, .back { transition: none; }
  .landing .stamp, .landing .sticker { transition: opacity 200ms ease; }
  .js .gift-tag, .js .gift.in .gift-tag, .js .gift-cast-tag, .js .gift.in .gift-cast-tag { transform: rotate(-3deg); transition: opacity 300ms ease; }
  .js .gift-shadow, .js .gift-lid { transform: none; transition: opacity 300ms ease; }
  .env, .env-seal, .drawn, .yr-fill, .yr-in, .yr-seam, .yr-bow { transform: none; transition: opacity 300ms ease !important; }
  .env-seal { transform: translate(-50%, -50%); }
  .yr-fill { transform: translateX(calc((var(--p, 0.66) - 1) * 100%)); }
  .yr-in { transform: translateX(calc((1 - var(--p, 0.66)) * 100%)); }
  .yr-seam { transform: translateX(calc(var(--x, 0) * 100cqw)); }
  .yr-bow { transform: translate(calc(var(--b, 0.88) * 100cqw - 50%), -52%); }
  .back .got .sticker { transition: opacity 200ms ease; }
}

/* ---------- Short laptop screens ---------- */
/* A held chapter shows whole: on a laptop's shorter screen its padding, type and objects size to the height, so
   nothing it holds sits above the top of the window while you scroll through it. */
@media (min-width: 901px) and (max-height: 900px) {
  .pin .scene > section { padding-block: clamp(14px, 3.2svh, 44px); }
  .pin .scene h2 { font-size: min(var(--t2), 8.4svh); }
  .pin .scene :is(.talk-words, .flip-words, .sides-words, .add-words, .buy-words, .papers-words) p { margin-top: clamp(12px, 2.2svh, 22px); }
  .pin .talk .era { margin-top: clamp(14px, 2.6svh, 26px); }
  .pin .rooms-wrap { --rh: clamp(44px, 6.6svh, 56px); }
  .pin .pn-body { --bh: clamp(360px, calc(100svh - 230px), 490px); }
  .pin .flip { gap: clamp(16px, 3svh, 56px); }
  .pin .whose { margin-top: clamp(14px, 2.6svh, 28px); gap: clamp(20px, 2.4vw, 28px); }
  .pin .who img { width: clamp(50px, 7.6svh, 68px); height: clamp(50px, 7.6svh, 68px); }
  .pin .turn { width: min(100%, 1060px, calc((100svh - 370px) * 2.57)); }
}

/* On a phone the steps take turns in one line above the lists, the one now in full. */
@media (max-width: 640px) {
  .sync-steps { grid-template-columns: minmax(0, 1fr); margin-top: 22px; }
  .sync-steps li { grid-area: 1 / 1; padding-top: 0; opacity: 0; }
  .sync-steps li.done { opacity: 0; }
  .sync-steps li.on { opacity: 1; }
  .sync-steps li::before, .sync-steps li::after { display: none; }
  .sync-steps b { font-size: 30px; }
  .sync-steps span { font-size: 21px; min-height: 2.4em; }
}
