/* PhiJo landing. Legal and support pages use style.css.
   Block colors come from the App Store screenshots (marketing/screenshots/render.mjs).
   Italic is reserved for quoted words. */

:root {
  --paper: #F5EFE3;
  --ink: #1A1715;
  --ink-soft: #3D352E;
  --muted: #6B6259;
  --accent: #7A5C36;
  --line: rgba(26, 23, 21, 0.16);
  --card: #2A1C13;
  --cream: #F8F1E3;
  --gold: #E6C896;
  --grain-opacity: 0.32;
  --serif: 'Lora', 'EB Garamond', Georgia, 'Times New Roman', serif;
  --gutter: clamp(1.25rem, 5vw, 3.5rem);
}

@media (prefers-color-scheme: dark) {
  :root {
    --paper: #1A1715;
    --ink: #F5EFE3;
    --ink-soft: #DDD4C5;
    --muted: #AFA494;
    --accent: #C9A878;
    --line: rgba(245, 239, 227, 0.18);
    --card: #2E2620;
    --grain-opacity: 0.06;
  }
}

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

html {
  -webkit-text-size-adjust: 100%;
  background: var(--paper);
}

body {
  position: relative;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--serif);
  font-size: 1.0625rem;
  line-height: 1.6;
  overflow-x: clip;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* The app's own paper texture */
body::before {
  content: '';
  position: absolute;
  inset: 0;
  background: url('assets/paper-grain.webp') 0 0 / 256px;
  opacity: var(--grain-opacity);
  pointer-events: none;
}

body > * { position: relative; }

a {
  color: inherit;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.18em;
}

:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 3px;
  border-radius: 3px;
}

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

