/* ============================================================
   Quantix — website stylesheet (Sanskriti Studios)
   ============================================================ */

:root {
  --bg: #070b14;
  --bg-2: #0b1220;
  --bg-3: #111a2e;
  --bg-card: rgba(255, 255, 255, 0.03);
  --border: rgba(255, 255, 255, 0.09);
  --border-strong: rgba(255, 255, 255, 0.16);
  --text: #e6ecf7;
  --text-muted: #93a2bd;
  --text-dim: #64748b;
  --indigo: #6366f1;
  --indigo-light: #818cf8;
  --pink: #ec4899;
  --green: #22c55e;
  --amber: #f59e0b;
  --cyan: #22d3ee;
  --red: #ef4444;
  --grad: linear-gradient(135deg, #6366f1 0%, #a855f7 45%, #ec4899 100%);
  --grad-soft: linear-gradient(135deg, rgba(99, 102, 241, 0.16), rgba(236, 72, 153, 0.16));
  --glow: 0 0 60px rgba(99, 102, 241, 0.35);
  --font: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --mono: "Fira Code", ui-monospace, "JetBrains Mono", monospace;
  --radius: 14px;
}

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: 84px;
}

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

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

::selection {
  background: rgba(99, 102, 241, 0.4);
}

/* ---------- Background decoration ---------- */
.bg-glow {
  position: fixed;
  inset: 0;
  z-index: -2;
  background:
    radial-gradient(600px circle at 12% -10%, rgba(99, 102, 241, 0.22), transparent 45%),
    radial-gradient(700px circle at 88% 0%, rgba(236, 72, 153, 0.16), transparent 45%),
    radial-gradient(900px circle at 50% 115%, rgba(34, 211, 238, 0.10), transparent 50%),
    var(--bg);
}
.bg-grid {
  position: fixed;
  inset: 0;
  z-index: -1;
  background-image:
    linear-gradient(rgba(99, 102, 241, 0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(99, 102, 241, 0.05) 1px, transparent 1px);
  background-size: 44px 44px;
  mask-image: radial-gradient(ellipse 90% 70% at 50% 0%, black 30%, transparent 80%);
  -webkit-mask-image: radial-gradient(ellipse 90% 70% at 50% 0%, black 30%, transparent 80%);
}

/* ---------- Nav ---------- */
.nav {
  position: sticky;
  top: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 0 28px;
  height: 66px;
  background: rgba(7, 11, 20, 0.78);
  backdrop-filter: blur(14px) saturate(140%);
  -webkit-backdrop-filter: blur(14px) saturate(140%);
  border-bottom: 1px solid var(--border);
}
.nav-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--text);
  font-weight: 700;
  font-size: 17px;
  letter-spacing: 0.2px;
}
.nav-brand img {
  width: 30px;
  height: 30px;
  border-radius: 7px;
}
.nav-brand .q {
  background: var(--grad);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}
.nav-links {
  display: flex;
  align-items: center;
  gap: 22px;
}
.nav-links a {
  color: var(--text-muted);
  font-size: 14px;
  font-weight: 500;
  transition: color 0.2s;
}
.nav-links a:hover {
  color: var(--text);
  text-decoration: none;
}
.nav-links .btn-sm {
  margin-left: 6px;
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 22px;
  border-radius: 10px;
  border: 1px solid var(--border-strong);
  background: var(--bg-3);
  color: var(--text);
  font: 600 14.5px var(--font);
  cursor: pointer;
  transition: transform 0.15s, box-shadow 0.2s, background 0.2s;
  white-space: nowrap;
}
.btn:hover {
  transform: translateY(-2px);
  text-decoration: none;
  background: #18233a;
}
.btn-primary {
  border: none;
  background: var(--grad);
  color: #fff;
  box-shadow: 0 8px 24px rgba(124, 58, 237, 0.35);
}
.btn-primary:hover {
  box-shadow: 0 12px 34px rgba(124, 58, 237, 0.5);
  background: var(--grad);
}
.btn-ghost {
  background: transparent;
}
.btn-sm {
  padding: 8px 14px;
  font-size: 13.5px;
  border-radius: 8px;
}
.btn-block {
  width: 100%;
  justify-content: center;
}
.icon {
  width: 17px;
  height: 17px;
}
.fa.icon { width: auto; height: auto; font-size: 15px; }
.btn .fa { margin-right: 8px; font-size: 12px; }
.nav-links a .fa { margin-right: 6px; font-size: 12px; color: var(--text-dim); }
.nav-links a:hover .fa { color: var(--indigo-light); }
.btn-sm .fa { font-size: 11px !important; }

