/* Akademi Game — stylesheet frontend. Tanpa framework/font eksternal.
   Identitas: arcade gelap, aksen neon violet-cyan. GELAP sebagai bawaan,
   terang tersedia lewat tombol tema (kebalikan dari situs showcase terang).
   Kontrak nama kelas sama dengan mesin AppShowcase — jangan diubah namanya. */

/* ----- 1. Token ----------------------------------------------------------- */
:root {
  /* Aksen utama: gradien violet -> cyan. */
  --primary: #7c5cff;
  --primary-hover: #6a46ff;
  --accent: #22d3ee;
  --accent-2: #ff4d9d;

  --bg: #0a0e1a;
  --surface: #121a2e;
  --surface-2: #1a2440;
  --border: #253154;
  --text: #eef2ff;
  --text-2: #98a4cc;
  --star: #ffc53d;

  --radius: 14px;
  --radius-lg: 20px;
  --radius-sm: 9px;
  --maxw: 1240px;

  --primary-soft: rgba(124, 92, 255, .16);
  --accent-soft: rgba(34, 211, 238, .14);
  --shadow: 0 2px 10px rgba(0, 0, 0, .45);
  --shadow-lg: 0 18px 44px rgba(3, 6, 18, .70);
  --glow: 0 0 0 1px rgba(124, 92, 255, .45), 0 10px 32px rgba(124, 92, 255, .28);
  --header-bg: rgba(10, 14, 26, .82);
  --scrim: rgba(10, 14, 26, 0);

  --ok: #34d399;
  --warn: #fbbf24;
  --err: #fb7185;

  --font: "Segoe UI", system-ui, -apple-system, Roboto, "Helvetica Neue", Arial, sans-serif;
  --grad: linear-gradient(115deg, #7c5cff 0%, #22d3ee 100%);
  --grad-soft: linear-gradient(115deg, rgba(124, 92, 255, .20), rgba(34, 211, 238, .14));
}

/* Tema terang: hanya bila sistem minta terang DAN pengguna tidak memaksa gelap. */
@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) {
    --bg: #f6f7fc;
    --surface: #ffffff;
    --surface-2: #eef0fa;
    --border: #d9dcef;
    --text: #141a2e;
    --text-2: #5b6486;
    --primary-soft: rgba(124, 92, 255, .10);
    --accent-soft: rgba(34, 211, 238, .12);
    --shadow: 0 1px 3px rgba(20, 26, 46, .10);
    --shadow-lg: 0 14px 36px rgba(20, 26, 46, .16);
    --glow: 0 0 0 1px rgba(124, 92, 255, .35), 0 10px 26px rgba(124, 92, 255, .18);
    --header-bg: rgba(246, 247, 252, .88);
    --scrim: rgba(246, 247, 252, 0);
    --ok: #0f9d58;
    --warn: #b06000;
    --err: #d93025;
  }
}

:root[data-theme="light"] {
  --bg: #f6f7fc;
  --surface: #ffffff;
  --surface-2: #eef0fa;
  --border: #d9dcef;
  --text: #141a2e;
  --text-2: #5b6486;
  --primary-soft: rgba(124, 92, 255, .10);
  --accent-soft: rgba(34, 211, 238, .12);
  --shadow: 0 1px 3px rgba(20, 26, 46, .10);
  --shadow-lg: 0 14px 36px rgba(20, 26, 46, .16);
  --glow: 0 0 0 1px rgba(124, 92, 255, .35), 0 10px 26px rgba(124, 92, 255, .18);
  --header-bg: rgba(246, 247, 252, .88);
  --scrim: rgba(246, 247, 252, 0);
  --ok: #0f9d58;
  --warn: #b06000;
  --err: #d93025;
}

/* ----- 2. Dasar ----------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scrollbar-color: var(--border) transparent;
}

body {
  margin: 0;
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.65;
  color: var(--text);
  background-color: var(--bg);
  /* Pendar latar; tetap aman kalau gradien tidak didukung karena warna dasar
     sudah di-set lewat background-color di atas. */
  background-image:
    radial-gradient(900px 520px at 12% -8%, rgba(124, 92, 255, .20), transparent 70%),
    radial-gradient(760px 480px at 92% 2%, rgba(34, 211, 238, .14), transparent 72%);
  background-repeat: no-repeat;
  background-attachment: fixed;
  -webkit-font-smoothing: antialiased;
  overflow-wrap: break-word;
}

