html.lenis, html.lenis body { height: auto; }
.lenis.lenis-smooth { scroll-behavior: auto !important; }
.lenis.lenis-stopped { overflow: hidden; }

body { font-family: 'Inter', sans-serif; background: #0a0a0a; color: #e5e5e5; overflow-x: hidden; }
::selection { background: #22d3ee; color: #0a0a0a; }

/* Grain overlay untuk nuansa sinematik */
.grain::after {
  content: ""; position: fixed; inset: -50%; pointer-events: none; z-index: 60;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='160' height='160'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='3' stitchTiles='stitch'/></filter><rect width='100%' height='100%' filter='url(%23n)' opacity='.5'/></svg>");
  opacity: .06; animation: grain 1.2s steps(6) infinite;
}
@keyframes grain {
  0%,100% { transform: translate(0,0) } 20% { transform: translate(-3%,2%) }
  40% { transform: translate(2%,-3%) } 60% { transform: translate(-2%,-1%) } 80% { transform: translate(3%,3%) }
}

.text-stroke { -webkit-text-stroke: 1px rgba(255,255,255,.35); color: transparent; }
.gradient-text {
  background: linear-gradient(90deg, #22d3ee, #a855f7 50%, #34d399);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}

.layer { position: absolute; inset: 0; will-change: transform; }

.reveal-line { display: inline-block; overflow: hidden; vertical-align: top; padding-bottom: .08em; }
.reveal-word { display: inline-block; will-change: transform, opacity; }

/* Gambar muncul halus setelah selesai dimuat */
/* Efek hover memakai properti `scale`/`translate` (bukan transform) agar tidak bentrok dengan animasi GSAP */
.fade-img { transition: opacity .8s ease, scale 1.2s cubic-bezier(.2,.8,.2,1), filter .6s ease; }
.fade-img.is-loading { opacity: 0; }

/* ---------- Kartu project (horizontal scroll) ---------- */
.card-size { flex-shrink: 0; width: 100%; aspect-ratio: 4 / 3; border-radius: 1.5rem; }
@media (min-width: 768px)  { .card-size { width: 42vw; aspect-ratio: 4 / 5; } }
@media (min-width: 1024px) { .card-size { width: 38vw; } }

.card { transform-style: preserve-3d; transition: box-shadow .5s ease; }
.card::before {
  content: ""; position: absolute; inset: -1px; border-radius: inherit; padding: 1px; z-index: 2; pointer-events: none;
  background: conic-gradient(from var(--angle, 0deg), transparent 0 60%, var(--accent) 75%, transparent 90%);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor; mask-composite: exclude; opacity: 0; transition: opacity .5s ease;
}
.card:hover::before { opacity: 1; animation: spin 3s linear infinite; }
@property --angle { syntax: '<angle>'; initial-value: 0deg; inherits: false; }
@keyframes spin { to { --angle: 360deg; } }
.card:hover { box-shadow: 0 30px 80px -20px var(--glow); }
.card .card-img { filter: grayscale(.6) brightness(.7); }
.card:hover .card-img { scale: 1.08; filter: grayscale(0) brightness(.9); }
.card .card-cta { transform: translateY(12px); opacity: 0; transition: all .5s cubic-bezier(.2,.8,.2,1); }
.card:hover .card-cta { transform: translateY(0); opacity: 1; }
@media (hover: none) { .card .card-cta { transform: none; opacity: 1; } }

/* ---------- Kartu produk ---------- */
.pcard { transition: translate .5s cubic-bezier(.2,.8,.2,1), box-shadow .5s ease, border-color .5s ease; }
.pcard:hover { translate: 0 -6px; border-color: rgba(255,255,255,.2); box-shadow: 0 30px 70px -30px var(--glow, rgba(34,211,238,.35)); }
.pcard:hover .pcard-img { scale: 1.06; }

.shot:hover .fade-img { scale: 1.04; }
.next-project:hover .next-img { scale: 1.06; opacity: .5; }

/* ---------- Form ---------- */
.field { background: transparent; border: 0; border-bottom: 1px solid rgba(255,255,255,.15); transition: border-color .3s; }
.field:focus { outline: none; border-color: #22d3ee; }

.qty { display: inline-flex; align-items: center; border: 1px solid rgba(255,255,255,.15); border-radius: 999px; }
.qty button { width: 38px; height: 38px; color: rgba(255,255,255,.7); font-size: 18px; line-height: 1; }
.qty button:hover { color: #22d3ee; }
.qty input { width: 44px; background: transparent; border: 0; text-align: center; color: #fff; -moz-appearance: textfield; }
.qty input::-webkit-outer-spin-button, .qty input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.qty input:focus { outline: none; }

/* ---------- Toast ---------- */
.toast {
  position: fixed; left: 50%; bottom: 28px; z-index: 80; transform: translate(-50%, 20px); opacity: 0; pointer-events: none;
  display: flex; align-items: center; gap: 14px; white-space: nowrap;
  padding: 12px 20px; border-radius: 999px; font-size: 14px; color: #fff;
  background: rgba(20,20,20,.92); border: 1px solid rgba(255,255,255,.14); backdrop-filter: blur(10px);
  transition: opacity .35s ease, transform .35s cubic-bezier(.2,.8,.2,1);
}
.toast.show { opacity: 1; transform: translate(-50%, 0); pointer-events: auto; }
.toast a { color: #22d3ee; }

@media (prefers-reduced-motion: reduce) {
  .grain::after, .card:hover::before { animation: none; }
}
