/*
 * Landing Page Formain — statis, tanpa build.
 *
 * Aturan UI Formain berlaku (DOMAIN_DAN_DEPLOY §B.0):
 *   - PREF-008: tidak ada properti `max-width`; wadah = `width: 100%` + selokan `clamp()`,
 *     kartu/teks = `width: min(X, 100%)`, gambar = `width: 100%; height: auto`.
 *   - PREF-009: prosa rata kiri-kanan lewat `.prose` (kembali rata kiri di bawah 480px);
 *     judul rata kiri; tidak ada teks lebih dari satu baris yang dipusatkan.
 *   - PREF-010: setiap tombol berikon.
 */

:root {
  --bg: #f5f7fb;
  --surface: #ffffff;
  --surface-alt: #eaf0f8;
  --text: #13233a;
  --muted: #4a5a70;
  --border: #d7dfea;
  --primary: #1f4ed8;
  --on-primary: #ffffff;
  --teal: #0f8f86;
  --tint: #e3ecff;
  --shadow: 0 1px 2px rgb(15 35 60 / 0.06), 0 8px 24px rgb(15 35 60 / 0.06);
  --gutter: clamp(1rem, 5vw, 4rem);
  --radius: 14px;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0e141c;
    --surface: #161e29;
    --surface-alt: #121a24;
    --text: #e6edf6;
    --muted: #a3b1c4;
    --border: #273344;
    --primary: #6f9bff;
    --on-primary: #0b1422;
    --teal: #4fd1c5;
    --tint: #1d2a44;
    --shadow: 0 1px 2px rgb(0 0 0 / 0.3), 0 8px 24px rgb(0 0 0 / 0.25);
    color-scheme: dark;
  }
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family:
    "Segoe UI", system-ui, -apple-system, Roboto, "Helvetica Neue", Arial, sans-serif;
  line-height: 1.6;
}

img {
  display: block;
  width: 100%;
  height: auto;
}

a {
  color: var(--primary);
}

h1,
h2,
h3 {
  margin: 0;
  line-height: 1.2;
  text-align: left;
}

.prose {
  margin: 0;
  text-align: justify;
  hyphens: auto;
}

.sprite {
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
}

.icon {
  flex: none;
  width: 1.15em;
  height: 1.15em;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.icon--up {
  transform: rotate(-90deg);
}

/* ── Bilah atas ─────────────────────────────────────────────────────────── */
.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  width: 100%;
  padding: 0.75rem var(--gutter);
  background: color-mix(in srgb, var(--surface) 88%, transparent);
  border-bottom: 1px solid var(--border);
  backdrop-filter: blur(8px);
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  color: var(--text);
  text-decoration: none;
}

.brand__logo {
  width: 40px;
  border-radius: 10px;
  background: #ffffff;
}

.brand__name {
  font-size: 1.2rem;
  font-weight: 700;
}

.topbar__nav {
  display: flex;
  gap: clamp(0.75rem, 2vw, 1.75rem);
  flex-wrap: wrap;
}

.topbar__nav a {
  color: var(--muted);
  font-weight: 600;
  text-decoration: none;
}

.topbar__nav a:hover {
  color: var(--primary);
}

/* ── Hero ───────────────────────────────────────────────────────────────── */
.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr);
  align-items: center;
  gap: clamp(1.5rem, 5vw, 4rem);
  width: 100%;
  padding: clamp(2.5rem, 7vw, 6rem) var(--gutter) clamp(2rem, 5vw, 4rem);
}

.eyebrow {
  margin: 0 0 0.5rem;
  color: var(--teal);
  font-size: 0.85rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.hero__title {
  font-size: clamp(1.9rem, 4.2vw, 3.2rem);
  letter-spacing: -0.01em;
}

.hero__lead {
  width: min(40rem, 100%);
  margin-top: 1.25rem;
  color: var(--muted);
  font-size: 1.1rem;
}

.hero__art {
  justify-self: center;
  width: min(22rem, 100%);
  padding: 1.25rem;
  border-radius: 28px;
  background: #ffffff;
  box-shadow: var(--shadow);
}

/* ── Tombol ─────────────────────────────────────────────────────────────── */
.actions {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin-top: 1.75rem;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.7rem 1.15rem;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface);
  color: var(--text);
  font-weight: 600;
  text-decoration: none;
  transition:
    transform 0.15s ease,
    box-shadow 0.15s ease;
}

.btn:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow);
}

.btn--primary {
  border-color: var(--primary);
  background: var(--primary);
  color: var(--on-primary);
}

/* ── Angka ──────────────────────────────────────────────────────────────── */
.stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1px;
  width: 100%;
  border-block: 1px solid var(--border);
  background: var(--border);
}

