:root {
  --bg0: #070a12;
  --bg1: #0b1022;
  --panel: rgba(255, 255, 255, 0.06);
  --panel2: rgba(255, 255, 255, 0.085);
  --stroke: rgba(255, 255, 255, 0.10);
  --text: rgba(255, 255, 255, 0.92);
  --muted: rgba(255, 255, 255, 0.70);
  --muted2: rgba(255, 255, 255, 0.55);
  --accent: #7c3aed;
  --accent2: #22c55e;
  --shadow: 0 20px 60px rgba(0, 0, 0, 0.55);
  --shadow2: 0 10px 28px rgba(0, 0, 0, 0.32);
  --radius: 18px;
}

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

html,
body {
  height: 100%;
}

body {
  margin: 0;
  color: var(--text);
  font-family: Inter, system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  letter-spacing: -0.01em;
  background: radial-gradient(1200px 700px at 20% -10%, rgba(124, 58, 237, 0.22), transparent 60%),
    radial-gradient(1000px 680px at 95% 5%, rgba(34, 197, 94, 0.16), transparent 55%),
    linear-gradient(180deg, var(--bg0), var(--bg1));
  overflow-x: hidden;
}

a {
  color: inherit;
}

.wrap {
  width: min(1080px, calc(100% - 32px));
  margin: 0 auto;
}

/* Animated background */
.bg {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: -1;
}

.bg__grain {
  position: absolute;
  inset: -40%;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='200' height='200'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.8' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='200' height='200' filter='url(%23n)' opacity='.55'/%3E%3C/svg%3E");
  opacity: 0.06;
  transform: translateZ(0);
  animation: grain 10s steps(2) infinite;
}

@keyframes grain {
  0% {
    transform: translate3d(-2%, -3%, 0);
  }
  25% {
    transform: translate3d(2%, -1%, 0);
  }
  50% {
    transform: translate3d(3%, 2%, 0);
  }
  75% {
    transform: translate3d(-1%, 3%, 0);
  }
  100% {
    transform: translate3d(-2%, -3%, 0);
  }
}

.bg__blob {
  position: absolute;
  width: 56vmin;
  height: 56vmin;
  border-radius: 999px;
  filter: blur(38px);
  opacity: 0.58;
  mix-blend-mode: screen;
  transform: translate3d(0, 0, 0);
  will-change: transform;
}

.bg__blob--a {
  left: -10vmin;
  top: -12vmin;
  background: radial-gradient(circle at 30% 30%, rgba(124, 58, 237, 0.95), rgba(124, 58, 237, 0.0) 65%);
  animation: floatA 14s ease-in-out infinite;
}

.bg__blob--b {
  right: -16vmin;
  top: 6vmin;
  width: 64vmin;
  height: 64vmin;
  background: radial-gradient(circle at 40% 30%, rgba(34, 197, 94, 0.80), rgba(34, 197, 94, 0.0) 62%);
  animation: floatB 18s ease-in-out infinite;
}

.bg__blob--c {
  left: 12vmin;
  bottom: -18vmin;
  width: 70vmin;
  height: 70vmin;
  opacity: 0.42;
  background: radial-gradient(circle at 50% 50%, rgba(79, 70, 229, 0.85), rgba(79, 70, 229, 0.0) 62%);
  animation: floatC 22s ease-in-out infinite;
}

@keyframes floatA {
  0%,
  100% {
    transform: translate3d(0, 0, 0) scale(1);
  }
  50% {
    transform: translate3d(6vmin, 3vmin, 0) scale(1.05);
  }
}

@keyframes floatB {
  0%,
  100% {
    transform: translate3d(0, 0, 0) scale(1);
  }
  50% {
    transform: translate3d(-6vmin, 4vmin, 0) scale(1.06);
  }
}

@keyframes floatC {
  0%,
  100% {
    transform: translate3d(0, 0, 0) scale(1);
  }
  50% {
    transform: translate3d(3vmin, -5vmin, 0) scale(1.04);
  }
}

