/* ===== Tema ===== */
:root {
  --bg: #0b0d17;
  --bg-alt: #10131f;
  --surface: #151a2b;
  --surface-2: #1c2238;
  --border: #262d47;
  --text: #e8ebf7;
  --muted: #8d94b3;
  --primary: #7c5cff;
  --primary-2: #22d3ee;
  --success: #34d399;
  --shadow: 0 20px 60px rgba(0, 0, 0, 0.45);
  --radius: 18px;
  --nav-h: 72px;
}

[data-theme="light"] {
  --bg: #f6f7fb;
  --bg-alt: #eef0f8;
  --surface: #ffffff;
  --surface-2: #f1f3fa;
  --border: #dde1ef;
  --text: #141831;
  --muted: #5d6485;
  --shadow: 0 20px 50px rgba(30, 40, 90, 0.12);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; scroll-padding-top: var(--nav-h); }

body {
  font-family: "Inter", system-ui, -apple-system, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  transition: background 0.3s, color 0.3s;
  overflow-x: hidden;
}

a { color: inherit; text-decoration: none; }
button { font: inherit; cursor: pointer; border: none; background: none; color: inherit; }

.container { width: 100%; max-width: 1180px; margin: 0 auto; padding: 0 20px; }
.narrow { max-width: 820px; }
.accent { color: var(--primary); }

.gradient-text {
  background: linear-gradient(90deg, var(--primary), var(--primary-2));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

/* ===== Tombol ===== */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 10px 18px; border-radius: 12px; font-weight: 600; font-size: 0.95rem;
  transition: transform 0.15s, box-shadow 0.2s, background 0.2s, border-color 0.2s;
  white-space: nowrap;
}
.btn:active { transform: scale(0.97); }
.btn-lg { padding: 14px 24px; font-size: 1rem; }
.btn-block { width: 100%; }
.btn-primary {
  background: linear-gradient(135deg, var(--primary), #5b3df5);
  color: #fff;
  box-shadow: 0 8px 24px rgba(124, 92, 255, 0.35);
}
.btn-primary:hover { box-shadow: 0 10px 30px rgba(124, 92, 255, 0.55); }
.btn-primary.connected { background: var(--surface-2); color: var(--success); box-shadow: none; border: 1px solid var(--border); }
.btn-outline { border: 1px solid var(--border); background: var(--surface); }
.btn-outline:hover { border-color: var(--primary); }
.btn-ghost { border: 1px solid var(--border); background: transparent; padding: 9px 14px; }
.btn-ghost:hover { background: var(--surface); }
.btn-light { background: #fff; color: #1a1340; }

/* ===== Navbar ===== */
.navbar {
  position: fixed; inset: 0 0 auto 0; height: var(--nav-h); z-index: 50;
  background: color-mix(in srgb, var(--bg) 75%, transparent);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid transparent;
  transition: border-color 0.3s;
}
.navbar.scrolled { border-bottom-color: var(--border); }
.nav-inner { height: 100%; display: flex; align-items: center; justify-content: space-between; gap: 20px; }

.logo { display: inline-flex; align-items: center; gap: 10px; font-weight: 800; font-size: 1.2rem; }
.logo-mark {
  width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center;
  background: linear-gradient(135deg, var(--primary), var(--primary-2)); color: #fff;
}

.nav-links { display: flex; gap: 28px; }
.nav-links a { color: var(--muted); font-weight: 500; transition: color 0.2s; }
.nav-links a:hover { color: var(--text); }

.nav-actions { display: flex; align-items: center; gap: 10px; }

.hamburger { display: none; width: 42px; height: 42px; border-radius: 10px; border: 1px solid var(--border); position: relative; }
.hamburger span {
  position: absolute; left: 11px; right: 11px; height: 2px; background: var(--text); border-radius: 2px;
  transition: transform 0.25s, opacity 0.2s;
}
.hamburger span:nth-child(1) { top: 14px; }
.hamburger span:nth-child(2) { top: 20px; }
.hamburger span:nth-child(3) { top: 26px; }
.hamburger.open span:nth-child(1) { transform: translateY(6px) rotate(45deg); }
.hamburger.open span:nth-child(2) { opacity: 0; }
.hamburger.open span:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }

/* ===== Hero ===== */
.hero { position: relative; padding: calc(var(--nav-h) + 70px) 0 90px; overflow: hidden; }
.hero-glow {
  position: absolute; width: 900px; height: 900px; top: -350px; right: -250px; pointer-events: none;
  background: radial-gradient(circle, rgba(124, 92, 255, 0.28), transparent 60%);
}
.hero-glow::after {
  content: ""; position: absolute; width: 600px; height: 600px; left: -500px; top: 500px;
  background: radial-gradient(circle, rgba(34, 211, 238, 0.14), transparent 60%);
}
.hero-inner { position: relative; display: grid; grid-template-columns: 1.1fr 0.9fr; gap: 56px; align-items: center; }

.badge {
  display: inline-block; padding: 6px 14px; border-radius: 999px; font-size: 0.85rem; font-weight: 600;
  background: rgba(52, 211, 153, 0.12); color: var(--success); border: 1px solid rgba(52, 211, 153, 0.3);
}
.hero h1 { font-size: clamp(2.2rem, 5vw, 3.6rem); line-height: 1.1; letter-spacing: -0.02em; margin: 20px 0; }
.lead { color: var(--muted); font-size: 1.1rem; max-width: 560px; }
.hero-cta { display: flex; flex-wrap: wrap; gap: 12px; margin: 32px 0 44px; }

.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.stat { padding-left: 14px; border-left: 2px solid var(--border); }
.stat-value { display: block; font-size: 1.6rem; font-weight: 800; }
.stat span { color: var(--muted); font-size: 0.85rem; }

/* ===== Swap card ===== */
.swap-card {
  background: var(--surface); border: 1px solid var(--border); border-radius: 24px;
  padding: 20px; box-shadow: var(--shadow); position: relative;
}
.swap-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 14px; }
.swap-head h2 { font-size: 1.2rem; }
.swap-meta { display: flex; gap: 8px; align-items: center; }
.chip { font-size: 0.8rem; padding: 5px 10px; border-radius: 999px; background: var(--surface-2); color: var(--muted); }
.icon-btn { width: 32px; height: 32px; border-radius: 8px; color: var(--muted); }
.icon-btn:hover { background: var(--surface-2); color: var(--text); }

