/* ============================================================
   For Mfon — a three-page invitation
   Style: colourful + minimalist (poppi-inspired colour blocks,
   wavy dividers, Fraunces display, pinned/tilted cards)
   Pages: index (envelope) · things (three things) · invite (poem)
   ============================================================ */

:root {
  --ink: #143d33;
  --cream: #fffaf0;
  --red: #ff4d3d;
  --yellow: #ffd23f;
  --teal: #19c2bf;
  --coral: #ff7a59;
  --lime: #bcd84a;
  --purple: #7b5cff;
  --pink: #ffd6df;
  --pink-strong: #ff5da2;
  --lilac: #ece1ff;

  --e-out: cubic-bezier(0.16, 1, 0.3, 1);
  --e-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
  --t-fast: 160ms;
  --t-norm: 300ms;
  --t-slow: 600ms;
  --pad-inline: clamp(1.25rem, 6vw, 6rem);
  --maxw: 66rem;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  color: var(--ink);
  background: var(--pink);
  font-family: "Outfit", system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  animation: pageIn 560ms var(--e-out) both;
}

body.is-leaving {
  opacity: 0;
  transition: opacity 340ms var(--e-out);
}

@keyframes pageIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
}

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

button,
a {
  font: inherit;
  color: inherit;
}

/* ── ambient grain ── */
.grain {
  position: fixed;
  inset: 0;
  z-index: 60;
  pointer-events: none;
  opacity: 0.045;
  mix-blend-mode: multiply;
  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 baseFrequency='.85' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='200' height='200' filter='url(%23n)' opacity='.6'/%3E%3C/svg%3E");
}

/* ============================================================
   Shared bits
   ============================================================ */
.eyebrow {
  margin: 0;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.2em;
  text-transform: uppercase;
}

h1,
h2 {
  font-family: "Fraunces", serif;
  font-weight: 600;
  letter-spacing: -0.015em;
  margin: 0;
}

em {
  font-style: italic;
}

.lede {
  font-size: clamp(1.05rem, 2.1vw, 1.25rem);
  line-height: 1.6;
}

/* ── buttons ── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  min-height: 54px;
  padding: 0 1.7rem;
  border: 0;
  border-radius: 999px;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  transition:
    transform var(--t-fast) var(--e-spring),
    box-shadow var(--t-norm) var(--e-out),
    background var(--t-norm) var(--e-out);
}

.btn:hover {
  transform: translateY(-2px);
}

.btn:active {
  transform: scale(0.97);
  transition-duration: 80ms;
}

.btn:focus-visible {
  outline: 3px solid var(--ink);
  outline-offset: 4px;
}

.btn--red {
  background: var(--red);
  color: var(--cream);
  box-shadow: 0 16px 34px -16px rgba(255, 77, 61, 0.9);
}

.btn--ink {
  background: var(--ink);
  color: var(--cream);
  box-shadow: 0 16px 34px -18px rgba(20, 61, 51, 0.85);
}

.btn--cream {
  background: var(--cream);
  color: var(--ink);
  box-shadow: 0 16px 34px -18px rgba(20, 61, 51, 0.6);
}

.btn--ghost {
  background: transparent;
  color: var(--ink);
  box-shadow: inset 0 0 0 2px currentColor;
}

/* ── waves ── */
.wave {
  position: absolute;
  left: 0;
  width: 100%;
  height: clamp(40px, 6vw, 80px);
  display: block;
  z-index: 1;
}

.wave:not(.wave--up) {
  bottom: -1px;
}

.wave--up {
  top: -1px;
  transform: scaleY(-1);
}

.wave--pink path { fill: var(--pink); }
.wave--yellow path { fill: var(--yellow); }
.wave--teal path { fill: var(--teal); }
.wave--purple path { fill: var(--purple); }
.wave--red path { fill: var(--red); }
.wave--cream path { fill: var(--cream); }

