:root {
  color-scheme: dark;
  --bg: #050611;
  --bg-soft: #0a0e1c;
  --panel: rgba(15, 20, 36, 0.74);
  --panel-solid: #111626;
  --panel-quiet: rgba(255, 255, 255, 0.045);
  --line: rgba(255, 255, 255, 0.12);
  --line-strong: rgba(255, 255, 255, 0.2);
  --text: #f6f0e6;
  --muted: #b8b2aa;
  --dim: #7e8794;
  --gold: #f2c879;
  --blue: #78aaff;
  --rose: #ff8b9a;
  --mint: #85e2c9;
  --shadow: 0 24px 90px rgba(0, 0, 0, 0.45);
  --radius: 8px;
  --max: 1160px;
  --font: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --serif: ui-serif, Georgia, Cambria, "Times New Roman", Times, serif;
}

* {
  box-sizing: border-box;
}

html {
  background: var(--bg);
  scroll-behavior: smooth;
}

body {
  min-width: 320px;
  margin: 0;
  overflow-x: hidden;
  background:
    radial-gradient(circle at 18% 10%, rgba(120, 170, 255, 0.16), transparent 34rem),
    radial-gradient(circle at 90% 4%, rgba(255, 139, 154, 0.11), transparent 28rem),
    linear-gradient(180deg, #050611 0%, #07101c 44%, #050611 100%);
  color: var(--text);
  font-family: var(--font);
}

body::selection {
  background: rgba(242, 200, 121, 0.35);
}

body.intro-pending {
  overflow: hidden;
}

body.intro-pending main,
body.intro-pending .journey-nav {
  display: none;
}

button,
audio,
video {
  font: inherit;
}

button {
  -webkit-tap-highlight-color: transparent;
}

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

.ambient::after {
  position: absolute;
  inset: 0;
  content: "";
  background:
    linear-gradient(rgba(255, 255, 255, 0.022) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.018) 1px, transparent 1px);
  background-size: 92px 92px;
  mask-image: linear-gradient(to bottom, black 0%, transparent 78%);
}

.moon {
  position: absolute;
  top: clamp(28px, 8vw, 94px);
  right: clamp(24px, 10vw, 150px);
  width: clamp(76px, 12vw, 156px);
  aspect-ratio: 1;
  border: 1px solid rgba(242, 200, 121, 0.28);
  border-radius: 50%;
  background:
    radial-gradient(circle at 36% 32%, rgba(255, 255, 255, 0.9), rgba(242, 200, 121, 0.58) 21%, rgba(242, 200, 121, 0.08) 58%, transparent 70%);
  box-shadow: 0 0 88px rgba(242, 200, 121, 0.18);
  opacity: 0.9;
}

.aurora {
  position: absolute;
  width: 42rem;
  height: 42rem;
  border-radius: 50%;
  filter: blur(70px);
  opacity: 0.38;
  transform: translate3d(0, 0, 0);
}

.aurora-one {
  top: -16rem;
  left: -15rem;
  background: rgba(120, 170, 255, 0.33);
}

.aurora-two {
  right: -16rem;
  bottom: 6rem;
  background: rgba(133, 226, 201, 0.18);
}

.starfield {
  position: absolute;
  inset: 0;
  opacity: 0;
  transition: opacity 900ms ease;
}

.starfield::before,
.starfield::after {
  position: absolute;
  inset: 0;
  content: "";
  background-image:
    radial-gradient(circle, rgba(255, 255, 255, 0.84) 0 1px, transparent 1.5px),
    radial-gradient(circle, rgba(242, 200, 121, 0.72) 0 1px, transparent 1.5px),
    radial-gradient(circle, rgba(133, 226, 201, 0.68) 0 1px, transparent 1.5px);
  background-position: 8% 18%, 62% 28%, 82% 72%;
  background-size: 240px 240px, 310px 310px, 390px 390px;
  animation: shimmer 8s ease-in-out infinite alternate;
}

body.build-open .starfield {
  opacity: 0.74;
}

main {
  position: relative;
  isolation: isolate;
}

.hero {
  min-height: 100svh;
  display: grid;
  place-items: center;
  padding: 56px 22px;
}

.hero-inner {
  width: min(920px, 100%);
  text-align: center;
}

.eyebrow {
  margin: 0 0 18px;
  color: var(--gold);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  text-wrap: pretty;
}

h1 {
  max-width: 12ch;
  margin: 0 auto;
  font-family: var(--serif);
  font-size: clamp(4.1rem, 16vw, 11rem);
  font-weight: 520;
  line-height: 0.86;
  letter-spacing: 0;
}

.subtitle {
  margin: 32px auto 0;
  color: var(--text);
  font-size: clamp(1.22rem, 3.6vw, 2.1rem);
  line-height: 1.18;
}

.quiet-line {
  margin: 12px auto 0;
  color: var(--muted);
  font-size: clamp(0.98rem, 2.5vw, 1.15rem);
}

.hero-after-intro {
  display: none;
  margin: 18px auto 0;
  color: rgba(242, 200, 121, 0.82);
  font-size: 0.92rem;
  font-weight: 760;
}

body.intro-complete .hero-after-intro {
  display: block;
}

.primary-button {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 54px;
  margin-top: 34px;
  padding: 0 24px;
  overflow: hidden;
  border: 1px solid rgba(242, 200, 121, 0.44);
  border-radius: 999px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.16), rgba(255, 255, 255, 0.04)),
    rgba(242, 200, 121, 0.1);
  box-shadow: 0 16px 52px rgba(242, 200, 121, 0.14), inset 0 1px 0 rgba(255, 255, 255, 0.16);
  color: var(--text);
  cursor: pointer;
  font-size: 0.95rem;
  font-weight: 760;
  letter-spacing: 0;
  transition: transform 180ms ease, border-color 180ms ease, background 180ms ease;
}

.primary-button::before {
  position: absolute;
  inset: 0;
  content: "";
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.28), transparent);
  transform: translateX(-120%);
  transition: transform 700ms ease;
}

