:root {
  --deep-navy: #020916;
  --navy: #06152f;
  --blue: #0d3768;
  --maroon: #8b1735;
  --maroon-dark: #4b0a22;
  --gold: #d9b75f;
  --gold-bright: #f6dc8c;
  --white: #f8f4ea;
  --muted: rgba(248, 244, 234, 0.74);
  --glass: rgba(5, 17, 39, 0.62);
  --ease-premium: cubic-bezier(0.16, 1, 0.3, 1);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  min-height: 100vh;
  overflow-x: hidden;
  font-family: "Inter", sans-serif;
  color: var(--white);
  background: var(--deep-navy);
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

.app {
  position: relative;
  min-height: 100vh;
  overflow: hidden;
}

/* Visual layers */
.bg-gradient {
  position: fixed;
  inset: 0;
  z-index: 0;
  background:
    radial-gradient(circle at 18% 18%, rgba(49, 145, 196, 0.48), transparent 28%),
    radial-gradient(circle at 78% 42%, rgba(139, 23, 53, 0.72), transparent 34%),
    radial-gradient(circle at 45% 86%, rgba(8, 44, 82, 0.94), transparent 35%),
    linear-gradient(135deg, #06142c 0%, #0a2a4f 42%, #54112c 72%, #050e22 100%);
  background-size: 180% 180%;
  animation: gradientFlow 26s ease-in-out infinite alternate;
}

.texture-layer {
  position: fixed;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  opacity: 0.3;
  background-image:
    linear-gradient(rgba(255,255,255,0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.03) 1px, transparent 1px);
  background-size: 42px 42px;
}

.wave-layer {
  position: fixed;
  inset: 0;
  z-index: 2;
  opacity: 0.22;
  pointer-events: none;
  background:
    repeating-radial-gradient(
      circle at 82% 18%,
      transparent 0 18px,
      rgba(255,255,255,0.15) 19px 21px,
      transparent 22px 38px
    );
  animation: waveDrift 36s linear infinite;
}

.global-glow {
  position: fixed;
  z-index: 2;
  width: 390px;
  height: 390px;
  border-radius: 50%;
  filter: blur(78px);
  opacity: 0.46;
  pointer-events: none;
}

.glow-blue {
  top: 8%;
  left: 7%;
  background: rgba(75, 178, 218, 0.34);
  animation: glowFloatA 18s ease-in-out infinite alternate;
}

.glow-maroon {
  right: 8%;
  bottom: 8%;
  background: rgba(168, 22, 69, 0.42);
  animation: glowFloatB 21s ease-in-out infinite alternate;
}

.glow-gold {
  top: 42%;
  left: 46%;
  background: rgba(217, 183, 95, 0.16);
  animation: glowFloatC 23s ease-in-out infinite alternate;
}

.particle-layer {
  position: fixed;
  inset: 0;
  z-index: 3;
  overflow: hidden;
  pointer-events: none;
}

.particle {
  position: absolute;
  border-radius: 50%;
  background: rgba(248, 244, 234, 0.76);
  box-shadow: 0 0 16px rgba(217, 183, 95, 0.76);
  animation: particleFloat linear infinite;
}

.cloud-layer {
  position: fixed;
  left: 0;
  right: 0;
  pointer-events: none;
  z-index: 4;
}

.cloud-layer::before,
.cloud-layer::after {
  content: "";
  position: absolute;
  border-radius: 999px 999px 0 0;
  background: rgba(3, 28, 58, 0.94);
}

.cloud-back {
  bottom: -78px;
  height: 150px;
  opacity: 0.42;
  animation: cloudDriftBack 28s ease-in-out infinite alternate;
}

.cloud-back::before {
  width: 52%;
  height: 150px;
  left: -8%;
  bottom: 0;
}

.cloud-back::after {
  width: 56%;
  height: 170px;
  right: -10%;
  bottom: 0;
}

.cloud-front {
  bottom: -62px;
  height: 130px;
  opacity: 0.7;
  animation: cloudDriftFront 22s ease-in-out infinite alternate;
}

.cloud-front::before {
  width: 45%;
  height: 130px;
  left: 8%;
  bottom: 0;
}

.cloud-front::after {
  width: 46%;
  height: 138px;
  right: 6%;
  bottom: 0;
}

/* Gate */
.gate {
  position: fixed;
  inset: 0;
  z-index: 999;
  display: none;
  pointer-events: none;
}

.gate.active {
  display: block;
}

.gate-panel {
  position: absolute;
  top: 0;
  width: 50%;
  height: 100%;
  background:
    radial-gradient(circle at center, rgba(217,183,95,0.12), transparent 38%),
    linear-gradient(135deg, #06152f, #57132e 58%, #030916);
  box-shadow: inset 0 0 90px rgba(0,0,0,0.58);
}

.gate-left {
  left: 0;
}

.gate-right {
  right: 0;
}

.gate.active .gate-left {
  animation: gateOpenLeft 1.2s var(--ease-premium) forwards;
}

.gate.active .gate-right {
  animation: gateOpenRight 1.2s var(--ease-premium) forwards;
}

.gate-glow {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 6px;
  height: 120%;
  transform: translate(-50%, -50%);
  background: rgba(246, 220, 140, 0.95);
  filter: blur(14px);
  opacity: 0;
}

.gate.active .gate-glow {
  animation: gateGlow 1.1s ease-out forwards;
}

/* Watermark */
.watermark {
  position: fixed;
  z-index: 75;
  font-size: 0.72rem;
  letter-spacing: 0.04em;
  color: rgba(248,244,234,0.34);
  pointer-events: auto;
  opacity: 0;
  transition: opacity 350ms ease, color 350ms ease;
}

.watermark.show {
  opacity: 1;
}

.watermark:hover {
  color: rgba(217,183,95,0.7);
}

.watermark-osis {
  left: 18px;
  bottom: 18px;
}

.watermark-design {
  right: 86px;
  bottom: 18px;
}

/* Music */
.music-btn {
  position: fixed;
  right: 20px;
  top: 20px;
  z-index: 80;
  width: 48px;
  height: 48px;
  display: none;
  place-items: center;
  border-radius: 50%;
  border: 1px solid rgba(217,183,95,0.42);
  background: rgba(5,17,39,0.76);
  color: var(--white);
  font-size: 1.2rem;
  cursor: pointer;
  backdrop-filter: blur(12px);
  box-shadow:
    0 12px 32px rgba(0,0,0,0.32),
    0 0 20px rgba(217,183,95,0.16);
  transition: transform 300ms ease, box-shadow 300ms ease;
}

.music-btn.show {
  display: grid;
}

.music-btn.playing {
  color: var(--gold-bright);
  animation: musicPulse 1.8s ease-in-out infinite;
}

.music-btn:hover {
  transform: translateY(-3px);
}

/* Cover */
.cover {
  position: relative;
  z-index: 10;
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 26px;
  text-align: center;
  overflow: hidden;
}

.cover::before {
  content: "";
  position: absolute;
  width: min(760px, 94vw);
  aspect-ratio: 1;
  border-radius: 50%;
  border: 1px solid rgba(217,183,95,0.28);
  background:
    radial-gradient(circle at center, rgba(6,21,47,0.08) 0 28%, rgba(139,23,53,0.35) 29% 48%, rgba(6,21,47,0.18) 49% 100%);
  box-shadow:
    inset 0 0 80px rgba(255,255,255,0.04),
    0 0 120px rgba(0,0,0,0.28);
}

.cover-content {
  position: relative;
  z-index: 5;
  width: min(780px, 100%);
  padding: clamp(36px, 6vw, 72px);
  border-radius: 38px;
  background:
    linear-gradient(180deg, rgba(6,18,42,0.54), rgba(6,18,42,0.26)),
    radial-gradient(circle at center, rgba(255,255,255,0.08), transparent 62%);
  border: 1px solid rgba(255,255,255,0.13);
  backdrop-filter: blur(9px);
  box-shadow: 0 30px 100px rgba(0,0,0,0.36);
  animation: coverEnter 1.3s var(--ease-premium) both;
}

.cover-clock {
  position: absolute;
  z-index: 3;
  width: min(440px, 74vw);
  aspect-ratio: 1;
  border-radius: 50%;
  border: 1px solid rgba(248,244,234,0.16);
  opacity: 0.34;
  animation: floatCenter 13s ease-in-out infinite;
}

.cover-clock-ring {
  position: absolute;
  inset: 20%;
  border-radius: 50%;
  border: 1px solid rgba(217,183,95,0.24);
}

.cover-hand {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 3px;
  border-radius: 999px;
  transform-origin: bottom center;
}

.cover-hour {
  height: 100px;
  background: rgba(248,244,234,0.75);
  animation: slowClockRotate 52s linear infinite;
}

.cover-minute {
  height: 166px;
  background: rgba(217,183,95,0.9);
  animation: slowClockRotate 38s linear infinite;
}

.cover-dot {
  position: absolute;
  width: 17px;
  height: 17px;
  left: 50%;
  top: 50%;
  border-radius: 50%;
  background: var(--gold);
  transform: translate(-50%, -50%);
  box-shadow: 0 0 18px rgba(217,183,95,0.85);
}

/* Typography */
.script-text {
  font-family: "Great Vibes", cursive;
  font-size: clamp(2.1rem, 5vw, 3.8rem);
  line-height: 1;
  color: rgba(248,244,234,0.94);
  text-shadow: 0 0 22px rgba(255,255,255,0.42);
  margin-bottom: 12px;
}

h1,
h2 {
  font-family: "Cormorant Garamond", serif;
  font-size: clamp(3.1rem, 9vw, 7.2rem);
  line-height: 0.84;
  font-weight: 500;
  letter-spacing: 0.035em;
  text-transform: uppercase;
  color: var(--white);
  text-shadow:
    0 0 18px rgba(255,255,255,0.48),
    0 0 50px rgba(98, 163, 215, 0.34);
}

h1 span,
h2 span {
  display: inline-block;
  font-size: 0.62em;
  margin-top: 14px;
}

.blur-title {
  animation: textBlurReveal 2.2s var(--ease-premium) both, glowPulse 5s ease-in-out infinite alternate;
}

.cover-subtitle,
.scene-copy {
  width: min(600px, 100%);
  margin: 26px auto 0;
  font-size: clamp(1rem, 2.4vw, 1.16rem);
  line-height: 1.8;
  color: var(--muted);
  font-weight: 300;
}

/* Buttons */
.premium-btn,
.scene-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 54px;
  margin-top: 34px;
  padding: 0 32px;
  border-radius: 999px;
  cursor: pointer;
  text-decoration: none;
  font-family: "Inter", sans-serif;
  font-size: 0.96rem;
  font-weight: 500;
  letter-spacing: 0.02em;
  color: var(--white);
  border: 1px solid rgba(217,183,95,0.34);
  background:
    linear-gradient(135deg, rgba(161,31,64,0.98), rgba(87,12,38,0.98) 55%, rgba(159,118,43,0.86));
  box-shadow:
    0 16px 38px rgba(0,0,0,0.32),
    inset 0 0 0 1px rgba(255,255,255,0.12);
  transition: transform 300ms ease, box-shadow 300ms ease;
  animation: buttonPulse 3.2s ease-in-out infinite;
}

.scene-btn {
  min-height: 48px;
  padding: 0 26px;
  font-size: 0.9rem;
  background:
    linear-gradient(135deg, rgba(6,33,65,0.9), rgba(107,18,48,0.92));
}

.premium-btn:hover,
.scene-btn:hover {
  transform: translateY(-3px);
  box-shadow:
    0 20px 48px rgba(0,0,0,0.38),
    0 0 30px rgba(217,183,95,0.34);
}

/* Experience */
.hidden {
  display: none;
}

.experience {
  position: relative;
  z-index: 10;
  height: 100vh;
  overflow-y: auto;
  overflow-x: hidden;
  scroll-snap-type: y mandatory;
  scroll-behavior: smooth;
}

.experience::-webkit-scrollbar {
  width: 0;
}

.scene {
  position: relative;
  min-height: 100vh;
  width: 100%;
  display: grid;
  place-items: center;
  padding: 74px 20px;
  text-align: center;
  scroll-snap-align: start;
  scroll-snap-stop: always;
  overflow: hidden;
}

.scene::before {
  content: "";
  position: absolute;
  inset: 18px;
  border-radius: 34px;
  border: 1px solid rgba(248,244,234,0.08);
  pointer-events: none;
  z-index: 1;
}

.scene-content,
.recipient-box,
.invitation-card,
.detail-content,
.location-card,
.closing-card,
.envelope-wrap,
.map-frame {
  position: relative;
  z-index: 8;
}

/* Progress */
.progress-bar {
  position: fixed;
  left: 0;
  bottom: 0;
  z-index: 70;
  width: 100%;
  height: 3px;
  background: rgba(255,255,255,0.08);
}

.progress-bar span {
  display: block;
  width: 0;
  height: 100%;
  background: linear-gradient(90deg, var(--maroon), var(--gold-bright));
  box-shadow: 0 0 18px rgba(217,183,95,0.5);
  transition: width 350ms ease;
}

.progress-dots {
  position: fixed;
  right: 22px;
  top: 50%;
  z-index: 70;
  display: grid;
  gap: 11px;
  transform: translateY(-50%);
}

.dot {
  width: 9px;
  height: 9px;
  border-radius: 999px;
  border: 1px solid rgba(217,183,95,0.7);
  background: rgba(255,255,255,0.12);
  cursor: pointer;
  transition: 300ms ease;
}

.dot.active {
  height: 28px;
  background: rgba(217,183,95,0.92);
  box-shadow: 0 0 18px rgba(217,183,95,0.5);
}

/* Scene opening */
.clock-portal {
  position: absolute;
  z-index: 3;
  width: min(720px, 92vw);
  aspect-ratio: 1;
  left: 50%;
  top: 50%;
  border-radius: 50%;
  transform: translate(-50%, -50%) scale(0.48) rotate(-10deg);
  opacity: 0;
  background:
    radial-gradient(circle at center, rgba(248,244,234,0.18) 0 4%, rgba(8,17,36,0.96) 5% 19%, rgba(141,21,54,0.76) 20% 48%, rgba(7,24,50,0.74) 49% 100%);
  border: 2px solid rgba(217,183,95,0.34);
  box-shadow:
    inset 0 0 64px rgba(255,255,255,0.06),
    0 0 90px rgba(255,255,255,0.04);
}

.scene.active-scene .clock-portal {
  animation: portalReveal 1.6s var(--ease-premium) forwards, portalIdle 12s ease-in-out 1.6s infinite;
}

.clock-portal span {
  position: absolute;
  left: 50%;
  top: 50%;
  font-family: "Cormorant Garamond", serif;
  font-size: clamp(1.7rem, 4vw, 4.8rem);
  color: rgba(248,244,234,0.56);
  text-shadow: 0 0 14px rgba(255,255,255,0.22);
  opacity: 0;
  transform:
    translate(-50%, -50%)
    rotate(calc(var(--i) * 30deg))
    translateY(calc(min(-294px, -37vw)))
    rotate(calc(var(--i) * -30deg));
}

.scene.active-scene .clock-portal span {
  animation: romanStaggerReveal 0.8s var(--ease-premium) forwards;
  animation-delay: calc(var(--i) * 0.06s + 0.5s);
}

.portal-ring {
  position: absolute;
  width: 31%;
  height: 31%;
  left: 50%;
  top: 50%;
  border-radius: 50%;
  border: 1px solid rgba(248,244,234,0.34);
  background: radial-gradient(circle, rgba(5,13,31,0.95), rgba(109,18,49,0.74));
  transform: translate(-50%, -50%);
}

.portal-hand {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 4px;
  border-radius: 999px;
  transform-origin: bottom center;
  filter: drop-shadow(0 0 10px rgba(255,255,255,0.42));
}

.portal-hour {
  height: 150px;
  background: linear-gradient(var(--white), rgba(255,255,255,0.08));
  animation: clockOpeningSpin 1.4s ease-out forwards, slowClockRotate 56s linear 1.4s infinite;
}

.portal-minute {
  height: 250px;
  width: 3px;
  background: linear-gradient(var(--gold), rgba(217,183,95,0.12));
  animation: clockOpeningSpin 1.4s ease-out forwards, slowClockRotate 40s linear 1.4s infinite;
}

.portal-center {
  position: absolute;
  width: 24px;
  height: 24px;
  left: 50%;
  top: 50%;
  border-radius: 50%;
  background: var(--gold);
  transform: translate(-50%, -50%);
  box-shadow:
    0 0 18px rgba(217,183,95,0.8),
    0 0 70px rgba(248,244,234,0.45);
}

.roman-mark {
  position: absolute;
  z-index: 2;
  font-family: "Cormorant Garamond", serif;
  font-size: clamp(5rem, 15vw, 14rem);
  line-height: 1;
  color: rgba(248,244,234,0.075);
  text-shadow: 0 0 28px rgba(255,255,255,0.12);
  pointer-events: none;
}

.roman-left {
  left: 5%;
  top: 12%;
}

.roman-right {
  right: 7%;
  bottom: 12%;
}

.roman-center {
  top: 6%;
  left: 50%;
  transform: translateX(-50%);
}

.opening-content {
  opacity: 0;
  transform: scale(1.06);
  filter: blur(12px);
}

.scene.active-scene .opening-content {
  animation: sceneZoomReveal 1.5s var(--ease-premium) 0.4s forwards;
}

/* Envelope */
.envelope-wrap {
  width: min(560px, 92vw);
  height: 420px;
  display: grid;
  place-items: center;
  opacity: 0;
  transform: scale(0.82) rotate(-3deg);
}

.scene.active-scene .envelope-wrap {
  animation: envelopeArrive 1.25s var(--ease-premium) forwards;
}

.envelope {
  position: relative;
  width: min(430px, 86vw);
  height: 260px;
  perspective: 1000px;
}

.envelope-shadow {
  position: absolute;
  left: 8%;
  right: 8%;
  bottom: -24px;
  height: 36px;
  border-radius: 50%;
  background: rgba(0,0,0,0.38);
  filter: blur(14px);
}

.envelope-body {
  position: absolute;
  inset: 70px 0 0;
  border-radius: 0 0 26px 26px;
  background:
    linear-gradient(145deg, rgba(95,14,40,0.96), rgba(7,35,66,0.96));
  border: 1px solid rgba(217,183,95,0.42);
  box-shadow:
    0 28px 76px rgba(0,0,0,0.38),
    inset 0 0 32px rgba(255,255,255,0.04);
}

.envelope-flap {
  position: absolute;
  left: 0;
  top: 70px;
  width: 100%;
  height: 150px;
  background:
    linear-gradient(145deg, rgba(151,29,63,0.96), rgba(6,31,62,0.96));
  border: 1px solid rgba(217,183,95,0.42);
  clip-path: polygon(0 0, 50% 100%, 100% 0);
  transform-origin: top center;
  z-index: 4;
}

.scene.active-scene .envelope-flap {
  animation: cardUnfold 1.35s var(--ease-premium) 0.45s forwards;
}

.letter-card {
  position: absolute;
  left: 50%;
  top: 94px;
  width: 78%;
  height: 220px;
  border-radius: 24px;
  padding: 32px 20px;
  transform: translateX(-50%) translateY(72px) scale(0.88);
  opacity: 0;
  z-index: 3;
  background:
    linear-gradient(180deg, rgba(248,244,234,0.96), rgba(223,209,170,0.92));
  color: #231321;
  border: 1px solid rgba(217,183,95,0.85);
  box-shadow: 0 18px 50px rgba(0,0,0,0.28);
}

.letter-card .script-text {
  color: #7b1739;
  text-shadow: none;
}

.letter-card h3 {
  font-family: "Cormorant Garamond", serif;
  font-size: clamp(2rem, 6vw, 3.4rem);
  line-height: 0.95;
  text-transform: uppercase;
}

.letter-card small {
  display: block;
  margin-top: 14px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.scene.active-scene .letter-card {
  animation: letterRise 1.25s var(--ease-premium) 1s forwards;
}

.floating-next {
  position: absolute;
  z-index: 10;
  bottom: 108px;
}

/* Recipient */
.recipient-frame {
  position: absolute;
  z-index: 2;
  width: min(680px, 90vw);
  height: min(440px, 58vh);
  border: 1px solid rgba(217,183,95,0.18);
  border-radius: 42px;
  transform: rotate(-2deg);
  animation: frameDrift 9s ease-in-out infinite alternate;
}

.frame-two {
  width: min(540px, 82vw);
  height: min(360px, 48vh);
  transform: rotate(2deg);
  opacity: 0.7;
  animation-delay: 1s;
}

.recipient-box {
  width: min(780px, 100%);
  padding: clamp(38px, 7vw, 76px);
  border-radius: 38px;
  background:
    radial-gradient(circle at center, rgba(255,255,255,0.08), transparent 62%),
    linear-gradient(180deg, rgba(5,17,39,0.6), rgba(5,17,39,0.24));
  border: 1px solid rgba(217,183,95,0.3);
  backdrop-filter: blur(10px);
  box-shadow: 0 30px 92px rgba(0,0,0,0.38);
  clip-path: inset(0 50% 0 50%);
  opacity: 0;
}

.scene.active-scene .recipient-box {
  animation: clipReveal 1.4s var(--ease-premium) forwards;
}

.recipient-name {
  font-family: "Cormorant Garamond", serif;
  font-size: clamp(3.1rem, 8vw, 6.4rem);
  font-weight: 500;
  line-height: 0.96;
  color: var(--white);
  text-shadow:
    0 0 18px rgba(255,255,255,0.42),
    0 0 38px rgba(217,183,95,0.22);
}

.recipient-name span {
  display: inline-block;
  opacity: 0;
  transform: translateY(18px) rotate(4deg);
  filter: blur(4px);
}

.scene.active-scene .recipient-name span {
  animation: letterReveal 0.62s var(--ease-premium) forwards;
  animation-delay: calc(var(--char) * 0.045s + 0.6s);
}

.recipient-note {
  width: min(520px, 100%);
  margin: 26px auto 0;
  color: var(--muted);
  line-height: 1.8;
  font-weight: 300;
}

.gold-line {
  width: min(360px, 72%);
  height: 1px;
  margin: 26px auto;
  background: linear-gradient(90deg, transparent, rgba(217,183,95,0.95), transparent);
}

/* Message */
.message-clock,
.closing-clock {
  position: absolute;
  width: min(560px, 88vw);
  aspect-ratio: 1;
  border-radius: 50%;
  border: 1px solid rgba(217,183,95,0.2);
  background:
    radial-gradient(circle, rgba(139,23,53,0.2), transparent 48%),
    repeating-radial-gradient(circle, transparent 0 22px, rgba(255,255,255,0.07) 23px 24px, transparent 25px 44px);
  opacity: 0.48;
  z-index: 2;
  animation: floatCenter 15s ease-in-out infinite;
}

.invitation-card,
.location-card,
.closing-card {
  width: min(780px, 100%);
  padding: clamp(38px, 6vw, 68px);
  border-radius: 34px;
  background:
    linear-gradient(180deg, rgba(6,18,42,0.76), rgba(6,18,42,0.45)),
    radial-gradient(circle at center, rgba(255,255,255,0.07), transparent 62%);
  border: 1px solid rgba(217,183,95,0.34);
  backdrop-filter: blur(12px);
  box-shadow:
    0 30px 94px rgba(0,0,0,0.42),
    inset 0 0 38px rgba(255,255,255,0.035);
  overflow: hidden;
}

.invitation-card {
  transform: translateY(22px) scale(0.78) rotate(-3deg);
  opacity: 0;
}

.scene.active-scene .invitation-card {
  animation: invitationCardOpen 1.35s var(--ease-premium) forwards;
}

.section-label {
  margin-bottom: 24px;
  font-size: 0.78rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: rgba(217,183,95,0.9);
}

.message-text,
.closing-card p,
.location-card p {
  width: min(640px, 100%);
  margin: 0 auto;
  font-size: clamp(1.05rem, 2.6vw, 1.24rem);
  line-height: 1.9;
  color: var(--muted);
  font-weight: 300;
}

.corner {
  position: absolute;
  width: 44px;
  height: 44px;
  border-color: rgba(217,183,95,0.72);
}

.top-left {
  top: 18px;
  left: 18px;
  border-top: 1px solid;
  border-left: 1px solid;
}

.top-right {
  top: 18px;
  right: 18px;
  border-top: 1px solid;
  border-right: 1px solid;
}

.bottom-left {
  bottom: 18px;
  left: 18px;
  border-bottom: 1px solid;
  border-left: 1px solid;
}

.bottom-right {
  bottom: 18px;
  right: 18px;
  border-bottom: 1px solid;
  border-right: 1px solid;
}

.shimmer {
  position: absolute;
  top: 0;
  left: -120%;
  width: 70%;
  height: 100%;
  transform: skewX(-18deg);
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.16), transparent);
}

.scene.active-scene .shimmer {
  animation: shimmerSweep 1.8s ease forwards 0.9s;
}

.below-card {
  position: absolute;
  z-index: 10;
  bottom: 105px;
}

/* Detail */
.detail-content {
  width: min(980px, 100%);
  opacity: 0;
  transform: scale(0.95);
}

.scene.active-scene .detail-content {
  animation: detailReveal 1.1s var(--ease-premium) forwards;
}

.section-title {
  font-family: "Cormorant Garamond", serif;
  font-size: clamp(3rem, 7vw, 5.6rem);
  font-weight: 500;
  line-height: 0.98;
  margin-bottom: 34px;
  color: var(--white);
  text-shadow:
    0 0 18px rgba(255,255,255,0.38),
    0 0 38px rgba(217,183,95,0.22);
}

.event-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
}

