/* =========================================================
   143-8 ? Infinite Love Experience
   Nocturne luxury ? oxblood, black cherry, moonlit blush, antique gold
   ========================================================= */

:root {
  --oxblood: #2a0614;
  --cherry: #4a1028;
  --wine: #3b0a1e;
  --wine-deep: #0a0308;
  --blush: #e8c4c4;
  --blush-soft: #f3dedc;
  --moon: #f7efe8;
  --gold: #c9a24b;
  --gold-soft: #e2c97a;
  --gold-dim: rgba(201, 162, 75, 0.35);
  --paper: #f7efe6;
  --paper-ink: #2a1520;
  --text: #f3e8e4;
  --muted: rgba(243, 232, 228, 0.58);
  --glass: rgba(255, 245, 240, 0.06);
  --glass-border: rgba(201, 162, 75, 0.28);

  --font-display: "Fraunces", Georgia, serif;
  --font-body: "DM Sans", system-ui, sans-serif;
  --font-hand: "Caveat", "Segoe Script", cursive;

  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  --radius: 22px;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: auto;
}

html.lenis,
html.lenis body {
  height: auto;
}

.lenis.lenis-smooth {
  scroll-behavior: auto !important;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font-body);
  font-weight: 300;
  color: var(--text);
  background: radial-gradient(
    120% 90% at 50% -10%,
    #5a1835 0%,
    var(--oxblood) 40%,
    var(--wine-deep) 100%
  );
  background-attachment: fixed;
  overflow-x: clip;
  -webkit-font-smoothing: antialiased;
}

img {
  max-width: 100%;
  display: block;
}

button,
input {
  font: inherit;
}

:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 3px;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.handwritten {
  font-family: var(--font-hand);
  font-weight: 400;
  letter-spacing: 0.02em;
}

.eyebrow {
  margin: 0 0 0.75rem;
  font-size: 0.72rem;
  letter-spacing: 0.32em;
  text-transform: uppercase;
  color: var(--gold);
}

.section-title {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 300;
  font-size: clamp(2rem, 6vw, 3.6rem);
  line-height: 1.12;
  color: var(--blush-soft);
}

/* ---------- overlays ---------- */
.grain,
.vignette {
  pointer-events: none;
  position: fixed;
  inset: 0;
  z-index: 50;
}

.grain {
  opacity: 0.055;
  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");
}

.vignette {
  background: radial-gradient(
    ellipse at center,
    transparent 35%,
    rgba(5, 1, 4, 0.78) 100%
  );
}

/* ---------- WebGL ---------- */
.webgl-root {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
}

.webgl-root canvas {
  width: 100%;
  height: 100%;
  display: block;
}

.webgl-fallback {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
}

.fallback-heart {
  width: min(280px, 50vw);
  aspect-ratio: 1;
  background: radial-gradient(
    circle at 35% 35%,
    rgba(232, 196, 196, 0.35),
    rgba(201, 162, 75, 0.12) 45%,
    transparent 70%
  );
  mask: radial-gradient(circle, #000 40%, transparent 72%);
  animation: soft-pulse 4s ease-in-out infinite;
}

@keyframes soft-pulse {
  0%,
  100% {
    transform: scale(1);
    opacity: 0.7;
  }
  50% {
    transform: scale(1.06);
    opacity: 1;
  }
}

/* ---------- progress rail ---------- */
.progress-rail {
  position: fixed;
  top: 50%;
  right: 1.1rem;
  transform: translateY(-50%);
  z-index: 55;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
  pointer-events: none;
}

.progress-rail__track {
  width: 2px;
  height: min(28vh, 180px);
  background: rgba(232, 196, 196, 0.15);
  border-radius: 999px;
  overflow: hidden;
}

.progress-rail__fill {
  width: 100%;
  height: 0%;
  background: linear-gradient(to bottom, var(--gold), var(--blush));
  border-radius: inherit;
  will-change: height;
}

.progress-rail__label {
  writing-mode: vertical-rl;
  font-size: 0.65rem;
  letter-spacing: 0.28em;
  color: var(--gold-dim);
  text-transform: uppercase;
}

@media (max-width: 700px) {
  .progress-rail {
    display: none;
  }
}

/* Mobile story progress ribbon */
.progress-ribbon {
  display: none;
}

@media (max-width: 767px) {
  .progress-ribbon {
    position: fixed;
    left: 1rem;
    right: 1rem;
    bottom: max(0.85rem, env(safe-area-inset-bottom));
    z-index: 55;
    display: flex;
    align-items: center;
    gap: 0.7rem;
    padding: 0.55rem 0.8rem;
    border-radius: 999px;
    background: rgba(10, 3, 8, 0.72);
    border: 1px solid rgba(201, 162, 75, 0.28);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    pointer-events: none;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
  }

  .progress-ribbon[hidden] {
    display: none !important;
  }

  .progress-ribbon__track {
    flex: 1;
    height: 3px;
    border-radius: 999px;
    overflow: hidden;
    background: rgba(232, 196, 196, 0.16);
  }

  .progress-ribbon__fill {
    width: 0%;
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, var(--gold), var(--blush));
    box-shadow: 0 0 12px rgba(201, 162, 75, 0.55);
    will-change: width;
  }

  .progress-ribbon__motif {
    flex: 0 0 auto;
    font-size: 0.62rem;
    letter-spacing: 0.22em;
    text-transform: uppercase;
    color: var(--gold-soft);
  }
}

/* ---------- sound pill ---------- */
.sound-pill {
  position: fixed;
  top: 1.1rem;
  right: 1.1rem;
  z-index: 60;
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.55rem 0.95rem;
  border-radius: 999px;
  border: 1px solid var(--glass-border);
  background: rgba(10, 3, 8, 0.72);
  color: var(--gold);
  backdrop-filter: blur(14px);
  cursor: pointer;
  transition: transform 0.3s var(--ease-out), border-color 0.3s, background 0.3s;
}

.sound-pill:hover {
  transform: scale(1.04);
  border-color: var(--gold);
}

.sound-pill[aria-pressed="true"] {
  background: rgba(201, 162, 75, 0.16);
}