/* Top bar */
.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(5, 7, 14, 0.46);
  backdrop-filter: blur(12px);
}

.topbar::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -1px;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(124, 58, 237, 0.65), rgba(34, 197, 94, 0.45), transparent);
  opacity: 0.65;
  pointer-events: none;
}

.topbar__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 0;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 900;
  text-decoration: none;
  letter-spacing: -0.02em;
}

.brand__mark {
  width: 34px;
  height: 34px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  font-weight: 900;
  color: rgba(255, 255, 255, 0.96);
  background: radial-gradient(circle at 30% 30%, rgba(124, 58, 237, 1), rgba(79, 70, 229, 0.85));
  border: 1px solid rgba(255, 255, 255, 0.14);
  box-shadow: 0 14px 26px rgba(124, 58, 237, 0.18);
}

.brand__text {
  display: flex;
  flex-direction: column;
  line-height: 1.05;
}

.brand__name {
  font-size: 0.98rem;
  letter-spacing: -0.03em;
}

.brand__handle {
  font-size: 0.85rem;
  color: var(--muted2);
  font-weight: 800;
  letter-spacing: -0.01em;
}

.nav {
  display: flex;
  gap: 14px;
}

.nav__link {
  text-decoration: none;
  color: rgba(255, 255, 255, 0.84);
  font-weight: 900;
  font-size: 0.92rem;
  padding: 8px 10px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.10);
  background: rgba(255, 255, 255, 0.04);
  transition: transform 140ms ease, background 140ms ease, border-color 140ms ease;
}

.nav__link:hover {
  transform: translateY(-1px);
  background: rgba(255, 255, 255, 0.075);
  border-color: rgba(255, 255, 255, 0.14);
}

.nav__link:active {
  transform: translateY(0);
}

/* Hero */
.hero {
  padding: 64px 0 26px;
}

.pill {
  display: inline-flex;
  gap: 8px;
  align-items: center;
  padding: 7px 12px;
  border-radius: 999px;
  border: 1px solid var(--stroke);
  background: rgba(255, 255, 255, 0.05);
  color: var(--muted);
  font-weight: 700;
  font-size: 0.9rem;
}

.hero__title {
  margin: 16px 0 10px;
  font-size: clamp(2.15rem, 4.8vw, 3.5rem);
  line-height: 1.06;
  letter-spacing: -0.045em;
}

.hero__sub {
  margin: 0;
  max-width: 78ch;
  color: var(--muted);
  font-size: 1.05rem;
  line-height: 1.7;
}

.hero__cta {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 22px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid var(--stroke);
  text-decoration: none;
  font-weight: 800;
  transition: transform 140ms ease, box-shadow 140ms ease, background 140ms ease, border-color 140ms ease;
  box-shadow: var(--shadow2);
}

.btn:active {
  transform: translateY(0);
}

.btn--primary {
  color: white;
  border-color: rgba(255, 255, 255, 0.14);
  background: linear-gradient(135deg, rgba(124, 58, 237, 0.95), rgba(79, 70, 229, 0.95));
}

.btn--primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 16px 38px rgba(124, 58, 237, 0.22);
}

.btn--ghost {
  color: var(--text);
  background: rgba(255, 255, 255, 0.06);
}

.btn--ghost:hover {
  transform: translateY(-1px);
  background: rgba(255, 255, 255, 0.085);
}

/* Panel / cards */
.panel {
  margin: 22px 0 56px;
  padding: 18px;
  border-radius: var(--radius);
  border: 1px solid rgba(255, 255, 255, 0.09);
  background: rgba(255, 255, 255, 0.045);
  box-shadow: var(--shadow);
}

.panel__head {
  display: flex;
  gap: 10px;
  align-items: baseline;
  justify-content: space-between;
  flex-wrap: wrap;
  padding: 6px 4px 14px;
}

.panel__title {
  margin: 0;
  font-size: 1.12rem;
  letter-spacing: -0.02em;
}

