:root {
  --kraft: #e8d8b8;
  --kraft-dark: #d4c39e;
  --mint: #d4e8d4;
  --blush: #f5d5d5;
  --butter: #f5e8c8;
  --sky: #cde5f5;
  --peach: #f5d5b8;
  --lavender: #d5d0f0;
  --paper: #fdf8f0;
  --ink: #3a3530;
  --red: #c0392b;
  --blue: #2563a8;
  --green: #2d7d46;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  font-family: 'Patrick Hand', cursive;
  color: var(--ink);
  background: var(--paper);
  overflow-x: hidden;
}

#grain {
  position: fixed;
  inset: 0;
  z-index: 9999;
  pointer-events: none;
  opacity: 0.04;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.65' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

#page {
  min-height: 100vh;
  font-size: 18px;
  line-height: 1.6;
}

/* ============ TOKEN GATE ============ */
#gate {
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: var(--kraft);
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100dvh;
}

#gate.invalid {
  background: var(--blush);
}

.gate-card {
  background: var(--paper);
  border: 3px solid var(--ink);
  border-radius: 20px;
  padding: 2rem;
  max-width: 340px;
  text-align: center;
  position: relative;
  box-shadow: 8px 8px 0 var(--ink);
  transform: rotate(-1.5deg);
}

.gate-card::before {
  content: '';
  position: absolute;
  top: -18px;
  left: 50%;
  transform: translateX(-50%) rotate(3deg);
  width: 100px;
  height: 36px;
  background: var(--blue);
  opacity: 0.6;
  border-radius: 2px;
}

.gate-title {
  font-family: 'Permanent Marker', cursive;
  font-size: 1.5rem;
  margin-bottom: 1rem;
}

.gate-guest {
  font-family: 'Shadows Into Light', cursive;
  font-size: 2rem;
  color: var(--red);
  margin: 1rem 0;
}

.gate-btn {
  background: var(--green);
  color: white;
  border: 3px solid var(--ink);
  border-radius: 50px;
  padding: 0.8rem 2rem;
  font-family: 'Permanent Marker', cursive;
  font-size: 1.1rem;
  cursor: pointer;
  box-shadow: 4px 4px 0 var(--ink);
  transition: transform 0.15s, box-shadow 0.15s;
}

.gate-btn:hover {
  transform: translate(2px, 2px);
  box-shadow: 2px 2px 0 var(--ink);
}

.gate-btn:active {
  transform: translate(4px, 4px);
  box-shadow: 0 0 0 var(--ink);
}

.gate-error {
  color: var(--red);
  margin-top: 1rem;
  font-size: 0.95rem;
}

/* ============ SECTION SPREADS ============ */
.spread {
  position: relative;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  padding: 4rem 1.5rem;
}

.spread::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 0;
}

