@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:ital,wght@0,500;0,700;1,600&family=Quicksand:wght@400;500;600;700&family=Vazirmatn:wght@400;600;700&family=Dancing+Script:wght@600;700&family=Cormorant+Garamond:ital,wght@0,500;0,600;1,600&family=Baloo+2:wght@500;700&family=Bebas+Neue&family=Aref+Ruqaa:wght@400;700&display=swap');

:root {
  --blush: #ffe4ec;
  --blush-deep: #ffb6c9;
  --cream: #fff8f3;
  --lavender: #e5d4f7;
  --rose-text: #8a4a5c;
  --rose-dark: #6b3648;
  --accent: #ff8fab;
  --accent-soft: #ffd4e0;
  --white: #ffffff;
  --shadow: 0 6px 16px rgba(138, 74, 92, 0.16);
  --radius: 20px;
}

* { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  scroll-snap-type: y mandatory;
  scrollbar-width: none; /* Firefox: hide native, the fun scrollbar replaces it */
}

/* Suspended while dragging/clicking the fun scrollbar so a big jump can actually
   land — see initFunScrollbar in app.js for why. */
html.snap-suspended {
  scroll-snap-type: none;
}

html::-webkit-scrollbar { display: none; } /* Chrome/Edge/Safari */

body {
  margin: 0;
  font-family: 'Quicksand', 'Vazirmatn', sans-serif;
  background: linear-gradient(180deg, var(--cream), var(--blush) 40%, var(--lavender) 100%);
  color: var(--rose-dark);
  overflow-x: hidden;
}

/* ---------- Fun custom scrollbar (replaces the native one) ---------- */
.fun-scrollbar {
  position: fixed;
  top: 0;
  right: 6px;
  height: 100vh;
  width: 30px;
  z-index: 500;
  opacity: 1;
  transition: opacity 0.4s ease;
}

.fun-scrollbar.hidden {
  opacity: 0;
  pointer-events: none;
}

.fun-scrollbar-track {
  position: relative;
  width: 6px;
  height: calc(100% - 40px);
  margin: 20px auto;
  background: rgba(255, 255, 255, 0.45);
  border-radius: 6px;
  cursor: pointer;
}

.fun-scrollbar-thumb {
  position: absolute;
  left: 50%;
  top: 0;
  transform: translate(-50%, 0);
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), var(--blush-deep));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  box-shadow: var(--shadow);
  cursor: grab;
  transition: transform 0.15s ease;
}

.fun-scrollbar-thumb:active {
  cursor: grabbing;
  transform: translate(-50%, 0) scale(1.15);
}

h1, h2, h3, .serif {
  font-family: 'Playfair Display', serif;
}

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

button {
  font-family: 'Quicksand', sans-serif;
  cursor: pointer;
  border: none;
}

.hidden { display: none !important; }

/* ---------- Lock screen (Windows 7 style) ---------- */
#lock-screen.win7 {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  font-family: 'Segoe UI', 'Quicksand', sans-serif;
  color: white;
}

.win7-bg {
  position: absolute;
  inset: 0;
  background: url('../assets/lock-background.jpg') center top / cover no-repeat;
  overflow: hidden;
}

.win7-bg::after {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 50% 42%, rgba(10,10,30,0.55) 0%, rgba(10,10,30,0.7) 100%);
}

.win7-glow,
.win7-lines,
.win7-bokeh,
.win7-petal {
  display: none;
}

.win7-glow {
  position: absolute;
  right: -10%;
  bottom: -20%;
  width: 60%;
  height: 70%;
  background: radial-gradient(circle, rgba(255,255,255,0.85) 0%, rgba(255,255,255,0) 70%);
}

.win7-lines {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.win7-lines path {
  fill: none;
  stroke: rgba(255, 255, 255, 0.55);
  stroke-width: 1.5;
}

.win7-bokeh {
  position: absolute;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, rgba(255,255,255,0.9), rgba(255,255,255,0.05) 70%);
  filter: blur(1px);
  animation: bokehFloat 8s ease-in-out infinite;
}

.win7-bokeh.b1 { width: 90px; height: 90px; left: 8%; top: 20%; animation-delay: 0s; }
.win7-bokeh.b2 { width: 50px; height: 50px; left: 20%; top: 55%; animation-delay: 1.5s; }
.win7-bokeh.b3 { width: 130px; height: 130px; right: 12%; top: 30%; animation-delay: 0.8s; }
.win7-bokeh.b4 { width: 60px; height: 60px; right: 25%; top: 65%; animation-delay: 2.2s; }
.win7-bokeh.b5 { width: 40px; height: 40px; left: 45%; top: 12%; animation-delay: 3s; }

@keyframes bokehFloat {
  0%, 100% { transform: translateY(0); opacity: 0.8; }
  50% { transform: translateY(-18px); opacity: 1; }
}

