/* ==========================================================================
   nowmi.love — Romantic Interactive Static Love-Letter Stylesheet
   ========================================================================== */

:root {
  /* Color Palette */
  --bg-blush-light: #FFF5F7;
  --bg-blush-mid: #FFE4EC;
  --bg-rose-soft: #FAD2E1;
  --bg-rose-accent: #F7C0D4;

  --text-primary: #3D1422;
  --text-secondary: #6B2840;
  --text-muted: #984B66;
  --accent-rose: #C84B76;
  --accent-rose-deep: #A6345C;
  --accent-rose-soft: #E88DAE;

  /* Glassmorphism */
  --glass-bg: rgba(255, 255, 255, 0.65);
  --glass-bg-hover: rgba(255, 255, 255, 0.76);
  --glass-border: rgba(236, 158, 184, 0.48);
  --glass-highlight: rgba(255, 255, 255, 0.85);
  --glass-shadow: 0 18px 48px -12px rgba(145, 45, 78, 0.14),
                  0 4px 16px -2px rgba(145, 45, 78, 0.07);

  /* Typography */
  --font-bengali: 'Noto Serif Bengali', 'Tiro Bangla', serif;
  --font-bengali-display: 'Tiro Bangla', 'Noto Serif Bengali', serif;
  --font-english: 'Cormorant Garamond', Georgia, serif;

  /* Layout */
  --container-max: 660px;
}

/* Reset & Base */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  overflow-x: hidden;
  -webkit-text-size-adjust: 100%;
}

body {
  min-height: 100vh;
  min-height: 100dvh;
  overflow-x: hidden;
  font-family: var(--font-bengali);
  color: var(--text-primary);
  background-color: var(--bg-blush-light);
  background-image:
    radial-gradient(circle at 18% 15%, rgba(250, 210, 225, 0.72) 0%, transparent 48%),
    radial-gradient(circle at 84% 80%, rgba(255, 218, 232, 0.85) 0%, transparent 52%),
    linear-gradient(160deg, var(--bg-blush-light) 0%, var(--bg-blush-mid) 52%, var(--bg-rose-soft) 100%);
  background-attachment: fixed;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  position: relative;
}

body.locked {
  overflow: hidden;
  height: 100vh;
  height: 100dvh;
}

/* Custom Text Selection */
::selection {
  background: rgba(214, 90, 132, 0.22);
  color: var(--text-primary);
}

/* Screen-reader Only Utility */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* ==========================================================================
   Animated Petals Canvas & Ambient Background
   ========================================================================== */

#petals-canvas {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 0;
}

.ambient-glow {
  position: fixed;
  border-radius: 50%;
  filter: blur(72px);
  pointer-events: none;
  z-index: 0;
  opacity: 0.55;
}

.ambient-glow--top {
  width: clamp(240px, 42vw, 480px);
  height: clamp(240px, 42vw, 480px);
  top: -10%;
  left: -8%;
  background: radial-gradient(circle, rgba(248, 175, 202, 0.65), rgba(255, 228, 236, 0));
}

.ambient-glow--bottom {
  width: clamp(260px, 46vw, 520px);
  height: clamp(260px, 46vw, 520px);
  bottom: -12%;
  right: -8%;
  background: radial-gradient(circle, rgba(244, 164, 192, 0.6), rgba(255, 228, 236, 0));
}

/* ==========================================================================
   Layout Container & Glassmorphic Card Surface
   ========================================================================== */

.container {
  width: 100%;
  max-width: var(--container-max);
  margin-inline: auto;
  padding-inline: clamp(1.25rem, 5.5vw, 2.25rem);
  position: relative;
  z-index: 2;
}

.glass-card {
  background: var(--glass-bg);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--glass-border);
  box-shadow:
    var(--glass-shadow),
    inset 0 1px 0 0 var(--glass-highlight);
  border-radius: clamp(20px, 3vw, 28px);
}

/* ==========================================================================
   1. Password Lock Screen (26/11/2008)
   ========================================================================== */