.primary-button:hover {
  border-color: rgba(242, 200, 121, 0.72);
  transform: translateY(-2px);
}

.primary-button:hover::before {
  transform: translateX(120%);
}

.primary-button:focus-visible {
  outline: 3px solid rgba(120, 170, 255, 0.58);
  outline-offset: 4px;
}

.page-shell {
  width: min(var(--max), calc(100% - 32px));
  margin: 0 auto;
  padding: 0 0 70px;
}

.page-shell[hidden] {
  display: none;
}

.section {
  padding: clamp(92px, 13vw, 158px) 0;
}

.intro-section {
  min-height: 100svh;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(240px, 360px);
  gap: 28px;
  align-items: end;
  align-content: center;
  padding-top: clamp(72px, 10vw, 126px);
  padding-bottom: clamp(92px, 12vw, 148px);
}

.intro-copy {
  max-width: 760px;
}

.intro-copy p {
  margin: 0;
  color: var(--text);
  font-family: var(--serif);
  font-size: clamp(1.35rem, 3.2vw, 2.55rem);
  line-height: 1.12;
}

.intro-copy p + p {
  margin-top: 22px;
  color: rgba(246, 240, 230, 0.74);
}

.status-card {
  display: flex;
  gap: 12px;
  align-items: center;
  min-height: 96px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.045);
  color: var(--muted);
  line-height: 1.45;
  box-shadow: var(--shadow);
}

.status-dot {
  width: 11px;
  height: 11px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: var(--mint);
  box-shadow: 0 0 24px rgba(133, 226, 201, 0.62);
}

.chapter-jump {
  display: flex;
  justify-content: center;
  margin-top: clamp(44px, 7vw, 76px);
}

.intro-jump,
.split-section .chapter-jump {
  grid-column: 1 / -1;
}

.letter-section .chapter-jump {
  width: min(850px, 100%);
}

.chapter-jump-button {
  position: relative;
  display: inline-flex;
  gap: 10px;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  padding: 0 17px;
  overflow: hidden;
  border: 1px solid rgba(246, 240, 230, 0.12);
  border-radius: 999px;
  appearance: none;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.085), rgba(255, 255, 255, 0.025)),
    rgba(10, 14, 24, 0.62);
  box-shadow: 0 14px 44px rgba(0, 0, 0, 0.24), inset 0 1px 0 rgba(255, 255, 255, 0.08);
  color: rgba(246, 240, 230, 0.82);
  cursor: pointer;
  font: inherit;
  font-size: 0.86rem;
  font-weight: 820;
  letter-spacing: 0.01em;
  transition: border-color 180ms ease, color 180ms ease, transform 180ms ease, background 180ms ease;
  backdrop-filter: blur(16px);
}

.chapter-jump-button::before {
  position: absolute;
  inset: 0;
  content: "";
  background: radial-gradient(circle at 50% 0%, rgba(242, 200, 121, 0.18), transparent 58%);
  opacity: 0;
  transition: opacity 180ms ease;
}

.chapter-jump-button span {
  position: relative;
  z-index: 1;
}

.chapter-jump-button span[aria-hidden="true"] {
  color: rgba(242, 200, 121, 0.82);
  font-size: 1rem;
  transform: translateY(-1px);
}

.chapter-jump-button:hover,
.chapter-jump-button:focus-visible {
  border-color: rgba(242, 200, 121, 0.28);
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.11), rgba(255, 255, 255, 0.035)),
    rgba(16, 20, 32, 0.72);
  color: var(--text);
  outline: none;
  transform: translateY(-2px);
}

.chapter-jump-button:hover::before,
.chapter-jump-button:focus-visible::before {
  opacity: 1;
}

.rare-tooltip-wrap {
  position: relative;
  display: inline-block;
}

.inline-easter {
  display: inline-block;
  padding: 0 0.12em 0 0;
  border: 0;
  appearance: none;
  background: transparent;
  color: inherit;
  cursor: pointer;
  font: inherit;
  font-style: italic;
  line-height: inherit;
  opacity: 0.92;
  overflow: visible;
  text-decoration: none;
  vertical-align: baseline;
}

.rare-tooltip {
  position: absolute;
  left: 50%;
  bottom: calc(100% + 10px);
  z-index: 8;
  width: max-content;
  padding: 7px 10px;
  border: 1px solid rgba(242, 200, 121, 0.18);
  border-radius: 999px;
  background: rgba(9, 12, 22, 0.82);
  box-shadow: 0 14px 42px rgba(0, 0, 0, 0.38), inset 0 1px 0 rgba(255, 255, 255, 0.08);
  color: rgba(246, 240, 230, 0.9);
  font-family: var(--font);
  font-size: 0.78rem;
  font-weight: 800;
  line-height: 1;
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, 5px);
  transition: opacity 180ms ease, transform 180ms ease;
  white-space: nowrap;
  backdrop-filter: blur(14px);
}

.rare-tooltip::after {
  position: absolute;
  left: 50%;
  bottom: -5px;
  width: 9px;
  height: 9px;
  content: "";
  border-right: 1px solid rgba(242, 200, 121, 0.14);
  border-bottom: 1px solid rgba(242, 200, 121, 0.14);
  background: rgba(9, 12, 22, 0.82);
  transform: translateX(-50%) rotate(45deg);
}

.rare-tooltip-wrap:hover .rare-tooltip,
.rare-tooltip-wrap:focus-within .rare-tooltip,
.rare-tooltip-wrap.tooltip-open .rare-tooltip {
  opacity: 1;
  transform: translate(-50%, 0);
}

.sparkles-word {
  color: var(--text);
  cursor: default;
  text-decoration: underline;
  text-decoration-color: rgba(242, 200, 121, 0.28);
  text-underline-offset: 4px;
}

.section-heading {
  max-width: 720px;
  margin-bottom: 28px;
}

.section-heading.compact {
  margin-bottom: 0;
}

.section-heading h2,
.letter-card h2,
.final-card h2 {
  margin: 0;
  font-family: var(--serif);
  font-size: clamp(2.25rem, 8vw, 5.8rem);
  font-weight: 520;
  line-height: 0.94;
  letter-spacing: 0;
}

