/* =========================================================
   uglymorph — base theme
   black, liquid glass, no deps
   ========================================================= */

:root {
  /* OLED palette — pure black is the main bg, so off-pixels consume no energy.
     Layered surfaces use tiny amounts of white over black for cards/panels. */
  --bg-0: #000000;
  --bg-1: #0a0a0a;
  --bg-2: #111111;

  --ink-0: #ffffff;
  --ink-1: rgba(255, 255, 255, 0.90);
  --ink-2: rgba(255, 255, 255, 0.65);
  --ink-3: rgba(255, 255, 255, 0.42);
  --ink-4: rgba(255, 255, 255, 0.20);

  --line: rgba(255, 255, 255, 0.08);
  --line-strong: rgba(255, 255, 255, 0.18);

  --glass: rgba(255, 255, 255, 0.04);
  --glass-hi: rgba(255, 255, 255, 0.07);
  --glass-lo: rgba(255, 255, 255, 0.025);

  --accent: #ffffff;
  --accent-dim: rgba(255, 255, 255, 0.7);

  --ok: #4ade80;
  --warn: #fbbf24;
  --err: #f87171;
  --info: #60a5fa;

  --radius-sm: 10px;
  --radius: 14px;
  --radius-lg: 20px;
  --radius-xl: 28px;

  --shadow-1: 0 1px 0 rgba(255,255,255,0.04) inset, 0 10px 30px rgba(0,0,0,0.5);
  --shadow-2: 0 1px 0 rgba(255,255,255,0.06) inset, 0 20px 60px rgba(0,0,0,0.7);

  --blur: 22px;

  --t-fast: 140ms cubic-bezier(.2,.7,.3,1);
  --t-med:  260ms cubic-bezier(.2,.7,.3,1);
  --t-slow: 480ms cubic-bezier(.2,.7,.3,1);

  /* system font stack — no Google Fonts dependency so the page renders even
     when fonts.googleapis.com is blocked or slow. Inter / SF / Segoe are
     commonly available and visually close to the original. */
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', 'SF Pro Display', 'SF Pro Text', Roboto, 'Helvetica Neue', Arial, sans-serif;
  --font-mono: 'JetBrains Mono', 'SF Mono', ui-monospace, SFMono-Regular, Menlo, Consolas, 'Courier New', monospace;
}

* { box-sizing: border-box; }
html, body { height: 100%; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font-sans);
  color: var(--ink-1);
  background: var(--bg-0);
  font-feature-settings: 'ss01', 'cv11';
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  letter-spacing: -0.005em;
  overflow-x: hidden;
}

/* no aurora / gradients — true OLED black */
body::before { content: none; }
body::after  { content: none; }

/* glass primitives */
.glass {
  background: var(--glass);
  border: 1px solid var(--line);
  backdrop-filter: blur(var(--blur)) saturate(140%);
  -webkit-backdrop-filter: blur(var(--blur)) saturate(140%);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-1);
}
.glass-hi {
  background: var(--glass-hi);
  border: 1px solid var(--line-strong);
  backdrop-filter: blur(var(--blur)) saturate(160%);
  -webkit-backdrop-filter: blur(var(--blur)) saturate(160%);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-2);
}
.glass-lo {
  background: var(--glass-lo);
  border: 1px solid var(--line);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-radius: var(--radius);
}

/* typography */
h1, h2, h3, h4 { margin: 0; font-weight: 600; letter-spacing: -0.02em; color: var(--ink-0); }
h1 { font-size: clamp(2.2rem, 5vw, 3.4rem); line-height: 1.05; }
h2 { font-size: 1.25rem; line-height: 1.2; }
h3 { font-size: 1rem; line-height: 1.3; }
p  { margin: 0; color: var(--ink-2); }
small { color: var(--ink-3); }
code, .mono { font-family: var(--font-mono); font-size: 0.92em; }

/* layout */
.container {
  width: 100%;
  max-width: 1180px;
  margin: 0 auto;
  padding: 0 24px;
}
.row { display: flex; align-items: center; gap: 12px; }
.col { display: flex; flex-direction: column; gap: 12px; }
.spacer { flex: 1; }

