/* FrankenPandas: shared base. Indigo-black from the pandas logo's ink, lime for the engine,
   pandas magenta and yellow as the second and third voices. */
@font-face {
  font-family: "Inter";
  src: url("/fonts/inter-latin.woff2") format("woff2");
  font-weight: 100 900;
  font-display: swap;
}
@font-face {
  font-family: "JetBrains Mono";
  src: url("/fonts/mono-latin.woff2") format("woff2");
  font-weight: 100 800;
  font-display: swap;
}

:root {
  --bg: #07061a;
  --bg-2: #0c0a25;
  --panel: rgba(22, 19, 52, 0.66);
  --panel-solid: #120f2e;
  --panel-2: rgba(32, 28, 72, 0.55);
  --line: rgba(178, 170, 255, 0.11);
  --line-2: rgba(178, 170, 255, 0.2);
  --text: #efeef8;
  --muted: #aeacca;
  --dim: #8a88ae;
  --lime: #b8f442;
  --lime-2: #8fd626;
  --pink: #ff5aa8;
  --gold: #ffd23f;
  --sky: #72cdff;
  --violet: #ab93ff;
  --tone: var(--lime);
  --ease: cubic-bezier(0.19, 1, 0.22, 1);
  --sans: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "JetBrains Mono", ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  --wrap: 1220px;
  --gutter: clamp(18px, 4vw, 40px);
  --r: 18px;
  --r-sm: 11px;
  color-scheme: dark;
}
[data-tone="lime"] { --tone: var(--lime); }
[data-tone="pink"] { --tone: var(--pink); }
[data-tone="gold"] { --tone: var(--gold); }
[data-tone="sky"] { --tone: var(--sky); }
[data-tone="violet"] { --tone: var(--violet); }

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; scroll-padding-top: 84px; }
@media (prefers-reduced-motion: no-preference) { html { scroll-behavior: smooth; } }
body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(1100px 620px at 8% -6%, rgba(184, 244, 66, 0.085), transparent 62%),
    radial-gradient(900px 600px at 98% 4%, rgba(255, 90, 168, 0.075), transparent 60%),
    radial-gradient(1200px 900px at 50% 120%, rgba(114, 205, 255, 0.05), transparent 60%),
    var(--bg);
  background-attachment: fixed;
  color: var(--text);
  font: 400 17px/1.62 var(--sans);
  font-feature-settings: "cv11", "ss01", "ss03";
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: clip;
}
/* Film grain, very light. */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 100;
  opacity: 0.05;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}
body.solid { background: var(--bg); }