/* Color rotation */
.spread-s1 { background: linear-gradient(135deg, var(--kraft), var(--kraft-dark)); }
.spread-s2 { background: linear-gradient(180deg, var(--mint), #a8d4a8); }
.spread-s3 { background: linear-gradient(135deg, var(--blush), #f0b0b0); }
.spread-s4 { background: linear-gradient(180deg, var(--butter), #f0d890); }
.spread-s5 { background: linear-gradient(135deg, var(--sky), #a8d4f0); }
.spread-s6 { background: linear-gradient(180deg, var(--peach), #f0b890); }
.spread-s7 { background: linear-gradient(135deg, var(--lavender), #b8b0e0); }
.spread-s8 { background: linear-gradient(180deg, var(--paper), var(--kraft)); }

.spread-inner {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 1080px;
  margin: 0 auto;
  flex: 1 1 auto;
  min-width: 0;
}

/* Doodle background elements */
.doodle {
  position: absolute;
  font-size: 4.2rem;
  opacity: 0.6;
  z-index: 0;
  pointer-events: none;
  animation: float-doodle 6s ease-in-out infinite;
  filter: drop-shadow(2px 2px 0 rgba(58,53,48,0.25));
}

@keyframes float-doodle {
  0%, 100% { transform: translateY(0) rotate(0deg); }
  50% { transform: translateY(-15px) rotate(8deg); }
}

/* Washi tape */
.washi {
  position: absolute;
  width: 120px;
  height: 32px;
  background: repeating-linear-gradient(
    90deg,
    currentColor,
    currentColor 4px,
    transparent 4px,
    transparent 8px
  );
  opacity: 0.5;
  z-index: 2;
  pointer-events: none;
}

/* Polaroid frame */
.polaroid {
  background: white;
  padding: 12px 12px 40px 12px;
  border: 2px solid var(--ink);
  box-shadow: 6px 6px 0 rgba(0,0,0,0.15);
  transform: rotate(-2deg);
  position: relative;
  transition: transform 0.3s;
}

.polaroid:hover {
  transform: rotate(0deg) scale(1.03);
}

.polaroid img {
  width: 100%;
  height: 200px;
  object-fit: cover;
  display: block;
  filter: sepia(0.15);
}

.polaroid figcaption {
  font-family: 'Shadows Into Light', cursive;
  font-size: 1rem;
  text-align: center;
  margin-top: 8px;
  color: var(--ink);
}

.polaroid:nth-child(even) { transform: rotate(2deg); }
.polaroid:nth-child(even):hover { transform: rotate(0deg) scale(1.03); }

/* ============ HANDWRITING HEADINGS ============ */
.h-marker {
  font-family: 'Permanent Marker', cursive;
  font-size: clamp(2rem, 5vw, 3.5rem);
  line-height: 1.1;
  color: var(--ink);
  text-shadow: 2px 2px 0 var(--kraft);
}

.h-script {
  font-family: 'Shadows Into Light', cursive;
  font-size: clamp(1.8rem, 4vw, 2.8rem);
  color: var(--red);
}

.h-small {
  font-family: 'Patrick Hand', cursive;
  font-size: 1.1rem;
  opacity: 0.8;
}

/* Highlight marker effect */
.hl {
  background: linear-gradient(90deg, transparent, #ffd700 30%, #ffd700 70%, transparent);
  background-size: 100% 60%;
  background-position: 0 60%;
  background-repeat: no-repeat;
  padding: 0 0.2em;
}

/* ============ COUNTDOWN ============ */
.countdown-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
  max-width: 500px;
  margin: 2rem auto;
}

.cd-cell {
  background: white;
  border: 3px solid var(--ink);
  border-radius: 12px;
  padding: 1rem 0.5rem;
  text-align: center;
  position: relative;
  transform: rotate(-1deg);
  box-shadow: 4px 4px 0 var(--ink);
}

.cd-cell:nth-child(2) { transform: rotate(1deg); }
.cd-cell:nth-child(3) { transform: rotate(-0.5deg); }
.cd-cell:nth-child(4) { transform: rotate(0.5deg); }

.cd-num {
  font-family: 'Permanent Marker', cursive;
  font-size: 2.5rem;
  display: block;
  line-height: 1;
}

.cd-label {
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 2px;
  opacity: 0.7;
}

/* ============ TIMELINE ============ */
.timeline {
  position: relative;
  padding-left: 2rem;
  max-width: 600px;
  margin: 0 auto;
}

/* Two-column timeline on wide screens */
@media (min-width: 760px) {
  #story .timeline {
    max-width: 1000px;
    padding-left: 0;
  }
  #story .timeline::before {
    left: 50%;
    transform: translateX(-50%);
  }
  #story .tl-item {
    width: calc(50% - 3rem);
  }
  #story .tl-item:nth-child(odd) {
    margin-left: 0;
    margin-right: auto;
    text-align: right;
  }
  #story .tl-item:nth-child(odd)::before {
    left: auto;
    right: -3.25rem;
  }
  #story .tl-item:nth-child(even) {
    margin-left: auto;
    margin-right: 0;
  }
  #story .tl-item:nth-child(even)::before {
    left: -3.25rem;
  }
}

.timeline::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 4px;
  background: repeating-linear-gradient(
    to bottom,
    var(--ink) 0px,
    var(--ink) 8px,
    transparent 8px,
    transparent 16px
  );
}

.tl-item {
  position: relative;
  margin-bottom: 2.5rem;
  padding: 1.2rem;
  background: rgba(255,255,255,0.7);
  border: 2px solid var(--ink);
  border-radius: 12px;
  box-shadow: 4px 4px 0 rgba(0,0,0,0.1);
  transform: rotate(-0.5deg);
}

.tl-item:nth-child(even) { transform: rotate(0.5deg); }

.tl-item::before {
  content: '';
  position: absolute;
  left: -2.5rem;
  top: 50%;
  transform: translateY(-50%);
  width: 16px;
  height: 16px;
  background: var(--red);
  border: 3px solid var(--ink);
  border-radius: 50%;
}

.tl-date {
  font-family: 'Permanent Marker', cursive;
  font-size: 1rem;
  color: var(--blue);
  margin-bottom: 0.3rem;
}

.tl-text {
  font-size: 1rem;
  line-height: 1.5;
}

/* ============ STICKY NOTES ============ */
.notes-wall {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  justify-content: center;
  max-width: 700px;
  margin: 0 auto;
}

.sticky-note {
  background: var(--butter);
  border: 2px solid var(--ink);
  padding: 1.2rem;
  min-width: 180px;
  max-width: 240px;
  box-shadow: 5px 5px 0 rgba(0,0,0,0.12);
  position: relative;
  transform: rotate(-2deg);
}

.sticky-note:nth-child(even) {
  background: var(--mint);
  transform: rotate(2deg);
}

.sticky-note:nth-child(3n) {
  background: var(--blush);
  transform: rotate(1deg);
}

.sticky-note::before {
  content: '📌';
  position: absolute;
  top: -12px;
  left: 50%;
  transform: translateX(-50%) rotate(-15deg);
  font-size: 1.2rem;
}

.sticky-note:hover {
  transform: rotate(0deg) scale(1.02);
  transition: transform 0.2s;
}

.note-text {
  font-size: 0.95rem;
  line-height: 1.4;
}

.note-from {
  font-family: 'Shadows Into Light', cursive;
  font-size: 0.85rem;
  color: var(--blue);
  margin-top: 0.5rem;
  text-align: right;
}

/* ============ RSVP FORM ============ */
.rsvp-form {
  background: white;
  border: 3px solid var(--ink);
  border-radius: 16px;
  padding: 2rem;
  max-width: 400px;
  margin: 0 auto;
  box-shadow: 6px 6px 0 var(--ink);
  position: relative;
}

.rsvp-form::before {
  content: '';
  position: absolute;
  top: -14px;
  right: 20px;
  width: 80px;
  height: 28px;
  background: var(--red);
  opacity: 0.4;
  transform: rotate(-5deg);
  border-radius: 2px;
}

.rsvp-form label {
  display: block;
  font-family: 'Permanent Marker', cursive;
  margin-bottom: 0.8rem;
}

.rsvp-form select,
.rsvp-form textarea,
.rsvp-form input[type="number"] {
  width: 100%;
  padding: 0.7rem;
  border: 2px solid var(--ink);
  border-radius: 8px;
  font-family: 'Patrick Hand', cursive;
  font-size: 1rem;
  background: var(--butter);
  margin-top: 0.3rem;
}

.rsvp-form button {
  margin-top: 1rem;
  width: 100%;
  background: var(--green);
  color: white;
  border: 3px solid var(--ink);
  border-radius: 50px;
  padding: 0.7rem;
  font-family: 'Permanent Marker', cursive;
  font-size: 1rem;
  cursor: pointer;
  box-shadow: 4px 4px 0 var(--ink);
  transition: transform 0.15s, box-shadow 0.15s;
}

.rsvp-form button:hover {
  transform: translate(2px, 2px);
  box-shadow: 2px 2px 0 var(--ink);
}

.rsvp-ok {
  text-align: center;
  font-size: 1.2rem;
  color: var(--green);
  margin-top: 1rem;
}

/* ============ WISHES ============ */
.wish-board {
  background: var(--kraft);
  border: 4px solid var(--ink);
  border-radius: 12px;
  padding: 2rem;
  max-width: 600px;
  margin: 0 auto;
  position: relative;
  box-shadow: 8px 8px 0 rgba(0,0,0,0.15);
}

.wish-board::before {
  content: '';
  position: absolute;
  top: 12px;
  left: 12px;
  right: 12px;
  bottom: 12px;
  border: 2px dashed rgba(58,53,48,0.3);
  border-radius: 8px;
  pointer-events: none;
}

.wish-input-row {
  display: flex;
  gap: 0.8rem;
  margin-bottom: 1.5rem;
}

.wish-input-row input {
  flex: 1;
  padding: 0.7rem 1rem;
  border: 2px solid var(--ink);
  border-radius: 50px;
  font-family: 'Patrick Hand', cursive;
  font-size: 1rem;
  background: white;
}

.wish-input-row button {
  background: var(--red);
  color: white;
  border: 2px solid var(--ink);
  border-radius: 50px;
  padding: 0.7rem 1.4rem;
  font-family: 'Permanent Marker', cursive;
  cursor: pointer;
  box-shadow: 3px 3px 0 var(--ink);
}

.wish-list {
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
  max-height: 400px;
  overflow-y: auto;
}

.wish-item {
  background: white;
  border: 2px solid var(--ink);
  border-radius: 10px;
  padding: 0.8rem 1rem;
  font-size: 0.95rem;
  transform: rotate(-0.5deg);
  box-shadow: 3px 3px 0 rgba(0,0,0,0.08);
}

.wish-item:nth-child(even) { transform: rotate(0.5deg); }

.wish-item .wish-name {
  font-family: 'Shadows Into Light', cursive;
  font-size: 0.9rem;
  color: var(--blue);
  margin-bottom: 0.2rem;
}

/* Sticky notes grid fills more space */
@media (min-width: 760px) {
  .notes-wall {
    max-width: 1000px;
    gap: 1.4rem;
  }
  .sticky-note {
    min-width: 240px;
    max-width: 300px;
    padding: 1.4rem;
  }
}

/* Wish board wider */
@media (min-width: 760px) {
  .wish-board { max-width: 760px; }
}

/* RSVP wider on desktop */
@media (min-width: 760px) {
  .rsvp-form { max-width: 460px; }
}

/* ============ SCROLL ANIMATIONS ============ */
.reveal {
  opacity: 0;
  transform: translateY(30px) rotate(-1deg);
  transition: opacity 0.8s ease, transform 0.8s ease;
}

.reveal.visible {
  opacity: 1;
  transform: translateY(0) rotate(0);
}

.reveal-left {
  opacity: 0;
  transform: translateX(-40px) rotate(-2deg);
  transition: opacity 0.8s ease, transform 0.8s ease;
}

.reveal-left.visible {
  opacity: 1;
  transform: translateX(0) rotate(0);
}

/* ============ MARQUEE ============ */
.marquee-wrap {
  overflow: hidden;
  position: relative;
}

.marquee {
  display: flex;
  gap: 2rem;
  white-space: nowrap;
  animation: marquee-scroll 25s linear infinite;
  width: max-content;
}

@keyframes marquee-scroll {
  from { transform: translateX(0); }
  to { transform: translateX(-50%); }
}

.marquee-item {
  font-family: 'Permanent Marker', cursive;
  font-size: 1.5rem;
  padding: 0.5rem 1rem;
  background: rgba(255,255,255,0.5);
  border: 2px solid var(--ink);
  border-radius: 8px;
  display: inline-block;
}

/* ============ TURNTABLE PLAYER ============ */
#player {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 900;
  background: var(--ink);
  color: var(--paper);
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.8rem 1.2rem;
  box-shadow: 0 -4px 20px rgba(0,0,0,0.3);
  transform: translateY(100%);
  transition: transform 0.4s ease;
}

#player.show {
  transform: translateY(0);
}

.player-deck {
  position: relative;
  width: 56px;
  height: 56px;
  flex-shrink: 0;
}

.vinyl {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background:
    radial-gradient(circle at 50% 50%, var(--red) 0 6px, var(--paper) 6px 18%, transparent 19%),
    repeating-radial-gradient(
      circle,
      transparent 0,
      transparent 3px,
      rgba(0,0,0,0.4) 4px,
      rgba(0,0,0,0.4) 5px
    );
  border: 3px solid var(--ink);
  flex-shrink: 0;
  animation: spin-vinyl 2.4s linear infinite;
  animation-play-state: paused;
}

#player.playing .vinyl {
  animation-play-state: running;
}

@keyframes spin-vinyl {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

/* highlight wedge agar rotasi terlihat */
.vinyl::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: conic-gradient(
    from 20deg,
    rgba(255,255,255,0.35) 0deg 24deg,
    transparent 24deg 180deg,
    rgba(255,255,255,0.15) 180deg 200deg,
    transparent 200deg 360deg
  );
  pointer-events: none;
}

.vinyl::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 4px;
  height: 4px;
  background: var(--ink);
  border-radius: 50%;
}

