:root {
  --bg: #070b14;
  --bg-elev: #0e1524;
  --ink: #e8eef8;
  --muted: #8b97ad;
  --line: rgba(232, 238, 248, 0.12);
  --accent: #3dd6c6;
  --accent-2: #6b8cff;
  --glow: rgba(61, 214, 198, 0.35);
  --max: 1120px;
  --font-display: "Outfit", "Noto Sans SC", sans-serif;
  --font-body: "Noto Sans SC", "Outfit", sans-serif;
  --font-mono: "IBM Plex Mono", "Consolas", monospace;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.7;
  background: var(--bg);
  min-height: 100vh;
  overflow-x: hidden;
}

a {
  color: var(--accent);
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

a:hover {
  color: #7aefe3;
}

.wrap {
  width: min(100% - 2.5rem, var(--max));
  margin: 0 auto;
}

/* ----- top nav ----- */
.topbar {
  position: fixed;
  inset: 0 0 auto;
  z-index: 40;
  backdrop-filter: blur(14px);
  background: rgba(7, 11, 20, 0.72);
  border-bottom: 1px solid transparent;
  transition: border-color 0.3s ease, background 0.3s ease;
}

.topbar.is-solid {
  border-bottom-color: var(--line);
}

.topbar-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.95rem 0;
}

.logo {
  display: flex;
  align-items: baseline;
  gap: 0.55rem;
  color: var(--ink);
  text-decoration: none;
  font-family: var(--font-display);
  font-weight: 700;
  letter-spacing: 0.04em;
}

.logo span {
  color: var(--accent);
}

.logo-sub {
  font-size: 0.72rem;
  font-weight: 500;
  color: var(--muted);
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 1.15rem;
  font-size: 0.9rem;
}

.nav a {
  color: var(--muted);
  text-decoration: none;
}

.nav a:hover,
.nav a[aria-current="page"] {
  color: var(--ink);
}

/* ----- hero ----- */
.hero {
  position: relative;
  min-height: 100vh;
  display: grid;
  align-items: end;
  padding: 7rem 0 4.5rem;
  isolation: isolate;
}

.hero-bg {
  position: absolute;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(900px 520px at 18% 20%, rgba(61, 214, 198, 0.18), transparent 60%),
    radial-gradient(800px 480px at 88% 12%, rgba(107, 140, 255, 0.22), transparent 55%),
    radial-gradient(700px 500px at 50% 110%, rgba(61, 214, 198, 0.08), transparent 50%),
    linear-gradient(180deg, #0a1020 0%, var(--bg) 78%);
  overflow: hidden;
}

.hero-bg::before {
  content: "";
  position: absolute;
  inset: -20%;
  background-image:
    radial-gradient(1.5px 1.5px at 20% 30%, rgba(255, 255, 255, 0.45), transparent),
    radial-gradient(1.5px 1.5px at 60% 70%, rgba(255, 255, 255, 0.35), transparent),
    radial-gradient(1px 1px at 80% 20%, rgba(255, 255, 255, 0.4), transparent),
    radial-gradient(1px 1px at 40% 80%, rgba(255, 255, 255, 0.25), transparent),
    radial-gradient(1.5px 1.5px at 10% 60%, rgba(255, 255, 255, 0.3), transparent);
  animation: drift 28s linear infinite;
  opacity: 0.7;
}

.hero-bg::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent 55%, var(--bg) 100%);
}

@keyframes drift {
  from { transform: translate3d(0, 0, 0); }
  to { transform: translate3d(-4%, 3%, 0); }
}

.hero-kicker {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  margin: 0 0 1.1rem;
  color: var(--accent);
  font-size: 0.82rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  font-family: var(--font-display);
  opacity: 0;
  animation: rise 0.9s ease 0.1s forwards;
}

.hero-kicker::before {
  content: "";
  width: 1.5rem;
  height: 1px;
  background: var(--accent);
}

.hero h1 {
  margin: 0 0 1rem;
  max-width: 14ch;
  font-family: var(--font-display);
  font-size: clamp(2.6rem, 7vw, 4.6rem);
  font-weight: 700;
  line-height: 1.08;
  letter-spacing: -0.02em;
  opacity: 0;
  animation: rise 0.95s ease 0.2s forwards;
}

