/* style.css */
:root {
  /* Core Colors - Dark Premium */
  --bg-color: #050505;
  --surface-color: rgba(20, 20, 20, 0.6);
  --surface-border: rgba(255, 255, 255, 0.08);

  /* Golden Accents */
  --accent-gold: #F5C365;
  --accent-gold-dim: rgba(245, 195, 101, 0.15);
  --accent-glow: rgba(245, 195, 101, 0.4);

  /* Typography Colors */
  --text-primary: #FFFFFF;
  --text-secondary: #9CA3AF;

  --radius: 24px;
  --transition: all 0.4s cubic-bezier(0.25, 1, 0.5, 1);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: 'Plus Jakarta Sans', sans-serif;
  background-color: var(--bg-color);
  color: var(--text-primary);
  min-height: 100vh;
  overflow-x: hidden;
  line-height: 1.6;
}

/* Texture Noise */
.bg-noise {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  pointer-events: none;
  z-index: 50;
  opacity: 0.03;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noiseFilter'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.65' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)'/%3E%3C/svg%3E");
}

/* Ambient Glow Orbs */
.glow-orb {
  position: fixed;
  border-radius: 50%;
  filter: blur(80px);
  z-index: 0;
  pointer-events: none;
  opacity: 0.3;
}

.orb-1 {
  width: 400px;
  height: 400px;
  background: var(--accent-glow);
  top: -100px;
  right: -100px;
}

.orb-2 {
  width: 300px;
  height: 300px;
  background: rgba(255, 255, 255, 0.05);
  bottom: 20%;
  left: -50px;
}

/* Layout Container */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 2rem;
  position: relative;
  z-index: 10;
}

/* Header */
.header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 3rem;
  padding: 1rem 0;
  border-bottom: 1px solid var(--surface-border);
}

.logo {
  font-size: 1.5rem;
  font-weight: 800;
  letter-spacing: 2px;
  color: var(--accent-gold);
}

.subtitle {
  font-size: 0.9rem;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 1px;
}

/* Bento Grid System */
.bento-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  grid-auto-rows: minmax(160px, auto);
  /* Reduced heavily from 200px to make cards much more compact */
  gap: 1.5rem;
}

/* Premium Card Style */
.bento-card {
  background: var(--surface-color);
  border: 1px solid var(--surface-border);
  border-radius: var(--radius);
  position: relative;
  overflow: hidden;
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  transition: transform 0.3s ease, border-color 0.3s ease, box-shadow 0.4s ease;
  display: flex;
  flex-direction: column;
}

/* Mouse Hover Glow Effect (Controlled by JS) */
.bento-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  border-radius: inherit;
  padding: 2px;
  background: radial-gradient(800px circle at var(--mouse-x) var(--mouse-y),
      var(--accent-glow),
      transparent 40%);
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  opacity: 0;
  transition: opacity 0.5s;
  pointer-events: none;
  z-index: 2;
}

.bento-card:hover::before {
  opacity: 1;
}


.card-content {
  padding: 2.0rem 2.5rem;
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: center;
  position: relative;
  z-index: 3;
}

.centered {
  align-items: center;
  text-align: center;
}

/* Grid Placements */
.hero-card {
  grid-column: span 2;
  grid-row: span 2;
}

.portrait-card {
  grid-column: span 2;
  grid-row: span 2;
  padding: 0;
}

.message-card {
  grid-column: span 2;
  grid-row: span 1;
  transition: all 0.5s cubic-bezier(0.25, 1, 0.5, 1);
}

.decor-card {
  grid-column: span 1;
  grid-row: span 1;
  padding: 0;
}

.mini-card {
  grid-column: span 1;
  grid-row: span 1;
}

/* Typography inside Cards */
.tag {
  display: inline-block;
  padding: 0.4rem 1rem;
  background: var(--accent-gold-dim);
  color: var(--accent-gold);
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 1.5rem;
  align-self: flex-start;
  border: 1px solid rgba(245, 195, 101, 0.2);
}

.title {
  font-size: 4rem;
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: -1px;
  margin: 1.5rem 0 2rem; /* Jarak bawah dinaikkan dari 1rem menjadi 2rem */
  background: linear-gradient(135deg, #FFF, #A0A0A0);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.desc {
  font-size: 1.1rem;
  color: var(--text-secondary);
  font-weight: 300;
  max-width: 90%;
}

/* Image Wrappers */
.image-wrapper {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  border-radius: inherit;
}

.bento-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.7s cubic-bezier(0.25, 1, 0.5, 1);
}

.bento-card:hover .bento-img {
  transform: scale(1.05);
}

.image-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.6) 0%, transparent 40%);
  pointer-events: none;
}

/* Message Card Specifics */
.icon-ring {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  border: 1px solid var(--accent-gold);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent-gold);
  margin-bottom: 1rem;
}

.message-card h3 {
  font-size: 1.5rem;
  margin-bottom: 0.5rem;
  font-weight: 600;
}