.win7-petal {
  position: absolute;
  font-size: 22px;
  opacity: 0.8;
  animation: bokehFloat 6s ease-in-out infinite;
}
.win7-petal.p1 { left: 15%; bottom: 15%; animation-delay: 0.5s; }
.win7-petal.p2 { right: 18%; bottom: 22%; animation-delay: 1.8s; }
.win7-petal.p3 { left: 60%; top: 18%; animation-delay: 2.6s; }

.win7-lang {
  position: absolute;
  top: 16px;
  left: 16px;
  padding: 6px 12px;
  border: 1px solid rgba(255,255,255,0.6);
  border-radius: 3px;
  font-size: 12px;
  background: rgba(255,255,255,0.15);
  z-index: 2;
}

.win7-center {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.win7-tile {
  width: 130px;
  height: 130px;
  border-radius: 8px;
  overflow: hidden;
  border: 3px solid rgba(255,255,255,0.9);
  box-shadow: 0 8px 24px rgba(0,0,0,0.25);
  margin-bottom: 14px;
}

.win7-tile img { width: 100%; height: 100%; object-fit: cover; }

.win7-username {
  font-size: 22px;
  font-weight: 600;
  text-shadow: 0 1px 4px rgba(0,0,0,0.3);
}

.win7-status {
  font-size: 13px;
  opacity: 0.9;
  margin-bottom: 14px;
  text-shadow: 0 1px 3px rgba(0,0,0,0.3);
}

.win7-password-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

#lock-input {
  width: 220px;
  padding: 9px 12px;
  border-radius: 2px;
  border: 1px solid rgba(255,255,255,0.7);
  font-size: 14px;
  font-family: 'Segoe UI', 'Quicksand', sans-serif;
  outline: none;
  background: rgba(255,255,255,0.95);
  color: #333;
}

#lock-input:focus { border-color: white; box-shadow: 0 0 0 2px rgba(255,255,255,0.5); }

.win7-arrow {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: rgba(255,255,255,0.25);
  border: 1px solid rgba(255,255,255,0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s, transform 0.15s;
}

.win7-arrow svg { width: 18px; height: 18px; }

.win7-arrow:hover { background: rgba(255,255,255,0.45); transform: scale(1.08); }

.win7-error {
  margin-top: 10px;
  font-size: 13px;
  min-height: 18px;
  text-shadow: 0 1px 3px rgba(0,0,0,0.3);
}

.win7-switch-user {
  margin-top: 26px;
  padding: 7px 16px;
  border-radius: 3px;
  border: 1px solid rgba(255,255,255,0.6);
  background: rgba(255,255,255,0.15);
  color: white;
  font-size: 13px;
  transition: background 0.2s;
}

.win7-switch-user:hover { background: rgba(255,255,255,0.3); }

.win7-footer {
  position: absolute;
  bottom: 20px;
  left: 0;
  right: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  z-index: 2;
}

.win7-ease {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: rgba(255,255,255,0.15);
  border: 1px solid rgba(255,255,255,0.6);
  display: flex;
  align-items: center;
  justify-content: center;
}

.win7-ease svg { width: 20px; height: 20px; }

.win7-logo {
  display: flex;
  align-items: center;
  gap: 10px;
}

.win7-logo-sq {
  display: inline-block;
  width: 9px;
  height: 9px;
  border-radius: 1px;
}
.win7-logo-sq.sq1 { background: var(--accent); }
.win7-logo-sq.sq2 { background: var(--lavender); }
.win7-logo-sq.sq3 { background: var(--blush-deep); }
.win7-logo-sq.sq4 { background: #fff3b0; }

.win7-logo-text {
  font-size: 15px;
  text-shadow: 0 1px 3px rgba(0,0,0,0.3);
}

/* ---------- Sections shared ----------
   Each top-level section is a full-screen "slide" with its own background.
   Scroll-snap (set on html) turns scrolling into a jump from one to the next,
   and .section-inner keeps the actual content readably narrow. */
section {
  width: 100%;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 80px 20px;
  position: relative;
  scroll-snap-align: start;
  scroll-snap-stop: always;
}

.section-inner {
  width: 100%;
  max-width: 1000px;
  margin: 0 auto;
}

#counter { background: linear-gradient(135deg, #fff8f3, #ffe3d6); }
#timeline { background: linear-gradient(135deg, #fdf3ff, #f3e2ff); }
#fun-zone { background: linear-gradient(135deg, #f3e8ff, #e5d4f7); }
#closing { background: linear-gradient(135deg, #ffe9c9, #ffd6e8); }

/* Skip layout/paint/style work entirely for sections currently off-screen.
   With ~17 full-height snap sections plus animated decor stickers and
   backdrop-filter cards, this is what keeps scrolling smooth.
   The "auto" in contain-intrinsic-size makes the browser remember each
   section's real last-rendered height instead of always guessing a flat
   fallback — a flat guess that doesn't match reality is what was causing
   a relayout (and the multi-second stutter) every time a section crossed
   into view. */
#counter,
#timeline,
#fun-zone,
#closing {
  content-visibility: auto;
  contain-intrinsic-size: auto 100vh;
}

.section-heading {
  text-align: center;
  font-size: clamp(28px, 5vw, 42px);
  margin-bottom: 12px;
  color: var(--rose-dark);
}

#closing-heading {
  font-family: 'Aref Ruqaa', serif;
  font-weight: 700;
  font-size: clamp(34px, 6vw, 50px);
  unicode-bidi: plaintext;
}

