/* ==========================================================================
   OUR LITTLE UNIVERSE — stylesheet
   Token system:
   --void / --void-deep   : midnight navy background
   --gold                 : warm golden light (primary accent)
   --nova                 : soft purple-blue glow (secondary accent)
   --ember                : muted warm rose, used sparingly (chaos section) — NOT valentine red
   --starlight             : off-white text
   --glass                : translucent card surface
   ========================================================================== */

:root{
  --void: #0b0e1f;
  --void-deep: #060812;
  --void-soft: #121631;
  --gold: #e8b96a;
  --gold-soft: #f3d9a3;
  --nova: #8b7fd6;
  --nova-soft: #b3a8ef;
  --ember: #d98a6f;
  --starlight: #f6f2e9;
  --starlight-dim: #c9c7d6;
  --glass: rgba(246, 242, 233, 0.06);
  --glass-border: rgba(246, 242, 233, 0.14);
  --shadow-deep: 0 30px 60px -20px rgba(0,0,0,0.6);

  --font-hand: 'Caveat', cursive;
  --font-serif: 'Cormorant Garamond', serif;
  --font-bn: 'Hind Siliguri', 'Cormorant Garamond', serif;

  --ease-soft: cubic-bezier(.22,.61,.36,1);
}

*{ box-sizing: border-box; }
html{ scroll-behavior: smooth; }

body{
  margin:0;
  background: radial-gradient(ellipse at 50% -10%, var(--void-soft), var(--void) 55%, var(--void-deep) 100%);
  color: var(--starlight);
  font-family: var(--font-serif), var(--font-bn);
  overflow-x: hidden;
  min-height: 100vh;
  cursor: default;
}

/* Bangla text needs the Bangla-aware face for correct glyph shaping */
:lang(bn), .bn, p, span, h1, h2, h3, figcaption, button{
  font-family: var(--font-serif), var(--font-bn);
}

::selection{ background: var(--nova); color: var(--void-deep); }

img{ max-width:100%; display:block; }
button{ font-family: inherit; cursor:pointer; }

/* ---------- ambient layers ---------- */
#starfield{
  position: fixed; inset:0; width:100%; height:100%;
  z-index:0; pointer-events:none;
}

#cursor-glow{
  position: fixed;
  width: 320px; height: 320px;
  border-radius: 50%;
  pointer-events:none;
  z-index:1;
  background: radial-gradient(circle, rgba(139,127,214,0.10) 0%, rgba(139,127,214,0) 70%);
  transform: translate(-50%,-50%);
  transition: opacity .4s ease;
  opacity:0;
}
@media (hover:hover) and (pointer:fine){
  #cursor-glow{ opacity:1; }
}

#scroll-progress{
  position: fixed; top:0; left:0; width:100%; height:2px; z-index:50;
  background: rgba(255,255,255,0.04);
}
#scroll-progress-bar{
  height:100%; width:0%;
  background: linear-gradient(90deg, var(--gold), var(--nova));
  transition: width .1s linear;
}

/* ==========================================================================
   OPENING
   ========================================================================== */
.opening{
  position: relative;
  min-height: 100svh;
  display:flex; align-items:center; justify-content:center;
  text-align:center;
  padding: 6vh 6vw;
  z-index:2;
}
.opening-vignette{
  position:absolute; inset:0;
  background: radial-gradient(ellipse at 50% 50%, transparent 30%, rgba(6,8,18,0.55) 100%);
  pointer-events:none;
}
.opening-inner{ position:relative; z-index:2; max-width: 720px; }

.reveal-line{
  font-family: var(--font-serif);
  font-style: italic;
  font-weight: 400;
  font-size: clamp(1.3rem, 3.4vw, 2.2rem);
  color: var(--starlight-dim);
  margin: 0.5em 0;
  opacity:0;
  letter-spacing: 0.01em;
}
.reveal-line-emph{
  color: var(--gold-soft);
  font-style: normal;
  font-weight: 500;
}
.reveal-line.is-shown{
  animation: lineIn 1.1s var(--ease-soft) forwards;
}
@keyframes lineIn{
  from{ opacity:0; transform: translateY(14px); filter: blur(6px); }
  to{ opacity:1; transform: translateY(0); filter: blur(0); }
}

