/* ============================================
   WishCraft — Main Stylesheet
   ============================================ */

:root {
  --cream: #faf7f2;
  --dark: #1a1208;
  --rose: #e8636a;
  --rose-light: #f4a0a4;
  --gold: #c9a84c;
  --gold-light: #f0d896;
  --warm-gray: #8c7d6e;
  --card-bg: #fff9f3;
  --border: rgba(201, 168, 76, 0.2);
  --font-display: "Playfair Display", Georgia, serif;
  --font-body: "DM Sans", sans-serif;
  --radius: 20px;
  --radius-sm: 12px;
  --shadow: 0 8px 40px rgba(26, 18, 8, 0.08);
  --shadow-lg: 0 20px 80px rgba(26, 18, 8, 0.14);
}

*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}
html {
  scroll-behavior: smooth;
}
body {
  font-family: var(--font-body);
  background: var(--cream);
  color: var(--dark);
  overflow-x: hidden;
}

h1,
h2,
h3 {
  font-family: var(--font-display);
  line-height: 1.15;
}
h1 {
  font-size: clamp(2.4rem, 6vw, 4.2rem);
  font-weight: 700;
}
h2 {
  font-size: clamp(2rem, 4vw, 3rem);
  font-weight: 700;
}
h3 {
  font-size: 1.2rem;
  font-weight: 700;
}
em {
  font-style: italic;
  color: var(--rose);
}
p {
  line-height: 1.7;
  color: var(--warm-gray);
}
a {
  text-decoration: none;
  color: inherit;
}

/* ---- HEADER ---- */
#header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  background: rgba(250, 247, 242, 0.88);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
  transition: box-shadow 0.3s;
}
.header-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 2rem;
  height: 68px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.logo {
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--dark);
}
.logo span {
  color: var(--rose);
}
nav {
  display: flex;
  align-items: center;
  gap: 2rem;
}
nav a {
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--warm-gray);
  transition: color 0.2s;
  cursor: pointer;
}
nav a:hover {
  color: var(--dark);
}
.btn-order,
.btn-order-sm {
  background: var(--rose);
  color: #fff !important;
  padding: 0.55rem 1.4rem;
  border-radius: 50px;
  font-size: 0.85rem;
  font-weight: 500;
  transition:
    background 0.2s,
    transform 0.15s;
}
.btn-order:hover,
.btn-order-sm:hover {
  background: #d44d54;
  transform: translateY(-1px);
}
.btn-order-sm {
  padding: 0.45rem 1.1rem;
  font-size: 0.8rem;
}
.hamburger {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
}
.hamburger span {
  display: block;
  width: 24px;
  height: 2px;
  background: var(--dark);
  border-radius: 2px;
  transition: 0.25s;
}
.mobile-menu {
  display: none;
  flex-direction: column;
  padding: 1rem 2rem 1.5rem;
  gap: 1rem;
  border-top: 1px solid var(--border);
}
.mobile-menu a {
  font-size: 1rem;
  font-weight: 500;
  color: var(--warm-gray);
}
.mobile-menu.open {
  display: flex;
}
@media (max-width: 680px) {
  nav {
    display: none;
  }
  .hamburger {
    display: flex;
  }
}