.sound-pill__text {
  font-size: 0.72rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.sound-pill__eq {
  display: flex;
  align-items: flex-end;
  gap: 2px;
  height: 12px;
}

.sound-pill__eq i {
  display: block;
  width: 2px;
  height: 4px;
  background: var(--gold);
  border-radius: 1px;
  opacity: 0.45;
}

.sound-pill[aria-pressed="true"] .sound-pill__eq i {
  opacity: 1;
  animation: eq 0.8s ease-in-out infinite;
}

.sound-pill[aria-pressed="true"] .sound-pill__eq i:nth-child(2) {
  animation-delay: 0.15s;
}

.sound-pill[aria-pressed="true"] .sound-pill__eq i:nth-child(3) {
  animation-delay: 0.3s;
}

@keyframes eq {
  0%,
  100% {
    height: 4px;
  }
  50% {
    height: 12px;
  }
}

/* ---------- GATE ---------- */
.gate {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  padding: 1.5rem;
  background:
    radial-gradient(70% 50% at 50% 20%, rgba(90, 24, 53, 0.65), transparent 70%),
    var(--wine-deep);
  transition: opacity 1.1s var(--ease-out), visibility 1.1s;
}

.gate.is-leaving {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.gate__stars {
  position: absolute;
  inset: 0;
  background-image: radial-gradient(1.5px 1.5px at 20% 30%, rgba(255, 240, 230, 0.7), transparent),
    radial-gradient(1px 1px at 70% 20%, rgba(226, 201, 122, 0.8), transparent),
    radial-gradient(1.5px 1.5px at 40% 70%, rgba(255, 240, 230, 0.55), transparent),
    radial-gradient(1px 1px at 85% 60%, rgba(232, 196, 196, 0.7), transparent),
    radial-gradient(1px 1px at 15% 80%, rgba(226, 201, 122, 0.5), transparent),
    radial-gradient(1.5px 1.5px at 55% 45%, rgba(255, 255, 255, 0.45), transparent);
  animation: twinkle 6s ease-in-out infinite;
  pointer-events: none;
}

@keyframes twinkle {
  0%,
  100% {
    opacity: 0.55;
  }
  50% {
    opacity: 1;
  }
}

.gate__constellation {
  position: absolute;
  top: 12%;
  left: 50%;
  transform: translateX(-50%);
  width: min(320px, 80vw);
  color: rgba(201, 162, 75, 0.55);
  pointer-events: none;
}

.constellation-line {
  stroke-dasharray: 400;
  stroke-dashoffset: 400;
  animation: draw-line 2.8s var(--ease-out) 0.4s forwards;
}

@keyframes draw-line {
  to {
    stroke-dashoffset: 0;
  }
}

.gate__glass {
  position: relative;
  width: min(440px, 100%);
  padding: 2.5rem 1.75rem;
  text-align: center;
  border-radius: 28px;
  background: linear-gradient(160deg, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0.02));
  border: 1px solid var(--glass-border);
  box-shadow:
    0 30px 80px rgba(0, 0, 0, 0.45),
    inset 0 1px 0 rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(18px);
}

.gate__eyebrow {
  margin: 0 0 0.5rem;
  font-size: 1.4rem;
  color: var(--gold-soft);
}

.gate__title {
  margin: 0 0 1.1rem;
  font-family: var(--font-display);
  font-weight: 300;
  font-size: clamp(2.4rem, 8vw, 3.5rem);
  color: var(--blush-soft);
}

.gate__hint {
  margin: 0 0 1.5rem;
  color: var(--muted);
  font-size: 0.95rem;
}

.gate__form {
  display: flex;
  gap: 0.65rem;
  justify-content: center;
  flex-wrap: wrap;
}

.gate__input-wrap {
  position: relative;
  width: min(220px, 100%);
}

.gate__input {
  width: 100%;
  padding: 0.95rem 1.15rem;
  border-radius: 999px;
  border: 1px solid rgba(232, 196, 196, 0.25);
  background: rgba(255, 255, 255, 0.04);
  color: transparent;
  -webkit-text-fill-color: transparent;
  caret-color: var(--gold-soft);
  text-align: center;
  letter-spacing: 0;
  outline: none;
  transition: border-color 0.25s, box-shadow 0.25s;
}

.gate__input:focus {
  border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(201, 162, 75, 0.18);
}

.gate__input::placeholder {
  letter-spacing: 0.08em;
  color: rgba(243, 232, 228, 0.3);
  -webkit-text-fill-color: rgba(243, 232, 228, 0.3);
}

.gate__hearts {
  position: absolute;
  inset: 0.2rem 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.42rem;
  pointer-events: none;
  overflow: hidden;
}

.gate__heart {
  display: inline-block;
  color: var(--blush);
  font-size: 0.72rem;
  line-height: 1;
  text-shadow:
    0 0 6px rgba(255, 150, 180, 0.8),
    0 0 14px rgba(201, 162, 75, 0.45);
  animation: pin-heart-in 0.28s var(--ease-out) both;
}

@keyframes pin-heart-in {
  from {
    opacity: 0;
    transform: translateY(5px) scale(0.25) rotate(-18deg);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1) rotate(0);
  }
}

.gate__btn {
  padding: 0.95rem 1.6rem;
  border-radius: 999px;
  border: none;
  background: linear-gradient(135deg, var(--gold), #a87f2e);
  color: var(--wine-deep);
  font-weight: 500;
  letter-spacing: 0.06em;
  cursor: pointer;
  transition: transform 0.25s var(--ease-out), filter 0.25s;
}

.gate__btn:hover {
  transform: translateY(-1px);
  filter: brightness(1.06);
}

.gate__error {
  margin: 1rem 0 0;
  color: var(--blush);
  font-size: 0.92rem;
}

.gate.is-shake .gate__glass {
  animation: shake 0.45s ease;
}

@keyframes shake {
  0%,
  100% {
    transform: translateX(0);
  }
  20% {
    transform: translateX(-10px);
  }
  40% {
    transform: translateX(10px);
  }
  60% {
    transform: translateX(-7px);
  }
  80% {
    transform: translateX(7px);
  }
}

/* ---------- experience ---------- */
.experience {
  position: relative;
  z-index: 1;
}

.experience[hidden] {
  display: none !important;
}

.section {
  position: relative;
  padding: clamp(4rem, 10vh, 7rem) 1.25rem;
}

/* gold thread */
.gold-thread {
  position: fixed;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 1px;
  height: 100vh;
  z-index: 2;
  pointer-events: none;
  background: rgba(201, 162, 75, 0.08);
  opacity: 0.5;
}

.gold-thread__fill {
  width: 100%;
  height: 0%;
  background: linear-gradient(to bottom, transparent, var(--gold), transparent);
  box-shadow: 0 0 12px rgba(201, 162, 75, 0.4);
}

@media (max-width: 700px) {
  .gold-thread {
    display: none;
  }
}

/* petals */
.petals {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 3;
  overflow: hidden;
}

.petal {
  position: absolute;
  top: -40px;
  width: 12px;
  height: 18px;
  border-radius: 70% 0 70% 0;
  background: linear-gradient(135deg, var(--blush), rgba(201, 162, 75, 0.55));
  opacity: 0.4;
  will-change: transform;
}

/* ---------- HERO ---------- */
.hero {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding-top: 8vh;
}

.hero__seal {
  margin-bottom: 2rem;
}

.envelope {
  position: relative;
  width: 140px;
  height: 96px;
  margin: 0 auto;
  perspective: 600px;
}

.envelope__body {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, #6b2340, #3b0a1e);
  border: 1px solid rgba(201, 162, 75, 0.35);
  border-radius: 6px;
  display: grid;
  place-items: center;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.35);
}

