/* ==========================================================================
   NACA.ID — Motion Layer
   ADDITIVE. Tidak mengubah layout, ukuran, warna, atau tipografi.
   Semua gerak hormati prefers-reduced-motion.
   Palet tetap earthy: #fbf9f6 / #75593b / #151616.
   ========================================================================== */

/* ---------- Token gerak ---------- */
:root {
  --nc-ease: cubic-bezier(.22, 1, .36, 1);
  --nc-ease-inout: cubic-bezier(.4, 0, .2, 1);
  --nc-fast: .18s;
  --nc-base: .34s;
  --nc-slow: .6s;
}

/* ==========================================================================
   1. ENTRANCE — konten muncul saat halaman dibuka
   Hanya elemen yang benar-benar ditandai .nc-reveal yang dianimasikan,
   supaya kalau JS gagal konten tetap terlihat apa adanya.
   ========================================================================== */

@keyframes ncFadeUp {
  from { opacity: 0; transform: translateY(18px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes ncFadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes ncScaleIn {
  from { opacity: 0; transform: scale(.955); }
  to   { opacity: 1; transform: scale(1); }
}

.nc-reveal      { animation: ncFadeUp var(--nc-slow) var(--nc-ease) both; }
.nc-reveal-soft { animation: ncFadeIn var(--nc-base) var(--nc-ease) both; }
.nc-reveal-zoom { animation: ncScaleIn var(--nc-base) var(--nc-ease) both; }

/* Delay bertingkat untuk kartu sebaris */
.nc-d1 { animation-delay: .06s; }
.nc-d2 { animation-delay: .12s; }
.nc-d3 { animation-delay: .18s; }
.nc-d4 { animation-delay: .24s; }
.nc-d5 { animation-delay: .30s; }
.nc-d6 { animation-delay: .36s; }

/* ==========================================================================
   2. HER0 — judul masuk bertahap, kata per kata terasa naik
   ========================================================================== */

@keyframes ncHeroLine {
  from { opacity: 0; transform: translateY(26px); }
  to   { opacity: 1; transform: translateY(0); }
}
.nc-hero > * {
  animation: ncHeroLine .8s var(--nc-ease) both;
}
.nc-hero > *:nth-child(1) { animation-delay: .05s; }
.nc-hero > *:nth-child(2) { animation-delay: .15s; }
.nc-hero > *:nth-child(3) { animation-delay: .25s; }
.nc-hero > *:nth-child(4) { animation-delay: .35s; }
.nc-hero > *:nth-child(5) { animation-delay: .45s; }

/* ==========================================================================
   3. SCROLL REVEAL — muncul saat masuk layar
   ========================================================================== */

.nc-muncul {
  opacity: 0;
  transform: translateY(22px);
  transition: opacity .65s var(--nc-ease), transform .65s var(--nc-ease);
}
.nc-muncul.nc-terlihat {
  opacity: 1;
  transform: translateY(0);
}

/* ==========================================================================
   4. KARTU PRODUK — angkat halus + gambar zoom lembut saat hover
   ========================================================================== */

.nc-kartu {
  transition: transform var(--nc-base) var(--nc-ease),
              box-shadow var(--nc-base) var(--nc-ease);
  will-change: transform;
}
.nc-kartu:hover {
  transform: translateY(-6px);
  box-shadow: 0 18px 40px -16px rgba(21, 22, 22, .22),
              0 4px 12px -6px rgba(21, 22, 22, .08);
}
.nc-kartu:active { transform: translateY(-2px) scale(.992); }

/* Gambar di dalam kartu: zoom pelan, tidak mengubah rasio */
.nc-kartu img,
.nc-zoom-wrap img {
  transition: transform .7s var(--nc-ease);
}
.nc-kartu:hover img,
.nc-zoom-wrap:hover img {
  transform: scale(1.055);
}
/* biar gambar tidak meluber keluar kartu saat membesar */
.nc-kartu, .nc-zoom-wrap { overflow: hidden; }

/* ==========================================================================
   5. TOMBOL — tekan berasa, tombol utama dapat kilau halus
   ========================================================================== */

.nc-press { transition: transform var(--nc-fast) var(--nc-ease); }
.nc-press:active { transform: scale(.965); }

/* Tombol utama (bg-secondary / bg-primary-container): kilau saat hover */
.nc-cta {
  position: relative;
  overflow: hidden;
  transition: transform var(--nc-fast) var(--nc-ease),
              box-shadow var(--nc-base) var(--nc-ease);
}
.nc-cta::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(110deg, transparent 32%, rgba(255,255,255,.3) 50%, transparent 68%);
  transform: translateX(-130%);
  transition: transform .7s var(--nc-ease);
  pointer-events: none;
}
.nc-cta:hover::after { transform: translateX(130%); }
.nc-cta:hover { box-shadow: 0 10px 26px -10px rgba(117, 89, 59, .45); }
.nc-cta:active { transform: scale(.975); }

/* ==========================================================================
   6. IKON & GARIS — micro-motion saat hover pada link navigasi
   ========================================================================== */

.nc-link {
  position: relative;
  transition: color var(--nc-fast) var(--nc-ease-inout);
}
/* garis bawah tumbuh dari tengah */
.nc-link::after {
  content: '';
  position: absolute;
  left: 50%;
  bottom: -.2em;
  width: 0;
  height: 2px;
  background: currentColor;
  transform: translateX(-50%);
  transition: width var(--nc-base) var(--nc-ease);
}
.nc-link:hover::after { width: 100%; }

/* panah/east & ikon material geser sedikit saat hover */
.nc-link .material-symbols-outlined,
.nc-panah .material-symbols-outlined {
  transition: transform var(--nc-base) var(--nc-ease);
}
.nc-link:hover .material-symbols-outlined,
.nc-panah:hover .material-symbols-outlined {
  transform: translateX(4px);
}

/* ==========================================================================
   7. BARIS KATALOG — masuk bertahap saat difilter/load
   ========================================================================== */

.nc-baris { animation: ncFadeIn var(--nc-base) var(--nc-ease) both; }

/* ==========================================================================
   8. ACCORDION (FAQ) — buka/tutup halus
   ========================================================================== */

.nc-isi {
  overflow: hidden;
  transition: max-height .4s var(--nc-ease), opacity .3s var(--nc-ease);
}

/* ==========================================================================
   9. SKELETON — saat gambar belum termuat (warna earthy, bukan biru)
   ========================================================================== */

@keyframes ncShimmer {
  0%   { background-position: -400px 0; }
  100% { background-position: 400px 0; }
}
.nc-loading {
  background: linear-gradient(90deg, #f2ede6 0%, #e7dfd3 50%, #f2ede6 100%);
  background-size: 400px 100%;
  animation: ncShimmer 1.4s linear infinite;
}

/* Gambar: fade-in lembut begitu selesai dimuat */
.nc-img {
  opacity: 0;
  transition: opacity .55s var(--nc-ease);
}
.nc-img.nc-siap { opacity: 1; }

/* ==========================================================================
   10. PENANDA PRODUK — denyut sangat halus untuk badge Bestseller
   ========================================================================== */

@keyframes ncPulse {
  0%, 100% { transform: scale(1); }
  50%      { transform: scale(1.045); }
}
.nc-badge { animation: ncPulse 2.6s ease-in-out infinite; }

/* ==========================================================================
   11. SCROLL HALUS & HEADER
   ========================================================================== */

html { scroll-behavior: smooth; }

header, nav {
  transition: box-shadow var(--nc-base) var(--nc-ease),
              background-color var(--nc-base) var(--nc-ease);
}
.nc-scrolled {
  box-shadow: 0 4px 20px -8px rgba(21, 22, 22, .16);
}

/* Kilau berjalan pada marquee promo (kalau ada) */
@keyframes ncMarquee {
  from { transform: translateX(0); }
  to   { transform: translateX(-50%); }
}

/* ==========================================================================
   12. LAYAR SENTUH — hover terangkat tidak cocok di HP
   Di layar sentuh, :hover "nyangkut" setelah disentuh, jadi kartu terlihat
   melayang terus. Ganti dengan efek tekan yang hilang saat jari diangkat.
   ========================================================================== */

@media (hover: none) and (pointer: coarse) {
  .nc-kartu:hover {
    transform: none;
    box-shadow: none;
  }
  .nc-kartu:active {
    transform: scale(.982);
    box-shadow: 0 6px 18px -8px rgba(21, 22, 22, .18);
  }
  /* zoom gambar tetap jalan saat disentuh (terasa hidup, lalu balik) */
  .nc-kartu:hover img, .nc-zoom-wrap:hover img { transform: none; }
  .nc-kartu:active img { transform: scale(1.03); }

  /* kilau tombol: jangan berjalan terus setelah disentuh */
  .nc-cta:hover::after { transform: translateX(-130%); }
  .nc-cta:active::after { transform: translateX(130%); }
  .nc-cta:hover { box-shadow: none; }

  /* garis bawah link: cukup saat benar-benar ditekan */
  .nc-link:hover::after { width: 0; }
  .nc-link:active::after { width: 100%; }
}

/* ==========================================================================
   13. AKSESIBILITAS — hormati preferensi pengguna
   ========================================================================== */

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }
  .nc-muncul { opacity: 1 !important; transform: none !important; }
  .nc-kartu:hover, .nc-cta:active, .nc-press:active { transform: none; }
  .nc-kartu:hover img, .nc-zoom-wrap:hover img { transform: none; }
  .nc-link:hover::after { width: 0; }
  .nc-badge { animation: none; }
}
