/* Landing (S-01), halaman undang-undang dan halaman offline.
 * Tema: midnight navy (lalai, gelap) dengan aksen amber; mod cerah melalui <html data-theme="light"> (theme.js).
 * Hanya fail ini yang mengubah token warna; dashboard /app/ kekal dengan tema terangnya sendiri. */

body.site {
  --bg: #0a0f1f;
  --surface: #121a30;
  --surface-2: #18223d;
  --text: #eef2ff;
  --muted: #a8b2cc;
  --border: #27324f;
  --glass: rgba(18, 26, 48, 0.72);
  --accent: #fbbf24;
  --accent-hover: #fcd34d;
  --accent-ink: #1b1403;
  --accent-text: #fbbf24;
  --teal: #2dd4bf;
  --chip-bg: rgba(251, 191, 36, 0.14);
  --chip-text: #fcd34d;
  --glow-a: rgba(251, 191, 36, 0.13);
  --glow-b: rgba(45, 212, 191, 0.09);
  --shadow: 0 18px 50px rgba(0, 0, 0, 0.45);
  --primary: var(--accent);
  --primary-dark: var(--accent-hover);
  --secondary: var(--text);

  background-color: var(--bg);
  background-image:
    radial-gradient(60% 520px at 50% 0, var(--glow-a), transparent 70%),
    radial-gradient(40% 420px at 0 38%, var(--glow-b), transparent 70%);
  background-repeat: no-repeat;
  color: var(--text);
}
html[data-theme="light"] body.site {
  --bg: #f7f8fc;
  --surface: #ffffff;
  --surface-2: #eef1fa;
  --text: #0f1530;
  --muted: #4a5578;
  --border: #dfe4f2;
  --glass: rgba(255, 255, 255, 0.8);
  --accent-text: #b45309;
  --teal: #0f766e;
  --chip-bg: #fef3c7;
  --chip-text: #92400e;
  --glow-a: rgba(251, 191, 36, 0.2);
  --glow-b: rgba(15, 118, 110, 0.08);
  --shadow: 0 18px 50px rgba(15, 21, 48, 0.14);
}
html { color-scheme: dark; }
html[data-theme="light"] { color-scheme: light; }

body.site a { color: var(--accent-text); }
body.site :focus-visible { outline-color: var(--accent); }
body.site .btn { background: var(--accent); color: var(--accent-ink); border-radius: 999px; font-weight: 700; }
body.site .btn:hover { background: var(--accent-hover); }
body.site .btn-secondary { background: transparent; color: var(--text); border-color: var(--border); }
body.site .btn-secondary:hover { background: var(--surface-2); }
body.site .card { background: var(--surface); border-color: var(--border); border-radius: 20px; padding: var(--s5); }
body.site .caption { color: var(--muted); }

/* ---------- header: bar penuh lebar dengan kesan kaca ---------- */
.site-header { position: sticky; top: 0; z-index: 30; background: var(--glass); border-bottom: 1px solid var(--border); -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px); }
.site-header .pill {
  position: relative; max-width: 1040px; margin: 0 auto; min-height: 64px; padding: 6px var(--s4);
  display: flex; align-items: center; justify-content: space-between; gap: var(--s2);
}
.brand { display: inline-flex; align-items: center; gap: var(--s2); font-weight: 800; font-size: 18px; color: var(--text) !important; text-decoration: none; white-space: nowrap; }
.brand svg { width: 26px; height: 26px; color: var(--accent-text); flex: none; }
.site-nav { display: none; align-items: center; gap: var(--s1); }
.site-nav a { color: var(--muted) !important; text-decoration: none; font-weight: 600; font-size: 15px; padding: 10px 14px; border-radius: 999px; }
.site-nav a:hover { color: var(--text) !important; background: var(--surface-2); }
.header-actions { display: flex; align-items: center; gap: var(--s1); }
.icon-toggle {
  display: inline-flex; align-items: center; justify-content: center; width: 44px; height: 44px; padding: 0;
  border: 0; border-radius: 50%; background: transparent; color: var(--text); cursor: pointer;
}
.icon-toggle:hover { background: var(--surface-2); }
.icon-toggle svg { width: 22px; height: 22px; }
.theme-sun { display: none; }
html[data-theme="light"] .theme-sun { display: block; }
html[data-theme="light"] .theme-moon { display: none; }
.header-login { display: none; min-height: 44px; padding: 0 var(--s5); }
.menu-panel {
  position: absolute; left: var(--s3); right: var(--s3); top: calc(100% + 8px); padding: var(--s2);
  background: var(--surface); border: 1px solid var(--border); border-radius: 24px; box-shadow: var(--shadow);
  display: flex; flex-direction: column;
}
.menu-panel a { color: var(--text) !important; text-decoration: none; font-weight: 600; padding: 14px var(--s4); border-radius: 14px; min-height: 48px; display: flex; align-items: center; }
.menu-panel a:hover { background: var(--surface-2); }
@media (min-width: 840px) {
  .site-nav { display: flex; }
  .header-login { display: inline-flex; }
  .menu-toggle, .menu-panel { display: none !important; }
}

