:root {
  --brand-cyan: #06b6d4;
  --brand-violet: #8b5cf6;
  --brand-pink: #ec4899;
  --ink: #1e293b;
  --muted: #64748b;
  --muted-2: #94a3b8;
  --border: #e2e8f0;
  --bg: #f7f8fc;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  background: var(--bg);
  color: var(--ink);
  font-family: Inter, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  position: relative;
  min-height: 100%;
}
.font-display {
  font-family: "Space Grotesk", Inter, -apple-system, "Segoe UI", sans-serif;
}
a { color: inherit; text-decoration: none; }
[x-cloak], [data-cloak] { display: none !important; }

/* ---------- layout ---------- */
.container { max-width: 72rem; margin: 0 auto; padding: 0 1.5rem; }
.container-narrow { max-width: 42rem; margin: 0 auto; padding: 0 1.5rem; }
.flex { display: flex; }
.flex-1 { flex: 1; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-2 { gap: 0.5rem; }
.gap-3 { gap: 0.75rem; }
.gap-4 { gap: 1rem; }
.grid { display: grid; gap: 1rem; }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-cards { grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
.stack > * + * { margin-top: 1rem; }
.text-center { text-align: center; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---------- background blobs ---------- */
.bg-blobs { position: fixed; inset: 0; z-index: 0; overflow: hidden; pointer-events: none; }
.blob { position: absolute; border-radius: 9999px; filter: blur(70px); opacity: 0.35; animation: float 18s ease-in-out infinite; }
.blob-1 { width: 32rem; height: 32rem; top: -10rem; left: -8rem; background: radial-gradient(circle at 30% 30%, var(--brand-cyan), transparent 70%); }
.blob-2 { width: 28rem; height: 28rem; top: 10rem; right: -10rem; background: radial-gradient(circle at 70% 30%, var(--brand-violet), transparent 70%); animation-delay: -6s; }
.blob-3 { width: 26rem; height: 26rem; bottom: -12rem; left: 20%; background: radial-gradient(circle at 50% 50%, var(--brand-pink), transparent 70%); animation-delay: -12s; }
@keyframes float {
  0%, 100% { transform: translate(0, 0) scale(1); }
  33% { transform: translate(2rem, -3rem) scale(1.08); }
  66% { transform: translate(-3rem, 2rem) scale(0.95); }
}

/* ---------- nav ---------- */
.navbar { position: relative; z-index: 10; padding: 1.25rem 0; }
.navbar .container { display: flex; align-items: center; justify-content: space-between; }
.logo { font-family: "Space Grotesk", sans-serif; font-size: 1.25rem; font-weight: 700; }
.nav-links { display: flex; gap: 1.5rem; font-size: 0.9rem; font-weight: 500; color: var(--muted); }
.nav-links a:hover { color: var(--brand-violet); }

main.content { position: relative; z-index: 10; padding: 0.5rem 0 4rem; }

/* ---------- glass / gradient ---------- */
.glass { background: rgba(255,255,255,0.65); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px); border: 1px solid rgba(255,255,255,0.6); box-shadow: 0 8px 32px rgba(31,38,135,0.08); border-radius: 1rem; }
.gradient-text { background: linear-gradient(90deg, var(--brand-cyan), var(--brand-violet), var(--brand-pink)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.gradient-border { position: relative; }
.gradient-border::before {
  content: ""; position: absolute; inset: -1px; border-radius: inherit; padding: 1px;
  background: linear-gradient(120deg, var(--brand-cyan), var(--brand-violet), var(--brand-pink));
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor; mask-composite: exclude; opacity: 0.6; transition: opacity 0.3s ease; pointer-events: none;
}
.gradient-border:hover::before { opacity: 1; }

/* ---------- typography ---------- */
h1, h2, h3 { font-family: "Space Grotesk", sans-serif; margin: 0; }
.h1 { font-size: 2.5rem; font-weight: 700; letter-spacing: -0.02em; }
.h2 { font-size: 1.5rem; font-weight: 700; }
.h3 { font-size: 1.125rem; font-weight: 600; }
.text-muted { color: var(--muted); }
.text-muted-2 { color: var(--muted-2); }
.text-sm { font-size: 0.875rem; }
.text-xs { font-size: 0.75rem; }
p { margin: 0; }

/* ---------- forms ---------- */
.field { margin-bottom: 1.5rem; }
.field:last-child { margin-bottom: 0; }
.label { display: block; font-size: 0.875rem; font-weight: 500; color: var(--muted); margin-bottom: 0.5rem; }
.input {
  width: 100%; border: 1px solid var(--border); background: rgba(255,255,255,0.85);
  border-radius: 0.75rem; padding: 0.85rem 1rem; font-size: 1rem; font-family: inherit; color: var(--ink);
  transition: border-color 0.2s, box-shadow 0.2s;
}
.input:focus { outline: none; border-color: var(--brand-violet); box-shadow: 0 0 0 3px rgba(139,92,246,0.15); }
.input-sm { padding: 0.6rem 0.9rem; font-size: 0.875rem; }
.checkbox-row { display: flex; align-items: center; gap: 0.5rem; font-size: 0.875rem; color: var(--muted); cursor: pointer; }

.pill-group { display: grid; grid-template-columns: 1fr 1fr; gap: 0.5rem; }
.pill-input { position: absolute; opacity: 0; width: 0; height: 0; }
.pill-label {
  display: block; text-align: center; border: 1px solid var(--border); border-radius: 0.75rem;
  padding: 0.85rem 1rem; font-size: 0.875rem; cursor: pointer; transition: all 0.15s;
}
.pill-input:checked + .pill-label {
  border-color: var(--brand-violet); background: rgba(139,92,246,0.08); color: var(--brand-violet); font-weight: 500;
}
.pill-input.accent-cyan:checked + .pill-label {
  border-color: var(--brand-cyan); background: rgba(6,182,212,0.08); color: var(--brand-cyan);
}

.mode-group { display: grid; grid-template-columns: 1fr 1fr; gap: 0.75rem; }
.mode-card {
  display: block; border: 1px solid var(--border); border-radius: 1rem; padding: 1.1rem 1.25rem;
  cursor: pointer; transition: all 0.15s;
}
.mode-card-title { display: block; font-weight: 600; font-size: 0.95rem; margin-bottom: 0.35rem; }
.mode-card-desc { display: block; font-size: 0.78rem; color: var(--muted); line-height: 1.4; }
.pill-input:checked + .mode-card {
  border-color: var(--brand-violet); background: rgba(139,92,246,0.07);
  box-shadow: 0 0 0 3px rgba(139,92,246,0.12);
}
.pill-input:checked + .mode-card .mode-card-title { color: var(--brand-violet); }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; border: none; border-radius: 0.75rem;
  font-family: inherit; font-size: 0.95rem; font-weight: 500; padding: 0.9rem 1.5rem; cursor: pointer;
  text-align: center; transition: transform 0.15s ease, box-shadow 0.3s ease;
}
.btn-block { width: 100%; }
.btn-gradient {
  color: #fff; background: linear-gradient(90deg, var(--brand-cyan), var(--brand-violet));
  background-size: 200% 100%; box-shadow: 0 4px 20px rgba(139,92,246,0.25);
}
.btn-gradient:hover { background-position: 100% 0; transform: translateY(-1px); box-shadow: 0 8px 28px rgba(139,92,246,0.4); }
.btn-gradient:active { transform: translateY(0); }
.btn-outline { background: transparent; border: 1px solid var(--border); color: var(--muted); }
.btn-outline:hover { background: rgba(255,255,255,0.6); }
.btn-outline-danger { background: transparent; border: 1px solid #fecaca; color: #ef4444; padding: 0.5rem 0.9rem; font-size: 0.8rem; }
.btn-outline-danger:hover { background: #fef2f2; }
.btn-sm { padding: 0.5rem 0.9rem; font-size: 0.8rem; }

/* ---------- cards ---------- */
.card { padding: 1.25rem; }
.card-pad-lg { padding: 2rem; }
.site-card { display: block; transition: transform 0.15s ease; }
.site-card:hover { transform: translateY(-2px); }

/* ---------- badges / status dots ---------- */
.badge { display: inline-flex; align-items: center; gap: 0.4rem; font-size: 0.75rem; font-weight: 500; padding: 0.25rem 0.6rem; border-radius: 9999px; }
.badge-success { background: #ecfdf5; color: #10b981; }
.badge-failed { background: #fef2f2; color: #ef4444; }
.badge-running { background: #ecfeff; color: var(--brand-cyan); }
.badge-pending { background: #f1f5f9; color: #64748b; }
.dot { width: 0.4rem; height: 0.4rem; border-radius: 9999px; display: inline-block; }
.dot-success { background: #34d399; }
.dot-failed { background: #f87171; }
.dot-running { background: var(--brand-cyan); }
.dot-pending { background: #cbd5e1; }

/* ---------- skeleton ---------- */
.skeleton { position: relative; overflow: hidden; background: linear-gradient(90deg, #e9ecf5 25%, #f4f5fa 37%, #e9ecf5 63%); background-size: 400% 100%; animation: shimmer 1.6s ease-in-out infinite; border-radius: 0.5rem; height: 1rem; }
@keyframes shimmer { 0% { background-position: 100% 0; } 100% { background-position: -100% 0; } }
.skeleton-w-80 { width: 80%; }
.skeleton-w-60 { width: 60%; }
.skeleton-w-40 { width: 40%; }

/* ---------- progress ---------- */
.progress-track { background: rgba(148,163,184,0.2); border-radius: 9999px; overflow: hidden; height: 0.75rem; }
.progress-fill { height: 100%; background: linear-gradient(90deg, var(--brand-cyan), var(--brand-violet), var(--brand-pink)); background-size: 200% 100%; animation: progress-flow 2.5s linear infinite; transition: width 0.4s ease; border-radius: 9999px; }
.progress-fill.is-error { background: #f87171; animation: none; }
@keyframes progress-flow { 0% { background-position: 0% 0; } 100% { background-position: 200% 0; } }

/* ---------- tabs ---------- */
.tabs { display: grid; grid-template-columns: repeat(4, 1fr); gap: 0.5rem; max-width: 30rem; margin-bottom: 1rem; }
.tab-btn { border: none; background: transparent; border-radius: 0.5rem; padding: 0.5rem; font-size: 0.875rem; color: var(--muted); cursor: pointer; font-family: inherit; }
.tab-btn.active { background: rgba(139,92,246,0.1); color: var(--brand-violet); font-weight: 500; }
.tab-panel { display: none; }
.tab-panel.active { display: block; }

/* ---------- log panel ---------- */
.log-panel { background: rgba(15,23,42,0.95); border-radius: 0.75rem; padding: 1rem; height: 14rem; overflow-y: auto; font-family: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 0.75rem; color: #6ee7b7; }
.log-line { white-space: pre-wrap; word-break: break-all; }
.log-line + .log-line { margin-top: 0.15rem; }
.log-line--page { color: #67e8f9; }
.log-line--css { color: #c4b5fd; }
.log-line--js { color: #fcd34d; }
.log-line--img { color: #6ee7b7; }
.log-line--font { color: #f9a8d4; }
.log-line--video { color: #93c5fd; }
.log-line--other { color: #cbd5e1; }
.log-line--warn { color: #fb923c; }
.log-line--error { color: #f87171; }
.log-line--success { color: #4ade80; font-weight: 600; }
.log-line--info { color: #94a3b8; }

.log-legend { display: none; flex-wrap: wrap; gap: 0.75rem; color: var(--muted-2); margin-bottom: -0.5rem; }
.legend-item { display: inline-flex; align-items: center; gap: 0.3rem; }
.legend-dot { width: 0.5rem; height: 0.5rem; border-radius: 9999px; display: inline-block; }
.legend-page { background: #22d3ee; }
.legend-css { background: #a78bfa; }
.legend-js { background: #fbbf24; }
.legend-img { background: #34d399; }
.legend-font { background: #f472b6; }
.legend-warn { background: #fb923c; }

/* ---------- entrance animations ---------- */
@keyframes fade-in-up { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: translateY(0); } }
.animate-in { animation: fade-in-up 0.5s cubic-bezier(0.16,1,0.3,1) both; }
@keyframes pulse-dot { 0%, 100% { opacity: 1; transform: scale(1); } 50% { opacity: 0.4; transform: scale(0.7); } }
.pulse-dot { animation: pulse-dot 1.2s ease-in-out infinite; }

::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: linear-gradient(var(--brand-cyan), var(--brand-violet)); border-radius: 9999px; }

@media (max-width: 640px) {
  .grid-2 { grid-template-columns: 1fr; }
  .tabs { grid-template-columns: repeat(2, 1fr); }
  .h1 { font-size: 2rem; }
}
