/* ============================================================
   RafifOS · 10 base
   ============================================================ */

@font-face{
  font-family: "Plus Jakarta Sans";
  src: url("../assets/fonts/PlusJakartaSans.woff2") format("woff2");
  font-weight: 200 800;
  font-style: normal;
  font-display: swap;
}
@font-face{
  font-family: "Inter";
  src: url("../assets/fonts/Inter.woff2") format("woff2");
  font-weight: 300 700;
  font-style: normal;
  font-display: swap;
}

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

html, body{
  margin: 0;
  padding: 0;
  height: 100%;
  overflow: hidden;
  overscroll-behavior: none;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-ui);
  font-size: var(--t-body);
  line-height: var(--lh-body);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  -webkit-tap-highlight-color: transparent;
  -webkit-touch-callout: none;
  user-select: none;
}

body{ position: fixed; inset: 0; }

h1,h2,h3,h4,p,ul,ol{ margin: 0; }
ul,ol{ padding: 0; list-style: none; }
button{ font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
input, textarea{ font: inherit; color: inherit; background: none; border: 0; outline: none; }
img,svg{ display: block; }
::selection{ background: var(--a-40); color: var(--ink); }

/* ---------- lapisan akar ---------- */
#rfs{
  position: fixed;
  inset: 0;
  display: block;
  overflow: hidden;
  background: var(--bg);
}

/* Aurora: dua gradien radial besar yang bergerak sangat lambat.
   Tanpa filter blur, jadi biayanya hampir nol di Mali-G51. */
.aurora{
  position: absolute;
  inset: -20%;
  pointer-events: none;
  z-index: 0;
  contain: strict;
}
.aurora::before,
.aurora::after{
  content: "";
  position: absolute;
  width: 78%;
  height: 78%;
  border-radius: 50%;
  will-change: transform;
}
.aurora::before{
  left: -12%;
  top: -18%;
  background: radial-gradient(circle at 50% 50%, var(--a-24), transparent 62%);
  animation: drift-a 44s var(--ease-inout) infinite alternate;
}
.aurora::after{
  right: -16%;
  bottom: -22%;
  background: radial-gradient(circle at 50% 50%, var(--a-08), transparent 66%);
  animation: drift-b 58s var(--ease-inout) infinite alternate;
}
@keyframes drift-a{
  from{ transform: translate3d(0,0,0) scale(1); }
  to{ transform: translate3d(6%, 5%, 0) scale(1.12); }
}
@keyframes drift-b{
  from{ transform: translate3d(0,0,0) scale(1.06); }
  to{ transform: translate3d(-7%, -4%, 0) scale(1); }
}

/* butiran halus: mencegah gradien terlihat bergaris */
.grain{
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  opacity: var(--noise);
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='120' height='120'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='2'/></filter><rect width='120' height='120' filter='url(%23n)'/></svg>");
  background-size: 180px 180px;
}

/* ---------- utilitas ---------- */
.hidden{ display: none !important; }
.sr{
  position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap;
}
.row{ display: flex; align-items: center; }
.col{ display: flex; flex-direction: column; }
.gap1{ gap: var(--s1); } .gap2{ gap: var(--s2); } .gap3{ gap: var(--s3); }
.gap4{ gap: var(--s4); } .gap6{ gap: var(--s6); }
.grow{ flex: 1 1 auto; min-width: 0; }
.trunc{ overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.micro{
  font-size: var(--t-micro);
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--ink-3);
  font-weight: 600;
}
.muted{ color: var(--ink-3); }
.ink2{ color: var(--ink-2); }

/* ---------- tombol ---------- */
.btn{
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--s2);
  min-height: calc(var(--u) * 11);
  padding: 0 var(--s5);
  border-radius: var(--r-pill);
  background: var(--surface-3);
  color: var(--ink);
  font-size: var(--t-sm);
  font-weight: 600;
  transition: transform var(--d-fast) var(--ease-out), background var(--d-fast) linear;
  will-change: transform;
}
.btn:active{ transform: scale(.965); background: var(--press); }
.btn.primary{ background: var(--a); color: var(--a-ink); }
.btn.ghost{ background: transparent; border: 1px solid var(--line-strong); }
.btn.wide{ width: 100%; }
.btn[disabled]{ opacity: .4; pointer-events: none; }