/* ── scroll reveal ── */
.reveal {
  opacity: 0;
  transform: translateY(18px);
  transition:
    opacity var(--t-slow) var(--e-out),
    transform var(--t-slow) var(--e-out);
}

.reveal.is-visible {
  opacity: 1;
  transform: none;
}

/* ============================================================
   PAGE 1 — Envelope
   ============================================================ */
.stage {
  display: grid;
  place-items: center;
  align-content: center;
  gap: 2.5rem;
  min-height: 100vh;
  padding: 4rem var(--pad-inline);
  text-align: center;
  background: var(--pink);
}

.stage__title {
  font-size: clamp(1.6rem, 5vw, 2.6rem);
  color: var(--ink);
}

.stage__title em {
  color: var(--red);
}

.envelope {
  position: relative;
  width: clamp(18rem, 86vw, 27rem);
  aspect-ratio: 7 / 5;
  margin-top: 5rem;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: pointer;
  perspective: 1400px;
  animation: bob 4.5s var(--e-out) infinite;
}

.envelope:focus-visible {
  outline: 3px solid var(--red);
  outline-offset: 10px;
  border-radius: 12px;
}

.envelope.is-open {
  animation: none;
}

@keyframes bob {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-10px); }
}

/* letter (slides up out of the envelope) */
.ev-letter {
  position: absolute;
  left: 7%;
  right: 7%;
  top: 9%;
  height: 80%;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  padding: 1.4rem 1.2rem 0;
  background: var(--cream);
  border-radius: 10px;
  box-shadow: 0 10px 24px -16px rgba(20, 61, 51, 0.5);
  transition: transform 760ms var(--e-spring);
}

.envelope.is-open .ev-letter {
  transform: translateY(-58%);
}

.ev-letter__eyebrow {
  color: var(--red);
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.ev-letter__line {
  font-family: "Fraunces", serif;
  font-style: italic;
  font-size: clamp(1.1rem, 4vw, 1.5rem);
  line-height: 1.1;
  color: var(--ink);
}

/* envelope body (front pocket) */
.ev-body {
  position: absolute;
  inset: 0;
  z-index: 3;
  background: var(--red);
  border-radius: 14px;
  box-shadow: 0 30px 60px -28px rgba(255, 77, 61, 0.9);
  overflow: hidden;
}

.ev-body::before {
  /* faint front-seam V */
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(to bottom right, transparent calc(50% - 1px), rgba(20, 61, 51, 0.12) 50%, transparent calc(50% + 1px)) left / 50% 100% no-repeat,
    linear-gradient(to bottom left, transparent calc(50% - 1px), rgba(20, 61, 51, 0.12) 50%, transparent calc(50% + 1px)) right / 50% 100% no-repeat;
}

.ev-label {
  position: absolute;
  bottom: 13%;
  left: 0;
  right: 0;
  z-index: 1;
  font-family: "Fraunces", serif;
  font-style: italic;
  font-size: clamp(1.2rem, 5vw, 1.7rem);
  color: var(--cream);
}

/* flap */
.ev-flap {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 64%;
  z-index: 4;
  background: var(--red);
  filter: brightness(0.9);
  clip-path: polygon(0 0, 100% 0, 50% 100%);
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 100 100' preserveAspectRatio='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath fill='black' d='M2.8 0 H97.2 C96.2 2.8 94.1 6.4 90.8 10.4 L50 100 L9.2 10.4 C5.9 6.4 3.8 2.8 2.8 0 Z'/%3E%3C/svg%3E");
  mask-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 100 100' preserveAspectRatio='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath fill='black' d='M2.8 0 H97.2 C96.2 2.8 94.1 6.4 90.8 10.4 L50 100 L9.2 10.4 C5.9 6.4 3.8 2.8 2.8 0 Z'/%3E%3C/svg%3E");
  -webkit-mask-size: 100% 100%;
  mask-size: 100% 100%;
  -webkit-mask-repeat: no-repeat;
  mask-repeat: no-repeat;
  transform-origin: top center;
  transition: transform 700ms var(--e-out), z-index 0ms 350ms;
}

.envelope.is-open .ev-flap {
  transform: rotateX(174deg);
  z-index: 1;
}

/* wax seal */
.seal {
  position: absolute;
  top: 33%;
  left: 50%;
  z-index: 5;
  transform: translate(-50%, -50%);
  width: 3.4rem;
  height: 3.4rem;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--yellow);
  color: var(--red);
  font-size: 1.5rem;
  box-shadow: 0 8px 18px -8px rgba(20, 61, 51, 0.6);
  transition: transform 360ms var(--e-spring), opacity 260ms var(--e-out);
}