.section-heading p:not(.eyebrow) {
  max-width: 560px;
  margin: 18px 0 0;
  color: var(--muted);
  font-size: clamp(1rem, 2vw, 1.2rem);
  line-height: 1.55;
}

.messages-grid {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 16px;
}

.message-card,
.audio-card,
.timeline-card,
.trait-card,
.bug-card,
.letter-card,
.final-card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.075), rgba(255, 255, 255, 0.028)),
    var(--panel);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}

.message-card {
  grid-column: span 6;
  overflow: hidden;
}

.message-card.wide {
  grid-column: span 6;
}

.message-card.portrait {
  grid-column: span 4;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding-top: 18px;
}

.audio-card {
  grid-column: span 4;
  padding: 20px;
}

.media-frame {
  position: relative;
  overflow: hidden;
  background: #04050a;
}

.message-card.wide .media-frame {
  aspect-ratio: 16 / 9;
}

.phone-frame {
  width: min(72%, 270px);
  aspect-ratio: 9 / 16;
  padding: 8px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 28px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.12), rgba(255, 255, 255, 0.03));
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.6), 0 18px 54px rgba(0, 0, 0, 0.42);
}

.phone-frame .media-frame {
  width: 100%;
  height: 100%;
  border-radius: 21px;
}

video,
img {
  display: block;
  width: 100%;
  height: 100%;
}

video {
  background: #03040a;
  object-fit: contain;
}

.media-frame img {
  object-fit: cover;
}

.message-card.wide video {
  object-fit: cover;
}

.message-body,
.audio-body {
  padding: 18px;
}

.message-card.portrait .message-body {
  width: 100%;
}

.message-title,
.timeline-card h3,
.trait-card,
.bug-card {
  margin: 0;
  color: var(--text);
  font-size: 1rem;
  font-weight: 760;
  line-height: 1.3;
}

.message-meta,
.media-caption,
.audio-card p {
  margin: 7px 0 0;
  color: var(--dim);
  font-size: 0.9rem;
  line-height: 1.45;
}

audio {
  width: 100%;
  margin-top: 18px;
  filter: invert(0.92) hue-rotate(178deg) saturate(0.76);
}

.timeline {
  position: relative;
  display: grid;
  gap: 22px;
}

.timeline::before {
  position: absolute;
  top: 18px;
  bottom: 18px;
  left: 18px;
  width: 1px;
  content: "";
  background: linear-gradient(to bottom, transparent, rgba(242, 200, 121, 0.4), rgba(120, 170, 255, 0.24), transparent);
}

.timeline-card {
  position: relative;
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
  gap: 24px;
  padding: 22px;
  margin-left: 38px;
}

.timeline-card::before {
  position: absolute;
  top: 24px;
  left: -29px;
  width: 12px;
  height: 12px;
  content: "";
  border: 1px solid rgba(242, 200, 121, 0.58);
  border-radius: 50%;
  background: var(--bg);
  box-shadow: 0 0 24px rgba(242, 200, 121, 0.22);
}

.chapter-copy p {
  margin: 12px 0 0;
  color: var(--muted);
  line-height: 1.58;
}

.chapter-note {
  display: inline-flex;
  margin-top: 16px;
  padding: 8px 10px;
  border: 1px solid rgba(133, 226, 201, 0.2);
  border-radius: var(--radius);
  background: rgba(133, 226, 201, 0.07);
  color: rgba(226, 250, 244, 0.82);
  font-size: 0.84rem;
  line-height: 1.4;
}

.memory-visual {
  min-height: 170px;
  display: grid;
  align-content: end;
  gap: 10px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background:
    radial-gradient(circle at 18% 24%, rgba(242, 200, 121, 0.22), transparent 10rem),
    radial-gradient(circle at 88% 78%, rgba(120, 170, 255, 0.18), transparent 11rem),
    rgba(255, 255, 255, 0.035);
}

.music-bars {
  display: flex;
  gap: 5px;
  align-items: end;
  height: 42px;
}

.music-bars span {
  width: 7px;
  border-radius: 999px;
  background: linear-gradient(var(--gold), var(--rose));
  opacity: 0.84;
}

.music-bars span:nth-child(1) { height: 28%; }
.music-bars span:nth-child(2) { height: 62%; }
.music-bars span:nth-child(3) { height: 44%; }
.music-bars span:nth-child(4) { height: 80%; }
.music-bars span:nth-child(5) { height: 52%; }

.memory-visual p {
  margin: 0;
  color: rgba(246, 240, 230, 0.82);
  font-family: var(--serif);
  font-size: 1.35rem;
  line-height: 1.18;
}

.chapter-media {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 10px;
  align-content: start;
}

.media-tile {
  grid-column: span 3;
  min-width: 0;
}

.media-tile.wide {
  grid-column: span 6;
}

.media-tile.portrait {
  grid-column: span 2;
}

.media-tile.small {
  grid-column: span 2;
}

.media-tile figure {
  margin: 0;
}

.media-tile .media-frame {
  aspect-ratio: 4 / 3;
  border: 1px solid rgba(255, 255, 255, 0.11);
  border-radius: var(--radius);
}

.media-tile.wide .media-frame {
  aspect-ratio: 16 / 9;
}

.media-tile.portrait .media-frame {
  aspect-ratio: 3 / 4;
}

.media-tile video {
  object-fit: contain;
}

.media-tile img {
  object-fit: cover;
}

.media-caption {
  min-height: 1.25rem;
  padding: 7px 2px 0;
}

.text-only-memory {
  display: grid;
  place-items: center;
  min-height: 190px;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0.025)),
    rgba(255, 255, 255, 0.035);
  color: rgba(246, 240, 230, 0.76);
  font-family: var(--serif);
  font-size: 1.35rem;
  line-height: 1.3;
}

.split-section {
  display: grid;
  grid-template-columns: 0.92fr 1.4fr;
  gap: 28px;
  align-items: start;
}