.panel__hint {
  margin: 0;
  color: var(--muted2);
  font-weight: 600;
}

.grid {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 14px;
}

.card {
  grid-column: span 12;
  border-radius: 18px;
  border: 1px solid rgba(255, 255, 255, 0.10);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.06), rgba(255, 255, 255, 0.03));
  overflow: hidden;
  box-shadow: var(--shadow2);
  transform-style: preserve-3d;
}

@media (min-width: 880px) {
  .card {
    grid-column: span 8;
  }
}

.card__link {
  display: block;
  padding: 18px 18px 16px;
  text-decoration: none;
}

.card__meta {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--muted2);
  font-weight: 700;
  font-size: 0.92rem;
}

.dot {
  width: 4px;
  height: 4px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.35);
}

.card__title {
  margin: 10px 0 8px;
  font-size: 1.22rem;
  letter-spacing: -0.03em;
}

.card__text {
  margin: 0;
  color: var(--muted);
  line-height: 1.65;
}

.card__footer {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.tag {
  display: inline-flex;
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.10);
  background: rgba(124, 58, 237, 0.12);
  font-weight: 800;
  font-size: 0.82rem;
}

.spacer {
  flex: 1;
}

.arrow {
  font-weight: 900;
  color: rgba(255, 255, 255, 0.85);
}

/* Page + post */
.page {
  padding: 34px 0 72px;
}

.crumbs {
  display: inline-flex;
  gap: 10px;
  align-items: center;
  color: var(--muted2);
  text-decoration: none;
  font-weight: 800;
}

.crumbs:hover {
  color: var(--text);
}

.post {
  margin-top: 16px;
  padding: 22px;
  border-radius: var(--radius);
  border: 1px solid rgba(255, 255, 255, 0.09);
  background: rgba(255, 255, 255, 0.04);
  box-shadow: var(--shadow);
}

.post h1 {
  margin: 0 0 10px;
  font-size: clamp(2.0rem, 4.0vw, 2.8rem);
  letter-spacing: -0.04em;
  line-height: 1.08;
}

.post__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  color: var(--muted2);
  font-weight: 800;
  margin-bottom: 18px;
}

.prose {
  font-size: 1.05rem;
  line-height: 1.85;
  color: rgba(255, 255, 255, 0.88);
}

.prose h2 {
  margin-top: 34px;
  letter-spacing: -0.03em;
}

.prose h3 {
  margin-top: 26px;
  letter-spacing: -0.02em;
}

.prose a {
  color: rgba(255, 255, 255, 0.92);
  text-decoration-color: rgba(124, 58, 237, 0.6);
  text-underline-offset: 3px;
}

.prose a:hover {
  text-decoration-color: rgba(124, 58, 237, 0.95);
}

.prose pre {
  margin: 18px 0;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.10);
  overflow: auto;
  background: rgba(0, 0, 0, 0.28);
  box-shadow: 0 12px 26px rgba(0, 0, 0, 0.34);
}

.prose code,
.prose pre {
  font-family: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono",
    "Courier New", monospace;
}

.prose :not(pre) > code {
  padding: 0.18em 0.38em;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.10);
  background: rgba(255, 255, 255, 0.06);
}

.prose blockquote {
  margin: 18px 0;
  padding: 6px 14px;
  border-left: 4px solid rgba(124, 58, 237, 0.7);
  background: rgba(255, 255, 255, 0.04);
  border-radius: 14px;
}

.footer {
  padding: 10px 0 32px;
  color: var(--muted2);
  font-weight: 700;
}

/* Reveal animations */
.reveal {
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 600ms ease, transform 600ms ease;
}

.reveal.is-in {
  opacity: 1;
  transform: translateY(0);
}

/* Respect reduced motion */
@media (prefers-reduced-motion: reduce) {
  .bg__grain,
  .bg__blob {
    animation: none !important;
  }
  .reveal {
    opacity: 1;
    transform: none;
    transition: none;
  }
  .card {
    transform: none !important;
  }
}