.envelope.is-open .seal {
  transform: translate(-50%, -50%) scale(0);
  opacity: 0;
}

.stage__hint {
  margin: 0;
  font-weight: 600;
  font-size: 0.92rem;
  letter-spacing: 0.04em;
  color: var(--ink);
  opacity: 0.7;
}

.envelope.is-open ~ .stage__hint {
  opacity: 0;
}

/* ============================================================
   PAGE 2 — Three things  (+ shared flip cards)
   ============================================================ */
.hero {
  position: relative;
  padding: clamp(1.5rem, 4vw, 2.5rem) var(--pad-inline) clamp(6rem, 12vw, 9rem);
  text-align: center;
}

.hero--red { background: var(--red); color: var(--cream); }
.hero--teal { background: var(--teal); color: var(--ink); }

.back {
  display: inline-block;
  font-weight: 600;
  font-size: 0.92rem;
  text-decoration: none;
  opacity: 0.85;
  transition: opacity var(--t-fast) var(--e-out), transform var(--t-fast) var(--e-out);
}

.back:hover {
  opacity: 1;
  transform: translateX(-3px);
}

.hero__inner {
  max-width: 56rem;
  margin: clamp(2.5rem, 8vw, 5rem) auto 0;
}

.hero h1 {
  font-size: clamp(2.8rem, 9vw, 6rem);
  line-height: 0.96;
}

.hero--red .eyebrow { color: var(--yellow); }
.hero--red h1 em { color: var(--yellow); }
.hero--teal .eyebrow { color: var(--red); }
.hero--teal h1 em { color: var(--cream); }

.hero__copy {
  max-width: 30rem;
  margin: 1.3rem auto 0;
  font-size: clamp(1.05rem, 2.2vw, 1.25rem);
}

.hero--red .hero__copy { color: rgba(255, 250, 240, 0.9); }

/* eggs / things section */
.things {
  position: relative;
  padding: clamp(2.5rem, 6vw, 4.5rem) var(--pad-inline) clamp(4rem, 9vw, 6.5rem);
  background: var(--pink);
}

.things__progress {
  margin: 0 auto clamp(2rem, 5vw, 3.5rem);
  width: fit-content;
  padding: 0.5rem 1.2rem;
  border-radius: 999px;
  background: var(--cream);
  font-weight: 700;
  font-size: 0.85rem;
  letter-spacing: 0.04em;
  box-shadow: 0 10px 24px -14px rgba(20, 61, 51, 0.5);
}

.panel-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(1.6rem, 4vw, 2.6rem);
  max-width: 62rem;
  margin: 0 auto;
}

/* framed panel (inspired by stacked note cards) */
.panel {
  position: relative;
  min-height: clamp(22rem, 62vw, 25rem);
  padding: 1.1rem;
  border: 5px solid var(--purple);
  border-radius: 1.8rem;
  background: var(--lilac);
  cursor: pointer;
  overflow: hidden;
  transform: rotate(var(--rot, 0deg));
  transition: transform 320ms var(--e-out), box-shadow 320ms var(--e-out);
}

.panel:hover {
  transform: rotate(0deg) translateY(-5px);
  box-shadow: 0 26px 50px -28px rgba(123, 92, 255, 0.7);
}

