/* Samakamu: halaman utama (launcher), halaman legal, dan 404. */

:root {
  --bg: #ffffff;
  --surface: #ffffff;
  --text: #202124;
  --muted: #5f6368;
  --border: #e3e6e8;
  --hover: #f3f5f5;
  --brand: #0f766e;
  --brand-soft: #e3f3f1;
  --shadow: 0 1px 6px rgb(32 33 36 / 0.12);
  color-scheme: light;
}

/* Tema gelap: ikut setelan perangkat, kecuali pengguna memilih terang lewat tombol tema. */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #121615;
    --surface: #1b2220;
    --text: #e6eeec;
    --muted: #9aaba7;
    --border: #2c3835;
    --hover: #222b29;
    --brand: #2dd4bf;
    --brand-soft: #123532;
    --shadow: 0 1px 6px rgb(0 0 0 / 0.5);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #121615;
  --surface: #1b2220;
  --text: #e6eeec;
  --muted: #9aaba7;
  --border: #2c3835;
  --hover: #222b29;
  --brand: #2dd4bf;
  --brand-soft: #123532;
  --shadow: 0 1px 6px rgb(0 0 0 / 0.5);
  color-scheme: dark;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  -webkit-text-size-adjust: 100%;
}

a { color: inherit; }
button, input { font: inherit; color: inherit; }
[hidden] { display: none !important; }
:focus-visible { outline: 3px solid var(--brand); outline-offset: 2px; }

/* ---------- Kerangka halaman utama ---------- */
.launcher {
  width: min(1000px, 100% - 32px);
  min-height: 100vh;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  padding: env(safe-area-inset-top) 0 env(safe-area-inset-bottom);
}
.launcher main { flex: 1; }

.topbar {
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  font-size: 1.125rem;
  text-decoration: none;
}
.brand img { display: block; border-radius: 8px; }
.top-actions { display: flex; align-items: center; gap: 10px; }

.icon-button {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
}
.icon-button:hover { background: var(--hover); color: var(--text); }

.language-switcher {
  display: flex;
  padding: 3px;
  border: 1px solid var(--border);
  border-radius: 999px;
}
.lang-btn {
  min-width: 40px;
  height: 32px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  font-size: 0.8125rem;
  font-weight: 700;
  cursor: pointer;
}
.lang-btn.active { background: var(--brand-soft); color: var(--text); }

/* ---------- Judul & cari ---------- */
.hero {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 40px 0 8px;
}
.hero-logo { border-radius: 14px; }
.hero h1 {
  margin: 12px 0 0;
  font-size: clamp(2.25rem, 8vw, 3.5rem);
  line-height: 1.05;
  letter-spacing: -0.03em;
}
.tagline { margin: 8px 0 24px; color: var(--muted); font-size: 1.0625rem; }

.search-wrapper {
  position: relative;
  width: min(640px, 100%);
  display: flex;
  align-items: center;
  height: 52px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface);
  box-shadow: var(--shadow);
}
.search-wrapper:focus-within { border-color: var(--brand); }
.search-icon { position: absolute; left: 18px; color: var(--muted); pointer-events: none; }
.search-wrapper input {
  flex: 1;
  min-width: 0;
  height: 100%;
  padding: 0 48px 0 48px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  outline: none;
  font-size: 1rem;
}
.search-wrapper input::-webkit-search-cancel-button { -webkit-appearance: none; }
.clear-search {
  position: absolute;
  right: 8px;
  width: 36px;
  height: 36px;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--muted);
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
  visibility: hidden;
}
.clear-search.visible { visibility: visible; }
.clear-search:hover { background: var(--hover); }

/* ---------- Kisi aplikasi ---------- */
.apps-section { padding: 32px 0 8px; }
.apps-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  max-width: 760px;
  margin: 0 auto;
}
.app-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 14px 6px;
  border-radius: 16px;
  text-align: center;
  text-decoration: none;
  transition: background 0.15s, transform 0.1s;
}
.app-card:hover { background: var(--hover); }
.app-card:active { transform: scale(0.97); }
.app-icon { width: 64px; height: 64px; border-radius: 16px; }
.app-name { font-weight: 600; font-size: 0.9375rem; line-height: 1.25; }
.app-desc { color: var(--muted); font-size: 0.8125rem; line-height: 1.35; }

