/* =================================================================
   Roven — "warm hand-made"
   cream + electric magenta + plum, squiggle path + mystery tags
   ================================================================= */

@import url('https://fonts.googleapis.com/css2?family=Gaegu:wght@400;700&family=Noto+Serif+SC:wght@400;500;700&family=Noto+Sans+SC:wght@400;500&display=swap');

:root {
  /* base */
  --canvas:      #FBF5E9;   /* cream — 70-80% of every screen   */
  --canvas-2:    #F3E8D2;   /* deeper cream for layering        */
  --paper-line:  #EADfc6;

  /* text — plum carries all readable copy */
  --ink:         #38203A;
  --accent-700:  #7A2E5E;   /* secondary text                   */

  /* the spice */
  --magenta:     #EC1E8C;
  --magenta-700: #C0156F;
  --on-magenta:  #FFF6FB;

  /* decorative fills (never hold body text) */
  --periwinkle:  #AEB4EF;
  --mauve:       #D6A9D2;
  --butter:      #F4CE6E;
  --blush:       #F4B3BD;
  --on-deco:     #38203A;

  /* form */
  --radius-md: 18px;
  --radius-lg: 34px;
  --stroke-hand: 1.5px;
  --stroke-doodle: 2.5px;

  --serif: "Noto Serif SC", serif;
  --sans:  "Noto Sans SC", system-ui, sans-serif;
  --hand:  "Gaegu", "Noto Sans SC", cursive;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; }

body {
  background: #E7DCC6;                 /* surround for desktop */
  font-family: var(--sans);
  color: var(--ink);
  display: flex;
  justify-content: center;
  align-items: stretch;
}

.defs { position: absolute; }

/* ---------- phone frame ---------- */
.phone {
  position: relative;
  width: 100%;
  max-width: 430px;
  background: var(--canvas);
  overflow: hidden;
  /* faint paper grain */
  background-image:
    radial-gradient(circle at 18% 12%, rgba(214,169,210,.06), transparent 40%),
    radial-gradient(circle at 85% 70%, rgba(174,180,239,.07), transparent 45%);
}
@media (min-width: 432px) {
  body { padding: 22px 0; }
  .phone {
    height: calc(100vh - 44px);
    border-radius: 42px;
    box-shadow: 0 24px 60px rgba(56,32,58,.28), 0 0 0 10px #2a1830;
  }
}

/* ---------- scroll-snap pages ---------- */
.pages {
  height: 100vh;
  overflow-y: scroll;
  scroll-snap-type: y mandatory;
  scroll-behavior: smooth;
  scrollbar-width: none;
}
@media (min-width: 432px) { .pages { height: calc(100vh - 44px); } }
.pages::-webkit-scrollbar { display: none; }

