:root {
  --bg: #060912;
  --bg2: #0b1424;
  --card: rgba(16, 24, 40, 0.78);
  --line: rgba(56, 189, 248, 0.16);
  --text: #f1f5f9;
  --muted: #94a3b8;
  --cyan: #38bdf8;
  --green: #4ade80;
  --orange: #fbbf24;
  --danger: #fb7185;
  --font-display: "Space Grotesk", system-ui, sans-serif;
  --font-body: "Plus Jakarta Sans", system-ui, sans-serif;
  --font-mono: "IBM Plex Mono", ui-monospace, monospace;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.6;
  letter-spacing: 0.01em;
  background:
    radial-gradient(1000px 520px at 8% -8%, rgba(56, 189, 248, 0.16), transparent 55%),
    radial-gradient(800px 420px at 92% 8%, rgba(74, 222, 128, 0.08), transparent 50%),
    radial-gradient(700px 400px at 50% 100%, rgba(251, 191, 36, 0.05), transparent 55%),
    linear-gradient(165deg, var(--bg), var(--bg2) 50%, #09101c);
  background-attachment: fixed;
  -webkit-font-smoothing: antialiased;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: 0.28;
  background-image:
    linear-gradient(rgba(56, 189, 248, 0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(56, 189, 248, 0.05) 1px, transparent 1px);
  background-size: 56px 56px;
  mask-image: radial-gradient(ellipse at center, black 25%, transparent 78%);
  z-index: 0;
}

.site-wrap { position: relative; z-index: 1; }

.font-display {
  font-family: var(--font-display);
  letter-spacing: -0.03em;
  line-height: 1.12;
}
.font-mono { font-family: var(--font-mono); }

h1, h2, h3, .font-display {
  font-family: var(--font-display);
}

.nav-blur {
  backdrop-filter: blur(18px);
  background: rgba(6, 9, 18, 0.78);
  border-bottom: 1px solid var(--line);
}

.brand-mark {
  font-family: var(--font-display);
  letter-spacing: -0.04em;
  background: linear-gradient(120deg, #fff 10%, var(--cyan) 80%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.card-glass {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 20px;
  backdrop-filter: blur(12px);
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.22);
}

.cmd {
  font-family: var(--font-mono);
  font-size: 0.88rem;
  line-height: 1.65;
  color: #7dd3fc;
  background: #05080f;
  border: 1px solid rgba(56, 189, 248, 0.22);
  border-radius: 14px;
  padding: 1rem 1.1rem;
  overflow-x: auto;
  white-space: pre-wrap;
  word-break: break-word;
}

.copy-btn {
  opacity: 0.75;
  transition: opacity 0.2s, transform 0.2s, background 0.2s;
  background: rgba(8, 15, 28, 0.85);
}
.copy-btn:hover {
  opacity: 1;
  transform: translateY(-1px);
  background: rgba(14, 28, 48, 0.95);
}

.tag {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-family: var(--font-body);
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #7dd3fc;
  border: 1px solid rgba(56, 189, 248, 0.35);
  border-radius: 999px;
  padding: 0.3rem 0.8rem;
  background: rgba(56, 189, 248, 0.06);
}

.section-link {
  display: block;
  transition: transform 0.28s ease, border-color 0.28s ease, box-shadow 0.28s ease;
}
.section-link:hover {
  transform: translateY(-6px);
  border-color: rgba(56, 189, 248, 0.5);
  box-shadow: 0 22px 48px rgba(0, 0, 0, 0.4);
}

.btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  border-radius: 14px;
  background: linear-gradient(135deg, #38bdf8, #22d3ee);
  color: #041018;
  font-weight: 700;
  padding: 0.8rem 1.25rem;
  transition: transform 0.2s, filter 0.2s;
}
.btn-primary:hover {
  transform: translateY(-2px);
  filter: brightness(1.05);
}

.btn-ghost {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 14px;
  border: 1px solid rgba(56, 189, 248, 0.35);
  color: #bae6fd;
  padding: 0.8rem 1.25rem;
  transition: background 0.2s, transform 0.2s;
}
.btn-ghost:hover {
  background: rgba(56, 189, 248, 0.08);
  transform: translateY(-2px);
}

.quote-chip {
  border-left: 3px solid var(--cyan);
  padding-left: 1rem;
  color: var(--muted);
  font-style: italic;
}

/* Welcome overlay */
#welcome-overlay {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  background:
    radial-gradient(circle at 50% 35%, #12304a, #060912 68%);
  transition: opacity 0.75s ease, visibility 0.75s ease;
}
#welcome-overlay.hide {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}
.welcome-line { overflow: hidden; }
.welcome-line span {
  display: inline-block;
  transform: translateY(110%);
  opacity: 0;
  animation: riseIn 0.95s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}
.welcome-line:nth-child(2) span { animation-delay: 0.15s; }
.welcome-line:nth-child(3) span { animation-delay: 0.3s; }
.welcome-line:nth-child(4) span { animation-delay: 0.45s; }

@keyframes riseIn {
  to { transform: translateY(0); opacity: 1; }
}

@keyframes floaty {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-10px); }
}
.floaty { animation: floaty 5s ease-in-out infinite; }

@keyframes pulseDot {
  0%, 100% { box-shadow: 0 0 0 0 rgba(74, 222, 128, 0.55); }
  70% { box-shadow: 0 0 0 12px rgba(74, 222, 128, 0); }
}
.live-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--green);
  animation: pulseDot 1.8s infinite;
}

.reveal {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.65s ease, transform 0.65s ease;
}
.reveal.show {
  opacity: 1;
  transform: translateY(0);
}

.note-card {
  animation: noteIn 0.45s ease;
}
@keyframes noteIn {
  from { opacity: 0; transform: translateY(-12px) scale(0.98); }
  to { opacity: 1; transform: none; }
}

.step-num {
  width: 2rem;
  height: 2rem;
  border-radius: 999px;
  display: inline-grid;
  place-items: center;
  font-family: var(--font-display);
  font-weight: 700;
  background: rgba(56, 189, 248, 0.15);
  color: #7dd3fc;
  flex-shrink: 0;
}

.toc a {
  color: var(--muted);
  text-decoration: none;
  border-left: 2px solid transparent;
  padding-left: 0.75rem;
  display: block;
  margin: 0.4rem 0;
  transition: color 0.2s, border-color 0.2s;
}
.toc a:hover, .toc a.active {
  color: var(--cyan);
  border-color: var(--cyan);
}

.tip-ticker {
  overflow: hidden;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: rgba(8, 16, 28, 0.7);
}
.tip-ticker p {
  margin: 0;
  padding: 0.9rem 1.1rem;
  white-space: nowrap;
  animation: tipSlide 18s linear infinite;
}
@keyframes tipSlide {
  0% { transform: translateX(0); }
  100% { transform: translateX(-50%); }
}

@media (max-width: 768px) {
  body { font-size: 15px; }
  .cmd { font-size: 0.8rem; }
}