.trait-grid,
.bug-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.trait-card,
.bug-card {
  min-height: 78px;
  display: flex;
  align-items: center;
  padding: 18px;
  border-color: var(--line);
  background:
    linear-gradient(135deg, rgba(120, 170, 255, 0.11), rgba(255, 255, 255, 0.026)),
    var(--panel);
}

.bug-card {
  background:
    linear-gradient(135deg, rgba(255, 139, 154, 0.105), rgba(242, 200, 121, 0.045)),
    var(--panel);
}

.forecast-section {
  padding-top: clamp(44px, 8vw, 86px);
}

.forecast-card {
  display: grid;
  grid-template-columns: minmax(260px, 0.8fr) minmax(0, 1.2fr);
  gap: clamp(18px, 4vw, 34px);
  align-items: center;
  padding: clamp(18px, 4vw, 30px);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background:
    radial-gradient(circle at 18% 0%, rgba(242, 200, 121, 0.1), transparent 16rem),
    linear-gradient(180deg, rgba(255, 255, 255, 0.07), rgba(255, 255, 255, 0.03)),
    var(--panel);
  box-shadow: var(--shadow);
}

.forecast-copy h2 {
  margin: 0;
  font-family: var(--serif);
  font-size: clamp(2.3rem, 7vw, 5.4rem);
  font-weight: 520;
  line-height: 0.94;
}

.forecast-copy p:not(.eyebrow) {
  margin: 18px 0 0;
  color: rgba(246, 240, 230, 0.82);
  font-size: clamp(1.1rem, 2vw, 1.35rem);
  line-height: 1.45;
}

.forecast-copy span {
  display: inline-flex;
  margin-top: 18px;
  padding: 9px 11px;
  border: 1px solid rgba(133, 226, 201, 0.18);
  border-radius: var(--radius);
  background: rgba(133, 226, 201, 0.07);
  color: rgba(226, 250, 244, 0.84);
  font-size: 0.9rem;
  line-height: 1.42;
}

.forecast-preview {
  min-height: 320px;
}

.letter-section {
  display: grid;
  place-items: center;
}

.letter-card {
  width: min(850px, 100%);
  padding: clamp(26px, 7vw, 64px);
  background:
    radial-gradient(circle at 18% 0%, rgba(242, 200, 121, 0.12), transparent 18rem),
    rgba(12, 16, 27, 0.82);
}

.letter-copy {
  margin-top: 30px;
  color: rgba(246, 240, 230, 0.86);
  font-family: var(--serif);
  font-size: clamp(1.25rem, 2.7vw, 1.78rem);
  line-height: 1.42;
}

.letter-copy p {
  margin: 0;
}

.letter-copy p + p {
  margin-top: 22px;
}

.final-section {
  min-height: 54vh;
  display: grid;
  place-items: center;
  padding-bottom: 28px;
}

.final-card {
  width: min(760px, 100%);
  padding: clamp(26px, 6vw, 58px);
  text-align: center;
}

.merge-button {
  margin-top: 28px;
}

.merge-result {
  min-height: 3.2em;
  margin: 24px 0 0;
  color: var(--text);
  font-family: var(--serif);
  font-size: clamp(1.45rem, 4vw, 2.4rem);
  line-height: 1.18;
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 360ms ease, transform 360ms ease;
}

.merge-result.visible {
  opacity: 1;
  transform: translateY(0);
}

.confetti-piece {
  position: fixed;
  top: -16px;
  z-index: 20;
  width: 7px;
  height: 12px;
  border-radius: 2px;
  pointer-events: none;
  animation: confetti-fall var(--fall-duration, 2600ms) cubic-bezier(0.17, 0.67, 0.24, 1) forwards;
}

.spark-pop {
  position: fixed;
  z-index: 21;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--gold);
  pointer-events: none;
  box-shadow: 0 0 18px currentColor;
  animation: spark-pop 900ms ease-out forwards;
}

.reveal {
  opacity: 0;
  transform: translateY(22px);
  transition: opacity 760ms ease, transform 760ms ease;
}

.reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}

@keyframes shimmer {
  from {
    transform: translate3d(0, 0, 0);
    opacity: 0.52;
  }
  to {
    transform: translate3d(18px, -14px, 0);
    opacity: 0.94;
  }
}

@keyframes confetti-fall {
  0% {
    transform: translate3d(0, -20px, 0) rotate(0deg);
    opacity: 1;
  }
  100% {
    transform: translate3d(var(--drift, 0), 110vh, 0) rotate(var(--spin, 420deg));
    opacity: 0;
  }
}

@keyframes spark-pop {
  0% {
    transform: translate(-50%, -50%) scale(0.6);
    opacity: 0;
  }
  18% {
    opacity: 1;
  }
  100% {
    transform: translate(calc(-50% + var(--x)), calc(-50% + var(--y))) scale(0);
    opacity: 0;
  }
}

@media (max-width: 920px) {
  .intro-section,
  .timeline-card,
  .split-section,
  .intro-gate-inner,
  .forecast-card {
    grid-template-columns: 1fr;
  }

  .section-heading.compact {
    margin-bottom: 18px;
  }

  .message-card,
  .message-card.wide,
  .message-card.portrait,
  .audio-card {
    grid-column: span 12;
  }

  .message-card.portrait {
    align-items: stretch;
  }

  .phone-frame {
    width: min(76%, 310px);
    margin: 0 auto;
  }

  .timeline-card {
    gap: 18px;
  }

  .chapter-media {
    grid-template-columns: repeat(4, 1fr);
  }

  .media-tile,
  .media-tile.wide {
    grid-column: span 4;
  }

  .media-tile.portrait,
  .media-tile.small {
    grid-column: span 2;
  }
}

