:root {
  color-scheme: dark;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
  color: var(--ff-text);
  background: var(--ff-night-gradient);
  font: 400 16px/1.5 var(--ff-font-ui);
  min-height: 100vh;
}
a {
  color: inherit;
  text-decoration: none;
}
a:focus-visible,
button:focus-visible {
  outline: 3px solid var(--ff-focus);
  outline-offset: 5px;
}
.demo-nav {
  max-width: 1280px;
  margin: auto;
  padding: 24px 40px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}
.demo-nav > span,
.demo-nav > a:last-child {
  color: var(--ff-muted);
  font-size: 12px;
}
.demo-brand {
  display: flex;
  gap: 12px;
  align-items: center;
  font: 600 30px/1 var(--ff-font-display);
}
.intro {
  text-align: center;
  padding: 40px 24px 24px;
}
.eyebrow {
  color: var(--ff-signal);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  font-weight: 700;
}
h1 {
  font: 500 clamp(36px, 4.6vw, 64px)/1.03 var(--ff-font-display);
  margin: 16px 0;
  letter-spacing: -0.025em;
}
h1 em {
  color: var(--ff-cover-mist);
  font-weight: 500;
}
.intro > p:last-child {
  color: var(--ff-muted);
  font-size: 14px;
  line-height: 1.7;
}
.experience {
  max-width: 1080px;
  margin: 0 auto;
}
.scene-window {
  width: 100%;
  overflow: hidden;
  position: relative;
}
.scene {
  width: 1080px;
  height: 760px;
  position: absolute;
  top: 0;
  left: 0;
  transform-origin: top left;
}
.scene::before {
  content: '';
  position: absolute;
  inset: 8px 112px;
  border: 1px solid var(--ff-border);
  border-radius: var(--ff-radius-lg);
  background: color-mix(in srgb, var(--ff-surface) 20%, transparent);
  opacity: 0;
  transition: opacity 1s;
}
.scene.is-organized::before {
  opacity: 1;
}
.scene-heading {
  position: absolute;
  top: 24px;
  left: 152px;
  right: 152px;
  display: flex;
  align-items: center;
  gap: 12px;
  font: 600 26px/1 var(--ff-font-display);
  opacity: 0;
  transition: opacity 1s;
}
.scene-heading .feed-label {
  margin-left: auto;
  font: 500 11px/1 var(--ff-font-ui);
  color: var(--ff-muted);
}
.is-organized .scene-heading {
  opacity: 1;
}
.pile-label {
  position: absolute;
  top: 36px;
  width: 100%;
  text-align: center;
  font-size: 12px;
  letter-spacing: 0.05em;
  color: var(--ff-muted);
  transition: opacity 0.5s;
}
.is-organized .pile-label {
  opacity: 0;
}
.piece {
  position: absolute;
  width: 224px;
  height: 309px;
  top: 0;
  left: 0;
  border-radius: var(--ff-radius-md);
  box-shadow: var(--ff-shadow-raised);
  background: var(--ff-surface);
  color: var(--ff-ink);
  overflow: hidden;
  border: 1px solid var(--ff-border);
  transform-origin: 50% 50%;
}
.piece img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}
.piece-art {
  position: absolute;
  inset: 0 0 40px;
  background: var(--ff-surface);
}
.piece-art img {
  object-fit: contain;
  object-position: top;
}
.piece-meta {
  position: absolute;
  inset: auto 0 0;
  height: 40px;
  padding: 8px 10px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  opacity: 0;
  font: 600 10px/1.2 var(--ff-font-ui);
}
.piece-meta span:first-child {
  color: var(--ff-primary);
}
.piece-meta span:last-child {
  color: var(--ff-muted);
  font-size: 9px;
}
.source {
  position: absolute;
  inset: 0;
  background: var(--ff-surface);
  padding: 20px 16px;
  font: 400 12px/1.6 var(--ff-font-ui);
}
.source .source-label {
  font-size: 10px;
  font-weight: 700;
  color: var(--ff-muted);
  border-bottom: 1px solid var(--ff-border);
  padding-bottom: 12px;
  margin-bottom: 16px;
}
.source h2 {
  font: 600 24px/1.1 var(--ff-font-display);
  margin: 12px 0;
}
.message-bubble {
  border-radius: var(--ff-radius-md);
  padding: 12px;
  background: var(--ff-surface-subtle);
  margin-bottom: 12px;
}
.message-bubble.reply {
  background: var(--ff-primary);
  color: var(--ff-primary-contrast);
  margin-left: 40px;
}
.note {
  background: var(--ff-cover-gold);
  color: var(--ff-night-end);
}
.note .source-label {
  color: inherit;
}
.note h2 {
  font-style: italic;
  font-size: 30px;
  transform: rotate(-3deg);
  margin-block: 24px;
}
.fly {
  position: absolute;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--ff-firefly-body);
  box-shadow: 0 0 8px 2px color-mix(in srgb, var(--ff-firefly-gold) 55%, transparent);
  opacity: 0;
  pointer-events: none;
}
.fly::before {
  content: '';
  position: absolute;
  inset: -24px;
  background: var(--ff-firefly-simple-falloff);
}
.swarm {
  position: absolute;
  inset: 0;
  pointer-events: none;
}
.experience-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding: 16px 40px;
}
#status {
  color: var(--ff-cover-mist);
  font-size: 1rem;
  line-height: 1.5;
  font-weight: 500;
}
.playback {
  display: flex;
  gap: 8px;
}
.playback .ff-button {
  min-height: 44px;
  font-size: 12px;
}
.footnote {
  text-align: center;
  font-size: 11px;
  color: var(--ff-muted);
  margin: 24px;
}
@media (max-width: 600px) {
  .demo-nav {
    padding: 24px;
  }
  .demo-nav > span {
    display: none;
  }
  .intro {
    padding-top: 24px;
  }
  .experience-footer {
    padding: 8px 24px;
    flex-direction: column;
    text-align: center;
  }
  .scene-window {
    margin-top: 16px;
  }
}
@media (prefers-reduced-motion: reduce) {
  *,
  *::before {
    transition: none !important;
  }
}
/* Second motion study: a real pile, a breath, then a single scrolling feed. */
.scene {
  height: 700px;
}
.scene::before,
.scene-heading {
  display: none;
}
.pile-label {
  top: 16px;
}
.piece.incoming {
  height: auto;
  min-height: 0;
  border-radius: var(--ff-radius-xs);
  opacity: 0;
}
.incoming.flyer {
  width: 224px;
}
.incoming.flyer img {
  height: auto;
}
.incoming.messages {
  width: 300px;
  background: transparent;
  border: 0;
  box-shadow: none;
  overflow: visible;
  padding: 8px;
}
.chat-person {
  text-align: center;
  font-size: 12px;
  font-weight: 700;
  margin-bottom: 16px;
  color: var(--ff-cover-mist);
}
.chat-person span {
  display: block;
  font-size: 10px;
  font-weight: 400;
  color: var(--ff-muted);
}
.message-bubble {
  position: relative;
  background: var(--ff-surface-subtle);
  color: var(--ff-ink);
  padding: 12px 16px;
  font-size: 13px;
  line-height: 1.4;
  margin-right: 32px;
  box-shadow: var(--ff-shadow-card);
}
.message-bubble::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: -6px;
  width: 16px;
  height: 16px;
  background: inherit;
  border-radius: 0 0 0 14px;
  transform: skewX(-20deg);
}
.message-bubble.reply {
  background: var(--ff-primary);
  color: var(--ff-primary-contrast);
  margin-left: 48px;
  margin-right: 0;
}
.message-bubble.reply::after {
  left: auto;
  right: -6px;
  transform: skewX(20deg);
  border-radius: 0 0 14px 0;
}
.incoming.email {
  width: 320px;
  padding: 0 20px 16px;
  font-size: 12px;
  line-height: 1.5;
}
.mail-toolbar {
  margin: 0 -20px 16px;
  padding: 12px 16px;
  display: flex;
  justify-content: space-between;
  background: var(--ff-surface-subtle);
  color: var(--ff-primary);
  border-bottom: 1px solid var(--ff-border);
}
.incoming.email h2 {
  font: 700 18px/1.2 var(--ff-font-ui);
  margin: 0 0 16px;
}
.mail-sender {
  display: flex;
  align-items: center;
  gap: 8px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--ff-border);
}
.mail-sender > b {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--ff-surface-subtle);
  text-align: center;
  line-height: 32px;
}
.mail-sender small {
  display: block;
  color: var(--ff-muted);
  font-size: 10px;
}
.incoming.note {
  width: 250px;
  padding: 24px;
}
.incoming.note h2,
.fundraiser-art h2 {
  font: 600 italic 30px/1.1 var(--ff-font-display);
}
.incoming.note p {
  font-size: 12px;
}
.landing-puff {
  position: absolute;
  width: 300px;
  height: 140px;
  border-radius: 50%;
  opacity: 0;
  pointer-events: none;
  background:
    radial-gradient(ellipse at 30% 55%, var(--ff-cover-mist), transparent 55%),
    radial-gradient(ellipse at 70% 40%, var(--ff-cover-mist), transparent 55%);
  filter: blur(12px);
}
.gather-glow {
  position: absolute;
  inset: 80px 240px 100px;
  opacity: 0;
  pointer-events: none;
  border-radius: 50%;
  background: radial-gradient(
    ellipse,
    color-mix(in srgb, var(--ff-firefly-gold) 85%, var(--ff-surface)),
    color-mix(in srgb, var(--ff-firefly-gold) 55%, transparent) 35%,
    color-mix(in srgb, var(--ff-firefly-gold) 15%, transparent) 58%,
    transparent 74%
  );
  filter: blur(24px);
}
.demo-feed {
  position: absolute;
  left: 370px;
  top: 16px;
  width: 340px;
  height: 660px;
  border-radius: var(--ff-radius-lg);
  border: 1px solid var(--ff-border);
  background: var(--ff-canvas);
  color: var(--ff-ink);
  overflow: hidden;
  box-shadow: var(--ff-shadow-raised);
  opacity: 0;
}
.demo-feed-header {
  display: flex;
  gap: 12px;
  align-items: center;
  padding: 20px 16px;
  height: 72px;
  border-bottom: 1px solid var(--ff-border);
  background: var(--ff-canvas);
  position: relative;
  z-index: 2;
}
.demo-feed-header strong {
  font: 600 30px/1 var(--ff-font-display);
}
.demo-feed-header > span:last-child {
  margin-left: auto;
  font-size: 11px;
  color: var(--ff-muted);
}
.feed-viewport {
  height: 588px;
  overflow: hidden;
  padding: 12px;
}
.feed-inner {
  display: flex;
  flex-direction: column;
  gap: 16px;
  will-change: transform;
}
.feed-event {
  flex-shrink: 0;
  overflow: hidden;
  background: var(--ff-surface);
  border: 1px solid var(--ff-border);
  border-radius: var(--ff-radius-md);
  box-shadow: var(--ff-shadow-card);
}
.feed-event img {
  display: block;
  width: 100%;
  height: auto;
}
.event-heading {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
}
.event-heading > strong {
  color: var(--ff-primary);
  font: 600 13px/1 var(--ff-font-display);
  white-space: nowrap;
}
.event-heading h2 {
  font: 600 18px/1.1 var(--ff-font-display);
  margin: 0;
}
.event-footer {
  padding: 12px;
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  color: var(--ff-muted);
}
.fundraiser-art {
  background: var(--ff-cover-gold);
  color: var(--ff-night-end);
  padding: 32px 24px;
  min-height: 280px;
}
.fundraiser-art p {
  font-size: 12px;
}
.swarm {
  z-index: 5;
}
.playback [hidden] {
  display: none;
}
/* Paper has an edge; digital invitations keep their familiar UI shape. */
.scene {
  height: 800px;
}
.pieces {
  position: absolute;
  inset: 0;
  perspective: 1100px;
  transform-style: preserve-3d;
}
.piece.incoming.flyer,
.piece.incoming.note {
  border-radius: 0;
  border: 0;
  box-shadow:
    var(--ff-shadow-raised),
    3px 4px 0 color-mix(in srgb, var(--ff-cover-mist) 18%, transparent);
  backface-visibility: hidden;
}
.incoming.flyer::after,
.incoming.note::after {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(
    100deg,
    transparent 30%,
    color-mix(in srgb, var(--ff-surface) 12%, transparent) 48%,
    color-mix(in srgb, var(--ff-night-start) 9%, transparent) 51%,
    transparent 70%
  );
}
.incoming.messages {
  width: 280px;
}
.message-bubble {
  transform-origin: bottom left;
}
.message-bubble.reply {
  transform-origin: bottom right;
}
.image-message {
  width: 156px;
  padding: 4px;
  overflow: hidden;
}
.image-message img {
  width: 100%;
  height: auto;
  border-radius: var(--ff-radius-sm);
}
.incoming.email {
  width: 320px;
  border-radius: var(--ff-radius-sm);
}
.envelope-icon {
  width: 24px;
  height: 24px;
  flex-shrink: 0;
}
.email-attachment {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px;
  background: var(--ff-surface-subtle);
  border: 1px solid var(--ff-border);
  border-radius: var(--ff-radius-xs);
  color: var(--ff-muted);
  font-size: 10px;
}
.email-attachment img {
  width: 76px;
  height: auto;
}
.gather-glow {
  inset: -40px 40px;
  background:
    radial-gradient(
      ellipse at 40% 50%,
      color-mix(in srgb, var(--ff-firefly-gold) 70%, transparent),
      color-mix(in srgb, var(--ff-firefly-gold) 22%, transparent) 30%,
      transparent 65%
    ),
    radial-gradient(
      ellipse at 65% 58%,
      color-mix(in srgb, var(--ff-firefly-gold) 60%, transparent),
      color-mix(in srgb, var(--ff-firefly-gold) 10%, transparent) 42%,
      transparent 72%
    );
  filter: blur(48px);
}
.demo-feed {
  left: 370px;
  top: 24px;
  width: 340px;
  height: 716px;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  overflow: visible;
}
.demo-feed .phone {
  width: 340px;
  height: 700px;
  margin: 0;
}
.demo-feed .phone-scroll {
  overflow-y: auto;
  touch-action: pan-y;
}
.demo-feed .phone-feed {
  padding-bottom: 96px;
}
.demo-feed .phone-tabs .feed-segment {
  width: 55%;
}
.demo-feed .phone-header .brand {
  color: var(--ff-ink);
}
/* Keep the demo introduction independent of the landing page's copy column. */
.intro {
  width: 100%;
  max-width: none;
  margin: 0;
  text-align: center;
}
.intro h1 {
  max-width: none;
  text-align: center;
}
/* Familiar message chrome stays still while the conversation arrives inside. */
.piece.incoming.messages {
  background: var(--ff-canvas);
  border: 1px solid var(--ff-border);
  border-radius: var(--ff-radius-lg);
  padding: 0 12px 12px;
  box-shadow: var(--ff-shadow-raised);
  overflow: hidden;
}
.chat-chrome {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin: 0 -12px;
  padding: 12px 16px 4px;
  background: var(--ff-surface-subtle);
  color: var(--ff-primary);
}
.chat-avatar {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--ff-border);
  color: var(--ff-ink);
  font-size: 12px;
}
.chat-person {
  color: var(--ff-ink);
  background: var(--ff-surface-subtle);
  margin: 0 -12px 16px;
  padding: 0 12px 12px;
  border-bottom: 1px solid var(--ff-border);
}
.chat-person span {
  font-size: 9px;
}
.message-bubble {
  font-size: 12px;
  margin-bottom: 8px;
  padding: 10px 12px;
}
.image-message {
  padding: 4px;
  width: 136px;
}
.chat-compose {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  color: var(--ff-muted);
  font-size: 12px;
  margin-top: 12px;
}
.chat-compose span:nth-child(2) {
  flex: 1;
  border: 1px solid var(--ff-border);
  border-radius: var(--ff-radius-pill);
  padding: 6px 12px;
  font-size: 10px;
}
.chat-compose span:last-child {
  border-radius: 50%;
  padding: 4px 8px;
  background: var(--ff-primary);
  color: var(--ff-primary-contrast);
}
/* New fictional print pieces use the shared content palette and simple vector art. */
.incoming.flyer {
  container-type: inline-size;
}
.print-flyer {
  aspect-ratio: 5/6;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: 6cqw;
  text-align: center;
  background: var(--ff-surface);
  color: var(--ff-lake);
  overflow: hidden;
}
.print-flyer p {
  margin: 2cqw 0;
  font-size: 4cqw;
  line-height: 1.2;
}
.print-flyer .print-kicker {
  font-size: 3cqw;
  letter-spacing: 0.06em;
}
.print-flyer h2 {
  margin: 2cqw 0;
  font: 600 16cqw/0.95 var(--ff-font-display);
}
.print-flyer svg {
  width: 32cqw;
  height: 32cqw;
  flex-shrink: 0;
  margin: 2cqw 0;
}
.print-flyer strong {
  font: 700 4cqw/1.2 var(--ff-font-ui);
  margin-top: 2cqw;
}
.print-flyer .print-detail {
  font-size: 3.2cqw;
  letter-spacing: 0.08em;
  font-weight: 700;
}
.print-flyer small {
  font-size: 3cqw;
  line-height: 1.3;
  margin-top: 3cqw;
}
.print-reunion {
  background: color-mix(in srgb, var(--ff-cover-mist) 25%, var(--ff-surface));
}
.print-reunion h2 {
  font-style: italic;
}
.print-run {
  background: var(--ff-cover-gold);
  color: var(--ff-night-end);
}
.print-run h2 {
  font: 700 14cqw/0.9 var(--ff-font-ui);
  letter-spacing: -0.06em;
}
.print-run svg {
  width: 26cqw;
  height: 26cqw;
}
.print-movie {
  background: var(--ff-night-mid);
  color: var(--ff-cover-gold);
}
.print-movie h2 {
  font-size: 14cqw;
}
.print-books {
  background: color-mix(in srgb, var(--ff-cover-coral) 25%, var(--ff-surface));
}
.print-books h2 {
  font-size: 15cqw;
}
.print-science {
  background: var(--ff-cover-sky);
  color: var(--ff-night-end);
}
.print-science h2 {
  font: 700 20cqw/0.85 var(--ff-font-ui);
  letter-spacing: -0.06em;
}
.print-science svg {
  width: 35cqw;
  height: 35cqw;
}
.print-swim {
  background: color-mix(in srgb, var(--ff-cover-mist) 60%, var(--ff-surface));
}
.print-swim h2 {
  font-style: italic;
}
.print-run svg {
  width: 22cqw;
  height: 22cqw;
}
.print-science svg {
  width: 28cqw;
  height: 28cqw;
}
.print-run,
.print-science {
  padding-block: 4cqw;
}
/* A few bolder posters balance the quieter stationery in the stack. */
.print-swim {
  background: var(--ff-cover-sky);
  color: var(--ff-night-end);
}
.print-swim h2 {
  font: 700 17cqw/0.9 var(--ff-font-ui);
  letter-spacing: -0.065em;
  transform: rotate(-5deg);
  color: var(--ff-night-mid);
}
.print-swim svg {
  width: 70cqw;
  height: 43cqw;
  overflow: visible;
  margin: 1cqw 0;
}
.graphic-sun {
  fill: var(--ff-cover-gold);
  stroke: none;
}
.graphic-water {
  fill: var(--ff-lake);
  stroke: none;
}
.graphic-wave {
  fill: none;
  stroke: var(--ff-cover-mist);
  stroke-width: 4;
}
.graphic-swimmer {
  fill: none;
  stroke: var(--ff-night-mid);
  stroke-width: 8;
  stroke-linecap: round;
}
.graphic-head {
  fill: var(--ff-night-mid);
  stroke: none;
}
.print-run svg {
  width: 66cqw;
  height: 35cqw;
  overflow: hidden;
  transform: rotate(-8deg);
}
.print-run h2 {
  transform: rotate(-3deg);
}
.graphic-track {
  stroke: var(--ff-cover-coral);
  stroke-width: 7;
  fill: none;
}
.graphic-shoe {
  fill: var(--ff-surface);
  stroke: var(--ff-night-mid);
  stroke-width: 3;
}
.print-movie {
  background: var(--ff-night-mid);
  color: var(--ff-cover-gold);
}
.print-movie svg {
  width: 56cqw;
  height: 40cqw;
}
.print-movie h2 {
  font-size: 15cqw;
}
.graphic-moon {
  fill: var(--ff-cover-gold);
  stroke: none;
}
.graphic-stars {
  fill: var(--ff-cover-mist);
  stroke: none;
}
.graphic-popcorn {
  fill: var(--ff-cover-coral);
  stroke: var(--ff-cover-gold);
}
.print-swim svg {
  height: 35cqw;
}
.print-run svg {
  height: 29cqw;
}
.print-movie svg {
  height: 34cqw;
}
/* A flexible print surface replaces the rigid card-like 3D rotation. */
.pieces {
  perspective: none;
  transform-style: flat;
}
.paper-surface {
  transform-origin: 50% 20%;
  background: inherit;
  width: 100%;
}
.incoming.flyer::after,
.incoming.note::after {
  display: none;
}
.piece.incoming.flyer,
.piece.incoming.note {
  box-shadow: var(--ff-shadow-card);
}
.illustrated-flyer {
  display: block;
  width: 100%;
  height: auto;
}
.print-science {
  background: var(--ff-surface);
  color: var(--ff-lake);
}
.print-science .print-kicker {
  color: var(--ff-muted);
}
.print-science svg {
  color: var(--ff-cover-coral);
}
/* Both message windows share identical chrome and outer dimensions. */
.piece.incoming.messages {
  height: 544px;
}
.incoming.messages .chat-compose {
  position: absolute;
  bottom: 12px;
  left: 12px;
  right: 12px;
}
/* Small edge wisps expand sideways at contact, rather than a floating cloud. */
.landing-puff {
  left: 0;
  top: 0;
  border-radius: 0;
  opacity: 1;
  background: none;
  filter: none;
  transform-origin: 50% 50%;
}
.air-wisp {
  position: absolute;
  bottom: -6px;
  left: 8%;
  width: 42px;
  height: 16px;
  border-radius: 50%;
  background: radial-gradient(ellipse, var(--ff-cover-mist), transparent 70%);
  filter: blur(3px);
  opacity: 0;
}
.air-wisp:nth-child(2) {
  left: auto;
  right: 8%;
  width: 34px;
  height: 14px;
}
.air-wisp:nth-child(3) {
  left: 46%;
  width: 26px;
  height: 10px;
}
/* Let the transformation breathe beyond its stage without horizontal scrolling. */
body {
  overflow-x: clip;
}
.scene-window {
  overflow: visible;
}
.chat-chrome {
  display: grid;
  grid-template-columns: 32px 1fr 32px;
  align-items: center;
}
.chat-chrome > :first-child {
  justify-self: start;
}
.chat-chrome > .chat-avatar {
  justify-self: center;
}
.chat-chrome > :last-child {
  justify-self: end;
}
.chat-person {
  text-align: center;
}
.message-bubble:not(.reply) {
  background: var(--ff-gray-200);
  color: var(--ff-ink);
}
/* Bubble transforms remain inside their window’s layer in the paper stack. */
.piece.incoming {
  isolation: isolate;
}
#status {
  min-height: 1.5em;
}
.caption-chunk {
  display: inline-block;
  white-space: nowrap;
}
#status.is-chunked {
  white-space: nowrap;
}