.event-card {
  min-height: 200px;
  padding: 28px 20px;
  border-radius: 28px;
  background:
    linear-gradient(135deg, rgba(139,23,53,0.68), rgba(6,33,65,0.58));
  border: 1px solid rgba(217,183,95,0.28);
  backdrop-filter: blur(10px);
  box-shadow:
    0 22px 64px rgba(0,0,0,0.3),
    inset 0 0 22px rgba(255,255,255,0.035);
  opacity: 0;
  transition: transform 260ms ease, box-shadow 300ms ease;
}

.card-from-left {
  transform: translateX(-56px) rotate(-2deg);
}

.card-from-scale {
  transform: scale(0.82);
}

.card-from-right {
  transform: translateX(56px) rotate(2deg);
}

.scene.active-scene .event-card {
  animation: detailCardIn 0.9s var(--ease-premium) forwards;
}

.scene.active-scene .event-card:nth-child(1) {
  animation-delay: 0.2s;
}

.scene.active-scene .event-card:nth-child(2) {
  animation-delay: 0.42s;
}

.scene.active-scene .event-card:nth-child(3) {
  animation-delay: 0.64s;
}

.event-card:hover {
  box-shadow:
    0 28px 74px rgba(0,0,0,0.38),
    0 0 30px rgba(217,183,95,0.22);
}