.lock-screen {
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding-block: 2rem;
  position: relative;
  z-index: 3;
  opacity: 1;
  transform: scale(1) translateY(0);
  filter: blur(0);
  transition:
    opacity 0.85s cubic-bezier(0.22, 1, 0.36, 1),
    transform 0.85s cubic-bezier(0.22, 1, 0.36, 1),
    filter 0.85s cubic-bezier(0.22, 1, 0.36, 1);
}

.lock-screen.unlocking {
  opacity: 0;
  transform: scale(0.96) translateY(-14px);
  filter: blur(8px);
  pointer-events: none;
}

.lock-screen[hidden] {
  display: none !important;
}

.lock-card {
  width: 100%;
  max-width: 470px;
  margin-inline: auto;
  padding: clamp(2.1rem, 6vw, 3.25rem) clamp(1.5rem, 5.5vw, 2.75rem);
  text-align: center;
  position: relative;
  overflow: hidden;
  animation: cardEntrance 0.9s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.lock-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 15%;
  right: 15%;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.95), transparent);
}

/* Wax Seal / Heart Emblem */
.wax-seal {
  width: 56px;
  height: 56px;
  margin: 0 auto 1.15rem;
  border-radius: 50%;
  background: linear-gradient(145deg, rgba(255, 240, 245, 0.92), rgba(250, 205, 222, 0.78));
  border: 1px solid rgba(218, 120, 154, 0.38);
  box-shadow:
    0 8px 20px -4px rgba(175, 58, 98, 0.2),
    inset 0 2px 4px rgba(255, 255, 255, 0.9);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent-rose);
}

.heart-icon {
  width: 24px;
  height: 24px;
  animation: gentlePulse 3.2s ease-in-out infinite;
}

.domain-tag {
  font-family: var(--font-english);
  font-size: clamp(0.85rem, 1.8vw, 0.98rem);
  letter-spacing: 0.24em;
  text-transform: lowercase;
  color: var(--text-muted);
  margin-bottom: 0.4rem;
}

.lock-title {
  font-family: var(--font-english);
  font-weight: 600;
  font-style: italic;
  font-size: clamp(1.85rem, 5vw, 2.45rem);
  line-height: 1.2;
  color: var(--text-primary);
  margin-bottom: 0.65rem;
}

.lock-prompt {
  font-family: var(--font-english);
  font-size: clamp(1.08rem, 2.5vw, 1.24rem);
  line-height: 1.45;
  color: var(--text-secondary);
  margin-bottom: 1.85rem;
}

/* Input & Unlock Button */
.unlock-form {
  display: flex;
  flex-direction: column;
  gap: 0.95rem;
  align-items: center;
}

.input-wrapper {
  width: 100%;
  max-width: 290px;
  position: relative;
}

#date-input {
  width: 100%;
  padding: 0.9rem 1.15rem;
  font-family: var(--font-english);
  font-size: clamp(1.2rem, 3vw, 1.38rem);
  font-weight: 600;
  letter-spacing: 0.16em;
  text-align: center;
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.78);
  border: 1.5px solid rgba(222, 138, 168, 0.52);
  border-radius: 999px;
  outline: none;
  box-shadow: inset 0 2px 5px rgba(145, 45, 78, 0.04);
  transition:
    border-color 0.25s ease,
    box-shadow 0.25s ease,
    background-color 0.25s ease;
}

#date-input::placeholder {
  color: rgba(152, 75, 102, 0.45);
  font-weight: 400;
  letter-spacing: 0.12em;
}

#date-input:focus {
  background: rgba(255, 255, 255, 0.95);
  border-color: var(--accent-rose);
  box-shadow:
    0 0 0 4px rgba(200, 75, 118, 0.14),
    inset 0 2px 4px rgba(145, 45, 78, 0.03);
}

#date-input.input-error {
  border-color: #C93B5B;
  box-shadow: 0 0 0 4px rgba(201, 59, 91, 0.14);
}