.player-meta {
  flex: 1;
  min-width: 0;
}

.player-track {
  font-family: 'Patrick Hand', cursive;
  font-size: 0.9rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.player-artist {
  font-size: 0.75rem;
  opacity: 0.6;
}

.player-controls {
  display: flex;
  gap: 0.5rem;
  align-items: center;
  flex-shrink: 0;
}

.player-controls button {
  background: rgba(255,255,255,0.1);
  border: 2px solid rgba(255,255,255,0.3);
  color: white;
  border-radius: 50%;
  width: 40px;
  height: 40px;
  cursor: pointer;
  font-size: 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s;
}

.player-controls button:hover {
  background: rgba(255,255,255,0.2);
}

.player-controls button:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.player-progress {
  width: 100%;
  height: 10px;
  background: rgba(255,255,255,0.2);
  border-radius: 5px;
  margin-top: 0.5rem;
  cursor: pointer;
  position: relative;
  touch-action: none;
}

.player-progress-fill {
  height: 100%;
  background: var(--red);
  border-radius: 5px;
  width: 0%;
  position: relative;
  pointer-events: none;
}
/* knob di ujung fill */
.player-progress-fill::after {
  content: '';
  position: absolute;
  right: -5px;
  top: 50%;
  transform: translateY(-50%);
  width: 10px;
  height: 10px;
  background: var(--paper);
  border: 2px solid var(--red);
  border-radius: 50%;
}

/* ============ OUTRO ============ */
.outro-sign {
  font-family: 'Shadows Into Light', cursive;
  font-size: 2rem;
  color: var(--red);
  text-align: center;
  margin-top: 2rem;
}

.outro-heart {
  font-size: 3rem;
  text-align: center;
  animation: pulse-heart 1.5s ease-in-out infinite;
}

@keyframes pulse-heart {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.15); }
}

/* ============ CALENDAR & MAPS ============ */
.action-btns {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
  justify-content: center;
  margin-top: 1.5rem;
}

.action-btn {
  background: white;
  border: 3px solid var(--ink);
  border-radius: 50px;
  padding: 0.6rem 1.4rem;
  font-family: 'Patrick Hand', cursive;
  font-size: 0.95rem;
  text-decoration: none;
  color: var(--ink);
  box-shadow: 3px 3px 0 var(--ink);
  transition: transform 0.15s, box-shadow 0.15s;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}

.action-btn:hover {
  transform: translate(1px, 1px);
  box-shadow: 2px 2px 0 var(--ink);
}

/* ============ LOADING ============ */
#loading {
  position: fixed;
  inset: 0;
  z-index: 2000;
  background: var(--paper);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1rem;
}

.loader-reels {
  font-size: 3rem;
  animation: float-doodle 2s ease-in-out infinite;
}

.loader-text {
  font-family: 'Shadows Into Light', cursive;
  font-size: 1.2rem;
  color: var(--ink);
  opacity: 0.6;
}

/* ============ RESPONSIVE ============ */
@media (max-width: 640px) {
  .countdown-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .cd-cell {
    font-size: 0.9rem;
  }
  .cd-num {
    font-size: 1.8rem;
  }
  .notes-wall {
    flex-direction: column;
    align-items: center;
  }
  .sticky-note {
    min-width: auto;
    width: 90%;
  }
  .marquee {
    animation-duration: 20s;
  }
  .marquee-item {
    font-size: 1.1rem;
  }
}