.event-icon {
  width: 50px;
  height: 50px;
  display: grid;
  place-items: center;
  margin: 0 auto 18px;
  border-radius: 50%;
  color: var(--gold-bright);
  border: 1px solid rgba(217,183,95,0.38);
  background: rgba(255,255,255,0.06);
  font-size: 1.25rem;
}

.event-card span {
  display: block;
  margin-bottom: 10px;
  font-size: 0.72rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: rgba(248,244,234,0.56);
}

.event-card strong {
  display: block;
  font-family: "Cormorant Garamond", serif;
  font-size: clamp(1.35rem, 3vw, 1.85rem);
  font-weight: 600;
  line-height: 1.15;
}

/* Location */
.map-frame {
  position: absolute;
  width: min(620px, 90vw);
  height: min(380px, 48vh);
  border-radius: 34px;
  border: 1px solid rgba(217,183,95,0.22);
  background:
    linear-gradient(135deg, rgba(6,33,65,0.42), rgba(139,23,53,0.26)),
    radial-gradient(circle at 70% 40%, rgba(217,183,95,0.12), transparent 32%);
  box-shadow: inset 0 0 50px rgba(255,255,255,0.035);
  opacity: 0;
  transform: scale(0.9) rotate(-1deg);
}

.scene.active-scene .map-frame {
  animation: mapReveal 1.15s var(--ease-premium) forwards;
}