@media (max-width: 640px) {
  .hero {
    padding: 44px 18px;
  }

  .page-shell {
    width: min(100% - 22px, var(--max));
    padding-bottom: 40px;
  }

  .section {
    padding: 74px 0;
  }

  .eyebrow {
    margin-bottom: 14px;
    font-size: 0.66rem;
  }

  .intro-copy p {
    font-size: clamp(1.5rem, 8vw, 2.05rem);
  }

  .messages-grid {
    gap: 12px;
  }

  .message-body,
  .audio-body {
    padding: 16px;
  }

  .timeline::before {
    left: 10px;
  }

  .timeline-card {
    margin-left: 24px;
    padding: 16px;
  }

  .timeline-card::before {
    left: -20px;
  }

  .chapter-media {
    gap: 8px;
  }

  .media-tile.portrait,
  .media-tile.small {
    grid-column: span 4;
  }

  .trait-grid,
  .bug-grid {
    grid-template-columns: 1fr;
  }

  .trait-card,
  .bug-card {
    min-height: 64px;
  }

  .letter-copy {
    font-size: 1.22rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 1ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 1ms !important;
  }

  .reveal {
    opacity: 1;
    transform: none;
  }
}

/* Premium interaction layer */

body.modal-open {
  overflow: hidden;
}

.intro-gate {
  min-height: 100svh;
  display: grid;
  place-items: center;
  padding: clamp(22px, 5vw, 58px);
}

.intro-gate[hidden] {
  display: none;
}

.intro-gate-inner {
  width: min(900px, 100%);
  display: grid;
  gap: 18px;
  align-items: center;
  justify-items: center;
}

.intro-skip {
  margin-top: 0;
}

.intro-status {
  min-height: 1.4em;
  margin: 12px 0 0;
  color: var(--gold);
  font-size: 0.95rem;
  font-weight: 760;
  text-align: center;
}

.intro-video-card {
  position: relative;
  width: 100%;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: var(--radius);
  background:
    radial-gradient(circle at 22% 12%, rgba(242, 200, 121, 0.14), transparent 16rem),
    radial-gradient(circle at 84% 80%, rgba(120, 170, 255, 0.13), transparent 18rem),
    #050712;
  box-shadow: 0 34px 120px rgba(0, 0, 0, 0.58), inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.intro-video-card::before {
  position: absolute;
  inset: 12px;
  z-index: 1;
  content: "";
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius);
  pointer-events: none;
}

.intro-video-card video {
  width: 100%;
  aspect-ratio: 16 / 9;
  height: auto;
  object-fit: contain;
}

.intro-video-overlay {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: grid;
  place-items: center;
  gap: 88px;
  border: 0;
  background:
    linear-gradient(180deg, rgba(5, 6, 17, 0.08), rgba(5, 6, 17, 0.36)),
    radial-gradient(circle at 50% 50%, transparent, rgba(5, 6, 17, 0.28));
  color: var(--text);
  cursor: pointer;
  text-align: center;
  transition: opacity 220ms ease;
}

.intro-video-overlay.hidden {
  opacity: 0;
  pointer-events: none;
}

.intro-video-overlay > span:last-child {
  align-self: end;
  margin-bottom: 22px;
  color: rgba(246, 240, 230, 0.68);
  font-size: 0.76rem;
  font-weight: 780;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.intro-fallback {
  position: absolute;
  inset: 18px;
  z-index: 3;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 16px;
  border-radius: var(--radius);
  background: rgba(5, 6, 17, 0.78);
  text-align: center;
  backdrop-filter: blur(14px);
}

.intro-fallback[hidden] {
  display: none;
}

.intro-fallback p {
  margin: 0;
  color: var(--muted);
}

.intro-caption {
  display: grid;
  justify-items: center;
  gap: 12px;
  text-align: center;
}

.intro-caption > p:first-child {
  max-width: 620px;
  margin: 0;
  color: rgba(246, 240, 230, 0.82);
  font-size: clamp(1rem, 2vw, 1.14rem);
  line-height: 1.55;
}

.journey-nav {
  position: fixed;
  top: 50%;
  right: 18px;
  z-index: 12;
  display: grid;
  gap: 11px;
  padding: 10px 8px;
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: 999px;
  background: rgba(7, 9, 18, 0.38);
  opacity: 0;
  pointer-events: none;
  transform: translateY(-50%) translateX(10px);
  transition: opacity 360ms ease, transform 360ms ease;
  backdrop-filter: blur(18px);
}

body.build-open .journey-nav {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(-50%) translateX(0);
}

.journey-nav a {
  width: 18px;
  height: 18px;
  display: grid;
  place-items: center;
  border-radius: 50%;
}

.journey-nav span {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: rgba(246, 240, 230, 0.38);
  box-shadow: 0 0 0 0 rgba(242, 200, 121, 0);
  transition: width 200ms ease, height 200ms ease, background 200ms ease, box-shadow 200ms ease;
}

.journey-nav a:hover span,
.journey-nav a.active span {
  width: 8px;
  height: 8px;
  background: var(--gold);
  box-shadow: 0 0 22px rgba(242, 200, 121, 0.44);
}

.chapter-screen {
  min-height: 100svh;
  display: grid;
  align-content: center;
}

#archive {
  display: block;
  min-height: auto;
  padding-bottom: clamp(120px, 18vw, 230px);
}

.section {
  scroll-margin-top: 0;
}

@media (min-width: 921px) {
  html {
    scroll-snap-type: y proximity;
  }

  .hero,
  .intro-section,
  .chapter-screen,
  #archive {
    scroll-snap-align: start;
    scroll-snap-stop: normal;
  }
}

.hero-inner {
  position: relative;
}

.hero-inner::before {
  position: absolute;
  inset: -18% 4% auto;
  height: 54%;
  content: "";
  background: radial-gradient(ellipse, rgba(242, 200, 121, 0.12), transparent 68%);
  filter: blur(24px);
  pointer-events: none;
}

.message-carousel-wrap {
  position: relative;
  width: 100%;
  min-width: 0;
  max-width: 100%;
  overflow: hidden;
  margin-left: 0;
}

.message-carousel {
  min-width: 0;
  max-width: 100%;
  display: flex;
  gap: 18px;
  overflow-x: auto;
  padding: 10px 9px 24px;
  scroll-snap-type: x mandatory;
  scrollbar-width: thin;
  scrollbar-color: rgba(242, 200, 121, 0.42) transparent;
}