.panel.is-cracking {
  animation: eggCrackShake 430ms var(--e-out) both;
}

.panel:focus-visible {
  outline: 3px solid var(--ink);
  outline-offset: 6px;
}

.crack {
  position: absolute;
  inset: 0.75rem;
  z-index: 5;
  pointer-events: none;
  opacity: 0;
  transform: scale(0.92);
  filter: drop-shadow(0 5px 0 rgba(255, 250, 240, 0.28));
  background:
    linear-gradient(112deg, transparent 0 41%, rgba(20, 61, 51, 0.62) 41.4% 42.3%, transparent 42.7%) 48% 10% / 38% 48% no-repeat,
    linear-gradient(62deg, transparent 0 52%, rgba(20, 61, 51, 0.5) 52.4% 53.5%, transparent 54%) 35% 31% / 34% 42% no-repeat,
    linear-gradient(128deg, transparent 0 48%, rgba(20, 61, 51, 0.46) 48.5% 49.6%, transparent 50%) 61% 34% / 31% 38% no-repeat,
    radial-gradient(circle at 50% 44%, rgba(255, 250, 240, 0.9) 0 0.28rem, transparent 0.32rem),
    radial-gradient(circle at 45% 38%, rgba(255, 250, 240, 0.8) 0 0.18rem, transparent 0.22rem),
    radial-gradient(circle at 57% 39%, rgba(255, 250, 240, 0.8) 0 0.18rem, transparent 0.22rem);
}

.panel.is-cracking .crack {
  animation: crackFlash 520ms var(--e-out) both;
}

/* closed state — dashed slots + hint */
.ghost {
  position: absolute;
  border: 2px dashed rgba(123, 92, 255, 0.5);
  border-radius: 1rem;
  transition: opacity 300ms var(--e-out), transform 300ms var(--e-out);
}

.ghost--1 {
  top: 9%;
  left: 7%;
  right: 16%;
  height: 30%;
  transform: rotate(-2deg);
}

.ghost--2 {
  bottom: 9%;
  left: 16%;
  right: 7%;
  height: 26%;
  transform: rotate(3deg);
}

.peek {
  position: absolute;
  top: 50%;
  left: 50%;
  z-index: 4;
  transform: translate(-50%, -50%);
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.55rem 1rem;
  border-radius: 999px;
  background: var(--cream);
  color: var(--ink);
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  box-shadow: 0 12px 26px -14px rgba(20, 61, 51, 0.55);
  transition: opacity 300ms var(--e-out), transform 300ms var(--e-out);
}

.peek__dot {
  width: 0.6rem;
  height: 0.6rem;
  border-radius: 50%;
  background: var(--accent);
}

.panel.is-open .ghost {
  opacity: 0;
}

.panel.is-open .peek {
  opacity: 0;
  transform: translate(-50%, -50%) scale(0.85);
  pointer-events: none;
}

/* open state — message bubble + bold chip */
.bubble,
.chip {
  position: absolute;
  opacity: 0;
  text-align: left;
  box-shadow: 0 16px 36px -18px rgba(20, 61, 51, 0.5);
  transition: opacity 420ms var(--e-out), transform 540ms var(--e-spring);
}

.bubble {
  z-index: 1;
  top: 5%;
  left: 4%;
  right: 9%;
  padding: 1rem 1.05rem;
  border-radius: 1.1rem 1.1rem 1.1rem 0.35rem;
  background: var(--cream);
  transform: translateY(16px) rotate(-5deg) scale(0.95);
}

.chip {
  z-index: 2;
  bottom: 5%;
  left: 11%;
  right: 5%;
  padding: 0.95rem 1.1rem;
  border-radius: 1.1rem 1.1rem 0.35rem 1.1rem;
  background: var(--accent);
  color: var(--chip-fg, var(--cream));
  font-family: "Fraunces", serif;
  font-weight: 700;
  font-size: clamp(1.3rem, 4vw, 1.7rem);
  line-height: 1;
  transform: translateY(16px) rotate(6deg) scale(0.95);
}