.map-path {
  position: absolute;
  height: 2px;
  background: linear-gradient(90deg, transparent, rgba(217,183,95,0.7), transparent);
  transform-origin: left center;
  opacity: 0;
}

.scene.active-scene .map-path {
  animation: mapPathReveal 1.2s ease forwards;
}

.path-one {
  width: 70%;
  left: 14%;
  top: 36%;
  transform: rotate(-10deg);
}

.path-two {
  width: 54%;
  left: 28%;
  top: 54%;
  transform: rotate(16deg);
  animation-delay: 0.35s;
}

.path-three {
  width: 42%;
  left: 22%;
  top: 68%;
  transform: rotate(-22deg);
  animation-delay: 0.65s;
}

.map-pin {
  position: absolute;
  left: 58%;
  top: 45%;
  width: 56px;
  height: 56px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: var(--gold-bright);
  border: 1px solid rgba(217,183,95,0.5);
  background: rgba(83,12,36,0.76);
  box-shadow: 0 0 28px rgba(217,183,95,0.34);
  opacity: 0;
}

.scene.active-scene .map-pin {
  animation: pinDrop 0.9s var(--ease-premium) forwards 0.9s;
}

.location-card {
  margin-top: 160px;
  opacity: 0;
  transform: translateY(34px) scale(0.94);
}