.section-sub {
  text-align: center;
  max-width: 560px;
  margin: 0 auto 50px;
  opacity: 0.75;
}

/* ---------- Hero / dodge button ---------- */
#hero {
  min-height: 100vh;
  width: 100%;
  max-width: none;
  margin: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  position: relative;
  overflow: hidden;
  /* Static gradient — animating background-position here used to force a full
     repaint of the whole hero every frame, forever, which was a major source
     of the site-wide scroll jank. */
  background: linear-gradient(-45deg, #ffe4ec, #ffd4e0, #e5d4f7, #ffe9c9);
  background-size: 200% 200%;
  background-position: 30% 40%;
}

.hero-bg {
  position: absolute;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
}

.hero-blob {
  position: absolute;
  border-radius: 50%;
  filter: blur(2px);
  opacity: 0.55;
  background: radial-gradient(circle at 35% 35%, rgba(255,255,255,0.9), rgba(255,255,255,0) 70%);
  animation: blobDrift 12s ease-in-out infinite;
}

.hero-blob.blob1 { width: 220px; height: 220px; left: 8%; top: 15%; animation-delay: 0s; }
.hero-blob.blob2 { width: 160px; height: 160px; right: 10%; top: 55%; animation-delay: 2.5s; }
.hero-blob.blob3 { width: 130px; height: 130px; left: 20%; bottom: 10%; animation-delay: 5s; }

@keyframes blobDrift {
  0%, 100% { transform: translate(0, 0) scale(1); }
  50% { transform: translate(20px, -25px) scale(1.08); }
}

.hero-heart {
  position: absolute;
  font-size: 26px;
  opacity: 0.5;
  animation: heartFloat 9s ease-in-out infinite;
}

.hero-heart.h1 { left: 12%; top: 25%; animation-delay: 0s; font-size: 30px; }
.hero-heart.h2 { right: 15%; top: 20%; animation-delay: 2s; font-size: 22px; }
.hero-heart.h3 { left: 25%; bottom: 20%; animation-delay: 4s; font-size: 20px; }
.hero-heart.h4 { right: 22%; bottom: 28%; animation-delay: 6s; font-size: 26px; }

@keyframes heartFloat {
  0%, 100% { transform: translateY(0) rotate(0deg); opacity: 0.4; }
  50% { transform: translateY(-22px) rotate(8deg); opacity: 0.7; }
}

.hero-content {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
}

#hero h1 {
  font-size: clamp(32px, 7vw, 58px);
  margin-bottom: 52px;
  color: var(--rose-dark);
  opacity: 0;
  animation: heroFadeIn 0.9s ease 0.15s forwards;
}

@keyframes heroFadeIn {
  from { opacity: 0; transform: translateY(14px); }
  to { opacity: 1; transform: translateY(0); }
}

.hero-buttons {
  position: relative;
  height: 260px;
  width: 100%;
  max-width: 480px;
}

.hero-btn {
  padding: 18px 44px;
  border-radius: 50px;
  font-size: 19px;
  font-weight: 700;
  letter-spacing: 0.3px;
  font-family: 'Quicksand', sans-serif;
  box-shadow: var(--shadow);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.hero-btn-yes {
  background: linear-gradient(135deg, var(--accent), var(--blush-deep));
  color: white;
  position: relative;
  z-index: 2;
}

.hero-btn-yes:hover {
  transform: scale(1.08);
  box-shadow: 0 14px 34px rgba(255, 143, 171, 0.45);
}

.hero-btn-no {
  background: white;
  color: var(--rose-dark);
  position: absolute;
  z-index: 3;
  top: 60px;
  left: calc(50% - 58px);
  --wobble: 0deg;
  transition: top 0.4s cubic-bezier(0.34, 1.2, 0.4, 1), left 0.4s cubic-bezier(0.34, 1.2, 0.4, 1), transform 0.2s ease;
}

.hero-btn-no.wobble {
  animation: noWobble 0.4s ease;
}

@keyframes noWobble {
  0% { transform: rotate(0deg); }
  40% { transform: rotate(var(--wobble)); }
  100% { transform: rotate(0deg); }
}

.no-taunt {
  position: absolute;
  z-index: 4;
  transform: translate(-20%, 0);
  background: var(--rose-dark);
  color: white;
  padding: 5px 14px;
  border-radius: 20px;
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.35s ease, transform 0.35s ease;
}

.no-taunt.show {
  opacity: 1;
  transform: translate(-20%, -8px);
}

#hero.pulse-shake {
  animation: heroPulseShake 0.6s ease;
}