.stat {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  padding: 1.5rem var(--gutter);
  background: var(--surface);
}

.stat strong {
  color: var(--primary);
  font-size: clamp(1.6rem, 3vw, 2.2rem);
  line-height: 1.1;
}

.stat span {
  color: var(--muted);
  font-size: 0.95rem;
}

/* ── Bagian ─────────────────────────────────────────────────────────────── */
.section {
  width: 100%;
  padding: clamp(3rem, 7vw, 5.5rem) var(--gutter);
}

.section--alt {
  background: var(--surface-alt);
}

.section__head {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  width: min(46rem, 100%);
  margin-bottom: 2.25rem;
}

.section__head h2,
.case__text h2 {
  font-size: clamp(1.5rem, 3vw, 2.1rem);
}

.section__head .prose {
  color: var(--muted);
}

.grid {
  display: grid;
  gap: 1.25rem;
}

.grid--3 {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.grid--2 {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.card {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  padding: clamp(1.25rem, 2.5vw, 1.75rem);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.card h3 {
  font-size: 1.2rem;
}

.card .prose {
  color: var(--muted);
}

.card__icon {
  display: inline-grid;
  place-items: center;
  width: 2.75rem;
  height: 2.75rem;
  border-radius: 12px;
  background: var(--tint);
  color: var(--primary);
  font-size: 1.25rem;
}

.checklist {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  margin: 0;
  padding: 0;
  list-style: none;
  color: var(--muted);
}

.checklist li {
  display: flex;
  align-items: flex-start;
  gap: 0.6rem;
}

.checklist .icon {
  margin-top: 0.2em;
  color: var(--teal);
}

/* ── Studi kasus ────────────────────────────────────────────────────────── */
.case {
  display: grid;
  grid-template-columns: minmax(0, 12rem) minmax(0, 1fr);
  align-items: center;
  gap: clamp(1.5rem, 4vw, 3rem);
  padding: clamp(1.5rem, 4vw, 2.5rem);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.case__logo {
  padding: 1rem;
  border-radius: var(--radius);
  background: #ffffff;
}

.case__text {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.case__text .prose {
  color: var(--muted);
}

.case__text .actions {
  margin-top: 0.5rem;
}

/* ── Kaki ───────────────────────────────────────────────────────────────── */
.footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  width: 100%;
  padding: 1.5rem var(--gutter);
  border-top: 1px solid var(--border);
  color: var(--muted);
  font-size: 0.9rem;
}

.footer p {
  margin: 0;
}

/* ── Kembali ke atas (mengambang) ───────────────────────────────────────── */
.to-top {
  position: fixed;
  right: var(--gutter);
  bottom: clamp(1rem, 4vw, 2rem);
  z-index: 20;
  display: inline-grid;
  place-items: center;
  width: 3rem;
  height: 3rem;
  border-radius: 50%;
  background: var(--primary);
  color: var(--on-primary);
  font-size: 1.2rem;
  box-shadow: var(--shadow);
  transition:
    opacity 0.2s ease,
    transform 0.2s ease,
    visibility 0.2s;
}

.to-top:hover {
  transform: translateY(-2px);
}

.to-top:focus-visible {
  outline: 3px solid var(--teal);
  outline-offset: 3px;
}

/* Tanpa skrip tombolnya selalu tampil; dengan skrip ia tersembunyi sampai halaman digulir. */
.js .to-top:not(.to-top--tampil) {
  visibility: hidden;
  opacity: 0;
  transform: translateY(0.75rem);
  pointer-events: none;
}

/* ── Responsif ──────────────────────────────────────────────────────────── */
@media (max-width: 900px) {
  .hero {
    grid-template-columns: minmax(0, 1fr);
  }

  .hero__art {
    grid-row: 1;
    justify-self: start;
    width: min(9rem, 100%);
    padding: 0.75rem;
    border-radius: 20px;
  }

  .grid--3 {
    grid-template-columns: minmax(0, 1fr);
  }

  .stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 720px) {
  /* Pemutus baris judul hanya berguna di layar lebar; di potret ia memenggal "satu backend". */
  .hero__title br {
    display: none;
  }

  .grid--2 {
    grid-template-columns: minmax(0, 1fr);
  }

  .case {
    grid-template-columns: minmax(0, 1fr);
  }

  .case__logo {
    width: min(8rem, 100%);
  }
}

/* PREF-009: di potret sempit, prosa kembali rata kiri dan tombol ditumpuk selebar penuh. */
@media (max-width: 480px) {
  .prose {
    text-align: left;
    hyphens: manual;
  }

  .actions {
    flex-direction: column;
    align-items: stretch;
  }

  .btn {
    justify-content: center;
  }

  .topbar__nav {
    width: 100%;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  .btn,
  .to-top {
    transition: none;
  }
}
