/* 
  100% Self-Contained Offline Stylesheet
  Custom designed layout utilities, transitions, and keyframes for Samridhi's Birthday Experience
*/

:root {
  --obsidian-bg: #0B0B0F;
  --rosegold: #E0A96D;
  --blushpink: #F7C5CC;
  --cream: #F5F5F7;
  --silver: #9A9A9E;
  --white-10: rgba(255, 255, 255, 0.1);
  --white-5: rgba(255, 255, 255, 0.05);
}

/* Base resets */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

body {
  background-color: var(--obsidian-bg);
  color: var(--cream);
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  min-height: 100vh;
  overflow-x: hidden;
  position: relative;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

/* Utility Layout Classes (Tailwind Offline Fallbacks) */
.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.items-end { align-items: flex-end; }
.justify-center { justify-content: center; }
.justify-between { justify-content: space-between; }
.flex-grow { flex-grow: 1; }
.grid { display: grid; }
.gap-2 { gap: 0.5rem; }
.gap-3 { gap: 0.75rem; }
.gap-4 { gap: 1rem; }
.gap-5 { gap: 1.25rem; }
.gap-6 { gap: 1.5rem; }

.relative { position: relative; }
.absolute { position: absolute; }
.fixed { position: fixed; }
.inset-0 { top: 0; right: 0; bottom: 0; left: 0; }
.inset-x-0 { left: 0; right: 0; }
.inset-y-0 { top: 0; bottom: 0; }
.top-0 { top: 0; }
.bottom-0 { bottom: 0; }
.left-0 { left: 0; }
.right-0 { right: 0; }
.z-10 { z-index: 10; }
.z-20 { z-index: 20; }
.z-30 { z-index: 30; }
.z-40 { z-index: 40; }
.z-50 { z-index: 50; }

.w-full { width: 100%; }
.h-full { height: 100%; }
.min-h-screen { min-height: 100vh; }
.max-w-md { max-width: 28rem; }
.max-w-xl { max-width: 36rem; }
.max-w-lg { max-width: 32rem; }
.aspect-square { aspect-ratio: 1 / 1; }

.p-2 { padding: 0.5rem; }
.p-3 { padding: 0.75rem; }
.p-4 { padding: 1rem; }
.p-6 { padding: 1.5rem; }
.p-8 { padding: 2rem; }
.py-1.5 { padding-top: 0.375rem; padding-bottom: 0.375rem; }
.py-2 { padding-top: 0.5rem; padding-bottom: 0.5rem; }
.py-3.5 { padding-top: 0.875rem; padding-bottom: 0.875rem; }
.py-4 { padding-top: 1rem; padding-bottom: 1rem; }
.py-10 { padding-top: 2.5rem; padding-bottom: 2.5rem; }
.py-12 { padding-top: 3rem; padding-bottom: 3rem; }
.py-20 { padding-top: 5rem; padding-bottom: 5rem; }
.px-3 { padding-left: 0.75rem; padding-right: 0.75rem; }
.px-4 { padding-left: 1rem; padding-right: 1rem; }
.px-5 { padding-left: 1.25rem; padding-right: 1.25rem; }
.px-6 { padding-left: 1.5rem; padding-right: 1.5rem; }
.pt-1 { padding-top: 0.25rem; }
.pt-2 { padding-top: 0.5rem; }
.pt-4 { padding-top: 1rem; }
.pt-8 { padding-top: 2rem; }
.pt-24 { padding-top: 6rem; }
.pb-1 { padding-bottom: 0.25rem; }
.pb-2 { padding-bottom: 0.5rem; }
.pb-4 { padding-bottom: 1rem; }
.pb-6 { padding-bottom: 1.5rem; }
.pb-20 { padding-bottom: 5rem; }
.mt-1 { margin-top: 0.25rem; }
.mt-4 { margin-top: 1rem; }
.mt-auto { margin-top: auto; }
.mb-2 { margin-bottom: 0.5rem; }
.mb-6 { margin-bottom: 1.5rem; }
.mx-auto { margin-left: auto; margin-right: auto; }
.-mx-4 { margin-left: -1rem; margin-right: -1rem; }

/* Text & Typography */
.font-serif { font-family: 'Playfair Display', Georgia, Cambria, serif; }
.font-sans { font-family: 'Inter', sans-serif; }
.font-handwritten { font-family: 'Caveat', cursive, sans-serif; }

.text-center { text-align: center; }
.text-right { text-align: right; }
.text-justify { text-align: justify; }
.text-xs { font-size: 0.75rem; }
.text-[9px] { font-size: 9px; }
.text-[10px] { font-size: 10px; }
.text-sm { font-size: 0.875rem; }
.text-base { font-size: 1rem; }
.text-lg { font-size: 1.125rem; }
.text-xl { font-size: 1.25rem; }
.text-2xl { font-size: 1.5rem; }
.text-3xl { font-size: 1.875rem; }
.text-4xl { font-size: 2.25rem; }
.text-5xl { font-size: 3rem; }

.font-bold { font-weight: 700; }
.font-semibold { font-weight: 600; }
.font-medium { font-weight: 500; }
.font-light { font-weight: 300; }
.leading-tight { line-height: 1.25; }
.leading-relaxed { line-height: 1.625; }
.tracking-wide { letter-spacing: 0.025em; }
.tracking-widest { letter-spacing: 0.15em; }
.uppercase { text-transform: uppercase; }
.italic { font-style: italic; }

.text-rosegold { color: var(--rosegold); }
.text-blushpink { color: var(--blushpink); }
.text-cream { color: var(--cream); }
.text-silver { color: var(--silver); }
.text-obsidian { color: var(--obsidian-bg); }

.bg-obsidian { background-color: var(--obsidian-bg); }
.bg-rosegold { background-color: var(--rosegold); }
.bg-blushpink { background-color: var(--blushpink); }
.bg-white\/5 { background-color: rgba(255, 255, 255, 0.05); }
.bg-white\/20 { background-color: rgba(255, 255, 255, 0.2); }
.bg-black\/30 { background-color: rgba(0, 0, 0, 0.3); }

/* Borders & Rounding */
.rounded-full { border-radius: 9999px; }
.rounded-sm { border-radius: 0.125rem; }
.rounded-2xl { border-radius: 1rem; }
.rounded-3xl { border-radius: 1.5rem; }
.border { border: 1px solid rgba(255, 255, 255, 0.1); }
.border-b { border-bottom: 1px solid rgba(255, 255, 255, 0.1); }
.border-l-2 { border-left: 2px solid rgba(255, 255, 255, 0.1); }
.border-white\/10 { border-color: var(--white-10); }
.border-white\/5 { border-color: var(--white-5); }
.border-rosegold\/20 { border-color: rgba(224, 169, 109, 0.2); }
.border-rosegold\/30 { border-color: rgba(224, 169, 109, 0.3); }
.border-rosegold\/40 { border-color: rgba(224, 169, 109, 0.4); }
.border-rosegold\/50 { border-color: rgba(224, 169, 109, 0.5); }

/* Transitions & Blurs */
.transition-all { transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1); }
.duration-500 { transition-duration: 500ms; }
.backdrop-blur-md { backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); }
.backdrop-blur-lg { backdrop-filter: blur(24px); -webkit-backdrop-filter: blur(24px); }
.shadow-lg { box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.3); }
.shadow-xl { box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.4); }
.shadow-2xl { box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.6); }