/* Reserve space for the copy and controls before fitting the stage to height. */
.demo-nav {
  padding-block: 16px;
}
.intro {
  padding-block: 16px;
}
.intro h1 {
  font-size: clamp(32px, 5vh, 64px);
  margin-block: 12px;
}
#status.is-chunked {
  white-space: normal;
}

.intro h1 {
  line-height: 1.18;
}
#status {
  margin: 0;
  padding: 8px 24px 24px;
  text-align: center;
}
.experience-footer {
  justify-content: center;
  padding: 8px 24px;
}
.playback {
  justify-content: center;
}
.playback .ff-button {
  --ff-button-height: 28px;
  --button-surface: color-mix(in srgb, var(--ff-surface) 24%, transparent);
  --button-surface-border: color-mix(in srgb, var(--ff-border) 40%, transparent);
  min-height: 30px;
  padding: 0 16px;
  gap: 8px;
  opacity: 0.8;
  font-size: 11px;
}
.playback svg {
  width: 12px;
  height: 12px;
  flex: none;
}

/* Embedded story shares the tested demo without leaking layout into the site. */
body.is-embedded {
  background: var(--ff-night-start);
}
.is-embedded .demo-nav,
.is-embedded .intro h1 {
  display: none;
}
.is-embedded .intro {
  padding: 24px 24px 8px;
}
.is-embedded .intro .eyebrow {
  font: 500 clamp(28px, 3.5vw, 40px)/1.18 var(--ff-font-display);
  color: var(--ff-text);
  text-transform: none;
  letter-spacing: -0.025em;
  margin: 0;
}
/* The embedded stage already reserves its full height; avoid a nested page scrollbar. */
body.is-embedded {
  overflow: hidden;
}
.is-embedded .intro .eyebrow {
  font-size: 40px;
}

