/* ============================================================
   20/10 VIETNAMESE WOMEN'S DAY - DAISY GARDEN & GREETING CARD
   Merged experience: Full Botanical Garden + Letter + Memory Album
   ============================================================ */

@font-face {
  font-family: "Noto Serif";
  src: url("../assets/fonts/noto-serif-regular.woff2") format("woff2");
  font-style: normal;
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: "Noto Serif";
  src: url("../assets/fonts/noto-serif-italic.woff2") format("woff2");
  font-style: italic;
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: "Noto Sans";
  src: url("../assets/fonts/noto-sans-regular.woff2") format("woff2");
  font-style: normal;
  font-weight: 400;
  font-display: swap;
}

:root {
  color-scheme: light;
  --sky: #BBDFF5;
  --ink: #703A50;
  --ink-deep: #4E2335;
  --muted: #936779;
  --rose: #C66388;
  --rose-light: #FBEAF0;
  --gold: #D4AF37;
  --amber: #E69500;
  --leaf: #5B8263;
  --paper: #FFFDFB;
  --paper-cream: #FCF8F2;
  --line: #ECD3DB;
  --font-serif: "Noto Serif", Georgia, "Times New Roman", serif;
  --font-sans: "Noto Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-hand: 'Patrick Hand', 'Charm', cursive, var(--font-serif);
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html {
  scroll-behavior: smooth;
  scroll-snap-type: y proximity;
}

html, body {
  margin: 0;
  padding: 0;
  min-width: 320px;
  min-height: 100%;
  font-family: var(--font-sans);
  color: var(--ink);
  background: #BBDFF5;
  -webkit-tap-highlight-color: transparent;
}

body {
  overflow-x: hidden;
}

button {
  font: inherit;
  color: inherit;
  cursor: pointer;
  touch-action: manipulation;
}

button:focus-visible, a:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: 4px;
}

/* ============================================================
   TOP FLOATING CONTROLS (NAVIGATION & MUSIC)
   ============================================================ */
.floating-top-bar {
  position: fixed;
  top: 14px;
  left: 0;
  right: 0;
  padding: 0 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  pointer-events: none;
  z-index: 1000;
}

.floating-nav-pill, .floating-music-btn {
  pointer-events: auto;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 8px 15px;
  background: rgba(255, 253, 249, 0.92);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(212, 175, 55, 0.45);
  border-radius: 999px;
  box-shadow: 0 4px 18px rgba(112, 58, 80, 0.12), 0 1px 3px rgba(0,0,0,0.06);
  color: var(--ink);
  font-size: 0.8rem;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.2, 0.8, 0.2, 1);
  user-select: none;
}

.floating-nav-pill:hover, .floating-music-btn:hover {
  background: #FFFDF9;
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(112, 58, 80, 0.22);
  border-color: var(--gold);
  color: var(--rose);
}

.floating-music-btn.is-playing {
  border-color: var(--rose);
  color: var(--rose);
  background: #FFF5F8;
  animation: musicPulse 2s ease-in-out infinite;
}

@keyframes musicPulse {
  0%, 100% { box-shadow: 0 4px 18px rgba(198, 99, 136, 0.2); }
  50% { box-shadow: 0 4px 22px rgba(198, 99, 136, 0.4); }
}

/* ============================================================
   MAIN GARDEN STAGE (CANVAS & BLOOM INTERACTION)
   ============================================================ */
.garden {
  position: relative;
  width: 100%;
  height: 100svh;
  min-height: 560px;
  overflow: hidden;
  isolation: isolate;
  background: linear-gradient(180deg, #bbdff5 0%, #d8edf9 36%, #edf7fb 68%, #f2f7ec 100%);
  scroll-snap-align: start;
}

.garden::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -2;
  pointer-events: none;
  background: radial-gradient(ellipse at 50% 110%, rgba(215, 232, 202, 0.7), transparent 60%);
  opacity: 0;
  transition: opacity 4s;
}

.garden.is-growing::after {
  opacity: 1;
}

#flowers {
  position: absolute;
  inset: 0;
  z-index: 1;
  width: 100%;
  height: 100%;
  display: block;
}

#ambientPetals {
  position: absolute;
  inset: 0;
  z-index: 2;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

