/* ==========================================================================
   KATALOG UNDANGAN DIGITAL — stylesheet halaman utama
   ========================================================================== */
:root{
  --ink:        #262319;
  --ink-soft:   #6b6455;
  --surface:    #f7f4ee;
  --surface-2:  #ffffff;
  --line:       rgba(38,35,25,0.12);
  --gold:       #a8823f;
  --gold-deep:  #8a6a2f;
  --shadow:     0 20px 44px -26px rgba(38,35,25,0.35);
  --radius:     14px;
  --font-display: "Fraunces", "Iowan Old Style", Georgia, serif;
  --font-body:    "Inter", "Segoe UI", system-ui, sans-serif;
  color-scheme: light;
}

*{ box-sizing:border-box; }
html{ scroll-behavior:smooth; }
body{
  margin:0;
  background:var(--surface);
  color:var(--ink);
  font-family:var(--font-body);
  -webkit-font-smoothing:antialiased;
}
img{ max-width:100%; display:block; }
h1,h2,h3{ font-family:var(--font-display); margin:0; text-wrap:balance; }
p{ margin:0; }
a{ color:inherit; text-decoration:none; }
button{ font-family:inherit; cursor:pointer; }

.wrap{ max-width:1180px; margin:0 auto; padding:0 1.5rem; }

/* ---------- header ---------- */
header.site{
  border-bottom:1px solid var(--line);
  background:var(--surface-2);
}
.site-bar{
  display:flex; align-items:center; justify-content:space-between;
  padding:1.1rem 0; gap:1rem;
}
.brand{ display:flex; align-items:center; gap:.6rem; font-family:var(--font-display); font-size:1.15rem; font-weight:600; }
.brand .dot{ width:8px; height:8px; border-radius:50%; background:var(--gold); flex:none; }
.brand small{ display:block; font-family:var(--font-body); font-weight:400; font-size:.68rem; letter-spacing:.14em; text-transform:uppercase; color:var(--ink-soft); }

/* ---------- hero ---------- */
.hero{ padding:3.6rem 0 2.4rem; text-align:center; }
.hero .eyebrow{
  font-size:.72rem; letter-spacing:.24em; text-transform:uppercase; color:var(--gold-deep);
  margin-bottom:.9rem;
}
.hero h1{ font-size:clamp(1.9rem,5vw,2.9rem); line-height:1.15; margin:0 auto; max-width:720px; }
.hero p.lead{ margin:1.1rem auto 0; max-width:560px; color:var(--ink-soft); font-size:1rem; line-height:1.7; }

/* ---------- filters ---------- */
.filters{
  display:flex; flex-wrap:wrap; gap:.6rem; justify-content:center;
  margin:2.2rem 0 0;
}
.chip{
  border:1px solid var(--line); background:var(--surface-2); color:var(--ink-soft);
  padding:.5rem 1.05rem; font-size:.8rem; letter-spacing:.02em; border-radius:999px;
  transition:background .2s ease, color .2s ease, border-color .2s ease;
}
.chip:hover{ border-color:var(--gold); color:var(--ink); }
.chip.active{ background:var(--ink); border-color:var(--ink); color:var(--surface-2); }

/* ---------- grid ---------- */
.grid{
  display:grid; grid-template-columns:repeat(auto-fill,minmax(260px,1fr)); gap:1.6rem;
  padding:2.6rem 0 4rem;
}

.card{
  background:var(--surface-2); border:1px solid var(--line); border-radius:var(--radius);
  overflow:hidden; position:relative; display:flex; flex-direction:column;
  box-shadow:var(--shadow);
  transition:transform .25s ease, box-shadow .25s ease;
}
.card:hover{ transform:translateY(-4px); }