@keyframes heroPulseShake {
  0% { transform: scale(1) translateX(0); }
  20% { transform: scale(1.02) translateX(-4px); }
  40% { transform: scale(1.02) translateX(4px); }
  60% { transform: scale(1.03) translateX(-3px); }
  80% { transform: scale(1.01) translateX(3px); }
  100% { transform: scale(1) translateX(0); }
}

#hero-yes-message {
  margin-top: 32px;
  font-size: 22px;
  font-weight: 600;
  font-family: 'Playfair Display', serif;
  color: var(--rose-dark);
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 0.4s, transform 0.4s;
}

#hero-yes-message.show { opacity: 1; transform: translateY(0); }

.scroll-hint {
  position: absolute;
  bottom: 30px;
  font-size: 14px;
  opacity: 0.6;
  animation: bob 2s ease-in-out infinite;
}

/* ---------- Gated content reveal ---------- */
#gated-content {
  opacity: 0;
  transition: opacity 0.8s ease;
}

#gated-content.revealed {
  opacity: 1;
}

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

/* ---------- Days counter (flip clock) ---------- */
#counter {
  text-align: center;
  padding: 80px 20px 60px;
}

.flip-clock {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 18px;
  flex-wrap: wrap;
  margin-top: 40px;
}

.counter-unit {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
}

.counter-unit-label {
  font-size: 15px;
  text-transform: uppercase;
  letter-spacing: 3px;
  font-weight: 700;
  color: var(--rose-dark);
  opacity: 0.75;
}

.flip-sep {
  font-size: 48px;
  font-weight: 700;
  color: var(--accent);
  transform: translateY(-14px);
  opacity: 0.7;
}

.flip-group {
  display: flex;
  gap: 6px;
}

.flip-digit {
  position: relative;
  flex-shrink: 0;
  width: 56px;
  height: 84px;
}

@media (max-width: 640px) {
  .flip-digit { width: 40px; height: 60px; }
  .flip-sep { font-size: 32px; }
}

/* Page-turn illusion done in plain 2D (scaleY squish + swap + un-squish) so it
   paints reliably everywhere — true 3D perspective/backface-visibility here
   turned out to have real cross-browser rendering bugs on digits that never
   changed value, so this trades a little depth for correctness. */
.flip-digit-inner {
  position: relative;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 14px;
  font-family: 'Playfair Display', serif;
  font-weight: 700;
  font-size: clamp(32px, 6vw, 48px);
  color: white;
  background: linear-gradient(160deg, var(--rose-dark), var(--accent));
  box-shadow: var(--shadow);
  transform-origin: center top;
  transition: transform 0.28s cubic-bezier(0.4, 0, 0.2, 1), filter 0.28s ease;
}

.flip-digit-inner.squish {
  transform: scaleY(0.05);
  filter: brightness(0.7);
}

.flip-digit-inner::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  top: 50%;
  height: 2px;
  margin-top: -1px;
  background: rgba(0, 0, 0, 0.25);
  z-index: 3;
  pointer-events: none;
}

/* ---------- Timeline preview: nodes alternating above/below a single line ----------
   Everything is sized to fit one screen width, no horizontal scrollbar needed. */
.tl-preview-strip {
  --tl-half-w: 48px;
  position: relative;
  width: 100%;
  max-width: 1180px;
  margin: 0 auto;
  height: 360px;
  padding: 0 20px;
}

.tl-preview-line {
  position: absolute;
  left: 0;
  right: 0;
  top: 180px;
  height: 4px;
  border-radius: 2px;
}

.tl-preview-item {
  position: absolute;
  top: 180px;
  width: 96px;
  margin-left: calc(var(--tl-half-w) * -1);
  display: flex;
  flex-direction: column;
  align-items: center;
  cursor: pointer;
}

.tl-preview-item.above { transform: translateY(-100%); }

.tl-preview-connector {
  width: 2px;
  height: 20px;
  background: var(--rose-dark);
  opacity: 0.5;
}

.tl-preview-thumb {
  width: 88px;
  height: 88px;
  border-radius: 50%;
  overflow: hidden;
  box-shadow: var(--shadow);
  border: 4px solid var(--accent);
  background: linear-gradient(160deg, var(--accent-soft), var(--blush-deep));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 30px;
  flex-shrink: 0;
  transition: transform 0.2s ease;
}

