:root {
  --bg: #0b0d10;
  --bg-elev: #12161c;
  --bg-elev-2: #181e27;
  --line: rgba(255, 255, 255, 0.08);
  --line-strong: rgba(255, 255, 255, 0.14);
  --text: #e8edf5;
  --muted: #93a0b5;
  --faint: #6b778c;
  --accent: #5eead4;
  --accent-2: #38bdf8;
  --accent-dim: rgba(94, 234, 212, 0.12);
  --warn: #fbbf24;
  --bad: #fb7185;
  --good: #4ade80;
  --coredis: #5eead4;
  --redispy: #94a3b8;
  --radius: 14px;
  --shadow: 0 24px 80px rgba(0, 0, 0, 0.45);
  --font: "Instrument Sans", system-ui, sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, monospace;
  --header-h: 64px;
}

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

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.55;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

.noise {
  pointer-events: none;
  position: fixed;
  inset: 0;
  z-index: 0;
  opacity: 0.035;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

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

code,
pre {
  font-family: var(--mono);
}

/* Header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  height: var(--header-h);
  display: flex;
  align-items: center;
  gap: 1.5rem;
  padding: 0 1.5rem;
  background: rgba(11, 13, 16, 0.82);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--text);
  text-decoration: none;
  font-weight: 600;
}
.brand:hover {
  text-decoration: none;
}
.brand-mark {
  color: var(--accent);
  font-size: 0.95rem;
}
.brand-tag {
  font-size: 0.7rem;
  font-weight: 500;
  color: var(--faint);
  border: 1px solid var(--line);
  padding: 0.1rem 0.4rem;
  border-radius: 999px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.nav {
  display: flex;
  gap: 1.1rem;
  margin-left: 0.5rem;
  flex: 1;
}
.nav a {
  color: var(--muted);
  font-size: 0.92rem;
  text-decoration: none;
}
.nav a:hover {
  color: var(--text);
}

.header-status {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.8rem;
  color: var(--muted);
  font-family: var(--mono);
}
.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--faint);
  box-shadow: 0 0 0 3px rgba(148, 163, 184, 0.15);
}
.header-status.ok .status-dot {
  background: var(--good);
  box-shadow: 0 0 0 3px rgba(74, 222, 128, 0.18);
}
.header-status.bad .status-dot {
  background: var(--bad);
  box-shadow: 0 0 0 3px rgba(251, 113, 133, 0.18);
}

/* Hero */
.hero {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 2.5rem;
  padding: 4rem 1.5rem 3rem;
  max-width: 1180px;
  margin: 0 auto;
}

.hero::before {
  content: "";
  position: absolute;
  inset: -20% 10% auto -10%;
  height: 70%;
  background:
    radial-gradient(ellipse at 20% 30%, rgba(94, 234, 212, 0.14), transparent 55%),
    radial-gradient(ellipse at 80% 0%, rgba(56, 189, 248, 0.12), transparent 50%);
  z-index: -1;
  pointer-events: none;
}

.eyebrow {
  font-family: var(--mono);
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
  margin: 0 0 0.85rem;
}

.hero h1 {
  font-size: clamp(2.2rem, 4.5vw, 3.4rem);
  line-height: 1.08;
  letter-spacing: -0.03em;
  font-weight: 700;
  margin: 0 0 1.1rem;
}
.hero h1 em {
  font-style: italic;
  font-weight: 500;
  background: linear-gradient(120deg, var(--accent), var(--accent-2));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.lead {
  font-size: 1.08rem;
  color: var(--muted);
  max-width: 38rem;
  margin: 0 0 1.5rem;
}
.lead strong {
  color: var(--text);
  font-weight: 600;
}

.hero-cta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  margin-bottom: 2rem;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.7rem 1.15rem;
  border-radius: 999px;
  font-weight: 600;
  font-size: 0.95rem;
  border: 1px solid transparent;
  cursor: pointer;
  text-decoration: none;
  transition: transform 0.15s ease, background 0.15s ease, border-color 0.15s ease;
}
.btn:hover {
  text-decoration: none;
  transform: translateY(-1px);
}
.btn.primary {
  background: linear-gradient(135deg, #2dd4bf, #22d3ee);
  color: #042f2e;
}
.btn.ghost {
  background: transparent;
  border-color: var(--line-strong);
  color: var(--text);
}
.btn.ghost:hover {
  border-color: var(--accent);
  color: var(--accent);
}
.btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
  transform: none;
}
.btn.small {
  padding: 0.45rem 0.85rem;
  font-size: 0.85rem;
}

.hero-stats {
  list-style: none;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.75rem;
  padding: 0;
  margin: 0;
}
.hero-stats li {
  background: var(--bg-elev);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 0.75rem 0.85rem;
}
.hero-stats span {
  display: block;
  font-weight: 600;
  font-size: 0.92rem;
}
.hero-stats small {
  color: var(--faint);
  font-size: 0.75rem;
}

.terminal {
  background: var(--bg-elev);
  border: 1px solid var(--line);
  border-radius: calc(var(--radius) + 4px);
  box-shadow: var(--shadow);
  overflow: hidden;
}
.terminal-bar {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.7rem 0.9rem;
  border-bottom: 1px solid var(--line);
  background: var(--bg-elev-2);
}
.terminal-bar span {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #334155;
}
.terminal-bar span:nth-child(1) {
  background: #fb7185;
}
.terminal-bar span:nth-child(2) {
  background: #fbbf24;
}
.terminal-bar span:nth-child(3) {
  background: #4ade80;
}
.terminal-bar code {
  margin-left: auto;
  color: var(--faint);
  font-size: 0.75rem;
}
.terminal-body {
  margin: 0;
  padding: 1.1rem 1.15rem 1.25rem;
  font-size: 0.8rem;
  line-height: 1.65;
  overflow-x: auto;
  color: #cbd5e1;
}
.terminal-body .kw {
  color: #c084fc;
}
.terminal-body .fn {
  color: #67e8f9;
}
.terminal-body .str {
  color: #86efac;
}
.terminal-body .num {
  color: #fcd34d;
}
.terminal-body .bool {
  color: #f9a8d4;
}
.terminal-body .tp {
  color: #7dd3fc;
}
.terminal-body .cm {
  color: #64748b;
}

/* Sections */
.section {
  position: relative;
  z-index: 1;
  padding: 4rem 1.5rem;
  max-width: 1180px;
  margin: 0 auto;
}
.section.alt {
  max-width: none;
  padding-left: 0;
  padding-right: 0;
  background: linear-gradient(180deg, rgba(18, 22, 28, 0.65), rgba(11, 13, 16, 0));
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}
.section.alt > * {
  max-width: 1180px;
  margin-left: auto;
  margin-right: auto;
  padding-left: 1.5rem;
  padding-right: 1.5rem;
}

.section-head {
  margin-bottom: 2rem;
  max-width: 46rem;
}
.section-head h2 {
  margin: 0 0 0.6rem;
  font-size: clamp(1.6rem, 3vw, 2.15rem);
  letter-spacing: -0.02em;
}
.section-lead {
  margin: 0;
  color: var(--muted);
}
.section-lead code {
  font-size: 0.88em;
  background: var(--accent-dim);
  color: var(--accent);
  padding: 0.1em 0.35em;
  border-radius: 4px;
}

/* Demos */
.demo-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1.1rem;
}