.opacity-0 { opacity: 0; }
.opacity-95 { opacity: 0.95; }
.pointer-events-none { pointer-events: none; }
.pointer-events-auto { pointer-events: auto; }
.hidden { display: none !important; }
.select-none { user-select: none; }
.select-text { user-select: text; }
.active\:scale-95:active { transform: scale(0.95); }

/* Scrollbars styling */
::-webkit-scrollbar {
  width: 6px;
}
::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.02);
}
::-webkit-scrollbar-thumb {
  background: rgba(224, 169, 109, 0.25);
  border-radius: 999px;
}
::-webkit-scrollbar-thumb:hover {
  background: rgba(224, 169, 109, 0.4);
}
.no-scrollbar::-webkit-scrollbar {
  display: none;
}
.no-scrollbar {
  -ms-overflow-style: none;
  scrollbar-width: none;
}

/* Twinkling Starfield */
.star {
  position: absolute;
  background-color: #ffffff;
  border-radius: 50%;
  animation: twinkle var(--duration, 4s) ease-in-out infinite;
  animation-delay: var(--delay, 0s);
  opacity: 0.2;
}

@keyframes twinkle {
  0%, 100% { opacity: 0.15; transform: scale(0.8); }
  50% { opacity: 0.85; transform: scale(1.25); }
}