.opening-mark{ margin-top: 2.2rem; opacity:0; }
.opening-mark.is-shown{ animation: lineIn 1.3s var(--ease-soft) forwards; }
.opening-date{
  display:block;
  font-family: var(--font-hand);
  color: var(--nova-soft);
  font-size: clamp(1.1rem, 2.6vw, 1.5rem);
  letter-spacing: 0.15em;
  margin-bottom: 0.4rem;
}
.opening-title{
  font-family: var(--font-hand);
  font-weight: 700;
  font-size: clamp(2.4rem, 7vw, 4.6rem);
  margin: 0;
  color: var(--starlight);
  text-shadow: 0 0 30px rgba(232,185,106,0.25);
}
.star-glyph{ color: var(--gold); display:inline-block; }

#enter-btn{ opacity:0; margin-top: 3rem; }
#enter-btn.is-shown{ animation: lineIn 1.2s var(--ease-soft) forwards; }

.glow-btn{
  position:relative;
  background: transparent;
  border: 1px solid var(--glass-border);
  color: var(--starlight);
  padding: 0.9rem 2rem;
  border-radius: 999px;
  font-size: 1.05rem;
  letter-spacing: 0.03em;
  display:inline-flex; align-items:center; gap:0.6rem;
  backdrop-filter: blur(6px);
  transition: border-color .4s ease, box-shadow .4s ease, transform .3s ease;
  box-shadow: 0 0 0 rgba(232,185,106,0);
}
.glow-btn:hover{
  border-color: var(--gold);
  box-shadow: 0 0 34px rgba(232,185,106,0.28);
  transform: translateY(-2px);
}
.glow-btn .arrow{ transition: transform .3s ease; }
.glow-btn:hover .arrow{ transform: translateX(4px); }

/* ==========================================================================
   MAIN / SECTIONS
   ========================================================================== */
main{ position:relative; z-index:2; }

.section{
  position:relative;
  max-width: 1080px;
  margin: 0 auto;
  padding: 12vh 6vw;
}
.section-dim{
  background: linear-gradient(180deg, transparent, rgba(0,0,0,0.28) 20%, rgba(0,0,0,0.28) 80%, transparent);
  max-width:none;
}
.section-dim > *{ max-width: 720px; margin-left:auto; margin-right:auto; }

.section-head{ text-align:center; margin-bottom: 4rem; }
.eyebrow{
  display:inline-block;
  font-family: var(--font-hand);
  font-size: 1.3rem;
  color: var(--gold-soft);
  letter-spacing: 0.08em;
  margin-bottom: 0.6rem;
}
.subtitle{
  font-size: clamp(1.1rem, 2.4vw, 1.4rem);
  color: var(--starlight-dim);
  line-height:1.7;
  max-width: 560px;
  margin: 0 auto;
}

/* scroll reveal */
.reveal{
  opacity:0;
  transform: translateY(28px);
  transition: opacity .9s var(--ease-soft), transform .9s var(--ease-soft);
}
.reveal.is-visible{ opacity:1; transform: translateY(0); }

/* ==========================================================================
   TIMELINE (section 1)
   ========================================================================== */
.timeline{
  display:flex; flex-direction:column; align-items:center;
  gap: 0; margin-bottom: 4rem;
}
.tl-node{
  background:none; border:none; color: var(--starlight);
  display:flex; flex-direction:column; align-items:center; gap:0.5rem;
  padding: 0.6rem 1rem;
}
.tl-dot{
  width:14px; height:14px; border-radius:50%;
  background: var(--void);
  border: 2px solid var(--nova-soft);
  box-shadow: 0 0 0 rgba(139,127,214,0);
  transition: box-shadow .3s ease, background .3s ease, transform .3s ease;
}
.tl-node:hover .tl-dot, .tl-node.is-open .tl-dot{
  background: var(--gold);
  border-color: var(--gold);
  box-shadow: 0 0 18px rgba(232,185,106,0.6);
  transform: scale(1.15);
}
.tl-label{
  font-family: var(--font-hand);
  font-size: 1.3rem;
  color: var(--starlight-dim);
}
.tl-node:hover .tl-label, .tl-node.is-open .tl-label{ color: var(--gold-soft); }
.tl-line{
  width:2px; height: 34px;
  background: linear-gradient(180deg, var(--nova-soft), transparent);
  opacity:0.5;
}
.tl-msg{
  max-width: 480px;
  margin: 0.4rem 0 0.8rem;
  padding: 0.9rem 1.3rem;
  background: var(--glass);
  border: 1px solid var(--glass-border);
  border-radius: 14px;
  font-size: 1.05rem;
  color: var(--starlight-dim);
  text-align:center;
  backdrop-filter: blur(8px);
}

.beginning-photo{ display:flex; justify-content:center; }