img, svg, video { max-width: 100%; height: auto; }
img { border-style: none; }

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

h1, h2, h3, h4 {
  margin: 0 0 .5em;
  line-height: 1.22;
  font-weight: 800;
  letter-spacing: -.02em;
}
h1 { font-size: clamp(1.7rem, 4.2vw, 2.6rem); }
h2 { font-size: clamp(1.3rem, 2.6vw, 1.75rem); }
h3 { font-size: 1.1rem; }
p { margin: 0 0 1em; }

:where(a, button, input, select, textarea, [tabindex]):focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 6px;
}

.container {
  width: 100%;
  max-width: var(--maxw);
  margin-inline: auto;
  padding-inline: 18px;
}

.sr-only {
  position: absolute !important;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 200;
  padding: 10px 16px;
  background: var(--primary);
  color: #fff;
  border-radius: 0 0 var(--radius-sm) 0;
  font-weight: 700;
}
.skip-link:focus { left: 0; }

.text-muted { color: var(--text-2); }

.empty {
  padding: 48px 20px;
  text-align: center;
  color: var(--text-2);
  background: var(--surface);
  border: 1px dashed var(--border);
  border-radius: var(--radius-lg);
}

/* ----- 3. Header ---------------------------------------------------------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 60;
  background: var(--header-bg);
  backdrop-filter: saturate(150%) blur(14px);
  -webkit-backdrop-filter: saturate(150%) blur(14px);
  border-bottom: 1px solid var(--border);
}
/* Garis neon tipis di bawah header — penanda identitas situs game. */
.site-header::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: -1px;
  height: 2px;
  background: var(--grad);
  opacity: .85;
}

.site-header__inner {
  display: flex;
  align-items: center;
  gap: 14px;
  min-height: 66px;
  padding-block: 10px;
}

.logo {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  flex: 0 0 auto;
  color: var(--text);
  font-weight: 900;
  letter-spacing: -.025em;
  text-decoration: none;
}
.logo:hover { text-decoration: none; }
.logo img {
  width: 34px; height: 34px;
  border-radius: 10px;
  background: var(--grad);
  padding: 3px;
  box-shadow: 0 0 0 1px var(--border);
}
.logo__text { font-size: 1.12rem; white-space: nowrap; }
.logo--footer { margin-bottom: 12px; }
.logo--footer img { width: 30px; height: 30px; }

.nav {
  display: flex;
  align-items: center;
  gap: 2px;
  margin-inline-start: 8px;
}
.nav__link {
  position: relative;
  padding: 9px 14px;
  border-radius: 999px;
  color: var(--text-2);
  font-size: .95rem;
  font-weight: 700;
  white-space: nowrap;
}
.nav__link:hover {
  color: var(--text);
  background: var(--surface-2);
  text-decoration: none;
}
.nav__link--active {
  color: var(--text);
  background: var(--primary-soft);
  box-shadow: inset 0 0 0 1px rgba(124, 92, 255, .45);
}

.search-form {
  position: relative;
  display: flex;
  align-items: center;
  flex: 1 1 260px;
  min-width: 0;
  max-width: 440px;
  margin-inline-start: auto;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 999px;
  transition: box-shadow .16s, border-color .16s;
}
.search-form:focus-within {
  border-color: transparent;
  box-shadow: var(--glow);
}
.search-form__icon {
  flex: 0 0 auto;
  margin-inline-start: 14px;
  color: var(--text-2);
}
.search-form__input {
  flex: 1 1 auto;
  min-width: 0;
  padding: 11px 10px;
  border: 0;
  background: transparent;
  color: var(--text);
  font: inherit;
  font-size: .95rem;
}
.search-form__input::placeholder { color: var(--text-2); }
.search-form__input:focus { outline: none; }
.search-form__input::-webkit-search-cancel-button { filter: invert(.5); }

