/* ===========================================
   ROBIN — OUR STORY (Immersive Redesign V3)
   style.css
   =========================================== */

/* -------------------------------------------
   CSS CUSTOM PROPERTIES
------------------------------------------- */
:root {
  /* Warm & Stunning Palette */
  --color-bg:           #faf9f6;        /* Warm off-white (paper) */
  --color-text:         #303030;        /* Deep charcoal (Apple-like) */
  --color-text-muted:   #86868b;        /* Apple grey */
  
  /* Romantic Accents */
  --color-accent:       #FF3131;        /* Neon Red */
  --color-accent-soft:  #ff8fa3;        /* Soft Blush */
  --color-gold:         #c9a227;        /* Subtle Gold */

  /* Typography */
  --font-serif:    'Great Vibes', cursive; /* More romantic */
  --font-sans:     'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;

  /* Spacing */
  --section-width: 100vw;
  --image-scale:   1.1;

  /* Transitions */
  --ease-apple:    cubic-bezier(0.25, 1, 0.5, 1);
  --duration-long: 1.6s;
}

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

html {
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
}

body {
  background-color: transparent; /* Main bg is now on .background-fx to ensure correct stacking */
  color: var(--color-text);
  font-family: var(--font-sans);
  line-height: 1.5;
  overflow: hidden; /* Hide vertical scrollbar */
  width: 100vw;
  height: 100vh;
}

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

/* -------------------------------------------
   FLOATING HEART CARD
------------------------------------------- */
.floating-heart-card {
  position: fixed;
  top: 2rem;
  right: 2rem;
  z-index: 100;
  background: rgba(255, 255, 255, 0.6);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  padding: 0.8rem 1.5rem;
  border-radius: 50px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.4);
  transition: transform 0.3s ease;
}

.floating-heart-card:hover {
  transform: scale(1.05);
}

.fhc-content {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  font-family: var(--font-sans);
  font-weight: 600;
  color: var(--color-text);
  font-size: 0.9rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.fhc-heart-anim {
  width: 24px;
  height: 24px;
  color: var(--color-accent);
  filter: blur(0.5px); /* Slightly blurred as requested */
  animation: heartbeat 1.5s infinite ease-in-out;
  display: flex;
  align-items: center;
  justify-content: center;
}

.fhc-heart-anim svg {
  width: 100%;
  height: 100%;
}

.fhc-divider {
  width: 1px;
  height: 16px;
  background-color: rgba(0,0,0,0.1);
}

.fhc-years {
  color: var(--color-text-muted);
}

@keyframes heartbeat {
  0% { transform: scale(1); filter: blur(0.5px); }
  15% { transform: scale(1.3); filter: blur(2px); } /* Blur increases on beat */
  30% { transform: scale(1); filter: blur(0.5px); }
  45% { transform: scale(1.15); filter: blur(1px); }
  60% { transform: scale(1); filter: blur(0.5px); }
  100% { transform: scale(1); filter: blur(0.5px); }
}

/* -------------------------------------------
   BACKGROUND FX (Liquid Glass Canvas)
------------------------------------------- */
.background-fx {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  z-index: -1;
  pointer-events: none;
  background-color: var(--color-bg); /* Paper color */
  overflow: hidden;
}

.background-fx::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  /* Placeholder for background image - user to replace URL */
  background-image: url('assets/images/background.png'); 
  background-size: cover;
  background-position: center;
  filter: blur(15px);
  transform: scale(1.1);
  z-index: -1;
}

#hero-canvas {
  width: 100%;
  height: 100%;
  display: block; /* Removes any inline spacing */
}

/* Remove old SVG styles */

/* Remove old .line styles */

@keyframes drift {
  0% { transform: rotate(0deg) scale(1); }
  100% { transform: rotate(10deg) scale(1.05); }
}