/* ==========================================================================
   POLAROID + GALLERY
   ========================================================================== */
.polaroid{
  background: #f4efe4;
  padding: 14px 14px 46px;
  border-radius: 3px;
  box-shadow: var(--shadow-deep), 0 2px 0 rgba(255,255,255,0.4) inset;
  width: min(280px, 78vw);
  margin: 0;
  transform: rotate(var(--tilt, -3deg));
  transition: transform .4s var(--ease-soft), box-shadow .4s ease;
  position: relative;
}
.polaroid::after{
  content:"";
  position:absolute; inset:14px 14px 46px;
  box-shadow: 0 0 40px rgba(0,0,0,0.12) inset;
  pointer-events:none;
}
.polaroid img{
  width:100%; aspect-ratio: 4/5; object-fit:cover;
  filter: sepia(0.08) contrast(1.03) saturate(1.05);
  cursor: zoom-in;
}
.polaroid figcaption{
  font-family: var(--font-hand);
  color:#3a3226;
  font-size: 1.15rem;
  text-align:center;
  margin-top: 10px;
  line-height:1.3;
}
.polaroid:hover{
  transform: rotate(0deg) translateY(-6px) scale(1.03);
  box-shadow: 0 40px 70px -18px rgba(0,0,0,0.65);
}

.gallery{
  display:grid;
  grid-template-columns: repeat(3, minmax(0,1fr));
  gap: 2.4rem 1.4rem;
  place-items:center;
}
.gallery .polaroid:nth-child(1){ --tilt: -4deg; }
.gallery .polaroid:nth-child(2){ --tilt: 5deg; }
.gallery .polaroid:nth-child(3){ --tilt: -6deg; }
.gallery .polaroid:nth-child(4){ --tilt: 4deg; }
.gallery .polaroid:nth-child(5){ --tilt: -5deg; }
.gallery .polaroid:nth-child(6){ --tilt: 6deg; }

/* ==========================================================================
   CHAOS CARDS
   ========================================================================== */
.chaos-grid{
  display:grid;
  grid-template-columns: repeat(3, minmax(0,1fr));
  gap: 1.4rem;
}
.chaos-card{
  background: var(--glass);
  border: 1px solid var(--glass-border);
  border-radius: 18px;
  padding: 1.8rem 1.5rem;
  backdrop-filter: blur(10px);
  opacity:0; transform: translateY(24px) scale(0.97);
  transition: opacity .7s var(--ease-soft), transform .7s var(--ease-soft), border-color .3s ease;
}
.chaos-card.is-visible{ opacity:1; transform: translateY(0) scale(1); }
.chaos-card:hover{ border-color: var(--ember); }
.chaos-icon{ font-size: 1.8rem; }
.chaos-card h3{
  font-family: var(--font-hand);
  font-size: 1.5rem;
  color: var(--gold-soft);
  margin: 0.5rem 0 0.6rem;
}
.chaos-en{ font-style: italic; color: var(--starlight); margin: 0 0 0.5rem; line-height:1.5; }
.chaos-bn{ color: var(--starlight-dim); margin:0; line-height:1.6; }

/* ==========================================================================
   FIGHTS SECTION
   ========================================================================== */
.section-dim{ text-align:center; }
.fights-text{ display:flex; flex-direction:column; gap:1.6rem; align-items:center; }
.fights-line{
  font-size: clamp(1.1rem, 2.6vw, 1.5rem);
  color: var(--starlight-dim);
  line-height:1.8;
  margin:0;
}
.fights-transition{ color: var(--nova-soft); font-style:italic; }
.fights-big{
  font-family: var(--font-hand);
  font-size: clamp(2.2rem, 6vw, 3.6rem);
  color: var(--gold-soft);
  margin: 0.2rem 0;
  text-shadow: 0 0 30px rgba(232,185,106,0.2);
}

/* ==========================================================================
   SECRETS
   ========================================================================== */