.tl-preview-item:hover .tl-preview-thumb { transform: scale(1.12); }

.tl-preview-item.emphasize .tl-preview-thumb {
  border-width: 5px;
}

.tl-preview-thumb img,
.tl-preview-thumb video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Explicit stacking order both ways, regardless of DOM append order:
   below-the-line reads connector -> thumb -> date (top to bottom);
   above-the-line reads date -> thumb -> connector (top to bottom, connector touches the line). */
.tl-preview-item.below .tl-preview-connector { order: 1; }
.tl-preview-item.below .tl-preview-thumb { order: 2; }
.tl-preview-item.below .tl-preview-date { order: 3; }

.tl-preview-item.above .tl-preview-date { order: 1; }
.tl-preview-item.above .tl-preview-thumb { order: 2; }
.tl-preview-item.above .tl-preview-connector { order: 3; }

.tl-preview-date {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--rose-dark);
  opacity: 0.85;
  white-space: nowrap;
  margin: 6px 0;
}

@media (max-width: 800px) {
  .tl-preview-strip { --tl-half-w: 30px; height: 300px; padding: 0 14px; }
  .tl-preview-line { top: 150px; }
  .tl-preview-item { top: 150px; width: 60px; margin-left: calc(var(--tl-half-w) * -1); }
  .tl-preview-thumb { width: 54px; height: 54px; font-size: 18px; }
  .tl-preview-connector { height: 14px; }
  .tl-preview-date { font-size: 8px; }
}

/* ---------- Timeline: each date is its own full-screen, themed slide ---------- */
.tl-slide {
  width: 100%;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 80px 20px;
  position: relative;
  overflow: hidden;
  scroll-snap-align: start;
  scroll-snap-stop: always;
  content-visibility: auto;
  contain-intrinsic-size: auto 100vh;
}

.tl-slide-icon {
  position: absolute;
  font-size: 56px;
  opacity: 0.4;
  pointer-events: none;
  z-index: 1;
  filter: drop-shadow(0 4px 10px rgba(0, 0, 0, 0.15));
}
.tl-slide-icon.pos-tl { top: 30px; left: 30px; transform: rotate(-8deg); }
.tl-slide-icon.pos-tr { top: 30px; right: 30px; transform: rotate(8deg); }
.tl-slide-icon.pos-bl { bottom: 30px; left: 30px; transform: rotate(6deg); }
.tl-slide-icon.pos-br { bottom: 30px; right: 30px; transform: rotate(-6deg); }

@media (max-width: 700px) {
  .tl-slide-icon { font-size: 38px; }
}