.envelope__flap {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 52px;
  background: linear-gradient(180deg, #8a2f52, #5c1230);
  clip-path: polygon(0 0, 50% 100%, 100% 0);
  transform-origin: top center;
  transform: rotateX(0deg);
  transition: transform 1.2s cubic-bezier(0.22, 1, 0.36, 1);
  z-index: 2;
  border-top: 1px solid rgba(201, 162, 75, 0.3);
  backface-visibility: hidden;
}

.envelope.is-open .envelope__flap {
  transform: rotateX(-160deg);
}

.envelope__wax {
  position: relative;
  z-index: 3;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: radial-gradient(circle at 35% 30%, #e2c97a, var(--gold) 55%, #8a6a22);
  color: var(--wine-deep);
  font-family: var(--font-display);
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.35);
}

.hero__motif {
  margin: 0 0 0.75rem;
  font-size: 0.85rem;
  letter-spacing: 0.45em;
  text-transform: uppercase;
  color: var(--gold);
}

.hero__title {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 300;
  font-size: clamp(2.8rem, 10vw, 5.4rem);
  line-height: 1.05;
  color: var(--blush-soft);
  text-shadow: 0 0 60px rgba(232, 196, 196, 0.25);
}

.hero__title em {
  font-style: italic;
  color: var(--moon);
}

.hero__sub {
  margin: 1rem 0 0;
  font-size: clamp(1.4rem, 4vw, 1.95rem);
  color: var(--gold-soft);
}

.scroll-cue {
  position: absolute;
  bottom: 2.5rem;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.6rem;
  color: var(--muted);
  font-size: 0.72rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
}

.scroll-cue__line {
  width: 1px;
  height: 42px;
  background: linear-gradient(to bottom, var(--gold), transparent);
  animation: pulse-line 2.2s ease-in-out infinite;
}

@keyframes pulse-line {
  0%,
  100% {
    opacity: 0.35;
    transform: scaleY(0.85);
  }
  50% {
    opacity: 1;
    transform: scaleY(1);
  }
}

/* ---------- LETTER ---------- */
.letter-section {
  padding-top: 2rem;
  padding-bottom: 2rem;
  min-height: 100vh;
}

.letter-pin {
  min-height: 100vh;
  display: grid;
  place-items: center;
}

.letter-card {
  width: min(580px, 100%);
  padding: clamp(1.75rem, 5vw, 2.85rem);
  background: linear-gradient(
    145deg,
    rgba(255, 250, 244, 0.96),
    rgba(247, 239, 230, 0.92)
  );
  color: var(--paper-ink);
  border-radius: 6px 22px 6px 22px;
  box-shadow:
    0 30px 70px rgba(0, 0, 0, 0.4),
    inset 0 0 0 1px rgba(201, 162, 75, 0.2);
  position: relative;
  backdrop-filter: blur(4px);
}

.letter-card::before {
  content: "";
  position: absolute;
  inset: 12px;
  border: 1px solid rgba(201, 162, 75, 0.28);
  border-radius: 2px 14px 2px 14px;
  pointer-events: none;
}

.letter-card__greeting {
  margin: 0 0 1.4rem;
  font-family: var(--font-display);
  font-size: 1.4rem;
  font-style: italic;
  color: var(--wine);
}

.letter-chapter {
  margin-bottom: 1.5rem;
}

.letter-chapter__title {
  margin: 0 0 0.65rem;
  font-family: var(--font-hand);
  font-size: 1.35rem;
  color: var(--gold);
  opacity: 0;
  transform: translateY(10px);
}

.letter-chapter__lines {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.letter-line {
  margin: 0;
  font-size: clamp(0.98rem, 2.6vw, 1.12rem);
  line-height: 1.65;
  opacity: 0;
  transform: translateY(14px);
}

.letter-card__closing {
  margin: 1.5rem 0 0.35rem;
  font-family: var(--font-display);
  font-style: italic;
  color: #5c1230;
  opacity: 0;
}

.letter-card__signature {
  margin: 0;
  font-size: 1.55rem;
  color: var(--wine);
  opacity: 0;
}

/* ---------- MEMORY PORTALS ---------- */
.memories {
  padding-top: 4rem;
}

.memories__header {
  text-align: center;
  margin-bottom: 2rem;
}

.memories__note {
  margin: 0.85rem 0 0;
  font-size: 1.45rem;
  color: var(--gold-soft);
}

.portal-list {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.portal {
  position: relative;
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 3rem 1.25rem;
}

.portal__inner {
  position: relative;
  isolation: isolate;
  width: min(920px, 100%);
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.5rem;
  align-items: center;
}

@media (min-width: 800px) {
  .portal__inner {
    grid-template-columns: 1.1fr 0.9fr;
    gap: 2.5rem;
  }

  .portal:nth-child(even) .portal__inner {
    grid-template-columns: 0.9fr 1.1fr;
  }

  .portal:nth-child(even) .portal__media {
    order: 2;
  }
}

.portal__media {
  position: relative;
  z-index: 2;
  overflow: hidden;
  border-radius: var(--radius);
  aspect-ratio: 3 / 4;
  box-shadow:
    0 30px 70px rgba(0, 0, 0, 0.5),
    0 0 0 1px rgba(201, 162, 75, 0.28),
    inset 0 0 60px rgba(201, 162, 75, 0.08);
}

.portal__media::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(
    180deg,
    rgba(201, 162, 75, 0.08),
    transparent 30%,
    rgba(10, 3, 8, 0.35)
  );
  pointer-events: none;
  z-index: 2;
}

.portal__mask {
  position: absolute;
  inset: 0;
  overflow: hidden;
  clip-path: none;
  transform: none;
  transform-origin: 50% 48%;
  will-change: clip-path, transform, filter;
  background: rgba(20, 6, 14, 0.18);
}

.portal__img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center top;
  display: block;
  will-change: transform;
  filter: saturate(1.05) contrast(1.02);
}

.portal__glow {
  position: absolute;
  inset: -20%;
  background: radial-gradient(
    circle at 30% 20%,
    rgba(201, 162, 75, 0.22),
    transparent 55%
  );
  pointer-events: none;
  z-index: 3;
  opacity: 0.6;
  mix-blend-mode: screen;
}

.portal__heart-bloom {
  position: absolute;
  left: 50%;
  top: 50%;
  width: min(72%, 390px);
  height: auto;
  z-index: 6;
  overflow: visible;
  pointer-events: none;
  transform: translate(-50%, -50%);
  transform-origin: center;
  opacity: 0;
  filter:
    drop-shadow(0 0 8px rgba(255, 207, 219, 0.9))
    drop-shadow(0 0 22px rgba(201, 162, 75, 0.7));
  will-change: transform, opacity, filter;
}

.portal__heart-bloom path {
  fill: rgba(255, 200, 220, 0.035);
  stroke: var(--gold-soft);
  stroke-width: 0.8;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-dasharray: 280;
  stroke-dashoffset: 280;
  vector-effect: non-scaling-stroke;
}

.portal__source {
  position: absolute;
  left: var(--source-x);
  top: var(--source-y);
  z-index: 7;
  display: flex;
  align-items: center;
  gap: 0.45rem;
  color: rgba(255, 240, 220, 0.95);
  pointer-events: none;
  opacity: 0;
  translate: -50% -50%;
  transform-origin: center;
  filter:
    drop-shadow(0 0 7px rgba(255, 200, 220, 0.9))
    drop-shadow(0 0 18px rgba(201, 162, 75, 0.7));
  will-change: transform, opacity, filter;
}

.portal__source-pulse {
  position: relative;
  width: 8px;
  height: 8px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: #fff6e5;
  box-shadow:
    0 0 0 1px rgba(201, 162, 75, 0.8),
    0 0 12px rgba(255, 200, 220, 0.95);
}

.portal__source-pulse::before,
.portal__source-pulse::after {
  content: "";
  position: absolute;
  inset: -6px;
  border: 1px solid rgba(226, 201, 122, 0.65);
  border-radius: 50%;
  animation: source-ripple 1.8s ease-out infinite;
}

.portal__source-pulse::after {
  animation-delay: 0.6s;
}

.portal__source b {
  max-width: 120px;
  font-family: var(--font-hand);
  font-size: 1rem;
  font-weight: 400;
  line-height: 1;
  white-space: nowrap;
  text-shadow: 0 1px 10px rgba(10, 3, 8, 0.9);
}

@keyframes source-ripple {
  0% {
    opacity: 0.9;
    transform: scale(0.35);
  }
  100% {
    opacity: 0;
    transform: scale(1.7);
  }
}

.portal__chapter {
  position: absolute;
  top: 1rem;
  left: 1rem;
  z-index: 4;
  font-family: var(--font-display);
  font-size: 0.85rem;
  letter-spacing: 0.2em;
  color: var(--gold);
  background: rgba(10, 3, 8, 0.45);
  backdrop-filter: blur(8px);
  padding: 0.35rem 0.7rem;
  border-radius: 999px;
  border: 1px solid rgba(201, 162, 75, 0.3);
}

.portal__caption h3 {
  margin: 0 0 0.5rem;
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(1.45rem, 3.5vw, 2rem);
  color: var(--blush-soft);
}

.portal__caption {
  position: relative;
  z-index: 4;
  transform-style: preserve-3d;
  transform-origin: center center;
  backface-visibility: hidden;
  will-change: transform, opacity, filter;
}

.portal__caption::before {
  content: "";
  position: absolute;
  inset: -1.4rem -1.5rem;
  z-index: -1;
  border: 1px solid rgba(201, 162, 75, 0.2);
  border-radius: 22px 5px 22px 5px;
  background:
    linear-gradient(135deg, rgba(67, 14, 35, 0.58), rgba(10, 3, 8, 0.34)),
    radial-gradient(circle at 15% 20%, rgba(255, 200, 220, 0.1), transparent 45%);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.08),
    0 24px 70px rgba(0, 0, 0, 0.2);
  backdrop-filter: blur(10px);
  opacity: 0;
  transform: translateZ(-20px) scale(0.94);
  transition: opacity 0.8s var(--ease-out), transform 0.8s var(--ease-out);
}