.wrap {
  max-width: 1200px;
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.display {
  font-weight: 400;
  font-size: clamp(3.5rem, 9.5vw, 8rem);
  line-height: 1;
  letter-spacing: -0.025em;
}

.lead {
  max-width: 31rem;
  margin-top: clamp(1.25rem, 2.5vw, 2rem);
  font-size: clamp(1.15rem, 1.7vw, 1.375rem);
  line-height: 1.5;
  text-wrap: pretty;
}

.lead + .lead { margin-top: 0.9rem; }

.fine {
  max-width: 31rem;
  margin-top: 1.1rem;
  font-size: 0.95rem;
  opacity: 0.75;
  text-wrap: pretty;
}

.badge { display: inline-block; border-radius: 7px; transition: transform 0.25s ease; }
.badge:hover { transform: translateY(-2px); }
.badge img { width: 165px; height: 55px; }

/* ---------- Header: the app's syllable corners ---------- */

.top {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: start;
  padding: clamp(1rem, 3vw, 1.75rem) clamp(1rem, 4vw, 2.5rem) 0;
}

.corner {
  display: inline-flex;
  flex-direction: column;
  min-width: 44px;
  min-height: 44px;
  font-size: 0.72rem;
  line-height: 1.45;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  text-decoration: none;
  color: var(--muted);
}

.corner:hover { color: var(--ink); }
.corner-left { justify-self: start; }
.corner-right { justify-self: end; text-align: right; }

.masthead { text-align: center; }

.brand {
  font-size: 1.15rem;
  font-weight: 400;
  letter-spacing: 0.42em;
  padding-left: 0.42em;
  color: var(--ink-soft);
}

.date {
  font-size: 0.82rem;
  letter-spacing: 0.06em;
  color: var(--muted);
  min-height: 1.4em;
}

/* ---------- Today's quote ---------- */

.today {
  min-height: 86svh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: clamp(2rem, 5vh, 3.5rem) var(--gutter) clamp(3rem, 7vh, 4.5rem);
}

.today-figure {
  max-width: 66rem;
  width: 100%;
  transition: opacity 0.5s ease;
}

.js .today-figure[data-state='pending'] { opacity: 0; }

.today-label {
  font-size: 0.95rem;
  color: var(--muted);
}

.mark {
  display: block;
  height: 0.62em;
  margin-top: 0.75rem;
  font-size: clamp(4rem, 8vw, 6.5rem);
  line-height: 1;
  font-weight: 500;
  color: #B08A5E;
}

.today-quote {
  font-style: italic;
  font-size: clamp(2.25rem, 6vw, 5rem);
  line-height: 1.16;
  letter-spacing: -0.012em;
  text-wrap: balance;
}

.today-quote.is-long {
  font-size: clamp(1.75rem, 4.2vw, 3.4rem);
  line-height: 1.24;
}

.today-cite {
  margin-top: clamp(1.25rem, 3vh, 2rem);
  font-size: 1.1rem;
  color: var(--ink-soft);
}

.today-source { color: var(--muted); }

.original { margin-top: 1rem; }
.original[hidden] { display: none; }

.original-text {
  font-style: italic;
  font-size: clamp(1rem, 1.6vw, 1.2rem);
  color: var(--ink-soft);
  text-wrap: balance;
}

.original-lang {
  font-size: 0.85rem;
  color: var(--accent);
}

.today-foot {
  margin-top: clamp(1.75rem, 4vh, 2.75rem);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.25rem;
}

.lede {
  max-width: 33rem;
  font-size: 1.1rem;
  color: var(--ink-soft);
  text-wrap: pretty;
}

/* ---------- Color blocks ---------- */

.block {
  --base: #4a3322;
  --glow: #7a5635;
  --deep: #281a10;
  position: relative;
  overflow: clip;
  color: var(--cream);
  background:
    radial-gradient(85% 75% at 22% 12%, var(--glow) 0%, transparent 62%),
    radial-gradient(90% 80% at 85% 100%, var(--deep) 0%, transparent 70%),
    var(--base);
}

.block::before {
  content: '';
  position: absolute;
  inset: 0;
  background: url('assets/paper-grain.webp') 0 0 / 256px;
  opacity: 0.1;
  mix-blend-mode: overlay;
  pointer-events: none;
}

.block > * { position: relative; }

.terracotta { --base: #8a4a2c; --glow: #b8703f; --deep: #4f2817; }
.ochre { --base: #6b4a1d; --glow: #9a6d29; --deep: #3a2710; }
.oxblood { --base: #6a2a22; --glow: #94402f; --deep: #351310; }
.sage { --base: #33402e; --glow: #516440; --deep: #1a2216; }
.plum { --base: #43304c; --glow: #6c4d7a; --deep: #241729; }
.charcoal { --base: #2f2922; --glow: #4d4030; --deep: #16120d; }
.teal { --base: #234038; --glow: #356f5d; --deep: #102b25; }
.slate { --base: #2b3a4b; --glow: #445a72; --deep: #161f2a; }

.block-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr);
  gap: clamp(2rem, 5vw, 5rem);
  padding-top: clamp(4rem, 8vw, 7rem);
}

.block-text { padding-bottom: clamp(3.5rem, 7vw, 6rem); }

.flip > .block-text { order: 2; }

.phone {
  --pw: clamp(270px, 29vw, 380px);
  --crop: 0.62;
  width: var(--pw);
  justify-self: center;
  align-self: end;
  margin-bottom: calc(var(--pw) * var(--crop) * -1);
  filter: drop-shadow(0 28px 44px rgba(0, 0, 0, 0.48));
}

.phone-widget { width: calc(var(--pw) * 1.166); --crop: 0.82; }
.phone-streak { --crop: 0.28; }

/* ---------- Journal ---------- */

.sheet {
  position: relative;
  justify-self: center;
  align-self: center;
  width: min(100%, 27rem);
  margin-bottom: clamp(5rem, 8vw, 7rem);
  padding: clamp(2rem, 4vw, 3rem) clamp(1.5rem, 3vw, 2.5rem) clamp(9rem, 15vw, 11rem);
  background: #F5EFE3;
  color: #1A1715;
  border-radius: 4px;
  text-align: center;
  box-shadow: 0 34px 60px -26px rgba(0, 0, 0, 0.65);
}

.sheet-quote {
  font-style: italic;
  font-size: clamp(1.45rem, 2.6vw, 1.95rem);
  line-height: 1.28;
  text-wrap: balance;
}

.sheet-author {
  margin-top: 0.7rem;
  font-size: 0.95rem;
  color: #6B6259;
}

.sticky {
  --tilt: -3deg;
  position: absolute;
  left: clamp(-1.5rem, -2vw, -0.5rem);
  bottom: clamp(-3.5rem, -4vw, -2rem);
  width: 86%;
  padding: 1.5rem 1.35rem 1rem;
  background: #E8DBA9;
  color: #3A3220;
  font-size: clamp(1.02rem, 1.5vw, 1.15rem);
  line-height: 1.4;
  text-align: left;
  transform: rotate(var(--tilt));
  box-shadow: 0 20px 28px -14px rgba(0, 0, 0, 0.6);
}

.sticky::before {
  content: '';
  position: absolute;
  top: -0.7rem;
  left: 38%;
  width: 5rem;
  height: 1.4rem;
  background: rgba(255, 252, 240, 0.6);
  transform: rotate(1.5deg);
}

.sticky-date {
  display: block;
  margin-top: 0.5rem;
  font-size: 0.78rem;
  opacity: 0.7;
}

/* ---------- Types ---------- */

.types-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(0, 0.75fr);
  gap: clamp(1rem, 4vw, 4rem);
  align-items: center;
  padding-block: clamp(4rem, 8vw, 7rem);
}

.glyphs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-top: clamp(1.75rem, 3.5vw, 2.75rem);
}

.glyph {
  width: 3.25rem;
  height: 3.25rem;
  border: 1px solid rgba(248, 241, 227, 0.26);
  border-radius: 50%;
  background: none;
  color: var(--cream);
  font-family: 'Apple Symbols', 'Segoe UI Symbol', var(--serif);
  font-size: 1.35rem;
  line-height: 1;
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease, transform 0.25s ease;
}

.glyph:hover { transform: translateY(-2px); border-color: var(--gold); }

.glyph[aria-pressed='true'] {
  background: var(--gold);
  border-color: var(--gold);
  color: #241729;
}

.type-panel { margin-top: 1.5rem; min-height: 8rem; }

.type-name {
  font-weight: 400;
  font-size: clamp(1.75rem, 3.2vw, 2.5rem);
  line-height: 1.2;
}

.type-desc {
  margin-top: 0.4rem;
  max-width: 30rem;
  font-size: 1.05rem;
  opacity: 0.85;
  text-wrap: pretty;
}

.type-big {
  display: block;
  text-align: center;
  font-family: 'Apple Symbols', 'Segoe UI Symbol', var(--serif);
  font-size: clamp(9rem, 24vw, 21rem);
  line-height: 1;
  color: var(--gold);
}

.swap { animation: swap 0.5s cubic-bezier(0.22, 1, 0.36, 1); }

@keyframes swap {
  from { opacity: 0; transform: translateY(8px) scale(0.97); }
  to { opacity: 1; transform: none; }
}

/* ---------- Sources ---------- */

.sources { padding-block: clamp(4rem, 8vw, 7rem); }

.spec {
  list-style: none;
  margin-top: clamp(2.5rem, 5vw, 4rem);
}

.spec li {
  padding-block: clamp(1.5rem, 3.2vw, 2.5rem);
  border-top: 1px solid rgba(248, 241, 227, 0.2);
}

.spec-orig {
  font-style: italic;
  font-size: clamp(1.9rem, 5.2vw, 4.5rem);
  line-height: 1.12;
  letter-spacing: -0.012em;
  text-wrap: balance;
}

.spec-meta {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.25rem 2rem;
  margin-top: 0.9rem;
}

.spec-trans { font-size: 1.05rem; }

.spec-ref {
  font-size: 0.95rem;
  color: var(--gold);
}

/* ---------- Authors ---------- */

.paper-section { padding-block: clamp(4rem, 8vw, 7rem); }

.authors {
  list-style: none;
  margin-top: clamp(1.75rem, 3.5vw, 3rem);
  font-size: clamp(1.4rem, 3vw, 2.35rem);
  line-height: 1.38;
  letter-spacing: -0.005em;
  text-wrap: pretty;
}

.authors li { display: inline; }

.authors li:not(:last-child)::after {
  content: ' · ';
  color: #B08A5E;
}

/* ---------- Free and Premium ---------- */

.plans-section { padding-block: 0 clamp(4rem, 8vw, 7rem); }

.plans {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: clamp(1rem, 2vw, 1.5rem);
  align-items: stretch;
}

.plan {
  padding: clamp(1.5rem, 3vw, 2.5rem);
  border-radius: 1.5rem;
  border: 1px solid var(--line);
}

.plan-premium {
  background: var(--card);
  border-color: transparent;
  color: var(--cream);
}

.plan h3 {
  font-weight: 400;
  font-size: clamp(1.75rem, 3vw, 2.5rem);
  line-height: 1.15;
  margin-bottom: 1.1rem;
}

.plan-premium h3 { color: var(--gold); }

.plan ul { list-style: none; }

.plan li {
  padding-block: 0.55rem;
  border-top: 1px solid var(--line);
  line-height: 1.4;
}

.plan-premium li { border-top-color: rgba(248, 241, 227, 0.18); }

.plans-note {
  margin-top: 1.25rem;
  color: var(--muted);
  text-wrap: pretty;
}

/* ---------- Closing ---------- */

.closing {
  padding-block: clamp(4.5rem, 9vw, 8rem);
  text-align: center;
}

.icons {
  display: flex;
  justify-content: center;
  margin-bottom: clamp(2rem, 4vw, 3rem);
}

.icons img {
  width: clamp(4.25rem, 10vw, 7.5rem);
  height: auto;
  margin-inline: clamp(-0.7rem, -1vw, -0.4rem);
  border-radius: 22.5%;
  box-shadow: 0 18px 30px -14px rgba(0, 0, 0, 0.6);
  transition: transform 0.35s cubic-bezier(0.22, 1, 0.36, 1);
}

.icons img:nth-child(1) { transform: rotate(-9deg) translateY(8px); }
.icons img:nth-child(2) { transform: rotate(-3deg); z-index: 1; }
.icons img:nth-child(3) { transform: rotate(3deg); z-index: 1; }
.icons img:nth-child(4) { transform: rotate(9deg) translateY(8px); }
.icons:hover img { transform: none; }

.closing .lead,
.closing .fine { margin-inline: auto; }

.closing .badge { margin-top: clamp(2rem, 3.5vw, 3rem); }

.maker {
  margin-top: clamp(2.5rem, 5vw, 4rem);
  padding-top: 1.75rem;
  border-top: 1px solid rgba(248, 241, 227, 0.2);
}

/* ---------- Contact: an envelope that opens ---------- */

.contact-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: clamp(2.5rem, 5vw, 5rem);
  align-items: center;
  padding-block: clamp(4.5rem, 8vw, 7rem);
}

.contact-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: clamp(1.5rem, 3vw, 2.25rem);
}

.contact-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 0.6rem 1.5rem;
  border: 1px solid rgba(248, 241, 227, 0.4);
  border-radius: 999px;
  background: none;
  color: var(--cream);
  font: inherit;
  font-size: 1rem;
  text-decoration: none;
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease, transform 0.25s ease;
}

.contact-btn:hover { transform: translateY(-2px); border-color: var(--cream); }

.contact-btn-primary {
  background: var(--cream);
  border-color: var(--cream);
  color: #1F2A36;
}

.contact-btn[data-copied] {
  background: var(--gold);
  border-color: var(--gold);
  color: #1F2A36;
}

.envelope {
  --env-w: min(100%, 31rem);
  position: relative;
  width: var(--env-w);
  aspect-ratio: 3 / 2;
  justify-self: center;
  margin-top: clamp(9.5rem, 15vw, 12rem);
  perspective: 1400px;
  filter: drop-shadow(0 34px 40px rgba(0, 0, 0, 0.42));
}

.env-back,
.env-front,
.env-bottom {
  position: absolute;
  inset: 0;
  border-radius: 6px;
}

.env-back { background: #BFB29A; z-index: 1; }

.env-front {
  z-index: 4;
  background: #E4D8C0;
  clip-path: polygon(0 0, 50% 54%, 100% 0, 100% 100%, 0 100%);
  pointer-events: none;
}

.env-bottom {
  z-index: 5;
  background: #EFE5D1;
  clip-path: polygon(0 100%, 50% 46%, 100% 100%);
  pointer-events: none;
}

.env-flap {
  position: absolute;
  inset: 0 0 auto;
  height: 58%;
  z-index: 2;
  transform: rotateX(180deg);
  transform-origin: 50% 0;
  transform-style: preserve-3d;
}

.env-flap-shape {
  position: absolute;
  inset: 0;
  background: #D8CBB1;
  clip-path: polygon(0 0, 100% 0, 50% 100%);
}

.env-seal {
  position: absolute;
  left: 50%;
  bottom: -6%;
  width: 19%;
  aspect-ratio: 1;
  translate: -50% 0;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #A64B3A, #70261D 72%);
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.4), inset 0 0 0 3px rgba(0, 0, 0, 0.12);
  color: #EBC9A6;
  font-size: clamp(1.1rem, 2.6vw, 1.75rem);
  line-height: 1;
  backface-visibility: hidden;
}

.letter {
  position: absolute;
  left: 5%;
  right: 5%;
  bottom: 5%;
  height: 88%;
  z-index: 3;
  padding: clamp(1rem, 2.4vw, 1.6rem) clamp(1rem, 2.6vw, 1.75rem);
  background: #F8F1E3;
  color: #1A1715;
  border-radius: 3px;
  transform: translateY(-60%);
  transition: transform 0.45s cubic-bezier(0.22, 1, 0.36, 1);
}

.envelope:hover .letter { transform: translateY(-64%); }

/* Ruled lines, waiting to be written on */
.letter::after {
  content: '';
  position: absolute;
  inset: 44% clamp(1rem, 2.6vw, 1.75rem) 0;
  background: repeating-linear-gradient(
    to bottom,
    rgba(26, 23, 21, 0.13) 0 1px,
    transparent 1px clamp(1.35rem, 3vw, 1.9rem)
  );
  pointer-events: none;
}

.letter-hello {
  font-style: italic;
  font-size: clamp(1rem, 2vw, 1.25rem);
  line-height: 1.3;
  padding-right: 22%;
}

.letter-mail {
  display: inline-block;
  margin-top: clamp(0.35rem, 1vw, 0.6rem);
  font-size: clamp(1.15rem, 2.55vw, 1.75rem);
  line-height: 1.25;
  letter-spacing: -0.01em;
  color: #70261D;
  text-underline-offset: 0.16em;
}

.stamp {
  position: absolute;
  top: clamp(0.65rem, 1.6vw, 1rem);
  right: clamp(0.65rem, 1.6vw, 1rem);
  width: 16%;
  padding: 6px;
  background: #fff;
  rotate: 4deg;
  /* Perforated edge: holes tile across, a solid center keeps the icon whole */
  --hole: radial-gradient(circle, transparent 1.7px, #000 2px) -3px -3px / 7px 7px;
  --center: linear-gradient(#000 0 0) center / calc(100% - 8px) calc(100% - 8px) no-repeat;
  -webkit-mask: var(--hole), var(--center);
  mask: var(--hole), var(--center);
}

/* Sealed until it scrolls into view, then: flap, then letter. */
.motion .envelope:not(.in) .env-flap { transform: none; z-index: 6; }
.motion .envelope:not(.in) .letter { transform: none; }

.motion .env-flap {
  transition:
    transform 0.9s cubic-bezier(0.45, 0, 0.2, 1) 0.2s,
    z-index 0s linear 0.65s;
}

.motion .envelope.in .letter {
  transition: transform 1s cubic-bezier(0.2, 1.1, 0.35, 1) 0.95s;
}

.motion .envelope.opened .letter {
  transition: transform 0.45s cubic-bezier(0.22, 1, 0.36, 1);
}

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

.foot {
  padding-block: 1.25rem 1.75rem;
  font-size: 0.875rem;
  color: var(--muted);
}

.foot .wrap {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0 2rem;
}

.foot-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0 1.1rem;
}

.foot-nav a {
  display: inline-block;
  padding-block: 0.6rem;
  text-decoration: none;
}

.foot-nav a:hover { color: var(--ink); text-decoration: underline; }

.foot-copy { padding-block: 0.6rem; }

/* ---------- Streak counter ---------- */

.streak-count {
  display: flex;
  align-items: center;
  gap: 0.2em;
  margin-top: clamp(1.25rem, 2.5vw, 2rem);
  font-size: clamp(3.25rem, 6vw, 5rem);
  line-height: 1;
  color: var(--gold);
  font-variant-numeric: tabular-nums;
}

.flame {
  width: 0.8em;
  height: 0.8em;
  fill: currentColor;
  transform-origin: 50% 90%;
}

.flame-core { fill: #6a2a22; }

/* ---------- Motion. Hidden states live under .motion, which home.js sets only
   when it is running and the reader has not asked for reduced motion. ---------- */

/* If home.js never runs, the quote still appears. */
.js .today-figure[data-state='pending'] { animation: failsafe 0s linear 3s forwards; }
@keyframes failsafe { to { opacity: 1; } }

/* Today's quote: word by word, then everything under it */
.motion .today-quote .word {
  display: inline-block;
  opacity: 0;
  transform: translateY(0.4em);
  filter: blur(8px);
}

.motion .today.play .today-quote .word {
  opacity: 1;
  transform: none;
  filter: blur(0);
  transition:
    opacity 0.7s ease calc(var(--i) * 70ms + 250ms),
    transform 0.9s cubic-bezier(0.22, 1, 0.36, 1) calc(var(--i) * 70ms + 250ms),
    filter 0.7s ease calc(var(--i) * 70ms + 250ms);
}

.motion .today-label,
.motion .mark,
.motion .today-cite,
.motion .original,
.motion .lede,
.motion .today-foot .badge {
  opacity: 0;
  translate: 0 14px;
}

.motion .today.play .today-label,
.motion .today.play .mark {
  opacity: 1;
  translate: 0 0;
  transition: opacity 0.7s ease, translate 0.9s cubic-bezier(0.22, 1, 0.36, 1);
}

.motion .today.play .today-cite,
.motion .today.play .original,
.motion .today.play .lede,
.motion .today.play .today-foot .badge {
  opacity: 1;
  translate: 0 0;
  transition:
    opacity 0.8s ease calc(var(--after) + var(--step, 0ms)),
    translate 0.9s cubic-bezier(0.22, 1, 0.36, 1) calc(var(--after) + var(--step, 0ms));
}

.motion .today.play .original { --step: 180ms; }
.motion .today.play .lede { --step: 360ms; }
.motion .today.play .today-foot .badge { --step: 520ms; }

/* Big titles rise out of a mask */
.motion .display .mask {
  display: inline-block;
  overflow: clip;
  padding-block: 0.08em 0.24em;
  margin-block: -0.08em -0.24em;
  vertical-align: top;
}

.motion .display .mask > span {
  display: inline-block;
  transform: translateY(115%) rotate(4deg);
  transform-origin: 0 100%;
  transition: transform 1.1s cubic-bezier(0.16, 1, 0.3, 1) calc(var(--i, 0) * 90ms);
}

.motion .display.in .mask > span { transform: none; }

/* Text follows the title */
.motion .lead,
.motion .fine,
.motion .plans-note,
.motion .glyphs,
.motion .type-panel,
.motion .streak-count,
.motion .closing .badge {
  transition: opacity 0.9s ease 0.25s, translate 1s cubic-bezier(0.22, 1, 0.36, 1) 0.25s;
}

.motion .lead:not(.in),
.motion .fine:not(.in),
.motion .plans-note:not(.in),
.motion .glyphs:not(.in),
.motion .type-panel:not(.in),
.motion .streak-count:not(.in),
.motion .closing .badge:not(.in) {
  opacity: 0;
  translate: 0 26px;
}

/* Phones and the sheet are moved by the scroll handler in home.js */
.motion .phone,
.motion .sheet { will-change: transform; }

/* The note lands on the page, then the tape goes on */
.motion .sheet:not(.in) .sticky { opacity: 0; }

.motion .sheet.in .sticky {
  animation: stick 0.75s cubic-bezier(0.2, 1.5, 0.4, 1) 0.35s both;
}

@keyframes stick {
  from { opacity: 0; transform: translate(50px, -110px) rotate(-16deg) scale(1.3); }
  35% { opacity: 1; }
  to { opacity: 1; transform: rotate(var(--tilt)); }
}

.motion .sheet:not(.in) .sticky::before { transform: rotate(1.5deg) scaleX(0); }

.motion .sticky::before {
  transform-origin: 0 50%;
  transition: transform 0.4s ease 1.05s;
}

/* Streak flame */
.motion .flame { animation: flicker 2.4s ease-in-out infinite; }

@keyframes flicker {
  0%, 100% { transform: scale(1) rotate(-1deg); }
  30% { transform: scale(1.06, 1.12) rotate(2deg); }
  55% { transform: scale(0.97, 1.03) rotate(-2deg); }
  80% { transform: scale(1.04, 1.08) rotate(1deg); }
}

/* Type glyph */
.motion .type-big { animation: float 6s ease-in-out infinite; }

.motion .type-big.swap {
  animation:
    glyph-in 0.8s cubic-bezier(0.2, 1.3, 0.4, 1),
    float 6s ease-in-out 0.8s infinite;
}

@keyframes float {
  0%, 100% { transform: translateY(-8px) rotate(-3deg); }
  50% { transform: translateY(8px) rotate(3deg); }
}

@keyframes glyph-in {
  from { opacity: 0; transform: scale(0.55) rotate(-35deg); }
  to { opacity: 1; transform: translateY(-8px) rotate(-3deg); }
}

/* Plans */
.motion .plan { transition: opacity 0.9s ease, translate 1s cubic-bezier(0.22, 1, 0.36, 1); }
.motion .plan-premium { transition-delay: 0.15s; }
.motion .plan:not(.in) { opacity: 0; translate: 0 50px; }

.motion .plan li {
  transition: opacity 0.6s ease calc(var(--i) * 55ms + 0.3s), translate 0.7s ease calc(var(--i) * 55ms + 0.3s);
}

.motion .plan:not(.in) li { opacity: 0; translate: -14px 0; }

/* Icons deal out from a single stack */
.motion .icons img {
  transition: transform 1s cubic-bezier(0.2, 1.35, 0.4, 1) 0.1s, opacity 0.5s ease 0.1s;
}

.motion .icons:not(.in) img { opacity: 0; }
.motion .icons:not(.in) img:nth-child(1) { transform: translateX(135%) scale(0.8); }
.motion .icons:not(.in) img:nth-child(2) { transform: translateX(45%) scale(0.8); }
.motion .icons:not(.in) img:nth-child(3) { transform: translateX(-45%) scale(0.8); }
.motion .icons:not(.in) img:nth-child(4) { transform: translateX(-135%) scale(0.8); }

@media (prefers-reduced-motion: reduce) {
  .today-figure, .badge, .glyph, .icons img { transition: none; }
  .swap { animation: none; }
}

/* ---------- Narrow ---------- */

@media (max-width: 860px) {
  .block-grid,
  .contact-grid,
  .types-grid { grid-template-columns: minmax(0, 1fr); }
  .flip > .block-text { order: 0; }
  .block-text { padding-bottom: 0.5rem; }
  .phone { --pw: min(70vw, 320px); }
  .phone-widget { justify-self: center; --crop: 0.95; }
  .phone-streak { --crop: 0.5; }
  .sheet { margin-top: 1rem; margin-bottom: 5.5rem; }
  .type-big { order: -1; text-align: left; font-size: clamp(7rem, 34vw, 11rem); }
  .plans { grid-template-columns: minmax(0, 1fr); }
  .spec-meta { flex-direction: column; }
}