.demo-card {
  background: var(--bg-elev);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.15rem 1.2rem 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  min-height: 280px;
}
.demo-card h3 {
  margin: 0;
  font-size: 1.1rem;
}
.demo-card .blurb {
  margin: 0;
  color: var(--muted);
  font-size: 0.92rem;
  flex: 0;
}
.demo-controls {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.55rem;
}
.demo-controls label {
  font-size: 0.8rem;
  color: var(--faint);
  font-family: var(--mono);
  display: flex;
  align-items: center;
  gap: 0.4rem;
}
.demo-controls input[type="number"] {
  width: 5.5rem;
  background: var(--bg);
  border: 1px solid var(--line-strong);
  color: var(--text);
  border-radius: 8px;
  padding: 0.35rem 0.5rem;
  font-family: var(--mono);
  font-size: 0.85rem;
}

.bars {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  margin-top: 0.25rem;
}
.bar-row {
  display: grid;
  grid-template-columns: 9.5rem 1fr auto;
  gap: 0.6rem;
  align-items: center;
  font-size: 0.8rem;
}
.bar-row .name {
  color: var(--muted);
  font-family: var(--mono);
  font-size: 0.72rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.bar-track {
  height: 10px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 999px;
  overflow: hidden;
}
.bar-fill {
  height: 100%;
  width: 0%;
  border-radius: 999px;
  transition: width 0.55s cubic-bezier(0.2, 0.8, 0.2, 1);
  background: linear-gradient(90deg, #64748b, #94a3b8);
}
.bar-fill.coredis,
.bar-fill.winner {
  background: linear-gradient(90deg, #14b8a6, #5eead4);
}
.bar-fill.redis-py,
.bar-fill.coredis-uncached {
  background: linear-gradient(90deg, #475569, #94a3b8);
}
.bar-meta {
  font-family: var(--mono);
  color: var(--text);
  font-size: 0.72rem;
  min-width: 7.5rem;
  text-align: right;
}

.demo-meta {
  margin: 0;
  font-size: 0.8rem;
  color: var(--faint);
  line-height: 1.45;
}
.demo-meta strong {
  color: var(--accent);
  font-weight: 600;
}
.demo-error {
  color: var(--bad);
  font-size: 0.85rem;
  margin: 0;
}
.demo-loading {
  color: var(--accent-2);
  font-family: var(--mono);
  font-size: 0.8rem;
}

/* Investigations */
.invest-layout {
  display: grid;
  grid-template-columns: 240px 1fr;
  gap: 1.25rem;
  align-items: start;
}
.invest-nav {
  position: sticky;
  top: calc(var(--header-h) + 1rem);
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}
.invest-nav button {
  text-align: left;
  background: transparent;
  border: 1px solid transparent;
  color: var(--muted);
  padding: 0.65rem 0.8rem;
  border-radius: 10px;
  cursor: pointer;
  font: inherit;
  font-size: 0.9rem;
}
.invest-nav button:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.03);
}
.invest-nav button.active {
  color: var(--text);
  background: var(--accent-dim);
  border-color: rgba(94, 234, 212, 0.25);
}

.invest-panel {
  background: var(--bg-elev);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.4rem 1.5rem 1.6rem;
  min-height: 420px;
}
.invest-panel .eyebrow {
  margin-bottom: 0.4rem;
}
.invest-panel h3 {
  margin: 0 0 0.75rem;
  font-size: 1.35rem;
  letter-spacing: -0.02em;
}
.invest-panel .summary {
  color: var(--muted);
  margin: 0 0 1rem;
}
.invest-panel h4 {
  margin: 1.1rem 0 0.45rem;
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--faint);
}
.why {
  margin: 0;
  color: var(--text);
}
.code-compare {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
  margin-top: 0.5rem;
}
.code-block {
  background: #0a0c0f;
  border: 1px solid var(--line);
  border-radius: 10px;
  overflow: hidden;
}
.code-block header {
  padding: 0.45rem 0.75rem;
  font-size: 0.72rem;
  font-family: var(--mono);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  border-bottom: 1px solid var(--line);
  color: var(--faint);
}
.code-block.good header {
  color: var(--accent);
}
.code-block pre {
  margin: 0;
  padding: 0.85rem;
  font-size: 0.75rem;
  line-height: 1.55;
  overflow-x: auto;
  color: #cbd5e1;
  white-space: pre-wrap;
}
.verdict {
  margin: 1.15rem 0 0;
  padding: 0.85rem 1rem;
  border-left: 3px solid var(--accent);
  background: var(--accent-dim);
  border-radius: 0 10px 10px 0;
  color: var(--text);
  font-size: 0.95rem;
}

/* Table */
.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--bg-elev);
}
.compare-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.92rem;
  min-width: 640px;
}
.compare-table th,
.compare-table td {
  padding: 0.85rem 1rem;
  text-align: left;
  border-bottom: 1px solid var(--line);
}
.compare-table th {
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--faint);
  background: var(--bg-elev-2);
}
.compare-table tr:last-child td {
  border-bottom: none;
}
.compare-table .hl {
  background: rgba(94, 234, 212, 0.05);
}
.compare-table th.hl {
  color: var(--accent);
}
.compare-table .yes {
  color: var(--good);
  font-weight: 600;
}
.compare-table .mid {
  color: var(--warn);
}
.compare-table .no {
  color: var(--faint);
}