/* ============ REDUCED MOTION ============ */
@media (prefers-reduced-motion: reduce) {
  .doodle, .outro-heart, .vinyl {
    animation: none !important;
  }
  .marquee {
    animation: none !important;
  }
  .reveal, .reveal-left {
    opacity: 1 !important;
    transform: none !important;
    transition: none !important;
  }
}
/* ============ NEW ANIMATIONS (research batch) ============ */

/* Envelope gate — flap opens on click */
.envelope {
  position: relative;
  width: 260px;
  height: 170px;
  margin: 0 auto 1.5rem;
  perspective: 800px;
}
.env-body {
  position: absolute;
  inset: 0;
  background: var(--paper);
  border: 3px solid var(--ink);
  border-radius: 6px;
  box-shadow: 8px 8px 0 rgba(0,0,0,0.18);
  overflow: hidden;
}
.env-flap {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 52%;
  background: var(--kraft-dark);
  border: 3px solid var(--ink);
  border-radius: 6px 6px 0 0;
  transform-origin: top center;
  transition: transform 0.7s cubic-bezier(0.34, 1.4, 0.64, 1);
  z-index: 3;
  clip-path: polygon(0 0, 100% 0, 50% 100%);
  background: var(--blush);
}
.env-letter {
  position: absolute;
  left: 14px;
  right: 14px;
  top: 14px;
  bottom: 14px;
  background: white;
  border: 2px solid var(--ink);
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Shadows Into Light', cursive;
  font-size: 1.15rem;
  text-align: center;
  transition: transform 0.7s 0.25s cubic-bezier(0.34, 1.3, 0.64, 1);
  z-index: 2;
}
.envelope.open .env-flap {
  transform: rotateX(178deg);
}
.envelope.open .env-letter {
  transform: translateY(-78px) rotate(-3deg);
}
.env-seal {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -42%);
  width: 44px;
  height: 44px;
  background: var(--red);
  border: 3px solid var(--ink);
  border-radius: 50%;
  z-index: 4;
  font-size: 1.2rem;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 0.3s, transform 0.3s;
}
.envelope.open .env-seal {
  opacity: 0;
  transform: translate(-50%, -42%) scale(0.4);
}

/* Marquee ticker strip */
.ticker {
  position: relative;
  z-index: 2;
  overflow: hidden;
  background: var(--ink);
  color: var(--paper);
  border-top: 3px solid var(--ink);
  border-bottom: 3px solid var(--ink);
  padding: 0.45rem 0;
  transform: rotate(-1.2deg);
  width: 100%;
  align-self: stretch;
  margin: 2rem 0 0;
}
.ticker-track {
  display: inline-flex;
  white-space: nowrap;
  animation: ticker-scroll 22s linear infinite;
  will-change: transform;
}
.ticker:hover .ticker-track { animation-play-state: paused; }
@keyframes ticker-scroll {
  from { transform: translateX(0); }
  to { transform: translateX(-50%); }
}
.ticker span {
  font-family: 'Permanent Marker', cursive;
  font-size: 1.05rem;
  letter-spacing: 1px;
  padding: 0 1.6rem;
}
.ticker .dot { color: var(--blush); }

/* Underline redraw (SVG stroke-dash) */
.ul-draw {
  position: relative;
  display: inline-block;
}
.ul-draw svg {
  position: absolute;
  left: 0;
  right: 0;
  bottom: -0.28em;
  width: 100%;
  height: 0.35em;
  overflow: visible;
}
.ul-draw path {
  stroke: var(--red);
  stroke-width: 6;
  fill: none;
  stroke-linecap: round;
  stroke-dasharray: 300;
  stroke-dashoffset: 300;
}
.ul-draw.visible path {
  animation: ul-draw 0.9s 0.35s ease forwards;
}
@keyframes ul-draw {
  to { stroke-dashoffset: 0; }
}

/* Polaroid tilt-in on reveal */
.tilt-in {
  opacity: 0;
  transform: rotate(9deg) scale(0.82) translateY(40px);
  transition: opacity 0.7s ease, transform 0.7s cubic-bezier(0.34, 1.45, 0.64, 1);
}
.tilt-in.visible {
  opacity: 1;
  transform: rotate(-2deg) scale(1) translateY(0);
}

/* Wobble on hover/tap (sticky notes, cards) */
@keyframes wobble {
  0%, 100% { transform: rotate(var(--tilt, -2deg)); }
  25% { transform: rotate(calc(var(--tilt, -2deg) + 3deg)); }
  75% { transform: rotate(calc(var(--tilt, -2deg) - 3deg)); }
}
.sticky-note:hover, .wish-item:hover, .tl-item:hover {
  animation: wobble 0.5s ease-in-out 1;
}

/* Countdown digit pop (flip) */
.cd-num.pop { animation: cd-flip 0.4s cubic-bezier(0.34, 1.4, 0.64, 1); }

/* Wish pop-in (new item enters cork-board) */
@keyframes wish-pop {
  0% { opacity: 0; transform: scale(0.5) rotate(-8deg); }
  60% { opacity: 1; transform: scale(1.08) rotate(2deg); }
  100% { opacity: 1; transform: scale(1) rotate(-0.5deg); }
}
.wish-item.new {
  animation: wish-pop 0.55s cubic-bezier(0.34, 1.45, 0.64, 1);
}

/* Ken Burns on venue photo */
.kenburns img, .kenburns .venue-art {
  animation: kenburns 18s ease-in-out infinite alternate;
}
.venue-art {
  width: 100%;
  height: 200px;
  display: block;
}
@keyframes kenburns {
  0% { transform: scale(1.02) translate(0, 0); }
  100% { transform: scale(1.14) translate(-2%, 2%); }
}

