/* ============================================================
   pyNetX — architectural documentation
   dark glass theme · cyan / amber / magenta / mint accents
   ============================================================ */

:root {
  --bg: #05070f;
  --bg-2: #080d1a;
  --panel: rgba(13, 20, 38, 0.6);
  --panel-border: rgba(94, 140, 210, 0.18);
  --text: #d7e3f4;
  --text-dim: #8da3c0;
  --cyan: #59e3ff;
  --amber: #ffb454;
  --magenta: #ff5db1;
  --mint: #7cffb2;
  --violet: #c792ff;
  --red: #ff4d6d;
  --mono: "JetBrains Mono", ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  --display: "Space Grotesk", "Inter", system-ui, sans-serif;
  --body: "Inter", system-ui, -apple-system, sans-serif;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  background:
    radial-gradient(1100px 600px at 85% -5%, rgba(38, 80, 155, 0.22), transparent 60%),
    radial-gradient(900px 700px at -10% 35%, rgba(120, 40, 110, 0.13), transparent 60%),
    radial-gradient(800px 500px at 50% 110%, rgba(20, 90, 110, 0.16), transparent 60%),
    var(--bg);
  color: var(--text);
  font-family: var(--body);
  font-size: 16px;
  line-height: 1.65;
  overflow-x: hidden;
}

::selection { background: rgba(89, 227, 255, 0.25); }

