/* ── Reset ─────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html {
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: 'Geist', 'Inter', system-ui, sans-serif;
  font-size: var(--t-md);
  line-height: 1.5;
  min-height: 100dvh;
}

/* Mono class — untuk email addresses, tokens, kode */
.mono {
  font-family: 'JetBrains Mono', 'Fira Code', 'Cascadia Code', monospace;
  font-variant-numeric: tabular-nums;
  font-feature-settings: 'tnum' 1, 'liga' 0;
}

/* ── Typography ─────────────────────────────────────── */
h1, h2, h3 {
  font-weight: 600;
  letter-spacing: -0.02em;
  text-wrap: balance;
  color: var(--text);
}

h1 { font-size: var(--t-xl); }
h2 { font-size: var(--t-lg); }
h3 { font-size: var(--t-md); }

p { color: var(--dim); }

/* ── Focus ──────────────────────────────────────────── */
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: var(--r-sm);
}

/* ── Scrollbar ──────────────────────────────────────── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--muted); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--dim); }

/* ── Utilities ──────────────────────────────────────── */
.sr-only {
  position: absolute; width: 1px; height: 1px;
  padding: 0; margin: -1px; overflow: hidden;
  clip: rect(0,0,0,0); white-space: nowrap; border: 0;
}

.truncate { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }

/* ── Toast ──────────────────────────────────────────── */
#toast-container {
  position: fixed;
  bottom: var(--s6);
  right: var(--s6);
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: var(--s2);
  pointer-events: none;
}

.toast {
  background: var(--surface2);
  border: 1px solid var(--muted);
  color: var(--text);
  font-size: var(--t-sm);
  padding: var(--s3) var(--s4);
  border-radius: var(--r-md);
  pointer-events: auto;
  animation: toast-in var(--t-mid) var(--ease-out) forwards;
}

.toast.out { animation: toast-out var(--t-mid) var(--ease-in) forwards; }
.toast.success { border-color: var(--accent); color: var(--accent); }
.toast.error   { border-color: var(--danger); color: var(--danger); }

@keyframes toast-in  { from { opacity:0; transform:translateY(8px); } to { opacity:1; transform:none; } }
@keyframes toast-out { from { opacity:1; } to { opacity:0; transform:translateY(-4px); } }

/* ── Reduced motion ─────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}