.scene.active-scene .location-card {
  animation: locationCardReveal 1.15s var(--ease-premium) 0.25s forwards;
}

.location-btn {
  margin-top: 30px;
  margin-right: 10px;
}

/* Closing */
.closing-glow {
  position: absolute;
  width: min(540px, 86vw);
  aspect-ratio: 1;
  border-radius: 50%;
  background: rgba(217,183,95,0.14);
  filter: blur(70px);
  z-index: 2;
  animation: closingGlow 4s ease-in-out infinite alternate;
}

.closing-card {
  opacity: 0;
  transform: scale(1.08);
}

.scene.active-scene .closing-card {
  animation: closingZoomOut 1.5s var(--ease-premium) forwards;
}

.closing-card h3 {
  font-family: "Cormorant Garamond", serif;
  font-size: clamp(3rem, 8vw, 6rem);
  font-weight: 500;
  line-height: 0.96;
  color: var(--white);
  text-shadow:
    0 0 18px rgba(255,255,255,0.42),
    0 0 38px rgba(217,183,95,0.22);
}

.closing-card small {
  display: block;
  margin-top: 18px;
  color: rgba(217,183,95,0.86);
  letter-spacing: 0.04em;
}

.closing-credit {
  display: grid;
  gap: 4px;
  margin-top: 28px;
  font-size: 0.78rem;
  color: rgba(248,244,234,0.5);
}