/* ---- HERO ---- */
#hero {
  min-height: 100vh;
  display: flex;
  align-items: center;
  position: relative;
  overflow: hidden;
  padding: 100px 2rem 60px;
}
.hero-bg {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
}
.blob {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  opacity: 0.35;
}
.blob-1 {
  width: 500px;
  height: 500px;
  background: radial-gradient(circle, var(--gold-light), transparent 70%);
  top: -100px;
  right: -100px;
  animation: floatBlob 8s ease-in-out infinite;
}
.blob-2 {
  width: 400px;
  height: 400px;
  background: radial-gradient(circle, var(--rose-light), transparent 70%);
  bottom: -80px;
  left: -80px;
  animation: floatBlob 10s ease-in-out infinite reverse;
}
.blob-3 {
  width: 300px;
  height: 300px;
  background: radial-gradient(circle, #ffd6e0, transparent 70%);
  top: 40%;
  left: 40%;
  animation: floatBlob 12s ease-in-out infinite 2s;
}
@keyframes floatBlob {
  0%,
  100% {
    transform: translate(0, 0) scale(1);
  }
  50% {
    transform: translate(30px, -30px) scale(1.05);
  }
}

.hero-content {
  max-width: 1200px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4rem;
  align-items: center;
  position: relative;
  z-index: 1;
  width: 100%;
}
.hero-badge {
  display: inline-block;
  background: rgba(201, 168, 76, 0.12);
  border: 1px solid var(--gold);
  color: #8a6800;
  font-size: 0.78rem;
  font-weight: 500;
  padding: 0.35rem 1rem;
  border-radius: 50px;
  margin-bottom: 1.5rem;
  letter-spacing: 0.04em;
}
.hero-text h1 {
  margin-bottom: 1.2rem;
}
.hero-text p {
  font-size: 1.05rem;
  max-width: 440px;
  margin-bottom: 2.5rem;
}
.hero-cta {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
}
.btn-primary {
  display: inline-block;
  background: var(--dark);
  color: #fff;
  padding: 0.8rem 2rem;
  border-radius: 50px;
  font-size: 0.95rem;
  font-weight: 500;
  transition:
    background 0.2s,
    transform 0.15s,
    box-shadow 0.2s;
}
.btn-primary:hover {
  background: var(--rose);
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(232, 99, 106, 0.35);
}
.btn-ghost {
  display: inline-block;
  color: var(--dark);
  padding: 0.8rem 2rem;
  border-radius: 50px;
  font-size: 0.95rem;
  font-weight: 500;
  border: 1.5px solid rgba(26, 18, 8, 0.2);
  transition:
    border-color 0.2s,
    color 0.2s;
}
.btn-ghost:hover {
  border-color: var(--rose);
  color: var(--rose);
}

.hero-visual {
  position: relative;
  display: flex;
  justify-content: center;
  padding: 2rem;
}
.phone-mockup {
  position: relative;
  width: 220px;
  animation: phoneBob 4s ease-in-out infinite;
}
@keyframes phoneBob {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-12px);
  }
}
.phone-frame {
  background: #1a1208;
  border-radius: 36px;
  padding: 12px;
  box-shadow:
    0 0 0 2px #3a2e1e,
    0 30px 80px rgba(26, 18, 8, 0.4),
    inset 0 1px 0 rgba(255, 255, 255, 0.08);
  position: relative;
}
.phone-notch {
  position: absolute;
  top: 16px;
  left: 50%;
  transform: translateX(-50%);
  width: 60px;
  height: 10px;
  background: #1a1208;
  border-radius: 10px;
  z-index: 2;
}
.phone-screen {
  background: linear-gradient(160deg, #fff9f3 0%, #fce8ec 100%);
  border-radius: 26px;
  overflow: hidden;
  height: 380px;
}
.mock-site {
  padding: 2rem 1.2rem;
}
.mock-header {
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 700;
  text-align: center;
  margin-bottom: 1rem;
  color: var(--dark);
}
.mock-photo {
  background: linear-gradient(135deg, var(--rose-light), var(--gold-light));
  border-radius: 14px;
  height: 140px;
  margin-bottom: 1rem;
}
.mock-text {
  margin-bottom: 1rem;
}
.mock-line {
  height: 8px;
  background: rgba(26, 18, 8, 0.1);
  border-radius: 4px;
  margin-bottom: 8px;
}
.mock-line.long {
  width: 100%;
}
.mock-line.medium {
  width: 75%;
}
.mock-line.short {
  width: 55%;
}
.mock-music {
  background: rgba(26, 18, 8, 0.06);
  border-radius: 8px;
  padding: 8px 10px;
  font-size: 0.7rem;
  color: var(--warm-gray);
  text-align: center;
}
.phone-glow {
  position: absolute;
  bottom: -30px;
  left: 50%;
  transform: translateX(-50%);
  width: 160px;
  height: 40px;
  background: var(--rose-light);
  filter: blur(30px);
  opacity: 0.5;
}
.floating-tag {
  position: absolute;
  background: #fff;
  border: 1px solid var(--border);
  box-shadow: 0 4px 20px rgba(26, 18, 8, 0.1);
  padding: 0.5rem 1rem;
  border-radius: 50px;
  font-size: 0.78rem;
  font-weight: 500;
  white-space: nowrap;
}
.tag-1 {
  top: 10%;
  right: -10px;
  animation: tagFloat 5s ease-in-out infinite;
}
.tag-2 {
  top: 40%;
  left: -20px;
  animation: tagFloat 5s ease-in-out infinite 1.5s;
}
.tag-3 {
  bottom: 15%;
  right: -5px;
  animation: tagFloat 5s ease-in-out infinite 3s;
}
@keyframes tagFloat {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-6px);
  }
}
.scroll-hint {
  position: absolute;
  bottom: 2rem;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  opacity: 0.4;
  font-size: 0.72rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}