/* -------------------------------------------
   HORIZONTAL SCROLL CONTAINER
------------------------------------------- */
.scroll-container {
  position: relative;
  z-index: 1; /* Place in front of background-fx */
  display: flex;
  flex-wrap: nowrap;
  overflow-x: auto;
  overflow-y: hidden;
  width: 100vw;
  height: 100vh;
  scroll-behavior: smooth;
  /* REMOVED scroll-snap to make it feel continuous/Apple-like */
  /* scroll-snap-type: x mandatory; */
  -webkit-overflow-scrolling: touch;
}

.scroll-container::-webkit-scrollbar {
  display: none;
}
.scroll-container {
  -ms-overflow-style: none;
  scrollbar-width: none;
}

/* -------------------------------------------
   SECTIONS
------------------------------------------- */
.section {
  position: relative;
  flex: 0 0 100vw; /* Full width sections */
  width: 100vw;
  height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 5vw;
  /* scroll-snap-align: center; */ /* Optional: subtle snap */
}

/* -------------------------------------------
   TYPOGRAPHY (Apple Style)
------------------------------------------- */
h1, h2, h3 {
  font-family: var(--font-serif);
  font-weight: 600;
  line-height: 1.1;
  color: var(--color-text);
  letter-spacing: -0.02em;
}

h1 { 
  font-size: clamp(5rem, 12vw, 11rem); 
  font-weight: 400; 
  padding-top: 0.3em; /* Fix cut-off top */
  line-height: 1.3;
}
h2 { font-size: clamp(3rem, 7vw, 6rem); font-weight: 400; }

p {
  font-size: 1.2rem;
  font-weight: 400;
  color: var(--color-text-muted);
  max-width: 48ch;
  line-height: 1.6;
}

/* -------------------------------------------
   HERO
------------------------------------------- */
.section--hero {
  flex-direction: column;
  text-align: center;
  justify-content: center;
}

.hero__content {
  position: relative;
  z-index: 2;
  /* Blur transparent card */
  background: rgba(255, 255, 255, 0.2);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  padding: 3rem;
  border-radius: 32px;
  border: 1px solid rgba(255, 255, 255, 0.3);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.05);
  max-width: 800px;
  margin: 0 auto;
}

.hero__eyebrow {
  font-family: var(--font-sans);
  font-size: 0.9rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--color-accent);
  margin-bottom: 2rem;
  /* Removed animation to let scrollReveal handle it cleanly */
}

.hero__title {
  margin-bottom: 1.5rem;
  background: linear-gradient(135deg, #1d1d1f 0%, #434344 100%); /* Subtle gradient text */
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  /* Removed animation to let scrollReveal handle it cleanly */
}

.hero__subtitle {
  font-size: 1.8rem;
  color: var(--color-text-muted);
  margin: 0 auto 4rem;
  /* Removed animation to let scrollReveal handle it cleanly */
}

.btn-continue {
  background: linear-gradient(135deg, #ff3131, #ff9a9e); /* Red/Pink Gradient */
  background-size: 200% 200%;
  color: white;
  border: none;
  padding: 1.2rem 3rem;
  font-size: 1.1rem;
  font-weight: 500;
  border-radius: 50px;
  cursor: pointer;
  transition: transform 0.4s var(--ease-apple), box-shadow 0.4s var(--ease-apple), background-position 0.4s ease;
  /* Removed animation to let scrollReveal handle it cleanly */
}

.btn-continue:hover {
  transform: scale(1.04);
  box-shadow: 0 10px 30px rgba(255, 49, 49, 0.4);
  background-position: 100% 0; /* Animate Gradient */
  filter: brightness(1.1); /* Brighter on hover */
}

/* -------------------------------------------
   CHAPTER SECTIONS (Immersive Layout)
------------------------------------------- */
.chapter__inner {
  display: flex; /* Changed from grid to flex for cleaner alignment */
  flex-direction: row; /* Default: row */
  gap: 4vw; /* Reduced gap to fit card padding */
  width: 100%;
  max-width: 90vw;
  align-items: center;
  justify-content: space-between;
  
  /* Immersive Card Style */
  background: rgba(255, 255, 255, 0.2); /* Reduced opacity for darker/clearer text */
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  padding: 3rem;
  border-radius: 48px; /* More rounded corners (was 32px) */
  border: 1px solid rgba(255, 255, 255, 0.15);
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
}

.layout--image-left { flex-direction: row; }
.layout--image-right { flex-direction: row-reverse; }

/* Image */
.chapter__image-wrap {
  flex: 1 1 50%; /* Balanced with text (was 55%) */
  position: relative;
  overflow: hidden;
  border-radius: 40px; /* More rounded (was 24px) */
  aspect-ratio: 4 / 3;
  background-color: transparent;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.15); /* Soft drop shadow */
  transition: transform 0.8s ease-out; /* For parallax feel */
}

.chapter__img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform: scale(var(--image-scale)); /* Zoomed in slightly initially */
  transition: transform 2s ease-out;
}