/* buttons */
.btn {
  appearance: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 38px;
  padding: 0 16px;
  border-radius: 999px;
  background: var(--glass);
  border: 1px solid var(--line);
  color: var(--ink-1);
  cursor: pointer;
  transition: background var(--t-fast), border-color var(--t-fast), transform var(--t-fast), color var(--t-fast);
  user-select: none;
  white-space: nowrap;
}
.btn:hover { background: var(--glass-hi); border-color: var(--line-strong); color: var(--ink-0); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: 0.45; cursor: not-allowed; }
.btn-primary {
  background: linear-gradient(180deg, #ffffff 0%, #d6d6e0 100%);
  color: #0a0a10;
  border-color: rgba(255,255,255,0.4);
}
.btn-primary:hover { background: linear-gradient(180deg, #ffffff 0%, #e8e8f0 100%); color: #0a0a10; }
.btn-ghost { background: transparent; border-color: var(--line); }
.btn-danger { color: var(--err); }
.btn-danger:hover { background: rgba(248,113,113,0.10); border-color: rgba(248,113,113,0.3); color: var(--err); }
.btn-sm { height: 30px; padding: 0 12px; font-size: 0.85rem; }
.btn-icon { width: 38px; padding: 0; }
.btn-block { width: 100%; }

/* inputs */
.input, .textarea, .select {
  width: 100%;
  height: 42px;
  padding: 0 14px;
  background: var(--glass-lo);
  border: 1px solid var(--line);
  border-radius: 12px;
  color: var(--ink-1);
  outline: none;
  transition: border-color var(--t-fast), background var(--t-fast);
}
.textarea { height: auto; padding: 12px 14px; resize: vertical; min-height: 96px; }
.input:focus, .textarea:focus, .select:focus {
  border-color: var(--line-strong);
  background: var(--glass);
}
.input::placeholder, .textarea::placeholder { color: var(--ink-3); }

/* chips / badges */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 0.75rem;
  background: var(--glass);
  border: 1px solid var(--line);
  color: var(--ink-2);
}
.badge .dot { width: 7px; height: 7px; border-radius: 999px; background: var(--ink-3); }
.badge.ok .dot { background: var(--ok); box-shadow: 0 0 8px rgba(74,222,128,0.6); }
.badge.warn .dot { background: var(--warn); box-shadow: 0 0 8px rgba(251,191,36,0.6); }
.badge.err .dot { background: var(--err); box-shadow: 0 0 8px rgba(248,113,113,0.6); }

/* dividers */
hr {
  border: 0;
  border-top: 1px solid var(--line);
  margin: 16px 0;
}

/* scrollbar */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--glass-hi); border-radius: 999px; border: 2px solid transparent; background-clip: padding-box; }
::-webkit-scrollbar-thumb:hover { background: var(--line-strong); background-clip: padding-box; border: 2px solid transparent; }

/* selection */
::selection { background: rgba(255,255,255,0.18); color: var(--ink-0); }

/* toast */
.toast-wrap {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  gap: 10px;
  z-index: 100;
  pointer-events: none;
}
.toast {
  pointer-events: auto;
  padding: 12px 16px;
  border-radius: 14px;
  background: rgba(20,20,28,0.85);
  border: 1px solid var(--line-strong);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  color: var(--ink-1);
  font-size: 0.92rem;
  box-shadow: var(--shadow-2);
  animation: toast-in var(--t-med) both;
}
.toast.err { border-color: rgba(248,113,113,0.4); }
.toast.ok  { border-color: rgba(74,222,128,0.4); }
@keyframes toast-in {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* utility */
.hide { display: none !important; }
.muted { color: var(--ink-3); }
.center { display: flex; align-items: center; justify-content: center; }
.pre-wrap { white-space: pre-wrap; }
.mono-block {
  font-family: var(--font-mono);
  font-size: 0.82rem;
  color: var(--ink-2);
  background: rgba(0,0,0,0.35);
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid var(--line);
  white-space: pre-wrap;
  word-break: break-word;
  max-height: 240px;
  overflow: auto;
}