/* Audio Player Spinning & Equalizer */
.eq-bar {
  animation: eq-bounce 1s ease-in-out infinite alternate;
  transform-origin: bottom;
}
.eq-bar:nth-child(1) { animation-duration: 0.8s; }
.eq-bar:nth-child(2) { animation-duration: 0.5s; animation-delay: 0.15s; }
.eq-bar:nth-child(3) { animation-duration: 0.7s; animation-delay: 0.3s; }

@keyframes eq-bounce {
  0% { transform: scaleY(0.25); }
  100% { transform: scaleY(1); }
}
.paused-animation .eq-bar {
  animation-play-state: paused;
}

/* ================= PAGE 1: WRAPPED MODULE CUSTOM CSS ================= */
.story-wrapper {
  display: flex;
  justify-content: center;
  align-items: center;
  width: 100%;
  height: 100vh;
  padding: 1rem;
}

.story-container {
  width: 100%;
  max-width: 360px;
  aspect-ratio: 9 / 16;
  background-color: #0d0d12;
  border-radius: 1.5rem;
  overflow: hidden;
  position: relative;
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.75);
}

.story-slide {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 2.5rem 1.5rem;
  background-size: cover;
  background-position: center;
  transition: opacity 0.5s ease-in-out, transform 0.5s ease-in-out;
  opacity: 0;
  transform: scale(1.02);
  z-index: 10;
  pointer-events: none;
}

.story-slide.active {
  opacity: 1;
  transform: scale(1);
  z-index: 15;
  pointer-events: auto;
}

/* Dark gradient overlay to ensure high text contrast */
.story-slide::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, 
    rgba(11, 11, 15, 0.95) 0%, 
    rgba(11, 11, 15, 0.6) 40%, 
    rgba(11, 11, 15, 0.2) 75%, 
    rgba(11, 11, 15, 0.55) 100%
  );
  z-index: 1;
}

.story-content {
  position: relative;
  z-index: 2;
  margin-bottom: 2rem;
  animation: slideContentUp 0.6s cubic-bezier(0.19, 1, 0.22, 1) forwards;
}

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

.story-progress-bar {
  position: absolute;
  top: 1rem;
  left: 1rem;
  right: 1rem;
  height: 3px;
  display: flex;
  gap: 4px;
  z-index: 30;
}

.progress-segment {
  flex: 1;
  background-color: rgba(255, 255, 255, 0.2);
  border-radius: 9999px;
  overflow: hidden;
  height: 100%;
}

.progress-segment-inner {
  height: 100%;
  background-color: var(--rosegold);
  width: 0%;
}

.progress-segment-inner.completed {
  width: 100%;
}

.progress-segment-inner.active {
  animation: fill-story var(--slide-duration, 5s) linear forwards;
}

@keyframes fill-story {
  from { width: 0%; }
  to { width: 100%; }
}

.story-tap-left {
  position: absolute;
  inset-y: 0;
  left: 0;
  width: 25%;
  z-index: 25;
  cursor: pointer;
}

.story-tap-right {
  position: absolute;
  inset-y: 0;
  right: 0;
  width: 75%;
  z-index: 25;
  cursor: pointer;
}

/* ================= PAGE 2: TIMELINE MODULE CUSTOM CSS ================= */
.timeline-section {
  max-width: 540px;
  width: 100%;
  margin: 0 auto;
  padding: 6rem 1rem 5rem 1rem;
}

.timeline-line {
  position: relative;
  border-left: 2px solid rgba(224, 169, 109, 0.25);
  margin-left: 0.5rem;
  padding: 1rem 0 2rem 1.5rem;
}

/* Node marker indicator on vertical line */
.timeline-node {
  position: absolute;
  left: -9px;
  top: 1.5rem;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background-color: var(--obsidian-bg);
  border: 2px solid var(--rosegold);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10;
}

.timeline-node::after {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background-color: var(--rosegold);
}

.timeline-card {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.7s cubic-bezier(0.2, 0.8, 0.2, 1), transform 0.7s cubic-bezier(0.2, 0.8, 0.2, 1);
  margin-bottom: 3.5rem;
}

.timeline-card.in-view {
  opacity: 1;
  transform: translateY(0);
}