.tl-slide-inner {
  max-width: 720px;
  width: 100%;
  /* No backdrop-filter here on purpose — it was the single most expensive
     effect on weaker/software-rendered GPUs, applied across 12 slides.
     A more opaque solid background gives a similar "card" feel for free. */
  background: rgba(255, 255, 255, 0.88);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 44px 40px;
  text-align: center;
  opacity: 0;
  transform: translateY(36px);
  transition: opacity 0.8s cubic-bezier(0.16, 1, 0.3, 1), transform 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

.tl-slide.visible .tl-slide-inner {
  opacity: 1;
  transform: translateY(0);
}

.tl-slide.emphasize .tl-slide-inner {
  border: 2px solid var(--accent);
}

/* Dark card variant, paired with moodier slide themes (suits, prom, concert) */
.tl-slide.card-dark .tl-slide-inner {
  background: rgba(16, 14, 20, 0.86);
}
.tl-slide.card-dark .tl-title { color: #fdf8f3; }
.tl-slide.card-dark .tl-caption { color: #e6dcd3; opacity: 0.9; }

.tl-date {
  font-size: 14px;
  text-transform: uppercase;
  letter-spacing: 2px;
  color: var(--accent);
  font-weight: 700;
}

.tl-title {
  margin: 6px 0 14px;
  font-size: clamp(24px, 4vw, 32px);
}

.tl-caption {
  font-size: 16px;
  opacity: 0.85;
  margin-bottom: 20px;
  line-height: 1.6;
}

/* ---------- Per-slide title fonts, one flavor per kind of memory ---------- */
.tl-slide.font-handwritten .tl-title {
  font-family: 'Dancing Script', cursive;
  font-weight: 700;
  font-size: clamp(32px, 5.5vw, 48px);
}

.tl-slide.font-playful .tl-title {
  font-family: 'Baloo 2', cursive;
  font-weight: 700;
}

.tl-slide.font-elegant .tl-title {
  font-family: 'Cormorant Garamond', serif;
  font-style: italic;
  font-weight: 600;
  font-size: clamp(28px, 4.6vw, 40px);
  letter-spacing: 0.5px;
}

.tl-slide.font-glam .tl-title {
  font-family: 'Playfair Display', serif;
  font-style: italic;
  font-weight: 700;
  letter-spacing: 1px;
  text-shadow: 0 0 14px rgba(255, 255, 255, 0.35);
}

.tl-slide.font-poster .tl-title {
  font-family: 'Bebas Neue', sans-serif;
  letter-spacing: 3px;
  font-size: clamp(30px, 5.2vw, 46px);
}

/* A title that's just a big, glowing, gently-pulsing emoji instead of words */
.tl-title.tl-title-emoji {
  font-size: clamp(56px, 10vw, 84px);
  line-height: 1;
  filter: drop-shadow(0 4px 14px rgba(255, 105, 155, 0.55));
  animation: emojiTitlePulse 2.2s ease-in-out infinite;
}

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

.tl-slide.font-poster .tl-date {
  color: #ff59c6;
  text-shadow: 0 0 10px rgba(255, 89, 198, 0.6);
}

/* ---------- Photo layout + per-slide frame styles ---------- */
.tl-images {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 14px;
}

.tl-photo {
  position: relative;
  cursor: pointer;
  width: 190px;
}

.tl-photo img, .tl-photo video {
  display: block;
  width: 100%;
  height: 220px;
  object-fit: cover;
}

/* Plain rounded snapshot — the default for an ordinary day */
.tl-photo--simple {
  border-radius: 14px;
  overflow: hidden;
  box-shadow: var(--shadow);
}

/* Classic instant-camera photo: thick white border, extra-deep on the bottom */
.tl-photo--polaroid {
  background: #fff;
  padding: 10px 10px 32px;
  box-shadow: 0 10px 22px rgba(0, 0, 0, 0.3);
}

/* A little washi-tape strip pinning the corner down */
.tl-photo--tape {
  background: #fff;
  padding: 8px;
  border-radius: 3px;
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.22);
}
.tl-photo--tape::before {
  content: '';
  position: absolute;
  top: -10px;
  left: 50%;
  transform: translateX(-50%) rotate(-4deg);
  width: 60px;
  height: 22px;
  background: rgba(255, 224, 140, 0.8);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.15);
}

/* Formal gold-bordered frame, for the dressed-up occasions */
.tl-photo--gold {
  padding: 6px;
  border-radius: 4px;
  background: linear-gradient(135deg, #d4af37, #f5e08a);
  box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.5), 0 12px 26px rgba(0, 0, 0, 0.45);
}
.tl-photo--gold img { border-radius: 2px; }

/* A fun, slightly-crooked sticker with a bold white border */
.tl-photo--sticker {
  border-radius: 16px;
  overflow: hidden;
  border: 4px solid #fff;
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.35);
  transform: rotate(-3deg);
}
.tl-photo--sticker:nth-child(even) { transform: rotate(3deg); }

/* Scrapbook page corner, cream paper with a little tape accent */
.tl-photo--scrapbook {
  background: #fffbe8;
  padding: 8px;
  border-radius: 3px;
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.2);
}
.tl-photo--scrapbook::after {
  content: '';
  position: absolute;
  bottom: -8px;
  right: 14px;
  width: 34px;
  height: 14px;
  background: rgba(178, 220, 200, 0.75);
  transform: rotate(3deg);
}

/* Concert-ticket stub: dashed edge, tucked in tight */
.tl-photo--ticket {
  border-radius: 6px;
  overflow: hidden;
  border: 2px dashed rgba(255, 255, 255, 0.55);
  box-shadow: 0 10px 22px rgba(0, 0, 0, 0.45);
}

/* Montreal-style scattered layout: photos tossed at gentle random angles */
.tl-images.scattered {
  gap: 6px;
}
.tl-images.scattered .tl-photo {
  transform: rotate(var(--tilt, 0deg));
  margin: 6px 12px;
  transition: transform 0.2s ease;
}
.tl-images.scattered .tl-photo:hover {
  transform: rotate(0deg) scale(1.05);
  z-index: 2;
}

/* ---------- Fun zone nav ---------- */
.fun-nav {
  position: relative;
  display: flex;
  justify-content: center;
  gap: 14px;
  flex-wrap: wrap;
  margin-bottom: 50px;
}

.fun-nav button {
  padding: 12px 22px;
  border-radius: 30px;
  background: white;
  color: var(--rose-dark);
  font-weight: 600;
  box-shadow: var(--shadow);
  transition: background 0.2s, color 0.2s, transform 0.15s;
}

.fun-nav button.active,
.fun-nav button:hover {
  background: var(--accent);
  color: white;
  transform: translateY(-2px);
}

.fun-panel { position: relative; display: none; }
.fun-panel.active { display: block; animation: fadeIn 0.4s ease; }

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ---------- Memory match ---------- */
.match-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  max-width: 560px;
  margin: 0 auto;
}