.secrets-grid{
  display:grid;
  grid-template-columns: repeat(4, minmax(0,1fr));
  gap: 1.2rem;
  margin-bottom: 1.6rem;
}
.secret-card{
  position:relative;
  background: linear-gradient(145deg, rgba(139,127,214,0.14), rgba(232,185,106,0.06));
  border: 1px solid var(--glass-border);
  border-radius: 16px;
  padding: 2.2rem 1rem;
  display:flex; flex-direction:column; align-items:center; gap:0.6rem;
  color: var(--starlight);
  font-size: 1.05rem;
  filter: blur(2.5px);
  transition: filter .4s ease, transform .3s ease, border-color .3s ease;
}
.secret-card:hover{ filter: blur(0px); transform: translateY(-4px); border-color: var(--nova-soft); }
.secret-lock{ font-size: 1.6rem; }
.secret-reply{
  text-align:center;
  min-height: 2rem;
  font-family: var(--font-hand);
  font-size: 1.4rem;
  color: var(--gold-soft);
  margin: 0.5rem 0 2rem;
}
.unknown-outro{ text-align:center; color: var(--starlight-dim); line-height:2; }
.unknown-outro .small-note{ font-style:italic; color: var(--nova-soft); }

/* ==========================================================================
   LITTLE THINGS BUBBLES
   ========================================================================== */
.bubbles{
  display:flex; flex-wrap:wrap; justify-content:center; gap: 0.9rem;
}
.bubble{
  background: var(--glass);
  border: 1px solid var(--glass-border);
  border-radius: 999px;
  padding: 0.7rem 1.3rem;
  font-size: 1rem;
  color: var(--starlight-dim);
  backdrop-filter: blur(8px);
  transition: transform .35s var(--ease-soft), color .3s ease, border-color .3s ease, background .3s ease;
}
.bubble:hover{
  transform: scale(1.12);
  color: var(--void-deep);
  background: linear-gradient(120deg, var(--gold-soft), var(--nova-soft));
  border-color: transparent;
}

/* ==========================================================================
   PLAYLIST
   ========================================================================== */
.player{ display:flex; flex-direction:column; gap: 0.9rem; }
.track{
  display:flex; align-items:center; gap: 1.1rem;
  background: var(--glass);
  border: 1px solid var(--glass-border);
  border-radius: 14px;
  padding: 0.9rem 1.2rem;
  backdrop-filter: blur(8px);
  transition: border-color .3s ease;
}
.track.is-playing{ border-color: var(--gold); }
.play-btn{
  width: 42px; height:42px; border-radius:50%;
  border: 1px solid var(--glass-border);
  background: rgba(255,255,255,0.03);
  display:flex; align-items:center; justify-content:center;
  flex-shrink:0;
  transition: background .3s ease, border-color .3s ease;
}
.play-btn:hover{ border-color: var(--gold); }
.icon-play, .icon-pause{ width:18px; height:18px; fill: var(--starlight); }
.track-info{ display:flex; flex-direction:column; flex:1; min-width:0; }
.track-title{ font-size: 1.1rem; color: var(--starlight); }
.track-artist{ font-size: 0.9rem; color: var(--starlight-dim); font-style: italic; }
.equalizer{
  display:flex; align-items:flex-end; gap:3px; height:20px; opacity:0.35;
}
.equalizer span{
  width:3px; background: var(--gold); height: 40%;
  border-radius: 2px;
}
.track.is-playing .equalizer{ opacity:1; }
.track.is-playing .equalizer span{ animation: eq 0.9s ease-in-out infinite; }
.equalizer span:nth-child(1){ animation-delay: 0s; }
.equalizer span:nth-child(2){ animation-delay: .15s; }
.equalizer span:nth-child(3){ animation-delay: .3s; }
.equalizer span:nth-child(4){ animation-delay: .45s; }
@keyframes eq{
  0%,100%{ height:30%; } 50%{ height:100%; }
}
.playlist-note{
  text-align:center; margin-top: 2rem;
  font-family: var(--font-hand); font-size:1.4rem; color: var(--nova-soft);
}

/* ==========================================================================
   LETTER
   ========================================================================== */
.letter-card{
  background: linear-gradient(160deg, rgba(232,185,106,0.06), rgba(139,127,214,0.06));
  border: 1px solid var(--glass-border);
  border-radius: 20px;
  padding: clamp(2rem, 5vw, 3.4rem);
  box-shadow: var(--shadow-deep);
  max-width: 720px; margin: 0 auto;
}
.letter-card p{
  font-size: clamp(1.05rem, 2.2vw, 1.3rem);
  line-height: 2;
  color: var(--starlight-dim);
  margin: 0 0 1.1rem;
}
.letter-emph{
  font-family: var(--font-hand);
  font-size: 1.6rem !important;
  color: var(--gold-soft) !important;
}

/* ==========================================================================
   FINAL SURPRISE
   ========================================================================== */
.section-final{
  min-height: 100svh;
  display:flex; align-items:center; justify-content:center;
  flex-direction:column;
  text-align:center;
  transition: background 1.4s ease;
}
.envelope-stage{ display:flex; flex-direction:column; align-items:center; gap:1.6rem; }
.final-intro{ font-family: var(--font-hand); font-size: 1.7rem; color: var(--starlight-dim); }