/* ---------- Layout ---------- */
.container {
  max-width: 1180px;
  margin: 0 auto;
  padding: 0 28px;
}
.section {
  padding: 96px 0;
}
.section-tight {
  padding: 64px 0;
}

.eyebrow {
  color: var(--indigo-light);
  font-size: 12.5px;
  font-weight: 700;
  letter-spacing: 2.5px;
  text-transform: uppercase;
}
h1, h2, h3, h4 {
  line-height: 1.15;
  letter-spacing: -0.3px;
}
.section-title {
  font-size: clamp(26px, 4vw, 38px);
  font-weight: 800;
  margin: 12px 0 14px;
}
.section-sub {
  color: var(--text-muted);
  font-size: 16.5px;
  max-width: 640px;
}
.grad-text {
  background: var(--grad);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}
.center {
  text-align: center;
}
.center .section-sub {
  margin: 0 auto;
}

/* ---------- Hero ---------- */
.hero {
  padding: 110px 0 40px;
  text-align: center;
  position: relative;
}
.hero .badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 16px;
  border-radius: 999px;
  border: 1px solid var(--border-strong);
  background: var(--bg-card);
  color: var(--text-muted);
  font-size: 13px;
  font-weight: 500;
  margin-bottom: 28px;
}
.hero .badge .dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 10px var(--green);
}
.hero h1 {
  font-size: clamp(42px, 7vw, 76px);
  font-weight: 900;
  letter-spacing: -1.5px;
  line-height: 1.04;
}
.hero .tagline {
  color: var(--text-muted);
  font-size: clamp(17px, 2.4vw, 21px);
  max-width: 620px;
  margin: 22px auto 34px;
}
.hero .cta-row {
  display: flex;
  gap: 14px;
  justify-content: center;
  flex-wrap: wrap;
}
.hero .stat-row {
  display: flex;
  gap: 26px;
  justify-content: center;
  flex-wrap: wrap;
  margin-top: 44px;
  color: var(--text-dim);
  font-size: 13px;
}
.hero .stat-row b {
  color: var(--text);
  display: block;
  font-size: 18px;
}