.message-carousel::-webkit-scrollbar {
  height: 6px;
}

.message-carousel::-webkit-scrollbar-thumb {
  border-radius: 999px;
  background: rgba(242, 200, 121, 0.34);
}

.message-carousel .message-card {
  position: relative;
  grid-column: auto;
  width: min(78vw, 520px);
  min-width: min(78vw, 520px);
  min-height: 540px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  overflow: hidden;
  padding: 18px;
  scroll-snap-align: center;
  background:
    radial-gradient(circle at 20% 0%, rgba(242, 200, 121, 0.12), transparent 15rem),
    linear-gradient(180deg, rgba(255, 255, 255, 0.09), rgba(255, 255, 255, 0.034)),
    rgba(13, 17, 30, 0.86);
}

.message-carousel .message-card.portrait {
  align-items: stretch;
}

.message-glow {
  position: absolute;
  inset: auto -20% -34% -20%;
  height: 45%;
  background: radial-gradient(ellipse, rgba(120, 170, 255, 0.14), transparent 70%);
  pointer-events: none;
}

.message-kicker,
.preview-label {
  color: var(--gold);
  font-size: 0.72rem;
  font-weight: 760;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.message-body,
.audio-body {
  position: relative;
  padding: 16px 4px 2px;
}

.message-carousel .message-title {
  font-size: clamp(1.35rem, 3vw, 2rem);
}

.video-preview,
.archive-video-preview {
  position: relative;
  width: 100%;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.13);
  border-radius: var(--radius);
  background:
    radial-gradient(circle at 26% 24%, rgba(242, 200, 121, 0.22), transparent 9rem),
    radial-gradient(circle at 76% 70%, rgba(120, 170, 255, 0.2), transparent 12rem),
    linear-gradient(135deg, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0.024)),
    #080b15;
  color: var(--text);
  cursor: pointer;
  isolation: isolate;
  transition: transform 220ms ease, border-color 220ms ease, background 220ms ease;
}

.video-preview {
  min-height: 326px;
}

.video-preview.landscape {
  aspect-ratio: 16 / 10;
}

.video-preview.portrait {
  min-height: 378px;
  display: grid;
  place-items: center;
}

.video-preview:hover,
.archive-video-preview:hover {
  border-color: rgba(242, 200, 121, 0.36);
  transform: translateY(-2px);
}

.cinema-strip {
  position: absolute;
  inset: 14px;
  border-radius: var(--radius);
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.05) 1px, transparent 1px) 0 0 / 34px 100%,
    linear-gradient(180deg, rgba(255, 255, 255, 0.18), rgba(255, 255, 255, 0.03));
  opacity: 0.72;
}

.mini-phone {
  width: min(56%, 190px);
  aspect-ratio: 9 / 16;
  display: grid;
  place-items: center;
  padding: 8px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 26px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.12), rgba(255, 255, 255, 0.035));
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.36), inset 0 0 0 1px rgba(0, 0, 0, 0.44);
}

.mini-phone span {
  width: 100%;
  height: 100%;
  border-radius: 19px;
  background:
    radial-gradient(circle at 44% 20%, rgba(246, 240, 230, 0.18), transparent 7rem),
    linear-gradient(165deg, rgba(242, 200, 121, 0.16), rgba(120, 170, 255, 0.1)),
    #070913;
}

.play-orb {
  position: absolute;
  top: 50%;
  left: 50%;
  z-index: 2;
  width: 62px;
  height: 62px;
  display: grid;
  place-items: center;
  padding-left: 4px;
  border: 1px solid rgba(242, 200, 121, 0.42);
  border-radius: 50%;
  background: rgba(7, 9, 18, 0.58);
  box-shadow: 0 18px 48px rgba(0, 0, 0, 0.38), 0 0 42px rgba(242, 200, 121, 0.16);
  transform: translate(-50%, -50%);
  backdrop-filter: blur(14px);
}

.video-preview .preview-label,
.archive-video-preview .preview-label {
  position: absolute;
  left: 16px;
  bottom: 14px;
  z-index: 2;
}

.audio-message {
  gap: 18px;
}

.audio-message::before {
  width: 82px;
  height: 82px;
  display: grid;
  place-items: center;
  margin-bottom: 44px;
  content: "voice";
  border: 1px solid rgba(242, 200, 121, 0.22);
  border-radius: 50%;
  background: rgba(242, 200, 121, 0.08);
  color: rgba(246, 240, 230, 0.78);
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  box-shadow: 0 0 60px rgba(242, 200, 121, 0.12);
}

.custom-audio {
  position: relative;
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr) 44px;
  gap: 12px;
  align-items: center;
  margin-top: 26px;
  padding: 13px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.045);
}

.custom-audio audio {
  display: none;
}

.audio-toggle {
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(242, 200, 121, 0.26);
  border-radius: 50%;
  background: rgba(242, 200, 121, 0.1);
  color: var(--text);
  cursor: pointer;
}

.audio-track {
  height: 6px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.12);
  cursor: pointer;
}

.audio-progress {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--gold), var(--mint));
}

.audio-time {
  color: var(--muted);
  font-size: 0.8rem;
  font-variant-numeric: tabular-nums;
  text-align: right;
}

.carousel-arrow {
  position: absolute;
  top: 50%;
  z-index: 3;
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 50%;
  background: rgba(7, 9, 18, 0.58);
  color: var(--text);
  cursor: pointer;
  font-size: 1.5rem;
  transform: translateY(-50%);
  backdrop-filter: blur(14px);
}

.carousel-prev {
  left: 6px;
}

.carousel-next {
  right: 6px;
}

.chapter-media {
  align-items: start;
}

.media-frame {
  background:
    radial-gradient(circle at 50% 38%, rgba(246, 240, 230, 0.08), transparent 11rem),
    #070913;
}

.media-frame img {
  object-fit: var(--fit, cover);
  object-position: var(--object-position, 50% 50%);
}

.media-tile.artifact {
  grid-column: span 3;
}

