/* ══════════════════════════════════════════════
   BASE.CSS — shared tokens, resets, typography
   ══════════════════════════════════════════════ */

@import url('https://fonts.googleapis.com/css2?family=DM+Sans:ital,opsz,wght@0,9..40,300;0,9..40,400;0,9..40,500;0,9..40,600;1,9..40,300&family=DM+Mono:wght@400;500&display=swap');

/* ── Design tokens ── */
:root {
  /* Brand */
  --brand-name:         "ROYALTI";          /* ← change your brand name here */

  /* Palette */
  --bg-base:            #0d0f14;
  --bg-surface:         #13161e;
  --bg-surface-2:       #181c26;
  --bg-raised:          #1e2330;
  --bg-raised-2:        #242a38;
  --border:             rgba(255,255,255,0.07);
  --border-strong:      rgba(255,255,255,0.12);

  /* Accent */
  --accent:             #5b6af0;
  --accent-light:       #7c89f5;
  --accent-dim:         rgba(91,106,240,0.15);
  --accent-glow:        rgba(91,106,240,0.35);

  /* Semantic colours (cards) */
  --teal:               #10b8a8;
  --teal-dim:           rgba(16,184,168,0.15);
  --sky:                #38bdf8;
  --sky-dim:            rgba(56,189,248,0.12);
  --violet:             #a78bfa;
  --violet-dim:         rgba(167,139,250,0.12);
  --emerald:            #34d399;
  --emerald-dim:        rgba(52,211,153,0.12);

  /* Text */
  --text-primary:       #f0f2f8;
  --text-secondary:     #8a8fa8;
  --text-muted:         #555d72;
  --text-link:          #7c89f5;

  /* Status */
  --green:              #22c55e;
  --red:                #f43f5e;
  --amber:              #f59e0b;

  /* Sizing */
  --sidebar-w:          220px;
  --sidebar-icon-w:     52px;
  --header-h:           56px;
  --radius:             10px;
  --radius-sm:          6px;
  --radius-lg:          14px;

  /* Shadows */
  --shadow-sm:          0 1px 3px rgba(0,0,0,0.4);
  --shadow:             0 4px 16px rgba(0,0,0,0.5);
  --shadow-lg:          0 8px 32px rgba(0,0,0,0.6);

  /* Font */
  --font-body:          'DM Sans', system-ui, sans-serif;
  --font-mono:          'DM Mono', monospace;
}

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

html { font-size: 14px; -webkit-font-smoothing: antialiased; }

body {
  font-family: var(--font-body);
  background: var(--bg-base);
  color: var(--text-primary);
  line-height: 1.5;
  min-height: 100vh;
}

/* ── Typography ── */
h1, h2, h3, h4, h5, h6 { font-weight: 500; line-height: 1.2; }

/* ── Links ── */
a { color: var(--text-link); text-decoration: none; }
a:hover { color: var(--accent-light); }

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

/* ── Selection ── */
::selection { background: var(--accent-dim); color: var(--text-primary); }

/* ── Grain overlay (subtle texture on body) ── */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='1'/%3E%3C/svg%3E");
  opacity: 0.025;
  pointer-events: none;
  z-index: 9999;
}

/* ── Utility ── */
.text-right   { text-align: right; }
.text-center  { text-align: center; }
.text-muted   { color: var(--text-secondary); }
.text-green   { color: var(--green); }
.text-red     { color: var(--red); }
.mono         { font-family: var(--font-mono); font-size: 0.9em; }

/* ── Buttons ── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 10px 22px;
  border-radius: var(--radius-sm);
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  border: none;
  transition: all 0.18s ease;
  letter-spacing: 0.01em;
}

.btn-primary {
  background: var(--accent);
  color: #fff;
}
.btn-primary:hover {
  background: var(--accent-light);
  box-shadow: 0 0 20px var(--accent-glow);
  color: #fff;
  text-decoration: none;
}

.btn-ghost {
  background: var(--bg-raised);
  color: var(--text-secondary);
  border: 1px solid var(--border-strong);
}
.btn-ghost:hover {
  background: var(--bg-raised-2);
  color: var(--text-primary);
  text-decoration: none;
}

/* ── Input base ── */
.input {
  width: 100%;
  padding: 11px 14px;
  background: var(--bg-raised);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-family: var(--font-body);
  font-size: 13px;
  outline: none;
  transition: all 0.18s;
}
.input::placeholder { color: var(--text-muted); }
.input:hover { background: var(--bg-raised-2); border-color: rgba(255,255,255,0.18); }
.input:focus { background: var(--bg-raised-2); border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-dim); }

/* ── Badge ── */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.03em;
}
.badge-green { background: rgba(34,197,94,0.12); color: var(--green); }
.badge-accent { background: var(--accent-dim); color: var(--accent-light); }
.badge-muted  { background: var(--bg-raised); color: var(--text-secondary); border: 1px solid var(--border); }

/* ── Panel / Card base ── */
.card {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.card-header {
  padding: 14px 18px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.card-title {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-secondary);
}

.card-body { padding: 18px; }

/* ── Divider ── */
.divider {
  height: 1px;
  background: var(--border);
  margin: 16px 0;
}

/* ── Fade-in animation ── */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}

.fade-up { animation: fadeUp 0.4s ease both; }
.fade-up-1 { animation-delay: 0.05s; }
.fade-up-2 { animation-delay: 0.10s; }
.fade-up-3 { animation-delay: 0.15s; }
.fade-up-4 { animation-delay: 0.20s; }
.fade-up-5 { animation-delay: 0.25s; }