/* ---------- susun atur umum ---------- */
.wrap { max-width: 1040px; margin: 0 auto; padding: 0 var(--s4); }
.section { padding: 56px 0; }
.section-head { max-width: 640px; margin: 0 auto var(--s6); text-align: center; }
.eyebrow {
  display: inline-block; margin: 0 0 var(--s3); padding: 5px 14px; border-radius: 999px;
  font-size: 13px; font-weight: 700; color: var(--chip-text); background: var(--chip-bg);
}
.section h2 { font-size: 28px; line-height: 1.2; letter-spacing: -0.01em; margin: 0 0 var(--s3); }
.section-head p { color: var(--muted); font-size: 17px; margin: 0; }
.accent { color: var(--accent-text); }
@media (min-width: 840px) { .section h2 { font-size: 36px; } }

/* ---------- hero ---------- */
/* padding-top/bottom sahaja: shorthand `padding` akan membuang gutter sisi daripada .wrap */
.hero { display: grid; gap: var(--s6); align-items: center; padding-top: var(--s6); padding-bottom: var(--s6); text-align: center; }
.hero h1 { font-size: 36px; line-height: 1.1; letter-spacing: -0.02em; margin: 0 0 var(--s4); }
.hero .lead { font-size: 18px; color: var(--muted); margin: 0 auto var(--s5); max-width: 520px; }
.badge-pill {
  display: inline-flex; align-items: center; gap: var(--s2); padding: 8px 16px; margin: 0 0 var(--s4);
  border: 1px solid var(--border); border-radius: 999px; background: var(--surface); font-size: 13px; font-weight: 600;
}
.badge-pill::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--teal); }
.hero-cta { display: flex; flex-direction: column; align-items: stretch; gap: var(--s3); max-width: 360px; margin: 0 auto; }
.hero-cta .btn { min-height: 54px; font-size: 17px; }
.hero-note { display: flex; align-items: flex-start; justify-content: center; gap: var(--s2); margin: var(--s4) auto 0; max-width: 420px; text-align: left; }
.hero-note svg { width: 18px; height: 18px; flex: none; margin-top: 2px; color: var(--teal); }
.hero-note p { margin: 0; }
.text-btn { background: none; border: 0; padding: 12px; font: inherit; font-weight: 700; color: var(--text); cursor: pointer; min-height: 44px; }
.text-btn:hover { color: var(--accent-text); }