/* Use cases */
.use-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
}
.use-card {
  background: var(--bg-elev);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.15rem;
}
.use-card h3 {
  margin: 0 0 0.5rem;
  font-size: 1.05rem;
}
.use-card p {
  margin: 0 0 0.85rem;
  color: var(--muted);
  font-size: 0.92rem;
}
.use-card code {
  display: inline-block;
  font-size: 0.75rem;
  color: var(--accent);
  background: var(--accent-dim);
  padding: 0.25rem 0.5rem;
  border-radius: 6px;
}

/* Start */
.start-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
}
.start-card {
  background: var(--bg-elev);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1rem 1.1rem 1.15rem;
}
.start-card h3 {
  margin: 0 0 0.65rem;
  font-size: 1rem;
}
.start-card pre {
  margin: 0;
  background: #0a0c0f;
  border-radius: 10px;
  padding: 0.85rem;
  font-size: 0.78rem;
  line-height: 1.55;
  overflow-x: auto;
  color: #cbd5e1;
  border: 1px solid var(--line);
}
.footnote {
  margin: 1.5rem 0 0;
  color: var(--faint);
  font-size: 0.9rem;
}

.site-footer {
  position: relative;
  z-index: 1;
  padding: 2rem 1.5rem 3rem;
  text-align: center;
  color: var(--faint);
  font-size: 0.88rem;
  border-top: 1px solid var(--line);
}
.site-footer a {
  color: var(--muted);
}

/* Responsive */
@media (max-width: 960px) {
  .hero {
    grid-template-columns: 1fr;
    padding-top: 2.5rem;
  }
  .hero-stats {
    grid-template-columns: repeat(2, 1fr);
  }
  .nav {
    display: none;
  }
  .demo-grid,
  .use-grid,
  .start-grid,
  .code-compare {
    grid-template-columns: 1fr;
  }
  .invest-layout {
    grid-template-columns: 1fr;
  }
  .invest-nav {
    position: static;
    flex-direction: row;
    flex-wrap: wrap;
  }
  .bar-row {
    grid-template-columns: 1fr;
    gap: 0.25rem;
  }
  .bar-meta {
    text-align: left;
  }
}