/* Text */
.chapter__text {
  flex: 1 1 50%; /* Increased width (was 40%) */
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  padding: 1rem 0; /* Reduced padding to utilize width */
}

.chapter__number {
  font-size: 0.85rem;
  letter-spacing: 0.15em;
  font-weight: 600;
  text-transform: uppercase;
  color: var(--color-accent);
  margin-bottom: 1.5rem;
}

.chapter__title {
  margin-bottom: 2rem;
  font-weight: 700;
}

.chapter__body {
  margin-bottom: 3rem;
  color: var(--color-text);
  max-width: 100%; /* Override max-width */
}

.btn-continue-small {
  background: linear-gradient(135deg, #ff3131, #ff9a9e);
  background-size: 200% 200%;
  color: white; /* White text always */
  border: none; /* No border for gradient buttons */
  padding: 0.8rem 2rem;
  font-size: 0.95rem;
  border-radius: 50px;
  cursor: pointer;
  transition: all 0.4s ease;
  font-size: 1.2rem;
}

.btn-continue-small:hover {
  background-position: 100% 0;
  transform: scale(1.05);
  box-shadow: 0 5px 15px rgba(255, 49, 49, 0.3);
  filter: brightness(1.1);
}

/* Trip Variant */
/* .section--trip .chapter__inner {
  background: transparent;
  border: none;
} REMOVED to keep card consistency */
.section--trip .chapter__image-wrap {
  aspect-ratio: 16 / 9; /* Wider trip photos */
  flex: 1 1 65%;
}

/* -------------------------------------------
   SCROLL REVEAL ANIMATIONS (Blur Fade)
------------------------------------------- */
.reveal {
  opacity: 0;
  filter: blur(10px);
  transition: opacity 1.2s var(--ease-apple), filter 1.2s var(--ease-apple), transform 1.2s var(--ease-apple);
  will-change: opacity, filter, transform;
}

.reveal.is-visible {
  opacity: 1;
  filter: blur(0);
  transform: translate(0, 0);
}

.reveal--left { transform: translateX(-30px); }
.reveal--right { transform: translateX(30px); }
.reveal--up { transform: translateY(40px); }

.reveal--left.is-visible,
.reveal--right.is-visible,
.reveal--up.is-visible {
  transform: translate(0, 0);
}

/* -------------------------------------------
   SUMMARY SECTION
------------------------------------------- */
.section--summary {
  justify-content: flex-start;
  padding-left: 10vw;
  gap: 10vw; /* Lots of space */
}

.section--summary .summary__block {
  flex: 0 0 50vw;
  min-width: unset;
  /* Subtle styling for summary blocks */
  background: white;
  padding: 4rem;
  border-radius: 32px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.06);
}

.stats__grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4rem;
}

.stat-card {
  background: transparent;
  border: none;
  padding: 0;
  text-align: left;
  align-items: flex-start;
}

.stat-card__number {
  font-size: 5rem;
  font-weight: 700;
  color: var(--color-accent);
  line-height: 1;
  margin-bottom: 0.5rem;
}