.page {
  position: relative;
  min-height: 100%;
  scroll-snap-align: start;
  scroll-snap-stop: always;
  padding: 64px 30px 168px;   /* bottom room for the floating next button */
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

/* ---------- hand-drawn frame helper ---------- */
.frame { position: relative; }
.frame > .frame-edge {
  content: "";
  position: absolute; inset: 0;
  border: var(--stroke-hand) solid var(--ink);
  border-radius: var(--radius-md);
  filter: url(#wobble);
  pointer-events: none;
}

/* ---------- type ---------- */
.kicker {
  font-family: var(--hand);
  font-size: 20px;
  color: var(--accent-700);
  transform: rotate(-1.5deg);
  display: inline-block;
}
.kicker-star { width: 30px; height: auto; vertical-align: -8px; margin-left: 9px; }
.body { font-size: 16.5px; line-height: 1.85; color: var(--ink); }
.body + .body { margin-top: 14px; }
.muted { color: var(--accent-700); }

/* =================================================================
   P1 — hi, {name}
   ================================================================= */
.p1 { justify-content: center; text-align: left; }
.p1 .hello {
  font-family: var(--hand);
  font-size: 26px;
  color: var(--accent-700);
  margin: 0 0 6px;
  transform: rotate(-2deg);
}
.p1 .name {
  font-family: var(--serif);
  font-weight: 700;
  font-size: 66px;
  line-height: 1.02;
  margin: 0 0 28px;
  color: var(--ink);
  position: relative;
  display: inline-block;
}
.p1 .name .ul {            /* hand underline */
  position: absolute; left: -4px; right: -10px; bottom: -10px; height: 14px;
}
.p1 .lines { max-width: 30ch; }
.p1 .lines .body { white-space: nowrap; }   /* keep each line unbroken */
.p1 .from {
  margin-top: 30px;
  font-family: var(--hand);
  font-size: 19px;
  color: var(--accent-700);
}

/* blob behind the name */
.blob {
  position: absolute;
  z-index: -1;
  filter: blur(.4px);
  opacity: .85;
}

/* =================================================================
   P2 — profile attributes (mystery tags)
   ================================================================= */
.section-title {
  font-family: var(--serif);
  font-weight: 700;
  font-size: 27px;
  line-height: 1.35;
  margin: 0 0 14px;
}
.p2 .intro { margin-bottom: 22px; }

.tags { display: flex; flex-direction: column; gap: 16px; }
.tag {
  position: relative;
  padding: 16px 17px 17px;
  border-radius: var(--radius-md);
  color: var(--on-deco);
}
.tag:nth-child(odd)  { transform: rotate(-1.4deg); }
.tag:nth-child(even) { transform: rotate(1.3deg); }
.tag.f-periwinkle { background: var(--periwinkle); }
.tag.f-mauve      { background: var(--mauve); }
.tag.f-butter     { background: var(--butter); }
.tag.f-blush      { background: var(--blush); }
.tag .tag-head {
  font-family: var(--hand);
  font-weight: 700;
  font-size: 21px;
  line-height: 1.3;
  margin-bottom: 7px;
  display: flex; gap: 9px; align-items: flex-start;
}
.tag .tag-head .tag-star { flex: none; margin-top: 1px; }
.tag .tag-note { font-size: 14.5px; line-height: 1.7; }

.p2 .outro {
  margin-top: 24px;
  font-family: var(--serif);
  font-size: 17px;
  line-height: 1.8;
  color: var(--ink);
}

/* =================================================================
   P3 — the match
   ================================================================= */
.match-card {
  margin: 16px 0 22px;
  padding: 22px 22px 24px;
  background: var(--canvas-2);
  border-radius: var(--radius-lg);
}
.match-id { display: flex; align-items: center; gap: 16px; margin-bottom: 18px; }
.match-avatar {
  flex: none; width: 70px; height: 70px; border-radius: 50%;
  background: var(--periwinkle);
  display: grid; place-items: center;
  font-family: var(--serif); font-weight: 700; font-size: 30px; color: var(--on-deco);
  transform: rotate(-3deg);
}
.match-avatar.has-img { overflow: hidden; background: transparent; }
.avatar-img { width: 100%; height: 100%; object-fit: cover; display: block; transform: scale(1.12); }
.match-name { font-family: var(--serif); font-weight: 700; font-size: 30px; margin: 0; }
.match-meta { font-family: var(--hand); font-size: 18px; color: var(--accent-700); margin-top: 2px; }

/* ---- in-card photo carousel (swipe left/right) ---- */
.carousel { margin: 4px 0 18px; }
.ctrack {
  display: flex;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  gap: 0;
  border-radius: var(--radius-md);
}
.ctrack::-webkit-scrollbar { display: none; }
.slide {
  position: relative;
  flex: 0 0 100%;
  scroll-snap-align: center;
  scroll-snap-stop: always;   /* friction: one slide per swipe, no flinging past */
  aspect-ratio: 3 / 4;
}
.slide img {
  width: 100%; height: 100%; object-fit: cover; display: block;
  border-radius: var(--radius-md);
}
.slide-cap {
  position: absolute; left: 12px; bottom: 11px;
  font-family: var(--hand); font-size: 16px; color: #fff;
  text-shadow: 0 1px 6px rgba(0,0,0,.55);
}
.cdots { display: flex; justify-content: center; gap: 7px; margin-top: 11px; }
.cdots .cdot {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--accent-700); opacity: .26; cursor: pointer; transition: all .22s ease;
}
.cdots .cdot.active { opacity: 1; background: var(--magenta); transform: scale(1.45); }
.cswipe {
  display: block; text-align: center; margin-top: 7px;
  font-family: var(--hand); font-size: 14px; color: var(--accent-700);
}

.date-box {
  margin-top: 6px;
  padding: 18px 18px 20px;
  border-radius: var(--radius-md);
  background: var(--canvas);
}
.date-box .date-title {
  font-family: var(--hand); font-weight: 700; font-size: 20px; color: var(--magenta-700);
  margin-bottom: 10px; display: flex; gap: 8px; align-items: center;
}
.date-box .body { font-size: 15px; line-height: 1.75; }
.date-box .body + .body { margin-top: 8px; }

/* =================================================================
   P4 — paywall (trust-critical: calm, clear, low wobble)
   ================================================================= */
.p4 { justify-content: flex-start; }
.p4 .pay-head {
  font-family: var(--serif); font-weight: 700; font-size: 25px; margin: 0 0 8px;
  display: flex; align-items: center; gap: 10px;
}
.head-flower { flex: none; width: 40px; height: auto; transform: rotate(9deg); }
.p4 .teaser { font-size: 15.5px; line-height: 1.75; color: var(--accent-700); margin-bottom: 20px; }

.locked { display: flex; flex-direction: column; gap: 26px; }

/* a teaser row: a locked visual on one side, copy on the other */
.lock-row { display: flex; align-items: center; gap: 14px; }
/* tighten the map-row → deck-row spacing by half (26px gap → 13px) */
.map-row + .deck-row { margin-top: -13px; }

/* the copy column shared by both rows */
.lock-copy { flex: 1 1 auto; min-width: 0; }
.lock-h {
  font-family: var(--serif); font-weight: 700; font-size: 17.5px;
  color: var(--ink); margin: 0 0 10px;
}
.lock-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 9px; }
.lock-list li {
  position: relative; padding-left: 17px;
  font-size: 14.5px; line-height: 1.5; color: var(--accent-700);
}
.lock-list li::before {
  content: "✶"; position: absolute; left: 0; top: 1px;
  color: var(--magenta); font-size: 11px;
}
/* redacted location — blurred until paid */
.redact {
  display: inline-block; filter: blur(4.5px);
  user-select: none; opacity: .9; color: var(--ink);
  padding: 0 3px; vertical-align: baseline;
}