.no-results { text-align: center; color: var(--muted); padding: 24px 0; }
.no-results p { margin: 4px 0; }
.no-results-title { color: var(--text); font-weight: 600; }

/* ---------- Prinsip & tentang ---------- */
.principles {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  max-width: 760px;
  margin: 24px auto 0;
}
.principle {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 14px 16px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--surface);
  font-size: 0.875rem;
  color: var(--muted);
}
.principle strong { color: var(--text); font-size: 0.9375rem; }
.principle-icon { font-size: 1.25rem; }

.about {
  max-width: 640px;
  margin: 28px auto 0;
  text-align: center;
  color: var(--muted);
  font-size: 0.875rem;
}
.about p { margin: 0 0 6px; }
.about-note { font-size: 0.8125rem; }

.footer {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 4px 8px;
  margin-top: 32px;
  padding: 16px 0 24px;
  border-top: 1px solid var(--border);
  color: var(--muted);
  font-size: 0.8125rem;
}
.footer a { text-decoration: underline; text-underline-offset: 2px; }
.footer a:hover { color: var(--text); }

/* HP: deskripsi app disembunyikan, prinsip ditumpuk. */
@media (max-width: 600px) {
  .hero { padding-top: 20px; }
  .apps-section { padding-top: 24px; }
  .apps-grid { gap: 4px; }
  .app-card { padding: 10px 2px; }
  .app-icon { width: 56px; height: 56px; border-radius: 14px; }
  .app-name { font-size: 0.8125rem; }
  .app-desc { display: none; }
  .principles { grid-template-columns: 1fr; gap: 8px; }
  .principle { flex-direction: row; flex-wrap: wrap; align-items: baseline; column-gap: 8px; padding: 12px 14px; }
  .principle span:last-child { flex-basis: 100%; }
}

/* ---------- Halaman legal (privasi, syarat) & 404 ---------- */
.top {
  width: min(760px, 100% - 32px);
  margin: 0 auto;
  height: 64px;
  display: flex;
  align-items: center;
}
.top .brand img { width: 32px; height: 32px; }
.brand-name { font-weight: 700; }

.doc {
  width: min(760px, 100% - 32px);
  margin: 0 auto;
  padding-bottom: 24px;
}
.doc-lang { display: flex; flex-wrap: wrap; gap: 8px; padding: 4px 0 8px; }
.doc-lang a {
  padding: 6px 14px;
  border: 1px solid var(--border);
  border-radius: 999px;
  font-size: 0.875rem;
  text-decoration: none;
}
.doc-lang a:hover { border-color: var(--brand); }
.doc article { padding: 8px 0 16px; }
.doc article + article { border-top: 1px solid var(--border); margin-top: 24px; }
.doc h1 { font-size: 1.5rem; line-height: 1.25; margin: 16px 0 4px; }
.doc h2 { font-size: 1.0625rem; margin: 24px 0 6px; }
.doc p, .doc li { overflow-wrap: anywhere; }
.doc ul { padding-left: 20px; }
.doc li + li { margin-top: 4px; }
.doc a { color: var(--brand); text-underline-offset: 2px; }
.doc code { font-size: 0.875em; padding: 1px 5px; border-radius: 6px; background: var(--hover); }
.muted { color: var(--muted); margin-top: 0; font-size: 0.875rem; }

body > footer {
  width: min(760px, 100% - 32px);
  margin: 0 auto;
  padding: 16px 0 28px;
  border-top: 1px solid var(--border);
  color: var(--muted);
  font-size: 0.875rem;
}
body > footer a { color: var(--brand); }

.notfound {
  width: min(560px, 100% - 32px);
  margin: 12vh auto 0;
  text-align: center;
}
.notfound h1 { font-size: 1.75rem; margin: 0 0 8px; }
.notfound .lead { color: var(--muted); }
.notfound .actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; margin-top: 20px; }
.button {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0 20px;
  border: 1px solid var(--border);
  border-radius: 999px;
  font-weight: 600;
  text-decoration: none;
}
.button.primary { background: var(--brand); border-color: var(--brand); color: #fff; }
:root[data-theme="dark"] .button.primary { color: #062c28; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .button.primary { color: #062c28; }
}

@media (prefers-reduced-motion: reduce) {
  .app-card { transition: none; }
  .app-card:active { transform: none; }
}