a { color: var(--cyan); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ---------------- nav ---------------- */
.nav {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 50;
  display: flex;
  align-items: center;
  gap: 28px;
  padding: 14px 32px;
  transition: background 0.3s, border-color 0.3s, backdrop-filter 0.3s;
  border-bottom: 1px solid transparent;
}
.nav.scrolled {
  background: rgba(6, 9, 18, 0.78);
  backdrop-filter: blur(14px);
  border-bottom-color: var(--panel-border);
}
.nav .logo {
  font-family: var(--display);
  font-weight: 700;
  font-size: 1.2rem;
  letter-spacing: 0.02em;
  color: #fff;
}
.nav .logo span { color: var(--cyan); }
.nav .links {
  display: flex;
  gap: 4px;
  margin-left: auto;
  flex-wrap: wrap;
}
.nav .links a {
  color: var(--text-dim);
  font-size: 0.83rem;
  font-weight: 500;
  padding: 6px 12px;
  border-radius: 999px;
  transition: color 0.2s, background 0.2s;
}
.nav .links a:hover { color: #fff; text-decoration: none; }
.nav .links a.active {
  color: var(--cyan);
  background: rgba(89, 227, 255, 0.1);
}
.nav .gh {
  color: var(--text-dim);
  font-size: 0.83rem;
  border: 1px solid var(--panel-border);
  padding: 6px 14px;
  border-radius: 999px;
  white-space: nowrap;
}
.nav .gh:hover { color: var(--cyan); border-color: rgba(89, 227, 255, 0.5); text-decoration: none; }

/* ---------------- hero ---------------- */
.hero {
  position: relative;
  height: 100vh;
  min-height: 640px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
#hero-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
}
.hero-overlay {
  position: relative;
  z-index: 2;
  text-align: center;
  padding: 0 24px;
  pointer-events: none;
}
.hero-overlay > * { pointer-events: auto; }
.hero-kicker {
  font-family: var(--mono);
  font-size: 0.8rem;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--cyan);
  margin-bottom: 18px;
}
.hero h1 {
  font-family: var(--display);
  font-size: clamp(3.4rem, 9vw, 6.4rem);
  font-weight: 700;
  line-height: 1.02;
  letter-spacing: -0.02em;
  background: linear-gradient(120deg, #ffffff 20%, var(--cyan) 55%, var(--magenta) 95%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  filter: drop-shadow(0 0 32px rgba(89, 227, 255, 0.25));
}
.hero .tagline {
  max-width: 640px;
  margin: 22px auto 0;
  color: var(--text-dim);
  font-size: 1.06rem;
}
.hero .tagline strong { color: var(--text); font-weight: 600; }
.hero-badges {
  display: flex;
  gap: 10px;
  justify-content: center;
  flex-wrap: wrap;
  margin-top: 26px;
}
.badge {
  font-family: var(--mono);
  font-size: 0.76rem;
  padding: 7px 14px;
  border-radius: 999px;
  border: 1px solid var(--panel-border);
  background: rgba(10, 16, 30, 0.65);
  color: var(--text-dim);
  backdrop-filter: blur(8px);
}
.badge b { color: var(--cyan); font-weight: 600; }
.hero-stats {
  display: flex;
  gap: 42px;
  justify-content: center;
  flex-wrap: wrap;
  margin-top: 44px;
}
.stat { text-align: center; }
.stat .num {
  font-family: var(--display);
  font-size: 1.9rem;
  font-weight: 700;
  color: #fff;
}
.stat .num em { color: var(--cyan); font-style: normal; }
.stat .lbl {
  font-size: 0.74rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-dim);
  margin-top: 2px;
}
.scroll-hint {
  position: absolute;
  bottom: 28px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 2;
  color: var(--text-dim);
  font-size: 0.74rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  animation: bob 2.4s ease-in-out infinite;
}
@keyframes bob {
  0%, 100% { transform: translate(-50%, 0); opacity: 0.6; }
  50% { transform: translate(-50%, 8px); opacity: 1; }
}

/* ---------------- layout ---------------- */
main { position: relative; z-index: 1; }
section {
  max-width: 1180px;
  margin: 0 auto;
  padding: 110px 28px 30px;
}
.section-kicker {
  font-family: var(--mono);
  font-size: 0.76rem;
  letter-spacing: 0.26em;
  text-transform: uppercase;
  color: var(--cyan);
  margin-bottom: 12px;
}
.section-kicker.amber { color: var(--amber); }
.section-kicker.magenta { color: var(--magenta); }
.section-kicker.mint { color: var(--mint); }
.section-kicker.violet { color: var(--violet); }
h2 {
  font-family: var(--display);
  font-size: clamp(1.7rem, 3.6vw, 2.5rem);
  font-weight: 700;
  letter-spacing: -0.01em;
  color: #fff;
  margin-bottom: 16px;
}
.lede {
  max-width: 780px;
  color: var(--text-dim);
  font-size: 1.04rem;
  margin-bottom: 38px;
}
.lede code, p code, li code, td code {
  font-family: var(--mono);
  font-size: 0.86em;
  background: rgba(89, 227, 255, 0.08);
  border: 1px solid rgba(89, 227, 255, 0.14);
  color: #aee9ff;
  padding: 1px 6px;
  border-radius: 6px;
  white-space: nowrap;
}

/* reveal animation */
.reveal {
  opacity: 0;
  transform: translateY(26px);
  transition: opacity 0.7s ease, transform 0.7s ease;
}
.reveal.visible { opacity: 1; transform: none; }

/* ---------------- cards ---------------- */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(245px, 1fr));
  gap: 18px;
}
.card {
  background: var(--panel);
  border: 1px solid var(--panel-border);
  border-radius: 18px;
  padding: 26px 24px;
  backdrop-filter: blur(10px);
  transition: transform 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease;
}
.card:hover {
  transform: translateY(-4px);
  border-color: rgba(89, 227, 255, 0.4);
  box-shadow: 0 14px 44px rgba(20, 120, 180, 0.16);
}
.card .icon { font-size: 1.5rem; margin-bottom: 12px; display: block; }
.card h3 {
  font-family: var(--display);
  font-size: 1.06rem;
  color: #fff;
  margin-bottom: 8px;
}
.card p { color: var(--text-dim); font-size: 0.9rem; }

/* ---------------- 3D scene panels ---------------- */
.scene-panel {
  position: relative;
  height: 580px;
  border-radius: 22px;
  border: 1px solid var(--panel-border);
  background:
    radial-gradient(600px 360px at 50% 0%, rgba(40, 80, 150, 0.14), transparent 70%),
    rgba(7, 11, 22, 0.7);
  overflow: hidden;
  margin-bottom: 30px;
}
.scene-panel canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
}
.scene-panel .corner-tag {
  position: absolute;
  top: 14px;
  left: 16px;
  z-index: 2;
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.12em;
  color: var(--text-dim);
  background: rgba(6, 10, 20, 0.7);
  border: 1px solid var(--panel-border);
  padding: 5px 11px;
  border-radius: 999px;
  backdrop-filter: blur(6px);
}
.legend {
  position: absolute;
  bottom: 14px;
  left: 16px;
  z-index: 2;
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
  font-size: 0.74rem;
  color: var(--text-dim);
  background: rgba(6, 10, 20, 0.7);
  border: 1px solid var(--panel-border);
  padding: 7px 13px;
  border-radius: 999px;
  backdrop-filter: blur(6px);
}
.legend i {
  display: inline-block;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  margin-right: 6px;
  vertical-align: -0.5px;
}
.dot-cyan { background: var(--cyan); box-shadow: 0 0 8px var(--cyan); }
.dot-amber { background: var(--amber); box-shadow: 0 0 8px var(--amber); }
.dot-magenta { background: var(--magenta); box-shadow: 0 0 8px var(--magenta); }
.dot-mint { background: var(--mint); box-shadow: 0 0 8px var(--mint); }
.dot-red { background: var(--red); box-shadow: 0 0 8px var(--red); }