.secret-text {
  color: var(--text-secondary);
  font-size: 1.05rem;
  line-height: 1.7;
  max-height: 0;
  opacity: 0;
  filter: blur(10px);
  transform: translateY(10px);
  overflow: hidden;
  transition: all 0.7s cubic-bezier(0.25, 1, 0.5, 1);
}

.secret-text.visible {
  max-height: 500px;
  /* Allows for very long text */
  opacity: 1;
  filter: blur(0px);
  transform: translateY(0);
  margin-bottom: 1.5rem;
}

.premium-btn {
  background: transparent;
  color: var(--text-primary);
  border: 1px solid var(--surface-border);
  padding: 0.8rem 1.5rem;
  border-radius: 8px;
  font-family: inherit;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  align-self: flex-start;
  margin-top: auto;
  transition: var(--transition);
  position: relative;
  overflow: hidden;
}

.premium-btn:hover {
  background: var(--text-primary);
  color: var(--bg-color);
}

/* Mini Card */
.big-number {
  font-size: 5rem;
  font-weight: 800;
  color: var(--accent-gold);
  line-height: 1;
  margin-bottom: 0.5rem;
}

.label {
  font-size: 0.85rem;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 2px;
}

/* Footer */
.footer {
  margin-top: 4rem;
  text-align: center;
  color: var(--text-secondary);
  font-size: 0.9rem;
  padding: 2rem 0;
}

/* Intersection Observer Animations */
.reveal {
  opacity: 0;
  transform: translateY(30px);
  transition: all 0.8s cubic-bezier(0.25, 1, 0.5, 1);
}

.reveal.active {
  opacity: 1;
  transform: translateY(0);
}

/* Responsive Grid Adjustments */
@media (max-width: 1024px) {
  .hero-card {
    grid-column: span 4;
  }

  .portrait-card {
    grid-column: span 4;
  }

  .message-card {
    grid-column: span 2;
    grid-row: span 2;
  }

  .decor-card {
    grid-column: span 2;
  }

  .mini-card {
    grid-column: span 2;
  }
}

@media (max-width: 640px) {
  .bento-grid {
    display: flex;
    flex-direction: column;
  }

  .bento-card {
    min-height: 300px;
  }
  
  .mini-card, .decor-card {
    min-height: 150px; /* Mencegah gap bawah yang terlalu besar pada layar HP */
  }

  .title {
    font-size: 2.5rem;
  }

  .card-content {
    padding: 1.5rem;
  }
}

/* Dynamic Festive Particles */
#particles-container {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  pointer-events: none;
  z-index: 1;
  overflow: hidden;
}

.dynamic-particle {
  position: absolute;
  background-color: var(--accent-gold);
  border-radius: 50%;
  box-shadow: 0 0 10px 2px var(--accent-glow);
  opacity: 0;
  animation: floatUp ease-in-out infinite, pulseTwinkle ease-in-out infinite;
}

/* For emoji particles (like ✨ or 💛) */
.dynamic-emoji {
  position: absolute;
  opacity: 0;
  animation: floatUp ease-in infinite, pulseTwinkle ease-in-out infinite;
  filter: drop-shadow(0 0 5px var(--accent-glow));
}

@keyframes floatUp {
  0% {
    transform: translateY(100vh) scale(0.5);
  }

  100% {
    transform: translateY(-10vh) scale(1.2);
  }
}

@keyframes pulseTwinkle {

  0%,
  100% {
    opacity: 0;
  }

  50% {
    opacity: 0.8;
  }
}

.photo-badge {
  position: absolute;
  bottom: 20px;
  right: 20px;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(10px);
  padding: 0.5rem 1rem;
  border-radius: 20px;
  border: 1px solid var(--accent-gold-dim);
  color: var(--accent-gold);
  font-size: 0.8rem;
  font-weight: 600;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
  animation: subtleFloat 3s ease-in-out infinite;
}

.pulse-animation {
  animation: pulse-ring 2s infinite;
}

@keyframes pulse-ring {
  0% {
    box-shadow: 0 0 0 0 rgba(245, 195, 101, 0.4);
  }

  70% {
    box-shadow: 0 0 0 15px rgba(245, 195, 101, 0);
  }

  100% {
    box-shadow: 0 0 0 0 rgba(245, 195, 101, 0);
  }
}

.float-animation {
  animation: subtleFloat 4s ease-in-out infinite;
  display: inline-block;
}

@keyframes subtleFloat {

  0%,
  100% {
    transform: translateY(0);
  }

  50% {
    transform: translateY(-10px);
  }
}

/* Memories Section */
.memories-section {
  margin-top: 5rem;
  padding-top: 3rem;
  border-top: 1px solid var(--surface-border);
}

.section-header {
  text-align: center;
  margin-bottom: 3rem;
}

.memories-title {
  font-size: 2.5rem;
  font-weight: 800;
  color: var(--text-primary);
  letter-spacing: -1px;
  margin-bottom: 1rem;
}

.line-divider {
  width: 60px;
  height: 3px;
  background: var(--accent-gold);
  margin: 0 auto;
  border-radius: 2px;
  box-shadow: 0 0 10px var(--accent-glow);
}