.device-wrap { position: relative; justify-self: center; width: 100%; max-width: 300px; }
.device-wrap::before {
  content: ""; position: absolute; inset: 8% 0 -4%; z-index: 0; border-radius: 40px;
  background: radial-gradient(closest-side, var(--glow-a), transparent 72%); filter: blur(8px);
}
.phone-shot { position: relative; z-index: 1; display: block; width: 100%; height: auto; border-radius: 30px; border: 8px solid #060a16; background: #060a16; box-shadow: var(--shadow); }
html[data-theme="light"] .phone-shot { border-color: #1a2140; }
.float-chip {
  position: absolute; z-index: 2; display: inline-flex; align-items: center; gap: var(--s2); padding: 10px 14px;
  background: var(--surface); border: 1px solid var(--border); border-radius: 16px; box-shadow: var(--shadow);
  font-size: 13px; font-weight: 700; white-space: nowrap; animation: floaty 6s ease-in-out infinite;
}
.float-chip svg { width: 18px; height: 18px; color: var(--accent-text); }
.float-chip.chip-a { left: -14px; top: 9%; }
.float-chip.chip-b { right: -14px; bottom: 18%; animation-delay: -3s; }
.float-chip.chip-b svg { color: var(--teal); }
@keyframes floaty { 50% { transform: translateY(-8px); } }
@media (prefers-reduced-motion: reduce) { .float-chip { animation: none; } }
@media (min-width: 840px) {
  .hero { grid-template-columns: 1.15fr 1fr; text-align: left; padding-top: var(--s7, 56px); }
  .hero h1 { font-size: 52px; }
  .hero .lead { margin-left: 0; }
  .hero-cta { flex-direction: row; align-items: center; max-width: none; margin: 0; flex-wrap: wrap; }
  .hero-cta .btn { min-width: 220px; }
  .hero-note { justify-content: flex-start; margin-left: 0; }
  .float-chip.chip-a { left: -48px; }
  .float-chip.chip-b { right: -40px; }
}

/* ---------- langkah ---------- */
.steps { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--s4); counter-reset: step; }
.steps li { counter-increment: step; }
.steps li::before {
  content: counter(step); display: inline-flex; align-items: center; justify-content: center; width: 40px; height: 40px;
  border-radius: 50%; background: var(--accent); color: var(--accent-ink); font-weight: 800; margin-bottom: var(--s3);
}
.steps h3, .features h3 { font-size: 18px; margin-bottom: var(--s2); }
.steps p, .features p { margin: 0; color: var(--muted); }
@media (min-width: 840px) { .steps { grid-template-columns: repeat(3, 1fr); } }

/* ---------- ciri ---------- */
.features { display: grid; gap: var(--s4); }
.f-icon { display: inline-flex; align-items: center; justify-content: center; width: 44px; height: 44px; border-radius: 14px; background: var(--surface-2); color: var(--accent-text); margin-bottom: var(--s3); }
.f-icon svg { width: 22px; height: 22px; }
@media (min-width: 640px) { .features { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1000px) { .features { grid-template-columns: repeat(3, 1fr); } }

/* ---------- tangkapan skrin ---------- */
.shots { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(220px, 250px); gap: var(--s5); overflow-x: auto; padding: var(--s2) var(--s1) var(--s4); scroll-snap-type: x mandatory; }
.shots figure { margin: 0; scroll-snap-align: center; }
.shots figcaption { text-align: center; font-size: 14px; color: var(--muted); margin-top: var(--s3); }
@media (min-width: 1000px) { .shots { grid-auto-flow: row; grid-template-columns: repeat(4, 1fr); grid-auto-columns: auto; overflow: visible; } }

/* ---------- harga ---------- */
.seg { display: inline-flex; padding: 4px; border: 1px solid var(--border); border-radius: 999px; background: var(--surface); margin: 0 auto var(--s5); }
.seg button { min-height: 44px; padding: 0 var(--s5); border: 0; border-radius: 999px; background: transparent; color: var(--muted); font: inherit; font-weight: 700; cursor: pointer; }
.seg button[aria-pressed="true"] { background: var(--accent); color: var(--accent-ink); }
.seg-wrap { text-align: center; }
.pricing { display: grid; gap: var(--s4); max-width: 820px; margin: 0 auto; }
@media (min-width: 760px) { .pricing { grid-template-columns: 1fr 1fr; } }
.price { font-size: 38px; font-weight: 800; margin: var(--s1) 0 0; letter-spacing: -0.02em; }
.price small { font-size: 15px; font-weight: 600; color: var(--muted); letter-spacing: 0; }
.plan-pro { border: 2px solid var(--accent) !important; position: relative; }
.plan-tag { position: absolute; top: -13px; left: var(--s5); padding: 3px 12px; border-radius: 999px; background: var(--accent); color: var(--accent-ink); font-size: 12px; font-weight: 800; letter-spacing: 0.06em; text-transform: uppercase; }
.ticks { list-style: none; padding: 0; margin: 0; display: grid; gap: var(--s3); }
.ticks li { padding-left: 30px; position: relative; }
.ticks li::before { content: ""; position: absolute; left: 4px; top: 7px; width: 12px; height: 7px; border-left: 2px solid var(--teal); border-bottom: 2px solid var(--teal); transform: rotate(-45deg); }
.save { color: var(--teal); font-weight: 700; }
.pricing-note { text-align: center; margin: var(--s5) auto 0; max-width: 560px; }

/* ---------- FAQ ---------- */
.faq-list { max-width: 720px; margin: 0 auto; display: grid; gap: var(--s3); }
.faq-list details { background: var(--surface); border: 1px solid var(--border); border-radius: 18px; padding: 0 var(--s4); }
.faq-list summary { list-style: none; display: flex; align-items: center; justify-content: space-between; gap: var(--s3); min-height: 60px; cursor: pointer; font-weight: 700; }
.faq-list summary::-webkit-details-marker { display: none; }
.faq-list summary::after {
  content: ""; flex: none; width: 10px; height: 10px; margin-right: 6px;
  border-right: 2px solid var(--accent-text); border-bottom: 2px solid var(--accent-text);
  transform: translateY(-3px) rotate(45deg); transition: transform 0.2s ease;
}
.faq-list details[open] summary::after { transform: translateY(2px) rotate(-135deg); }
.faq-list details p { margin: 0; padding: 0 0 var(--s4); color: var(--muted); }

/* ---------- CTA akhir ---------- */
.final-cta { text-align: center; padding: var(--s7, 56px) var(--s4) !important; background: linear-gradient(160deg, var(--surface), var(--surface-2)) !important; }
.final-cta h2 { font-size: 30px; }
.final-cta p { color: var(--muted); max-width: 460px; margin: 0 auto var(--s5); }
.final-cta .btn { min-height: 54px; min-width: 240px; font-size: 17px; }

/* ---------- bar CTA melekat (phone sahaja) ---------- */
.cta-bar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 25; padding: var(--s3) var(--s4) calc(var(--s3) + env(safe-area-inset-bottom));
  background: var(--glass); border-top: 1px solid var(--border); -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px);
  transform: translateY(110%); transition: transform 0.25s ease;
}
.cta-bar.show { transform: none; }
.cta-bar .btn { width: 100%; min-height: 52px; }
@media (min-width: 840px) { .cta-bar { display: none; } }
@media (max-width: 839px) { body.site.has-cta { padding-bottom: 84px; } }
@media (prefers-reduced-motion: reduce) { .cta-bar { transition: none; } }