.panel.is-open .bubble {
  opacity: 1;
  transform: rotate(-3deg);
}

.panel.is-open .chip {
  opacity: 1;
  transform: rotate(3deg);
  transition-delay: 90ms;
}

@keyframes eggCrackShake {
  0%,
  100% {
    transform: rotate(var(--rot, 0deg)) translateX(0);
  }
  15% {
    transform: rotate(calc(var(--rot, 0deg) - 2deg)) translateX(-4px);
  }
  32% {
    transform: rotate(calc(var(--rot, 0deg) + 2deg)) translateX(5px);
  }
  50% {
    transform: rotate(calc(var(--rot, 0deg) - 1deg)) translateX(-3px);
  }
  72% {
    transform: rotate(calc(var(--rot, 0deg) + 1deg)) translateX(2px);
  }
}

@keyframes crackFlash {
  0% {
    opacity: 0;
    transform: scale(0.86);
  }
  28% {
    opacity: 1;
    transform: scale(1.04);
  }
  78% {
    opacity: 0.82;
    transform: scale(1);
  }
  100% {
    opacity: 0;
    transform: scale(1.08);
  }
}

.bubble__head {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: rgba(20, 61, 51, 0.55);
}

.bubble__dot {
  width: 0.7rem;
  height: 0.7rem;
  border-radius: 50%;
  background: var(--accent);
}

.bubble__title {
  display: block;
  margin: 0.45rem 0 0.4rem;
  font-family: "Fraunces", serif;
  font-size: 1.3rem;
  line-height: 1;
  color: var(--ink);
}

.bubble__msg {
  display: block;
  font-size: 0.92rem;
  line-height: 1.5;
  color: var(--ink);
}

/* next-gate (button that unlocks after all three) */
.next-gate {
  max-width: 34rem;
  margin: clamp(3rem, 7vw, 4.5rem) auto 0;
  text-align: center;
}

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

.next-gate:not([hidden]) {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 560ms var(--e-out), transform 600ms var(--e-spring);
}

.next-gate.is-in {
  opacity: 1;
  transform: none;
}

.next-gate__hint {
  margin: 0 0 1.1rem;
  font-family: "Fraunces", serif;
  font-style: italic;
  font-size: clamp(1.3rem, 3vw, 1.8rem);
  color: var(--ink);
}

.things__lock-hint {
  margin: clamp(2.5rem, 6vw, 4rem) auto 0;
  width: fit-content;
  font-weight: 600;
  font-size: 0.92rem;
  color: var(--ink);
  opacity: 0.6;
}

/* ============================================================
   PAGE 3 — Invite (poem + details)
   ============================================================ */
.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  padding: 0.7rem clamp(1rem, 4vw, 2.5rem);
  background: var(--teal);
}

.topbar__title {
  font-weight: 700;
  font-size: 0.88rem;
  letter-spacing: 0.06em;
  color: var(--ink);
}

.sound-toggle {
  display: inline-grid;
  place-items: center;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  cursor: pointer;
  background: var(--ink);
  color: var(--cream);
  transition: transform var(--t-fast) var(--e-spring), background var(--t-fast) var(--e-out);
}

.sound-toggle:hover { transform: translateY(-1px); }
.sound-toggle:active { transform: scale(0.94); }
.sound-toggle:focus-visible { outline: 3px solid var(--cream); outline-offset: 3px; }
.sound-toggle.needs-gesture { animation: soundNudge 1.6s var(--e-out) infinite; }

.sound-icon {
  width: 22px;
  height: 22px;
}

.sound-icon__speaker {
  fill: currentColor;
}

.sound-icon__waves path {
  fill: none;
  stroke: var(--yellow);
  stroke-width: 1.8;
  stroke-linecap: round;
  transition: opacity var(--t-fast) var(--e-out);
}