.artifact-frame {
  display: grid;
  place-items: center;
  padding: 24px;
  background:
    radial-gradient(circle at 50% 50%, rgba(242, 200, 121, 0.1), transparent 11rem),
    rgba(255, 255, 255, 0.035);
}

.artifact-frame img {
  width: min(82%, 260px);
  height: auto;
  max-height: 180px;
  object-fit: contain;
}

.artifact-hit {
  position: absolute;
  inset: 0;
  border: 0;
  background: transparent;
  cursor: pointer;
}

.photo-hit {
  position: absolute;
  inset: 0;
  border: 0;
  background: transparent;
  cursor: zoom-in;
}

.media-frame::after {
  position: absolute;
  right: 10px;
  bottom: 10px;
  z-index: 2;
  padding: 6px 8px;
  content: "open";
  border: 1px solid rgba(255, 255, 255, 0.13);
  border-radius: 999px;
  background: rgba(5, 6, 17, 0.52);
  color: rgba(246, 240, 230, 0.74);
  font-size: 0.68rem;
  font-weight: 780;
  letter-spacing: 0.08em;
  opacity: 0;
  text-transform: uppercase;
  transform: translateY(4px);
  transition: opacity 180ms ease, transform 180ms ease;
  backdrop-filter: blur(10px);
}

.media-frame:hover::after {
  opacity: 1;
  transform: translateY(0);
}

.artifact-frame::after {
  content: "tap";
}

.artifact-note {
  position: absolute;
  left: 12px;
  right: 12px;
  bottom: 12px;
  padding: 9px 10px;
  border: 1px solid rgba(242, 200, 121, 0.18);
  border-radius: var(--radius);
  background: rgba(5, 6, 17, 0.72);
  color: rgba(246, 240, 230, 0.82);
  font-size: 0.78rem;
  opacity: 0;
  transform: translateY(6px);
  transition: opacity 200ms ease, transform 200ms ease;
  backdrop-filter: blur(12px);
}

.artifact-note.visible {
  opacity: 1;
  transform: translateY(0);
}

.archive-video-preview {
  min-height: 182px;
  aspect-ratio: 16 / 9;
}

.media-tile.portrait .archive-video-preview,
.archive-video-preview.portrait {
  aspect-ratio: 9 / 16;
  min-height: 280px;
  background:
    radial-gradient(circle at 50% 22%, rgba(242, 200, 121, 0.2), transparent 8rem),
    linear-gradient(170deg, rgba(255, 255, 255, 0.08), rgba(120, 170, 255, 0.08)),
    #070913;
}

.preview-grain {
  position: absolute;
  inset: 10px;
  border-radius: var(--radius);
  background:
    linear-gradient(rgba(255, 255, 255, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.028) 1px, transparent 1px);
  background-size: 18px 18px;
  opacity: 0.52;
}

.music-protocol {
  min-height: 230px;
}

.ghost-button,
.secondary-button {
  width: fit-content;
  min-height: 42px;
  padding: 0 15px;
  border: 1px solid rgba(255, 255, 255, 0.13);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.052);
  color: var(--text);
  cursor: pointer;
  font-size: 0.86rem;
  font-weight: 740;
  transition: transform 180ms ease, border-color 180ms ease, background 180ms ease;
}

.ghost-button:hover,
.secondary-button:hover {
  border-color: rgba(242, 200, 121, 0.34);
  background: rgba(242, 200, 121, 0.08);
  transform: translateY(-1px);
}

.transmission-logs {
  display: grid;
  gap: 14px;
  margin-top: 14px;
}

.transmission-logs[hidden] {
  display: none;
}

.transmission-logs > p {
  max-width: 520px;
  color: var(--muted);
  font-family: var(--font);
  font-size: 0.94rem;
}

.playlist-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.playlist-card {
  min-height: 88px;
  display: grid;
  align-content: center;
  gap: 7px;
  padding: 14px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--radius);
  background:
    radial-gradient(circle at 20% 10%, rgba(255, 139, 154, 0.12), transparent 7rem),
    rgba(255, 255, 255, 0.045);
  color: var(--text);
  text-decoration: none;
}

.playlist-card span {
  font-weight: 800;
}

.playlist-card small {
  color: var(--dim);
}

.text-only-memory {
  width: 100%;
  text-align: left;
  cursor: pointer;
}

.text-only-memory small {
  display: block;
  margin-top: 10px;
  color: var(--gold);
  font-family: var(--font);
  font-size: 0.72rem;
  font-weight: 760;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.interactive-bug {
  cursor: pointer;
}

.bug-confirmed {
  border-color: rgba(133, 226, 201, 0.3);
  background:
    linear-gradient(135deg, rgba(133, 226, 201, 0.14), rgba(255, 255, 255, 0.028)),
    var(--panel);
}

.locked-note {
  margin-top: 30px;
  padding: clamp(20px, 4vw, 32px);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--radius);
  background:
    radial-gradient(circle at 12% 0%, rgba(120, 170, 255, 0.12), transparent 14rem),
    rgba(255, 255, 255, 0.04);
}

.locked-note[hidden] {
  display: none;
}

.lock-mark {
  width: 52px;
  height: 52px;
  margin-bottom: 18px;
  border: 1px solid rgba(242, 200, 121, 0.24);
  border-radius: 50%;
  background:
    radial-gradient(circle at 50% 32%, rgba(242, 200, 121, 0.36), transparent 28%),
    rgba(242, 200, 121, 0.08);
  box-shadow: 0 0 44px rgba(242, 200, 121, 0.12);
}

.locked-note p {
  margin: 0;
  color: rgba(246, 240, 230, 0.84);
  font-family: var(--serif);
  font-size: clamp(1.16rem, 2.3vw, 1.55rem);
}

.unlock-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  margin-top: 22px;
}

.unlock-form input {
  min-height: 48px;
  min-width: 0;
  padding: 0 15px;
  border: 1px solid rgba(255, 255, 255, 0.13);
  border-radius: 999px;
  background: rgba(3, 4, 10, 0.42);
  color: var(--text);
  outline: 0;
}