/* ---------- kaki ---------- */
.site-footer { border-top: 1px solid var(--border); padding: var(--s5) 0; font-size: 14px; color: var(--muted); margin-top: var(--s5); }
.site-footer .inner { display: flex; flex-wrap: wrap; gap: var(--s3) var(--s5); justify-content: space-between; align-items: center; }
.site-footer nav { display: flex; flex-wrap: wrap; gap: var(--s2) var(--s4); }
.site-footer a { text-decoration: none; padding: 10px 0; display: inline-block; }

/* ---------- halaman undang-undang dan offline ---------- */
.legal { max-width: 760px; margin: 0 auto; padding: var(--s6) var(--s4) var(--s7, 56px); }
.legal h1 { font-size: 32px; letter-spacing: -0.01em; }
.legal h2 { font-size: 20px; margin-top: var(--s6); }
.legal li { margin-bottom: var(--s2); }
.legal .updated { color: var(--muted); }
.legal code { background: var(--surface-2); padding: 1px 6px; border-radius: 6px; font-size: 0.92em; }
.offline { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: var(--s5) var(--s4); }
.offline-card { max-width: 420px; text-align: center; }

/* ---------- animasi ketika scroll (site.js setupMotion; hanya bila .motion pada <html>) ---------- */
/* Anak [data-stagger] disembunyikan terus oleh CSS (bukan menunggu atribut daripada JS) supaya tiada kilat semasa dimuat. */
.motion [data-reveal], .motion [data-stagger] > * { opacity: 0; transition: opacity 0.7s ease, transform 0.7s cubic-bezier(0.2, 0.7, 0.2, 1); transition-delay: var(--d, 0ms); }
.motion [data-reveal="up"], .motion [data-stagger="up"] > * { transform: translateY(28px); }
.motion [data-reveal="zoom"], .motion [data-stagger="zoom"] > * { transform: scale(0.94); }
.motion [data-reveal].in, .motion [data-stagger] > .in { opacity: 1; transform: none; }
.motion .hero > div:first-child > * { animation: hero-in 0.8s cubic-bezier(0.2, 0.7, 0.2, 1) both; }
.motion .hero > div:first-child > :nth-child(2) { animation-delay: 0.08s; }
.motion .hero > div:first-child > :nth-child(3) { animation-delay: 0.16s; }
.motion .hero > div:first-child > :nth-child(4) { animation-delay: 0.24s; }
.motion .hero > div:first-child > :nth-child(5) { animation-delay: 0.32s; }
.motion .device-wrap { animation: device-in 0.7s cubic-bezier(0.2, 0.7, 0.2, 1) both; }
.device-wrap { translate: 0 var(--py, 0px); }
@keyframes hero-in { from { opacity: 0; transform: translateY(20px); } }
@keyframes device-in { from { opacity: 0; transform: translateY(40px) rotate(2deg); } }