/* A visible invitation to play while the stage waits to enter the viewport. */
.scene-window .story-play {
  --button-surface: color-mix(in srgb, var(--ff-night-mid) 32%, transparent);
  --button-surface-border: color-mix(in srgb, var(--ff-cover-mist) 38%, transparent);
  display: grid;
  place-items: center;
  line-height: 0;
  backdrop-filter: blur(6px) saturate(120%);
  -webkit-backdrop-filter: blur(6px) saturate(120%);
  position: absolute;
  left: 50%;
  top: 50%;
  translate: -50% -50%;
  width: 64px;
  height: 64px;
  min-height: 64px;
  padding: 0;
  border-radius: 50%;
  z-index: 8;
  opacity: 1;
  transition:
    opacity 600ms var(--ff-ease-out),
    transform var(--ff-duration-base) var(--ff-ease-menu-spring);
}
.story-play svg {
  width: 24px;
  height: 24px;
  display: block;
  margin: 0;
}
.scene-window .story-play:hover {
  --button-surface: color-mix(in srgb, var(--ff-night-mid) 44%, transparent);
}
.scene-window .story-play::before {
  box-shadow: inset 0 1px 1px color-mix(in srgb, var(--ff-cover-mist) 16%, transparent);
}
.scene-window.has-started .story-play {
  opacity: 0;
  pointer-events: none;
}
@media (prefers-reduced-motion: reduce) {
  .scene-window .story-play {
    transition: none;
  }
}
.scene-window.has-started.is-paused .story-play {
  opacity: 1;
  pointer-events: auto;
}