.unlock-btn {
  width: 100%;
  max-width: 290px;
  padding: 0.88rem 1.5rem;
  border: 1px solid rgba(190, 68, 110, 0.35);
  border-radius: 999px;
  background: linear-gradient(135deg, #D45882 0%, #B33B66 100%);
  color: #FFF9FB;
  font-family: var(--font-english);
  font-size: clamp(1.08rem, 2.4vw, 1.2rem);
  font-weight: 600;
  letter-spacing: 0.08em;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.55rem;
  box-shadow:
    0 10px 24px -6px rgba(179, 59, 102, 0.42),
    inset 0 1px 0 rgba(255, 255, 255, 0.35);
  transition:
    transform 0.22s ease,
    box-shadow 0.22s ease,
    filter 0.22s ease;
}

.unlock-btn:hover {
  transform: translateY(-1.5px);
  box-shadow:
    0 14px 28px -6px rgba(179, 59, 102, 0.5),
    inset 0 1px 0 rgba(255, 255, 255, 0.45);
  filter: brightness(1.03);
}

.unlock-btn:active {
  transform: translateY(0);
}

.unlock-btn:focus-visible {
  outline: 2px solid var(--accent-rose-deep);
  outline-offset: 3px;
}

.btn-arrow {
  width: 18px;
  height: 18px;
  transition: transform 0.22s ease;
}

.unlock-btn:hover .btn-arrow {
  transform: translateX(3px);
}

.error-message {
  min-height: 1.45em;
  font-family: var(--font-english);
  font-style: italic;
  font-size: clamp(0.98rem, 2.2vw, 1.1rem);
  color: #B82E52;
  opacity: 0;
  transform: translateY(-4px);
  transition: opacity 0.28s ease, transform 0.28s ease;
}

.error-message.visible {
  opacity: 1;
  transform: translateY(0);
}

/* Gentle Horizontal Shake Animation */
.lock-card.shake {
  animation: gentleShake 0.52s cubic-bezier(0.36, 0.07, 0.19, 0.97) both;
}

@keyframes gentleShake {
  0%, 100% {
    transform: translateX(0);
  }
  18% {
    transform: translateX(-9px);
  }
  36% {
    transform: translateX(8px);
  }
  54% {
    transform: translateX(-6px);
  }
  72% {
    transform: translateX(5px);
  }
  88% {
    transform: translateX(-2px);
  }
}

@keyframes cardEntrance {
  from {
    opacity: 0;
    transform: translateY(18px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

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

/* ==========================================================================
   2. Love Letter View (Hero + Scroll-Triggered Bengali Paragraphs)
   ========================================================================== */

.letter-view[hidden] {
  display: none !important;
  opacity: 0;
  visibility: hidden;
}

.letter-view {
  position: relative;
  z-index: 2;
  opacity: 0;
  transition: opacity 1.1s ease-out;
}

.letter-view.revealed {
  opacity: 1;
}

/* Hero Section (100dvh) */
.letter-hero {
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding-block: 3.5rem;
  position: relative;
}

.hero-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  animation: heroFadeUp 1.2s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.hero-ornament {
  display: inline-flex;
  align-items: center;
  gap: 0.85rem;
  margin-bottom: 1.5rem;
  color: var(--accent-rose);
}

.ornament-line {
  width: clamp(44px, 11vw, 76px);
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(200, 75, 118, 0.55), transparent);
}

.ornament-heart {
  font-size: 0.95rem;
  opacity: 0.85;
  animation: gentlePulse 3s ease-in-out infinite;
}

.hero-subtitle {
  font-family: var(--font-english);
  font-style: italic;
  font-size: clamp(1.12rem, 2.6vw, 1.38rem);
  letter-spacing: 0.06em;
  color: var(--text-secondary);
  margin-bottom: 0.65rem;
}

.hero-title {
  font-family: var(--font-bengali-display);
  font-weight: 500;
  font-size: clamp(1.9rem, 5.4vw, 2.85rem);
  line-height: 1.65;
  color: var(--text-primary);
  margin-bottom: 0.7rem;
  padding-block: 0.15em;
  text-shadow: 0 2px 14px rgba(255, 255, 255, 0.65);
}

.hero-caption {
  font-family: var(--font-english);
  font-size: clamp(1rem, 2.2vw, 1.16rem);
  color: var(--text-muted);
  margin-bottom: clamp(2.75rem, 7vh, 4.25rem);
}

/* Bouncing Scroll Cue */
.scroll-cue {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  gap: 0.55rem;
  text-decoration: none;
  color: var(--text-secondary);
  font-family: var(--font-english);
  font-style: italic;
  font-size: clamp(1.02rem, 2.2vw, 1.18rem);
  letter-spacing: 0.08em;
  padding: 0.6rem 1.2rem;
  border-radius: 999px;
  transition: color 0.25s ease, transform 0.25s ease;
}

.scroll-cue:hover {
  color: var(--accent-rose-deep);
}

.scroll-cue__icon {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.65);
  border: 1px solid var(--glass-border);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--accent-rose);
  box-shadow: 0 6px 16px rgba(166, 52, 92, 0.12);
  animation: scrollBounce 2.2s ease-in-out infinite;
}

.scroll-cue__icon svg {
  width: 18px;
  height: 18px;
}

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

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

/* ==========================================================================
   Love Letter Body & Stanza Cards
   ========================================================================== */

.letter-body {
  padding-top: clamp(1.5rem, 5vh, 3rem);
  padding-bottom: clamp(4rem, 10vh, 7rem);
}

.stanza-wrapper {
  min-height: 52vh;
  min-height: 52dvh;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: clamp(4.5rem, 14vh, 8.5rem);
}

.stanza-wrapper:last-child {
  margin-bottom: clamp(2rem, 6vh, 4rem);
}

.stanza-card {
  width: 100%;
  padding: clamp(1.85rem, 5.5vw, 3.1rem) clamp(1.5rem, 5.2vw, 2.85rem);
  position: relative;
}

.stanza-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 12%;
  right: 12%;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.9), transparent);
}