.search-form__btn {
  flex: 0 0 auto;
  margin: 4px;
  padding: 8px 18px;
  border: 0;
  border-radius: 999px;
  background: var(--grad);
  color: #0a0e1a;
  font: inherit;
  font-weight: 800;
  cursor: pointer;
  transition: filter .16s;
}
.search-form__btn:hover { filter: brightness(1.12); }

.site-header__actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex: 0 0 auto;
}

.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px; height: 40px;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface);
  color: var(--text-2);
  cursor: pointer;
  transition: color .16s, border-color .16s, background .16s;
}
.icon-btn:hover {
  color: var(--text);
  background: var(--surface-2);
  border-color: var(--primary);
}

/* Matahari tampil di tema terang, bulan di tema gelap. */
.theme-toggle__sun { display: none; }
.theme-toggle__moon { display: block; }
@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) .theme-toggle__sun { display: block; }
  :root:not([data-theme="dark"]) .theme-toggle__moon { display: none; }
}
:root[data-theme="light"] .theme-toggle__sun { display: block; }
:root[data-theme="light"] .theme-toggle__moon { display: none; }
:root[data-theme="dark"] .theme-toggle__sun { display: none; }
:root[data-theme="dark"] .theme-toggle__moon { display: block; }

.nav-toggle { display: none; }

@media (max-width: 900px) {
  .nav {
    position: absolute;
    top: 100%;
    left: 0; right: 0;
    display: none;
    flex-direction: column;
    align-items: stretch;
    gap: 2px;
    margin: 0;
    padding: 10px 18px 16px;
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    box-shadow: var(--shadow-lg);
  }
  .nav--open { display: flex; }
  .nav__link { padding: 12px 14px; border-radius: var(--radius-sm); }
  .nav-toggle { display: inline-flex; }
  .site-header__inner { position: relative; flex-wrap: wrap; }
  .search-form { order: 3; flex-basis: 100%; max-width: none; margin-inline-start: 0; }
}

/* ----- 4. Hero ------------------------------------------------------------ */
.hero {
  position: relative;
  overflow: hidden;
  padding: clamp(40px, 7vw, 76px) 0 clamp(30px, 5vw, 52px);
  border-bottom: 1px solid var(--border);
}
/* Pola grid arcade di belakang hero. */
.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(var(--border) 1px, transparent 1px),
    linear-gradient(90deg, var(--border) 1px, transparent 1px);
  background-size: 54px 54px;
  opacity: .30;
  mask-image: radial-gradient(70% 70% at 50% 30%, #000 30%, transparent 100%);
  -webkit-mask-image: radial-gradient(70% 70% at 50% 30%, #000 30%, transparent 100%);
  pointer-events: none;
}
.hero > .container { position: relative; }

.hero__title {
  max-width: 20ch;
  margin: 0 0 14px;
  font-size: clamp(2rem, 6vw, 3.4rem);
  font-weight: 900;
  letter-spacing: -.035em;
  background: var(--grad);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  /* Cadangan bila background-clip:text tidak didukung. */
  -webkit-text-fill-color: transparent;
}
@supports not ((-webkit-background-clip: text) or (background-clip: text)) {
  .hero__title { color: var(--text); -webkit-text-fill-color: currentColor; }
}

.hero__sub {
  max-width: 62ch;
  margin: 0 0 26px;
  font-size: clamp(1rem, 1.6vw, 1.14rem);
  color: var(--text-2);
}

.hero .search-form {
  max-width: 560px;
  margin-inline-start: 0;
  background: var(--surface);
}

/* ----- 5. Chips ----------------------------------------------------------- */
.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 22px;
}
.chips--scroll {
  flex-wrap: nowrap;
  overflow-x: auto;
  padding-bottom: 6px;
  scrollbar-width: thin;
  -webkit-overflow-scrolling: touch;
}
.chips--scroll::-webkit-scrollbar { height: 6px; }
.chips--scroll::-webkit-scrollbar-thumb { background: var(--border); border-radius: 99px; }

