/* =========================================================================
   LARISIN AJA — Custom styles (Responsive Motion & Mobile-Safe CSS)
   Sesuai motion smooth.md & perbaikan layout mobile:
   - box-sizing: border-box & full responsiveness
   - overflow-wrap & word-break untuk mencegah teks terpotong di tepi kanan
   - hero section padding-top 90px agar tidak ketutup navbar sticky/fixed
   - lite-motion & forced dark mode protection
   ========================================================================= */

:root {
  color-scheme: light only;
  --header-height: 4rem;
}

*, *::before, *::after {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-height) + 1.5rem);
  -webkit-text-size-adjust: 100%;
  width: 100%;
  max-width: 100%;
  overflow-x: hidden;
}

body {
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  width: 100%;
  max-width: 100%;
  overflow-x: hidden;
  background-color: #FDFBF7;
  margin: 0;
  padding: 0;
}

/* Cegah teks meluap / keluar dari tepi kanan layar */
p, h1, h2, h3, h4, h5, h6, span, li, a, label, button, div {
  overflow-wrap: break-word;
  word-break: break-word;
}

img, svg, video {
  max-width: 100%;
  height: auto;
}

/* Offset hero agar tidak ketutup navbar fixed/sticky */
.hero-section {
  padding-top: 90px !important;
}

@media (min-width: 640px) {
  .hero-section {
    padding-top: 70px !important;
  }
}

/* Reduced motion & machine-level lite fallback */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

html[data-motion="lite"] * {
  animation-duration: 0.01ms !important;
  animation-iteration-count: 1 !important;
  transition-duration: 0.01ms !important;
  scroll-behavior: auto !important;
}

html[data-motion="lite"] header {
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
  background-color: #FDFBF7 !important;
}

/* Hero gradient */
.hero-gradient {
  background:
    radial-gradient(55% 55% at 78% 12%, #FFE4CF 0%, rgba(255,228,207,0) 62%),
    radial-gradient(45% 45% at 6% 92%, #FFF1E3 0%, rgba(255,241,227,0) 60%),
    #FDFBF7;
}

/* Carousel — GPU acceleration & touch gesture handling */
.carousel-track {
  display: flex;
  transition: transform .45s cubic-bezier(.22, 1, .36, 1);
  will-change: transform;
  transform: translate3d(0, 0, 0);
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  width: 100%;
  max-width: 100%;
}

.carousel-viewport {
  touch-action: pan-y;
  -webkit-overflow-scrolling: touch;
  width: 100%;
  max-width: 100%;
}

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

/* Entrances with GPU-friendly transforms */
@keyframes fadeUp {
  from { opacity: 0; transform: translate3d(0, 14px, 0); }
  to   { opacity: 1; transform: translate3d(0, 0, 0); }
}
.animate-fadeUp {
  animation: fadeUp .45s cubic-bezier(.22, 1, .36, 1) both;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}
.animate-fadeIn {
  animation: fadeIn .25s ease both;
}

@keyframes scaleIn {
  from { opacity: 0; transform: scale(.96) translate3d(0, 10px, 0); }
  to   { opacity: 1; transform: scale(1) translate3d(0, 0, 0); }
}
.modal-panel {
  animation: scaleIn .3s cubic-bezier(.22, 1, .36, 1) both;
}

@keyframes bounceDot {
  0%, 80%, 100% { transform: translate3d(0, 0, 0); opacity: .35; }
  40% { transform: translate3d(0, -4px, 0); opacity: 1; }
}
.typing-dot { animation: bounceDot 1.2s infinite; }
.typing-dot:nth-child(2) { animation-delay: .15s; }
.typing-dot:nth-child(3) { animation-delay: .3s; }

@keyframes spin { to { transform: rotate(360deg); } }
.spin { animation: spin .8s linear infinite; }

/* Toast notification */
.toast-container {
  position: fixed;
  bottom: 1.25rem;
  left: 50%;
  transform: translate3d(-50%, 0, 0);
  z-index: 200;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: .5rem;
  width: min(26rem, calc(100vw - 2rem));
  pointer-events: none;
}

.toast {
  display: flex;
  align-items: center;
  gap: .625rem;
  width: 100%;
  padding: .875rem 1rem;
  border-radius: 1rem;
  background: #1F1209;
  color: #fff;
  font-size: .875rem;
  font-weight: 600;
  line-height: 1.4;
  box-shadow: 0 14px 34px -14px rgba(31,18,9,.45);
  pointer-events: auto;
  animation: toastIn .3s cubic-bezier(.22, 1, .36, 1) both;
}

.toast-success { background: #0F7B46; }
.toast-error { background: #C0273A; }

.toast-icon { display: inline-flex; flex-shrink: 0; }
.toast-icon svg { width: 1.25rem; height: 1.25rem; color: #fff; }

.toast--closing { animation: toastOut .3s ease forwards; }

@keyframes toastIn {
  from { opacity: 0; transform: translate3d(0, 14px, 0) scale(.98); }
  to   { opacity: 1; transform: translate3d(0, 0, 0) scale(1); }
}

@keyframes toastOut {
  to { opacity: 0; transform: translate3d(0, 14px, 0) scale(.98); }
}