.scroll-line {
  width: 1px;
  height: 40px;
  background: var(--dark);
  animation: scrollPulse 2s ease-in-out infinite;
}
@keyframes scrollPulse {
  0%,
  100% {
    transform: scaleY(1);
    opacity: 1;
  }
  50% {
    transform: scaleY(0.5);
    opacity: 0.3;
  }
}
@media (max-width: 860px) {
  .hero-content {
    grid-template-columns: 1fr;
    gap: 3rem;
    text-align: center;
  }
  .hero-text p {
    margin-left: auto;
    margin-right: auto;
  }
  .hero-cta {
    justify-content: center;
  }
  .hero-visual {
    padding: 1rem;
  }
}

/* ---- SECTIONS SHARED ---- */
section {
  padding: 100px 2rem;
}
.section-inner {
  max-width: 1200px;
  margin: 0 auto;
}
.section-label {
  font-size: 0.78rem;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 0.8rem;
}
.section-inner h2 {
  margin-bottom: 1rem;
}
.section-sub {
  font-size: 1rem;
  max-width: 480px;
  margin-bottom: 3.5rem;
}

/* ---- FEATURES ---- */
#keunggulan {
  background: var(--dark);
}
#keunggulan .section-label {
  color: var(--gold-light);
}
#keunggulan h2 {
  color: #fff;
}
#keunggulan em {
  color: var(--rose-light);
}
#keunggulan .section-sub {
  color: rgba(255, 255, 255, 0.45);
}
.features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1.5rem;
}
.feature-card {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius);
  padding: 2rem 1.8rem;
  transition:
    background 0.25s,
    transform 0.25s,
    border-color 0.25s;
}
.feature-card:hover {
  background: rgba(255, 255, 255, 0.07);
  transform: translateY(-4px);
  border-color: rgba(201, 168, 76, 0.3);
}
.feat-highlight {
  background: rgba(201, 168, 76, 0.08) !important;
  border-color: rgba(201, 168, 76, 0.25) !important;
}
.feat-icon {
  font-size: 2rem;
  margin-bottom: 1rem;
}
.feature-card h3 {
  color: #fff;
  margin-bottom: 0.6rem;
  font-size: 1.05rem;
}
.feature-card p {
  color: rgba(255, 255, 255, 0.5);
  font-size: 0.9rem;
}

/* ---- THEMES ---- */
.themes-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.8rem;
}
.theme-card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  transition:
    transform 0.25s,
    box-shadow 0.25s;
  cursor: pointer;
}
.theme-card:hover {
  transform: translateY(-6px);
  box-shadow: var(--shadow-lg);
}

/* Thumbnail area — background pakai gradient tema */
.theme-thumbnail {
  height: 260px;
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem 0 0.5rem;
  transition: background 0.3s;
}

/* Phone mockup di dalam thumbnail */
.thumb-phone {
  width: 110px;
  height: 210px;
  background: #1a1208;
  border-radius: 22px;
  padding: 6px;
  box-shadow:
    0 0 0 1.5px #3a2e1e,
    0 20px 50px rgba(0, 0, 0, 0.35),
    0 8px 20px rgba(0, 0, 0, 0.2);
  position: relative;
  flex-shrink: 0;
  transition: transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
  z-index: 1;
}
.theme-card:hover .thumb-phone {
  transform: translateY(-6px) scale(1.04);
}
.thumb-phone-notch {
  position: absolute;
  top: 9px;
  left: 50%;
  transform: translateX(-50%);
  width: 36px;
  height: 7px;
  background: #1a1208;
  border-radius: 4px;
  z-index: 3;
}
.thumb-phone-screen {
  width: 100%;
  height: 100%;
  border-radius: 17px;
  overflow: hidden;
  background: #fff;
  position: relative;
}
/* Screenshot foto tema */
.thumb-phone-screen img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top;
  display: block;
}
/* Fallback kalau belum ada foto: tampilkan emoji + gradient */
.thumb-phone-fallback {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
}