.envelope{
  position:relative;
  width: 160px; height: 110px;
  background:none; border:none; padding:0;
}
.envelope-body{
  position:absolute; inset:0;
  background: linear-gradient(160deg, #2a2550, #171334);
  border: 1px solid var(--glass-border);
  border-radius: 8px;
  box-shadow: var(--shadow-deep);
}
.envelope-flap{
  position:absolute; top:0; left:0; right:0; height: 60%;
  background: linear-gradient(160deg, #352d63, #1c1840);
  clip-path: polygon(0 0, 100% 0, 50% 90%);
  border-radius: 8px 8px 0 0;
  transform-origin: top;
  transition: transform .6s var(--ease-soft);
}
.envelope-seal{
  position:absolute; top: 42%; left:50%; transform: translate(-50%,-50%);
  color: var(--gold); font-size: 1.4rem;
  text-shadow: 0 0 14px rgba(232,185,106,0.7);
}
.envelope:hover .envelope-flap{ transform: rotateX(-15deg); }
.envelope.is-open .envelope-flap{ transform: rotateX(-180deg); opacity:0; }
.open-hint{ font-size: 0.95rem; letter-spacing:0.1em; color: var(--starlight-dim); text-transform:uppercase; }

.final-message{
  max-width: 620px;
  display:flex; flex-direction:column; align-items:center; gap:0.5rem;
}
.final-message[hidden]{ display:none; }
.final-line{
  font-size: clamp(1.1rem, 2.6vw, 1.5rem);
  color: var(--starlight-dim);
  opacity:0;
  margin: 0.15rem 0;
}
.final-line.is-shown{ animation: lineIn 1s var(--ease-soft) forwards; }
.final-gap{ margin-top: 1rem; }
.final-title{
  font-family: var(--font-hand);
  font-size: clamp(2.2rem, 6vw, 3.6rem);
  color: var(--starlight);
  margin: 2rem 0 0.4rem;
  text-shadow: 0 0 30px rgba(232,185,106,0.3);
  opacity:0;
}
.final-title.is-shown{ animation: lineIn 1.2s var(--ease-soft) forwards; }
.final-signature{
  font-family: var(--font-hand);
  font-size: 1.2rem; color: var(--nova-soft);
  opacity:0;
}
.final-signature.is-shown{ animation: lineIn 1.2s var(--ease-soft) forwards; }

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

/* ==========================================================================
   LIGHTBOX
   ========================================================================== */
.lightbox{
  position:fixed; inset:0; z-index:100;
  background: rgba(6,8,18,0.92);
  display:flex; align-items:center; justify-content:center;
  padding: 4vh 4vw;
  backdrop-filter: blur(6px);
  animation: fadeIn .3s ease;
}
.lightbox[hidden]{ display:none; }
@keyframes fadeIn{ from{ opacity:0; } to{ opacity:1; } }
.lightbox img{
  max-width: min(680px, 92vw); max-height: 86vh;
  border-radius: 6px;
  box-shadow: 0 40px 100px rgba(0,0,0,0.7);
}
.lightbox-close{
  position:absolute; top: 4vh; right: 5vw;
  background:none; border:none; color: var(--starlight);
  font-size: 1.6rem; width:44px; height:44px;
}

/* ==========================================================================
   RESPONSIVE
   ========================================================================== */
@media (max-width: 860px){
  .gallery{ grid-template-columns: repeat(2, minmax(0,1fr)); gap: 2rem 1rem; }
  .chaos-grid{ grid-template-columns: 1fr; }
  .secrets-grid{ grid-template-columns: repeat(2, minmax(0,1fr)); }
}
@media (max-width: 520px){
  .section{ padding: 9vh 6vw; }
  .gallery{ grid-template-columns: repeat(2, minmax(0,1fr)); gap: 1.6rem 0.8rem; }
  .polaroid{ width: 100%; }
  .timeline .tl-label{ font-size: 1.1rem; }
  .envelope{ width: 130px; height: 92px; }
}

/* ==========================================================================
   ACCESSIBILITY
   ========================================================================== */
button:focus-visible, .tl-node:focus-visible, .secret-card:focus-visible{
  outline: 2px solid var(--gold);
  outline-offset: 3px;
}

@media (prefers-reduced-motion: reduce){
  *{ animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; scroll-behavior:auto !important; }
}