/* ---------------- pipeline steps ---------------- */
.pipeline-steps {
  list-style: none;
  counter-reset: step;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(330px, 1fr));
  gap: 14px;
}
.pipeline-step {
  counter-increment: step;
  position: relative;
  background: var(--panel);
  border: 1px solid var(--panel-border);
  border-radius: 14px;
  padding: 16px 18px 16px 58px;
  font-size: 0.9rem;
  color: var(--text-dim);
  transition: border-color 0.3s, background 0.3s, color 0.3s, box-shadow 0.3s;
}
.pipeline-step::before {
  content: counter(step);
  position: absolute;
  left: 16px;
  top: 16px;
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  font-family: var(--mono);
  font-size: 0.82rem;
  color: var(--cyan);
  border: 1px solid rgba(89, 227, 255, 0.35);
  border-radius: 50%;
  transition: background 0.3s, color 0.3s, box-shadow 0.3s;
}
.pipeline-step b { color: var(--text); font-weight: 600; }
.pipeline-step.active {
  border-color: rgba(89, 227, 255, 0.6);
  background: rgba(16, 34, 54, 0.75);
  color: var(--text);
  box-shadow: 0 0 0 1px rgba(89, 227, 255, 0.18), 0 10px 36px rgba(30, 140, 200, 0.16);
}
.pipeline-step.active::before {
  background: var(--cyan);
  color: #04222e;
  box-shadow: 0 0 16px rgba(89, 227, 255, 0.6);
}

/* ---------------- explainer split ---------------- */
.split {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 18px;
  margin-top: 8px;
}

/* ---------------- threads anatomy ---------------- */
.threads-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 18px;
  margin-bottom: 26px;
}
.thread-card {
  background: var(--panel);
  border: 1px solid var(--panel-border);
  border-radius: 18px;
  padding: 24px;
  backdrop-filter: blur(10px);
  border-top: 2px solid var(--accent, var(--cyan));
}
.thread-card .pulse {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--accent, var(--cyan));
  box-shadow: 0 0 10px var(--accent, var(--cyan));
  margin-right: 9px;
  animation: pulse 1.8s ease-in-out infinite;
}
@keyframes pulse {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.5); opacity: 0.55; }
}
.thread-card h3 {
  display: inline;
  font-family: var(--display);
  font-size: 1rem;
  color: #fff;
}
.thread-card .count {
  float: right;
  font-family: var(--mono);
  font-size: 0.78rem;
  color: var(--accent, var(--cyan));
  border: 1px solid var(--panel-border);
  border-radius: 999px;
  padding: 2px 10px;
}
.thread-card p { margin-top: 12px; color: var(--text-dim); font-size: 0.87rem; }

.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  font-family: var(--mono);
  font-size: 0.76rem;
  color: var(--text-dim);
  border: 1px solid var(--panel-border);
  background: rgba(10, 16, 30, 0.6);
  border-radius: 999px;
  padding: 5px 12px;
}
.chip b { color: var(--amber); font-weight: 500; }

/* ---------------- tables ---------------- */
.table-wrap { overflow-x: auto; border-radius: 16px; border: 1px solid var(--panel-border); }
table { width: 100%; border-collapse: collapse; background: rgba(8, 13, 26, 0.6); font-size: 0.88rem; }
th, td { text-align: left; padding: 13px 18px; border-bottom: 1px solid rgba(94, 140, 210, 0.12); }
th {
  font-family: var(--mono);
  font-size: 0.74rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--cyan);
  background: rgba(12, 20, 38, 0.8);
}
td { color: var(--text-dim); }
td:first-child { color: var(--text); }
tr:last-child td { border-bottom: none; }