/* Badge kategori di pojok thumbnail */
.thumb-badge {
  position: absolute;
  bottom: 12px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid rgba(255, 255, 255, 0.5);
  backdrop-filter: blur(6px);
  padding: 0.25rem 0.8rem;
  border-radius: 50px;
  font-size: 0.68rem;
  font-weight: 600;
  color: var(--dark);
  white-space: nowrap;
  letter-spacing: 0.04em;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}
.theme-info {
  padding: 1.4rem;
}
.theme-code {
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 0.4rem;
}
.theme-info h3 {
  margin-bottom: 0.4rem;
  font-size: 1rem;
}
.theme-info p {
  font-size: 0.85rem;
  margin-bottom: 1.2rem;
}
.theme-tag {
  display: inline-block;
  background: rgba(201, 168, 76, 0.1);
  border: 1px solid var(--border);
  color: #8a6800;
  font-size: 0.7rem;
  font-weight: 500;
  padding: 0.2rem 0.7rem;
  border-radius: 20px;
  margin-right: 0.4rem;
  margin-bottom: 0.4rem;
}
.btn-preview {
  display: block;
  width: 100%;
  text-align: center;
  background: var(--dark);
  color: #fff;
  padding: 0.65rem;
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  font-weight: 500;
  border: none;
  cursor: pointer;
  margin-top: 1rem;
  transition: background 0.2s;
  font-family: var(--font-body);
}
.btn-preview:hover {
  background: var(--rose);
}

/* ---- CTA ---- */
#cta {
  background: linear-gradient(160deg, #fff9f3, #fce8ec);
  text-align: center;
  position: relative;
  overflow: hidden;
}
.cta-inner {
  max-width: 600px;
  margin: 0 auto;
  position: relative;
  z-index: 1;
}
.cta-inner h2 {
  margin: 1rem 0;
}
.cta-inner p {
  margin-bottom: 2rem;
}
.cta-blob {
  position: absolute;
  top: -150px;
  left: 50%;
  transform: translateX(-50%);
  width: 500px;
  height: 500px;
  background: radial-gradient(
    circle,
    rgba(232, 99, 106, 0.15),
    transparent 70%
  );
  filter: blur(60px);
  pointer-events: none;
}

/* ---- FOOTER ---- */
footer {
  background: var(--dark);
  padding: 3rem 2rem;
}
.footer-inner {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
}
footer .logo {
  color: #fff;
  font-size: 1.3rem;
}
footer .logo span {
  color: var(--rose);
}
footer p {
  font-size: 0.85rem;
  color: rgba(255, 255, 255, 0.35);
}
footer a:not(.logo) {
  font-size: 0.85rem;
  color: rgba(255, 255, 255, 0.5);
  transition: color 0.2s;
}
footer a:not(.logo):hover {
  color: var(--rose);
}

/* ---- PREVIEW PAGE ---- */

/* Header utama disembunyikan saat mode preview */
#header.hidden {
  display: none !important;
}

/* Preview page menempati seluruh layar */
#previewPage {
  position: fixed;
  inset: 0;
  z-index: 900;
  background: #f0ede8;
  display: flex;
  flex-direction: column;
}
#previewPage.hidden {
  display: none;
}

