/* =============================================
   Memory flow — 3-page story overlay (Hive Figma)
   Warm stone palette, editorial pacing.
   Contained by phone-frame (position:absolute within
   the framed shell, same pattern as journey-modal).
   ============================================= */

/* Memory card uses .journey-card styles directly — no overrides here. */

/* =============================================
   Overlay shell
   ============================================= */
.memory-overlay {
  position: absolute;
  inset: 0;
  z-index: 200;
  display: none;
  background: rgba(30, 22, 14, 0.0);  /* transparent — phone-frame clip provides edge */
  outline: none;
}
.memory-overlay.is-open {
  display: block;
  animation: memory-fade 0.22s ease;
}
@keyframes memory-fade {
  from { opacity: 0; }
  to { opacity: 1; }
}

.memory-frame {
  position: absolute;
  inset: 0;
  background: #fcf5f0;
  overflow: hidden;
  /* Phone frame inherits rounded corners via clipping */
}

.memory-chrome {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  z-index: 30;
  padding: 54px 16px 0;  /* 54px = iPhone status bar height */
  pointer-events: none;
}
.memory-chrome > * { pointer-events: auto; }

.memory-progress {
  display: flex;
  gap: 4px;
  padding: 6px 0 2px;
}
.memory-progress-seg {
  flex: 1;
  height: 3px;
  background: rgba(0, 0, 0, 0.15);
  border-radius: 2px;
  overflow: hidden;
}
.memory-progress-fill {
  width: 0;
  height: 100%;
  background: #282523;
  border-radius: 2px;
  transition: width 0.28s ease;
}
.memory-progress-seg.is-past .memory-progress-fill { width: 100%; }
.memory-progress-seg.is-current .memory-progress-fill { width: 100%; }

.memory-topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 0;
}
.memory-dismiss {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: none;
  background: transparent;
  color: #3a332d;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.memory-dismiss:active { opacity: 0.6; }

.memory-stage {
  position: absolute;
  inset: 0;
  z-index: 10;
}

.memory-page {
  position: absolute;
  inset: 0;
  display: none;
  overflow: hidden;
}
.memory-page.is-active {
  display: block;
  animation: memory-page-in 0.35s cubic-bezier(0.2, 0.9, 0.3, 1);
}
@keyframes memory-page-in {
  from { opacity: 0; transform: translateX(12px); }
  to   { opacity: 1; transform: none; }
}

/* Tap zones (invisible) */
.memory-tap {
  position: absolute;
  top: 120px;           /* below the chrome */
  bottom: 60px;
  width: 35%;
  z-index: 20;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.memory-tap-prev { left: 0; }
.memory-tap-next { right: 0; }

/* =============================================
   Page 1 — Cover
   ============================================= */
.memory-cover {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, #fcf5f0 0%, #efe7df 100%);
  padding: 130px 36px 60px;
  display: flex;
  flex-direction: column;
  align-items: center;
  box-sizing: border-box;
}
.memory-cover-title {
  font-family: 'Caveat', 'Kalam', 'Brush Script MT', cursive;
  font-size: 84px;
  font-weight: 600;
  color: #47383a;
  letter-spacing: -0.5px;
  line-height: 0.95;
  margin: 0 0 18px;
}
.memory-cover-intro {
  font-size: 16px;
  line-height: 1.55;
  color: #33302e;
  text-align: center;
  max-width: 320px;
  margin: 0 0 26px;
}
.memory-cover-art {
  flex: 1;
  width: 100%;
  max-width: 360px;
  border-radius: 28px;
  overflow: hidden;
  min-height: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}
.memory-cover-art img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* =============================================
   Page 2 — Photo Journal
   Absolute positioning mirrors the 393×852 Figma frame.
   ============================================= */
.memory-journal {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, #f4ebe0 0%, #ede1d1 100%);
  overflow: hidden;
}
.memory-journal-title {
  position: absolute;
  top: 130px;
  left: 24px;
  right: 24px;
  margin: 0;
  font-family: 'Georgia', 'Times New Roman', serif;
  font-size: 30px;
  font-style: italic;
  font-weight: 500;
  color: #47383a;
  line-height: 1.2;
  letter-spacing: -0.4px;
}
.memory-journal-swirl {
  position: absolute;
  top: 291px;
  left: 234px;
  width: 120px;
  height: 120px;
  pointer-events: none;
}
.memory-journal-topic {
  position: absolute;
  width: 250px;
  height: auto;
  display: block;
}
.memory-journal-topic-eagles { top: 200px; left: 24px; }
.memory-journal-topic-fantasy { top: 511px; left: 119px; }
.memory-journal-sticker {
  position: absolute;
  top: 576px;
  left: 42px;
  width: 120px;
  height: 120px;
  pointer-events: none;
  transform: rotate(-6deg);
}
.memory-journal-sticker img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

/* =============================================
   Page 3 — End
   ============================================= */
.memory-end {
  position: absolute;
  inset: 0;
  background: #fcf5f0;
  padding: 120px 24px 50px;
  display: flex;
  flex-direction: column;
  box-sizing: border-box;
}
.memory-end-title {
  font-family: 'Georgia', 'Times New Roman', serif;
  font-size: 32px;
  font-style: italic;
  font-weight: 500;
  color: #47383a;
  line-height: 1.15;
  letter-spacing: -0.4px;
  margin: 0 0 16px;
}
.memory-end-sub {
  font-size: 15px;
  line-height: 1.5;
  color: #3a332d;
  margin: 0 0 90px;
}
.memory-end-cards {
  display: flex;
  flex-direction: column;
  gap: 18px;
}
.memory-end-card-img {
  width: 100%;
  height: auto;
  display: block;
}
.memory-end-sticker {
  position: absolute;
  right: -8px;
  bottom: 60px;
  width: 120px;
  height: 120px;
  pointer-events: none;
  transform: rotate(-8deg);
  z-index: 2;
}
.memory-end-sticker img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}