/* row 1 — the folded map, 40% larger, bleeding off the left screen edge */
.map-row .map-card {
  position: relative; flex: 0 0 auto;
  width: 70%;
  margin-left: -68px;              /* part of the map runs off the left edge */
  transform: rotate(-5deg);
  pointer-events: none;            /* locked: can't drag / pan */
  user-select: none;
  filter: drop-shadow(0 14px 22px rgba(56,32,58,.30));
}
/* the cutout already carries the white border, fold creases & blurred face */
.map-img { width: 100%; height: auto; display: block; }

/* row 2 — fanned "pan stack" of photo cards on the right, bleeding off-edge */
.deck-row .card-stack {
  flex: 0 0 56%;
  margin-right: -44px;             /* part of the deck runs off the right edge */
}
.card-stack {
  position: relative;
  height: 278px;                   /* ~20% larger than before */
  display: flex; align-items: center; justify-content: center;
}
.card-stack .stack-card {
  position: absolute;
  width: 88%;
  aspect-ratio: 3 / 4;
  object-fit: cover;
  border-radius: var(--radius-md);
  border: 4px solid #fff;
  box-shadow: 0 12px 30px rgba(56,32,58,.28);
}

/* reveal photo — full image, lower third blurred behind a fade */
.reveal-photo {
  position: relative; border-radius: var(--radius-md); overflow: hidden;
  background: var(--canvas-2);
}
.reveal-photo .reveal-img {
  width: 100%; display: block;
  max-height: 56vh; object-fit: cover; object-position: center 28%;
}
.reveal-photo .reveal-fade {
  position: absolute; left: 0; right: 0; bottom: 0; height: 34%;
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  background: linear-gradient(to bottom, rgba(251,245,233,0), rgba(251,245,233,.6));
  -webkit-mask-image: linear-gradient(to bottom, transparent, #000 42%);
          mask-image: linear-gradient(to bottom, transparent, #000 42%);
  transition: opacity .6s ease;
}
.reveal-photo .photo-cap {
  position: absolute; left: 14px; bottom: 12px; z-index: 1;
  font-family: var(--hand); font-size: 17px; color: var(--on-deco);
}
.locked .blur-text { filter: blur(7px); user-select: none; transition: filter .6s ease; }

.advice-item {
  padding: 16px 17px; border-radius: var(--radius-md);
  background: var(--canvas-2); font-size: 14.5px; line-height: 1.75;
}

.lock-badge {
  position: absolute; inset: 0; display: grid; place-items: center; z-index: 2;
  pointer-events: none;
}
.lock-badge .pill {
  background: var(--canvas); color: var(--ink);
  padding: 9px 16px; border-radius: 999px; font-size: 14px; font-weight: 500;
  box-shadow: 0 4px 14px rgba(56,32,58,.18);
  display: flex; gap: 7px; align-items: center;
}

/* unlock card — centered over the blurred text block beneath the stack */
.pay-float {
  position: absolute;
  left: 6px; right: 6px; top: 50%;
  transform: translateY(-50%);
  z-index: 6;
}

/* pay panel — deliberately clean: square-ish, no rotation, clear button */
.pay-wrap { position: relative; }
.pay-panel {
  position: relative; z-index: 1;            /* opaque card over the sun */
  padding: 20px;
  border: var(--stroke-hand) solid var(--ink);
  border-radius: var(--radius-md);
  background: var(--canvas);
  box-shadow: 0 18px 44px rgba(56,32,58,.28);
}
/* sun peeking out from behind the card's top-left corner */
.pay-sun {
  position: absolute; top: -44px; left: -26px;
  width: 92px; height: auto; z-index: 0;     /* behind the card, protrudes top-left */
  transform: rotate(-8deg); pointer-events: none;
}
.pay-row { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 4px; }
.pay-row .label { font-size: 15px; color: var(--accent-700); }
.pay-row .price { font-family: var(--serif); font-weight: 700; font-size: 30px; color: var(--ink); }
.pay-note { font-size: 13px; color: var(--accent-700); line-height: 1.6; margin: 6px 0 8px; }
.unlock-list {
  list-style: none; margin: 0 0 16px; padding: 0;
  display: flex; flex-direction: column; gap: 6px;
}
.unlock-list li {
  position: relative; padding-left: 18px;
  font-size: 13.5px; color: var(--ink); line-height: 1.5;
}
.unlock-list li::before {
  content: "✶"; position: absolute; left: 0; top: 0;
  color: var(--magenta); font-size: 12px;
}

.btn-primary {
  width: 100%; border: none; cursor: pointer;
  background: var(--magenta); color: var(--on-magenta);
  font-family: var(--sans); font-weight: 500; font-size: 17px;
  padding: 16px; border-radius: 14px;
  box-shadow: 0 6px 0 var(--magenta-700);
  transition: transform .08s ease, box-shadow .08s ease;
}
.btn-primary:active { transform: translateY(4px); box-shadow: 0 2px 0 var(--magenta-700); }
.secure-line { text-align: center; font-size: 12px; color: var(--accent-700); margin-top: 12px; }

.unlocked-flag {
  display: none; margin-top: 16px; text-align: center;
  font-family: var(--hand); font-size: 19px; color: var(--magenta-700);
}
.p4.is-unlocked .unlocked-flag { display: block; }
.p4.is-unlocked .blur { filter: none; }
.p4.is-unlocked .blur-text { filter: none; }
.p4.is-unlocked .reveal-fade { opacity: 0; }
.p4.is-unlocked .stack-card { filter: none; }
.p4.is-unlocked .lock-badge { display: none; }
.p4.is-unlocked .pay-float { display: none; }
.p4.is-unlocked .map-lock { display: none; }
.p4.is-unlocked .map-card { pointer-events: auto; }

/* =================================================================
   QR unlock popup
   ================================================================= */
.qr-modal { position: absolute; inset: 0; z-index: 100; display: none; }
.qr-modal.open { display: grid; place-items: center; }
.qr-backdrop {
  position: absolute; inset: 0;
  background: rgba(56,32,58,.5);
  backdrop-filter: blur(3px); -webkit-backdrop-filter: blur(3px);
}
.qr-card {
  position: relative; z-index: 1;
  width: min(80%, 320px);
  background: var(--canvas);
  border-radius: var(--radius-lg);
  padding: 26px 24px 22px;
  text-align: center;
  box-shadow: 0 24px 70px rgba(56,32,58,.45);
  animation: qr-pop .22s ease-out;
}
@keyframes qr-pop { from { transform: scale(.92); opacity: 0; } to { transform: scale(1); opacity: 1; } }
.qr-x {
  position: absolute; top: 8px; right: 12px;
  background: none; border: none; cursor: pointer;
  font-size: 26px; line-height: 1; color: var(--accent-700);
}
.qr-title {
  font-family: var(--serif); font-weight: 700; font-size: 19px;
  color: var(--ink); margin: 2px 0 16px;
}
.qr-img { width: 100%; border-radius: 12px; display: block; }
.qr-steps {
  margin: 16px 0 0; text-align: left;
  display: flex; flex-direction: column; gap: 7px;
}
.qr-steps p {
  margin: 0; font-size: 14px; line-height: 1.5; color: var(--ink);
}

/* =================================================================
   squiggle "next" affordance + progress dots
   ================================================================= */
/* arrow on the left, label to its right (not overlaying) */
.next {
  position: absolute; left: 50%; bottom: 20px; transform: translateX(-50%);
  background: none; border: none; cursor: pointer; padding: 0;
  display: flex; align-items: center; gap: 10px;
  animation: bob 2.2s ease-in-out infinite;
}
.next-arrow {
  width: 82px; height: auto;
  filter: drop-shadow(0 4px 7px rgba(56,32,58,.16));
}
.next-label {
  color: var(--accent-700);
  font-family: var(--hand); font-size: 18px; white-space: nowrap;
}
@keyframes bob { 0%,100% { transform: translateX(-50%) translateY(0); } 50% { transform: translateX(-50%) translateY(6px); } }

.dots {
  position: absolute; right: 14px; top: 50%; transform: translateY(-50%);
  display: flex; flex-direction: column; gap: 10px; z-index: 20;
}
.dots .dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--accent-700); opacity: .28; transition: all .25s ease;
  border: none; padding: 0; cursor: pointer;
}
.dots .dot.active { opacity: 1; background: var(--magenta); transform: scale(1.5); }

/* doodle marks */
.doodle { position: absolute; pointer-events: none; z-index: 0; }
.star-soft { filter: drop-shadow(0 5px 9px rgba(56,32,58,.16)); }
.p1 .name { z-index: 1; }   /* name sits above the hero star */
.todo-banner {
  margin: auto; text-align: center; font-family: var(--hand);
  font-size: 22px; color: var(--accent-700); line-height: 1.6;
}