.portal.is-active .portal__caption::before {
  opacity: 1;
  transform: translateZ(-20px) scale(1);
}

.portal__caption > * {
  position: relative;
  transform-style: preserve-3d;
  backface-visibility: hidden;
  will-change: transform, opacity, letter-spacing;
}

.portal__word {
  display: inline-block;
  transform-style: preserve-3d;
  backface-visibility: hidden;
  will-change: transform, opacity, filter;
}

.portal__semantic-trails {
  position: absolute;
  inset: 0;
  z-index: 3;
  width: 100%;
  height: 100%;
  overflow: visible;
  pointer-events: none;
}

.portal__semantic-trails path {
  fill: none;
  stroke: rgba(226, 201, 122, 0.82);
  stroke-width: 1.15;
  stroke-linecap: round;
  opacity: 0;
  vector-effect: non-scaling-stroke;
  filter:
    drop-shadow(0 0 3px rgba(255, 235, 205, 0.9))
    drop-shadow(0 0 8px rgba(201, 162, 75, 0.65));
}

.portal__semantic-trails path[data-trail="note"] {
  stroke: rgba(255, 190, 211, 0.72);
  stroke-width: 0.85;
}

.portal__caption p {
  margin: 0;
  color: var(--muted);
  font-size: 1.02rem;
  line-height: 1.55;
}

.portal__caption .handwritten {
  display: block;
  margin-top: 0.75rem;
  font-size: 1.4rem;
  color: var(--gold-soft);
}

/* ---------- MEANING / INFINITY ---------- */
.meaning {
  text-align: center;
  padding-top: 5rem;
  padding-bottom: 5rem;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.meaning__digits {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: clamp(1rem, 4vw, 2rem);
  margin: 2.75rem 0 1.5rem;
}

.meaning-item {
  width: min(110px, 22vw);
  opacity: 0;
  transform: translateY(24px);
}

.meaning-item.is-eight {
  display: none;
}

.meaning-item__digit {
  display: grid;
  place-items: center;
  width: 100%;
  aspect-ratio: 1;
  margin-bottom: 0.75rem;
  border-radius: 50%;
  border: 1px solid rgba(201, 162, 75, 0.4);
  background: radial-gradient(
    circle at 35% 30%,
    rgba(201, 162, 75, 0.22),
    rgba(59, 10, 30, 0.55)
  );
  font-family: var(--font-display);
  font-size: clamp(2rem, 6vw, 2.8rem);
  font-weight: 500;
  color: var(--gold);
  box-shadow: 0 0 40px rgba(201, 162, 75, 0.12);
}

.meaning-item__word {
  margin: 0;
  font-family: var(--font-hand);
  font-size: 1.5rem;
  color: var(--blush);
}

.infinity-stage {
  position: relative;
  width: 140px;
  height: 140px;
  margin: 0.5rem auto 1.75rem;
  display: grid;
  place-items: center;
}

.digit-eight,
.digit-infinity {
  position: absolute;
  font-family: var(--font-display);
  font-size: clamp(4.5rem, 14vw, 6.5rem);
  font-weight: 300;
  color: var(--gold);
  text-shadow: 0 0 40px rgba(201, 162, 75, 0.45);
  will-change: transform, opacity;
  pointer-events: none;
}

.digit-eight {
  opacity: 1;
  transform: rotate(0deg) scale(1);
}

.digit-infinity {
  opacity: 0;
  transform: rotate(-90deg) scale(0.85);
}

.infinity-stage.is-transformed .digit-eight {
  opacity: 0;
  transform: rotate(90deg) scale(0.85);
}

.infinity-stage.is-transformed .digit-infinity {
  opacity: 1;
  transform: rotate(0deg) scale(1);
}

.digit-eight,
.digit-infinity {
  transition: opacity 1.1s var(--ease-out), transform 1.1s var(--ease-out);
}

.meaning__note {
  max-width: 520px;
  margin: 0 auto;
  color: var(--muted);
  font-size: 1.08rem;
  line-height: 1.75;
  opacity: 0;
}

/* ---------- FINALE ---------- */
.finale {
  min-height: 100vh;
  display: grid;
  place-items: center;
  text-align: center;
  padding-bottom: 6rem;
}

.finale__inner {
  position: relative;
  width: min(640px, 100%);
}

.finale__title {
  margin-bottom: 2.5rem;
}

.hold-btn {
  position: relative;
  z-index: 80;
  width: 170px;
  height: 170px;
  margin: 0 auto;
  border: none;
  background: transparent;
  color: var(--blush-soft);
  cursor: pointer;
  display: grid;
  place-items: center;
  -webkit-user-select: none;
  user-select: none;
  touch-action: none;
  -webkit-tap-highlight-color: transparent;
  isolation: isolate;
}

.hold-btn > * {
  pointer-events: none;
}

.hold-btn__ring {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  transform: rotate(-90deg);
}

.hold-btn__track,
.hold-btn__progress {
  fill: none;
  stroke-width: 2.5;
}

.hold-btn__track {
  stroke: rgba(232, 196, 196, 0.18);
}

.hold-btn__progress {
  stroke: var(--gold);
  stroke-linecap: round;
  stroke-dasharray: 327;
  stroke-dashoffset: 327;
  filter: drop-shadow(0 0 8px rgba(201, 162, 75, 0.5));
  transition: none;
}

.hold-btn__heart {
  font-size: 2.4rem;
  color: var(--blush);
  filter: drop-shadow(0 0 18px rgba(232, 196, 196, 0.55));
  z-index: 1;
  transition: transform 0.25s var(--ease-out);
}

.hold-btn.is-holding .hold-btn__heart {
  transform: scale(1.15);
}

.hold-btn__label {
  position: absolute;
  bottom: -2.1rem;
  left: 50%;
  transform: translateX(-50%);
  white-space: nowrap;
  font-size: 0.75rem;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--muted);
}