/* Page Header */
.page-header {
  position: absolute;
  top: max(60px, env(safe-area-inset-top));
  left: clamp(20px, 5vw, 64px);
  right: clamp(20px, 5vw, 64px);
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  pointer-events: none;
  z-index: 5;
}

.dedication {
  margin: 0;
  font: italic clamp(17px, 2vw, 22px)/1.5 var(--font-serif);
  color: var(--ink);
  text-shadow: 0 1px 12px rgba(255, 255, 255, 0.9);
}

.date-badge {
  margin: 0;
  text-align: right;
  font-size: 11px;
  line-height: 1.6;
  color: var(--muted);
  text-shadow: 0 1px 12px rgba(255, 255, 255, 0.9);
}

.date-badge span {
  display: block;
  font: 26px/1.3 var(--font-serif);
  font-weight: 600;
  color: var(--rose);
  margin-bottom: 2px;
}

/* Hero Center Hydrangea Button */
.flower-button {
  position: absolute;
  left: 50%;
  top: 46%;
  transform: translate(-50%, -50%);
  width: 190px;
  height: 190px;
  border: 0;
  border-radius: 50%;
  background: transparent;
  z-index: 10;
  cursor: pointer;
}

.flower-button::after {
  content: "";
  position: absolute;
  inset: 12px;
  border: 2px dashed rgba(66, 165, 245, 0.45);
  border-radius: 50%;
  transition: transform 0.6s cubic-bezier(0.2, 0.8, 0.2, 1), border-color 0.4s;
  animation: heroPulse 2.8s ease-in-out infinite;
}

.flower-button:hover::after {
  transform: scale(1.18);
  border-color: #7E57C2;
}

@keyframes heroPulse {
  0%, 100% { transform: scale(1); opacity: 0.5; }
  50% { transform: scale(1.08); opacity: 0.9; }
}

/* Intro Text */
.intro {
  position: absolute;
  left: 20px;
  right: 20px;
  top: 20%;
  text-align: center;
  transition: opacity 0.65s, transform 0.65s;
  pointer-events: none;
  z-index: 5;
}

.intro h1 {
  margin: 0;
  font: 400 clamp(23px, 3.2vw, 34px)/1.4 var(--font-serif);
  color: var(--ink);
  text-shadow: 0 2px 14px rgba(255, 255, 255, 0.9);
}

.intro p {
  margin: 10px 0 0;
  font-size: 13.5px;
  line-height: 1.6;
  color: var(--muted);
  text-shadow: 0 1px 10px rgba(255, 255, 255, 0.9);
}

.is-growing .intro {
  opacity: 0;
  transform: translateY(14px);
  pointer-events: none;
}

/* Growing Progress */
.progress-status {
  position: absolute;
  bottom: 84px;
  left: 20px;
  right: 20px;
  margin: 0;
  text-align: center;
  font: italic 16px/1.6 var(--font-serif);
  color: var(--ink);
  opacity: 0;
  transition: opacity 0.6s;
  pointer-events: none;
  text-shadow: 0 1px 12px #fff, 0 1px 8px #fff;
  z-index: 5;
}

.is-growing:not(.is-ready) .progress-status {
  opacity: 1;
}

/* Whisper Wish on Flower Tap */
.whisper-container {
  position: absolute;
  bottom: 84px;
  left: 50%;
  transform: translateX(-50%);
  width: max-content;
  max-width: min(90vw, 560px);
  text-align: center;
  z-index: 25;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.5s ease;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  padding: 7px 22px;
  border-radius: 999px;
  border: 1px solid rgba(220, 185, 200, 0.6);
  box-shadow: 0 4px 20px rgba(112, 58, 80, 0.12);
}

.garden.is-ready .whisper-container {
  opacity: 1;
}

.whisper-hint {
  font-size: 11px;
  color: var(--muted);
  margin: 0;
}

.daisy-wish {
  font: italic 15.5px/1.5 var(--font-serif);
  color: var(--ink-deep);
  margin: 2px auto 0;
  min-height: 22px;
  text-wrap: pretty;
}

.daisy-wish:empty {
  display: none;
}

.daisy-wish.is-new {
  animation: wishFade 0.4s ease both;
}

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

/* ============================================================
   POST-BLOOM ACTION BAR & ANIMATED ENVELOPE
   ============================================================ */