/* Header preview */
.preview-header {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0 1.5rem;
  height: 58px;
  background: rgba(250, 247, 242, 0.97);
  border-bottom: 1px solid var(--border);
  backdrop-filter: blur(12px);
  flex-shrink: 0;
}
.btn-back {
  background: none;
  border: 1.5px solid rgba(26, 18, 8, 0.2);
  color: var(--dark);
  padding: 0.4rem 1rem;
  border-radius: 50px;
  font-size: 0.82rem;
  font-weight: 500;
  cursor: pointer;
  font-family: var(--font-body);
  transition:
    border-color 0.2s,
    color 0.2s;
  white-space: nowrap;
  flex-shrink: 0;
}
.btn-back:hover {
  border-color: var(--rose);
  color: var(--rose);
}
.preview-title {
  font-family: var(--font-display);
  font-size: 0.95rem;
  font-weight: 700;
  flex: 1;
  text-align: center;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Toggle Desktop / Mobile */
.view-toggle {
  display: flex;
  align-items: center;
  background: rgba(26, 18, 8, 0.06);
  border-radius: 50px;
  padding: 3px;
  gap: 2px;
  flex-shrink: 0;
}
.toggle-btn {
  display: flex;
  align-items: center;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.35rem 0.9rem;
  border-radius: 50px;
  font-size: 0.78rem;
  font-weight: 500;
  font-family: var(--font-body);
  color: var(--warm-gray);
  transition:
    background 0.2s,
    color 0.2s;
  white-space: nowrap;
}
.toggle-btn.active {
  background: #fff;
  color: var(--dark);
  box-shadow: 0 1px 6px rgba(26, 18, 8, 0.12);
}
.toggle-btn svg {
  flex-shrink: 0;
}
@media (max-width: 500px) {
  .toggle-btn span {
    display: none;
  }
  .toggle-btn {
    padding: 0.35rem 0.6rem;
  }
}

/* Preview body */
.preview-body {
  flex: 1;
  overflow: hidden;
  display: flex;
  align-items: stretch;
}

/* Desktop mode: iframe full */
.preview-desktop {
  flex: 1;
  display: flex;
}
.preview-desktop iframe {
  width: 100%;
  height: 100%;
  border: none;
  display: block;
}

/* Mobile mode: wrapper — center mockup, tidak scroll */
.preview-mobile {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  padding: 1.5rem 1rem;
  background: #e8e4de;
}

/*
  Strategi: tinggi total area preview = 100dvh - 58px (preview header)
  Mockup phone mengisi area itu dengan padding atas bawah 1.5rem (48px total)
  Jadi tinggi mockup phone max = 100dvh - 58px - 48px = 100dvh - 106px
*/
.mockup-phone {
  /* Lebar proporsional: rasio iPhone ≈ 9:19.5, jadi width = height * 9/19.5 */
  --phone-h: min(780px, calc(100dvh - 106px));
  --phone-w: calc(var(--phone-h) * 9 / 19.5);

  width: var(--phone-w);
  height: var(--phone-h);
  background: #1a1208;
  border-radius: calc(var(--phone-w) * 0.14);
  padding: calc(var(--phone-w) * 0.038);
  box-shadow:
    0 0 0 2px #3a2e1e,
    0 0 0 10px #111,
    0 20px 60px rgba(0, 0, 0, 0.5);
  position: relative;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
}

/* Status bar */
.mockup-status {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 1.2rem;
  height: calc(var(--phone-h) * 0.052); /* ~40px di 780px */
  font-size: 0.68rem;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.75);
  flex-shrink: 0;
  position: relative;
  z-index: 4;
}

/* Dynamic island */
.mockup-notch {
  position: absolute;
  top: calc(var(--phone-h) * 0.023);
  left: 50%;
  transform: translateX(-50%);
  width: calc(var(--phone-w) * 0.38);
  height: calc(var(--phone-h) * 0.038);
  background: #1a1208;
  border-radius: 20px;
  z-index: 5;
}

/* Layar HP — flex:1 mengisi sisa tinggi phone */
.mockup-screen {
  flex: 1;
  border-radius: calc(var(--phone-w) * 0.1);
  overflow: hidden;
  background: #fff;
  position: relative;
  /* overflow:hidden clip konten, tapi iframe di dalam perlu pointer-events */
}

/*
  Lebar iframe = 390px (viewport iPhone), di-scale supaya muat.
  Scale = screen-width-actual / 390.
  Tinggi iframe di-set via JS supaya mengisi layar tanpa sisa putih.
*/
.mockup-screen iframe {
  width: 390px;
  height: 100%; /* JS akan override ini */
  border: none;
  display: block;
  transform-origin: top left;
  /* scale di-set via JS juga supaya akurat */
}

/* Home bar */
.mockup-home-bar {
  height: calc(var(--phone-h) * 0.036);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.mockup-home-bar::after {
  content: "";
  display: block;
  width: 40%;
  height: 4px;
  background: rgba(255, 255, 255, 0.3);
  border-radius: 3px;
}

/* Fallback dvh untuk browser lama */
@supports not (height: 100dvh) {
  .mockup-phone {
    --phone-h: min(780px, calc(100vh - 106px));
  }
}

/* Responsive layar kecil (mobile) */
@media (max-width: 440px) {
  .preview-mobile {
    padding: 1rem 0.5rem;
  }
  .mockup-phone {
    --phone-h: min(620px, calc(100dvh - 90px));
  }
}

.hidden {
  display: none !important;
}