a { color: inherit; text-decoration-color: color-mix(in srgb, currentColor 40%, transparent); text-underline-offset: 3px; }
a:hover { text-decoration-color: currentColor; }
p a, li a, dd a { color: var(--text); text-decoration-line: underline; }
code, pre, kbd { font-family: var(--mono); font-size: 0.88em; }
:not(pre) > code {
  padding: 0.08em 0.36em;
  border-radius: 6px;
  background: rgba(178, 170, 255, 0.1);
  border: 1px solid var(--line);
  white-space: nowrap;
}
::selection { background: rgba(184, 244, 66, 0.3); color: #fff; }
:focus-visible { outline: 2px solid var(--lime); outline-offset: 3px; border-radius: 6px; }
img, svg { max-width: 100%; }
button { font: inherit; color: inherit; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.wrap { width: min(var(--wrap), 100% - 2 * var(--gutter)); margin-inline: auto; }
.muted { color: var(--muted); }

.skip {
  position: absolute;
  left: 12px;
  top: -60px;
  z-index: 200;
  padding: 10px 14px;
  border-radius: 10px;
  background: var(--lime);
  color: #0b0a1d;
  font-weight: 650;
  text-decoration: none;
}
.skip:focus { top: 12px; }

/* ---------- Type ---------- */
.d1, .d2 { margin: 0; font-weight: 760; letter-spacing: -0.045em; text-wrap: balance; }
.d1 { font-size: clamp(2.7rem, 7.2vw, 5.9rem); line-height: 0.94; }
.d2 { font-size: clamp(2rem, 4.4vw, 3.5rem); line-height: 1.02; }
.d1 em, .d2 em { font-style: normal; }
.g {
  background: linear-gradient(100deg, var(--lime) 0%, #d9f77c 38%, var(--sky) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
[data-tone="pink"] .g { background-image: linear-gradient(100deg, var(--pink), #ffa3cf 55%, var(--gold)); }
[data-tone="gold"] .g { background-image: linear-gradient(100deg, var(--gold), #fff0a8 50%, var(--lime)); }
[data-tone="sky"] .g { background-image: linear-gradient(100deg, var(--sky), #bfe8ff 50%, var(--violet)); }
[data-tone="violet"] .g { background-image: linear-gradient(100deg, var(--violet), #d8ccff 50%, var(--pink)); }
.stop { color: var(--pink); }
code.h { font-size: 0.82em; padding: 0.02em 0.22em; border-radius: 10px; letter-spacing: -0.02em; }
.lede { color: var(--muted); font-size: clamp(1.04rem, 1.3vw, 1.18rem); line-height: 1.62; max-width: 68ch; text-wrap: pretty; }
.lede code { color: var(--text); }

.kick, .eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 20px;
  padding: 6px 13px 6px 11px;
  border: 1px solid var(--line-2);
  border-radius: 999px;
  background: rgba(20, 17, 48, 0.6);
  font: 600 11.5px/1.2 var(--mono);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
}
.kick .dot, .chapters .dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--tone);
  box-shadow: 0 0 12px var(--tone);
}
.eyebrow { gap: 0; padding: 0; overflow: hidden; }
.eyebrow span { padding: 6px 12px; border-left: 1px solid var(--line-2); }
.eyebrow span:first-child { border-left: 0; color: var(--lime); }
.eyebrow span { white-space: nowrap; }
/* Too narrow for one pill: each fact becomes its own. */
@media (max-width: 560px) {
  .eyebrow { flex-wrap: wrap; gap: 6px; border: 0; background: none; overflow: visible; letter-spacing: 0.1em; }
  .eyebrow span { border: 1px solid var(--line-2); border-radius: 999px; background: rgba(20, 17, 48, 0.6); padding: 5px 10px; }
  .eyebrow span:first-child { border-left: 1px solid var(--line-2); }
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  min-height: 46px;
  padding: 0 20px;
  border-radius: 13px;
  border: 1px solid transparent;
  font-weight: 640;
  font-size: 15.5px;
  letter-spacing: -0.01em;
  text-decoration: none;
  cursor: pointer;
  transition: transform 0.4s var(--ease), background-color 0.25s, border-color 0.25s, box-shadow 0.4s var(--ease);
  white-space: nowrap;
}
.btn .i { width: 18px; height: 18px; }
.btn.go { background: var(--lime); color: #0c0b1f; box-shadow: 0 8px 30px -10px rgba(184, 244, 66, 0.55); }
.btn.go:hover { background: #c9fb64; transform: translateY(-1px); box-shadow: 0 12px 34px -10px rgba(184, 244, 66, 0.7); }
.btn.ghost { background: rgba(178, 170, 255, 0.06); border-color: var(--line-2); color: var(--text); }
.btn.ghost:hover { background: rgba(178, 170, 255, 0.12); border-color: rgba(178, 170, 255, 0.34); }
.btn.sm { min-height: 38px; padding: 0 14px; font-size: 14px; border-radius: 11px; }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: 0.55; cursor: progress; }
.i { width: 20px; height: 20px; flex: none; }

/* ---------- Header ---------- */
.top {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(7, 6, 26, 0.72);
  backdrop-filter: saturate(150%) blur(14px);
  -webkit-backdrop-filter: saturate(150%) blur(14px);
  border-bottom: 1px solid var(--line);
}
.bar { display: flex; align-items: center; gap: 18px; height: 64px; width: min(1380px, 100% - 2 * var(--gutter)); margin-inline: auto; }
.brand { display: inline-flex; align-items: center; gap: 10px; font-weight: 720; letter-spacing: -0.02em; font-size: 17px; text-decoration: none; flex: none; }
.mark { width: 34px; height: 30px; overflow: visible; }
.mark .frame { fill: rgba(184, 244, 66, 0.06); stroke: var(--lime); stroke-width: 1.6; }
.mark .rule { stroke: rgba(184, 244, 66, 0.55); stroke-width: 1.3; fill: none; }
.mark .seam { stroke: var(--pink); stroke-width: 1.3; stroke-dasharray: 2.2 2.2; fill: none; }
.mark .stitch { stroke: var(--pink); stroke-width: 1.5; stroke-linecap: round; fill: none; }
.mark .idx { stroke: rgba(239, 238, 248, 0.45); stroke-width: 1.5; stroke-linecap: round; }
.mark .cells rect { fill: var(--lime); transition: opacity 0.6s var(--ease); }
.mark .cells rect.na { fill: var(--gold); }
.js .mark .cells rect { opacity: 0.18; }
.js .mark .cells rect.on { opacity: 1; }

.chapters { display: flex; align-items: center; gap: 2px; margin-inline: auto; }
.chapters a {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 11px;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 560;
  color: var(--muted);
  text-decoration: none;
  transition: color 0.2s, background-color 0.2s;
}
.chapters a .dot { box-shadow: none; opacity: 0.75; }
.chapters a:hover { color: var(--text); background: rgba(178, 170, 255, 0.07); }
.chapters a[aria-current] { color: var(--text); background: rgba(178, 170, 255, 0.1); }
.chapters a[aria-current] .dot { opacity: 1; box-shadow: 0 0 10px var(--tone); }
.tools { display: flex; align-items: center; gap: 8px; flex: none; margin-left: auto; }
.chapters + .tools { margin-left: 0; }
.menu { position: relative; display: none; }
.menu summary {
  list-style: none;
  display: grid;
  place-items: center;
  width: 42px;
  height: 40px;
  border-radius: 11px;
  border: 1px solid var(--line-2);
  cursor: pointer;
}
.menu summary::-webkit-details-marker { display: none; }
.menu[open] summary { background: rgba(178, 170, 255, 0.1); }
.menu nav {
  position: absolute;
  right: 0;
  top: calc(100% + 10px);
  display: grid;
  gap: 2px;
  min-width: 230px;
  padding: 8px;
  border-radius: 16px;
  border: 1px solid var(--line-2);
  background: rgba(16, 13, 40, 0.97);
  box-shadow: 0 30px 80px -20px rgba(0, 0, 0, 0.7);
}
.menu nav a:not(.btn) { display: flex; align-items: center; gap: 10px; padding: 11px 12px; border-radius: 10px; text-decoration: none; color: var(--muted); font-weight: 560; }
.menu nav a:not(.btn):hover, .menu nav a[aria-current] { background: rgba(178, 170, 255, 0.09); color: var(--text); }
.menu nav .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--tone); }
.menu nav .btn { margin-top: 6px; }
.progress { position: absolute; left: 0; right: 0; bottom: -1px; height: 2px; pointer-events: none; }
.progress i { display: block; height: 100%; width: 100%; transform-origin: 0 50%; transform: scaleX(var(--p, 0)); background: linear-gradient(90deg, var(--lime), var(--sky), var(--pink)); }

/* The chapter list already ends with Install; the button appears only once the list is folded away. */
@media (min-width: 1181px) { .chapters:not(:empty) ~ .tools .install { display: none; } }
@media (max-width: 1180px) {
  .chapters { display: none; }
  .menu { display: block; }
}
@media (max-width: 560px) {
  .tools .install { display: none; }
  .tools .btn.go span { display: none; }
  .tools .btn.go { width: 42px; padding: 0; }
  .brand { font-size: 16px; }
}

/* ---------- Footer ---------- */
.end { margin-top: clamp(60px, 10vw, 120px); border-top: 1px solid var(--line); padding: 34px 0 calc(40px + env(safe-area-inset-bottom)); color: var(--dim); font-size: 14px; }
.end .wrap { display: grid; grid-template-columns: auto 1fr auto; gap: 28px; align-items: center; }
.end p { margin: 0; max-width: 62ch; }
.end nav { display: flex; flex-wrap: wrap; gap: 6px 18px; }
.end nav a { color: var(--muted); text-decoration: none; padding: 8px 0; }
.end nav a:hover { color: var(--text); }
@media (max-width: 860px) { .end .wrap { grid-template-columns: 1fr; gap: 16px; } }