.stanza-index {
  display: inline-block;
  font-family: var(--font-english);
  font-style: italic;
  font-size: clamp(0.88rem, 1.8vw, 1rem);
  letter-spacing: 0.22em;
  color: var(--accent-rose);
  margin-bottom: 0.95rem;
  opacity: 0.85;
}

/* Bengali Typography: Clean Vowel Mark (kar & juktakkhor) Rendering */
.bengali-paragraph {
  font-family: var(--font-bengali);
  font-weight: 400;
  font-size: clamp(1.1rem, 2.5vw, 1.3rem);
  line-height: 2.05;
  color: var(--text-primary);
  letter-spacing: 0.005em;
  word-spacing: 0.04em;
  text-align: left;
  padding-block: 0.15em;
  overflow: visible;
}

.stanza-flourish {
  margin-top: 1.5rem;
  text-align: center;
  color: var(--accent-rose);
  font-size: 1.15rem;
  opacity: 0.78;
}

/* Scroll-Triggered Reveal Transition */
.reveal-paragraph {
  opacity: 0;
  transform: translateY(28px);
  transition:
    opacity 1s ease-out,
    transform 1s ease-out;
  will-change: opacity, transform;
}

.reveal-paragraph.is-visible {
  opacity: 1;
  transform: translateY(0);
}

/* ==========================================================================
   Minimal Footer
   ========================================================================== */

.letter-footer {
  padding-top: 1rem;
  padding-bottom: clamp(3.5rem, 8vh, 5.5rem);
  text-align: center;
  position: relative;
  z-index: 2;
}

.footer-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.55rem;
}

.footer-divider {
  width: 68px;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(200, 75, 118, 0.45), transparent);
  margin-bottom: 0.4rem;
}

.footer-heart {
  color: var(--accent-rose);
  font-size: 1rem;
  line-height: 1;
  animation: gentlePulse 3.4s ease-in-out infinite;
}

.footer-domain {
  font-family: var(--font-english);
  font-style: italic;
  font-size: clamp(0.95rem, 2vw, 1.08rem);
  letter-spacing: 0.18em;
  color: var(--text-muted);
}

/* ==========================================================================
   Responsive Refinements & Reduced Motion
   ========================================================================== */

@media (max-width: 480px) {
  .stanza-wrapper {
    min-height: 44dvh;
    margin-bottom: 4.25rem;
  }

  .stanza-card {
    border-radius: 20px;
  }

  .lock-card {
    border-radius: 22px;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  .reveal-paragraph {
    transition-duration: 0.01s;
    transform: none;
  }

  .scroll-cue__icon,
  .heart-icon,
  .ornament-heart,
  .footer-heart {
    animation: none;
  }
}