/* Rotating badge (save-the-date stamp) */
.badge-spin {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 92px;
  height: 92px;
  border: 3px dashed var(--red);
  border-radius: 50%;
  font-family: 'Permanent Marker', cursive;
  font-size: 0.8rem;
  color: var(--red);
  text-align: center;
  line-height: 1.1;
  animation: badge-rotate 14s linear infinite;
  background: rgba(255,255,255,0.75);
  margin: 0.8rem 0;
}
@keyframes badge-rotate {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

/* Tonearm on player — anchor di pojok kanan-atas vinyl, ujung stylus menyentuh groove saat playing */
.tonearm {
  position: absolute;
  width: 38px;
  height: 3px;
  background: var(--paper);
  border-radius: 2px;
  transform-origin: 34px 50%;   /* pivot di ujung kanan */
  transform: rotate(-42deg);    /* parkir: menjauh dari vinyl */
  transition: transform 0.6s cubic-bezier(0.34, 1.3, 0.64, 1);
  top: -2px;
  right: -6px;
  z-index: 2;
  box-shadow: 0 1px 2px rgba(0,0,0,0.5);
}
/* stylus tip di ujung kiri */
.tonearm::before {
  content: '';
  position: absolute;
  left: -3px;
  top: 50%;
  transform: translateY(-50%);
  width: 6px;
  height: 6px;
  background: var(--paper);
  border-radius: 50% 0 0 50%;
  box-shadow: -1px 1px 1px rgba(0,0,0,0.4);
}
#player.playing .tonearm { transform: rotate(-14deg); }  /* turun menyentuh groove */

/* Parallax doodle layer */
.doodle-parallax {
  will-change: transform;
}

/* Sparkle burst anchor */
.sparkle {
  position: absolute;
  pointer-events: none;
  z-index: 5;
  font-size: 1.7rem;
  opacity: 0;
  animation: sparkle-fade 2.4s ease-in-out infinite;
  filter: drop-shadow(1px 1px 0 rgba(58,53,48,0.3));
}
@keyframes sparkle-fade {
  0%, 100% { opacity: 0; transform: scale(0.4) rotate(0deg); }
  50% { opacity: 0.9; transform: scale(1) rotate(45deg); }
}

/* Wishes marquee (horizontal blessings strip) */
.wish-ticker {
  overflow: hidden;
  margin-top: 1.5rem;
  border-top: 2px dashed rgba(58,53,48,0.35);
  border-bottom: 2px dashed rgba(58,53,48,0.35);
  padding: 0.5rem 0;
  background: rgba(255,255,255,0.4);
}
.wish-ticker-track {
  display: inline-flex;
  white-space: nowrap;
  animation: ticker-scroll 35s linear infinite;
}
.wish-ticker-track .wt {
  font-family: 'Shadows Into Light', cursive;
  font-size: 1rem;
  color: var(--ink);
  padding: 0 1.4rem;
}
.wish-ticker-track .wt b { color: var(--blue); }

/* Envelope gate button bounce attention */
@keyframes attn {
  0%, 100% { transform: translateY(0) rotate(0deg); }
  50% { transform: translateY(-6px) rotate(-1deg); }
}
.gate-btn.attn { animation: attn 1.6s ease-in-out infinite; }

/* Reduced motion extensions */
@media (prefers-reduced-motion: reduce) {
  .ticker-track, .wish-ticker-track, .badge-spin, .kenburns img,
  .sparkle, .gate-btn.attn {
    animation: none !important;
  }
  .ul-draw path { stroke-dashoffset: 0 !important; animation: none !important; }
  .tilt-in { opacity: 1 !important; transform: none !important; }
  .cd-num.pop, .wish-item.new { animation: none !important; }
  .envelope .env-flap, .envelope .env-letter { transition: none !important; }
}
/* ============ SCRAPBOOK DENSE LAYER ============ */

/* Hand-drawn SVG containers */
.draw-svg { position: absolute; display: block; pointer-events: none; opacity: 0.75; }
.draw-svg svg { display: block; overflow: visible; }
.draw-svg path { vector-effect: non-scaling-stroke; }
.draw-svg.drawn path { transition: stroke-dashoffset 0.9s ease; stroke-dashoffset: 0; }

/* Parallax layers — absolutely positioned inside .spread, moved by JS var(--py) */
.plx { position: absolute; pointer-events: none; opacity: 0; transition: opacity 0.6s ease, transform 0.2s linear; will-change: transform; }
.spread.inview .plx { opacity: 1; }
.plx-float { animation: plx-float 5.5s ease-in-out infinite alternate; }
@keyframes plx-float { from { margin-top: -6px; } to { margin-top: 10px; } }

/* Confetti trail pieces (tiny marks along scroll) */
.trail { position: absolute; font-size: 0.9rem; pointer-events: none; opacity: 0.55; }
.trail.pop { animation: trail-pop 0.9s ease forwards; }
@keyframes trail-pop {
  0% { transform: translateY(6px) scale(0.4) rotate(0deg); opacity: 0; }
  40% { opacity: 0.85; }
  100% { transform: translateY(-14px) scale(1.1) rotate(20deg); opacity: 0.55; }
}

/* Sticky mini-note (progress marker) */
.mini-note {
  position: absolute;
  top: 14vh;
  right: 1.5rem;
  width: max-content;
  background: var(--butter);
  border: 2px solid var(--ink);
  padding: 0.35rem 0.7rem;
  font-family: 'Shadows Into Light', cursive;
  font-size: 0.9rem;
  transform: rotate(3deg);
  box-shadow: 3px 3px 0 rgba(0,0,0,0.15);
  z-index: 3;
  pointer-events: none;
}
.mini-note:nth-child(odd) { transform: rotate(-3deg); }

/* Section header underline draw (SVG wavy) */
.sec-ul { display: block; margin: 0.1rem auto 0.4rem; width: min(220px, 60%); height: 12px; }
.sec-ul path { stroke: var(--red); stroke-width: 5; fill: none; stroke-linecap: round; stroke-dasharray: 100; stroke-dashoffset: 100; }
.sec-ul.drawn path { transition: stroke-dashoffset 0.8s 0.2s ease; stroke-dashoffset: 0; }

/* ============ SCRAPBOOK BACKGROUND TEXTURE ============ */

/* Graph-paper / notebook grid overlay on every spread */
.spread::after {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  opacity: 0.35;
  background-image:
    repeating-linear-gradient(0deg, rgba(58,53,48,0.13) 0 1px, transparent 1px 28px),
    repeating-linear-gradient(90deg, rgba(58,53,48,0.13) 0 1px, transparent 1px 28px);
  mask-image: radial-gradient(ellipse at center, black 55%, transparent 100%);
}
.spread-s2::after { opacity: 0.28; background-image: repeating-linear-gradient(0deg, rgba(58,53,48,0.14) 0 1px, transparent 1px 24px), repeating-linear-gradient(90deg, rgba(58,53,48,0.14) 0 1px, transparent 1px 24px); }
.spread-s4::after { background-image: repeating-linear-gradient(0deg, rgba(58,53,48,0.12) 0 1px, transparent 1px 32px), repeating-linear-gradient(90deg, rgba(58,53,48,0.12) 0 1px, transparent 1px 32px); }
.spread-s6::after { background-image: radial-gradient(rgba(58,53,48,0.22) 1px, transparent 1.6px); background-size: 22px 22px; opacity: 0.5; }
.spread-s8::after { background-image: repeating-linear-gradient(0deg, rgba(58,53,48,0.1) 0 1px, transparent 1px 30px), repeating-linear-gradient(90deg, rgba(58,53,48,0.1) 0 1px, transparent 1px 30px); opacity: 0.25; }

/* Torn-paper edge divider between spreads */
.spread + .spread::before {
  content: '';
  position: absolute;
  top: -14px;
  left: 0;
  right: 0;
  height: 28px;
  background: inherit;
  clip-path: polygon(0 0, 4% 55%, 9% 12%, 15% 62%, 22% 20%, 28% 68%, 35% 18%, 42% 60%, 49% 14%, 56% 64%, 63% 22%, 70% 58%, 77% 16%, 84% 62%, 91% 20%, 96% 58%, 100% 10%, 100% 0, 0 0);
  z-index: 2;
}

/* Notebook margin line down each spread */
.spread-inner { position: relative; }

/* ==== Doodle garden scene (generated assets) ==== */
.scene { position:absolute; inset:0; overflow:hidden; pointer-events:none; z-index:0; }
.scene img { position:absolute; display:block; user-select:none; -webkit-user-drag:none; }
/* hero: konten atas, scene strip bawah (ponytail: scene hanya hidup di 40% bawah) */
#hero { justify-content: flex-start; padding-bottom: 34vh; }
#hero .spread-inner { margin-top: 1vh; flex: 0 0 auto; transform: scale(.86); transform-origin: top center; z-index: 0; }
#hero .scene { top: 42%; bottom: 150px; z-index: 1; }
#hero .ticker { margin-top: auto; z-index: 1; position: relative; }
/* couple: naikkan saat player muncul */
/* couple: tetap di tanah (ground line), naik tipis saat player muncul */
body.player-on .sc-couple { bottom: 6%; }
.sc-sun-wrap  { position:absolute; top:2%; right:6%; width:clamp(60px,8vw,105px); }
.sc-sun-wrap .sc-sun-glow { position:absolute; inset:-60%; border-radius:50%; background:radial-gradient(circle,rgba(212,167,55,.28),transparent 65%); animation:sc-pulse 5s ease-in-out infinite; }
.sc-sun        { position:relative; width:100%; animation:sc-pulse 5s ease-in-out infinite; }
.sc-cloud-a    { top:4%;  left:4%;   width:clamp(100px,14vw,200px); animation:sc-drift 70s linear infinite; }
.sc-cloud-b    { top:18%; right:22%; width:clamp(60px,9vw,125px);  animation:sc-drift 95s linear infinite reverse; opacity:.9; }
.sc-mosque     { bottom:5%; right:0%; width:clamp(220px,32vw,420px); opacity:.95; }
.sc-tree       { position:absolute; bottom:4%; left:-4%; width:clamp(280px,40vw,480px); }
.sc-leaf       { position:absolute; width:clamp(60px,8vw,110px); transform-origin:50% 90%; animation:sc-sway 4.5s ease-in-out infinite alternate; }
.sc-leaf-1 { top:6%;  left:8%;  animation-duration:4.2s; }
.sc-leaf-2 { top:2%;  left:38%; animation-duration:5.1s; animation-delay:-1.4s; }
.sc-leaf-3 { top:12%; left:60%; animation-duration:3.8s; animation-delay:-2.2s; }
.sc-leaf-4 { top:0%;  left:72%; width:clamp(50px,7vw,95px); animation-duration:4.8s; animation-delay:-.8s; }
.sc-couple     { bottom:4%; left:32%; transform:translateX(-50%); width:clamp(170px,22vw,280px); }
.sc-lamp       { bottom:5%; left:4%; width:clamp(70px,9vw,120px); }
.sc-lantern    { top:6%; left:12%; width:clamp(22px,3vw,38px); transform-origin:50% 0; animation:sc-swing 3.6s ease-in-out infinite alternate; }
.sc-fence      { bottom:5%; right:20%; width:clamp(70px,9vw,130px); opacity:.9; }
.sc-bush       { bottom:4%; right:34%; width:clamp(60px,8vw,110px); }
.sc-grass-a    { bottom:3%;  left:30%; width:clamp(55px,7.5vw,100px); transform-origin:50% 100%; animation:sc-sway 3.4s ease-in-out infinite alternate; }
.sc-grass-b    { bottom:3%;  right:8%; width:clamp(46px,6.5vw,88px);  transform-origin:50% 100%; animation:sc-sway 4.1s ease-in-out -1.2s infinite alternate; }
.sc-flower-a   { bottom:3.5%; left:20%; width:clamp(28px,3.8vw,50px); transform-origin:50% 100%; animation:sc-nod 3.8s ease-in-out infinite alternate; }
.sc-flower-b   { bottom:3%;  right:14%; width:clamp(28px,3.8vw,50px); transform-origin:50% 100%; animation:sc-nod 4.4s ease-in-out -1.6s infinite alternate; }
.sc-flower-c   { bottom:3.5%; left:70%; width:clamp(26px,3.4vw,46px); transform-origin:50% 100%; animation:sc-nod 3.2s ease-in-out -.7s infinite alternate; }
.sc-stones     { bottom:2.5%; left:8%; width:clamp(80px,11vw,150px); opacity:.85; }
.sc-mushroom   { bottom:3%;  left:44%; width:clamp(24px,3.2vw,42px); }
.sc-balloon    { top:6%; left:34%;  width:clamp(36px,5vw,68px); animation:sc-floaty 6s ease-in-out infinite; }
.sc-jar        { bottom:4%;  left:56%; width:clamp(32px,4.2vw,56px); animation:sc-flicker 3s ease-in-out infinite; }
.sc-notes      { top:8%; left:20%; width:clamp(44px,6vw,82px); animation:sc-floaty 7s ease-in-out -2s infinite; opacity:.85; }
.sc-bird       { position:absolute; top:12%; left:0; width:clamp(44px,5.5vw,78px); aspect-ratio:1.45; animation:sc-fly 26s linear infinite; }
.sc-butterfly  { position:absolute; top:30%; left:0; width:clamp(32px,4.2vw,56px); aspect-ratio:1.1; animation:sc-flutter 30s linear -8s infinite; }
/* sprites (frame-stepped) */
.sc-bird-frames, .sc-butterfly-frames { position:absolute; inset:0; }
.sc-bird-frames img, .sc-butterfly-frames img { position:absolute; inset:0; width:100%; height:100%; object-fit:contain; opacity:0; animation:sc-frame3 .9s steps(1) infinite; }
.sc-bird-frames img:nth-child(2), .sc-butterfly-frames img:nth-child(2) { animation-delay:.3s; }
.sc-bird-frames img:nth-child(3), .sc-butterfly-frames img:nth-child(3) { animation-delay:.6s; }
.sc-butterfly-frames img { animation-duration:.6s; }
.sc-butterfly-frames img:nth-child(2) { animation-delay:.2s; }
.sc-butterfly-frames img:nth-child(3) { animation-delay:.4s; }
@keyframes sc-frame3 { 0%{opacity:1} 33.4%{opacity:1} 33.5%{opacity:0} 100%{opacity:0} }
@keyframes sc-drift   { from { transform:translateX(-18vw) } to { transform:translateX(104vw) } }
@keyframes sc-sway    { from { transform:rotate(-4deg) } to { transform:rotate(4.5deg) } }
@keyframes sc-swing   { from { transform:rotate(-7deg) } to { transform:rotate(7deg) } }
@keyframes sc-nod     { from { transform:rotate(-6deg) } to { transform:rotate(3deg) } }
@keyframes sc-floaty  { 0%,100% { transform:translateY(0) } 50% { transform:translateY(-14px) } }
@keyframes sc-pulse   { 0%,100% { transform:scale(1) } 50% { transform:scale(1.06) } }
@keyframes sc-flicker { 0%,100% { filter:drop-shadow(0 0 4px rgba(212,167,55,.5)) } 50% { filter:drop-shadow(0 0 12px rgba(212,167,55,.9)) } }
@keyframes sc-fly     { 0% { transform:translate(-10vw,0) } 50% { transform:translate(48vw,3vh) } 100% { transform:translate(108vw,-1vh) } }
@keyframes sc-flutter { 0% { transform:translate(-8vw,0) } 25% { transform:translate(24vw,-4vh) } 50% { transform:translate(52vw,2vh) } 75% { transform:translate(76vw,-3vh) } 100% { transform:translate(106vw,1vh) } }
@media (max-width: 640px) {
  #hero { padding-bottom: 42vh; }
  #hero .scene { top: 46%; bottom: 120px; }
  .sc-fence, .sc-stones, .sc-mushroom, .sc-bush, .sc-jar { display:none; }
  .sc-couple { width:clamp(150px,44vw,220px); left:26%; }
  .sc-mosque { width:clamp(130px,38vw,200px); }
  .sc-tree   { width:clamp(130px,38vw,200px); }
}
@media (prefers-reduced-motion: reduce) { .scene * { animation: none !important; } }

/* Hero: scene depth via JS transform (will-change); konten card biasa */
#hero .scene { will-change: transform; }

/* ============ STORY: split 2-col, side drift via JS ============ */
.story-grid { position: relative; }
@media (min-width: 760px) {
  #story { padding: 4rem 0; }
  .story-grid {
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: 3rem;
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 2rem;
  }
  .story-side {
    position: sticky;
    top: 0;
    height: 100vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: flex-start;
    gap: 2rem;
    pointer-events: none;
  }
  .story-side-img {
    position: absolute;
    left: 0;
    width: 100%;
    opacity: 0.9;
    will-change: transform;
  }
  .story-side-bike   { top: 8%;  width: 200px; }
  .story-side-coffee { top: 38%; width: 140px; left: 30px; }
  .story-side-heart  { top: 65%; width: 90px;  left: 60px; }
  .story-content { position: relative; z-index: 1; }
  .story-content > * { position: relative; z-index: 1; }
}
@media (max-width: 759px) {
  .story-side { display: none; }
  .story-grid { display: block; }
  .story-content { width: 100%; }
}

/* ============ COUNTDOWN: clock drift ============ */
.cd-clock {
  position: absolute;
  top: 12%;
  right: 6%;
  width: 110px;
  opacity: 0.14;
  z-index: 0;
  pointer-events: none;
  will-change: transform;
}

/* ============ QUOTES: stacked card drift ============ */
.quotes-stack-wrap { position: relative; z-index: 1; }
.quotes-card { position: relative; will-change: transform, opacity; }

/* ============ RSVP: side drift ============ */
.rsvp-side {
  position: absolute;
  width: 120px;
  opacity: 0.28;
  z-index: 0;
  pointer-events: none;
  will-change: transform;
}
.rsvp-side-left { top: 18%; left: 5%; }
.rsvp-side-right { bottom: 15%; right: 5%; }
@media (max-width: 700px) { .rsvp-side { width: 70px; opacity: 0.18; } }

/* ============ WISHES: corner drift ============ */
.wishes-corner {
  position: absolute;
  opacity: 0.2;
  z-index: 0;
  pointer-events: none;
  will-change: transform;
}
.wishes-corner-heart { top: 10%; right: 6%; width: 100px; }
.wishes-corner-gift  { bottom: 12%; left: 6%;  width: 90px; }
@media (max-width: 700px) { .wishes-corner { width: 56px; opacity: 0.15; } }

/* ============ OUTRO: zoom-in ============ */
.outro-zoom {
  position: absolute;
  opacity: 0;
  z-index: 0;
  pointer-events: none;
  will-change: transform, opacity;
}
.outro-zoom:not(.outro-zoom-dove) { top: 8%; left: 5%; width: 150px; }
.outro-zoom-dove { bottom: 10%; right: 5%; width: 110px; }
@media (max-width: 700px) { .outro-zoom { width: 70px; } .outro-zoom-dove { width: 55px; } }

/* ============ EVENT: full-bleed mosque bg + drift ============ */
.event-bg {
  position: absolute;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
  z-index: 0;
}
.event-bg-img {
  position: absolute;
  top: 8%;
  right: 4%;
  width: clamp(180px, 26vw, 320px);
  opacity: 0.13;
  will-change: transform;
}
.event-bg-envelop {
  position: absolute;
  bottom: 10%;
  left: 5%;
  width: clamp(90px, 13vw, 150px);
  opacity: 0.18;
  will-change: transform;
}
.event-inner { z-index: 1; position: relative; }
@media (max-width: 640px) {
  .event-bg-img { top: 4%; right: 2%; width: 140px; }
  .event-bg-envelop { display: none; }
}

.spread-inner::before {
  content: '';
  position: absolute;
  left: -2.2rem;
  top: 0;
  bottom: 0;
  width: 2px;
  background: rgba(192,57,43,0.35);
  pointer-events: none;
}
@media (max-width: 640px) { .spread-inner::before { display: none; } }

/* Corner doodle marks: 4 pencil corners per spread */
.corner {
  position: absolute;
  width: 64px;
  height: 64px;
  pointer-events: none;
  opacity: 0.75;
  z-index: 1;
}
.corner::before, .corner::after {
  content: '';
  position: absolute;
  background: var(--ink);
  border-radius: 2px;
}
.corner::before { width: 100%; height: 3px; }
.corner::after { width: 3px; height: 100%; }
.corner-tl { top: 16px; left: 16px; }
.corner-tl::before { top: 0; left: 0; }
.corner-tl::after { top: 0; left: 0; }
.corner-tr { top: 16px; right: 16px; }
.corner-tr::before { top: 0; right: 0; }
.corner-tr::after { top: 0; right: 0; }
.corner-bl { bottom: 16px; left: 16px; }
.corner-bl::before { bottom: 0; left: 0; }
.corner-bl::after { bottom: 0; left: 0; }
.corner-br { bottom: 16px; right: 16px; }
.corner-br::before { bottom: 0; right: 0; }
.corner-br::after { bottom: 0; right: 0; }

/* Lined-paper heading block (ruled underline behind h2) */
.spread-inner > .h-marker {
  display: block;
  width: fit-content;
  margin-left: auto;
  margin-right: auto;
}
.spread-inner > .h-marker::after {
  content: '';
  display: block;
  width: 130%;
  margin: 0.35rem 0 0 -15%;
  height: 8px;
  background: repeating-linear-gradient(90deg, var(--ink) 0 10px, transparent 10px 20px);
  opacity: 0.35;
  transform: rotate(-0.6deg);
}

/* Scalloped paper edge frame on each spread (visual border) */
.spread-inner {
  padding: 1.4rem 1.6rem;
  background: rgba(255,255,255,0.32);
  border: 2.5px solid var(--ink);
  border-radius: 18px;
  box-shadow: 8px 8px 0 rgba(58,53,48,0.18);
}
.spread-s1 .spread-inner { background: var(--paper); }
.spread-s3 .spread-inner { background: rgba(245,213,213,0.45); }
.spread-s7 .spread-inner { background: rgba(213,208,240,0.4); }

/* Photo tape on heading block */
.h-marker { position: relative; }
.h-marker::before {
  content: '';
  position: absolute;
  top: -14px;
  left: 50%;
  transform: translateX(-50%) rotate(-4deg);
  width: 110px;
  height: 26px;
  background: repeating-linear-gradient(90deg, var(--butter), var(--butter) 6px, transparent 6px, transparent 11px);
  opacity: 0.85;
  border: 1.5px solid rgba(58,53,48,0.5);
  border-radius: 2px;
}

/* Confetti paper scraps (torn paper bits scattered) */
.paper-bit {
  position: absolute;
  pointer-events: none;
  z-index: 1;
  opacity: 0.9;
  border: 2px solid var(--ink);
  border-radius: 2px;
  box-shadow: 2px 2px 0 rgba(0,0,0,0.15);
}
.paper-bit.pb1 { background: var(--blush); width: 46px; height: 30px; transform: rotate(-12deg); }
.paper-bit.pb2 { background: var(--sky); width: 36px; height: 46px; transform: rotate(8deg); }
.paper-bit.pb3 { background: var(--butter); width: 52px; height: 26px; transform: rotate(-4deg); }
.paper-bit.pb4 { background: var(--mint); width: 30px; height: 40px; transform: rotate(14deg); }

/* Mini doodle rain: aset FLUX kecil, bobbing pelan */
.doodle-rain {
  position: absolute;
  pointer-events: none;
  z-index: 1;
  opacity: 0.65;
  animation: float-doodle 7s ease-in-out infinite;
}

/* Big center doodle — sudah dihapus, CSS dipertahankan saja */
.spin-slow { animation: spin-slow 18s linear infinite; }
@keyframes spin-slow { from { transform: translate(-50%,-50%) rotate(0deg); } to { transform: translate(-50%,-50%) rotate(360deg); } }
.pulse-soft { animation: pulse-soft 3.5s ease-in-out infinite; }
@keyframes pulse-soft { 0%,100% { transform: scale(1); opacity: 0.12; } 50% { transform: scale(1.12); opacity: 0.18; } }

/* Washi tape scraps (corner markers) */
.scrap { position: absolute; width: 90px; height: 26px; pointer-events: none; z-index: 1; opacity: 0.75; }
.scrap::after { content: ''; position: absolute; inset: 0; border-radius: 2px; }
.scrap-a { transform: rotate(-14deg); }
.scrap-a::after { background: repeating-linear-gradient(90deg, var(--red), var(--red) 6px, transparent 6px, transparent 12px); opacity: 0.5; }
.scrap-b { transform: rotate(11deg); }
.scrap-b::after { background: repeating-linear-gradient(90deg, var(--blue), var(--blue) 6px, transparent 6px, transparent 12px); opacity: 0.5; }
.scrap-c { transform: rotate(-6deg); }
.scrap-c::after { background: repeating-linear-gradient(90deg, var(--green), var(--green) 6px, transparent 6px, transparent 12px); opacity: 0.45; }

/* Polaroid stack on timeline */
.tl-item { position: relative; }
.tl-item .tl-photo {
  width: 72px; height: 54px; background: white; border: 2px solid var(--ink);
  position: absolute; right: -14px; top: -14px; transform: rotate(6deg);
  box-shadow: 3px 3px 0 rgba(0,0,0,0.15);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.4rem; overflow: hidden;
}
.tl-item:nth-child(even) .tl-photo { transform: rotate(-6deg); right: auto; left: -14px; }

/* Scroll progress bar top */
#progressbar {
  position: fixed; top: 0; left: 0; height: 4px; background: var(--red);
  width: 0%; z-index: 1100; transition: width 0.1s linear;
  box-shadow: 0 1px 0 rgba(0,0,0,0.2);
}

