/* ==========================================================================
   Farewell Film — Core Design System
   Palette: void, navy night, cream, sunset, gold
   ========================================================================== */

:root {
  --void: #050608;
  --navy: #0a1220;
  --night: #122038;
  --dusk: #1a2a45;
  --cream: #e8dfd0;
  --cream-soft: #c9bba8;
  --sunset: #c46b3a;
  --gold: #b8956c;
  --gold-soft: rgba(184, 149, 108, 0.45);
  --rain: rgba(180, 200, 220, 0.35);
  --text: var(--cream);
  --text-muted: rgba(232, 223, 208, 0.55);
  --serif: "Cormorant Garamond", "Times New Roman", Georgia, serif;
  --sans: "Outfit", "Helvetica Neue", Arial, sans-serif;
  --ease-cinematic: cubic-bezier(0.22, 0.61, 0.36, 1);
  --letterbox: clamp(18px, 4vh, 48px);
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

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

html {
  scroll-behavior: auto;
  background: var(--void);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

html.is-locked {
  overflow: hidden;
  height: 100%;
}

body {
  font-family: var(--sans);
  font-weight: 300;
  font-size: 16px;
  line-height: 1.6;
  background: var(--void);
  min-height: 100vh;
  overflow-x: hidden;
}

body.is-locked {
  overflow: hidden;
  height: 100%;
}

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

button {
  font: inherit;
  color: inherit;
  background: none;
  border: none;
  cursor: pointer;
}

[hidden] {
  display: none !important;
}

/* —— Overlays —— */

.grain {
  position: fixed;
  inset: 0;
  z-index: 90;
  pointer-events: none;
  opacity: 0.07;
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  background-size: 180px 180px;
}

.vignette {
  position: fixed;
  inset: 0;
  z-index: 85;
  pointer-events: none;
  background: radial-gradient(ellipse at center, transparent 40%, rgba(5, 6, 8, 0.55) 100%);
}

.letterbox {
  position: fixed;
  inset: 0;
  z-index: 88;
  pointer-events: none;
}

.letterbox__bar {
  position: absolute;
  left: 0;
  right: 0;
  height: var(--letterbox);
  background: var(--void);
}

.letterbox__bar--top {
  top: 0;
  padding-top: var(--safe-top);
}

.letterbox__bar--bottom {
  bottom: 0;
  padding-bottom: var(--safe-bottom);
}

.chromatic {
  position: fixed;
  inset: 0;
  z-index: 84;
  pointer-events: none;
  opacity: 0;
  mix-blend-mode: screen;
  background:
    linear-gradient(90deg, rgba(196, 107, 58, 0.08), transparent 40%, rgba(18, 48, 90, 0.1));
}

/* —— UI chrome —— */

.audio-toggle {
  position: fixed;
  top: calc(var(--letterbox) + 12px + var(--safe-top));
  right: 18px;
  z-index: 100;
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  color: var(--cream-soft);
  opacity: 0.7;
  transition: opacity 0.4s var(--ease-cinematic);
}

.audio-toggle:hover,
.audio-toggle:focus-visible {
  opacity: 1;
}

.audio-toggle__icon {
  width: 22px;
  height: 22px;
}

.progress {
  position: fixed;
  top: calc(var(--letterbox) + 8px + var(--safe-top));
  left: 50%;
  transform: translateX(-50%);
  z-index: 100;
  width: min(160px, 28vw);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.6s ease;
}

.progress.is-visible {
  opacity: 0.55;
}

.progress__track {
  height: 1px;
  background: rgba(232, 223, 208, 0.15);
}

.progress__fill {
  height: 100%;
  width: 0%;
  background: var(--gold);
  transform-origin: left center;
}

/* —— Intro —— */

.scene--intro {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  place-items: center;
  background: var(--void);
  visibility: visible;
  opacity: 1;
  pointer-events: auto;
}

.intro {
  text-align: center;
  padding: 2rem;
  max-width: 36rem;
}

.intro__line {
  font-family: var(--serif);
  font-weight: 300;
  font-size: clamp(1.35rem, 3.5vw, 2.15rem);
  letter-spacing: 0.04em;
  line-height: 1.45;
  color: var(--cream);
  opacity: 0;
}

.intro__line--second {
  margin-top: 1.25rem;
  color: var(--cream-soft);
}

.intro__cta {
  margin-top: 3.5rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.25rem;
}

.intro__prompt {
  font-family: var(--serif);
  font-size: clamp(1.1rem, 2.5vw, 1.5rem);
  letter-spacing: 0.12em;
  font-weight: 300;
  opacity: 0.9;
}

.intro__hint {
  font-size: 0.78rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--text-muted);
  font-weight: 300;
}

.btn-start {
  padding: 0.85rem 2.4rem;
  border: 1px solid rgba(232, 223, 208, 0.35);
  color: var(--cream);
  letter-spacing: 0.28em;
  text-transform: uppercase;
  font-size: 0.72rem;
  font-weight: 400;
  transition: border-color 0.4s ease, background 0.4s ease, color 0.4s ease;
}

.btn-start:hover,
.btn-start:focus-visible {
  border-color: var(--gold);
  background: rgba(184, 149, 108, 0.08);
  color: var(--gold);
}

/* —— Film / Scenes —— */

.film {
  position: fixed;
  inset: 0;
  z-index: 1;
  overflow: hidden;
  pointer-events: none;
}

.film.is-playing {
  pointer-events: auto;
}

.film .scene__copy {
  pointer-events: none;
}

.film .encore,
.film .encore * {
  pointer-events: auto;
}

.film .scene {
  position: absolute;
  inset: 0;
  min-height: 100%;
  visibility: hidden;
  opacity: 0;
  pointer-events: none;
}

.film .scene.is-active {
  z-index: 2;
}

.film .scene--pin {
  height: 100%;
  overflow: hidden;
}

.scene__stage {
  position: absolute;
  inset: 0;
  overflow: hidden;
  background: var(--void);
}

.scene__stage--black {
  background: var(--void);
}

.scene__stage--night {
  background: linear-gradient(180deg, #060910 0%, #0d1828 55%, #152438 100%);
}

.scene__stage--chat {
  background: linear-gradient(180deg, #07090e 0%, #0c121c 100%);
  display: grid;
  place-items: center;
}

.scene__stage--tunnel {
  background: #040507;
}

.scene__stage--rain {
  background: linear-gradient(180deg, #0a1018 0%, #121c2a 100%);
}

.scene__stage--sunrise {
  background: linear-gradient(180deg, #1a1520 0%, #3a2a28 40%, #6a4530 70%, #8a5a38 100%);
}

.scene__stage--horizon {
  background: var(--void);
}

.scene__stage--rewind {
  background: var(--void);
}

/* —— Typography / Captions —— */

.scene__copy {
  position: absolute;
  inset: 0;
  z-index: 20;
  display: grid;
  place-items: center;
  pointer-events: none;
  padding: calc(var(--letterbox) + 2rem) 1.5rem;
  text-align: center;
}

.scene__copy--phone {
  align-items: end;
  padding-bottom: calc(var(--letterbox) + 8vh);
}

.scene__copy--phone .caption {
  top: auto;
  bottom: calc(var(--letterbox) + 6vh);
  transform: translate(-50%, 0);
}

.scene__copy--truth,
.scene__copy--thanks,
.scene__copy--final {
  align-content: center;
}

.caption {
  font-family: var(--serif);
  font-weight: 300;
  font-size: clamp(1.25rem, 3.8vw, 2.6rem);
  letter-spacing: 0.06em;
  line-height: 1.35;
  color: var(--cream);
  opacity: 0;
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: min(90vw, 34rem);
  text-shadow: 0 2px 24px rgba(5, 6, 8, 0.55);
  will-change: opacity, transform, filter;
}

.caption--date {
  font-size: clamp(0.85rem, 2vw, 1.1rem);
  letter-spacing: 0.45em;
  text-transform: uppercase;
  font-family: var(--sans);
  font-weight: 300;
  color: var(--gold);
}

.caption--hero {
  font-size: clamp(2.2rem, 8vw, 5.5rem);
  letter-spacing: 0.12em;
  font-weight: 300;
}

.caption--warm {
  color: var(--gold);
}

.caption--soft {
  letter-spacing: 0.35em;
  text-transform: uppercase;
  font-size: clamp(0.8rem, 1.8vw, 1rem);
  font-family: var(--sans);
  color: var(--cream-soft);
}

.caption--harsh {
  letter-spacing: 0.35em;
  font-size: clamp(1.4rem, 4vw, 2.8rem);
  color: var(--cream);
}

.caption--name {
  font-size: clamp(2rem, 6vw, 4rem);
  letter-spacing: 0.08em;
}

.caption--goodbye {
  font-size: clamp(2.4rem, 7vw, 4.8rem);
  letter-spacing: 0.1em;
}

.caption--tiny {
  font-family: var(--sans);
  font-size: clamp(0.7rem, 1.5vw, 0.85rem);
  letter-spacing: 0.22em;
  color: var(--text-muted);
}

.caption--end {
  font-family: var(--sans);
  font-size: clamp(0.75rem, 1.6vw, 0.9rem);
  letter-spacing: 0.5em;
  text-transform: uppercase;
  color: var(--cream-soft);
}

.caption--stop {
  font-family: var(--sans);
  font-size: clamp(1.5rem, 5vw, 3rem);
  letter-spacing: 0.55em;
  font-weight: 400;
}

/* —— Encore: our song after THE END —— */

.encore {
  position: absolute;
  left: 50%;
  top: 58%;
  transform: translateX(-50%);
  width: min(92vw, 22rem);
  z-index: 30;
  pointer-events: auto;
  opacity: 0;
  text-align: center;
}

.encore__invite {
  font-family: var(--serif);
  font-weight: 300;
  font-size: clamp(0.95rem, 2.6vw, 1.15rem);
  letter-spacing: 0.06em;
  color: var(--cream);
  padding: 0.85rem 1.4rem;
  border: 1px solid rgba(184, 149, 108, 0.45);
  background: rgba(10, 12, 18, 0.35);
  transition: border-color 0.4s ease, background 0.4s ease, color 0.4s ease;
  width: 100%;
}

.encore__invite:hover,
.encore__invite:focus-visible {
  border-color: var(--gold);
  color: var(--gold);
  background: rgba(184, 149, 108, 0.08);
}

.encore__player {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.95rem 1.1rem;
  border: 1px solid rgba(232, 223, 208, 0.14);
  background:
    linear-gradient(145deg, rgba(26, 22, 28, 0.92), rgba(10, 14, 22, 0.88));
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.45);
  text-align: left;
}

.encore__play {
  flex: 0 0 auto;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  border: 1px solid rgba(184, 149, 108, 0.55);
  color: var(--gold);
  display: grid;
  place-items: center;
  background: rgba(184, 149, 108, 0.08);
  transition: background 0.35s ease, transform 0.35s ease;
}

.encore__play:hover,
.encore__play:focus-visible {
  background: rgba(184, 149, 108, 0.18);
  transform: scale(1.04);
}

.encore__play.is-playing {
  border-color: var(--cream-soft);
  color: var(--cream);
}

.encore__icon {
  width: 20px;
  height: 20px;
}

.encore__meta {
  flex: 1;
  min-width: 0;
}

.encore__label {
  font-family: var(--serif);
  font-size: 1.05rem;
  letter-spacing: 0.04em;
  color: var(--cream);
}

.encore__sub {
  margin-top: 0.15rem;
  font-size: 0.7rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.encore__bar {
  margin-top: 0.75rem;
  height: 1px;
  background: rgba(232, 223, 208, 0.15);
  overflow: hidden;
}

.encore__bar-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--gold), var(--sunset));
  transform-origin: left center;
}

.whisper {
  font-family: var(--serif);
  font-style: italic;
  font-size: clamp(1.5rem, 4vw, 2.8rem);
  letter-spacing: 0.08em;
  color: var(--gold);
  opacity: 0;
  position: absolute;
  left: 50%;
  top: 42%;
  transform: translate(-50%, -50%);
  pointer-events: none;
}

/* —— Forest (Scene 1) —— */

.forest {
  position: absolute;
  inset: 0;
  transform: scale(1.08);
  will-change: transform;
}

.forest__sky {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse at 50% 0%, #1a2840 0%, transparent 55%),
    linear-gradient(180deg, #070b12 0%, #101c30 50%, #0a121c 100%);
}

.forest__trees {
  position: absolute;
  left: -5%;
  right: -5%;
  bottom: 18%;
  height: 55%;
  opacity: 0.55;
  background-repeat: repeat-x;
  background-size: auto 100%;
}

.forest__trees--far {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='240' height='180' viewBox='0 0 240 180'%3E%3Cpolygon fill='%230b1524' points='0,180 40,40 80,180'/%3E%3Cpolygon fill='%23090f1a' points='60,180 110,20 160,180'/%3E%3Cpolygon fill='%230b1524' points='140,180 190,50 240,180'/%3E%3C/svg%3E");
  opacity: 0.35;
  bottom: 22%;
}

.forest__trees--mid {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='200' height='200' viewBox='0 0 200 200'%3E%3Cpolygon fill='%23080e18' points='0,200 50,30 100,200'/%3E%3Cpolygon fill='%230a121e' points='70,200 130,10 190,200'/%3E%3C/svg%3E");
  opacity: 0.7;
}

.forest__fog {
  position: absolute;
  left: -10%;
  right: -10%;
  height: 40%;
  background: linear-gradient(180deg, transparent, rgba(160, 175, 195, 0.08), transparent);
  filter: blur(20px);
}

.forest__fog--back {
  bottom: 30%;
  opacity: 0.5;
}

.forest__fog--front {
  bottom: 8%;
  opacity: 0.35;
}

.forest__ground {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 28%;
  background: linear-gradient(180deg, transparent, #060a10 40%, #040608 100%);
}

.path {
  position: absolute;
  bottom: 12%;
  height: 2px;
  background: linear-gradient(90deg, transparent, rgba(184, 149, 108, 0.35), transparent);
  opacity: 0;
  transform-origin: center;
}

.path--left {
  left: 8%;
  width: 32%;
  transform: rotate(-8deg);
}

.path--right {
  right: 8%;
  width: 32%;
  transform: rotate(8deg);
}

.path--merge {
  left: 50%;
  width: 0;
  transform: translateX(-50%);
  background: linear-gradient(90deg, transparent, rgba(196, 107, 58, 0.45), transparent);
}

.leaves {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
}

.leaf {
  position: absolute;
  width: 6px;
  height: 10px;
  background: rgba(184, 149, 108, 0.35);
  border-radius: 40% 60% 40% 60%;
  opacity: 0;
}

/* —— Characters —— */

.characters {
  position: absolute;
  inset: 0;
  z-index: 10;
  pointer-events: none;
}

.character {
  position: absolute;
  bottom: 14%;
  width: clamp(100px, 18vw, 200px);
  display: flex;
  justify-content: center;
  will-change: transform, opacity;
}

.character--masha {
  left: 18%;
}

.character--bear {
  right: 18%;
  width: clamp(120px, 22vw, 260px);
}

.character__img {
  width: 100%;
  height: auto;
  object-fit: contain;
  filter: drop-shadow(0 8px 20px rgba(0, 0, 0, 0.45));
  opacity: 0;
  position: relative;
  z-index: 2;
  /* Black-backdrop character renders composite cleanly on dark scenes */
  mix-blend-mode: screen;
}

.character__img.is-loaded {
  opacity: 1;
}

.character__img.is-loaded + .character__silhouette {
  opacity: 0;
}

.character__silhouette {
  position: absolute;
  inset: 0;
  z-index: 1;
  opacity: 0.85;
}

.character__silhouette--masha {
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 80 120'%3E%3Cellipse cx='40' cy='22' rx='14' ry='16' fill='%23c9bba8'/%3E%3Cpath d='M28 38 Q40 34 52 38 L54 78 Q40 90 26 78 Z' fill='%23a89078'/%3E%3Cpath d='M30 78 L26 112 L36 112 L40 82 L44 112 L54 112 L50 78 Z' fill='%238a7060'/%3E%3C/svg%3E") center bottom / contain no-repeat;
}

.character__silhouette--bear {
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 130'%3E%3Cellipse cx='30' cy='28' rx='10' ry='12' fill='%236a5548'/%3E%3Cellipse cx='70' cy='28' rx='10' ry='12' fill='%236a5548'/%3E%3Cellipse cx='50' cy='40' rx='28' ry='26' fill='%237a6558'/%3E%3Cellipse cx='50' cy='42' rx='14' ry='12' fill='%239a8070'/%3E%3Cpath d='M28 62 Q50 55 72 62 L78 105 Q50 118 22 105 Z' fill='%236a5548'/%3E%3C/svg%3E") center bottom / contain no-repeat;
}

.characters--meeting .character--masha {
  left: 12%;
  transform: translateX(-40px);
}

.characters--meeting .character--bear {
  right: 12%;
  transform: translateX(40px);
}

.characters--together {
  opacity: 0;
}

.characters--together .character--masha {
  left: 38%;
}

.characters--together .character--bear {
  left: 52%;
  right: auto;
}

.characters--montage .character--masha {
  left: 36%;
  bottom: 18%;
}

.characters--montage .character--bear {
  left: 50%;
  right: auto;
  bottom: 16%;
}

.characters--cycle .character--masha,
.characters--facing .character--masha {
  left: 28%;
}

.characters--cycle .character--bear,
.characters--facing .character--bear {
  right: 28%;
}

.characters--side .character--masha {
  left: 40%;
}

.characters--side .character--bear {
  left: 52%;
  right: auto;
}

.characters--farewell .character--masha {
  left: 44%;
  bottom: 22%;
  width: clamp(48px, 8vw, 80px);
}

.characters--farewell .character--bear {
  left: 52%;
  right: auto;
  bottom: 20%;
  width: clamp(60px, 10vw, 100px);
}

.character--closeup {
  position: relative;
  width: clamp(120px, 28vw, 280px);
  bottom: auto;
  left: auto;
  right: auto;
}

.warm-glow {
  position: absolute;
  inset: 0;
  opacity: 0;
  background:
    radial-gradient(ellipse at 50% 70%, rgba(196, 107, 58, 0.28), transparent 55%),
    linear-gradient(180deg, #0a1018 0%, #2a1e18 100%);
  pointer-events: none;
}

.weight {
  position: absolute;
  inset: 0;
  background: rgba(5, 6, 8, 0);
  pointer-events: none;
  z-index: 15;
}

/* —— Montage —— */

.montage {
  position: absolute;
  inset: 0;
  opacity: 0.4;
}

.montage__frame {
  position: absolute;
  inset: 0;
  opacity: 0;
  background:
    radial-gradient(ellipse at 40% 60%, rgba(184, 149, 108, 0.12), transparent 50%),
    linear-gradient(180deg, #0c1420, #151010);
}

.montage__frame[data-pose="stars"] {
  background:
    radial-gradient(1px 1px at 20% 30%, rgba(232, 223, 208, 0.7), transparent),
    radial-gradient(1px 1px at 60% 20%, rgba(232, 223, 208, 0.5), transparent),
    radial-gradient(1.5px 1.5px at 80% 40%, rgba(232, 223, 208, 0.6), transparent),
    linear-gradient(180deg, #050810, #101828);
}

.montage__frame[data-pose="rain"] {
  background: linear-gradient(180deg, #0a121c, #162030);
}

.rain-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 12;
  opacity: 0;
}

/* —— Phone —— */

.phone {
  position: absolute;
  left: 50%;
  top: 42%;
  transform: translate(-50%, -50%) scale(0.92);
  width: min(280px, 72vw);
  z-index: 8;
  opacity: 0;
}

.phone__bezel {
  background: #12151c;
  border-radius: 28px;
  padding: 10px;
  border: 1px solid rgba(232, 223, 208, 0.12);
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.55);
}

.phone__screen {
  background: linear-gradient(180deg, #0e1624, #162030);
  border-radius: 20px;
  min-height: 420px;
  padding: 1.25rem 1rem 2rem;
  position: relative;
  overflow: hidden;
}

.phone__status {
  display: flex;
  justify-content: space-between;
  font-size: 0.7rem;
  letter-spacing: 0.08em;
  color: var(--cream-soft);
  opacity: 0.7;
}

.phone__call {
  margin-top: 4.5rem;
  text-align: center;
}

.phone__avatar {
  width: 72px;
  height: 72px;
  margin: 0 auto 1.25rem;
  border-radius: 50%;
  background:
    radial-gradient(circle at 35% 30%, rgba(232, 223, 208, 0.25), transparent 50%),
    linear-gradient(145deg, #3a2a24, #1a1518);
  border: 1px solid rgba(184, 149, 108, 0.3);
}

.phone__name {
  font-family: var(--serif);
  font-size: 1.5rem;
  letter-spacing: 0.06em;
  margin-bottom: 0.35rem;
}

.phone__timer {
  font-size: 0.85rem;
  letter-spacing: 0.2em;
  color: var(--gold);
  font-variant-numeric: tabular-nums;
}

.phone__waves {
  display: flex;
  justify-content: center;
  gap: 5px;
  margin-top: 2rem;
  height: 28px;
  align-items: flex-end;
}

.phone__waves span {
  width: 3px;
  height: 8px;
  background: var(--gold-soft);
  border-radius: 2px;
}

.phone__glow {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 140%;
  height: 140%;
  transform: translate(-50%, -50%);
  background: radial-gradient(circle, rgba(100, 140, 200, 0.18), transparent 60%);
  pointer-events: none;
  z-index: -1;
}

.dawn {
  position: absolute;
  inset: 0;
  opacity: 0;
  background: linear-gradient(180deg, #1a2030 0%, #4a3a30 45%, #c46b3a55 100%);
  pointer-events: none;
  z-index: 5;
}

/* —— Chat —— */

.chat {
  width: min(360px, 88vw);
  background: rgba(10, 14, 22, 0.92);
  border: 1px solid rgba(232, 223, 208, 0.1);
  border-radius: 18px;
  overflow: hidden;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.45);
}

.chat__header {
  padding: 0.9rem 1.1rem;
  border-bottom: 1px solid rgba(232, 223, 208, 0.08);
  text-align: center;
}

.chat__title {
  font-family: "Grand Hotel", "Segoe Script", "Brush Script MT", cursive;
  font-size: 1.65rem;
  font-weight: 400;
  letter-spacing: 0.02em;
  color: var(--cream);
  line-height: 1;
}

.chat__thread {
  padding: 1.25rem 1rem 1.5rem;
  min-height: 320px;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.chat__bubble {
  max-width: 78%;
  padding: 0.65rem 0.95rem;
  border-radius: 16px;
  font-family: var(--serif);
  font-size: 1.05rem;
  letter-spacing: 0.04em;
  opacity: 0;
  transform: translateY(12px);
}

.chat__bubble--in {
  align-self: flex-start;
  background: rgba(26, 36, 52, 0.95);
  color: var(--cream);
  border-bottom-left-radius: 4px;
}

.chat__bubble--out {
  align-self: flex-end;
  background: rgba(58, 42, 36, 0.9);
  color: var(--gold);
  border-bottom-right-radius: 4px;
}

.chat__typing {
  align-self: flex-start;
  display: flex;
  gap: 4px;
  padding: 0.7rem 0.9rem;
  background: rgba(26, 36, 52, 0.8);
  border-radius: 14px;
  opacity: 0;
}

.chat__typing span {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--cream-soft);
  opacity: 0.5;
}

/* —— Memory tunnel —— */

.memory-tunnel {
  position: absolute;
  inset: 0;
  perspective: 900px;
  transform-style: preserve-3d;
}

.memory-card {
  position: absolute;
  left: 50%;
  top: 50%;
  width: clamp(140px, 28vw, 240px);
  aspect-ratio: 3 / 4;
  transform: translate(-50%, -50%);
  will-change: transform, opacity, filter;
  opacity: 0;
}

.memory-card__frame {
  width: 100%;
  height: 100%;
  position: relative;
  background: #1a1814;
  overflow: hidden;
}

.memory-card__img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  background: linear-gradient(145deg, #2a2430, #1a1820 50%, #3a2a20);
}

.memory-card__caption {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 0.5rem 0.65rem;
  font-size: 0.65rem;
  letter-spacing: 0.08em;
  color: var(--cream-soft);
  background: linear-gradient(transparent, rgba(5, 6, 8, 0.75));
  font-family: var(--sans);
}

.memory-card--polaroid .memory-card__frame {
  background: #e8dfd0;
  padding: 8px;
}

.memory-card__caption {
  display: none;
}

.memory-card--film .memory-card__frame {
  border: 10px solid #0a0a0a;
  border-image: none;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.05);
}

.memory-card--film .memory-card__frame::before,
.memory-card--film .memory-card__frame::after {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  width: 8px;
  background: repeating-linear-gradient(
    #0a0a0a 0 6px,
    #1a1a1a 6px 10px
  );
  z-index: 2;
}

.memory-card--film .memory-card__frame::before { left: -10px; }
.memory-card--film .memory-card__frame::after { right: -10px; }

.memory-card--instant .memory-card__frame {
  border: 3px solid #d8cfc0;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
}

.memory-card--contact .memory-card__frame {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3px;
  background: #0a0a0a;
  padding: 3px;
}

.memory-card--contact .memory-card__img {
  grid-column: 1 / -1;
  grid-row: 1 / -1;
  opacity: 0.85;
}

.memory-card--vintage .memory-card__frame {
  border: 1px solid rgba(184, 149, 108, 0.35);
  filter: sepia(0.25) contrast(1.05);
}

.film-strip {
  position: absolute;
  left: -10%;
  right: -10%;
  top: 50%;
  height: 120px;
  transform: translateY(-50%);
  background: repeating-linear-gradient(
    90deg,
    #0a0a0a 0 24px,
    #121212 24px 28px,
    #1a1510 28px 100px,
    #121212 100px 104px
  );
  opacity: 0;
  pointer-events: none;
}

/* —— Rewind —— */

.rewind {
  position: absolute;
  inset: 0;
}

.rewind__faces {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 2rem;
  transform: scale(1);
  will-change: transform, filter;
}

.rewind__strip {
  position: absolute;
  inset: 0;
  opacity: 0;
  background: repeating-linear-gradient(
    0deg,
    transparent 0 8px,
    rgba(232, 223, 208, 0.03) 8px 9px
  );
  pointer-events: none;
}

.light-leak {
  position: absolute;
  inset: -20%;
  opacity: 0;
  background:
    radial-gradient(ellipse at 20% 30%, rgba(196, 107, 58, 0.35), transparent 40%),
    radial-gradient(ellipse at 80% 70%, rgba(184, 149, 108, 0.25), transparent 45%);
  mix-blend-mode: screen;
  pointer-events: none;
}

/* —— Sunrise / Horizon —— */

.sunrise {
  position: absolute;
  inset: 0;
  opacity: 0;
  background:
    radial-gradient(ellipse at 50% 75%, rgba(196, 107, 58, 0.45), transparent 50%),
    linear-gradient(180deg, #1a2035 0%, #5a3a30 55%, #c46b3a66 100%);
}

.horizon {
  position: absolute;
  inset: 0;
  transform-origin: 50% 70%;
  will-change: transform;
}

.horizon__sky {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse at 50% 62%, rgba(196, 107, 58, 0.5) 0%, transparent 35%),
    linear-gradient(180deg, #1c2438 0%, #4a3a38 40%, #8a5a40 70%, #c47a48 100%);
}

.horizon__sun {
  position: absolute;
  left: 50%;
  top: 58%;
  width: clamp(60px, 12vw, 120px);
  height: clamp(60px, 12vw, 120px);
  transform: translate(-50%, -50%);
  border-radius: 50%;
  background: radial-gradient(circle, #f0d0a0, #c46b3a 60%, transparent 70%);
  filter: blur(2px);
  opacity: 0.85;
}

.horizon__land {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 32%;
  background: linear-gradient(180deg, #1a2018 0%, #0a100c 100%);
}

.horizon__trees {
  position: absolute;
  left: -5%;
  right: -5%;
  bottom: 28%;
  height: 22%;
  opacity: 0.65;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='100' viewBox='0 0 160 100'%3E%3Cpolygon fill='%23080e10' points='0,100 30,20 60,100'/%3E%3Cpolygon fill='%230a1214' points='50,100 90,5 130,100'/%3E%3Cpolygon fill='%23080e10' points='110,100 140,30 160,100'/%3E%3C/svg%3E");
  background-repeat: repeat-x;
  background-size: auto 100%;
}

/* —— Reduced motion —— */

@media (prefers-reduced-motion: reduce) {
  .grain {
    animation: none !important;
    opacity: 0.04;
  }

  .phone__waves span,
  .chat__typing span {
    animation: none !important;
  }
}
