/* Design tokens, reset, typography, keyframes. */

:root {
  --font: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
  --radius-sm: 8px;
  --radius: 12px;
  --radius-lg: 18px;
  --radius-xl: 24px;
  --ease: cubic-bezier(0.2, 0.8, 0.2, 1);
  --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
  --sidebar-w: 248px;
  --sidebar-w-collapsed: 74px;
  --bottom-bar-h: 64px;

  /* dark (default) */
  --bg: #0a0c11;
  --surface: #11141b;
  --surface-2: #161a23;
  --surface-3: #1e2430;
  --border: rgba(255, 255, 255, 0.07);
  --border-strong: rgba(255, 255, 255, 0.14);
  --text: #e9ecf3;
  --text-2: #aab1c3;
  --text-3: #7b8398;
  --accent: #7b93ff;
  --accent-2: #38d6c0;
  --accent-ink: #0a0c11;
  --ok: #3ecf8e;
  --warn: #f6b73c;
  --danger: #ff6477;
  --shadow: 0 18px 50px rgba(0, 0, 0, 0.5);
  --glass: rgba(17, 20, 27, 0.78);
  --code-bg: #0d1017;
  --glow-a: rgba(123, 147, 255, 0.16);
  --glow-b: rgba(56, 214, 192, 0.1);
}

:root[data-theme="light"] {
  --bg: #f3f5fa;
  --surface: #ffffff;
  --surface-2: #f7f8fc;
  --surface-3: #eceff6;
  --border: rgba(20, 28, 50, 0.08);
  --border-strong: rgba(20, 28, 50, 0.16);
  --text: #161b2b;
  --text-2: #4b5470;
  --text-3: #7a839c;
  --accent: #4f6bff;
  --accent-2: #0fb5a0;
  --accent-ink: #ffffff;
  --ok: #12a66a;
  --warn: #cf8205;
  --danger: #e5384f;
  --shadow: 0 18px 44px rgba(30, 40, 80, 0.14);
  --glass: rgba(255, 255, 255, 0.82);
  --code-bg: #f0f2f8;
  --glow-a: rgba(79, 107, 255, 0.12);
  --glow-b: rgba(15, 181, 160, 0.08);
}

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

html,
body {
  height: 100%;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 15px/1.55 var(--font);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow: hidden;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(900px 500px at 8% -10%, var(--glow-a), transparent 60%),
    radial-gradient(700px 480px at 100% 0%, var(--glow-b), transparent 55%);
  pointer-events: none;
}

#app {
  height: 100%;
}

[hidden] {
  display: none !important;
}

h1,
h2,
h3,
p {
  margin: 0;
}

h1 {
  font-size: 1.65rem;
  line-height: 1.2;
  letter-spacing: -0.02em;
}

h2 {
  font-size: 1.02rem;
  letter-spacing: -0.01em;
}

a {
  color: inherit;
  text-decoration: none;
}

button,
input,
select,
textarea {
  font: inherit;
  color: inherit;
}

button {
  cursor: pointer;
}

button:disabled {
  cursor: not-allowed;
}

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

::selection {
  background: color-mix(in srgb, var(--accent) 35%, transparent);
}

* {
  scrollbar-width: thin;
  scrollbar-color: var(--border-strong) transparent;
}

.muted {
  color: var(--text-2);
}

.small {
  font-size: 0.85rem;
}

.mono {
  font-family: var(--mono);
}

.pad {
  padding: 12px;
}

.icon {
  flex: none;
  display: block;
}

/* ------------------------------------------------------------ keyframes */

@keyframes fade-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes fade-up {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: none; }
}

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

@keyframes slide-in-right {
  from { opacity: 0; transform: translateX(16px); }
  to { opacity: 1; transform: none; }
}

@keyframes pulse {
  0% { box-shadow: 0 0 0 0 color-mix(in srgb, currentColor 55%, transparent); }
  70% { box-shadow: 0 0 0 7px transparent; }
  100% { box-shadow: 0 0 0 0 transparent; }
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

@keyframes shimmer {
  from { background-position: 200% 0; }
  to { background-position: -200% 0; }
}

@keyframes shake {
  10%, 90% { transform: translateX(-1px); }
  20%, 80% { transform: translateX(3px); }
  30%, 50%, 70% { transform: translateX(-5px); }
  40%, 60% { transform: translateX(5px); }
}

@keyframes bounce-dot {
  0%, 80%, 100% { transform: translateY(0); opacity: 0.45; }
  40% { transform: translateY(-4px); opacity: 1; }
}

@keyframes float-orb {
  0%, 100% { transform: translate3d(0, 0, 0) scale(1); }
  50% { transform: translate3d(30px, -24px, 0) scale(1.08); }
}

@keyframes flash-bg {
  0% { background: color-mix(in srgb, var(--accent) 22%, var(--surface)); }
  100% { background: var(--surface); }
}

@keyframes badge-pop {
  0% { transform: scale(0.6); }
  60% { transform: scale(1.25); }
  100% { transform: scale(1); }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
}