.card-preview{
  position:relative; width:100%; aspect-ratio:3/4; overflow:hidden;
  background:var(--preview-surface,#f1ede3);
  border-bottom:1px solid var(--line);
}
.card-preview iframe{
  /* Ukuran dikunci ke lebar HP (390px) supaya tipografi vw-based di dalam
     template selalu tampil proporsional seperti di HP, lalu di-scale down
     lewat JS (lihat scalePreviews() di catalog.js) mengikuti lebar kartu
     yang sesungguhnya -- kalau ini dihapus/di-100%, teks jadi raksasa &
     terpotong di layar lebar karena vw dihitung dari lebar kartu, bukan
     lebar HP. */
  position:absolute; top:0; left:0; width:390px; height:520px;
  transform-origin:top left; border:0; pointer-events:none;
}
.card-preview .placeholder{
  position:absolute; inset:0; display:flex; flex-direction:column; align-items:center; justify-content:center;
  gap:.6rem; color:var(--ink-soft);
  background:
    radial-gradient(circle at 20% 15%, color-mix(in srgb, var(--acc2,#d8d2c4) 45%, transparent), transparent 55%),
    radial-gradient(circle at 85% 85%, color-mix(in srgb, var(--acc,#b9b3a6) 40%, transparent), transparent 55%),
    var(--preview-surface,#f1ede3);
}
.card-preview .placeholder svg{ width:34px; height:34px; opacity:.55; }
.card-preview .placeholder span{ font-size:.72rem; letter-spacing:.14em; text-transform:uppercase; }

.code-badge{
  position:absolute; top:.7rem; left:.7rem; z-index:2;
  background:rgba(38,35,25,0.82); color:#fff; backdrop-filter:blur(2px);
  padding:.3rem .65rem; border-radius:6px;
  font-size:.7rem; letter-spacing:.09em; font-variant-numeric:tabular-nums;
}
.status-badge{
  position:absolute; top:.7rem; right:.7rem; z-index:2;
  padding:.3rem .6rem; border-radius:6px; font-size:.66rem; letter-spacing:.09em; text-transform:uppercase;
}
.status-badge.tersedia{ background:#eef3e6; color:#3f6e2c; border:1px solid rgba(63,110,44,.25); }
.status-badge.segera{ background:rgba(38,35,25,0.08); color:var(--ink-soft); border:1px solid var(--line); }

.card-body{ padding:1.1rem 1.2rem 1.3rem; display:flex; flex-direction:column; gap:.5rem; flex:1; }
.card-cat{ font-size:.68rem; letter-spacing:.13em; text-transform:uppercase; color:var(--gold-deep); }
.card-title{ font-size:1.25rem; }
.card-style{ font-size:.78rem; color:var(--ink-soft); }
.card-desc{ font-size:.85rem; color:var(--ink-soft); line-height:1.6; margin-top:.15rem; flex:1; }

.card-actions{ display:flex; gap:.6rem; margin-top:.9rem; }
.btn{
  flex:1; text-align:center; padding:.62rem .8rem; border-radius:8px; font-size:.8rem;
  letter-spacing:.03em; border:1px solid var(--ink); transition:background .2s ease,color .2s ease;
}
.btn.primary{ background:var(--ink); color:var(--surface-2); }
.btn.primary:hover{ background:var(--gold-deep); border-color:var(--gold-deep); }
.btn.ghost{ background:transparent; color:var(--ink); }
.btn.ghost:hover{ background:var(--ink); color:var(--surface-2); }
.btn[disabled], a.btn.disabled{
  pointer-events:none; opacity:.45; border-color:var(--line); color:var(--ink-soft); background:transparent;
}

/* ---------- how-to strip ---------- */
.howto{ background:var(--surface-2); border-top:1px solid var(--line); border-bottom:1px solid var(--line); }
.howto .wrap{ padding:2.4rem 1.5rem; display:grid; gap:1.6rem; grid-template-columns:repeat(auto-fit,minmax(200px,1fr)); }
.howto .step{ display:flex; flex-direction:column; gap:.35rem; }
.howto .step .n{ font-family:var(--font-display); font-size:1.4rem; color:var(--gold-deep); }
.howto .step h3{ font-size:.98rem; }
.howto .step p{ font-size:.82rem; color:var(--ink-soft); line-height:1.6; }

/* ---------- footer ---------- */
footer.site{ padding:2.4rem 0 3rem; text-align:center; }
footer.site p{ font-size:.8rem; color:var(--ink-soft); line-height:1.8; }
footer.site a{ color:var(--gold-deep); text-decoration:underline; text-underline-offset:3px; }

.empty-state{ text-align:center; padding:3rem 1rem; color:var(--ink-soft); font-size:.9rem; grid-column:1/-1; }

/* ---------- demo modal ---------- */
.demo-modal{
  position:fixed; inset:0; z-index:200;
  display:flex; align-items:center; justify-content:center;
  padding:2.2rem 1rem;
  visibility:hidden; opacity:0;
  transition:opacity .25s ease, visibility .25s ease;
}
.demo-modal.open{ visibility:visible; opacity:1; }
.demo-backdrop{
  position:absolute; inset:0;
  background:rgba(24,22,15,0.62); backdrop-filter:blur(2px);
}
.demo-panel{
  position:relative; z-index:1;
  width:100%; max-width:420px; height:100%; max-height:840px;
  background:var(--surface-2); border-radius:18px; overflow:hidden;
  display:flex; flex-direction:column;
  box-shadow:0 30px 70px -20px rgba(0,0,0,.5);
  transform:translateY(14px) scale(.98); transition:transform .28s ease;
}
.demo-modal.open .demo-panel{ transform:none; }
.demo-panel-head{
  display:flex; align-items:flex-start; justify-content:space-between; gap:.8rem;
  padding:.9rem 1rem; border-bottom:1px solid var(--line); flex:none;
}
.demo-modal-code{
  display:inline-block; font-size:.68rem; letter-spacing:.09em; color:var(--gold-deep);
  background:rgba(168,130,63,.12); padding:.15rem .5rem; border-radius:5px; margin-bottom:.3rem;
}
.demo-modal-title{ font-size:1.05rem; }
.demo-close{
  flex:none; width:34px; height:34px; border-radius:50%; border:1px solid var(--line);
  background:var(--surface-2); color:var(--ink); display:flex; align-items:center; justify-content:center;
  transition:background .2s ease, color .2s ease;
}
.demo-close:hover{ background:var(--ink); color:var(--surface-2); border-color:var(--ink); }
.demo-panel-body{ flex:1; min-height:0; }
.demo-panel-body iframe{ width:100%; height:100%; border:0; display:block; }

@media (max-width:520px){
  .demo-modal{ padding:0; }
  .demo-panel{ max-width:none; max-height:none; border-radius:0; }
}

@media (max-width:520px){
  .hero{ padding:2.6rem 0 1.8rem; }
  .grid{ grid-template-columns:repeat(auto-fill,minmax(150px,1fr)); gap:1rem; padding:1.8rem 0 3rem; }
  .card-body{ padding:.9rem 1rem 1.1rem; }
}