@media (max-width: 600px) {
  .match-grid { grid-template-columns: repeat(3, 1fr); }
}

.match-card {
  aspect-ratio: 1;
  perspective: 800px;
  cursor: pointer;
}

.match-card-inner {
  position: relative;
  width: 100%;
  height: 100%;
  transition: transform 0.5s;
  transform-style: preserve-3d;
}

.match-card.flipped .match-card-inner,
.match-card.matched .match-card-inner {
  transform: rotateY(180deg);
}

.match-face {
  position: absolute;
  inset: 0;
  backface-visibility: hidden;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: var(--shadow);
}

.match-front {
  background: linear-gradient(135deg, var(--accent), var(--blush-deep));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
}

.match-back {
  transform: rotateY(180deg);
}

.match-back img { width: 100%; height: 100%; object-fit: cover; }

.match-card.matched { opacity: 0.6; }

.match-status {
  text-align: center;
  margin-top: 20px;
  font-weight: 600;
}

/* ---------- Quiz ---------- */
.quiz-box {
  background: white;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 30px;
  max-width: 560px;
  margin: 0 auto;
}

.quiz-question {
  font-size: 20px;
  margin-bottom: 20px;
  text-align: center;
}

.quiz-choices {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.quiz-choice {
  padding: 14px 18px;
  border-radius: 12px;
  background: var(--cream);
  text-align: left;
  font-size: 15px;
  transition: background 0.2s;
  unicode-bidi: plaintext;
}

.quiz-choice:hover { background: var(--accent-soft); }
.quiz-choice.correct { background: #c8f0d3; }
.quiz-choice.incorrect { background: #f7c9c9; }

.quiz-progress {
  text-align: center;
  margin-bottom: 16px;
  font-size: 13px;
  opacity: 0.7;
}

.quiz-result {
  text-align: center;
}

.quiz-next {
  display: block;
  margin: 24px auto 0;
  padding: 10px 24px;
  border-radius: 30px;
  background: var(--accent);
  color: white;
  font-weight: 600;
}

/* ---------- Love note jar ---------- */
.jar-wrap {
  position: relative;
  text-align: center;
}

.jar-emoji {
  font-size: 90px;
  cursor: pointer;
  transition: transform 0.2s;
  user-select: none;
}

.jar-emoji:hover { transform: scale(1.08) rotate(-4deg); }

.jar-note {
  margin-top: 30px;
  background: white;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 24px 30px;
  max-width: 480px;
  margin-left: auto;
  margin-right: auto;
  font-size: 17px;
  font-style: italic;
  min-height: 30px;
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 0.4s, transform 0.4s;
}

.jar-note.show { opacity: 1; transform: translateY(0); }

/* ---------- Scratch off ---------- */
.scratch-wrap {
  text-align: center;
}

.scratch-container {
  position: relative;
  max-width: 420px;
  margin: 0 auto;
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  user-select: none;
  -webkit-user-select: none;
}

.scratch-reveal {
  padding: 50px 24px;
  background: linear-gradient(135deg, var(--blush-deep), var(--lavender));
  font-size: 18px;
  font-weight: 600;
  min-height: 160px;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  unicode-bidi: plaintext; /* lets RTL text (e.g. Persian) render in its natural direction */
  user-select: none;
  -webkit-user-select: none;
}

.scratch-canvas {
  position: absolute;
  inset: 0;
  cursor: grab;
  touch-action: none;
}

.scratch-hint {
  margin-top: 16px;
  font-size: 13px;
  opacity: 0.7;
}

/* ---------- Scattered decorative doodles ----------
   Sourced from one sprite sheet (assets/elements.jpg, a 3x4 grid of line-art
   doodles on white). mix-blend-mode: multiply drops the white background out
   against whatever color is behind it, so no image editing was needed. */
.decor-sticker {
  position: absolute;
  background-image: url('../assets/elements.jpg');
  background-repeat: no-repeat;
  background-size: 300% 400%;
  mix-blend-mode: multiply;
  opacity: 0.55;
  pointer-events: none;
  z-index: 2;
  animation: decorFloat 7s ease-in-out infinite;
}

@keyframes decorFloat {
  0%, 100% { transform: translateY(0) rotate(var(--decor-r, 0deg)); }
  50% { transform: translateY(-10px) rotate(var(--decor-r, 0deg)); }
}

/* ---------- Easter eggs (each found a different way, on purpose) ---------- */
.egg-trigger { cursor: pointer; }

/* 1. Timeline: a faint paw print tucked in the corner */
.egg-paw {
  position: absolute;
  top: 6px;
  left: 8px; /* was right-aligned, but that sat directly under the fixed fun scrollbar */
  font-size: 20px;
  opacity: 0.3;
  z-index: 5;
  transition: opacity 0.2s, transform 0.2s;
  animation: pawWiggle 3.4s ease-in-out infinite;
}
.egg-paw:hover { opacity: 0.9; transform: scale(1.15); }

@keyframes pawWiggle {
  0%, 100% { transform: rotate(0deg); }
  50% { transform: rotate(-14deg); }
}

/* 2. Counter heading: a tiny sparkle riding along the text */
.egg-inline-sparkle {
  display: inline-block;
  margin-left: 8px;
  font-size: 0.45em;
  vertical-align: super;
  opacity: 0.45;
  transition: opacity 0.2s, transform 0.2s;
}
.egg-inline-sparkle:hover { opacity: 1; transform: scale(1.3) rotate(20deg); }

/* 3. Fun-zone nav: a little ribbon sticker peeking off the corner */
.egg-ribbon {
  position: absolute;
  top: -12px;
  right: 6px;
  font-size: 22px;
  transform: rotate(20deg);
  opacity: 0.5;
  z-index: 5;
  transition: opacity 0.2s, transform 0.2s;
}
.egg-ribbon:hover { opacity: 1; transform: rotate(0deg) scale(1.15); }

/* 4. Quiz panel: a barely-there text link, easy to scroll right past */
.egg-hidden-text {
  display: block;
  margin-top: 16px;
  text-align: center;
  font-size: 11px;
  color: var(--blush-deep);
  text-decoration: underline dotted;
  opacity: 0.4;
  transition: opacity 0.2s;
}
.egg-hidden-text:hover { opacity: 1; }

/* 5. Love note jar: a ladybug that slowly crawls back and forth */
.egg-bug {
  position: absolute;
  bottom: 2px;
  left: 5%;
  font-size: 18px;
  z-index: 5;
  opacity: 0.75;
  animation: bugCrawl 7s linear infinite;
}

@keyframes bugCrawl {
  0% { left: 5%; transform: scaleX(1); }
  45% { left: 68%; transform: scaleX(1); }
  50% { left: 68%; transform: scaleX(-1); }
  95% { left: 5%; transform: scaleX(-1); }
  100% { left: 5%; transform: scaleX(1); }
}

/* 6. Closing section: a quiet "made with" line, heart included */
.egg-footer-heart {
  display: block;
  text-align: center;
  margin-top: 44px;
  font-size: 12px;
  opacity: 0.4;
  transition: opacity 0.2s;
}
.egg-footer-heart:hover { opacity: 0.9; }

.egg-modal {
  position: fixed;
  inset: 0;
  z-index: 900;
  background: rgba(107, 54, 72, 0.55);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.egg-modal-card {
  background: white;
  border-radius: var(--radius);
  padding: 20px;
  max-width: 420px;
  width: 100%;
  text-align: center;
  box-shadow: var(--shadow);
}

.egg-modal-card img {
  border-radius: 12px;
  margin-bottom: 14px;
  max-height: 320px;
  width: 100%;
  object-fit: cover;
}

.egg-modal-close {
  margin-top: 10px;
  padding: 10px 26px;
  border-radius: 30px;
  background: var(--accent);
  color: white;
  font-weight: 600;
}

/* ---------- Closing letter ---------- */
#closing {
  text-align: center;
  padding-bottom: 140px;
}

.letter-card {
  background: white;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 44px 36px;
  max-width: 600px;
  margin: 0 auto;
  font-size: 17px;
  line-height: 1.7;
  white-space: pre-line;
  text-align: left;
  unicode-bidi: plaintext; /* auto-detects RTL text like Persian and aligns it naturally */
}

#celebrate-btn {
  margin-top: 30px;
  padding: 16px 36px;
  border-radius: 50px;
  background: var(--accent);
  color: white;
  font-weight: 700;
  font-size: 18px;
  box-shadow: var(--shadow);
  transition: transform 0.15s;
}

#celebrate-btn:hover { transform: scale(1.06); }

.ask-link-btn {
  display: inline-block;
  margin-top: 18px;
  padding: 14px 32px;
  border-radius: 50px;
  background: white;
  color: var(--rose-dark);
  font-weight: 700;
  font-size: 16px;
  box-shadow: var(--shadow);
  text-decoration: none;
  border: 2px solid var(--accent-soft);
  unicode-bidi: plaintext; /* renders the Persian label right-to-left, as it should */
  transition: transform 0.15s, background 0.2s, border-color 0.2s;
}

.ask-link-btn:hover {
  transform: scale(1.05);
  background: var(--accent-soft);
  border-color: var(--accent);
}

/* ---------- Image lightbox ---------- */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 950;
  background: rgba(0,0,0,0.8);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.lightbox img, .lightbox video {
  max-width: 100%;
  max-height: 90vh;
  border-radius: 12px;
}

/* ---------- confetti canvas ---------- */
#confetti-canvas {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 800;
}