/* ---------------- API section ---------------- */
.api-cols {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(290px, 1fr));
  gap: 18px;
  margin-bottom: 26px;
}
.api-col {
  background: var(--panel);
  border: 1px solid var(--panel-border);
  border-radius: 18px;
  padding: 24px;
}
.api-col h3 {
  font-family: var(--display);
  font-size: 1rem;
  color: #fff;
  margin-bottom: 14px;
}
.api-col h3 small { color: var(--text-dim); font-weight: 400; font-size: 0.78rem; }
.method-list { display: flex; flex-direction: column; gap: 7px; }
.method {
  font-family: var(--mono);
  font-size: 0.79rem;
  color: #aee9ff;
  background: rgba(89, 227, 255, 0.05);
  border: 1px solid rgba(89, 227, 255, 0.12);
  border-radius: 9px;
  padding: 7px 12px;
  transition: border-color 0.2s, background 0.2s;
}
.method:hover { border-color: rgba(89, 227, 255, 0.4); background: rgba(89, 227, 255, 0.09); }
.method.amber { color: #ffd9a3; background: rgba(255, 180, 84, 0.05); border-color: rgba(255, 180, 84, 0.14); }
.method.amber:hover { border-color: rgba(255, 180, 84, 0.4); }
.method.mint { color: #c4ffde; background: rgba(124, 255, 178, 0.05); border-color: rgba(124, 255, 178, 0.14); }
.method.mint:hover { border-color: rgba(124, 255, 178, 0.4); }
.method span { color: var(--text-dim); }

/* ---------------- timeline ---------------- */
.timeline { position: relative; padding-left: 34px; }
.timeline::before {
  content: "";
  position: absolute;
  left: 9px;
  top: 6px;
  bottom: 6px;
  width: 2px;
  background: linear-gradient(var(--cyan), var(--magenta), var(--amber));
  opacity: 0.5;
}
.tl-item { position: relative; padding: 0 0 34px 18px; }
.tl-item::before {
  content: "";
  position: absolute;
  left: -31px;
  top: 7px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--bg);
  border: 2.5px solid var(--cyan);
  box-shadow: 0 0 12px rgba(89, 227, 255, 0.6);
}
.tl-item .ver {
  font-family: var(--mono);
  font-size: 0.82rem;
  color: var(--cyan);
  margin-right: 10px;
}
.tl-item .when { font-size: 0.78rem; color: var(--text-dim); }
.tl-item h3 { font-family: var(--display); font-size: 1.05rem; color: #fff; margin: 6px 0; }
.tl-item p { color: var(--text-dim); font-size: 0.9rem; max-width: 760px; }

/* ---------------- code ---------------- */
.code-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(460px, 100%), 1fr));
  gap: 20px;
}
.code-card {
  border: 1px solid var(--panel-border);
  border-radius: 18px;
  overflow: hidden;
  background: rgba(7, 11, 22, 0.85);
}
.code-card .code-head {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 18px;
  border-bottom: 1px solid var(--panel-border);
  font-family: var(--mono);
  font-size: 0.78rem;
  color: var(--text-dim);
}
.code-head .dots { display: flex; gap: 6px; margin-right: 8px; }
.code-head .dots i { width: 10px; height: 10px; border-radius: 50%; display: block; }
.code-head .dots i:nth-child(1) { background: #ff5f57; }
.code-head .dots i:nth-child(2) { background: #febc2e; }
.code-head .dots i:nth-child(3) { background: #28c840; }
pre {
  padding: 20px 22px;
  overflow-x: auto;
  font-family: var(--mono);
  font-size: 0.82rem;
  line-height: 1.7;
  color: #c8d8ee;
}
.tok-kw { color: var(--magenta); }
.tok-str { color: var(--mint); }
.tok-com { color: #5c7398; font-style: italic; }
.tok-bi { color: var(--amber); }
.tok-num { color: var(--violet); }

/* ---------------- footer ---------------- */
footer {
  margin-top: 110px;
  border-top: 1px solid var(--panel-border);
  padding: 44px 28px 56px;
}
.foot-inner {
  max-width: 1180px;
  margin: 0 auto;
  display: flex;
  flex-wrap: wrap;
  gap: 24px;
  align-items: center;
  justify-content: space-between;
  color: var(--text-dim);
  font-size: 0.86rem;
}
.foot-links { display: flex; gap: 20px; flex-wrap: wrap; }

@media (max-width: 720px) {
  .nav { padding: 12px 16px; gap: 12px; }
  .nav .links { display: none; }
  .scene-panel { height: 440px; }
  section { padding: 80px 18px 20px; }
}

/* ---------------- v2.0.7 feature plane ---------------- */
.dot-violet { background: var(--violet); box-shadow: 0 0 8px var(--violet); }
.latest-panel {
  background:
    radial-gradient(720px 420px at 18% 8%, rgba(255,93,177,0.14), transparent 66%),
    radial-gradient(680px 420px at 82% 12%, rgba(199,146,255,0.16), transparent 68%),
    rgba(7, 11, 22, 0.72);
}
.feature-ribbon {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 18px;
  margin: 0 0 26px;
  perspective: 1200px;
}
.feature-prism {
  position: relative;
  overflow: hidden;
  min-height: 194px;
  padding: 22px 22px 24px;
  border-radius: 18px;
  border: 1px solid color-mix(in srgb, var(--accent, var(--cyan)) 32%, transparent);
  background:
    linear-gradient(145deg, rgba(255,255,255,0.045), transparent 38%),
    radial-gradient(320px 160px at 16% 0%, color-mix(in srgb, var(--accent, var(--cyan)) 16%, transparent), transparent 72%),
    rgba(9, 15, 30, 0.68);
  backdrop-filter: blur(10px);
  transform-style: preserve-3d;
  transform: rotateX(0deg) rotateY(-2deg);
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.06),
    0 18px 50px rgba(0,0,0,0.16),
    0 0 28px color-mix(in srgb, var(--accent, var(--cyan)) 8%, transparent);
  transition: transform 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease;
}
.feature-prism::before {
  content: "";
  position: absolute;
  inset: auto -20% -42% -20%;
  height: 72%;
  background: linear-gradient(90deg, transparent, color-mix(in srgb, var(--accent, var(--cyan)) 20%, transparent), transparent);
  transform: rotate(-8deg);
  opacity: 0.42;
}
.feature-prism::after {
  content: "";
  position: absolute;
  top: 16px;
  right: 16px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--accent, var(--cyan));
  box-shadow: 0 0 18px var(--accent, var(--cyan));
}
.feature-prism:hover {
  transform: translateY(-5px) rotateX(2deg) rotateY(2deg);
  border-color: color-mix(in srgb, var(--accent, var(--cyan)) 56%, transparent);
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.08),
    0 24px 60px rgba(0,0,0,0.24),
    0 0 38px color-mix(in srgb, var(--accent, var(--cyan)) 14%, transparent);
}
.feature-tag {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--mono);
  font-size: 0.68rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent, var(--cyan));
  border: 1px solid color-mix(in srgb, var(--accent, var(--cyan)) 28%, transparent);
  background: color-mix(in srgb, var(--accent, var(--cyan)) 7%, transparent);
  border-radius: 999px;
  padding: 4px 10px;
  margin-bottom: 14px;
}
.feature-prism h3 {
  position: relative;
  z-index: 1;
  font-family: var(--display);
  color: #fff;
  font-size: 1.04rem;
  margin-bottom: 8px;
}
.feature-prism p {
  position: relative;
  z-index: 1;
  color: var(--text-dim);
  font-size: 0.88rem;
}
.deprecation-callout {
  border: 1px solid rgba(255,180,84,0.28);
  background:
    linear-gradient(120deg, rgba(255,180,84,0.1), rgba(255,93,177,0.055)),
    rgba(12, 16, 30, 0.72);
  border-radius: 16px;
  padding: 18px 20px;
  margin: 0 0 22px;
  color: var(--text-dim);
  font-size: 0.92rem;
}
.deprecation-callout b { color: #ffe2b8; font-family: var(--display); }
.method.deprecated {
  color: #ffd9a3;
  background: rgba(255,180,84,0.045);
  border-color: rgba(255,180,84,0.14);
}
.method.deprecated span {
  float: right;
  color: rgba(255,180,84,0.78);
  font-size: 0.7rem;
}
.tl-item.latest-release::before {
  border-color: var(--magenta);
  box-shadow: 0 0 16px rgba(255,93,177,0.72);
}
.tl-item.latest-release .ver { color: var(--magenta); }