.brand-mark { width: 28px; height: 28px; flex: none; object-fit: contain; }

/* ---------- Marketplace ---------- */
.market { padding-bottom: var(--s6); }
.market-hero { text-align: center; max-width: 720px; margin: 0 auto; padding: var(--s6) 0 var(--s4); }
.market-hero h1 { font-size: 32px; line-height: 1.15; letter-spacing: -0.02em; margin: 0 0 var(--s3); }
.market-hero .lead { color: var(--muted); font-size: 17px; margin: 0 auto var(--s5); }
.market-search { max-width: 520px; margin: 0 auto var(--s3); display: block; background: var(--surface); color: var(--text); border-color: var(--border); }
.market-chips { justify-content: center; flex-wrap: wrap; }
body.site .chip { background: var(--surface); color: var(--text); border: 1px solid var(--border); }
body.site .chip[aria-pressed="true"] { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
#market-count { text-align: center; margin: var(--s3) 0 var(--s4); }
.market-grid { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--s4); grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
.market-card { min-width: 0; }
.market-link { display: flex; flex-direction: column; height: 100%; text-decoration: none; color: var(--text) !important; background: var(--surface); border: 1px solid var(--border); border-radius: 20px; overflow: hidden; transition: transform 0.2s ease, box-shadow 0.2s ease; }
.market-link:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.market-cover { position: relative; aspect-ratio: 2 / 1; background: linear-gradient(135deg, var(--surface-2), var(--glow-a)); }
.market-cover img { width: 100%; height: 100%; object-fit: cover; display: block; }
.market-flag { position: absolute; top: 10px; left: 10px; padding: 3px 10px; border-radius: 999px; background: var(--accent); color: var(--accent-ink); font-size: 12px; font-weight: 800; }
.market-body { padding: var(--s3) var(--s4) var(--s4); display: grid; gap: var(--s2); }
.market-title { display: flex; align-items: center; gap: var(--s3); margin-top: -36px; }
.market-title h2 { font-size: 18px; margin: 28px 0 0; overflow-wrap: anywhere; }
.market-logo { flex: none; width: 56px; height: 56px; border-radius: 50%; object-fit: cover; background: var(--surface); border: 3px solid var(--surface); box-shadow: 0 2px 8px rgba(15, 23, 42, 0.12); }
.market-logo-ph { display: inline-flex; align-items: center; justify-content: center; font-weight: 800; font-size: 22px; color: var(--accent-text); background: var(--surface-2); }
.market-cat { margin: 2px 0 0; font-size: 13px; font-weight: 600; color: var(--muted); }
.market-desc { margin: 0; color: var(--muted); font-size: 14px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.market-empty { text-align: center; max-width: 480px; margin: 0 auto; }
.market-cta { margin-top: var(--s6); }
@media (min-width: 840px) { .market-hero h1 { font-size: 44px; } }
.market-landing-cta { text-align: center; }