.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex: 0 0 auto;
  padding: 8px 15px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface);
  color: var(--text-2);
  font-size: .9rem;
  font-weight: 700;
  white-space: nowrap;
  transition: color .16s, border-color .16s, background .16s;
}
.chip:hover {
  color: var(--text);
  border-color: var(--primary);
  background: var(--primary-soft);
  text-decoration: none;
}
.chip--active {
  color: #0a0e1a;
  background: var(--grad);
  border-color: transparent;
}
:root[data-theme="light"] .chip--active,
.chip--active { color: #0a0e1a; }

/* ----- 6. Section --------------------------------------------------------- */
.section { padding-block: clamp(30px, 4.6vw, 54px); }

.section__head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 20px;
}
.section__head h2 {
  position: relative;
  margin: 0;
  padding-inline-start: 14px;
}
/* Penanda batang neon di kiri setiap judul bagian. */
.section__head h2::before {
  content: "";
  position: absolute;
  left: 0; top: .18em; bottom: .18em;
  width: 4px;
  border-radius: 4px;
  background: var(--grad);
}
.section__more {
  flex: 0 0 auto;
  color: var(--accent);
  font-size: .94rem;
  font-weight: 800;
  white-space: nowrap;
}

.page-head {
  padding-block: clamp(26px, 4vw, 44px) 6px;
}
.page-head h1 { margin-bottom: .35em; }
.page-head p { max-width: 70ch; color: var(--text-2); }

.content-narrow { max-width: 760px; margin-inline: auto; }

/* ----- 7. Grid & scroller ------------------------------------------------- */
.grid-apps {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(168px, 1fr));
  gap: 14px;
}

.grid-articles {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 18px;
}

.h-scroll {
  display: flex;
  gap: 12px;
  overflow-x: auto;
  padding-bottom: 10px;
  scroll-snap-type: x proximity;
  scrollbar-width: thin;
  -webkit-overflow-scrolling: touch;
}
.h-scroll::-webkit-scrollbar { height: 8px; }
.h-scroll::-webkit-scrollbar-thumb { background: var(--border); border-radius: 99px; }
.h-scroll > * { scroll-snap-align: start; }

/* ----- 8. Kartu aplikasi -------------------------------------------------- */
.app-card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--surface);
  color: var(--text);
  text-decoration: none;
  overflow: hidden;
  transition: transform .18s, box-shadow .18s, border-color .18s;
}
/* Lapisan pendar yang muncul saat hover — ganti shadow biasa. */
.app-card::before {
  content: "";
  position: absolute;
  inset: 0;
  background: var(--grad-soft);
  opacity: 0;
  transition: opacity .18s;
  pointer-events: none;
}
.app-card:hover {
  transform: translateY(-4px);
  border-color: transparent;
  box-shadow: var(--glow);
  text-decoration: none;
}
.app-card:hover::before { opacity: 1; }

.app-card__icon {
  position: relative;
  width: 100%;
  max-width: 104px;
  aspect-ratio: 1 / 1;
  border-radius: 20px;
  background: var(--surface-2);
  object-fit: cover;
  box-shadow: 0 0 0 1px var(--border), 0 8px 18px rgba(0, 0, 0, .28);
}

.app-card__body {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
}

.app-card__name {
  margin: 0;
  font-size: .98rem;
  font-weight: 800;
  line-height: 1.3;
  letter-spacing: -.015em;
  /* Dua baris maksimum. */
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.app-card__meta {
  margin: 0;
  font-size: .82rem;
  color: var(--text-2);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.app-card__rating {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 2px 0 0;
  font-size: .82rem;
  color: var(--text-2);
}
.app-card__downloads { color: var(--text-2); }

/* Varian baris untuk .h-scroll: ikon di kiri, teks di kanan. */
.app-card--row {
  flex: 0 0 auto;
  flex-direction: row;
  align-items: center;
  gap: 13px;
  width: 290px;
  padding: 13px;
}
.app-card--row .app-card__icon {
  width: 72px;
  max-width: 72px;
  flex: 0 0 72px;
  border-radius: 17px;
}
.app-card--row .app-card__name { -webkit-line-clamp: 2; }

.rating-chip {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--surface-2);
  color: var(--text);
  font-size: .78rem;
  font-weight: 800;
  white-space: nowrap;
}
.rating-chip__star { color: var(--star); }

/* ----- 9. Kartu artikel -------------------------------------------------- */
.article-card {
  display: flex;
  flex-direction: column;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--surface);
  color: var(--text);
  text-decoration: none;
  overflow: hidden;
  transition: transform .18s, box-shadow .18s, border-color .18s;
}
.article-card:hover {
  transform: translateY(-4px);
  border-color: transparent;
  box-shadow: var(--glow);
  text-decoration: none;
}