/* Flying envelope (follows scroll between sections) */
#fly-env {
  position: fixed; right: 14px; top: 50%; transform: translateY(-50%) rotate(8deg);
  width: 46px; height: auto; z-index: 800; pointer-events: none;
  transition: transform 0.25s ease, opacity 0.3s;
  opacity: 0.9;
  filter: drop-shadow(2px 3px 0 rgba(58,53,48,0.18));
}
#fly-env.hidden { opacity: 0; }

/* Wishes paper plane burst */
.plane { position: absolute; font-size: 1.4rem; pointer-events: none; z-index: 4; animation: plane-fly 2.2s ease-out forwards; }
@keyframes plane-fly {
  0% { transform: translate(0, 0) rotate(0deg); opacity: 0; }
  15% { opacity: 1; }
  100% { transform: translate(40vw, -60vh) rotate(35deg); opacity: 0; }
}

/* Countdown ticker cells flip */
.cd-cell { perspective: 200px; }
.cd-num { display: inline-block; }
.cd-num.pop { animation: cd-flip 0.4s cubic-bezier(0.34, 1.4, 0.64, 1); }
@keyframes cd-flip {
  0% { transform: rotateX(90deg); }
  100% { transform: rotateX(0deg); }
}

/* Sparkle shower on gate open */
.sparkle-shower span { position: absolute; pointer-events: none; animation: shower-fall 1.8s ease-in forwards; }
@keyframes shower-fall {
  0% { transform: translateY(-20vh) rotate(0deg); opacity: 0; }
  20% { opacity: 1; }
  100% { transform: translateY(110vh) rotate(720deg); opacity: 0; }
}

/* Heart pulse rings on hero button hover */
.pulse-ring { position: absolute; border: 2px solid var(--red); border-radius: 50%; opacity: 0; animation: ring-out 1.6s ease-out infinite; }
@keyframes ring-out { 0% { transform: scale(0.4); opacity: 0.8; } 100% { transform: scale(2.2); opacity: 0; } }

@media (prefers-reduced-motion: reduce) {
  .plx-float, .trail.pop, .plane, .sparkle-shower span, .pulse-ring, .cd-num.pop,
  .sec-ul path, .draw-svg path { stroke-dashoffset: 0 !important; transition: none !important; }
}