.sound-icon__slash {
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  opacity: 0;
  transition: opacity var(--t-fast) var(--e-out);
}

/* muted state */
.sound-toggle[aria-pressed="false"] .sound-icon__waves path { opacity: 0; }
.sound-toggle[aria-pressed="false"] .sound-icon__slash { opacity: 1; }

@keyframes soundNudge {
  0%, 100% { box-shadow: 0 0 0 0 rgba(255, 218, 61, 0); }
  45% { box-shadow: 0 0 0 8px rgba(255, 218, 61, 0.22); }
}

@media (prefers-reduced-motion: reduce) {
  .sound-toggle.needs-gesture { animation: none; }
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* poem */
.poem {
  position: relative;
  padding: clamp(4rem, 10vw, 8rem) var(--pad-inline);
  background: var(--purple);
  color: var(--cream);
}

.poem__frame {
  max-width: 52rem;
  margin: 0 auto;
  text-align: center;
}

.poem__mark {
  display: block;
  margin-bottom: 1rem;
  color: var(--yellow);
  font-size: 1.6rem;
}

.poem__line {
  margin: 0;
  font-family: "Fraunces", serif;
  font-style: italic;
  font-size: clamp(1.5rem, 4vw, 2.9rem);
  line-height: 1.18;
  opacity: 0;
  transform: translateY(0.7rem);
  transition: opacity var(--t-slow) var(--e-out), transform var(--t-slow) var(--e-out);
}

.poem__line + .poem__line { margin-top: 0.6rem; }

.poem__caret {
  display: inline-block;
  width: 3px;
  height: 0.95em;
  margin-left: 0.05em;
  vertical-align: -0.1em;
  background: var(--yellow);
  border-radius: 2px;
  animation: caretBlink 950ms steps(1) infinite;
}

@keyframes caretBlink {
  50% { opacity: 0; }
}

.poem__frame.is-visible .poem__line { opacity: 1; transform: none; }
.poem__frame.is-visible .poem__line:nth-child(2) { transition-delay: 110ms; }
.poem__frame.is-visible .poem__line:nth-child(3) { transition-delay: 220ms; }
.poem__frame.is-visible .poem__line:nth-child(4) { transition-delay: 330ms; }
.poem__frame.is-visible .poem__line:nth-child(5) { transition-delay: 440ms; }
.poem__frame.is-visible .poem__line:nth-child(6) { transition-delay: 550ms; }
.poem__frame.is-visible .poem__line:nth-child(7) { transition-delay: 660ms; }
.poem__frame.is-visible .poem__line:nth-child(8) { transition-delay: 770ms; }

/* plan */
.plan {
  position: relative;
  padding: clamp(4rem, 9vw, 7rem) var(--pad-inline);
  background: var(--pink);
}

.plan__head {
  max-width: var(--maxw);
  margin: 0 auto clamp(2rem, 5vw, 3rem);
  text-align: center;
}

.plan__head .eyebrow { color: var(--red); }

.plan__head h2 {
  margin-top: 0.5rem;
  font-size: clamp(2.2rem, 6vw, 4rem);
  line-height: 1;
  color: var(--ink);
}

.plan__grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: clamp(1.2rem, 3vw, 2rem);
  max-width: var(--maxw);
  margin: 0 auto;
}

.plan-card {
  display: flex;
  flex-direction: column;
  padding: 1.6rem 1.5rem 1.7rem;
  border-radius: 1.2rem;
  background: var(--bg);
  color: var(--ink);
  box-shadow: 0 18px 40px -22px rgba(20, 61, 51, 0.5);
}

.plan-card__media {
  display: block;
  margin: -0.2rem -0.2rem 1.1rem;
  border-radius: 0.9rem;
  overflow: hidden;
  aspect-ratio: 16 / 10;
  background: rgba(20, 61, 51, 0.08);
}

.plan-card__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 600ms var(--e-out);
}