.unlock-form input:focus {
  border-color: rgba(242, 200, 121, 0.42);
  box-shadow: 0 0 0 3px rgba(242, 200, 121, 0.08);
}

.unlock-feedback {
  min-height: 1.5em;
  margin-top: 12px !important;
  color: var(--gold) !important;
  font-family: var(--font) !important;
  font-size: 0.92rem !important;
}

.hint-button {
  margin-top: 10px;
  padding: 0;
  border: 0;
  background: transparent;
  color: rgba(242, 200, 121, 0.86);
  cursor: pointer;
  font-size: 0.9rem;
  font-weight: 760;
}

.hint-text {
  min-height: 1.4em;
  margin-top: 9px !important;
  color: rgba(246, 240, 230, 0.64) !important;
  font-family: var(--font) !important;
  font-size: 0.9rem !important;
}

.letter-copy[hidden] {
  display: none;
}

.letter-copy.unlocked {
  animation: note-open 520ms ease both;
}

.unlock-success {
  margin-bottom: 24px !important;
  color: var(--gold);
  font-family: var(--font) !important;
  font-size: clamp(0.98rem, 2vw, 1.08rem) !important;
  font-weight: 760;
  letter-spacing: 0;
}

.shake {
  animation: soft-shake 360ms ease;
}

.merge-button:disabled {
  cursor: pointer;
  opacity: 1;
}

.media-modal {
  position: fixed;
  inset: 0;
  z-index: 30;
  display: grid;
  place-items: center;
  padding: 18px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 220ms ease;
}

.media-modal.open {
  opacity: 1;
  pointer-events: auto;
}

.media-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(2, 3, 8, 0.74);
  backdrop-filter: blur(18px);
}

.media-modal-panel {
  position: relative;
  width: min(920px, 100%);
  max-height: min(86svh, 820px);
  display: grid;
  gap: 14px;
  padding: 14px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: var(--radius);
  background:
    radial-gradient(circle at 12% 0%, rgba(242, 200, 121, 0.12), transparent 18rem),
    rgba(11, 14, 25, 0.96);
  box-shadow: 0 40px 120px rgba(0, 0, 0, 0.64);
}

.modal-close {
  position: absolute;
  top: -14px;
  right: -14px;
  z-index: 2;
  width: 38px;
  height: 38px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 50%;
  background: rgba(7, 9, 18, 0.92);
  color: var(--text);
  cursor: pointer;
  font-size: 1.45rem;
  line-height: 1;
}

.modal-media-shell {
  display: grid;
  place-items: center;
  min-height: 260px;
  overflow: hidden;
  border-radius: var(--radius);
  background:
    radial-gradient(circle at 50% 50%, rgba(255, 255, 255, 0.06), transparent 16rem),
    #04050a;
}

.modal-media-shell video {
  width: 100%;
  max-height: 70svh;
  object-fit: contain;
}

.modal-media-shell .modal-portrait {
  width: auto;
  max-width: min(420px, 100%);
  border-radius: 18px;
}

.modal-photo {
  width: auto;
  max-width: 100%;
  height: auto;
  max-height: 74svh;
  object-fit: contain;
  border-radius: var(--radius);
}

.modal-meta {
  display: flex;
  gap: 14px;
  align-items: center;
  justify-content: space-between;
  padding: 0 4px 2px;
}

.modal-title {
  margin: 0;
  color: var(--text);
  font-weight: 800;
}

@keyframes note-open {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes soft-shake {
  0%, 100% { transform: translateX(0); }
  24% { transform: translateX(-5px); }
  52% { transform: translateX(4px); }
  76% { transform: translateX(-2px); }
}

@media (min-width: 1120px) {
  .timeline-card {
    grid-template-columns: 330px minmax(0, 1fr);
  }
}

@media (max-width: 920px) {
  html {
    scroll-snap-type: none;
  }

  .journey-nav {
    top: auto;
    right: 50%;
    bottom: 12px;
    grid-auto-flow: column;
    transform: translateX(50%) translateY(12px);
  }

  body.build-open .journey-nav {
    transform: translateX(50%) translateY(0);
  }

  .chapter-screen {
    min-height: auto;
  }

  .final-section {
    min-height: 100svh;
  }

  .intro-section {
    min-height: auto;
    padding-top: 72px;
    padding-bottom: 82px;
  }

  .chapter-jump {
    justify-content: flex-start;
    margin-top: 34px;
  }

  .intro-jump,
  .letter-section .chapter-jump {
    justify-content: center;
  }

  .forecast-card {
    grid-template-columns: 1fr;
  }

  .message-carousel .message-card {
    width: min(82vw, 440px);
    min-width: min(82vw, 440px);
  }

  .carousel-arrow {
    display: none;
  }

  .media-tile.artifact {
    grid-column: span 4;
  }
}

@media (max-width: 640px) {
  .journey-nav {
    gap: 8px;
    padding: 8px 9px;
  }

  .message-carousel-wrap {
    width: 100%;
    margin-left: 0;
  }

  .message-carousel {
    gap: 12px;
    padding-inline: 11px;
    scroll-padding-inline: 11px;
  }

  .message-carousel .message-card {
    width: calc(100vw - 44px);
    min-width: calc(100vw - 44px);
    min-height: 500px;
    padding: 15px;
  }

  .video-preview {
    min-height: 286px;
  }

  .intro-gate {
    align-items: start;
    padding-top: 42px;
    overflow-y: auto;
  }

  .forecast-preview {
    min-height: 220px;
  }

  .video-preview.portrait {
    min-height: 332px;
  }

  .audio-message::before {
    margin-bottom: 32px;
  }

  .custom-audio {
    grid-template-columns: 44px minmax(0, 1fr) 40px;
    gap: 9px;
    padding: 10px;
  }

  .playlist-grid,
  .unlock-form {
    grid-template-columns: 1fr;
  }

  .secondary-button {
    width: 100%;
  }

  .modal-meta {
    align-items: flex-start;
    flex-direction: column;
  }
}