.article-card__img {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  background: var(--surface-2);
  border-bottom: 1px solid var(--border);
}

.article-card__body {
  display: flex;
  flex-direction: column;
  gap: 7px;
  padding: 16px 16px 18px;
}

.article-card__title {
  margin: 0;
  font-size: 1.04rem;
  font-weight: 800;
  line-height: 1.32;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.article-card__excerpt {
  margin: 0;
  font-size: .9rem;
  color: var(--text-2);
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.article-card__date {
  margin-top: 2px;
  font-size: .8rem;
  color: var(--text-2);
  text-transform: uppercase;
  letter-spacing: .06em;
  font-weight: 700;
}

/* ----- 10. Tombol -------------------------------------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  padding: 11px 22px;
  border: 1px solid transparent;
  border-radius: 999px;
  background: var(--surface-2);
  color: var(--text);
  font: inherit;
  font-weight: 800;
  text-decoration: none;
  cursor: pointer;
  transition: transform .14s, filter .16s, background .16s, border-color .16s;
}
.btn:hover { text-decoration: none; transform: translateY(-1px); }

.btn--primary {
  background: var(--grad);
  color: #0a0e1a;
}
.btn--primary:hover { filter: brightness(1.12); }

.btn--ghost {
  background: transparent;
  border-color: var(--border);
  color: var(--text);
}
.btn--ghost:hover { border-color: var(--primary); background: var(--primary-soft); }

.btn--play {
  background: var(--grad);
  color: #0a0e1a;
  padding: 11px 24px;
}
.btn--play:hover { filter: brightness(1.12); }

.btn--play--lg { padding: 14px 28px; font-size: 1.04rem; }

.btn--play__text {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  line-height: 1.15;
  text-align: left;
}
.btn--play__text strong { font-size: 1em; font-weight: 900; }
.btn--play__text small { font-size: .74em; opacity: .78; font-weight: 700; }

/* ----- 11. Halaman aplikasi ---------------------------------------------- */
.app-head {
  display: flex;
  align-items: flex-start;
  gap: clamp(16px, 3vw, 28px);
  padding-block: clamp(22px, 3.6vw, 36px) 20px;
}

.app-head__icon {
  flex: 0 0 auto;
  width: clamp(88px, 15vw, 128px);
  aspect-ratio: 1 / 1;
  border-radius: 26px;
  background: var(--surface-2);
  object-fit: cover;
  box-shadow: 0 0 0 1px var(--border), 0 16px 34px rgba(0, 0, 0, .40);
}

.app-head__info { min-width: 0; flex: 1 1 auto; }

.app-head__title {
  margin: 0 0 6px;
  font-size: clamp(1.5rem, 3.6vw, 2.3rem);
}

.app-head__dev {
  margin: 0 0 14px;
  color: var(--text-2);
  font-weight: 700;
}
.app-head__dev a { color: var(--accent); }

.stats-strip {
  display: flex;
  flex-wrap: wrap;
  align-items: stretch;
  gap: 0;
  margin: 18px 0 0;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  overflow: hidden;
  list-style: none;
}

.stat {
  flex: 1 1 110px;
  min-width: 100px;
  padding: 13px 16px;
  text-align: center;
  border-inline-start: 1px solid var(--border);
}
.stat:first-child { border-inline-start: 0; }

.stat__val {
  display: block;
  font-size: 1.02rem;
  font-weight: 900;
  letter-spacing: -.01em;
}

.stat__label {
  display: block;
  margin-top: 2px;
  font-size: .74rem;
  color: var(--text-2);
  text-transform: uppercase;
  letter-spacing: .07em;
  font-weight: 700;
}

.install-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  margin-top: 20px;
}

.install-note {
  margin: 10px 0 0;
  font-size: .85rem;
  color: var(--text-2);
}

.screenshots {
  display: flex;
  gap: 12px;
  overflow-x: auto;
  padding-bottom: 10px;
  scroll-snap-type: x proximity;
  scrollbar-width: thin;
  -webkit-overflow-scrolling: touch;
}
.screenshots::-webkit-scrollbar { height: 8px; }
.screenshots::-webkit-scrollbar-thumb { background: var(--border); border-radius: 99px; }
.screenshots img {
  flex: 0 0 auto;
  height: clamp(280px, 42vw, 420px);
  width: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface-2);
  object-fit: cover;
  scroll-snap-align: start;
}