.memories-marquee {
  width: 100%;
  overflow: hidden;
  position: relative;
  padding: 1rem 0;
  mask-image: linear-gradient(to right, transparent, black 5%, black 95%, transparent);
  -webkit-mask-image: linear-gradient(to right, transparent, black 5%, black 95%, transparent);
}

.memories-track {
  display: flex;
  gap: 2rem;
  width: max-content;
  animation: scrollMarquee 25s linear infinite;
}

.memories-track:hover {
  animation-play-state: paused;
  /* Pause scrolling when hovered so user can read */
}

@keyframes scrollMarquee {
  0% {
    transform: translateX(0);
  }

  /* Translate exactly 50% of the total track width (the original set) minus half the gap */
  100% {
    transform: translateX(calc(-50% - 1rem));
  }
}

.memory-card {
  position: relative;
  border-radius: var(--radius);
  overflow: hidden;
  height: 288px;
  /* Naik 15% dari 250px */
  width: 230px;
  /* Naik 15% dari 200px */
  flex-shrink: 0;
  border: 1px solid var(--surface-border);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
  cursor: pointer;
}

.memory-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.6s cubic-bezier(0.25, 1, 0.5, 1), filter 0.6s ease;
}

.memory-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.9) 0%, rgba(20, 20, 20, 0.3) 70%, transparent 100%);
  display: flex;
  align-items: flex-end;
  padding: 1.2rem;
  /* Disesuaikan dengan ukuran baru */
  opacity: 0;
  transition: opacity 0.4s ease;
}

.memory-text {
  color: #fff;
  font-size: 0.85rem;
  /* Sedikit dibesarkan */
  line-height: 1.4;
  font-weight: 300;
  transform: translateY(20px);
  transition: transform 0.5s cubic-bezier(0.25, 1, 0.5, 1);
  border-left: 2px solid var(--accent-gold);
  padding-left: 0.6rem;
}

/* Hover-to-Reveal Animation */
.memory-card:hover .memory-img {
  transform: scale(1.08);
  filter: blur(4px) brightness(0.7);
}

.memory-card:hover .memory-overlay {
  opacity: 1;
}

/* Welcome Screen Overlay */
body.locked {
  overflow: hidden;
  height: 100vh;
}

#welcome-screen {
  position: fixed;
  inset: 0;
  background-color: var(--bg-color);
  /* Matches deep dark theme */
  background-image: radial-gradient(circle at center, rgba(245, 195, 101, 0.05) 0%, transparent 60%);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 1.2s cubic-bezier(0.25, 1, 0.5, 1), visibility 1.2s;
}

#welcome-screen.hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: scale(1.1);
  /* Zoom-in dive effect */
}

.welcome-content {
  text-align: center;
  max-width: 600px;
  padding: 2rem;
}

.welcome-text {
  font-size: 1.2rem;
  color: var(--text-secondary);
  margin-bottom: 0.5rem;
  font-weight: 300;
  letter-spacing: 2px;
  text-transform: uppercase;
}

.welcome-name {
  font-size: 3.5rem;
  font-weight: 800;
  color: var(--text-primary);
  margin-bottom: 2rem;
  background: linear-gradient(135deg, #FFFFFF, var(--accent-gold));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  line-height: 1.2;
}

.welcome-ready {
  font-size: 1.8rem;
  color: var(--accent-gold);
  margin-bottom: 2.5rem;
  font-weight: 600;
  font-style: italic;
  text-shadow: 0 0 10px var(--accent-glow);
}

.action-container {
  min-height: 60px;
  /* Reserves space so button doesn't jump */
  display: flex;
  justify-content: center;
  align-items: center;
}

.loading-text {
  font-size: 1.1rem;
  color: var(--text-secondary);
  font-style: italic;
  animation: pulseOpacity 1.5s infinite ease-in-out;
}

@keyframes pulseOpacity {

  0%,
  100% {
    opacity: 0.5;
  }

  50% {
    opacity: 1;
  }
}

.welcome-btn {
  background: rgba(245, 195, 101, 0.1);
  color: var(--text-primary);
  border: 1px solid var(--accent-gold);
  padding: 1rem 3.5rem;
  border-radius: 50px;
  font-family: inherit;
  font-size: 1.2rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.4s ease, opacity 0.5s ease;
  box-shadow: 0 0 15px var(--accent-glow);
  backdrop-filter: blur(5px);
}

.welcome-btn.hidden {
  display: none !important;
}

.welcome-btn:hover {
  background: var(--accent-gold);
  color: var(--bg-color);
  box-shadow: 0 0 25px rgba(245, 195, 101, 0.6);
  transform: scale(1.05);
}

/* Staggered Entry Animations for Welcome Screen */
.line-1,
.line-2,
.line-3,
.line-4 {
  opacity: 0;
  transform: translateY(20px);
  animation: fadeUpIn 1s forwards cubic-bezier(0.25, 1, 0.5, 1);
}

.line-1 {
  animation-delay: 0.5s;
}

.line-2 {
  animation-delay: 1.5s;
}

.line-3 {
  animation-delay: 3.5s;
}

.line-4 {
  animation-delay: 5.0s;
}

/* Button appears last */

@keyframes fadeUpIn {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}