/* The scenes: copy and a screen side by side (stacked on phones), each rising into view once (scenes.js). Without
   a script, or with reduced motion, every scene is shown as it ends. */
.vh {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}
.row[hidden] {
  display: none;
}
.time {
  margin-bottom: 0.9rem;
  color: var(--ball);
}
.scene {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 400px), 1fr));
  gap: clamp(2.5rem, 6vw, 6rem);
  align-items: center;
  max-width: 1220px;
  min-height: 100svh;
  margin: 0 auto;
  padding: 12vh max(1.25rem, 5vw);
  text-align: left;
}
@media (min-width: 60rem) {
  .flip .screen {
    order: -1;
  }
}
h2 {
  margin-bottom: 1.1rem;
  font: italic 560 clamp(2.6rem, 6vw, 5rem) / 0.95 var(--serif);
  letter-spacing: -0.03em;
  text-wrap: balance;
}
.copy > p:not(.tag) {
  max-width: 36ch;
  margin-bottom: 0.9rem;
  font-size: 1.2rem;
  color: rgb(246 239 220 / 0.88);
}
.copy,
.screen {
  min-width: 0;
}
.screen {
  display: grid;
  place-items: center;
  rotate: -2deg;
}
/* Motion, only for those who have not asked for less. Without it every scene is shown as it ends. */
.js .scene:not(.seen) .copy {
  opacity: 0;
  translate: 0 60px;
}
.js .scene:not(.seen) .screen {
  opacity: 0;
  translate: 0 90px;
  rotate: 7deg;
}
.js [data-scene]:not(.seen) h2 {
  font-weight: 120;
}
.chip .cut {
  stroke: #fff;
}

/* The app cards: Benji's own chat, white on the lawn, in the system font. */
.app {
  --bg: #fff;
  --tx: var(--ink);
  --sub: rgb(0 0 0 / 0.45);
  --bub: rgb(0 0 0 / 0.05);
  --ring: rgb(0 0 0 / 0.08);
  display: grid;
  gap: 10px;
  width: min(100%, 420px);
  padding: 18px;
  border-radius: 30px;
  background: var(--bg);
  color: var(--tx);
  font: 13px / 1.4 var(--sys);
  text-align: left;
  box-shadow:
    0 50px 90px rgb(0 0 0 / 0.4),
    0 0 0 1px var(--ring);
}
.app small {
  display: block;
  font-size: 11.5px;
  font-weight: 600;
  color: var(--sub);
}
.big {
  font-size: 16px;
  font-weight: 700;
}
.bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 34px;
  font-size: 17px;
}
.me {
  justify-self: end;
  max-width: 260px;
  padding: 9px 14px;
  border-radius: 20px 20px 6px 20px;
  background: var(--app);
  color: #fff;
  font-size: 14.5px;
}
.did {
  display: flex;
  align-items: center;
  gap: 8px;
}
.peer {
  margin-left: 32px;
  padding: 9px 12px;
  border-radius: 14px;
  background: var(--bub);
  font-size: 14px;
}
.ask {
  padding: 14px;
  border-radius: 22px;
  background: linear-gradient(rgb(94 92 230 / 0.12), rgb(255 255 255 / 0.6));
  box-shadow: 0 0 0 0.5px rgb(0 0 0 / 0.1);
}
.ask small {
  color: var(--app);
  text-transform: uppercase;
}
.ask .big {
  margin: 4px 0 12px;
}
.row {
  display: flex;
  align-items: center;
  gap: 14px;
  color: var(--sub);
}
.row b {
  color: var(--ink);
}
.hold {
  --p: 0;
  display: grid;
  place-items: center;
  flex: none;
  width: 66px;
  height: 66px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: conic-gradient(var(--app) calc(var(--p) * 1turn), rgb(94 92 230 / 0.14) 0);
  cursor: pointer;
  touch-action: none;
  user-select: none;
  -webkit-touch-callout: none;
}
.hold .pup,
.a .pup {
  width: 54px;
  height: 54px;
  padding: 12px;
  background: #fff;
  fill: var(--app);
}
.a .pup {
  background: var(--ball);
  fill: #123c26;
}