.video-embed {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: #000;
  overflow: hidden;
}
.video-embed iframe {
  position: absolute;
  inset: 0;
  width: 100%; height: 100%;
  border: 0;
}

/* ----- 12. Prose (konten HTML dari DB) ----------------------------------- */
.prose { font-size: 1.01rem; line-height: 1.78; }
.prose > :first-child { margin-top: 0; }
.prose > :last-child { margin-bottom: 0; }

.prose h2 {
  margin: 1.9em 0 .6em;
  padding-inline-start: 13px;
  position: relative;
  font-size: clamp(1.2rem, 2.3vw, 1.5rem);
}
.prose h2::before {
  content: "";
  position: absolute;
  left: 0; top: .2em; bottom: .2em;
  width: 4px;
  border-radius: 4px;
  background: var(--grad);
}
.prose h3 { margin: 1.5em 0 .5em; font-size: 1.12rem; }

.prose ul, .prose ol { margin: 0 0 1.1em; padding-inline-start: 1.4em; }
.prose li { margin-bottom: .45em; }
.prose li::marker { color: var(--primary); }

.prose a { color: var(--accent); text-decoration: underline; text-underline-offset: 2px; }

.prose blockquote {
  margin: 1.4em 0;
  padding: 14px 18px;
  border-inline-start: 4px solid var(--primary);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  background: var(--primary-soft);
  color: var(--text);
}
.prose blockquote > :last-child { margin-bottom: 0; }

.prose img {
  border-radius: var(--radius);
  border: 1px solid var(--border);
}

.prose code {
  padding: .14em .42em;
  border-radius: 6px;
  background: var(--surface-2);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: .9em;
}
.prose pre {
  margin: 1.3em 0;
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface-2);
  overflow-x: auto;
}
.prose pre code { padding: 0; background: none; }

.prose table {
  width: 100%;
  margin: 1.3em 0;
  border-collapse: collapse;
  font-size: .95rem;
}
.prose th, .prose td {
  padding: 10px 13px;
  border: 1px solid var(--border);
  text-align: start;
}
.prose th { background: var(--surface-2); font-weight: 800; }

.prose hr { margin: 2em 0; border: 0; border-top: 1px solid var(--border); }

/* Clamp + tombol selengkapnya. */
.prose-clamp {
  position: relative;
  max-height: 440px;
  overflow: hidden;
}
.prose-clamp::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: 0;
  height: 130px;
  background: linear-gradient(to bottom, var(--scrim), var(--bg));
  pointer-events: none;
}
.prose-clamp.expanded { max-height: none; }
.prose-clamp.expanded::after { display: none; }

.read-more {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  margin-top: 14px;
  padding: 9px 20px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface);
  color: var(--text);
  font: inherit;
  font-weight: 800;
  cursor: pointer;
  transition: border-color .16s, background .16s;
}
.read-more:hover { border-color: var(--primary); background: var(--primary-soft); }

/* ----- 13. Glance / info-table / FAQ (blok GEO) -------------------------- */
.glance {
  margin: 0 0 26px;
  padding: 18px 20px;
  border: 1px solid var(--border);
  border-inline-start: 4px solid var(--primary);
  border-radius: var(--radius);
  background: var(--grad-soft);
}
.glance > :last-child { margin-bottom: 0; }
.glance__title {
  margin: 0 0 .5em;
  font-size: .78rem;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: .1em;
  color: var(--text-2);
}

.info-table {
  width: 100%;
  margin: 0 0 26px;
  border-collapse: collapse;
  font-size: .95rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}
