/* ==========================================================================
   PageTide sales page (snippets/tour/*, assets/js/tour.js)
   Loaded only on an app page with the full sales page on. site.css stays the
   base: paper, grain, inks, header, footer, buttons, stamps, FAQ.

   Proportion system. Root font size stays 100 %. Everything on this page is
   measured from these tokens and nothing else:
     type     --t-display 3 → 5.75rem, --t-h2 2.25 → 4rem, --t-h3 1.375 → 1.875rem,
              --t-lead 1.125 → 1.375rem, body 1.125rem (site.css)
     width    --c-content 72rem (reading blocks), --c-wide 100rem (scenes)
     devices  --ph  iPhone body height = min(74svh, 48rem)   (66svh, 34rem on phones)
              --th  iPad body height  = min(76svh, 50rem, viewport width − gutters)
     space    --sp-scene 4 → 8rem between scenes, --sp-block 2 → 3.5rem inside,
              --sp-inner 1 → 1.5rem between a heading and its words
   A scene is a centred pair: copy (max --copy-w) and a stage that hugs its
   device. Each stage prints its own ink field, so a field always backs the
   device it belongs to and never floats.

   Devices are drawn from Apple's published dimensions (see snippets/tour/phone.php
   and tablet.php). Their screens are size containers; --u is one iOS point.
   Motion is transform and opacity only. Reduced motion: every scene rests.
   ========================================================================== */

@font-face {
  font-family: "AtkinsonHyperlegible";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("../fonts/atkinson-hyperlegible-regular.woff") format("woff");
}
@font-face {
  font-family: "OpenDyslexic3";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("../fonts/opendyslexic3-regular.woff") format("woff");
}

/* ---------- tokens ---------- */
.tour {
  --t-display: clamp(3rem, 2.2rem + 3.2vw, 5.75rem);
  --t-h2: clamp(2.25rem, 1.6rem + 2.2vw, 4rem);
  --t-h3: clamp(1.375rem, 1.15rem + .75vw, 1.875rem);
  --t-lead: clamp(1.125rem, 1rem + .45vw, 1.375rem);

  --c-content: 72rem;
  --c-wide: 100rem;
  --copy-w: clamp(24rem, 18rem + 14vw, 38rem);

  --sp-scene: clamp(4rem, 2.5rem + 5vw, 8rem);
  --sp-block: clamp(2rem, 1.5rem + 2vw, 3.5rem);
  --sp-inner: clamp(1rem, .85rem + .6vw, 1.5rem);
  --g-col: clamp(2rem, .5rem + 4.5vw, 6.5rem);

  --ph: min(74svh, 48rem);
  --th: min(76svh, 50rem, calc(100vw - 2 * var(--gutter)));

  --ease-turn: cubic-bezier(.22, .9, .3, 1);   /* PTMotion.smooth / the Turn: zero-bounce springs */
  --ease-mark: cubic-bezier(.3, .7, .3, 1);    /* the word mark's waterline */
}
@media (max-width: 639px) {
  .tour { --ph: min(66svh, 34rem); }
}

.t-wide, .t-content {
  width: 100%;
  margin-inline: auto;
  padding-inline: var(--gutter);
}
.t-wide { max-width: calc(var(--c-wide) + 2 * var(--gutter)); }
.t-content { max-width: calc(var(--c-content) + 2 * var(--gutter)); }

.tour h2 { font-size: var(--t-h2); max-width: 17ch; }
.t-lead {
  margin-top: var(--sp-inner);
  max-width: 34em;
  font-size: var(--t-lead);
  line-height: 1.45;
  font-weight: 500;
  color: var(--deep);
}

/* ---------- scene rhythm and the copy + stage pair ---------- */
.tour > section { overflow-x: clip; }
.t-scene { padding-top: var(--sp-scene); }
.tour > :last-child { padding-bottom: var(--sp-scene); }

.t-grid {
  display: grid;
  grid-template-columns: minmax(0, var(--copy-w)) auto;
  justify-content: center;
  align-items: center;
  gap: var(--sp-block) var(--g-col);
}
.t-grid--flip { grid-template-columns: auto minmax(0, var(--copy-w)); }
.t-grid--flip > .t-copy { order: 2; }
.t-copy { min-width: 0; }

/* the stage hugs its device; its field is printed from the stage's own box */
.t-stage {
  position: relative;
  display: grid;
  justify-items: center;
  align-content: center;
  padding: clamp(1.25rem, 2.6vw, 2.75rem) clamp(1.5rem, 3.4vw, 3.75rem);
}
.t-stage::before {
  content: "";
  position: absolute;
  inset: 11% 0 8% 0;
  background: var(--ink-1);
  mix-blend-mode: multiply;
  clip-path: var(--cut-field);
  -webkit-mask: var(--m-ink) 120px 60px / 640px 640px;
  mask: var(--m-ink) 120px 60px / 640px 640px;
}
.t-stage::after {
  content: "";
  position: absolute;
  right: -4%;
  top: 2%;
  width: 34%;
  aspect-ratio: 1;
  background: var(--ink-2);
  mix-blend-mode: multiply;
  -webkit-mask: var(--m-bloom) center / 100% 100% no-repeat;
  mask: var(--m-bloom) center / 100% 100% no-repeat;
  pointer-events: none;
}
.t-stage--key::before { background: var(--ink-2); clip-path: var(--cut-field-b); }
.t-stage--key::after { background: var(--ink-1); left: -5%; right: auto; top: auto; bottom: 0; }

/* devices: assets/css/devices.css (shared with the home page) */

/* a recording that brings its own bezel stands where the frame would */
.t-video--bezel { display: block; position: relative; z-index: 60; width: auto; object-fit: contain; }
.t-video--bezel.t-video--phone { height: var(--ph); }
.t-video--bezel.t-video--tablet { height: var(--th); }