/* ---------- input ---------- */
.field{
  display: flex;
  align-items: center;
  gap: var(--s3);
  min-height: calc(var(--u) * 13);
  padding: 0 var(--s4);
  border-radius: var(--r-md);
  background: var(--surface-2);
  border: 1px solid var(--line);
  transition: border-color var(--d-fast) linear, background var(--d-fast) linear;
}
.field:focus-within{ border-color: var(--a-40); background: var(--surface); }
.field input{ width: 100%; font-size: var(--t-body); }
.field input::placeholder{ color: var(--ink-4); }

/* ---------- kartu ---------- */
.card{
  border-radius: var(--r-lg);
  background: var(--surface);
  border: 1px solid var(--line);
  padding: var(--s5);
}

/* ---------- scrollbar tipis ---------- */
.scroll{ overflow-y: auto; -webkit-overflow-scrolling: touch; overscroll-behavior: contain; }
.scroll::-webkit-scrollbar{ width: 6px; height: 6px; }
.scroll::-webkit-scrollbar-thumb{ background: var(--line-strong); border-radius: 99px; }
.scroll::-webkit-scrollbar-track{ background: transparent; }

/* ---------- seluruh transisi masuk/keluar standar ---------- */
@keyframes fade-in{ from{ opacity: 0 } to{ opacity: 1 } }
@keyframes fade-out{ from{ opacity: 1 } to{ opacity: 0 } }
@keyframes rise{
  from{ opacity: 0; transform: translate3d(0, 14px, 0) scale(.985); }
  to{ opacity: 1; transform: translate3d(0, 0, 0) scale(1); }
}
@keyframes sink{
  from{ opacity: 1; transform: translate3d(0, 0, 0) scale(1); }
  to{ opacity: 0; transform: translate3d(0, 10px, 0) scale(.985); }
}
@keyframes bloom{
  0%{ transform: scale(.6); opacity: 0; }
  60%{ opacity: .55; }
  100%{ transform: scale(2.4); opacity: 0; }
}

@keyframes fadeIn{ from{ opacity: 0 } to{ opacity: 1 } }

/* range: satu tampilan untuk semua slider (Chromium 92 tidak punya accent-color) */
input[type="range"]{ -webkit-appearance: none; appearance: none; background: transparent; height: 22px; }
input[type="range"]::-webkit-slider-runnable-track{ height: 4px; border-radius: 99px; background: var(--line-strong); }
input[type="range"]::-webkit-slider-thumb{
  -webkit-appearance: none;
  width: 18px; height: 18px; margin-top: -7px;
  border-radius: 50%;
  background: var(--a);
  box-shadow: 0 1px 4px rgba(0,0,0,.35);
}

/* chip: satu bentuk untuk semua tombol kecil */
.chip{
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  height: calc(var(--u) * 8);
  padding: 0 12px;
  border-radius: 99px;
  border: 1px solid var(--line-strong);
  background: var(--surface-2);
  color: var(--ink-2);
  font-size: var(--t-micro);
  font-weight: 650;
  line-height: 1;
  white-space: nowrap;
  transition: background var(--d-fast) linear, color var(--d-fast) linear, transform var(--d-fast) var(--ease-out);
}
.chip:active{ transform: scale(.97); }
.chip svg{ width: 14px; height: 14px; display: block; flex: 0 0 auto; }
.chip.on{ background: var(--a-14); border-color: var(--a-24); color: var(--ink); }
.chip.accent{ background: var(--a); border-color: transparent; color: var(--a-ink); }
.chip.accent svg{ color: var(--a-ink); }