.info-table th, .info-table td {
  padding: 11px 15px;
  border-bottom: 1px solid var(--border);
  text-align: start;
  vertical-align: top;
}
.info-table tr:last-child th, .info-table tr:last-child td { border-bottom: 0; }
.info-table th {
  width: 38%;
  background: var(--surface-2);
  font-weight: 800;
  color: var(--text-2);
}

.meta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 18px;
  margin: 0 0 18px;
  font-size: .88rem;
  color: var(--text-2);
}

.faq { margin: 0 0 26px; }
.faq details {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  margin-bottom: 10px;
  overflow: hidden;
}
.faq summary {
  padding: 14px 18px;
  font-weight: 800;
  cursor: pointer;
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: "+";
  flex: 0 0 auto;
  width: 24px; height: 24px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 7px;
  background: var(--primary-soft);
  color: var(--primary);
  font-weight: 900;
  font-size: 1.1rem;
  line-height: 1;
}
.faq details[open] summary::after { content: "–"; }
.faq summary:hover { background: var(--surface-2); }
.faq__answer {
  padding: 0 18px 16px;
  color: var(--text-2);
}
.faq__answer > :last-child { margin-bottom: 0; }

/* ----- 14. Share & CTA ---------------------------------------------------- */
.share-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin: 28px 0 0;
  padding-top: 20px;
  border-top: 1px solid var(--border);
}
.share-row__label {
  margin: 0;
  font-size: .8rem;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: .09em;
  color: var(--text-2);
}

.cta-banner {
  position: relative;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 22px;
  padding: clamp(22px, 4vw, 38px);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--grad-soft);
  overflow: hidden;
}
.cta-banner::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(var(--border) 1px, transparent 1px),
    linear-gradient(90deg, var(--border) 1px, transparent 1px);
  background-size: 44px 44px;
  opacity: .22;
  pointer-events: none;
}
.cta-banner__body { position: relative; flex: 1 1 320px; min-width: 0; }
.cta-banner__body > :last-child { margin-bottom: 0; }
.cta-banner__body p { color: var(--text-2); }
.cta-banner__title { margin: 0 0 .4em; }
.cta-banner .btn { position: relative; flex: 0 0 auto; }

/* ----- 14b. Strip statistik hero & kartu studio -------------------------- */
.hero__stats {
  margin-top: 26px;
  max-width: 620px;
  background: var(--surface);
}

.studio-grid__intro {
  max-width: 68ch;
  margin: -8px 0 18px;
}

.studio-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 14px;
}

.studio-card {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
  padding: 20px 22px 22px;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--surface);
  transition: border-color .18s, box-shadow .18s;
}
.studio-card:hover { border-color: transparent; box-shadow: var(--glow); }

.studio-card__name {
  margin: 0;
  font-size: 1.12rem;
  font-weight: 900;
  letter-spacing: -.02em;
}

.studio-card__meta {
  margin: 0 0 14px;
  font-size: .88rem;
  color: var(--text-2);
}

/* ----- 15. Breadcrumbs --------------------------------------------------- */
.breadcrumbs {
  padding-block: 16px 0;
  font-size: .86rem;
  color: var(--text-2);
}
.breadcrumbs ol {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.breadcrumbs li { display: inline-flex; align-items: center; gap: 6px; }
.breadcrumbs li + li::before {
  content: "/";
  color: var(--border);
  font-weight: 700;
}
.breadcrumbs a { color: var(--text-2); }
.breadcrumbs a:hover { color: var(--accent); }
.breadcrumbs [aria-current="page"] { color: var(--text); font-weight: 700; }

/* ----- 16. Artikel ------------------------------------------------------- */
.article-cover {
  width: 100%;
  margin: 0 0 24px;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--surface-2);
}

/* ----- 17. Pagination --------------------------------------------------- */
.pagination {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 7px;
  margin-top: 34px;
}
.pagination__link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 42px;
  padding: 9px 13px;
  border: 1px solid var(--border);
  border-radius: 11px;
  background: var(--surface);
  color: var(--text);
  font-weight: 800;
  font-size: .92rem;
}
.pagination__link:hover {
  border-color: var(--primary);
  background: var(--primary-soft);
  text-decoration: none;
}
.pagination__link--current {
  background: var(--grad);
  border-color: transparent;
  color: #0a0e1a;
}
.pagination__link--nav { font-weight: 700; }
.pagination__gap { padding: 9px 4px; color: var(--text-2); }

