:root {
  --bg: #0d0524;
  --panel: rgba(27, 0, 75, 0.5);
  --border: rgba(209, 190, 243, 0.14);
  --text: #f4f0fb;
  --muted: #b8a5d6;
  --accent: #954bf6;
  --accent-soft: #d1bef3;
  --ok: #34d399;
  --radius: 16px;
}

html { scroll-behavior: smooth; }

body {
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: Inter, system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
}

::selection { background: var(--accent); color: #fff; }

/* ---------- Background ---------- */
.bg {
  position: fixed;
  inset: 0;
  z-index: -10;
  pointer-events: none;
  overflow: hidden;
  background: radial-gradient(ellipse at top, #2b0077 0%, #140037 55%, #0a001f 100%);
}
.blob {
  position: absolute;
  width: 560px;
  height: 560px;
  border-radius: 50%;
  filter: blur(120px);
  opacity: 0.32;
  background: var(--accent);
  animation: drift 16s ease-in-out infinite alternate;
}
.blob:nth-child(1) { top: -160px; left: -140px; }
.blob:nth-child(2) { bottom: -200px; right: -160px; background: var(--accent-soft); opacity: 0.2; animation-duration: 20s; }
#particles {
  position: fixed;
  inset: 0;
  z-index: -5;
  pointer-events: none;
  opacity: 0.7;
}
@keyframes drift { to { transform: translate(40px, 40px); } }

/* ---------- Surfaces ---------- */
.glass {
  background: var(--panel);
  border: 1px solid var(--border);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  box-shadow: 0 24px 60px -16px rgba(0, 0, 0, 0.55);
}

/* ---------- Status pill ---------- */
.pulse-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--ok);
  box-shadow: 0 0 0 0 rgba(52, 211, 153, 0.6);
  animation: pulse 2s infinite;
}
@keyframes pulse {
  70% { box-shadow: 0 0 0 8px rgba(52, 211, 153, 0); }
  100% { box-shadow: 0 0 0 0 rgba(52, 211, 153, 0); }
}

/* ---------- Script window (the one memorable element) ---------- */
.script-window {
  border-radius: var(--radius);
  overflow: hidden;
  animation: rise 0.8s cubic-bezier(0.2, 0.8, 0.2, 1) both;
}
@keyframes rise {
  from { opacity: 0; transform: translateY(24px); }
  to { opacity: 1; transform: none; }
}
.window-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  background: rgba(0, 0, 0, 0.25);
}
.window-bar i {
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: rgba(209, 190, 243, 0.25);
}
.code {
  padding: 20px;
  background: rgba(8, 0, 24, 0.55);
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-size: 0.875rem;
  line-height: 1.75;
  color: var(--muted);
  white-space: pre-wrap;
  word-break: break-all;
}
.code .fn { color: #c4a1fb; }
.code .str { color: #86efac; }
.code .key { color: #fcd34d; }

/* ---------- Buttons ---------- */
.btn-primary {
  background: linear-gradient(135deg, var(--accent), #b88af8);
  color: #12002e;
  box-shadow: 0 8px 24px -6px rgba(149, 75, 246, 0.6);
}
.btn-primary:hover { box-shadow: 0 12px 32px -6px rgba(149, 75, 246, 0.8); }
.btn-primary[data-copied="true"] {
  background: linear-gradient(135deg, #34d399, #6ee7b7);
  box-shadow: 0 8px 24px -6px rgba(52, 211, 153, 0.55);
}

/* ---------- Focus ---------- */
:focus-visible {
  outline: 2px solid var(--accent-soft);
  outline-offset: 3px;
  border-radius: 8px;
}

/* ---------- Toast ---------- */
.toast {
  position: fixed;
  right: 16px;
  bottom: 16px;
  padding: 12px 18px;
  border-radius: 12px;
  background: #0f2a22;
  border: 1px solid rgba(52, 211, 153, 0.4);
  color: #a7f3d0;
  font-size: 0.875rem;
  font-weight: 500;
  box-shadow: 0 16px 40px -10px rgba(0, 0, 0, 0.6);
  transform: translateY(150%);
  transition: transform 0.35s cubic-bezier(0.2, 0.8, 0.2, 1);
  z-index: 50;
}
.toast.show { transform: none; }

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation: none !important;
    transition: none !important;
  }
  #particles { display: none; }
}

/* ==========================================================
   Landing page (index.html)
   ========================================================== */
section[id] { scroll-margin-top: 5rem; }

.rise { animation: rise 0.8s cubic-bezier(0.2, 0.8, 0.2, 1) both; }

.logo {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  object-fit: cover;
  box-shadow: 0 0 0 1px var(--border);
}

.btn-ghost {
  border: 1px solid var(--border);
  background: rgba(209, 190, 243, 0.06);
  color: var(--accent-soft);
}
.btn-ghost:hover {
  border-color: rgba(149, 75, 246, 0.6);
  background: rgba(149, 75, 246, 0.14);
  color: #fff;
}

.project:hover {
  border-color: rgba(149, 75, 246, 0.45);
  box-shadow: 0 24px 60px -16px rgba(149, 75, 246, 0.35);
}

.badge {
  padding: 2px 10px;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 500;
  border: 1px solid var(--border);
  color: var(--accent-soft);
  background: rgba(209, 190, 243, 0.06);
}
.badge-keyless { color: #6ee7b7; border-color: rgba(52, 211, 153, 0.3); background: rgba(52, 211, 153, 0.08); }
.badge-keyed { color: #fcd34d; border-color: rgba(252, 211, 77, 0.3); background: rgba(252, 211, 77, 0.08); }

.checks li { position: relative; padding-left: 1.5rem; }
.checks li::before {
  content: "";
  position: absolute;
  left: 0.25rem;
  top: 0.65em;
  width: 0.45rem;
  height: 0.45rem;
  border-radius: 50%;
  background: var(--accent);
}