/* ---------- Editor mockup ---------- */
.mock-wrap {
  max-width: 780px;
  margin: 64px auto 0;
  text-align: left;
}
.hero-banner {
  max-width: 1080px;
  margin: 44px auto 0;
  border-radius: 18px;
  overflow: hidden;
  border: 1px solid var(--border-strong);
  box-shadow: 0 20px 70px rgba(0, 0, 0, 0.45);
}
.hero-banner img {
  display: block;
  width: 100%;
  height: auto;
}
.mock {
  border-radius: 16px;
  border: 1px solid var(--border-strong);
  background: #0d1424;
  box-shadow: var(--glow);
  overflow: hidden;
}
.mock-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 16px;
  background: #101a2e;
  border-bottom: 1px solid var(--border);
}
.mock-bar .cir {
  width: 12px;
  height: 12px;
  border-radius: 50%;
}
.mock-bar .fname {
  margin-left: 8px;
  color: var(--text-dim);
  font: 12.5px var(--mono);
}
.mock-bar .play {
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 600;
  color: #fff;
  background: var(--grad);
  padding: 5px 12px;
  border-radius: 7px;
}
.mock-code {
  padding: 24px;
  font: 14.5px/1.8 var(--mono);
  min-height: 260px;
  white-space: pre-wrap;
}
.tk-k { color: #c792ea; }
.tk-f { color: #82aaff; }
.tk-s { color: #c3e88d; }
.tk-n { color: #f78c6c; }
.tk-c { color: #546e7a; font-style: italic; }
.tk-v { color: #eeffff; }
.tk-out { color: #89ddff; }
.cursor {
  display: inline-block;
  width: 9px;
  height: 18px;
  background: #82aaff;
  vertical-align: text-bottom;
  animation: blink 1s steps(1) infinite;
}
@keyframes blink {
  50% { opacity: 0; }
}

/* ---------- Cards / grid ---------- */
.grid {
  display: grid;
  gap: 20px;
}
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }

.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 26px;
  transition: transform 0.18s, border-color 0.2s, background 0.2s;
}
.card:hover {
  transform: translateY(-4px);
  border-color: var(--border-strong);
  background: rgba(255, 255, 255, 0.045);
}
.card .ic i {
  font-size: 21px;
  color: var(--indigo-light);
}
.card .ic {
  width: 44px;
  height: 44px;
  border-radius: 11px;
  display: grid;
  place-items: center;
  margin-bottom: 16px;
  background: var(--grad-soft);
  border: 1px solid var(--border);
}
.card h3 {
  font-size: 17px;
  font-weight: 700;
  margin-bottom: 8px;
}
.card p {
  color: var(--text-muted);
  font-size: 14px;
}
.card code, .chip {
  font-family: var(--mono);
  font-size: 12.5px;
  background: #18233a;
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 2px 7px;
  color: #a5b4fc;
}

/* ---------- Tabs / samples ---------- */
.tab-bar {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}
.tab {
  padding: 8px 16px;
  border-radius: 9px;
  border: 1px solid var(--border);
  background: var(--bg-card);
  color: var(--text-muted);
  font: 600 13px var(--font);
  cursor: pointer;
  transition: 0.15s;
}
.tab.active {
  background: var(--grad);
  color: #fff;
  border-color: transparent;
}
.codebox {
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: linear-gradient(180deg, #111a2e 0%, #0d1424 60%);
  overflow: hidden;
  box-shadow: 0 18px 40px -22px rgba(0, 0, 0, 0.8);
  position: relative;
}
.codebox::before {
  content: "quantix";
  position: absolute;
  top: 10px;
  right: 14px;
  font: 700 10px/1 var(--mono);
  letter-spacing: 1.2px;
  text-transform: uppercase;
  color: var(--text-dim);
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 4px 7px;
}
.codebox pre, pre.codebox {
  overflow-x: auto;
  padding: 24px 26px;
  font: 13.5px/1.75 var(--mono);
  color: #dbe6f7;
  scrollbar-width: thin;
  scrollbar-color: #2a3a5c transparent;
}
.codebox pre::-webkit-scrollbar, pre.codebox::-webkit-scrollbar { height: 9px; }
.codebox pre::-webkit-scrollbar-thumb, pre.codebox::-webkit-scrollbar-thumb { background: #2a3a5c; border-radius: 5px; }
.doc code {
  font-family: var(--mono);
  font-size: 0.92em;
  background: #18233a;
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 1px 7px;
  color: #a5b4fc;
  white-space: nowrap;
}
.doc p > code { white-space: normal; }
.doc tr td code { white-space: normal; }
.codebox .out {
  border-top: 1px solid var(--border);
  background: #060a12;
  padding: 14px 24px;
  color: #9ee6b7;
  font: 12.5px/1.7 var(--mono);
}

/* ---------- CTA band ---------- */
.cta-band {
  background: var(--grad-soft);
  border: 1px solid var(--border);
  border-radius: 22px;
  padding: 52px 40px;
  text-align: center;
  position: relative;
  overflow: hidden;
}
.cta-band h2 {
  font-size: clamp(24px, 3.6vw, 34px);
  font-weight: 800;
  margin-bottom: 10px;
}
.cta-band p {
  color: var(--text-muted);
  max-width: 560px;
  margin: 0 auto 28px;
}

/* ---------- Footer ---------- */
.footer {
  border-top: 1px solid var(--border);
  padding: 44px 0 60px;
  margin-top: 60px;
  color: var(--text-dim);
  font-size: 13px;
}
.footer-inner {
  display: flex;
  flex-wrap: wrap;
  gap: 28px;
  justify-content: space-between;
  align-items: center;
}
.footer .brand {
  display: flex;
  align-items: center;
  gap: 9px;
  color: var(--text);
  font-weight: 700;
  font-size: 15px;
}
.footer .brand img {
  width: 26px;
  height: 26px;
  border-radius: 6px;
}
.footer-links {
  display: flex;
  gap: 18px;
  align-items: center;
  flex-wrap: wrap;
}

/* ---------- Docs ---------- */
.doc-layout {
  display: grid;
  grid-template-columns: 250px 1fr;
  gap: 48px;
  max-width: 1180px;
  margin: 0 auto;
  padding: 48px 28px 80px;
}
.doc-nav {
  position: sticky;
  top: 84px;
  align-self: start;
  max-height: calc(100vh - 100px);
  overflow-y: auto;
  border-right: 1px solid var(--border);
  padding-right: 20px;
}
.doc-nav h5 {
  font-size: 11px;
  letter-spacing: 1.6px;
  text-transform: uppercase;
  color: var(--text-dim);
  margin: 20px 0 8px;
}
.doc-nav h5:first-child { margin-top: 0; }
.doc-nav a {
  display: block;
  padding: 5px 0 5px 12px;
  border-left: 2px solid transparent;
  color: var(--text-muted);
  font-size: 13.5px;
}
.doc-nav a:hover {
  color: var(--text);
  text-decoration: none;
  border-left-color: var(--indigo);
}
.doc-nav a.active {
  color: var(--indigo-light);
  border-left-color: var(--indigo-light);
}
.doc section[id] { scroll-margin-top: 92px; }
.doc h1 {
  font-size: 32px;
  font-weight: 800;
  margin: 4px 0 8px;
  scroll-margin-top: 92px;
}
.doc h2 {
  font-size: 23px;
  font-weight: 800;
  margin: 48px 0 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border);
  scroll-margin-top: 92px;
}
.doc h3 {
  font-size: 18px;
  font-weight: 700;
  margin: 30px 0 10px;
  scroll-margin-top: 92px;
}
.doc p, .doc li {
  color: var(--text-muted);
  font-size: 15px;
}
.doc ul, .doc ol {
  padding-left: 22px;
  margin: 10px 0;
}
.doc .lead {
  font-size: 17.5px;
  color: #b9c6dd;
  max-width: 700px;
}
.doc-grid { display: grid; gap: 14px; }
.doc-cols-2 {
  grid-template-columns: repeat(2, 1fr);
}
.doc-cols-3 {
  grid-template-columns: repeat(3, 1fr);
}
.doc-note {
  border-left: 3px solid var(--amber);
  background: rgba(245, 158, 11, 0.08);
  border-radius: 0 10px 10px 0;
  padding: 14px 18px;
  margin: 18px 0;
  color: var(--text);
  font-size: 14px;
}
.doc-note.warn { border-color: var(--red); background: rgba(239, 68, 68, 0.08); }
.doc-note.ok { border-color: var(--green); background: rgba(34, 197, 94, 0.08); }

table.tbl {
  width: 100%;
  border-collapse: collapse;
  margin: 14px 0 22px;
  font-size: 14px;
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
}
.tbl th {
  text-align: left;
  background: #131d33;
  color: var(--text);
  font-size: 12.5px;
  letter-spacing: 0.6px;
  text-transform: uppercase;
  padding: 11px 14px;
  border-bottom: 1px solid var(--border);
}
.tbl td {
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
  color: var(--text-muted);
  vertical-align: top;
}
.tbl tr:last-child td { border-bottom: none; }
.tbl td code { white-space: nowrap; }

/* ---------- Playground ---------- */
.pg-page { height: 100vh; overflow: hidden; }
.pg-nav a { color: var(--text-muted); }
.pg-ribbon .sep { width: 1px; height: 20px; background: var(--border); }
#monaco-container { width: 100%; height: 100%; }
.pg-body {
  display: flex;
  flex-direction: column;
  height: calc(100vh - 66px);
  overflow: hidden;
}
.pg-ribbon {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 22px;
  background: #0b1220;
  border-bottom: 1px solid var(--border);
  flex-wrap: wrap;
}
.pg-ribbon .spacer { flex: 1; }
.pg-ribbon select, .pg-ribbon input {
  background: #111a2e;
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 8px 12px;
  font: 13px var(--font);
  outline: none;
}
.pg-views {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
}
#editor-view {
  flex: 1;
  min-height: 0;
  border-bottom: 1px solid var(--border);
}
#terminal-wrap {
  display: none;
  flex-direction: column;
  height: 38%;
  min-height: 190px;
  border-top: 1px solid var(--border);
  background: #060a12;
}
#terminal-wrap.show { display: flex; }
.ptbar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 14px;
  background: #0b1220;
  border-bottom: 1px solid var(--border);
  color: var(--text-dim);
  font: 12px var(--mono);
}
.ptbar .pt-title { font-weight: 600; color: var(--text); }
.ptbar .pt-note { color: var(--text-dim); font-size: 11px; }
.ribbon-ico { color: var(--indigo-light); font-size: 15px; }
.ptbar .pt-btn {
  background: none;
  border: none;
  color: var(--text-dim);
  cursor: pointer;
  font-size: 12px;
  padding: 4px 9px;
  border-radius: 6px;
}
.ptbar .pt-btn:hover { color: var(--text); background: #151f39; }
.ptbar .spacer { flex: 1; }
#terminal-container { flex: 1; min-height: 0; padding: 10px 12px; overflow: hidden; }
#turtle-container {
  display: none;
  position: fixed;
  z-index: 60;
  left: 50%;
  bottom: 74px;
  transform: translateX(-50%);
  max-width: min(92vw, 660px);
  max-height: 45vh;
  overflow: auto;
  padding: 12px;
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.6);
}
#turtle-container.show { display: block; }
#turtle-container svg { width: 100%; height: auto; display: block; }

.statusbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 0 18px;
  height: 30px;
  background: #0b1220;
  border-top: 1px solid var(--border);
  color: var(--text-dim);
  font: 12px var(--mono);
}
.statusbar .st-l, .statusbar .st-r { display: flex; align-items: center; gap: 16px; }
.statusbar .dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--text-dim);
}
.statusbar .dot.ok { background: var(--green); box-shadow: 0 0 8px var(--green); }
.statusbar .dot.running { background: var(--amber); animation: blink 0.8s steps(1) infinite; }
.statusbar .dot.err { background: var(--red); }
.login-hint {
  max-width: 640px;
  margin: 120px auto;
  text-align: center;
  padding: 0 24px;
}
.login-hint h1 { font-size: 30px; }
.login-hint p { color: var(--text-muted); margin: 14px 0 24px; }