.hero h1 em {
  font-style: normal;
  background: linear-gradient(120deg, var(--accent), var(--accent-2));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.hero-lead {
  margin: 0 0 1.75rem;
  max-width: 36rem;
  color: var(--muted);
  font-size: clamp(1rem, 2.2vw, 1.15rem);
  opacity: 0;
  animation: rise 0.95s ease 0.32s forwards;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1rem;
  opacity: 0;
  animation: rise 0.95s ease 0.42s forwards;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  padding: 0.78rem 1.25rem;
  border-radius: 999px;
  border: 1px solid transparent;
  font-family: var(--font-display);
  font-size: 0.92rem;
  font-weight: 600;
  text-decoration: none;
  transition: transform 0.2s ease, background 0.2s ease, border-color 0.2s ease;
}

.btn:hover {
  transform: translateY(-1px);
}

.btn-primary {
  background: linear-gradient(120deg, var(--accent), #2bb8d4);
  color: #041018;
}

.btn-primary:hover {
  color: #041018;
}

.btn-ghost {
  border-color: var(--line);
  color: var(--ink);
  background: rgba(255, 255, 255, 0.03);
}

.btn-ghost:hover {
  border-color: rgba(61, 214, 198, 0.45);
  color: var(--accent);
}

.scroll-hint {
  margin-top: 3.5rem;
  color: var(--muted);
  font-size: 0.78rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  opacity: 0;
  animation: rise 0.9s ease 0.55s forwards, bob 2.4s ease-in-out 1.2s infinite;
}

@keyframes rise {
  from { opacity: 0; transform: translateY(18px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes bob {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(6px); }
}

/* ----- sections ----- */
.section {
  padding: 5rem 0;
}

.section-head {
  margin-bottom: 2rem;
}

.section-eyebrow {
  margin: 0 0 0.55rem;
  color: var(--accent);
  font-family: var(--font-display);
  font-size: 0.78rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.section-head h2 {
  margin: 0 0 0.65rem;
  font-family: var(--font-display);
  font-size: clamp(1.6rem, 3.5vw, 2.2rem);
  font-weight: 700;
  letter-spacing: -0.02em;
}

.section-head p {
  margin: 0;
  max-width: 40rem;
  color: var(--muted);
}

.matrix {
  display: grid;
  gap: 1rem;
}

@media (min-width: 720px) {
  .matrix {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 980px) {
  .matrix {
    grid-template-columns: repeat(6, 1fr);
  }
  .matrix a:nth-child(1) { grid-column: span 3; }
  .matrix a:nth-child(2) { grid-column: span 3; }
  .matrix a:nth-child(3),
  .matrix a:nth-child(4),
  .matrix a:nth-child(5) { grid-column: span 2; }
}

.matrix a {
  position: relative;
  display: block;
  padding: 1.35rem 1.3rem 1.45rem;
  border: 1px solid var(--line);
  border-radius: 18px;
  background:
    linear-gradient(160deg, rgba(255, 255, 255, 0.04), transparent 55%),
    var(--bg-elev);
  color: inherit;
  text-decoration: none;
  overflow: hidden;
  transition: border-color 0.25s ease, transform 0.25s ease, box-shadow 0.25s ease;
}

.matrix a::before {
  content: "";
  position: absolute;
  inset: auto -20% -40% auto;
  width: 180px;
  height: 180px;
  background: radial-gradient(circle, var(--glow), transparent 68%);
  opacity: 0;
  transition: opacity 0.3s ease;
}

.matrix a:hover {
  border-color: rgba(61, 214, 198, 0.45);
  transform: translateY(-3px);
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.35);
}

.matrix a:hover::before {
  opacity: 1;
}

.matrix-num {
  display: block;
  margin-bottom: 0.85rem;
  color: var(--muted);
  font-family: var(--font-display);
  font-size: 0.78rem;
  letter-spacing: 0.14em;
}

.matrix h3 {
  position: relative;
  margin: 0 0 0.45rem;
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 700;
}

.matrix p {
  position: relative;
  margin: 0;
  color: var(--muted);
  font-size: 0.92rem;
}

.about-panel {
  display: grid;
  gap: 1.5rem;
  padding: 1.75rem;
  border: 1px solid var(--line);
  border-radius: 22px;
  background:
    radial-gradient(500px 220px at 0% 0%, rgba(107, 140, 255, 0.12), transparent 60%),
    var(--bg-elev);
}

@media (min-width: 800px) {
  .about-panel {
    grid-template-columns: 1.2fr 1fr;
    align-items: center;
  }
}

.about-panel h2 {
  margin: 0 0 0.75rem;
  font-family: var(--font-display);
  font-size: 1.55rem;
}

.about-panel p {
  margin: 0 0 0.85rem;
  color: var(--muted);
}

.about-panel p:last-child {
  margin-bottom: 0;
}

.pill-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
}

.pill-list span {
  padding: 0.4rem 0.75rem;
  border-radius: 999px;
  border: 1px solid var(--line);
  color: var(--ink);
  font-size: 0.82rem;
  background: rgba(255, 255, 255, 0.03);
}

/* ----- article pages ----- */
.page-hero {
  padding: 7rem 0 2rem;
  border-bottom: 1px solid var(--line);
  background:
    radial-gradient(700px 280px at 15% 0%, rgba(61, 214, 198, 0.12), transparent 60%),
    radial-gradient(500px 240px at 90% 10%, rgba(107, 140, 255, 0.12), transparent 55%);
}

.page-hero h1 {
  margin: 0 0 0.75rem;
  max-width: 18ch;
  font-family: var(--font-display);
  font-size: clamp(1.8rem, 4vw, 2.6rem);
  line-height: 1.15;
}

.meta {
  margin: 0;
  color: var(--muted);
  font-size: 0.9rem;
}

.back {
  display: inline-flex;
  margin-bottom: 1.1rem;
  color: var(--muted);
  text-decoration: none;
  font-size: 0.9rem;
}

.back:hover {
  color: var(--accent);
}

.prose {
  padding: 2.5rem 0 1rem;
  max-width: 720px;
}

.prose h2 {
  margin: 2rem 0 0.7rem;
  font-family: var(--font-display);
  font-size: 1.25rem;
}

.prose h3 {
  margin: 1.4rem 0 0.5rem;
  font-size: 1.05rem;
}

.prose p,
.prose ul,
.prose ol {
  margin: 0 0 1rem;
  color: #c5cedd;
}

.prose ul,
.prose ol {
  padding-left: 1.25rem;
}

.prose li + li {
  margin-top: 0.35rem;
}

.prose code,
code {
  font-family: var(--font-mono);
  font-size: 0.88em;
  background: rgba(255, 255, 255, 0.06);
  padding: 0.12em 0.38em;
  border-radius: 4px;
}

.prose pre {
  background: #0a1220;
  border: 1px solid var(--line);
  color: #dce6f5;
  padding: 1rem 1.1rem;
  overflow-x: auto;
  border-radius: 12px;
  font-size: 0.86rem;
}

.prose pre code {
  background: none;
  padding: 0;
}

.table-wrap {
  overflow-x: auto;
  margin: 0 0 1.25rem;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.92rem;
}

th,
td {
  border: 1px solid var(--line);
  padding: 0.6rem 0.75rem;
  text-align: left;
  vertical-align: top;
  background: rgba(255, 255, 255, 0.02);
}

th {
  background: rgba(61, 214, 198, 0.08);
  color: var(--ink);
}

.callout {
  border: 1px solid rgba(61, 214, 198, 0.28);
  background: rgba(61, 214, 198, 0.08);
  color: #b7ebe4;
  padding: 0.9rem 1rem;
  margin: 0 0 1.25rem;
  border-radius: 12px;
  font-size: 0.92rem;
}

/* ----- footer ----- */
.site-footer {
  margin-top: 2rem;
  padding: 2.5rem 0 2.75rem;
  border-top: 1px solid var(--line);
  background: #05080f;
}

.footer-grid {
  display: grid;
  gap: 1.5rem;
}

@media (min-width: 760px) {
  .footer-grid {
    grid-template-columns: 1.4fr 1fr 1fr;
  }
}

.site-footer h3 {
  margin: 0 0 0.7rem;
  font-family: var(--font-display);
  font-size: 0.95rem;
}

.site-footer p,
.site-footer li {
  color: var(--muted);
  font-size: 0.88rem;
}

.site-footer ul {
  margin: 0;
  padding: 0;
  list-style: none;
}

.site-footer li + li {
  margin-top: 0.35rem;
}

.site-footer a {
  color: var(--muted);
  text-decoration: none;
}

.site-footer a:hover {
  color: var(--accent);
}

.footer-bottom {
  margin-top: 2rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--line);
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1.25rem;
  justify-content: space-between;
  color: var(--muted);
  font-size: 0.82rem;
}

.footer-bottom .icp a {
  color: var(--muted);
}

.footer-bottom .icp a:hover {
  color: var(--accent);
}
