/* =====================================================================
   BASE — reset, atmosfer halaman, tipografi, utilitas
   ===================================================================== */

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

* { margin: 0; }

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--nav-h) + 20px);
}

body {
  background: var(--bg-0);
  color: var(--ink-body);
  font-family: var(--font-sans);
  font-size: var(--text-base);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  min-height: 100vh;
  min-height: 100dvh;
  /* ruang untuk tab bar mobile + tombol WA tengah yang menonjol */
  padding-bottom: calc(var(--tabbar-h) + 30px + env(safe-area-inset-bottom, 0px));
}
@media (min-width: 1024px) {
  body { padding-bottom: 0; }
}

/* ---------- Atmosfer: aurora navy + grain halus ---------- */
.atmosphere {
  position: fixed;
  inset: 0;
  z-index: -2;
  pointer-events: none;
  background:
    radial-gradient(ellipse 60% 42% at 18% -8%,  oklch(48% 0.16 262 / .34), transparent 68%),
    radial-gradient(ellipse 52% 38% at 88% 4%,   oklch(60% 0.12 225 / .2),  transparent 66%),
    radial-gradient(ellipse 70% 50% at 50% 112%, oklch(42% 0.15 280 / .22), transparent 70%),
    var(--bg-0);
}
.atmosphere::after {
  /* grain — mencegah banding gradasi, menambah tekstur "material" */
  content: "";
  position: absolute;
  inset: 0;
  opacity: .05;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2'/%3E%3C/filter%3E%3Crect width='140' height='140' filter='url(%23n)' opacity='1'/%3E%3C/svg%3E");
}

/* ---------- Tipografi ---------- */
h1, h2, h3, h4 {
  color: var(--ink);
  line-height: 1.15;
  letter-spacing: -0.022em;
  font-weight: 800;
  text-wrap: balance;
}
h1 { font-size: var(--text-hero); }
h2 { font-size: var(--text-3xl); }
h3 { font-size: var(--text-xl); }
h4 { font-size: var(--text-lg); }

p { max-width: 68ch; text-wrap: pretty; }

a {
  color: var(--blue-bright);
  text-decoration: none;
  transition: color var(--dur-fast) var(--ease-out);
}
a:hover { color: var(--cyan); }

strong { color: var(--ink); font-weight: 700; }

img { max-width: 100%; display: block; }

button {
  font: inherit;
  color: inherit;
  background: none;
  border: 0;
  cursor: pointer;
}

::selection { background: oklch(64% 0.165 257 / .4); color: var(--ink); }

:focus-visible {
  outline: 2px solid var(--blue-bright);
  outline-offset: 3px;
  border-radius: var(--rad-xs);
}

@media (min-width: 1024px) {
  ::-webkit-scrollbar { width: 10px; }
  ::-webkit-scrollbar-thumb {
    background: oklch(50% 0.04 256 / .5);
    border-radius: 99px;
    border: 2px solid var(--bg-0);
  }
  ::-webkit-scrollbar-track { background: var(--bg-0); }
}

/* ---------- Layout dasar ---------- */
.container {
  width: 100%;
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: var(--pad);
}

.section { padding-block: clamp(3.2rem, 8vw, 5.5rem); }
.section-tight { padding-block: clamp(2rem, 5vw, 3.2rem); }

.section-head { margin-bottom: clamp(1.6rem, 4vw, 2.6rem); }
.section-head p {
  margin-top: .55rem;
  color: var(--ink-muted);
  font-size: var(--text-base);
}
.section-head .row-between { display: flex; align-items: flex-end; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }

/* ---------- Utilitas ---------- */
.mono { font-family: var(--font-mono); }
.muted { color: var(--ink-muted); }

.skip-link {
  position: absolute;
  left: 1rem;
  top: -100px;
  z-index: var(--z-toast);
  background: var(--blue);
  color: #fff;
  padding: .6rem 1.1rem;
  border-radius: var(--rad-full);
  transition: top var(--dur-base) var(--ease-out);
}
.skip-link:focus { top: 1rem; color: #fff; }

/* ---------- Panel kaca dasar ---------- */
.glass {
  background: var(--glass);
  -webkit-backdrop-filter: var(--blur);
  backdrop-filter: var(--blur);
  border: 1px solid var(--glass-line);
  box-shadow: inset 0 1px 0 var(--glass-hi), var(--shadow-1);
  border-radius: var(--rad-lg);
}
/* Fallback tanpa dukungan backdrop-filter: panel jadi solid */
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .glass { background: var(--bg-1); }
}

/* ---------- Reveal on scroll ----------
   Konten SELALU terlihat secara default. JS menambah .reveal tepat
   sebelum mengamati; tanpa JS tidak ada yang tersembunyi. */
.reveal {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity .65s var(--ease-out), transform .65s var(--ease-out);
}
.reveal.in { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .reveal { opacity: 1; transform: none; transition: none; }
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