.hidden { display: none !important; }
.mono { font-family: var(--mono); }

/* ---------- Motion & reveal ---------- */
.reveal {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.65s ease, transform 0.65s cubic-bezier(0.19, 0.7, 0.22, 1);
}
.reveal.in { opacity: 1; transform: none; }
.reveal.no-anim { opacity: 1; transform: none; }

@keyframes fadeUp {
  from { opacity: 0; transform: translateY(30px); }
  to { opacity: 1; transform: none; }
}
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: none; }
}
@keyframes floatY {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-9px); }
}
@keyframes gradShift {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}
@keyframes popIn {
  from { opacity: 0; transform: translateY(16px) scale(0.94); }
  to { opacity: 1; transform: none; }
}
@keyframes glowPulse {
  0%, 100% { box-shadow: 0 8px 24px rgba(124, 58, 237, 0.35); }
  50% { box-shadow: 0 12px 44px rgba(124, 58, 237, 0.6); }
}
@keyframes glowDrift {
  0%, 100% { transform: translate(0, 0); }
  33% { transform: translate(2%, -1.5%); }
  66% { transform: translate(-2%, 1.5%); }
}

.h-anim { animation: fadeUp 0.7s cubic-bezier(0.19, 0.7, 0.22, 1) both; }
.h-anim.d1 { animation-delay: 0.05s; }
.h-anim.d2 { animation-delay: 0.16s; }
.h-anim.d3 { animation-delay: 0.27s; }
.h-anim.d4 { animation-delay: 0.38s; }
.h-anim.d5 { animation-delay: 0.5s; }
.h-anim.d6 { animation-delay: 0.62s; }
.h-anim.d7 { animation-delay: 0.72s; }