.plan-card__media:hover img {
  transform: scale(1.05);
}

.plan-card__media:focus-visible {
  outline: 3px solid var(--ink);
  outline-offset: 3px;
}

.plan-card__no {
  font-family: "Fraunces", serif;
  font-size: 1.5rem;
  opacity: 0.7;
}

.plan-card__link {
  margin-top: auto;
  padding-top: 1.1rem;
  align-self: flex-start;
  font-size: 0.88rem;
  font-weight: 600;
  text-decoration: none;
  color: var(--ink);
  border-bottom: 2px solid rgba(20, 61, 51, 0.3);
  transition: border-color var(--t-fast) var(--e-out), transform var(--t-fast) var(--e-out);
}

.plan-card__link:hover {
  transform: translateY(-1px);
  border-color: var(--ink);
}

.plan-card__link:focus-visible {
  outline: 3px solid var(--ink);
  outline-offset: 3px;
  border-radius: 3px;
}

.plan-card__time {
  margin: 0.3rem 0 1.3rem;
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  opacity: 0.7;
}

.plan-card h3 {
  margin: 0;
  font-family: "Fraunces", serif;
  font-size: 1.8rem;
  line-height: 1.02;
}

.plan-card p {
  margin: 0.7rem 0 0;
  font-size: 0.96rem;
  line-height: 1.55;
}

/* answer */
.answer {
  position: relative;
  padding: clamp(4rem, 9vw, 7rem) var(--pad-inline);
  background: var(--yellow);
  text-align: center;
}

.answer__inner {
  max-width: 40rem;
  margin: 0 auto;
}

.answer .eyebrow { color: var(--red); }

.answer h2 {
  margin-top: 0.5rem;
  font-size: clamp(2.2rem, 6vw, 4rem);
  line-height: 1;
  color: var(--ink);
}

.answer__copy {
  max-width: 30rem;
  margin: 1rem auto 0;
  font-size: 1.05rem;
  line-height: 1.6;
  color: var(--ink);
}

.answer__actions {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 0.8rem;
  margin-top: 1.9rem;
}

.soft-reply {
  min-height: 1.5rem;
  margin: 1.2rem 0 0;
  font-family: "Fraunces", serif;
  font-style: italic;
  font-size: 1.25rem;
  color: var(--red);
  opacity: 0;
  transform: translateY(0.4rem);
  transition: opacity var(--t-norm) var(--e-out), transform var(--t-norm) var(--e-out);
}

.soft-reply.is-shown {
  opacity: 1;
  transform: none;
}

.camera-input {
  position: fixed;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.smile-share {
  display: grid;
  justify-items: center;
  gap: 0.9rem;
  max-width: 24rem;
  margin: 1.2rem auto 0;
}

.smile-share[hidden] {
  display: none;
}

.smile-share img {
  width: min(100%, 16rem);
  aspect-ratio: 1;
  object-fit: cover;
  border: 5px solid var(--cream);
  border-radius: 1.2rem;
  box-shadow: 0 18px 36px -22px rgba(20, 61, 51, 0.65);
}

.smile-share p {
  margin: 0;
  font-weight: 700;
  color: var(--ink);
}

/* credits */
.credits {
  padding: clamp(3rem, 6vw, 4rem) var(--pad-inline);
  background: var(--red);
  color: rgba(255, 250, 240, 0.85);
  text-align: center;
  font-size: 0.82rem;
}

.credits a {
  color: var(--yellow);
  text-decoration: none;
  border-bottom: 1px solid rgba(255, 210, 63, 0.4);
}

/* ============================================================
   Responsive
   ============================================================ */
@media (max-width: 760px) {
  .panel-grid,
  .plan__grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 540px) {
  .panel-grid,
  .plan__grid {
    grid-template-columns: 1fr;
    max-width: 24rem;
  }

  .answer__actions .btn {
    width: 100%;
  }
}

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

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