.stat-card__label {
  font-size: 1rem;
  letter-spacing: 0.05em;
  color: var(--color-text-muted);
}

/* -------------------------------------------
   NAV DOTS
------------------------------------------- */
.chapter-nav {
  position: fixed;
  bottom: 2rem;
  left: 50%;
  transform: translateX(-50%);
  z-index: 100;
  /* Make container flexible to center children */
  display: flex;
  justify-content: center;
  align-items: center;
  
  background: rgba(255, 255, 255, 0.8);
  padding: 0.8rem 1.5rem;
  border-radius: 50px;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow: 0 4px 20px rgba(0,0,0,0.08);
}

.chapter-nav__list {
  display: flex;
  flex-direction: row; /* FORCE horizontal */
  gap: 1rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.chapter-nav__dot {
  width: 10px;
  height: 10px;
  background-color: #d1d1d6; /* Apple inactive grey */
  border-radius: 50%;
  border: none;
  cursor: pointer;
  padding: 0;
  transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.chapter-nav__dot:hover {
  background-color: var(--color-accent);
  transform: scale(1.2);
}

.chapter-nav__dot.is-active {
  background-color: var(--color-accent);
  transform: scale(1.2);
  width: 24px; /* Pill shape for active */
  border-radius: 4px;
}

/* FIXED NAV ARROWS (Centered on edges) */
.nav-arrow-fixed {
  position: fixed;
  top: 50%;
  transform: translateY(-50%);
  z-index: 100;
  background: rgba(255, 255, 255, 0.5); /* Semi-transparent */
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.4);
  color: var(--color-text-muted);
  font-size: 1.5rem;
  width: 50px;
  height: 50px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
}

.nav-arrow-fixed--prev { left: 2rem; }
.nav-arrow-fixed--next { right: 2rem; }

.nav-arrow-fixed:hover {
  background: white;
  color: var(--color-accent);
  transform: translateY(-50%) scale(1.1);
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
}

/* Old Nav Arrow (removed) */
/* .nav-arrow { ... } */

/* -------------------------------------------
   AUDIO SYNC TEXT
------------------------------------------- */
.synced-text span {
  opacity: 0; /* Invisible initially */
  transition: opacity 0.5s ease;
  display: inline; /* Keep flow */
}

.synced-text span.active {
  opacity: 1;
}

.hidden-btn {
  display: none;
}

/* -------------------------------------------
   ANIMATIONS
------------------------------------------- */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(40px); filter: blur(10px); }
  to { opacity: 1; transform: translateY(0); filter: blur(0); }
}

/* -------------------------------------------
   CONCLUSION (EPIC ENDING)
------------------------------------------- */
.layout--centered {
  flex-direction: column;
  justify-content: center;
  text-align: center;
  max-width: 60vw; /* Focus the content */
  margin: 0 auto;
}

.conclusion__content {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3rem;
  width: 100%;
}

.conclusion__heart {
  width: 120px;
  height: 120px;
  color: var(--color-accent);
  animation: heartbeat-epic 1.5s infinite ease-in-out;
}

.conclusion__heart svg {
  width: 100%;
  height: 100%;
  filter: drop-shadow(0 0 20px rgba(255, 49, 49, 0.4));
}

.conclusion__text {
  font-family: var(--font-serif);
  font-size: clamp(4rem, 10vw, 8rem);
  color: var(--color-text);
  margin: 0;
  line-height: 1.1;
  background: linear-gradient(135deg, #ff3131, #ff9a9e);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  filter: drop-shadow(0 4px 20px rgba(255, 49, 49, 0.2));
}

@keyframes heartbeat-epic {
  0% { transform: scale(1); }
  15% { transform: scale(1.3); }
  30% { transform: scale(1); }
  45% { transform: scale(1.15); }
  60% { transform: scale(1); }
  100% { transform: scale(1); }
}