.grad-text {
  background-size: 220% 220%;
  animation: gradShift 8s ease-in-out infinite;
}

.bg-glow { animation: glowDrift 18s ease-in-out infinite; }

.btn { position: relative; overflow: hidden; }
.btn::after {
  content: "";
  position: absolute;
  top: 0;
  left: -130%;
  width: 55%;
  height: 100%;
  background: linear-gradient(105deg, transparent, rgba(255, 255, 255, 0.18), transparent);
  transform: skewX(-20deg);
  transition: left 0.55s ease;
  pointer-events: none;
}
.btn:hover::after { left: 150%; }

.btn-primary { animation: glowPulse 4s ease-in-out infinite; }
.btn-primary:hover { animation: none; transform: translateY(-2px); }

.card { will-change: transform; }
.card .ic { transition: transform 0.3s cubic-bezier(0.2, 0.7, 0.3, 1.4); }
.card:hover .ic { transform: scale(1.14) rotate(-5deg); }

.mock { animation: floatY 7s ease-in-out infinite; }

.nav.scrolled { box-shadow: 0 14px 34px rgba(0, 0, 0, 0.4); }

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.001s !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001s !important;
  }
  html { scroll-behavior: auto; }
  .reveal { opacity: 1; transform: none; }
}

/* ---------- Mobile nav (burger) ---------- */
.nav-toggle, .nav-burger { display: none; }