/* Scroll hint */
.scroll-hint {
  position: absolute;
  z-index: 30;
  left: 50%;
  bottom: 28px;
  transform: translateX(-50%);
  display: grid;
  gap: 10px;
  justify-items: center;
  width: min(520px, 100%);
  padding: 0 20px;
  color: rgba(248,244,234,0.72);
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.scroll-hint i {
  width: 18px;
  height: 18px;
  display: block;
  border-right: 1px solid rgba(217,183,95,0.95);
  border-bottom: 1px solid rgba(217,183,95,0.95);
  transform: rotate(45deg);
  animation: arrowBounce 1.5s ease-in-out infinite;
}

/* Keyframes */
@keyframes gateOpenLeft {
  from { transform: translateX(0); }
  to { transform: translateX(-102%); }
}

@keyframes gateOpenRight {
  from { transform: translateX(0); }
  to { transform: translateX(102%); }
}

@keyframes gateGlow {
  0% { opacity: 0; width: 4px; }
  35% { opacity: 1; width: 18px; }
  100% { opacity: 0; width: 90px; }
}

@keyframes gradientFlow {
  from { background-position: 0% 0%; }
  to { background-position: 100% 100%; }
}

@keyframes waveDrift {
  from { transform: translateX(0); }
  to { transform: translateX(-120px); }
}

@keyframes particleFloat {
  0% {
    transform: translateY(0) translateX(0) scale(0.8);
    opacity: 0;
  }
  20% { opacity: 0.8; }
  50% {
    transform: translateY(-55vh) translateX(22px) scale(1.15);
    opacity: 0.55;
  }
  100% {
    transform: translateY(-115vh) translateX(-18px) scale(0.7);
    opacity: 0;
  }
}

@keyframes cloudDriftBack {
  from { transform: translateX(-24px); }
  to { transform: translateX(24px); }
}

@keyframes cloudDriftFront {
  from { transform: translateX(18px); }
  to { transform: translateX(-18px); }
}

@keyframes glowFloatA {
  from { transform: translate(0, 0); }
  to { transform: translate(90px, 38px); }
}

@keyframes glowFloatB {
  from { transform: translate(0, 0); }
  to { transform: translate(-84px, -42px); }
}

@keyframes glowFloatC {
  from { transform: translate(-38px, 20px); }
  to { transform: translate(54px, -46px); }
}

@keyframes coverEnter {
  from {
    opacity: 0;
    transform: translateY(24px) scale(0.97);
    filter: blur(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
    filter: blur(0);
  }
}

@keyframes floatCenter {
  0%, 100% {
    transform: translate(-50%, -50%) translateY(0) rotate(0deg);
  }
  50% {
    transform: translate(-50%, -50%) translateY(-12px) rotate(1.2deg);
  }
}

@keyframes slowClockRotate {
  from { transform: translate(-50%, -100%) rotate(0deg); }
  to { transform: translate(-50%, -100%) rotate(360deg); }
}

@keyframes portalReveal {
  0% {
    opacity: 0;
    transform: translate(-50%, -50%) scale(0.48) rotate(-10deg);
    filter: blur(12px);
  }
  68% {
    opacity: 0.78;
    transform: translate(-50%, -50%) scale(1.04) rotate(1deg);
    filter: blur(0);
  }
  100% {
    opacity: 0.68;
    transform: translate(-50%, -50%) scale(1) rotate(0deg);
    filter: blur(0);
  }
}

@keyframes portalIdle {
  0%, 100% {
    transform: translate(-50%, -50%) translateY(0) rotate(0deg);
  }
  50% {
    transform: translate(-50%, -50%) translateY(-12px) rotate(1deg);
  }
}

@keyframes clockOpeningSpin {
  from { transform: translate(-50%, -100%) rotate(-420deg); }
  to { transform: translate(-50%, -100%) rotate(0deg); }
}

@keyframes romanStaggerReveal {
  from {
    opacity: 0;
    filter: blur(8px);
  }
  to {
    opacity: 1;
    filter: blur(0);
  }
}

@keyframes sceneZoomReveal {
  from {
    opacity: 0;
    transform: scale(1.06);
    filter: blur(12px);
  }
  to {
    opacity: 1;
    transform: scale(1);
    filter: blur(0);
  }
}

@keyframes textBlurReveal {
  from {
    opacity: 0;
    letter-spacing: 0.16em;
    filter: blur(12px);
  }
  to {
    opacity: 1;
    letter-spacing: 0.035em;
    filter: blur(0);
  }
}

@keyframes glowPulse {
  from {
    text-shadow:
      0 0 14px rgba(255,255,255,0.35),
      0 0 34px rgba(98,163,215,0.24);
  }
  to {
    text-shadow:
      0 0 24px rgba(255,255,255,0.62),
      0 0 58px rgba(217,183,95,0.24);
  }
}

@keyframes buttonPulse {
  0%, 100% {
    box-shadow:
      0 16px 38px rgba(0,0,0,0.32),
      0 0 0 rgba(217,183,95,0);
  }
  50% {
    box-shadow:
      0 16px 38px rgba(0,0,0,0.32),
      0 0 22px rgba(217,183,95,0.18);
  }
}

@keyframes envelopeArrive {
  from {
    opacity: 0;
    transform: scale(0.82) rotate(-3deg);
    filter: blur(8px);
  }
  to {
    opacity: 1;
    transform: scale(1) rotate(0deg);
    filter: blur(0);
  }
}

@keyframes cardUnfold {
  from { transform: rotateX(0deg); }
  to { transform: rotateX(180deg); }
}

@keyframes letterRise {
  from {
    opacity: 0;
    transform: translateX(-50%) translateY(72px) scale(0.88);
  }
  to {
    opacity: 1;
    transform: translateX(-50%) translateY(-96px) scale(1);
  }
}

@keyframes frameDrift {
  from { transform: rotate(-2deg) translateY(0); }
  to { transform: rotate(2deg) translateY(-14px); }
}

@keyframes clipReveal {
  from {
    opacity: 0;
    clip-path: inset(0 50% 0 50%);
    filter: blur(8px);
  }
  to {
    opacity: 1;
    clip-path: inset(0 0 0 0);
    filter: blur(0);
  }
}

@keyframes letterReveal {
  from {
    opacity: 0;
    transform: translateY(18px) rotate(4deg);
    filter: blur(4px);
  }
  to {
    opacity: 1;
    transform: translateY(0) rotate(0);
    filter: blur(0);
  }
}

@keyframes invitationCardOpen {
  from {
    opacity: 0;
    transform: translateY(22px) scale(0.78) rotate(-3deg);
    filter: blur(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1) rotate(0);
    filter: blur(0);
  }
}

@keyframes shimmerSweep {
  from { left: -120%; }
  to { left: 140%; }
}

@keyframes detailReveal {
  from {
    opacity: 0;
    transform: scale(0.95);
    filter: blur(7px);
  }
  to {
    opacity: 1;
    transform: scale(1);
    filter: blur(0);
  }
}

@keyframes detailCardIn {
  to {
    opacity: 1;
    transform: translateX(0) scale(1) rotate(0);
    filter: blur(0);
  }
}

@keyframes mapReveal {
  from {
    opacity: 0;
    transform: scale(0.9) rotate(-1deg);
    filter: blur(8px);
  }
  to {
    opacity: 0.58;
    transform: scale(1) rotate(0deg);
    filter: blur(0);
  }
}

@keyframes mapPathReveal {
  from {
    opacity: 0;
    clip-path: inset(0 100% 0 0);
  }
  to {
    opacity: 1;
    clip-path: inset(0 0 0 0);
  }
}

@keyframes pinDrop {
  from {
    opacity: 0;
    transform: translateY(-28px) scale(0.8);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes locationCardReveal {
  from {
    opacity: 0;
    transform: translateY(34px) scale(0.94);
    filter: blur(7px);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
    filter: blur(0);
  }
}

@keyframes closingZoomOut {
  from {
    opacity: 0;
    transform: scale(1.08);
    filter: blur(10px);
  }
  to {
    opacity: 1;
    transform: scale(1);
    filter: blur(0);
  }
}

@keyframes closingGlow {
  from { opacity: 0.45; transform: scale(0.95); }
  to { opacity: 0.9; transform: scale(1.08); }
}

@keyframes musicPulse {
  0%, 100% {
    box-shadow:
      0 12px 32px rgba(0,0,0,0.34),
      0 0 18px rgba(217,183,95,0.24);
  }
  50% {
    box-shadow:
      0 12px 32px rgba(0,0,0,0.34),
      0 0 34px rgba(217,183,95,0.52);
  }
}

@keyframes arrowBounce {
  0%, 100% {
    transform: rotate(45deg) translate(0, 0);
    opacity: 0.45;
  }
  50% {
    transform: rotate(45deg) translate(7px, 7px);
    opacity: 1;
  }
}

/* Responsive */
@media (max-width: 820px) {
  .cover {
    padding: 16px;
  }

  .cover-content {
    padding: 36px 22px;
    border-radius: 30px;
  }

  .cover::before {
    width: 640px;
    opacity: 0.68;
  }

  .scene {
    padding: 68px 16px;
  }

  .scene::before {
    inset: 10px;
    border-radius: 24px;
  }

  .clock-portal {
    width: 620px;
    opacity: 0.5;
  }

  .clock-portal span {
    transform:
      translate(-50%, -50%)
      rotate(calc(var(--i) * 30deg))
      translateY(-252px)
      rotate(calc(var(--i) * -30deg));
  }

  .recipient-box,
  .invitation-card,
  .closing-card,
  .location-card {
    padding: 38px 22px;
    border-radius: 28px;
  }

  .event-grid {
    grid-template-columns: 1fr;
    gap: 14px;
  }

  .event-card {
    min-height: auto;
    padding: 22px 18px;
  }

  .progress-dots {
    right: 14px;
    gap: 9px;
  }

  .scroll-hint {
    bottom: 22px;
    font-size: 0.68rem;
    padding: 0 60px;
  }

  .music-btn {
    right: 16px;
    top: 16px;
    width: 44px;
    height: 44px;
  }

  .below-card,
  .floating-next {
    bottom: 92px;
  }

  .map-frame {
    height: 340px;
  }

  .location-card {
    margin-top: 140px;
  }

  .watermark {
    font-size: 0.66rem;
  }

  .watermark-osis {
    left: 50%;
    bottom: 18px;
    transform: translateX(-50%);
  }

  .watermark-design {
    display: none;
  }
}

@media (max-width: 460px) {
  h1,
  h2 {
    font-size: 3rem;
  }

  .recipient-name,
  .section-title,
  .closing-card h3 {
    font-size: 2.9rem;
  }

  .script-text {
    font-size: 2.15rem;
  }

  .cover-subtitle,
  .scene-copy,
  .message-text,
  .closing-card p,
  .location-card p {
    line-height: 1.72;
  }

  .clock-portal {
    width: 560px;
  }

  .clock-portal span {
    transform:
      translate(-50%, -50%)
      rotate(calc(var(--i) * 30deg))
      translateY(-226px)
      rotate(calc(var(--i) * -30deg));
  }

  .roman-mark {
    font-size: 5.8rem;
  }

  .progress-dots {
    top: auto;
    bottom: 78px;
    right: 50%;
    transform: translateX(50%);
    display: flex;
  }

  .dot.active {
    width: 28px;
    height: 9px;
  }

  .location-btn {
    margin-right: 0;
  }
}
/* FIX SCENE ENVELOPE / KARTU UNDANGAN */
.scene-envelope {
  padding-top: 40px;
  padding-bottom: 120px;
}

.scene-envelope .roman-center {
  top: 7%;
  opacity: 0.55;
  z-index: 1;
}

.envelope-wrap {
  width: min(520px, 90vw);
  height: 360px;
  display: grid;
  place-items: center;
  transform-origin: center;
}

.envelope {
  position: relative;
  width: min(390px, 82vw);
  height: 245px;
  perspective: 1200px;
  transform: translateY(8px);
}

/* Bayangan amplop */
.envelope-shadow {
  position: absolute;
  left: 12%;
  right: 12%;
  bottom: -18px;
  height: 28px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.34);
  filter: blur(13px);
  z-index: 0;
}

/* Badan amplop dibuat lebih pendek dan rapi */
.envelope-body {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 160px;
  border-radius: 0 0 24px 24px;
  background:
    linear-gradient(145deg, rgba(84, 10, 37, 0.96), rgba(6, 31, 62, 0.96));
  border: 1px solid rgba(217, 183, 95, 0.42);
  box-shadow:
    0 24px 64px rgba(0, 0, 0, 0.34),
    inset 0 0 28px rgba(255, 255, 255, 0.04);
  z-index: 3;
}

/* Flap jangan menutupi kartu setelah terbuka */
.envelope-flap {
  position: absolute;
  left: 0;
  top: 84px;
  width: 100%;
  height: 130px;
  background:
    linear-gradient(145deg, rgba(118, 16, 52, 0.98), rgba(67, 9, 33, 0.98));
  border: 1px solid rgba(217, 183, 95, 0.36);
  clip-path: polygon(0 0, 50% 100%, 100% 0);
  transform-origin: top center;
  transform: rotateX(0deg);
  backface-visibility: hidden;
  z-index: 2;
}

/* Kartu dibuat lebih proporsional dan lebih naik */
.letter-card {
  position: absolute;
  left: 50%;
  top: 92px;
  width: 76%;
  height: 190px;
  padding: 28px 18px 24px;
  border-radius: 22px;
  transform: translateX(-50%) translateY(64px) scale(0.9);
  opacity: 0;
  z-index: 5;
  background:
    linear-gradient(180deg, rgba(250, 246, 225, 0.97), rgba(222, 207, 166, 0.94));
  color: #241420;
  border: 1px solid rgba(217, 183, 95, 0.85);
  box-shadow:
    0 18px 46px rgba(0, 0, 0, 0.28),
    inset 0 0 20px rgba(255, 255, 255, 0.28);
}

.letter-card .script-text {
  font-size: clamp(1.6rem, 5vw, 2.4rem);
  margin-bottom: 10px;
  color: rgba(122, 23, 57, 0.28);
  text-shadow: none;
}

.letter-card h3 {
  font-size: clamp(1.75rem, 6vw, 3rem);
  line-height: 0.95;
  letter-spacing: 0.04em;
}

.letter-card small {
  margin-top: 16px;
  font-size: 0.76rem;
  letter-spacing: 0.18em;
  color: rgba(36, 20, 32, 0.62);
}

/* Override animasi amplop lama agar lebih elegan */
@keyframes cardUnfold {
  0% {
    transform: rotateX(0deg);
  }

  100% {
    transform: rotateX(-172deg) translateY(-3px);
  }
}

@keyframes letterRise {
  0% {
    opacity: 0;
    transform: translateX(-50%) translateY(64px) scale(0.9);
    filter: blur(5px);
  }

  60% {
    opacity: 1;
    transform: translateX(-50%) translateY(-82px) scale(1.02);
    filter: blur(0);
  }

  100% {
    opacity: 1;
    transform: translateX(-50%) translateY(-74px) scale(1);
    filter: blur(0);
  }
}

/* Tombol jangan terlalu menempel bawah */
.floating-next {
  bottom: 104px;
  margin-top: 0;
  z-index: 20;
}

/* Scroll hint tidak bertabrakan dengan tombol */
.scene-envelope .scroll-hint {
  bottom: 26px;
}

/* Mobile fix */
@media (max-width: 460px) {
  .scene-envelope {
    padding-top: 24px;
    padding-bottom: 132px;
  }

  .envelope-wrap {
    height: 330px;
    transform: translateY(-8px);
  }

  .envelope {
    width: min(350px, 88vw);
    height: 230px;
  }

  .envelope-body {
    height: 150px;
  }

  .envelope-flap {
    top: 82px;
    height: 122px;
  }

  .letter-card {
    width: 74%;
    height: 176px;
    top: 92px;
    padding: 24px 16px 20px;
  }

  .letter-card h3 {
    font-size: 1.72rem;
  }

  .letter-card small {
    font-size: 0.68rem;
  }

  .floating-next {
    bottom: 96px;
  }

  .scene-envelope .scroll-hint {
    bottom: 20px;
  }
}
/* FIX TEXT PENERIMA AGAR TIDAK PUTUS PER HURUF */
.recipient-name {
  max-width: min(980px, 92vw);
  margin-inline: auto;
  word-break: normal;
  overflow-wrap: normal;
  line-height: 0.95;
}

.recipient-name .name-word {
  display: inline-block;
  white-space: nowrap;
  margin: 0 0.08em;
}

.recipient-name .name-char {
  display: inline-block;
  opacity: 0;
  transform: translateY(18px) rotate(4deg);
  filter: blur(4px);
}

.scene.active-scene .recipient-name .name-char {
  animation: letterReveal 0.62s var(--ease-premium) forwards;
  animation-delay: calc(var(--char) * 0.045s + 0.6s);
}

/* FIX UKURAN NAMA PENERIMA DI LAYAR KECIL */
@media (max-width: 820px) {
  .recipient-name {
    font-size: clamp(2.6rem, 11vw, 4.4rem);
    line-height: 1;
  }
}

@media (max-width: 460px) {
  .recipient-name {
    font-size: clamp(2.25rem, 13vw, 3.3rem);
    line-height: 1.05;
  }
}

/* FIX KARTU AMPLOP AGAR TEKS TIDAK KEPOTONG / MELEBAR */
.letter-card {
  width: min(330px, 74vw);
  height: auto;
  min-height: 176px;
  padding: 26px 18px 22px;
  display: grid;
  place-items: center;
  align-content: center;
  overflow: hidden;
  text-align: center;
}

.letter-card .script-text {
  font-size: clamp(1.55rem, 4.6vw, 2.25rem);
  line-height: 1;
  margin-bottom: 10px;
  opacity: 0.55;
}

.letter-card h3 {
  max-width: 100%;
  font-size: clamp(1.55rem, 5.4vw, 2.65rem);
  line-height: 1.04;
  letter-spacing: 0.055em;
  word-break: normal;
  overflow-wrap: normal;
  text-align: center;
}

.letter-card small {
  margin-top: 14px;
  font-size: clamp(0.62rem, 2.4vw, 0.76rem);
  letter-spacing: 0.16em;
}

/* Jika nama kartu terlalu panjang seperti PERPISAHAN ATHARVA, jangan melebar keluar */
.letter-card h3 br {
  display: none;
}

/* Mobile envelope card fix */
@media (max-width: 460px) {
  .letter-card {
    width: min(300px, 72vw);
    min-height: 166px;
    padding: 22px 14px 18px;
  }

  .letter-card h3 {
    font-size: clamp(1.35rem, 7.4vw, 2rem);
    line-height: 1.08;
    letter-spacing: 0.045em;
  }

  .letter-card .script-text {
    font-size: clamp(1.35rem, 6vw, 1.9rem);
  }

  .letter-card small {
    font-size: 0.62rem;
  }
}
/* FORCE FIX: NAMA PENERIMA TIDAK PECAH PER HURUF */
.recipient-box {
  width: min(980px, calc(100vw - 32px)) !important;
  max-width: calc(100vw - 32px) !important;
  overflow: visible !important;
}

.recipient-name {
  width: 100% !important;
  max-width: 100% !important;
  display: flex !important;
  flex-wrap: wrap !important;
  justify-content: center !important;
  align-items: center !important;
  column-gap: 0.22em !important;
  row-gap: 0.06em !important;
  white-space: normal !important;
  word-break: keep-all !important;
  overflow-wrap: normal !important;
  hyphens: none !important;
  text-align: center !important;
  line-height: 0.92 !important;
  font-size: clamp(3rem, 8vw, 5.8rem) !important;
}

.recipient-name .name-word {
  display: inline-flex !important;
  flex-wrap: nowrap !important;
  white-space: nowrap !important;
  word-break: keep-all !important;
  overflow-wrap: normal !important;
}

.recipient-name .name-space {
  display: none !important;
}

.recipient-name .name-char {
  display: inline-block !important;
  opacity: 0;
  transform: translateY(18px) rotate(4deg);
  filter: blur(4px);
}

.scene.active-scene .recipient-name .name-char {
  animation: letterReveal 0.62s var(--ease-premium) forwards;
  animation-delay: calc(var(--char) * 0.045s + 0.6s);
}

/* Ukuran khusus agar "Komite Sekolah" tidak turun jadi 1 huruf */
@media (max-width: 820px) {
  .recipient-name {
    font-size: clamp(2.35rem, 9.5vw, 4rem) !important;
    line-height: 1 !important;
  }
}

@media (max-width: 520px) {
  .recipient-name {
    font-size: clamp(2rem, 10vw, 3.1rem) !important;
    line-height: 1.04 !important;
    column-gap: 0.16em !important;
  }

  .recipient-box {
    padding-left: 18px !important;
    padding-right: 18px !important;
  }
}

@media (max-width: 390px) {
  .recipient-name {
    font-size: clamp(1.8rem, 9.2vw, 2.65rem) !important;
  }
}

/* FORCE FIX: KARTU AMPLOP BIAR TEKS TIDAK KEPOTONG */
.letter-card {
  width: min(360px, 76vw) !important;
  height: auto !important;
  min-height: 190px !important;
  max-height: none !important;
  padding: 28px 18px 22px !important;
  display: flex !important;
  flex-direction: column !important;
  justify-content: center !important;
  align-items: center !important;
  overflow: hidden !important;
  text-align: center !important;
}

.letter-card .script-text {
  font-size: clamp(1.55rem, 4.5vw, 2.25rem) !important;
  line-height: 1 !important;
  margin-bottom: 12px !important;
  opacity: 0.5 !important;
}

.letter-card h3 {
  width: 100% !important;
  max-width: 100% !important;
  font-size: clamp(1.45rem, 4.6vw, 2.55rem) !important;
  line-height: 1.08 !important;
  letter-spacing: 0.045em !important;
  word-break: normal !important;
  overflow-wrap: normal !important;
  white-space: normal !important;
  text-align: center !important;
}

.letter-card small {
  margin-top: 14px !important;
  font-size: clamp(0.62rem, 2.2vw, 0.76rem) !important;
  letter-spacing: 0.16em !important;
}

/* Paksa judul kartu jadi 2 baris rapi */
.letter-card h3 br {
  display: block !important;
}

/* Fix posisi kartu agar tidak turun kepotong */
@keyframes letterRise {
  0% {
    opacity: 0;
    transform: translateX(-50%) translateY(64px) scale(0.9);
    filter: blur(5px);
  }

  60% {
    opacity: 1;
    transform: translateX(-50%) translateY(-88px) scale(1.02);
    filter: blur(0);
  }

  100% {
    opacity: 1;
    transform: translateX(-50%) translateY(-80px) scale(1);
    filter: blur(0);
  }
}

@media (max-width: 520px) {
  .letter-card {
    width: min(310px, 72vw) !important;
    min-height: 172px !important;
    padding: 22px 14px 18px !important;
  }

  .letter-card h3 {
    font-size: clamp(1.25rem, 6.4vw, 1.85rem) !important;
    line-height: 1.12 !important;
    letter-spacing: 0.04em !important;
  }

  .letter-card .script-text {
    font-size: clamp(1.25rem, 5.5vw, 1.8rem) !important;
  }

  .letter-card small {
    font-size: 0.62rem !important;
  }
}