/* Polaroid aesthetic styling */
.polaroid-card {
  background-color: #fbfbfb;
  color: #1a1a1b;
  border-radius: 0.125rem;
  padding: 1rem 1rem 1.5rem 1rem;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
  width: 100%;
  max-width: 320px;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.25), box-shadow 0.3s ease;
}

.polaroid-card:hover {
  transform: rotate(0deg) scale(1.04) translateY(-5px) !important;
  box-shadow: 0 20px 35px rgba(224, 169, 109, 0.2);
  z-index: 15;
}

.polaroid-img-frame {
  width: 100%;
  aspect-ratio: 3 / 4;
  overflow: hidden;
  background-color: #e5e5e5;
  border: 1px solid rgba(0, 0, 0, 0.05);
}

.polaroid-img-frame img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  user-select: none;
}

.polaroid-footer {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  border-top: 1px solid rgba(0, 0, 0, 0.06);
  padding-top: 0.5rem;
}

.polaroid-caption {
  font-family: 'Caveat', cursive, sans-serif;
  font-size: 1.5rem;
  font-weight: 700;
  color: #26262b;
  line-height: 1.1;
  letter-spacing: 0.01em;
}

.polaroid-date {
  font-family: 'Inter', sans-serif;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #8c8c93;
  padding-bottom: 2px;
}

/* ================= PAGE 3: CANVAS MODULE CUSTOM CSS ================= */
.canvas-container {
  position: absolute;
  inset: 0;
  cursor: pointer;
  z-index: 10;
  overflow: hidden;
}

.canvas-hint {
  pointer-events: none;
  user-select: none;
  opacity: 0.55;
  transition: opacity 0.4s ease;
  position: absolute;
  top: 40%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 100%;
  max-width: 300px;
  text-align: center;
}

/* Canvas Floating components */
.floating-element {
  position: absolute;
  pointer-events: none;
  z-index: 20;
  animation: floatUpAnimation 3s cubic-bezier(0.1, 0.8, 0.25, 1) forwards;
  opacity: 0;
  will-change: transform, opacity;
}

@keyframes floatUpAnimation {
  0% {
    transform: translate(-50%, 0) scale(0.65) rotate(var(--rot-start, 0deg));
    opacity: 0;
  }
  12% {
    opacity: 0.95;
    transform: translate(-50%, -12vh) scale(1) rotate(var(--rot-mid, 5deg));
  }
  85% {
    opacity: 0.9;
  }
  100% {
    transform: translate(-50%, -78vh) scale(0.9) rotate(var(--rot-end, 15deg));
    opacity: 0;
  }
}

/* Sticky Action Button Shimmer Keyframes */
@keyframes shimmerBtn {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}
.btn-shimmer {
  background-size: 200% auto;
  animation: shimmerBtn 3s ease infinite;
}

/* Cursive handwritten signature */
.signature {
  font-family: 'Caveat', cursive, sans-serif;
  font-size: 2rem;
  letter-spacing: 0.05em;
}

/* Scroll lock when modal active */
.modal-open {
  overflow: hidden;
}

/* Sticky Timeline Navigation Header */
.sticky-timeline-nav {
  position: sticky;
  top: 55px; /* underneath main header */
  z-index: 35;
  padding: 0.5rem 1rem;
  background-color: rgba(11, 11, 15, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  display: flex;
  justify-content: center;
  gap: 6px;
  overflow-x: auto;
  scrollbar-width: none;
}
.sticky-timeline-nav::-webkit-scrollbar {
  display: none;
}

/* Buttons style defaults */
.btn-pill {
  padding: 0.4rem 0.9rem;
  border-radius: 9999px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.02em;
  background-color: rgba(255, 255, 255, 0.05);
  color: var(--silver);
  border: 1px solid rgba(255, 255, 255, 0.08);
  cursor: pointer;
  transition: all 0.25s ease;
  white-space: nowrap;
}
.btn-pill:hover {
  background-color: rgba(255, 255, 255, 0.1);
  color: var(--cream);
}
.btn-pill.active {
  background-color: rgba(224, 169, 109, 0.12);
  color: var(--rosegold);
  border-color: rgba(224, 169, 109, 0.35);
}

.custom-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.75rem 1.5rem;
  border-radius: 9999px;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  cursor: pointer;
  transition: all 0.2s ease;
  border: none;
  background-color: var(--rosegold);
  color: var(--obsidian-bg);
}
.custom-button:active {
  transform: scale(0.96);
}