.hold-btn[hidden] {
  display: none;
}

.finale-reveal {
  margin-top: 1.25rem;
}

.finale-reveal[hidden] {
  display: none;
}

.finale-reveal.is-visible {
  display: block;
  animation: fade-up 1.1s var(--ease-out) both;
}

.finale-reveal__message {
  margin: 0 0 1rem;
  font-family: var(--font-display);
  font-weight: 300;
  font-size: clamp(1.65rem, 5vw, 2.5rem);
  line-height: 1.3;
  color: var(--moon);
  text-shadow: 0 0 40px rgba(232, 196, 196, 0.2);
}

.finale-reveal__sub {
  margin: 0;
  font-size: clamp(1.25rem, 3.5vw, 1.7rem);
  color: var(--gold-soft);
  line-height: 1.45;
}

.finale-reveal__motif {
  margin: 2rem 0 0;
  letter-spacing: 0.4em;
  color: var(--gold);
  font-size: 0.9rem;
}

@keyframes fade-up {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.heart-burst {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: visible;
}

.burst-heart {
  position: absolute;
  left: 50%;
  top: 45%;
  font-size: 1rem;
  color: var(--blush);
  opacity: 0;
  will-change: transform, opacity;
}

.site-footer {
  text-align: center;
  padding: 2rem 1rem 3.5rem;
  color: var(--muted);
  font-size: 1.25rem;
}

/* ---------- reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  .scroll-cue__line,
  .gate__stars,
  .constellation-line,
  .fallback-heart,
  .sound-pill__eq i {
    animation: none !important;
  }

  .letter-line,
  .letter-chapter__title,
  .letter-card__closing,
  .letter-card__signature,
  .meaning-item,
  .meaning__note {
    opacity: 1 !important;
    transform: none !important;
  }

  .portal__mask {
    clip-path: inset(0 0 0 0) !important;
  }

  .digit-eight {
    display: none;
  }

  .digit-infinity {
    opacity: 1 !important;
    transform: none !important;
  }
}

/* =========================================================
   Cinematic Visual Polish ? loader, letterbox, portals, flare
   ========================================================= */

.loader {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: grid;
  place-items: center;
  background: radial-gradient(70% 50% at 50% 40%, #3b0a1e, #0a0308 75%);
  transition: opacity 0.9s var(--ease-out), visibility 0.9s;
}

.loader.is-done {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.loader__dust {
  position: absolute;
  inset: 0;
  background-image:
    radial-gradient(1.5px 1.5px at 20% 30%, rgba(226, 201, 122, 0.7), transparent),
    radial-gradient(1px 1px at 70% 45%, rgba(232, 196, 196, 0.6), transparent),
    radial-gradient(1.5px 1.5px at 40% 70%, rgba(255, 240, 230, 0.5), transparent),
    radial-gradient(1px 1px at 85% 25%, rgba(201, 162, 75, 0.65), transparent);
  animation: twinkle 3.5s ease-in-out infinite;
  pointer-events: none;
}

.loader__inner {
  position: relative;
  text-align: center;
}

.loader__ring {
  width: 64px;
  height: 64px;
  margin: 0 auto 1.25rem;
  border-radius: 50%;
  border: 1px solid rgba(201, 162, 75, 0.25);
  border-top-color: var(--gold);
  animation: spin 1.1s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.loader__motif {
  margin: 0 0 0.4rem;
  letter-spacing: 0.4em;
  font-size: 0.8rem;
  color: var(--gold);
}

.loader__text {
  margin: 0;
  font-size: 1.35rem;
  color: var(--blush);
}

.aurora {
  position: fixed;
  inset: -10%;
  z-index: 0;
  pointer-events: none;
  background:
    radial-gradient(40% 35% at 20% 20%, rgba(90, 24, 53, 0.45), transparent 70%),
    radial-gradient(35% 40% at 80% 70%, rgba(201, 162, 75, 0.12), transparent 70%),
    radial-gradient(45% 30% at 50% 90%, rgba(232, 196, 196, 0.1), transparent 70%);
  animation: aurora-drift 18s ease-in-out infinite alternate;
  opacity: 0.85;
}

@keyframes aurora-drift {
  from { transform: translate3d(-2%, -1%, 0) scale(1); }
  to { transform: translate3d(2%, 1%, 0) scale(1.05); }
}

.ambient-light {
  position: fixed;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background: radial-gradient(50% 40% at 50% 45%, rgba(201, 162, 75, 0.08), transparent 70%);
  opacity: 0.6;
  transition: opacity 0.8s var(--ease-out), background 0.8s;
  overflow: hidden;
}

.ambient-light::before,
.ambient-light::after {
  content: "";
  position: absolute;
  pointer-events: none;
  opacity: 0;
  transition: opacity 1.4s var(--ease-out), transform 1.8s var(--ease-out);
}

.ambient-light::before {
  inset: 26% -12%;
  background: linear-gradient(
    90deg,
    transparent 8%,
    rgba(255, 184, 205, 0.025) 30%,
    rgba(226, 201, 122, 0.13) 50%,
    rgba(255, 184, 205, 0.025) 70%,
    transparent 92%
  );
  filter: blur(22px);
  transform: rotate(-4deg) scaleX(0.78);
  mix-blend-mode: screen;
}

.ambient-light::after {
  width: min(52vw, 760px);
  aspect-ratio: 1;
  left: 50%;
  top: 50%;
  border-radius: 50%;
  background:
    radial-gradient(circle, transparent 28%, rgba(255, 200, 220, 0.055) 46%, transparent 70%),
    conic-gradient(from 20deg, transparent, rgba(201, 162, 75, 0.08), transparent 24%, transparent 76%, rgba(255, 200, 220, 0.07), transparent);
  filter: blur(12px);
  transform: translate(-50%, -50%) scale(0.72) rotate(-14deg);
  mix-blend-mode: screen;
}

.ambient-light.is-vow {
  background: radial-gradient(45% 40% at 50% 50%, rgba(232, 196, 196, 0.14), transparent 70%);
}

.ambient-light.is-memories {
  background: radial-gradient(40% 45% at 30% 50%, rgba(201, 162, 75, 0.1), transparent 65%);
}

.ambient-light.is-code {
  background: radial-gradient(50% 40% at 50% 45%, rgba(226, 201, 122, 0.16), transparent 70%);
}

.ambient-light.is-finale {
  background:
    radial-gradient(48% 38% at 50% 50%, rgba(255, 200, 220, 0.14), transparent 68%),
    radial-gradient(70% 55% at 50% 52%, rgba(201, 162, 75, 0.055), transparent 76%);
  opacity: 0.88;
}

.ambient-light.is-finale::before {
  opacity: 0.72;
  transform: rotate(-1.5deg) scaleX(1);
}

.ambient-light.is-finale::after {
  opacity: 0.8;
  transform: translate(-50%, -50%) scale(1) rotate(8deg);
}

.letterbox {
  position: fixed;
  inset: 0;
  z-index: 45;
  pointer-events: none;
}

.letterbox__top,
.letterbox__bottom {
  position: absolute;
  left: 0;
  right: 0;
  height: clamp(18px, 3.5vh, 36px);
  background: #050104;
  opacity: 0.85;
}

.letterbox__top { top: 0; }
.letterbox__bottom { bottom: 0; }

@media (max-width: 700px) {
  .letterbox {
    display: block;
  }

  .letterbox__top,
  .letterbox__bottom {
    height: max(10px, env(safe-area-inset-top, 10px));
    opacity: 0.55;
  }

  .letterbox__bottom {
    height: max(10px, env(safe-area-inset-bottom, 10px));
  }
}

.transition-flare {
  position: fixed;
  inset: 0;
  z-index: 48;
  pointer-events: none;
  background: radial-gradient(circle at 50% 50%, rgba(255, 240, 230, 0.35), transparent 55%);
  opacity: 0;
  mix-blend-mode: screen;
}

.transition-flare.is-flash {
  animation: flare 0.9s var(--ease-out);
}

@keyframes flare {
  0% { opacity: 0; }
  30% { opacity: 0.55; }
  100% { opacity: 0; }
}

.chapter-indicator {
  position: fixed;
  top: 1.2rem;
  left: 1.2rem;
  z-index: 55;
  display: flex;
  align-items: baseline;
  gap: 0.65rem;
  padding: 0.45rem 0.85rem;
  border-radius: 999px;
  background: rgba(10, 3, 8, 0.55);
  border: 1px solid rgba(201, 162, 75, 0.25);
  backdrop-filter: blur(12px);
  pointer-events: none;
}

.chapter-indicator__num {
  font-family: var(--font-display);
  font-size: 0.78rem;
  letter-spacing: 0.12em;
  color: var(--gold);
}

.chapter-indicator__label {
  font-size: 0.7rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--muted);
}

@media (max-width: 700px) {
  .chapter-indicator {
    top: max(0.85rem, env(safe-area-inset-top));
    bottom: auto;
    left: 0.85rem;
    transform: none;
  }
}

.hero__light {
  position: absolute;
  width: min(480px, 80vw);
  height: min(480px, 80vw);
  border-radius: 50%;
  background: radial-gradient(circle, rgba(201, 162, 75, 0.18), transparent 70%);
  filter: blur(10px);
  pointer-events: none;
  z-index: -1;
  animation: soft-pulse 5s ease-in-out infinite;
}

.letter-card__glint {
  position: absolute;
  top: 0;
  left: -40%;
  width: 40%;
  height: 100%;
  background: linear-gradient(100deg, transparent, rgba(255, 255, 255, 0.28), transparent);
  transform: skewX(-18deg);
  pointer-events: none;
  animation: glint 7s ease-in-out infinite;
}

@keyframes glint {
  0%, 70% { left: -40%; opacity: 0; }
  75% { opacity: 0.7; }
  100% { left: 120%; opacity: 0; }
}

.meaning__glow {
  position: absolute;
  width: min(420px, 70vw);
  height: min(420px, 70vw);
  border-radius: 50%;
  background: radial-gradient(circle, rgba(201, 162, 75, 0.2), transparent 68%);
  filter: blur(8px);
  pointer-events: none;
  z-index: -1;
}

/* Portal cinematic upgrades */
.portal {
  perspective: 1200px;
}

.portal__media {
  transform-style: preserve-3d;
  transition: box-shadow 0.5s;
}

.portal.is-active .portal__media {
  box-shadow:
    0 35px 80px rgba(0, 0, 0, 0.55),
    0 0 0 1px rgba(201, 162, 75, 0.4),
    0 0 80px rgba(201, 162, 75, 0.15);
}

.portal__frame {
  position: absolute;
  inset: 8px;
  border: 1px solid rgba(201, 162, 75, 0.35);
  border-radius: calc(var(--radius) - 6px);
  pointer-events: none;
  z-index: 5;
  box-shadow: inset 0 0 30px rgba(201, 162, 75, 0.08);
}

.portal__edge {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 4;
  background:
    linear-gradient(90deg, rgba(201, 162, 75, 0.25), transparent 18%, transparent 82%, rgba(201, 162, 75, 0.2)),
    linear-gradient(180deg, rgba(255, 245, 230, 0.12), transparent 20%, transparent 80%, rgba(10, 3, 8, 0.35));
  mix-blend-mode: soft-light;
}

.portal__mask {
  clip-path: none;
}

.portal__caption {
  opacity: 1;
  transform: none;
}

.portal__caption .line {
  display: block;
  overflow: hidden;
}

@media (max-width: 700px) {
  .aurora {
    opacity: 0.68;
    animation: aurora-drift 22s ease-in-out infinite alternate;
  }
  .ambient-light::before {
    inset: 31% -25%;
    filter: blur(18px);
  }
  .ambient-light::after {
    width: 90vw;
  }
  .letter-card__glint {
    opacity: 0.55;
  }
  .portal {
    perspective: 900px;
  }
  .portal__heart-bloom {
    width: min(78vw, 360px);
  }
  .portal__source {
    gap: 0.32rem;
  }
  .portal__source b {
    max-width: 90px;
    font-size: 0.82rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  .loader__ring,
  .aurora,
  .letter-card__glint,
  .hero__light,
  .ambient-light::before,
  .ambient-light::after,
  .portal__heart-bloom,
  .portal__source-pulse::before,
  .portal__source-pulse::after,
  .transition-flare.is-flash {
    animation: none !important;
    transition: none !important;
  }
  .loader__ring { border-top-color: var(--gold); }
}

/* =========================================================
   Portrait experience ? definitive phone composition
   ========================================================= */
@media (max-width: 767px) {
  body {
    background:
      radial-gradient(120% 70% at 50% -8%, #5a1835 0%, transparent 62%),
      radial-gradient(90% 50% at 80% 100%, rgba(201, 162, 75, 0.08), transparent 55%),
      #0a0308;
    background-attachment: scroll;
  }

  .section {
    padding-inline: 1rem;
  }

  .webgl-root {
    height: 100dvh;
  }

  .webgl-root canvas {
    opacity: 0.92;
  }

  .sound-pill {
    top: max(0.75rem, env(safe-area-inset-top));
    right: 0.75rem;
    padding: 0.55rem 0.78rem;
    border-color: rgba(201, 162, 75, 0.35);
    background: rgba(10, 3, 8, 0.72);
  }

  .sound-pill__text {
    display: none;
  }

  .chapter-indicator {
    top: max(0.85rem, env(safe-area-inset-top));
    bottom: auto;
    left: 0.85rem;
    right: auto;
    transform: none;
    min-width: 0;
    justify-content: flex-start;
    background: rgba(10, 3, 8, 0.78);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.28);
  }

  .gate {
    padding:
      max(1.25rem, env(safe-area-inset-top))
      1rem
      max(1.5rem, env(safe-area-inset-bottom));
  }

  .gate__glass {
    width: min(420px, 100%);
    padding: 2.35rem 1.25rem 1.85rem;
    border-radius: 28px;
    border-color: rgba(201, 162, 75, 0.34);
    background:
      linear-gradient(160deg, rgba(67, 14, 35, 0.72), rgba(10, 3, 8, 0.78)),
      rgba(255, 245, 240, 0.04);
    box-shadow:
      0 28px 70px rgba(0, 0, 0, 0.45),
      inset 0 1px 0 rgba(255, 255, 255, 0.08);
  }

  .gate__eyebrow {
    font-size: 1.55rem;
  }

  .gate__title {
    font-size: clamp(2.55rem, 11vw, 3.35rem);
    line-height: 1.05;
  }

  .gate__hint {
    font-size: 0.98rem;
    margin-bottom: 1.65rem;
  }

  .gate__form {
    flex-direction: column;
    align-items: stretch;
    gap: 0.85rem;
  }

  .gate__input-wrap,
  .gate__input,
  .gate__btn {
    width: 100%;
  }

  .gate__input {
    min-height: 54px;
    padding: 1.05rem 1.2rem;
    font-size: 1.02rem;
  }

  .gate__heart {
    font-size: 0.9rem;
  }

  .gate__hearts {
    gap: 0.55rem;
  }

  .gate__btn {
    min-height: 54px;
    padding: 1.05rem 1.6rem;
    font-size: 1.02rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
  }

  .hero {
    min-height: 100svh;
    padding-top: 14svh;
    padding-bottom: 16svh;
    justify-content: flex-end;
  }

  .hero__light {
    width: min(88vw, 420px);
    height: min(88vw, 420px);
    opacity: 0.9;
  }

  .hero__seal {
    margin-bottom: 1.35rem;
    transform: scale(0.9);
  }

  .hero__motif {
    letter-spacing: 0.42em;
    font-size: 0.78rem;
  }

  .hero__title {
    font-size: clamp(3.1rem, 14vw, 4.4rem);
    max-width: 94vw;
    line-height: 0.98;
  }

  .hero__sub {
    max-width: 86vw;
    font-size: 1.55rem;
    line-height: 1.18;
    color: var(--gold-soft);
  }

  .scroll-cue {
    bottom: max(5.2rem, calc(env(safe-area-inset-bottom) + 4.2rem));
  }

  .scroll-cue span {
    letter-spacing: 0.28em;
  }

  .letter-section {
    min-height: auto;
    padding-block: 4.5rem 5.5rem;
  }

  .letter-pin {
    min-height: auto;
    display: block;
  }

  .letter-card {
    width: 100%;
    padding: 2.15rem 1.4rem 2rem;
    border-radius: 6px 22px 6px 22px;
    box-shadow:
      0 24px 60px rgba(0, 0, 0, 0.35),
      inset 0 1px 0 rgba(255, 255, 255, 0.35);
  }

  .letter-card::before {
    inset: 10px;
  }

  .letter-card__greeting {
    font-size: 1.15rem;
  }

  .letter-chapter {
    margin-bottom: 2.65rem;
  }

  .letter-chapter__title {
    font-size: 1.65rem;
  }

  .letter-line {
    font-size: 1.05rem;
    line-height: 1.75;
  }

  .letter-card__signature {
    font-size: 1.7rem;
  }

  .memories {
    padding-inline: 0;
    padding-top: 3.5rem;
  }

  .memories__header {
    padding-inline: 1.15rem;
    margin-bottom: 0;
    min-height: 48svh;
    display: flex;
    flex-direction: column;
    justify-content: center;
  }

  .memories__note {
    font-size: 1.55rem;
  }

  .portal {
    min-height: auto;
    padding: 3.5rem 0.85rem 5.5rem;
    display: block;
    overflow: hidden;
    isolation: isolate;
  }

  .portal::before {
    content: "";
    position: absolute;
    width: 76vw;
    aspect-ratio: 1;
    left: 50%;
    top: 22%;
    z-index: -1;
    border-radius: 50%;
    background: radial-gradient(
      circle,
      rgba(201, 162, 75, 0.13),
      rgba(92, 22, 52, 0.1) 42%,
      transparent 72%
    );
    filter: blur(22px);
    transform: translateX(-50%);
    pointer-events: none;
  }

  .portal + .portal {
    border-top: 1px solid rgba(201, 162, 75, 0.1);
  }

  .portal__inner {
    position: relative;
    width: 100%;
    min-height: 0;
    display: flex;
    flex-direction: column;
    perspective: 1100px;
  }

  .portal__media {
    position: relative;
    inset: auto;
    width: 100%;
    height: auto;
    aspect-ratio: 9 / 16;
    border-radius: 28px;
    border: 1px solid rgba(226, 201, 122, 0.34);
    background:
      radial-gradient(circle at 50% 35%, rgba(92, 22, 52, 0.3), transparent 60%),
      #080206;
    box-shadow:
      0 28px 70px rgba(0, 0, 0, 0.5),
      0 0 0 5px rgba(255, 245, 240, 0.025),
      inset 0 0 45px rgba(201, 162, 75, 0.08);
    overflow: hidden;
  }

  .portal:nth-child(4) .portal__media,
  .portal:nth-child(6) .portal__media {
    aspect-ratio: 3 / 4;
  }

  .portal__mask,
  .portal__img {
    width: 100%;
    height: 100%;
  }

  .portal__img {
    object-fit: contain;
    object-position: center top;
    filter: saturate(1.035) contrast(1.025) brightness(0.98);
  }

  .portal__media::after {
    background:
      linear-gradient(180deg, rgba(255, 241, 230, 0.06), transparent 30%, rgba(10, 3, 8, 0.08) 100%),
      linear-gradient(105deg, rgba(201, 162, 75, 0.08), transparent 38%, rgba(255, 200, 220, 0.05));
  }

  .portal__frame {
    inset: 10px;
    border-radius: 20px;
    border-color: rgba(226, 201, 122, 0.42);
  }

  .portal__chapter {
    top: 1.1rem;
    left: 1.1rem;
    padding: 0.42rem 0.78rem;
    background: rgba(10, 3, 8, 0.64);
    border-color: rgba(226, 201, 122, 0.42);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25);
  }

  .portal__caption {
    position: relative;
    z-index: 7;
    left: auto;
    right: auto;
    bottom: auto;
    width: calc(100% - 1.2rem);
    margin: 1rem auto 0;
    padding: 1.5rem 1.3rem 1.35rem;
    border-radius: 24px;
    border: 1px solid rgba(226, 201, 122, 0.3);
    background:
      linear-gradient(145deg, rgba(59, 10, 30, 0.94), rgba(14, 4, 10, 0.96)),
      radial-gradient(circle at 90% 0%, rgba(201, 162, 75, 0.16), transparent 42%);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
    box-shadow:
      0 22px 48px rgba(0, 0, 0, 0.42),
      inset 0 1px 0 rgba(255, 255, 255, 0.08);
    text-align: left;
    transform-origin: top center;
    opacity: 1 !important;
    transform: none !important;
    filter: none !important;
  }

  .portal__caption::before {
    display: none;
  }

  .portal__caption::after {
    content: "?";
    position: absolute;
    top: -0.7rem;
    right: 1.25rem;
    display: grid;
    place-items: center;
    width: 1.55rem;
    height: 1.55rem;
    border-radius: 50%;
    color: var(--wine-deep);
    font-size: 0.7rem;
    background: linear-gradient(135deg, var(--gold-soft), var(--gold));
    border: 2px solid rgba(59, 10, 30, 0.9);
    box-shadow: 0 0 18px rgba(201, 162, 75, 0.45);
  }

  .portal__semantic-trails {
    inset: 0;
    width: 100%;
    height: 100%;
  }

  .portal__caption h3 {
    max-width: 100%;
    margin: 0 2rem 0.72rem 0;
    font-size: clamp(1.55rem, 6.8vw, 2.05rem);
    line-height: 1.12;
    color: #fff0ed;
    text-wrap: balance;
    opacity: 1 !important;
    transform: none !important;
    filter: none !important;
  }

  .portal__caption p {
    max-width: 100%;
    margin: 0;
    font-size: 0.96rem;
    line-height: 1.62;
    color: rgba(243, 232, 228, 0.72);
    opacity: 1 !important;
    transform: none !important;
    filter: none !important;
  }

  .portal__caption .handwritten {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    margin-top: 0.75rem;
    font-size: 1.4rem;
    color: var(--gold-soft);
    opacity: 1 !important;
    transform: none !important;
  }

  .portal__caption .handwritten::before {
    content: "";
    width: 2.25rem;
    height: 1px;
    background: linear-gradient(90deg, var(--gold), transparent);
  }

  .portal__source {
    display: none !important;
  }

  .portal__semantic-trails {
    display: none;
  }

  .portal__word {
    opacity: 1 !important;
    transform: none !important;
    filter: none !important;
  }

  .portal__source b {
    padding: 0.28rem 0.5rem;
    border-radius: 999px;
    background: rgba(10, 3, 8, 0.62);
    backdrop-filter: blur(6px);
  }

  .meaning {
    min-height: 110svh;
    padding-block: 6.5rem 7.5rem;
  }

  .meaning__glow {
    width: min(88vw, 420px);
    height: min(88vw, 420px);
    opacity: 0.9;
  }

  .meaning__digits {
    gap: 0.7rem;
    width: 100%;
    margin-top: 2.2rem;
  }

  .meaning-item {
    width: 29%;
  }

  .meaning-item__digit {
    font-size: 2.15rem;
    box-shadow: 0 0 36px rgba(201, 162, 75, 0.18);
  }

  .meaning-item__word {
    font-size: 1.35rem;
  }

  .infinity-stage {
    width: 150px;
    height: 150px;
    margin-top: 0.75rem;
  }

  .digit-eight,
  .digit-infinity {
    font-size: clamp(4.8rem, 18vw, 6.2rem);
  }

  .meaning__note {
    font-size: 1.02rem;
    line-height: 1.8;
    padding-inline: 0.35rem;
    max-width: 34rem;
  }

  .finale {
    min-height: 100svh;
    padding:
      5.5rem
      1rem
      max(7rem, calc(env(safe-area-inset-bottom) + 5.5rem));
  }

  .finale__title {
    font-size: clamp(2.2rem, 10vw, 3rem);
    margin-bottom: 2rem;
  }

  .hold-btn {
    width: 168px;
    height: 168px;
  }

  .hold-btn__label {
    font-size: 0.78rem;
    letter-spacing: 0.14em;
  }

  .finale-reveal__message {
    font-size: clamp(1.55rem, 7vw, 2.1rem);
  }

  .finale-reveal__sub {
    font-size: 1.35rem;
  }

  .site-footer {
    padding-bottom: max(5.5rem, calc(env(safe-area-inset-bottom) + 4.5rem));
  }
}

/* Wide-screen edition: broader spacing and gallery-room scale. */
@media (min-width: 1200px) {
  .portal__inner {
    width: min(1120px, 88vw);
    grid-template-columns: 1.2fr 0.8fr;
    gap: 4.5rem;
  }

  .portal:nth-child(even) .portal__inner {
    grid-template-columns: 0.8fr 1.2fr;
  }

  .portal__media {
    max-height: 78vh;
    justify-self: center;
  }

  .portal__caption h3 {
    font-size: clamp(2rem, 3vw, 2.8rem);
  }

  .letter-card {
    width: min(640px, 52vw);
  }
}

/* =========================================================
   Interactive 3D UI surfaces
   ========================================================= */
@media (hover: hover) and (pointer: fine) {
  .gate__glass,
  .letter-card,
  .portal__inner {
    --tilt-x: 0deg;
    --tilt-y: 0deg;
    --light-x: 50%;
    --light-y: 50%;
    transform-style: preserve-3d;
    transform:
      perspective(1100px)
      rotateX(var(--tilt-x))
      rotateY(var(--tilt-y));
    transition: transform 0.35s var(--ease-out);
    will-change: transform;
  }

  .gate__title,
  .letter-card__greeting {
    transform: translateZ(34px);
  }

  .gate__form,
  .letter-card__chapters {
    transform: translateZ(22px);
  }

  .portal__media {
    transform: translateZ(24px);
  }

  .portal__caption {
    transform: translateZ(44px);
  }

  .gate__glass::after,
  .letter-card::after,
  .portal__inner::after {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: inherit;
    pointer-events: none;
    background: radial-gradient(
      circle at var(--light-x) var(--light-y),
      rgba(255, 255, 255, 0.13),
      transparent 34%
    );
    opacity: 0.7;
    transform: translateZ(2px);
    z-index: 20;
  }
}

.hold-btn::before {
  content: "";
  position: absolute;
  inset: 18%;
  border-radius: 50%;
  background: radial-gradient(
    circle,
    rgba(232, 196, 196, 0.18),
    rgba(201, 162, 75, 0.06) 45%,
    transparent 72%
  );
  box-shadow:
    inset 0 0 26px rgba(255, 235, 235, 0.08),
    0 0 45px rgba(232, 196, 196, 0.12);
  transform: scale(0.88);
  transition:
    transform 0.25s var(--ease-out),
    box-shadow 0.25s,
    background 0.25s;
}

.hold-btn.is-holding::before {
  transform: scale(1.08);
  background: radial-gradient(
    circle,
    rgba(255, 220, 230, 0.36),
    rgba(201, 162, 75, 0.16) 48%,
    transparent 74%
  );
  box-shadow:
    inset 0 0 34px rgba(255, 245, 235, 0.14),
    0 0 70px rgba(232, 196, 196, 0.3);
  animation: hold-heartbeat 0.72s ease-in-out infinite;
}

.hold-btn.is-holding .hold-btn__label {
  color: var(--gold-soft);
}

@keyframes hold-heartbeat {
  0%,
  100% {
    transform: scale(1);
  }
  45% {
    transform: scale(1.09);
  }
}