.garden-actions {
  position: absolute;
  bottom: max(22px, env(safe-area-inset-bottom));
  left: 0;
  right: 0;
  display: flex;
  justify-content: center;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  padding: 0 16px;
  z-index: 15;
}

.action-btn {
  border: 1px solid #DCB9C8;
  background: rgba(255, 253, 252, 0.94);
  backdrop-filter: blur(8px);
  border-radius: 30px;
  padding: 10px 18px;
  font-size: 12.5px;
  font-weight: 500;
  color: var(--ink);
  box-shadow: 0 3px 16px rgba(118, 54, 77, 0.08);
  transition: all 0.25s ease;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.action-btn:hover {
  background: #FAE7EF;
  border-color: var(--rose);
  color: var(--rose);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(118, 54, 77, 0.16);
}

.action-btn.primary {
  background: var(--ink);
  color: var(--paper);
  border-color: var(--ink);
}

.action-btn.primary:hover {
  background: var(--rose);
  border-color: var(--rose);
  color: #FFF;
}

/* Floating Envelope for Opening Card - Positioned in the open sky above the daisies */
.envelope-floating {
  position: absolute;
  right: clamp(20px, 8vw, 80px);
  top: 22%;
  width: 140px;
  padding: 0;
  border: 0;
  background: transparent;
  text-align: center;
  transform: rotate(-5deg);
  animation: envelopeEntrance 0.8s cubic-bezier(0.2, 0.8, 0.2, 1) both, envelopeFloat 3.6s ease-in-out infinite 0.8s;
  z-index: 20;
  cursor: pointer;
}

@keyframes envelopeFloat {
  0%, 100% { transform: translateY(0) rotate(-5deg); }
  50% { transform: translateY(-7px) rotate(-3deg); }
}

.envelope-pocket {
  position: relative;
  display: block;
  width: 98px;
  height: 66px;
  margin: 0 auto 8px;
  background: #F6DCE4;
  border: 1px solid #E5B7C6;
  border-radius: 3px 3px 6px 6px;
  box-shadow: 0 8px 22px rgba(118, 54, 77, 0.18);
  transition: transform 0.35s ease;
}

.envelope-pocket::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 2;
  background:
    linear-gradient(32deg, #FBEAF0 49%, transparent 50%) left / 51% 100% no-repeat,
    linear-gradient(-32deg, #F8E3EA 49%, transparent 50%) right / 51% 100% no-repeat;
  border-radius: inherit;
}

.envelope-pocket::after {
  content: '';
  position: absolute;
  inset: -1px -1px 0;
  z-index: 3;
  background: #FDEDF3;
  clip-path: polygon(0 0, 100% 0, 50% 62%);
  transform-origin: top;
  transition: transform 0.4s ease;
}

.envelope-letter-peeking {
  position: absolute;
  inset: -10px 8px 8px;
  padding: 10px 0 0;
  background: var(--paper);
  border: 1px solid var(--line);
  font-family: var(--font-serif);
  font-style: italic;
  font-size: 11px;
  color: var(--rose);
  transition: transform 0.4s ease;
}

.envelope-seal-badge {
  position: absolute;
  left: calc(50% - 13px);
  top: 25px;
  z-index: 4;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: linear-gradient(135deg, #C44569, #9E1E42);
  color: #FFF6F8;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  box-shadow: 0 2px 6px rgba(118, 54, 77, 0.35);
  animation: pulseBeat 2.2s ease-in-out infinite;
}

.envelope-caption-text {
  display: block;
  font-size: 10px;
  color: var(--muted);
  line-height: 1.4;
  text-shadow: 0 1px 8px #fff;
}

.envelope-action-text {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: var(--rose);
  text-decoration: underline;
  text-underline-offset: 3px;
  margin-top: 2px;
  text-shadow: 0 1px 8px #fff;
}

.envelope-floating:hover .envelope-letter-peeking {
  transform: translateY(-8px);
}
.envelope-floating:hover .envelope-pocket::after {
  transform: rotateX(38deg);
}

@keyframes envelopeEntrance {
  from { opacity: 0; transform: translateY(20px) rotate(-12deg); }
  to { opacity: 1; transform: translateY(0) rotate(-5deg); }
}

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

/* ============================================================
   GREETING CARD DIALOG (HIGH-END STATIONERY)
   ============================================================ */
.card-dialog {
  width: min(480px, calc(100% - 24px));
  max-height: calc(100svh - 20px);
  padding: 0;
  border: 0;
  border-radius: 8px;
  overflow-y: auto;
  overflow-x: hidden;
  background: var(--paper);
  color: var(--ink);
  box-shadow: 0 24px 100px rgba(105, 57, 77, 0.25), 0 2px 12px rgba(105, 57, 77, 0.12);
  scrollbar-width: none;
  -ms-overflow-style: none;
  position: fixed;
  inset: 0;
  margin: auto;
  z-index: 2000;
}

.card-dialog::-webkit-scrollbar {
  display: none;
}

.card-dialog::backdrop {
  background: rgba(234, 245, 252, 0.55);
  backdrop-filter: blur(5px);
  -webkit-backdrop-filter: blur(5px);
}

.card-dialog[open] {
  animation: cardUnfold 0.8s cubic-bezier(0.2, 0.8, 0.2, 1) both;
}

@keyframes cardUnfold {
  from { opacity: 0; transform: translateY(35px) rotate(-1.5deg) scale(0.95); }
  to { opacity: 1; transform: none; }
}

.letter-content {
  position: relative;
  padding: clamp(16px, 2.5vh, 22px) clamp(18px, 3.5vw, 28px) clamp(12px, 2vh, 16px);
  text-align: center;
  background:
    linear-gradient(90deg, transparent 49.7%, rgba(238, 221, 227, 0.35) 50%, transparent 50.3%),
    var(--paper);
}

.letter-content::before {
  content: "";
  position: absolute;
  inset: 8px;
  border: 1px solid #EED6E1;
  border-radius: 4px;
  pointer-events: none;
}

.close-card-btn {
  position: absolute;
  top: 10px;
  right: 12px;
  width: 28px;
  height: 28px;
  border: 0;
  border-radius: 50%;
  background: transparent;
  font-size: 20px;
  color: var(--muted);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
  z-index: 10;
}

.close-card-btn:hover {
  background: #F9EAF0;
  color: var(--ink);
}

.letter-date-stamp {
  margin: 0 0 6px;
  font: 20px/1.2 var(--font-serif);
  color: var(--rose);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.letter-date-stamp span.slash {
  display: inline-block;
  width: 1px;
  height: 20px;
  background: #D9AEC1;
  transform: rotate(24deg);
}

.letter-daisy-sprig,
.letter-hydrangea-sprig {
  display: block;
  margin: 0 auto 6px;
  width: 60px;
  height: 40px;
}

.letter-recipient-title {
  font: italic clamp(14px, 1.8vh, 16px)/1.35 var(--font-serif);
  color: var(--ink);
  margin: 0 0 4px;
}

.letter-main-title {
  font: 400 clamp(17px, 2.4vh, 21px)/1.35 var(--font-serif);
  color: var(--ink-deep);
  margin: 0 0 8px;
  text-wrap: balance;
}

.letter-body-text {
  font-size: clamp(12.5px, 1.6vh, 13.5px);
  line-height: 1.55;
  color: var(--ink);
  margin: 0 0 6px;
  text-wrap: pretty;
  white-space: pre-line;
}

.letter-signature-block {
  margin: 8px 0 8px;
  font: italic clamp(14px, 1.8vh, 16px)/1.35 var(--font-serif);
  color: var(--rose);
}

.letter-footer-actions {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px dashed #EED6E1;
}

.letter-footer-actions .action-btn {
  padding: 7px 15px;
  font-size: 11.5px;
}

/* ============================================================
   MEMORY ALBUM SECTION (POLAROID PHOTO CARDS)
   ============================================================ */
.memory-album-section {
  position: relative;
  width: 100%;
  min-height: 100vh;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: 40px 16px;
  background: linear-gradient(180deg, #F2F7EC 0%, #FFFDF9 35%, #FDF6F8 100%);
  text-align: center;
  box-sizing: border-box;
  scroll-snap-align: start;
}

.album-container {
  width: min(100%, 1020px);
  margin: 0 auto;
}

.album-section-note {
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 0 0 4px;
}

.album-section-title {
  font: 400 clamp(22px, 3.2vw, 30px)/1.3 var(--font-serif);
  color: var(--ink-deep);
  margin: 0 0 10px;
}

.album-spread-btn {
  margin-bottom: 12px;
}

/* Photo Cards Grid */
.album-photos-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 20px;
  padding: 10px 10px 0;
  justify-items: center;
}

.polaroid-item {
  width: min(100%, 240px);
  background: var(--paper);
  border: 1px solid rgba(236, 211, 219, 0.7);
  box-shadow: 0 10px 30px rgba(118, 54, 77, 0.1), 0 2px 6px rgba(118, 54, 77, 0.05);
  padding: 8px 8px 0;
  border-radius: 4px;
  transition: transform 0.5s cubic-bezier(0.2, 0.8, 0.2, 1), box-shadow 0.3s;
  cursor: pointer;
  position: relative;
}

.polaroid-item:hover {
  transform: translateY(-8px) scale(1.02) !important;
  box-shadow: 0 18px 45px rgba(118, 54, 77, 0.18), 0 4px 12px rgba(118, 54, 77, 0.08);
  z-index: 10;
}

/* Washi Tape Accent */
.tape-accent {
  position: absolute;
  top: -9px;
  left: 50%;
  transform: translateX(-50%);
  width: 60px;
  height: 18px;
  background: rgba(255, 230, 240, 0.75);
  box-shadow: 0 1px 3px rgba(0,0,0,0.06);
  clip-path: polygon(3% 0%, 97% 0%, 100% 50%, 97% 100%, 3% 100%, 0% 50%);
  pointer-events: none;
}

.polaroid-photo-box {
  aspect-ratio: 3 / 4;
  overflow: hidden;
  border-radius: 2px;
  background: #F4E8EE;
}

.polaroid-photo-box img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  transition: transform 0.6s ease;
}

.polaroid-item:hover .polaroid-photo-box img {
  transform: scale(1.04);
}

.polaroid-caption {
  padding: 10px 4px 12px;
  text-align: center;
}

.polaroid-text {
  display: block;
  font: italic clamp(14px, 1.5vw, 16px)/1.35 var(--font-serif);
  color: var(--ink);
}

.polaroid-subnote {
  display: block;
  font-size: 10.5px;
  color: var(--muted);
  margin-top: 4px;
}

/* Stacked vs Spread View */
.album-photos-grid.is-stacked {
  position: relative;
  height: 385px;
  margin-bottom: 6px;
}

.album-photos-grid.is-stacked .polaroid-item {
  position: absolute;
  left: calc(50% - 120px);
  top: 5px;
}

.album-photos-grid.is-stacked .polaroid-item:nth-child(1) { transform: rotate(-5deg); z-index: 4; }
.album-photos-grid.is-stacked .polaroid-item:nth-child(2) { transform: translate(12px, 5px) rotate(4deg); z-index: 3; }
.album-photos-grid.is-stacked .polaroid-item:nth-child(3) { transform: translate(-12px, 10px) rotate(-8deg); z-index: 2; }
.album-photos-grid.is-stacked .polaroid-item:nth-child(4) { transform: translate(5px, 14px) rotate(6deg); z-index: 1; }

.album-photos-grid.is-spread {
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 20px;
}

.album-photos-grid.is-spread .polaroid-item:nth-child(1) { transform: rotate(-2deg); }
.album-photos-grid.is-spread .polaroid-item:nth-child(2) { transform: rotate(1.5deg); }
.album-photos-grid.is-spread .polaroid-item:nth-child(3) { transform: rotate(-1.5deg); }
.album-photos-grid.is-spread .polaroid-item:nth-child(4) { transform: rotate(2deg); }

/* ============================================================
   RESPONSIVE DESIGN
   ============================================================ */
@media (max-width: 600px) {
  .floating-top-bar { padding: 0 10px; top: 10px; }
  .floating-nav-pill, .floating-music-btn { padding: 6px 12px; font-size: 0.72rem; }
  .letter-content { padding: 30px 22px 24px; }
  .envelope-floating { right: 14px; top: 18%; width: 116px; }
  .envelope-pocket { width: 84px; height: 56px; }
  .envelope-seal-badge { top: 20px; }
  .action-btn { padding: 8px 14px; font-size: 11.5px; }
  .album-photos-grid.is-stacked { height: 420px; }
  .album-photos-grid.is-spread { grid-template-columns: minmax(0, 1fr); gap: 28px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation: none !important;
    transition: none !important;
  }
}
