/* =========================================
   APPLE STYLE HOMEPAGE (Final Optimized)
   ========================================= */

.apple-hero {
  position: relative;
  min-height: 92vh;
  background: #000;
  overflow: hidden;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
}

/* background gradient */
.hero-bg {
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 50% 20%, #222 0%, #000 70%);
  z-index: 1;
}

/* blur layer */
.hero-blur {
  position: absolute;
  inset: 0;
  backdrop-filter: blur(50px);
  background: rgba(0,0,0,.4);
  z-index: 2;
}

/* content */
.hero-content {
  position: relative;
  z-index: 3;
  max-width: 900px;
  padding: 20px;
  will-change: transform, opacity;
}

.hero-content h1 {
  font-size: clamp(32px, 5vw, 56px);
  font-weight: 700;
  letter-spacing: -1px;
  margin-bottom: 12px;
}

.hero-content p {
  font-size: clamp(18px, 2.5vw, 22px);
  opacity: .85;
  margin-bottom: 28px;
}

/* buttons */
.hero-actions {
  display: flex;
  gap: 12px;
  justify-content: center;
  flex-wrap: wrap;
}

.hero-btn {
  padding: 12px 26px;
  border-radius: 999px;
  font-size: 16px;
  text-decoration: none;
  transition: all .25s ease;
}

.hero-btn.primary {
  background: #0071e3;
  color: #fff;
}

.hero-btn.primary:hover {
  background: #005bb5;
}

.hero-btn.outline {
  border: 1px solid rgba(255,255,255,0.4);
  color: #fff;
  background: transparent;
}

.hero-btn.outline:hover {
  border-color: #fff;
  background: rgba(255,255,255,0.1);
}

.hero-btn:hover {
  transform: translateY(-2px);
}

.hero-btn:focus-visible {
  outline: 2px solid #fff;
  outline-offset: 3px;
}

/* cards section */
.apple-sections {
  background: #fff;
  color: #000;
  padding: 80px 20px;
  text-align: center;
  transition: background-color 0.4s ease, color 0.4s ease;
}

body.dark-mode .apple-sections {
  background: #000;
  color: #fff;
}

.apple-grid {
  max-width: 1200px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 24px;
}

.apple-card {
  background: #f5f5f7;
  border-radius: 20px;
  padding: 32px 24px;
  text-decoration: none;
  color: inherit;
  transition: transform .25s ease, box-shadow .25s ease, background-color .25s ease;
}

.apple-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 20px 40px rgba(0,0,0,0.15);
}

body.dark-mode .apple-card {
  background: #111;
  box-shadow: 0 12px 24px rgba(255,255,255,0.05);
}

.apple-card h2 {
  font-size: 24px;
  margin-bottom: 8px;
}

.apple-card p {
  font-size: 16px;
  opacity: .8;
}

/* responsive adjustments */
@media (max-width: 576px) {
  .apple-sections {
    padding: 40px 12px;
  }
  .apple-card {
    padding: 24px 16px;
  }
}

/* PROMO BANNER dengan animasi turun dari header */
.apple-promo {
  position: absolute; /* overlay, tidak dorong layout */
  top: 0;
  left: 0;
  width: 100%;
  background: linear-gradient(90deg, #00c853, #43a047); /* hijau awal */
  backdrop-filter: blur(6px);
  color: #fff;
  text-align: center;
  padding: 10px;
  font-size: 15px;
  font-weight: 500;
  opacity: 0;
  transform: translateY(-100%);
  animation: fadeInSmooth 2s ease forwards, promoGradientFade 8s ease-in-out forwards;
  z-index: 1000;
}

.apple-promo .promo-content {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  flex-wrap: wrap; /* biarkan teks dan tombol bisa turun baris */
  justify-content: center;
  align-items: center;
  gap: 12px;
  padding: 0 16px; /* ruang kiri-kanan agar tidak mepet */
  text-align: center;
}

/* Setelah animasi selesai, ikut scroll */
.apple-promo.scrolled {
  position: relative;
  transform: none;
  opacity: 1;
}

/* Animasi gradient dengan fade halus */
@keyframes promoGradientFade {
  0% {
    background: linear-gradient(90deg, #00c853, #43a047); /* hijau */
  }
  50% {
    background: linear-gradient(90deg, #4caf50, #2196f3); /* transisi hijau → biru */
  }
  100% {
    background: linear-gradient(90deg, #0071e3, #005bb5); /* biru Apple */
  }
}

.apple-promo.fadeout {
  animation: fadeOut 1.5s ease forwards;
}

.apple-promo .promo-text {
  margin: 0;
  white-space: normal; /* biarkan teks bisa wrap */
}

.apple-promo .promo-link {
  background: #fff;
  color: #0071e3;
  padding: 0.1em 1.5em;
  border-radius: 599px;
  font-weight: 550;
  font-size: 0.9em;
  text-decoration: none;
  transition: all 0.3s ease;
  flex-shrink: 0;
}

/* Hover: berubah jadi orange */
.apple-promo .promo-link:hover {
  background: #ff9000;
  color: #ffffff; /* teks putih agar kontras */
}

/* Klik (active): tetap #00f6ff */
.apple-promo .promo-link:active {
  background: #00f6ff;
  color: #000;
}

/* Animasi fade-in halus */
@keyframes fadeInSmooth {
  0% { opacity: 0; }
  100% { opacity: 1; }
}

@keyframes fadeOut {
  0% { opacity: 1; }
  100% { opacity: 0; visibility: hidden; }
}

/* Responsive */
@media (max-width: 768px) {
  .apple-promo .promo-content {
    flex-direction: column; /* teks di atas, tombol di bawah */
    gap: 8px;
    padding: 0 12px;
  }
  .apple-promo .promo-text {
    font-size: 0.91em;
  }
  .apple-promo .promo-link {
    font-size: 0.85em;
    padding: 0.2em 1em;
  }
}

/* VIDEO HERO ala Apple Music */
.apple-hero {
  position: relative;
  width: 100%;
  height: 100vh;
  overflow: hidden;
}

.apple-hero .hero-video {
  position: absolute;
  top: 0; left: 0;
  width: 100%; height: 100%;
  z-index: 0;
}

.apple-hero .hero-video video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.apple-hero .hero-overlay {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  height: 100%;
  text-align: center;
  color: #fff;
  padding: 0 20px; /* beri ruang kiri-kanan agar tidak terpotong */
}

.hero-title {
  font-size: 3rem;
  font-weight: 700;
  margin-bottom: 1rem;
  word-wrap: break-word; /* jaga agar teks tidak keluar layar */
  opacity: 0;
  transform: translateY(20px) scale(0.95);
  animation: fadeScaleUp 1.5s cubic-bezier(0.25, 0.8, 0.25, 1) forwards;
}

.hero-subtitle {
  font-size: 1.5rem;
  font-weight: 400;
  word-wrap: break-word;  /* jaga agar teks tidak keluar layar */
  opacity: 0;
  transform: translateY(20px) scale(0.95);
  animation: fadeScaleUp 1.5s cubic-bezier(0.25, 0.8, 0.25, 1) forwards;
  animation-delay: 0.5s; /* muncul sedikit setelah title */
}

/* Animasi fade + scale ala Apple Music */
@keyframes fadeScaleUp {
  0% {
    opacity: 0;
    transform: translateY(20px) scale(0.95);
  }
  100% {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

/* Responsive */
@media (max-width: 768px) {
  .hero-title {
    font-size: 1.7rem;
  }
  .hero-subtitle {
    font-size: 1.1rem;
  }
}