/* ---------- the reader page (iOS points through --u) ---------- */
.rd {
  --u: calc(100cqw / 440);
  --rd-font: "Iowan Old Style", "Sitka Text", Palatino, "Book Antiqua", serif;
  position: absolute;
  inset: 0;
  overflow: hidden;
  background: var(--rd-bg);
  color: var(--rd-tx);
  font-family: var(--rd-font);
  -webkit-font-smoothing: antialiased;
}
.rd[data-theme="light"] { --rd-bg: #FFFFFF; --rd-tx: #1B1B1D; --rd-2: #66666B; --ember: 232, 163, 61; --sent-a: .22; --word-a: .55; --land-a: .35; --tide: 11, 107, 120; --pm-a: .24; --hl-a: .42; --bar: rgba(255, 255, 255, .94); --bar-tx: #1B1B1D; }
.rd[data-theme="sepia"] { --rd-bg: #F4ECD8; --rd-tx: #433526; --rd-2: #6F5C45; --ember: 232, 163, 61; --sent-a: .22; --word-a: .55; --land-a: .35; --tide: 11, 107, 120; --pm-a: .24; --hl-a: .42; --bar: rgba(255, 255, 255, .9); --bar-tx: #1B1B1D; }
.rd[data-theme="dark"]  { --rd-bg: #121214; --rd-tx: #E6E6E8; --rd-2: #9A9AA0; --ember: 242, 184, 92; --sent-a: .28; --word-a: .28; --land-a: .32; --tide: 92, 200, 212; --pm-a: .30; --hl-a: .36; --bar: rgba(52, 52, 56, .92); --bar-tx: #F2F2F4; }
.rd[data-theme="black"] { --rd-bg: #000000; --rd-tx: #D9D9DB; --rd-2: #8E8E93; --ember: 242, 184, 92; --sent-a: .28; --word-a: .29; --land-a: .34; --tide: 92, 200, 212; --pm-a: .30; --hl-a: .36; --bar: rgba(44, 44, 48, .92); --bar-tx: #F2F2F4; }

.rd__head, .rd__foot {
  position: absolute;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0;
  font-family: -apple-system, system-ui, "SF Pro Text", "Helvetica Neue", sans-serif;
  font-size: calc(11 * var(--u));
  font-weight: 400;
  line-height: 1.2;
  white-space: nowrap;
  color: var(--rd-2);
  font-variant-numeric: tabular-nums;
}
.rd__head { top: calc(59 * var(--u)); height: calc(44 * var(--u)); left: calc(32 * var(--u)); right: calc(32 * var(--u)); overflow: hidden; }
.rd__foot { bottom: calc(102 * var(--u)); height: calc(44 * var(--u)); left: calc(16 * var(--u)); right: calc(16 * var(--u)); }
.rd__foot > span { grid-area: 1 / 1; transition: opacity .25s ease-out; }
.rd__foot { display: grid; place-items: center; }
.rd__note { font-size: calc(13 * var(--u)); font-weight: 600; color: var(--rd-tx); }
.rd__foot [hidden] { display: block; opacity: 0; }

.rd__col {
  position: absolute;
  top: calc(111 * var(--u));
  height: calc(682 * var(--u));   /* 31 whole lines of 22 pt inside the 111 / 154 pt insets */
  left: calc(20 * var(--u));
  right: calc(20 * var(--u));
  overflow: hidden;
}
.rd__text {
  position: relative;
  font-size: calc(16 * var(--u));
  line-height: calc(22 * var(--u));
  text-align: justify;
  -webkit-hyphens: auto;
  hyphens: auto;
  font-kerning: normal;
  font-variant-numeric: oldstyle-nums;
}
.rd__p { margin: 0; text-indent: 1em; }
.rd__p--cont { text-indent: 0; }
.rd__break { width: calc(140 * var(--u)); margin: calc(22 * var(--u)) auto calc(32 * var(--u)); border: 0; border-top: calc(1 * var(--u)) solid currentColor; }
.rd__break + .rd__p { text-indent: 0; }
.rd em { font-style: italic; }

/* read-along layers: a wash per sentence, a mark per word (SPECS 1.2, 1.3) */
.rd .s { padding-block: calc(2.5 * var(--u)); -webkit-box-decoration-break: clone; box-decoration-break: clone; }
.rd .s.is-wash { background: rgba(var(--ember), var(--sent-a)); }
.rd .s.is-land { background: rgba(var(--ember), var(--land-a)); }
.rd .s.is-placed { background: rgba(var(--tide), var(--pm-a)); }
.rd .w.is-word { background: rgba(var(--ember), var(--word-a)); border-radius: calc(3 * var(--u)); box-shadow: 0 0 0 calc(2 * var(--u)) rgba(var(--ember), var(--word-a)); }
.rd.is-live .w.is-word { background: none; box-shadow: none; }
.rd__mark {
  position: absolute;
  left: 0;
  top: 0;
  border-radius: calc(3 * var(--u));
  background: rgba(var(--ember), var(--word-a));
  mix-blend-mode: multiply;
  opacity: 0;
  pointer-events: none;
  transition: transform .16s var(--ease-mark), opacity .16s linear;
}
.rd[data-theme="dark"] .rd__mark, .rd[data-theme="black"] .rd__mark { mix-blend-mode: screen; border-bottom: calc(2 * var(--u)) solid rgb(var(--ember)); }
.rd__mark.is-on { opacity: 1; }
.rd__mark.is-dim { opacity: .35; transition: opacity 1s ease-out; }
.rd__mark.is-jump { transition: none; }


/* the read-along bar: a 52 pt capsule, four 44 pt buttons */
.rd__bar {
  position: absolute;
  z-index: 3;
  bottom: calc(42 * var(--u));
  left: 50%;
  translate: -50% 0;
  display: flex;
  align-items: center;
  height: calc(52 * var(--u));
  padding: 0 calc(10 * var(--u));
  border-radius: calc(26 * var(--u));
  background: var(--bar);
  color: var(--bar-tx);
  box-shadow: 0 calc(6 * var(--u)) calc(20 * var(--u)) rgba(0, 0, 0, .1), 0 0 0 calc(.5 * var(--u)) rgba(0, 0, 0, .06);
}
.rd__b {
  display: grid;
  place-items: center;
  width: calc(44 * var(--u));
  height: calc(44 * var(--u));
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: none;
  color: inherit;
  font: 600 calc(17 * var(--u)) / 1 -apple-system, system-ui, sans-serif;
}
.rd__b svg { width: calc(22 * var(--u)); height: calc(22 * var(--u)); }
button.rd__b { cursor: pointer; }
button.rd__b:focus-visible { outline: 2px solid var(--press); outline-offset: 2px; }
.rd__i-pause { display: none; }
.rd.is-playing .rd__i-pause { display: block; }
.rd.is-playing .rd__i-play { display: none; }

/* the dart: text-inked, opacity .7 at rest, tab flush with the screen edge */
.rd__dart {
  position: absolute;
  z-index: 2;
  right: 0;
  top: calc(107 * var(--u));
  width: calc(17.5 * var(--u));
  height: calc(9.55 * var(--u));
  margin-top: calc(-4.78 * var(--u));
  color: var(--rd-tx);
  opacity: .7;
  transform-origin: 100% 50%;
}
.rd__dart svg { display: block; width: 100%; height: 100%; }
.rd__dart--faint { opacity: .4; }
.rd__dart--left { right: auto; left: 0; scale: -1 1; transform-origin: 0 50%; }

/* reader fonts (SPECS 2.1) */
.f-original { --rd-font: "Iowan Old Style", "Sitka Text", Palatino, "Book Antiqua", serif; }
.f-newyork  { --rd-font: ui-serif, "New York", "Iowan Old Style", Georgia, serif; }
.f-iowan    { --rd-font: "Iowan Old Style", "Sitka Text", Palatino, serif; }
.f-charter  { --rd-font: Charter, "Bitstream Charter", "Charis SIL", Georgia, serif; }
.f-georgia  { --rd-font: Georgia, serif; }
.f-palatino { --rd-font: Palatino, "Palatino Linotype", "Book Antiqua", serif; }
.f-sf       { --rd-font: -apple-system, system-ui, "SF Pro Text", "Helvetica Neue", sans-serif; }
.f-atkinson { --rd-font: "AtkinsonHyperlegible", "Atkinson Hyperlegible", sans-serif; }
.f-dyslexic { --rd-font: "OpenDyslexic3", "OpenDyslexic", sans-serif; }

/* ---------- hero ---------- */
.t-hero { padding-top: clamp(1rem, .5rem + 1.5vw, 2rem); }
.t-hero__grid {
  display: grid;
  grid-template-columns: minmax(0, var(--copy-w)) auto;
  justify-content: center;
  align-items: center;
  gap: var(--sp-block) var(--g-col);
}
.t-back { font-size: 1.125rem; margin-bottom: var(--sp-inner); }
.t-hero__id { display: flex; align-items: center; gap: clamp(.875rem, .5rem + 1vw, 1.5rem); }
.t-hero__icon { flex: none; width: clamp(3.75rem, 2.75rem + 2.6vw, 5.5rem); height: auto; aspect-ratio: 1; border-radius: 22%; position: relative; z-index: 60; }
.t-hero__name { font-size: var(--t-display); line-height: .9; }
.t-hero__tag {
  margin-top: var(--sp-inner);
  font-size: var(--t-h3);
  font-weight: 800;
  font-stretch: 75%;
  line-height: 1.05;
  color: var(--deep);
  mix-blend-mode: multiply;
}
.t-hero__pitch { margin-top: var(--s-4); max-width: 30em; font-size: var(--t-lead); line-height: 1.45; font-weight: 500; color: var(--deep); }
.t-hero__act { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s-4) var(--s-6); margin-top: var(--sp-block); }
.t-hero__links { display: flex; flex-wrap: wrap; gap: var(--s-1) var(--s-5); }
.t-hero__links .link-arrow { font-size: 1.125rem; }
.t-hero__fine { margin-top: var(--sp-inner); font-size: var(--fs-small); line-height: 1.6; font-weight: 600; color: var(--press); }

.t-stage--hero { --ph: min(68svh, 46rem); padding-bottom: clamp(.75rem, 1.6vw, 1.5rem); }
@media (max-width: 639px) { .t-stage--hero { --ph: min(64svh, 33rem); } }
.t-stage--hero::before { inset: 14% -2% 15% 8%; }
.t-stage--hero::after { right: -6%; top: 0; width: 38%; }
.t-hero__devs { position: relative; display: flex; align-items: flex-end; }
.dev--hero-tab { --th: calc(var(--ph) * .86); margin-right: calc(var(--ph) * -.17); margin-bottom: calc(var(--ph) * .05); }
.dev--hero-tab .dev__shot { object-position: top center; }
.t-hero__ctl { position: relative; z-index: 61; display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: var(--s-2) var(--s-5); margin-top: clamp(.75rem, 1.5vw, 1.25rem); }
.t-src { max-width: 28em; font-size: .8125rem; line-height: 1.4; font-weight: 600; text-align: center; color: var(--press); }

/* ---------- controls: cut-paper, real buttons with states ---------- */
.t-play, .t-toggle, .t-again, .t-step, .t-chip {
  position: relative;
  isolation: isolate;
  border: 0;
  background: none;
  font: inherit;
  color: var(--press);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.t-play, .t-toggle, .t-again {
  display: inline-flex;
  align-items: center;
  gap: .55em;
  min-height: 2.75rem;
  padding: .55em 1.1em .6em .95em;
  font-size: 1.0625rem;
  font-weight: 800;
  font-stretch: 85%;
  line-height: 1.1;
  --hx: -3px; --hy: -2px;
}
.t-play::before, .t-toggle::before, .t-again::before {
  content: "";
  position: absolute;
  z-index: -1;
  inset: 0;
  background: var(--paper);
  border: 2px solid var(--press);
  clip-path: var(--cut-btn);
}
.t-play::after, .t-toggle::after, .t-again::after {
  content: "";
  position: absolute;
  z-index: -1;
  inset: 2px;
  background: var(--paper);
  clip-path: var(--cut-btn);
  transition: background-color .12s linear;
}
.t-play:is(:hover, :focus-visible)::after, .t-toggle:is(:hover, :focus-visible)::after, .t-again:is(:hover, :focus-visible)::after { background: var(--ink-3); }
.t-play[aria-pressed="true"] { color: var(--on-key); }
.t-play[aria-pressed="true"]::before { background: var(--ink-2); border-color: var(--ink-2); }
.t-play[aria-pressed="true"]::after { background: var(--ink-2); }
.t-play:focus-visible, .t-toggle:focus-visible, .t-again:focus-visible, .t-step:focus-visible, .t-chip:focus-visible { outline: 3px solid var(--press); outline-offset: 4px; }
.t-play svg, .t-toggle svg, .t-again svg { width: 1.05em; height: 1.05em; flex: none; }
.t-play__i--pause, .t-play__on { display: none; }
.t-play[aria-pressed="true"] .t-play__i--pause, .t-play[aria-pressed="true"] .t-play__on { display: inline; }
.t-play[aria-pressed="true"] .t-play__i--play, .t-play[aria-pressed="true"] .t-play__off { display: none; }
.t-play[aria-pressed="true"] .t-play__i--pause { display: block; }
.t-toggle__port { display: none; }
.t-toggle[data-land="false"] .t-toggle__land { display: none; }
.t-toggle[data-land="false"] .t-toggle__port { display: inline; }
html:not(.js) .t-play, html:not(.js) .t-toggle, html:not(.js) .t-again { display: none; }

/* step lists: the scene's sequence, readable as text and usable as controls */
.t-steps { display: grid; gap: 0; margin-top: var(--sp-block); counter-reset: step; }
.t-steps li { position: relative; }
.t-steps li::before {
  content: "";
  display: block;
  height: 10px;
  background: var(--ink-2);
  mix-blend-mode: multiply;
  -webkit-mask: var(--m-dots-fine) 0 0 / 8px 8px;
  mask: var(--m-dots-fine) 0 0 / 8px 8px;
}
.t-step {
  display: grid;
  grid-template-columns: 2.25rem minmax(0, 1fr);
  gap: .15rem .9rem;
  width: 100%;
  padding: .95rem .5rem .95rem 0;
  text-align: left;
  counter-increment: step;
}
.t-step__n {
  grid-row: span 2;
  position: relative;
  display: grid;
  place-items: center;
  width: 2.25rem;
  height: 2.25rem;
  font-size: 1.375rem;
  font-weight: 800;
  font-stretch: 75%;
  color: var(--ink-2);
}
.t-step__n::before { content: counter(step); position: relative; mix-blend-mode: multiply; }
.t-step__n::after {
  content: "";
  position: absolute;
  z-index: -1;
  inset: 0;
  background: var(--ink-3);
  mix-blend-mode: multiply;
  clip-path: var(--cut-plate);
  opacity: 0;
  transition: opacity .16s linear;
}
.t-step strong { font-size: var(--t-h3); font-weight: 800; font-stretch: 75%; line-height: 1.05; color: var(--ink-2); }
.t-step > span:last-child { font-size: 1.0625rem; line-height: 1.5; font-weight: 500; color: var(--press); }
.t-step[aria-pressed="true"] .t-step__n::after, .t-step:hover .t-step__n::after { opacity: 1; }
.t-step[aria-pressed="true"] strong { color: var(--deep); }
html:not(.js) .t-step { cursor: default; }
.t-steps--two .t-step { grid-template-columns: minmax(0, 1fr); padding-left: 0; }
.t-steps--two .t-step__n { display: none; }
.t-steps--two .t-step strong { justify-self: start; padding: 0 .25rem; margin-left: -.25rem; background: linear-gradient(var(--ink-3), var(--ink-3)) 0 85% / 0 .55em no-repeat; transition: background-size .18s var(--out); }
.t-steps--two .t-step[aria-pressed="true"] strong, .t-steps--two .t-step:hover strong { background-size: 100% .55em; }
.t-again { margin-top: var(--s-5); }
.t-again__on { display: none; }
.t-again[aria-pressed="true"] .t-again__on { display: inline; }
.t-again[aria-pressed="true"] .t-again__off { display: none; }

/* ---------- scene recordings and stills inside a device screen ---------- */
.tv { position: absolute; inset: 0; background: #0B0B0D; }
.tv > .t-video, .tv__view {
  position: absolute;
  inset: 0;
  opacity: 0;
  transition: opacity .35s ease-out;
}
.tv > .t-video.is-on, .tv__view.is-on { opacity: 1; }
.t-video { display: block; width: 100%; height: 100%; object-fit: cover; background: #0B0B0D center / cover no-repeat; }
.dev__land > .t-video { position: absolute; inset: 0; }
.tv__view .dev__shot { display: block; width: 100%; height: 100%; object-fit: cover; }
.t-vplay {
  position: absolute;
  z-index: 8;
  left: 50%;
  bottom: 7%;
  translate: -50% 0;
  display: inline-flex;
  align-items: center;
  gap: .5em;
  min-height: 2.75rem;
  padding: .55em 1.05em .6em .9em;
  border: 0;
  background: var(--paper);
  font: 800 1rem / 1.1 var(--font);
  font-stretch: 85%;
  color: var(--press);
  white-space: nowrap;
  cursor: pointer;
  clip-path: var(--cut-btn);
}
.t-vplay svg { width: 1em; height: 1em; }
.t-vplay__s { display: none; }
.t-vplay[aria-pressed="true"] .t-vplay__p { display: none; }
.t-vplay[aria-pressed="true"] .t-vplay__s { display: block; }
.t-vplay:is(:hover, :focus-visible) { background: var(--ink-3); }
.t-vplay:focus-visible { outline: 3px solid var(--press); outline-offset: 3px; }
.t-vplay[hidden] { display: none; }

/* the dart at the app's own pixels, after the step that names it */
.tn-pix { margin: var(--sp-inner) 0 0; display: flex; flex-wrap: wrap; align-items: center; gap: .5rem .9rem; }
.tn-pix__img { display: block; width: min(14rem, 60vw); height: auto; background: #fff; clip-path: polygon(0 4%, 98% 0, 100% 100%, 2% 97%); position: relative; z-index: 60; }
.tn-pix figcaption { max-width: 12rem; font-size: .875rem; font-weight: 700; line-height: 1.35; color: var(--press); }
@media (max-width: 1023px) { .tn-pix { justify-content: center; margin-top: var(--sp-block); } }

/* the step on screen, repeated under the phone when the list sits far below it */
.tn-now { display: none; }
@media (max-width: 1023px) {
  .tn-now { position: relative; z-index: 61; display: block; max-width: 24rem; margin-top: .75rem; padding: .55rem .8rem .6rem; background: var(--paper); font-size: .9375rem; line-height: 1.4; text-align: center; color: var(--press); }
  .tn-now b { display: block; font-size: 1.125rem; font-weight: 800; font-stretch: 75%; color: var(--ink-2); }
  /* the list becomes three compact buttons; the caption above carries the sentence */
  .t-steps--turn { display: flex; flex-wrap: wrap; justify-content: center; gap: .5rem; margin-top: var(--sp-inner); max-width: none; }
  .t-steps--turn li::before { display: none; }
  .t-steps--turn .t-step { grid-template-columns: auto auto; gap: 0 .45rem; width: auto; align-items: center; padding: .4rem .7rem .45rem .35rem; }
  .t-steps--turn .t-step__n { grid-row: auto; width: 1.9rem; height: 1.9rem; font-size: 1.125rem; }
  .t-steps--turn .t-step strong { font-size: 1.125rem; }
  .t-steps--turn .t-step > span:last-child { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
}

/* ---------- the iPad turn ---------- */
.t-stage--spread::before { inset: 16% -3% 12% -3%; background: var(--ink-1); }
.t-stage--spread::after { width: 30%; right: -2%; top: 4%; }
.t-turntable { width: var(--th); height: var(--th); display: grid; place-items: center; }
.dev--spread { transition: rotate .9s cubic-bezier(.45, 0, .2, 1); }
.dev--spread.is-land { rotate: -90deg; }
.dev--spread .dev__port { transition: opacity .3s linear .2s; }
.dev--spread .dev__land { transition: opacity .35s linear .5s; }
.dev--spread.is-land .dev__port { opacity: 0; transition-delay: .15s; }
.dev--spread.is-land .dev__land { opacity: 1; }
.dev--spread:not(.is-land) .dev__land { transition-delay: 0s; transition-duration: .2s; }

.t-quote { margin-top: var(--sp-inner); font-size: 1.0625rem; line-height: 1.5; font-weight: 600; color: var(--press); }
.t-quote__v { font-family: -apple-system, system-ui, sans-serif; font-weight: 600; color: var(--deep); background: linear-gradient(var(--ink-3), var(--ink-3)) 0 88% / 100% .5em no-repeat; }
.t-toggle { margin-top: var(--sp-block); }

/* ---------- themes and fonts ---------- */
.t-pick { margin: var(--sp-inner) 0 0; padding: 0; border: 0; min-width: 0; }
.t-lead + .t-pick { margin-top: var(--sp-block); }
.t-pick + .t-pick { margin: var(--sp-inner) 0 0; padding: 0; border: 0; min-width: 0; }
.t-pick__k { padding: 0; margin-bottom: .6rem; font-size: .8125rem; font-weight: 700; letter-spacing: .09em; text-transform: uppercase; color: var(--press); }
.t-pick__row { display: flex; flex-wrap: wrap; gap: .5rem .55rem; }
.t-chip {
  display: inline-flex;
  align-items: center;
  gap: .5em;
  min-height: 2.75rem;
  padding: .5rem .95rem .55rem;
  font-size: 1rem;
  font-weight: 700;
  line-height: 1.1;
}
.t-chip::before, .t-chip::after {
  content: "";
  position: absolute;
  z-index: -1;
  inset: 0;
  background: var(--press);
  clip-path: polygon(0 18%, 6% 0, 100% 5%, 98% 100%, 1% 94%);
}
.t-chip::after { inset: 2px; background: var(--paper); transition: background-color .12s linear; }
.t-chip:hover::after { background: var(--ink-3); }
.t-chip[aria-pressed="true"] { color: var(--on-key); }
.t-chip[aria-pressed="true"]::before, .t-chip[aria-pressed="true"]::after { background: var(--ink-2); }
.t-chip i { width: 1.05em; height: 1.05em; flex: none; border: 1.5px solid currentColor; }
.t-chip--light i { background: #FFFFFF; }
.t-chip--sepia i { background: #F4ECD8; }
.t-chip--dark i { background: #121214; }
.t-chip--black i { background: #000000; }
.t-chip--font { font-family: var(--rd-font); font-weight: 400; font-size: 1rem; padding-inline: .8rem; }
.t-chip--font.f-sf, .t-chip--font.f-atkinson { font-size: 1rem; }
.t-chip--font.f-dyslexic { font-size: .875rem; }
.t-again--quiet { margin-top: var(--sp-inner); font-size: .9375rem; }
.t-pick__more { margin-top: .6rem; font-size: .9375rem; font-weight: 600; line-height: 1.45; }

/* ---------- notes and the Markdown file ---------- */
.t-stage--notes::before { inset: 10% 6% 6% 0; }
.t-ticks { display: grid; gap: .55rem; margin-top: var(--sp-block); }
.t-ticks li { position: relative; padding-left: 1.6rem; font-size: 1.0625rem; font-weight: 600; line-height: 1.4; }
.t-ticks li::before { content: ""; position: absolute; left: 0; top: .32em; width: .85rem; height: .85rem; background: var(--ink-1); mix-blend-mode: multiply; clip-path: var(--cut-sticker); }
.t-ticks--row { display: flex; flex-wrap: wrap; gap: .5rem 1.6rem; }

/* ---------- your files ---------- */
.t-stage--files::before { inset: 12% -4% 10% 6%; background: var(--ink-2); clip-path: var(--cut-field-b); }
.t-stage--files::after { left: -4%; right: auto; top: auto; bottom: 2%; background: var(--ink-1); }
.dev--files { --th: min(56svh, 38rem, calc((100vw - 2 * var(--gutter)) / .76667)); }
.t-folders { display: flex; flex-wrap: wrap; gap: .55rem .5rem; margin-top: var(--sp-block); }
.t-folders li {
  position: relative;
  isolation: isolate;
  padding: .75rem 1rem .6rem 1rem;
  font-size: 1.0625rem;
  font-weight: 800;
  font-stretch: 85%;
  line-height: 1;
  color: var(--deep);
}
.t-folders li::before {
  content: "";
  position: absolute;
  z-index: -1;
  inset: 0;
  background: var(--ink-3);
  mix-blend-mode: multiply;
  clip-path: polygon(0 26%, 10% 26%, 16% 0, 46% 0, 52% 26%, 100% 26%, 100% 100%, 0 100%);
}
.t-folders li.is-abs::before { background: var(--ink-1); }
.t-facts { display: grid; gap: var(--s-4); margin-top: var(--sp-block); }
.t-facts p { max-width: 34em; font-size: 1.0625rem; line-height: 1.5; }
.t-facts b { font-weight: 800; color: var(--deep); }

/* ---------- CarPlay and Reading Targets: two printed plates ---------- */
.t-pair__grid { display: grid; grid-template-columns: minmax(0, .8fr) minmax(0, 1.25fr); align-items: start; gap: var(--sp-block) var(--g-col); max-width: calc(var(--c-content) + 2 * var(--gutter) + 8rem); }
.t-plate { position: relative; padding: clamp(1.75rem, 1rem + 2.4vw, 3.25rem); }
.t-plate h2 { font-size: clamp(1.875rem, 1.4rem + 1.6vw, 3rem); }
.t-plate::before {
  content: "";
  position: absolute;
  inset: 0;
  background: var(--ink-3);
  mix-blend-mode: multiply;
  clip-path: var(--cut-field-b);
}
.t-plate--targets::before { clip-path: var(--cut-field); }
.t-plate > * { position: relative; }
.car { margin-top: var(--sp-block); max-width: 26em; font-size: var(--t-h3); font-weight: 800; font-stretch: 75%; line-height: 1.15; color: var(--deep); }
.car span { color: var(--ink-2); mix-blend-mode: multiply; }
.t-plate .t-ticks--row { margin-top: var(--sp-inner); }


/* ---------- the plain facts ---------- */
.t-big {
  position: relative;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: var(--sp-block) var(--sp-block);
  max-width: calc(var(--c-wide) - 8rem);
  margin-inline: auto;
  padding: clamp(2rem, 1.25rem + 2.6vw, 3.75rem) clamp(1.5rem, 1rem + 2.4vw, 3.5rem);
}
.t-big::before {
  content: "";
  position: absolute;
  inset: 0;
  background: var(--ink-2);
  clip-path: var(--cut-slab);
  -webkit-mask: var(--m-ink) 40px 300px / 640px 640px;
  mask: var(--m-ink) 40px 300px / 640px 640px;
}
.t-big li { position: relative; display: grid; gap: .6rem; align-content: start; }
.t-big__w { font-size: clamp(2rem, 1.4rem + 1.9vw, 3.25rem); font-weight: 800; font-stretch: 75%; line-height: .95; color: var(--on-key); }
.t-big__s { max-width: 22em; font-size: 1rem; line-height: 1.45; font-weight: 500; color: var(--on-key); }

/* ---------- price ---------- */
.t-price__grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr); gap: var(--sp-block) var(--g-col); align-items: center; }
.t-price h2 { font-size: var(--t-display); }
.t-tag {
  position: relative;
  isolation: isolate;
  padding: clamp(2.25rem, 1.5rem + 2.4vw, 3.5rem) clamp(1.75rem, 1rem + 2.4vw, 3.25rem) clamp(2rem, 1.5rem + 2vw, 3rem) clamp(3.75rem, 2.5rem + 3vw, 5.25rem);
  color: var(--deep);
}
.t-tag::before {
  content: "";
  position: absolute;
  z-index: -1;
  inset: 0;
  background: var(--ink-3);
  mix-blend-mode: multiply;
  clip-path: var(--cut-tag);
  -webkit-mask: radial-gradient(circle .65rem at 2rem 2rem, #0000 97%, #000);
  mask: radial-gradient(circle .65rem at 2rem 2rem, #0000 97%, #000);
}
.t-tag__lead { font-size: var(--t-h3); font-weight: 800; font-stretch: 75%; line-height: 1.05; }
.t-tag__fig { margin-top: .35rem; font-size: clamp(2.5rem, 1.8rem + 2.4vw, 4.25rem); font-weight: 800; font-stretch: 75%; line-height: .95; color: var(--ink-2); mix-blend-mode: multiply; }
.t-tag__body { margin-top: var(--sp-inner); }
.t-tag__body p { max-width: 36em; font-size: 1.0625rem; line-height: 1.55; font-weight: 500; }
.t-tag__body p + p { margin-top: .75rem; }
.t-tag__soon { margin-top: var(--sp-inner); }

/* ---------- motion that waits for the scene to come on screen ---------- */
@media (prefers-reduced-motion: no-preference) {
  .js .t-folders li { transition: transform .5s var(--ease-turn), opacity .3s linear; }
  .js .t-files:not(.is-seen) .t-folders li { transform: translateY(.75rem); opacity: 0; }
  .js .t-files .t-folders li:nth-child(2) { transition-delay: .06s; }
  .js .t-files .t-folders li:nth-child(3) { transition-delay: .12s; }
  .js .t-files .t-folders li:nth-child(4) { transition-delay: .18s; }
  .js .t-files .t-folders li:nth-child(5) { transition-delay: .24s; }
  .js .t-files .t-folders li:nth-child(6) { transition-delay: .3s; }
}

/* ---------- responsive ---------- */
@media (max-width: 1023px) {
  .t-grid, .t-grid--flip, .t-hero__grid { grid-template-columns: minmax(0, 1fr); justify-content: stretch; }
  .t-hero__copy { max-width: 40rem; }
  /* stacked: heading and words, then the device, then the controls */
  .t-grid { row-gap: 0; }
  .t-grid > .t-copy { display: contents; }
  .t-grid > .t-copy > * { max-width: 40rem; order: 2; }
  .t-grid > .t-copy > button { justify-self: start; }
  .t-grid > .t-copy > h2, .t-grid > .t-copy > .t-lead { order: 0; }
  .t-grid > .t-stage { order: 1; margin-block: var(--sp-block) 0; }
  .t-stage { justify-self: center; }
  .t-pair__grid { grid-template-columns: minmax(0, 1fr); }
  .t-big { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .t-price__grid { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 639px) {
  .dev--hero-tab { display: none; }
  .t-stage { padding-inline: 1rem; width: 100%; }
  .t-big { grid-template-columns: minmax(0, 1fr); }
  .t-hero__act { gap: var(--s-4); }
}

@media (prefers-reduced-motion: reduce) {
  .tour *, .tour *::before, .tour *::after { animation: none !important; }
}
@media print {
  .t-hero__ctl, .t-play, .t-toggle, .t-again { display: none !important; }
}

/* ---------- REM Motion GFX films: real captures in Apple's official bezels ----------
   Transparent (HEVC alpha for Safari, VP9 alpha elsewhere). They bring their
   own bezels and sit straight on plain paper: no mat, no box, no mask, and no
   ink field or translate anywhere in a device's path (the jitter A/B showed a
   feathered mask letting the speckled field show through the moving device).
   z-index 60 with no stacking context between film and root keeps them above
   the grain.
   Films are sized by the device inside them, not by the canvas: the devices
   fill 82–97 % of the canvas height at their smallest, so a film 72svh tall
   (capped 52rem) shows a device about 60 % of the viewport high. Tall films
   pull their transparent side margins into the neighbouring whitespace. */
.tour { --film-h: min(72svh, 52rem); }
.t-motion { position: relative; z-index: 60; }
.t-motion__v { display: block; width: 100%; height: auto; aspect-ratio: 16 / 9; object-fit: contain; background: transparent; }
.t-motion--tall .t-motion__v { aspect-ratio: 4 / 5; }
.t-motion .t-vplay { position: relative; left: auto; bottom: auto; translate: none; display: flex; width: max-content; margin: .75rem auto 0; }
.t-motion--wide { width: min(100%, calc(var(--film-h) * 16 / 9)); margin-inline: auto; }
.t-motion--tall { --fw: calc(var(--film-h) * .8); width: var(--fw); flex: none; margin-inline: calc(var(--fw) * -.11); }

/* a film scene: the words on the left, the film on the right, sized by the
   viewport's height so heading and device share one screen. The film's box is
   a little narrower than 16:9; object-fit trims the transparent sides only
   (the widest push-in keeps a 9 % margin). Stacked below 1024px. */
.t-remember { display: grid; justify-items: center; row-gap: var(--sp-inner); }
.t-remember__copy { width: 100%; max-width: 40rem; }
.t-remember__copy > .t-lead, .t-remember__copy > .t-quote { margin-top: var(--sp-inner); }
.t-remember__copy > h3 + .t-lead { margin-top: var(--s-3); }
@media (min-width: 1024px) {
  .t-remember {
    grid-template-columns: minmax(16rem, 20rem) minmax(0, auto);
    justify-content: center;
    justify-items: stretch;
    align-items: center;
    column-gap: clamp(1.5rem, .5rem + 2.5vw, 3.5rem);
  }
  .t-remember__copy h2, .t-remember__copy h3 { max-width: 12ch; }
  .t-remember__film { width: min(calc(min(var(--c-wide), 100vw - 2 * var(--gutter)) - 20rem - 3.5rem), calc(var(--film-h) * 16 / 9)); margin: 0; }
  .t-remember__film .t-motion__v { aspect-ratio: auto; height: min(var(--film-h), calc((min(var(--c-wide), 100vw - 2 * var(--gutter)) - 20rem - 3.5rem) / 1.46)); object-fit: cover; }
}
.t-turn__steps { margin-top: var(--sp-scene); }
.t-sub { font-size: var(--t-h2); }

/* two devices side by side: our framed one with its ink field, REM's film on paper */
.t-stage--duo { --ph: min(62svh, 40rem); display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: clamp(.75rem, 2vw, 1.75rem); padding-inline: 0; }
.t-stage--duo::before { inset: 14% -3% 8% -3%; }
.t-stage--duo::after { right: auto; left: -4%; }
/* the Turn's pair leads with the film, so its field sits behind the framed phone on the right */
.t-turn .t-stage--duo::after { left: auto; right: -4%; }
.t-stage--duo > .tn-now { order: 3; flex-basis: 100%; margin-inline: auto; }
/* in a pair, a film keeps its transparent margin on the side that faces the
   other device, so a push-in never runs over it; it gives the outer margin
   back to the whitespace. The dart film pushes in to the left, so it leads. */
.t-stage--duo { --film-h: min(64svh, 46rem); }
.t-stage--duo > .t-motion--tall { margin-inline: 0; }
.t-stage--duo > .tn-dart { order: -1; margin-left: calc(var(--fw) * -.11); }
.t-stage--duo > .t-motion--tall:not(.tn-dart) { margin-right: calc(var(--fw) * -.11); }
.t-stage--duo > .tn-dart ~ .dev { order: 0; }
.t-stage--files { --th: min(56svh, 38rem); }

/* Reading Targets: the two plates stack on the left, the film stands on paper beside them */
.t-pair__grid { grid-template-columns: minmax(0, 1fr) auto; align-items: center; }
@media (min-width: 1024px) {
  .t-pair__grid > .t-plate { grid-column: 1; }
  .t-pair__grid > .tg__film { grid-column: 2; grid-row: 1 / span 2; margin-right: 0; }
}

/* phones: the read-along hero is the film; the live page needs more room */
.t-hero__film { display: none; }
@media (max-width: 1023px) {
  .t-motion--wide { width: 100%; }
  .t-pair__grid { grid-template-columns: minmax(0, 1fr); }
  .tg__film { justify-self: center; }
}
@media (max-width: 639px) {
  .tour { --film-h: min(62svh, 30rem); }
  .t-motion--tall, .t-stage--duo > .t-motion--tall, .t-stage--duo > .tn-dart { --fw: min(calc(var(--film-h) * .8), calc(100vw - 2 * var(--gutter))); margin-inline: 0; }
  .t-motion--wide .t-motion__v { aspect-ratio: 4 / 3; object-fit: cover; }
  .t-stage--duo { flex-direction: column; }
  .t-stage--duo::before { inset: 4% -2% 4% -2%; }
}

/* ---------- stills standing in for REM films (official bezels, real captures) ----------
   iPad and iPhone side by side, bottoms aligned, sized by the viewport's height
   like the films they replace. Every scene keeps its media inside its section. */
.t-stills { --th: min(66svh, 46rem); --ph: calc(var(--th) * .74); position: relative; z-index: 60; display: flex; align-items: flex-end; justify-content: center; gap: clamp(.75rem, 1.6vw, 1.5rem); }
.t-stills .dev--still { flex: none; }
.t-remember__film.t-stills { width: auto; margin: 0; }
.dev--files-phone { --ph: min(56svh, 38rem); }
.t-pair__grid > .dev--targets { --ph: min(64svh, 44rem); }
.tv--cycle .tv__view { transition: opacity .6s ease-out; }
.t-scene { position: relative; overflow-x: clip; }
.t-scene + .t-scene, .tour > section + section { margin-top: 0; }
@media (max-width: 1023px) {
  .t-stills { --th: min(46svh, calc((100vw - 2 * var(--gutter)) * .9)); }
}
@media (max-width: 639px) {
  .t-stills { --th: min(40svh, calc((100vw - 2 * var(--gutter)) * .72)); }
}
.t-spread { padding-bottom: var(--sp-block); }
@media (max-width: 639px) { .t-stage--spread { --th: calc((100vw - 2 * var(--gutter)) * .86); } }

/* listening with REM's sleep film: the ink field backs only the framed player,
   ending in the gap before the film; the film stands on plain paper, its
   transparent sides (22 % each) pulled into the gap and the margin. Without
   scripts or with reduced motion, the app's own sleep-timer still stands in. */
.t-stage--film::before { display: none; }
.t-framed { position: relative; display: flex; }
.t-framed::before {
  content: "";
  position: absolute;
  inset: 10% -14% 6% -14%;
  background: var(--ink-2);
  mix-blend-mode: multiply;
  clip-path: var(--cut-field-b);
  -webkit-mask: var(--m-ink) 120px 60px / 640px 640px;
  mask: var(--m-ink) 120px 60px / 640px 640px;
}
.t-stage--duo > .t-sleep-film { --fw: calc(var(--film-h) * .8); width: var(--fw); margin-inline: calc(var(--fw) * -.12) calc(var(--fw) * -.18); }
.t-sleep-still { display: none; }
html:not(.js) .t-sleep-film { display: none; }
html:not(.js) .t-sleep-still { display: block; }
@media (prefers-reduced-motion: reduce) {
  .t-sleep-film { display: none; }
  .t-sleep-still { display: block; }
}
@media (max-width: 639px) {
  .t-stage--duo > .t-sleep-film { --fw: min(calc(var(--film-h) * .8), calc(100vw - 2 * var(--gutter))); margin-inline: 0; }
}

/* every device PageTide runs on: REM's lineup, transparent, straight on the paper */
.t-lineup__head { text-align: center; display: grid; justify-items: center; }
.t-lineup__head h2 { max-width: 20ch; }
.t-lineup__fig { position: relative; z-index: 60; width: min(100% - 2 * var(--gutter), var(--c-wide)); margin: var(--sp-block) auto 0; }
.t-lineup__img { display: block; width: 100%; height: auto; }

/* phones: the read-along hero is REM's film (the live page needs more room than a phone gives);
   tablets and desktops keep the live page */
.t-hero__film { display: none; }
@media (max-width: 639px) {
  .t-stage--hero:has(.t-hero__film) .t-hero__devs, .t-stage--hero:has(.t-hero__film) .t-play { display: none; }
  .t-stage--hero:has(.t-hero__film)::before, .t-stage--hero:has(.t-hero__film)::after { display: none; }
  .t-stage--hero .t-hero__film { display: block; margin-inline: auto; }
}

/* phones: crop a wide film to its devices, never past them. The remembers
   devices stay within 30-70 % of the canvas width at every moment, the
   same-sentence pair within 21-79 %; each box keeps a little paper either side. */
@media (max-width: 639px) {
  .t-film--narrow .t-motion__v { aspect-ratio: 4 / 5; object-fit: cover; }
  .t-film--pair .t-motion__v { aspect-ratio: 1.08; object-fit: cover; }
}


/* Duo uses the same printed stage and type scale; only its screen changes. */
.t-fold .t-grid { grid-template-columns: minmax(0, .7fr) minmax(0, 1.3fr); }
.t-fold__controls { margin-top: var(--sp-inner); }
.t-fold__devices { position: relative; z-index: 60; display: grid; grid-template-columns: 3093fr 1574fr; gap: clamp(.75rem, 1.5vw, 1.5rem); align-items: end; width: 100%; max-width: 48rem; }
.t-fold__stage { min-width: 0; padding-inline: 0; }
.t-fold__devices img { display: block; width: 100%; height: auto; }
.t-fold__open, .t-fold__closed { display: grid; min-width: 0; }
.t-fold__open > img, .t-fold__closed > img { grid-area: 1 / 1; }
.t-fold__listen, .t-fold__overview { opacity: 0; transition: opacity 650ms ease-in-out; }
.t-fold.is-listening .t-fold__listen, .t-fold.is-listening .t-fold__overview { opacity: 1; }
.t-fold__frame { position: relative; z-index: 1; }
@media (max-width: 899px) {
  .t-fold .t-grid { grid-template-columns: 1fr; }
  .t-fold__devices { max-width: 38rem; }
}
@media (prefers-reduced-motion: reduce) {
  .t-fold__listen, .t-fold__overview { transition: none; }
}