/* The post: an envelope whose seal breaks (drag or press it), its flap opens and the letter rises out of it. */
.post {
  position: relative;
  width: min(100%, 440px);
  aspect-ratio: 3 / 2;
  margin-top: min(230px, 60%);
  perspective: 1200px;
}
.post > * {
  position: absolute;
  inset: 0;
  border-radius: 16px;
}
.post .letter {
  inset: 8% 6%;
  z-index: 2;
  display: flex;
  flex-direction: column;
  padding: 18px;
  border-radius: 14px;
  background: #fff;
  color: var(--ink);
  font: 13px / 1.45 var(--sys);
  text-align: left;
  box-shadow: 0 20px 40px rgb(0 0 0 / 0.25);
}
.open .letter {
  top: -96%;
  z-index: 4;
}
.back {
  background: #ece2c6;
  box-shadow: 0 40px 80px rgb(0 0 0 / 0.4);
}
.pocket {
  z-index: 3;
  background: linear-gradient(160deg, #f6efdc, #e9dcb9);
  clip-path: polygon(0 0, 50% 54%, 100% 0, 100% 100%, 0 100%);
}
.post .flap {
  bottom: 44%;
  z-index: 5;
  border-radius: 16px 16px 0 0;
  background: linear-gradient(#efe4c4, #e3d4ab);
  clip-path: polygon(0 0, 100% 0, 50% 100%);
  transform-origin: 50% 0;
}
.open .flap {
  z-index: 1;
  transform: rotateX(180deg);
}
.post .seal {
  inset: calc(56% - 34px) auto auto calc(50% - 34px);
  z-index: 6;
  display: grid;
  place-items: center;
  width: 68px;
  height: 68px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: radial-gradient(circle at 34% 30%, #cf5a3f, #a93421 55%, #7f2216);
  box-shadow:
    0 4px 10px rgb(80 15 5 / 0.45),
    inset 0 0 0 3px rgb(255 255 255 / 0.12);
  cursor: grab;
  touch-action: none;
}
.seal svg {
  width: 36px;
  height: 36px;
  fill: #f3d2c8;
}
.open .seal {
  opacity: 0;
  visibility: hidden;
}
.from {
  display: flex;
  align-items: center;
  gap: 8px;
}
.from small {
  margin-left: auto;
  color: rgb(0 0 0 / 0.4);
}
.chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 1px 7px;
  border-radius: 99px;
  background: oklch(0.95 0.04 150);
  color: oklch(0.42 0.11 150);
  font-size: 10.5px;
  font-weight: 600;
}
.chip svg {
  width: 11px;
  height: 11px;
  fill: currentColor;
}
.letter h3 {
  margin: 6px 0 8px;
  font-size: 16px;
}
.addr {
  display: flex;
  align-items: center;
  gap: 8px;
  width: fit-content;
  max-width: 100%;
  padding: 6px 10px 6px 6px;
  border-radius: 12px;
  box-shadow: 0 0 0 0.5px rgb(0 0 0 / 0.12);
  font-size: 12.5px;
  line-height: 1.3;
  overflow-wrap: anywhere;
}
.addr small,
.swept,
.plain small {
  color: rgb(0 0 0 / 0.5);
}
.postmark {
  flex: none;
  width: 34px;
  height: 34px;
  color: rgb(39 65 138 / 0.6);
  fill: none;
  stroke: currentColor;
  stroke-width: 0.9;
}
.postmark text,
.postmark use {
  fill: currentColor;
  stroke: none;
  font: 700 4.9px var(--sys);
  letter-spacing: 0.45px;
}
.swept {
  margin: 8px 0;
  font-size: 12px;
}
.plain {
  flex: 1;
  min-height: 0;
  overflow: hidden;
  padding: 11px 13px;
  border-radius: 12px;
  background: rgb(0 0 0 / 0.035);
  line-height: 1.55;
}
.plain small {
  font-size: 10px;
  text-transform: uppercase;
}
.plain dl {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 2px 12px;
  margin: 6px 0;
}

/* Private mode: the same chat in the private theme; the switch flips it. */
.private {
  --bg: oklch(0.17 0.025 285);
  --tx: rgb(255 255 255 / 0.92);
  --sub: rgb(255 255 255 / 0.5);
  --bub: oklch(0.25 0.035 285);
  --ring: rgb(143 141 255 / 0.35);
}
.app:not(.private) .if-private,
.private .if-standard {
  display: none;
}
.switch {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  padding: 0 6px 0 12px;
  border: 0;
  border-radius: 99px;
  background: var(--bub);
  color: inherit;
  font: 600 13px var(--sys);
  cursor: pointer;
}
.switch svg,
.band svg {
  width: 15px;
  height: 15px;
  fill: currentColor;
}
.switch i {
  width: 36px;
  height: 22px;
  padding: 2px;
  border-radius: 99px;
  background: rgb(0 0 0 / 0.18);
}
.switch i::after {
  content: "";
  display: block;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 2px rgb(0 0 0 / 0.25);
}
[aria-checked="true"] i {
  background: var(--app);
}
[aria-checked="true"] i::after {
  translate: 14px;
}
.band {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 12px;
  border-radius: 14px;
  background: linear-gradient(90deg, rgb(94 92 230 / 0.35), rgb(143 141 255 / 0.08));
  font-weight: 600;
  font-size: 12.5px;
}
.app:not(.private) .band {
  display: none;
}
.reply {
  max-width: 270px;
  padding: 10px 14px;
  border-radius: 20px 20px 20px 6px;
  background: var(--bub);
  font:
    600 14.5px / 1.4 ui-rounded,
    var(--sys);
}
.compose {
  display: flex;
  align-items: center;
  height: 44px;
  padding: 0 6px 0 14px;
  border-radius: 99px;
  box-shadow: inset 0 0 0 1px var(--ring);
  color: var(--sub);
}
.compose i {
  width: 32px;
  height: 32px;
  margin-left: auto;
  border-radius: 50%;
  background: var(--app);
}

@media (prefers-reduced-motion: no-preference) {
  .copy,
  .screen {
    transition:
      opacity 1s,
      translate 1.1s cubic-bezier(0.2, 0.8, 0.2, 1),
      rotate 1.2s cubic-bezier(0.2, 0.8, 0.2, 1);
  }
  .screen {
    transition-delay: 0.15s;
  }
  h2 {
    transition: font-weight 1.4s cubic-bezier(0.2, 0.8, 0.2, 1);
  }
  .app,
  .band,
  .reply,
  .switch i::after {
    transition: 0.5s;
  }
  .post .letter {
    transition: top 1s cubic-bezier(0.2, 0.8, 0.2, 1);
  }
  .post .flap {
    transition: transform 0.9s cubic-bezier(0.3, 0.7, 0.2, 1);
  }
  .post .seal {
    transition:
      transform 0.7s cubic-bezier(0.3, 0.7, 0.2, 1),
      opacity 0.6s 0.2s,
      visibility 0.8s;
  }
  .post .seal.drag {
    transition: none;
  }
}