/* ----- 18. Footer -------------------------------------------------------- */
.site-footer {
  margin-top: clamp(40px, 6vw, 72px);
  border-top: 1px solid var(--border);
  background: var(--surface);
  position: relative;
}
.site-footer::before {
  content: "";
  position: absolute;
  left: 0; right: 0; top: -1px;
  height: 2px;
  background: var(--grad);
  opacity: .7;
}

/* CSS melarang repeat(auto-fit, ...) berdampingan dengan track fr — seluruh
   deklarasi akan dibuang browser dan kolom footer menumpuk jadi satu. Karena
   itu jumlah kolomnya ditulis eksplisit. */
.footer-grid {
  display: grid;
  grid-template-columns: 1.7fr 1fr 1fr 1fr;
  gap: 30px;
  padding-block: clamp(32px, 5vw, 52px);
}

@media (max-width: 900px) {
  .footer-grid { grid-template-columns: 1fr 1fr 1fr; }
  .footer-col--about { grid-column: 1 / -1; }
}

.footer-col { min-width: 0; }

.footer-col__text {
  margin: 0 0 16px;
  font-size: .91rem;
  color: var(--text-2);
}

.footer-col__label {
  margin: 0 0 8px;
  font-size: .76rem;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: .09em;
  color: var(--text-2);
}

.footer-col__title {
  margin: 0 0 14px;
  font-size: .82rem;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: .09em;
  color: var(--text);
}

.footer-col__list {
  margin: 0;
  padding: 0;
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 9px;
}
.footer-col__list a {
  color: var(--text-2);
  font-size: .92rem;
}
.footer-col__list a:hover { color: var(--accent); }

.footer-col__ico { margin-inline-end: 2px; }

.social-links { display: flex; flex-wrap: wrap; gap: 8px; }
.social-links__item {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px; height: 38px;
  border: 1px solid var(--border);
  border-radius: 11px;
  background: var(--bg);
  color: var(--text-2);
  transition: color .16s, border-color .16s, background .16s;
}
.social-links__item:hover {
  color: var(--text);
  border-color: var(--primary);
  background: var(--primary-soft);
  text-decoration: none;
}

.site-footer__bottom {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding-block: 18px 26px;
  border-top: 1px solid var(--border);
  font-size: .86rem;
  color: var(--text-2);
}
.site-footer__bottom p { margin: 0; }
.site-footer__credit a { color: var(--accent); font-weight: 700; }

/* ----- 19. Penyesuaian layar kecil -------------------------------------- */
@media (max-width: 640px) {
  .grid-apps { grid-template-columns: repeat(auto-fill, minmax(144px, 1fr)); gap: 11px; }
  .app-card { padding: 11px; border-radius: var(--radius); }
  .app-card--row { width: 248px; }
  .app-head { flex-direction: column; align-items: flex-start; }
  .stat { flex-basis: 50%; border-inline-start: 0; border-top: 1px solid var(--border); }
  .stat:first-child, .stat:nth-child(2) { border-top: 0; }
  .section__head { flex-direction: column; align-items: flex-start; gap: 7px; }
  .footer-grid { grid-template-columns: 1fr 1fr; gap: 24px; }
  .footer-col--about { grid-column: 1 / -1; }
  .install-row .btn { flex: 1 1 100%; }
}

@media (max-width: 380px) {
  .footer-grid { grid-template-columns: 1fr; }
}

/* ----- 20. Aksesibilitas & cetak ---------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }
  .app-card:hover, .article-card:hover, .btn:hover { transform: none; }
}

@media print {
  body { background: #fff; color: #000; }
  .site-header, .site-footer, .search-form, .read-more, .share-row,
  .cta-banner, .h-scroll, .chips { display: none !important; }
  .prose-clamp { max-height: none; overflow: visible; }
  .prose-clamp::after { display: none; }
  a { color: #000; text-decoration: underline; }
}