/* ---------- GUI dialog renderer (playground) ---------- */
#gui-root { position: fixed; inset: 0; z-index: 400; pointer-events: none; }
.gui-backdrop {
  position: fixed;
  inset: 0;
  z-index: 400;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(4, 8, 16, 0.68);
  backdrop-filter: blur(7px);
  -webkit-backdrop-filter: blur(7px);
  animation: fadeIn 0.18s ease both;
  pointer-events: auto;
}
.gui-modal {
  position: relative;
  width: min(440px, 100%);
  border-radius: 16px;
  border: 1px solid var(--border-strong);
  background: linear-gradient(180deg, #151f38, #0e1526);
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.65), 0 0 0 1px rgba(255, 255, 255, 0.02);
  overflow: hidden;
  animation: popIn 0.28s cubic-bezier(0.2, 0.8, 0.2, 1) both;
}
.gui-modal.gui-window-modal { width: min(560px, 100%); }
.gui-head {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 18px 12px;
}
.gui-ico {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  flex: none;
  display: grid;
  place-items: center;
  font-size: 16px;
  color: #fff;
}
.gui-ico .fa { margin: 0; }
.gui-kind-message .gui-ico { background: #6366f1; }
.gui-kind-info .gui-ico { background: #22d3ee; }
.gui-kind-warn .gui-ico { background: #f59e0b; }
.gui-kind-error .gui-ico { background: #ef4444; }
.gui-kind-confirm .gui-ico { background: #8b5cf6; }
.gui-kind-choice .gui-ico { background: #10b981; }
.gui-kind-input .gui-ico { background: #0ea5e9; }
.gui-kind-window .gui-ico { background: #6366f1; }

.gui-title { font-size: 15.5px; font-weight: 700; color: var(--text); }
.gui-msg {
  padding: 2px 18px 18px;
  color: #c6d2e8;
  font-size: 14px;
  line-height: 1.6;
  white-space: pre-wrap;
  word-break: break-word;
}
.gui-choices { display: flex; flex-wrap: wrap; gap: 8px; padding: 0 18px 18px; }
.gui-btn {
  padding: 9px 16px;
  border-radius: 9px;
  border: 1px solid var(--border-strong);
  background: #1b2742;
  color: var(--text);
  font: 600 13.5px var(--font);
  cursor: pointer;
  transition: transform 0.12s, background 0.15s;
}
.gui-btn:hover { background: #24335a; transform: translateY(-1px); }
.gui-btn.primary { background: var(--grad); color: #fff; border: none; }
.gui-btn.primary:hover { filter: brightness(1.08); }
.gui-btn.danger { background: rgba(239, 68, 68, 0.92); color: #fff; border: none; }
.gui-btn.danger:hover { filter: brightness(1.08); }
.gui-foot { display: flex; justify-content: flex-end; gap: 10px; padding: 0 18px 18px; }

.gui-window { display: flex; flex-direction: column; }
.gui-wchart {
  display: flex;
  gap: 7px;
  align-items: center;
  padding: 12px 18px;
  border-bottom: 1px solid var(--border);
  background: #101a2e;
}
.gui-wchart .c { width: 11px; height: 11px; border-radius: 50%; }
.gui-wchart .wt { margin-left: 10px; color: var(--text-dim); font: 600 13px var(--mono); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.gui-wbody {
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  overflow: auto;
  max-height: 58vh;
}
.gui-wbody .g-label { color: var(--text); font-size: 14px; }
.gui-wbody .g-input {
  width: 100%;
  background: #0b1330;
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px 12px;
  font: 13px var(--mono);
  outline: none;
}
.gui-wbody .g-input:focus { border-color: var(--indigo); }
.gui-wbody .g-sep { height: 1px; background: var(--border); }
.gui-wbody .g-btn2 { align-self: flex-start; }
.gui-wbody .g-note { color: var(--text-dim); font-size: 11.5px; }
.gui-wbody .g-image { max-width: 100%; border-radius: 10px; border: 1px solid var(--border); }

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
  .grid-4, .grid-3 { grid-template-columns: repeat(2, 1fr); }
  .doc-layout { grid-template-columns: 1fr; }
  .doc-nav {
    position: static;
    border-right: none;
    border-bottom: 1px solid var(--border);
    padding-bottom: 12px;
    margin-bottom: 20px;
    max-height: none;
  }
  .doc-nav h5 { margin-top: 10px; }

  .nav-burger {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 9px;
    border: 1px solid var(--border);
    color: var(--text);
    font-size: 17px;
    cursor: pointer;
    margin-left: auto;
  }
  .nav-toggle { position: absolute; opacity: 0; pointer-events: none; }
  .nav-toggle:checked + .nav-burger {
    color: var(--indigo-light);
    border-color: var(--border-strong);
    background: #15203a;
  }
  .nav-links {
    position: absolute;
    top: 66px;
    left: 0;
    right: 0;
    flex-direction: column;
    align-items: stretch;
    gap: 4px;
    padding: 14px 22px 20px;
    background: rgba(9, 14, 26, 0.985);
    backdrop-filter: blur(14px);
    border-bottom: 1px solid var(--border);
    box-shadow: 0 30px 50px rgba(0, 0, 0, 0.5);
    display: none;
  }
  .nav-toggle:checked ~ .nav-links { display: flex; }
  .nav-links a { padding: 10px 4px; font-size: 15px; }
  .nav-links .hide-mobile { display: block; }
  .nav-links .btn-sm { margin: 8px 0 0; width: max-content; }

  .toc-toggle, .toc-summary { display: flex; }
  .toc-summary {
    cursor: pointer;
    align-items: center;
    gap: 8px;
    padding: 10px 14px;
    border: 1px solid var(--border);
    border-radius: 10px;
    color: var(--text);
    font: 700 13.5px var(--font);
    background: #111a2e;
    margin-bottom: 4px;
    user-select: none;
  }
  .toc-summary .toc-caret { margin-left: auto; transition: transform 0.2s; }
  .toc-toggle:checked + .toc-summary .toc-caret { transform: rotate(180deg); }
  .toc-toggle:not(:checked) ~ .doc-nav-links { display: none; }
}
@media (max-width: 620px) {
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
  .doc-cols-2, .doc-cols-3 { grid-template-columns: 1fr; }
  .section { padding: 56px 0; }
  .hero { padding: 64px 0 16px; }
  .doc-layout { padding: 28px 16px 56px; gap: 20px; }
  .doc h1 { font-size: 26px; }
  .doc h2 { font-size: 20px; }
  .doc p, .doc li { font-size: 14.5px; }
  .codebox pre, pre.codebox { padding: 18px 18px; font-size: 12.5px; }
  .codebox::before { display: none; }
  .doc table.tbl, .tbl { display: block; width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .doc .lead { font-size: 16px; }
  .cta-band { padding: 34px 22px; }
  .hero .stat-row { gap: 14px; }
  .hero-banner { margin-top: 30px; }
  .mock-code { padding: 18px; font-size: 12.5px; }
  .footer { padding: 36px 0 44px; margin-top: 40px; }
  .footer-inner { gap: 18px; justify-content: flex-start; }
  .footer-links { gap: 12px; }
  .footer-links a, .footer-links span { font-size: 12.5px; }
  .pg-ribbon { padding: 8px 12px; gap: 7px; }
  .pg-ribbon select { width: 100%; }
  .pg-ribbon .btn { flex: 0 0 auto; }
  #terminal-wrap { height: 46%; }
  .pt-note { display: none; }
  .statusbar { padding: 0 12px; font-size: 11px; }
  .statusbar .st-r { flex-wrap: wrap; }
  .gui-msg { font-size: 13.5px; }
  .gui-btn { flex: 0 0 auto; }
}