.token-box { background: var(--surface-2); border: 1px solid transparent; border-radius: 16px; padding: 14px 16px; transition: border-color 0.2s; }
.token-box:focus-within { border-color: var(--primary); }
.token-row { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.token-row label, .balance, .token-row.sub { font-size: 0.85rem; color: var(--muted); }
.token-row input {
  flex: 1; min-width: 0; background: none; border: none; outline: none; color: var(--text);
  font: inherit; font-size: 1.9rem; font-weight: 600; padding: 6px 0;
}
.token-select {
  display: inline-flex; align-items: center; gap: 8px; padding: 6px 12px 6px 6px; border-radius: 999px;
  background: var(--surface); border: 1px solid var(--border); font-weight: 700; flex-shrink: 0;
}
.token-icon { width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; font-size: 0.85rem; color: #fff; }
.token-icon.eth { background: #627eea; }
.token-icon.usdc { background: #2775ca; }

.flip-btn {
  display: grid; place-items: center; width: 42px; height: 42px; margin: -12px auto; position: relative; z-index: 2;
  background: var(--surface); border: 4px solid var(--surface); border-radius: 12px; font-size: 1.2rem;
  box-shadow: 0 0 0 1px var(--border); transition: transform 0.3s, color 0.2s;
}
.flip-btn:hover { color: var(--primary); }
.flip-btn.spin { transform: rotate(180deg); }

.swap-details { margin: 16px 4px; display: grid; gap: 8px; font-size: 0.88rem; }
.swap-details div { display: flex; justify-content: space-between; }
.swap-details span:first-child { color: var(--muted); }
.swap-note { text-align: center; font-size: 0.78rem; color: var(--muted); margin-top: 12px; }

/* ===== Sections ===== */
.section { padding: 100px 0; }
.section-alt { background: var(--bg-alt); }
.section-head { text-align: center; max-width: 640px; margin: 0 auto 56px; }
.section-head h2, .security-copy h2 { font-size: clamp(1.8rem, 3.5vw, 2.6rem); line-height: 1.2; letter-spacing: -0.01em; margin: 10px 0 14px; }
.section-head p, .security-copy p { color: var(--muted); }
.eyebrow { color: var(--primary); font-weight: 700; font-size: 0.85rem; text-transform: uppercase; letter-spacing: 0.12em; }

.grid.features { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 28px;
  transition: transform 0.25s, border-color 0.25s;
}
.card:hover { transform: translateY(-4px); border-color: var(--primary); }
.card-icon {
  width: 48px; height: 48px; border-radius: 12px; display: grid; place-items: center; font-size: 1.4rem;
  background: rgba(124, 92, 255, 0.14); color: var(--primary); margin-bottom: 18px;
}
.card h3 { margin-bottom: 8px; font-size: 1.15rem; }
.card p { color: var(--muted); font-size: 0.95rem; }

/* ===== Keamanan ===== */
.security { display: grid; grid-template-columns: 1fr 1fr; gap: 60px; align-items: center; }
.checklist { list-style: none; margin-top: 26px; display: grid; gap: 12px; }
.checklist li { padding-left: 34px; position: relative; }
.checklist li::before {
  content: "✓"; position: absolute; left: 0; top: 1px; width: 22px; height: 22px; border-radius: 50%;
  display: grid; place-items: center; font-size: 0.75rem; font-weight: 800;
  background: rgba(52, 211, 153, 0.15); color: var(--success);
}
.security-visual { display: flex; flex-direction: column; align-items: center; gap: 36px; }
.vault { position: relative; width: 260px; height: 260px; display: grid; place-items: center; }
.vault-ring { position: absolute; border-radius: 50%; border: 1px dashed var(--border); animation: rotate 30s linear infinite; }
.vault-ring.r1 { inset: 0; border-color: rgba(124, 92, 255, 0.5); }
.vault-ring.r2 { inset: 32px; border-color: rgba(34, 211, 238, 0.45); animation-direction: reverse; animation-duration: 22s; }
.vault-ring.r3 { inset: 64px; border-style: solid; border-color: var(--border); }
.vault-core {
  width: 96px; height: 96px; border-radius: 28px; display: grid; place-items: center; font-size: 2.4rem;
  background: linear-gradient(135deg, var(--primary), var(--primary-2)); box-shadow: 0 16px 50px rgba(124, 92, 255, 0.5);
}
@keyframes rotate { to { transform: rotate(360deg); } }

.flow { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; justify-content: center; font-size: 0.82rem; }
.flow span { padding: 6px 12px; border-radius: 999px; background: var(--surface); border: 1px solid var(--border); }
.flow i { width: 24px; height: 2px; background: linear-gradient(90deg, var(--primary), var(--primary-2)); }

/* ===== FAQ ===== */
.faq { display: grid; gap: 12px; }
.faq details { background: var(--surface); border: 1px solid var(--border); border-radius: 14px; padding: 0 22px; transition: border-color 0.2s; }
.faq details[open] { border-color: var(--primary); }
.faq summary {
  list-style: none; cursor: pointer; padding: 20px 0; font-weight: 600;
  display: flex; justify-content: space-between; align-items: center; gap: 16px;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; font-size: 1.4rem; color: var(--primary); transition: transform 0.25s; }
.faq details[open] summary::after { transform: rotate(45deg); }
.faq details p { color: var(--muted); padding-bottom: 20px; }

/* ===== CTA ===== */
.cta-banner {
  text-align: center; padding: 64px 24px; border-radius: 28px; color: #fff;
  background: linear-gradient(135deg, #5b3df5, var(--primary) 50%, #0ea5c6);
  box-shadow: 0 24px 70px rgba(124, 92, 255, 0.35);
}
.cta-banner h2 { font-size: clamp(1.6rem, 3.5vw, 2.4rem); margin-bottom: 10px; }
.cta-banner p { opacity: 0.85; margin-bottom: 28px; }

/* ===== Footer ===== */
.footer { border-top: 1px solid var(--border); padding-top: 60px; }
.footer-grid { display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: 32px; }
.footer-brand p { color: var(--muted); margin-top: 14px; max-width: 300px; font-size: 0.92rem; }
.footer h4 { font-size: 0.95rem; margin-bottom: 14px; }
.footer-grid > div:not(.footer-brand) a { display: block; color: var(--muted); font-size: 0.92rem; margin-bottom: 10px; }
.footer-grid a:hover { color: var(--text); }
.footer-bottom {
  display: flex; justify-content: space-between; flex-wrap: wrap; gap: 10px;
  margin-top: 48px; padding-top: 24px; padding-bottom: 28px; border-top: 1px solid var(--border);
  color: var(--muted); font-size: 0.85rem;
}

/* ===== Toast ===== */
.toast {
  position: fixed; left: 50%; bottom: 24px; transform: translate(-50%, 120px); z-index: 100;
  background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow);
  padding: 12px 20px; border-radius: 12px; font-size: 0.92rem; transition: transform 0.3s;
  max-width: calc(100% - 32px);
}
.toast.show { transform: translate(-50%, 0); }

/* ===== Reveal ===== */
.reveal { opacity: 0; transform: translateY(24px); transition: opacity 0.6s, transform 0.6s; }
.reveal.visible { opacity: 1; transform: none; }

/* ===== Responsif ===== */
@media (max-width: 980px) {
  .hero-inner, .security { grid-template-columns: 1fr; }
  .swap-card { max-width: 480px; width: 100%; margin: 0 auto; }
  .grid.features { grid-template-columns: repeat(2, 1fr); }
  .stats { grid-template-columns: repeat(2, 1fr); gap: 20px; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .footer-brand { grid-column: 1 / -1; }
}

@media (max-width: 760px) {
  .hamburger { display: block; }
  .nav-links {
    position: fixed; top: var(--nav-h); left: 0; right: 0;
    flex-direction: column; gap: 0; padding: 8px 16px 16px;
    background: var(--bg); border-bottom: 1px solid var(--border);
    transform: translateY(-120%); opacity: 0; pointer-events: none;
    transition: transform 0.3s, opacity 0.3s;
  }
  .nav-links.open { transform: none; opacity: 1; pointer-events: auto; }
  .nav-links a { padding: 14px 4px; border-bottom: 1px solid var(--border); }
  .nav-links a:last-child { border-bottom: none; }
  .nav-actions .btn-connect, .theme-label { display: none; }
  .container { padding: 0 16px; }
  .hero { padding-top: calc(var(--nav-h) + 40px); }
  .section { padding: 72px 0; }
  .grid.features { grid-template-columns: 1fr; }
  .vault { width: 200px; height: 200px; }
}

@media (max-width: 420px) {
  .token-row input { font-size: 1.5rem; }
  .hero-cta .btn { flex: 1; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  html { scroll-behavior: auto; }
}