/* Short messages hug their text; longer ones wrap within the conversation. */
.incoming.messages .message-bubble:not(.image-message) {
  width: fit-content;
  max-width: calc(100% - 32px);
  overflow-wrap: anywhere;
}
.incoming.messages .message-bubble.reply {
  margin-left: auto;
  margin-right: 0;
}

/* Soft swept tails join the bubble instead of forming a separate block. */
.incoming.messages .message-bubble {
  box-shadow: none;
}
.incoming.messages .message-bubble::after {
  width: 14px;
  height: 14px;
  left: -5px;
  right: auto;
  bottom: 0;
  border-radius: 0;
  transform: none;
  clip-path: path('M14 0 C13 7 8 11 0 12 C4 15 11 13 14 9 Z');
}
.incoming.messages .message-bubble.reply::after {
  left: auto;
  right: -5px;
  transform: scaleX(-1);
}
.incoming.messages .image-message::after {
  content: none;
}

/* Reserve two caption lines so mobile copy changes never move or rescale the phone. */
@media (max-width: 700px) {
  #status {
    min-height: calc(3em + 32px);
  }
}
/* Captions belong solely to the story timeline, including its delayed opening. */
#status:not(.is-active) {
  visibility: hidden;
}
.story-cta-slot {
  display: flex;
  justify-content: center;
  padding: 0 24px;
}
/* Keep the mobile caption adjacent to the story; group its CTA with playback. */
@media (max-width: 700px) {
  .experience {
    display: flex;
    flex-direction: column;
  }
  .scene-window {
    order: 1;
  }
  .story-cta-slot {
    order: 2;
  }
  .experience-footer {
    order: 3;
    padding-top: 16px;
  }
}
.story-cta {
  visibility: hidden;
  opacity: 0;
  translate: 0 4px;
  transition:
    opacity 1400ms var(--ff-ease-out),
    translate 1400ms var(--ff-ease-out);
}
.story-cta.is-visible {
  visibility: visible;
  opacity: 1;
  translate: 0 0;
}
@media (prefers-reduced-motion: reduce) {
  .story-cta {
    transition: none;
    translate: none;
  }
}
@media (prefers-reduced-motion: no-preference) {
  .is-embedded .intro .eyebrow.heading-reveal-pending {
    opacity: 0;
    translate: 0 4px;
  }
}
.mail-toolbar-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}
.mail-toolbar-actions svg {
  width: 18px;
  height: 18px;
}
.chat-chrome > span svg,
.chat-compose > span svg {
  width: 18px;
  height: 18px;
  display: block;
}
.chat-compose > span:first-child,
.chat-compose > span:last-child {
  display: grid;
  place-items: center;
}
/* Keep the send action circular even when its icon is an SVG. */
.incoming.messages .chat-compose > span:last-child {
  box-sizing: border-box;
  width: 28px;
  height: 28px;
  flex: 0 0 28px;
  padding: 0;
  border-radius: 50%;
  display: grid;
  place-items: center;
}
.incoming.messages .chat-compose > span:last-child svg {
  width: 17px;
  height: 17px;
}
