/* ==========================================================================
   personal_db — shared site styles
   Design model: photon.codes (spectrum hero, huge light headlines, dark UI)
   Brand voice: product's own brutalist mono dashboard (see assets/dashboard.png)
   ========================================================================== */

:root {
  --bg: #000;
  --fg: #fff;
  --fg-secondary: #9ca3af;
  --fg-tertiary: #6b7280;
  --card-bg: #0a0a0a;
  --card-bg-2: #111;
  --border: rgba(255, 255, 255, 0.08);
  --border-strong: rgba(255, 255, 255, 0.15);
  --blue: #2563eb;
  --blue-deep: #1d4ed8;
  --blue-bright: #3b82f6;
  --orange: #f97316;
  --green: #22c55e;

  --font-head: "Space Grotesk", sans-serif;
  --font-body: "Inter", sans-serif;
  --font-mono: "JetBrains Mono", monospace;

  --container: 1200px;
  --section-pad: clamp(88px, 10vw, 140px);
  --radius-lg: 20px;
  --radius-md: 16px;
  --radius-sm: 10px;
}

* {
  box-sizing: border-box;
}

html {
  background: var(--bg);
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

img {
  max-width: 100%;
  display: block;
}

a {
  color: inherit;
  text-decoration: none;
}

ul {
  margin: 0;
  padding: 0;
  list-style: none;
}

p {
  margin: 0;
}

h1, h2, h3, h4 {
  margin: 0;
  font-family: var(--font-head);
  font-weight: 400;
  letter-spacing: -0.02em;
}

button {
  font-family: inherit;
  cursor: pointer;
}

:focus-visible {
  outline: 2px solid var(--blue-bright);
  outline-offset: 3px;
  border-radius: 4px;
}

.container {
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 24px;
}

@media (min-width: 900px) {
  .container {
    padding: 0 40px;
  }
}

.mono {
  font-family: var(--font-mono);
}

.overline {
  display: block;
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.08em;
  color: var(--fg-tertiary);
  margin-bottom: 14px;
}

.section {
  padding: var(--section-pad) 0;
  border-bottom: 1px solid var(--border);
  position: relative;
}

.section:last-of-type {
  border-bottom: none;
}

/* ==========================================================================
   Light theme scope — black bookends, light body.
   The hero, manifesto, install section, nav, and footer stay on the dark
   :root palette. Sections carrying .light re-scope the semantic variables
   to a warm paper theme; every component below is written against these
   variables (not literal colors) so it re-themes automatically.
   ========================================================================== */

.light {
  --bg: #f7f6f3;
  --card-bg: #ffffff;
  --card-bg-2: #ffffff;
  --fg: #171a1f;
  --fg-secondary: #5a626d;
  --fg-tertiary: #9aa1ab;
  --border: #e6e3dc;
  --border-strong: #d5d1c7;
  background: var(--bg);
  color: var(--fg);
}

.section-head {
  max-width: 720px;
  margin-bottom: 56px;
}

.section-head h2 {
  font-size: clamp(1.9rem, 4vw, 2.75rem);
  line-height: 1.15;
  font-weight: 300;
}

.section-head h2 .dim {
  color: var(--fg-secondary);
}

.section-sub {
  margin-top: 18px;
  color: var(--fg-secondary);
  font-size: 1.05rem;
  max-width: 640px;
  line-height: 1.65;
}

/* ==========================================================================
   Buttons / Pills
   ========================================================================== */

.pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 14px 26px;
  border-radius: 999px;
  font-size: 0.95rem;
  border: 1px solid transparent;
  transition: transform 0.18s ease, border-color 0.18s ease, background 0.18s ease, opacity 0.18s ease;
  white-space: nowrap;
}

.pill:hover {
  transform: translateY(-1px);
}

.pill-white {
  background: #fff;
  color: #000;
  font-family: var(--font-body);
  font-weight: 600;
}

.pill-white:hover {
  opacity: 0.88;
}

.pill-ghost {
  background: transparent;
  color: var(--fg);
  border-color: var(--border-strong);
  font-family: var(--font-body);
  font-weight: 500;
}

.pill-ghost:hover {
  border-color: rgba(255, 255, 255, 0.4);
  background: rgba(255, 255, 255, 0.04);
}

.pill-command {
  background: linear-gradient(135deg, var(--blue-deep), var(--blue));
  color: #fff;
  font-family: var(--font-mono);
  font-size: 0.85rem;
  border: none;
  padding: 12px 18px;
  gap: 12px;
  position: relative;
  box-shadow: 0 8px 30px -12px rgba(37, 99, 235, 0.6);
  max-width: 100%;
  white-space: normal;
}

.pill-command .cmd-text {
  white-space: normal;
  word-break: break-word;
}

.pill-command:hover {
  box-shadow: 0 10px 34px -10px rgba(37, 99, 235, 0.75);
}

.pill-command .copy-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.15);
  flex-shrink: 0;
  font-size: 12px;
}

.pill-command .copy-flash {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #16a34a;
  border-radius: 999px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
  font-family: var(--font-mono);
  font-size: 0.85rem;
}

.pill-command.copied .copy-flash {
  opacity: 1;
}

.cta-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 16px;
  margin-top: 40px;
}

/* ==========================================================================
   Nav
   ========================================================================== */

.site-nav {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(0, 0, 0, 0.72);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border);
}

.site-nav .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 72px;
}

.wordmark {
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 1rem;
  letter-spacing: -0.01em;
  transition: opacity 0.15s ease;
}

.wordmark:hover {
  opacity: 0.75;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 36px;
}

.nav-links a:not(.pill) {
  font-size: 0.92rem;
  color: var(--fg-secondary);
  transition: color 0.15s ease;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.nav-links a:not(.pill):hover {
  color: var(--fg);
}

.nav-right {
  display: flex;
  align-items: center;
  gap: 28px;
}

.star-icon {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
}

.nav-menu-toggle {
  display: none;
}

/* ==========================================================================
   Hero + spectrum cascade
   ========================================================================== */

.hero {
  position: relative;
  padding: 160px 0 120px;
  overflow: hidden;
  border-bottom: 1px solid var(--border);
}

.hero-inner {
  position: relative;
  z-index: 2;
  max-width: 760px;
}

.hero h1 {
  font-size: clamp(2.5rem, 6vw, 4.5rem);
  line-height: 1.05;
  font-weight: 400;
}

.hero-sub {
  margin-top: 28px;
  color: var(--fg-secondary);
  font-size: 1.15rem;
  line-height: 1.7;
  max-width: 640px;
}

.hero-sub .glyph {
  margin-right: 2px;
}

.hero-meta {
  margin-top: 22px;
  color: var(--fg-tertiary);
  font-size: 0.85rem;
}

.spectrum-field {
  position: absolute;
  inset: -10% -20% -30% 30%;
  z-index: 1;
  pointer-events: none;
}

.spectrum-card {
  position: absolute;
  border-radius: 18px;
  border: 1px solid rgba(255, 255, 255, 0.15);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  display: flex;
  align-items: flex-end;
  padding: 14px;
  font-family: var(--font-mono);
  font-size: 12px;
  color: rgba(255, 255, 255, 0.75);
  animation: floaty 8s ease-in-out infinite alternate;
  will-change: transform;
}

.spectrum-card span {
  white-space: nowrap;
}

@keyframes floaty {
  from {
    transform: translateY(0) rotate(var(--rot, 0deg));
  }
  to {
    transform: translateY(-9px) rotate(var(--rot, 0deg));
  }
}

@media (prefers-reduced-motion: reduce) {
  .spectrum-card {
    animation: none;
  }
}

/* ==========================================================================
   Payoff section — tabs
   ========================================================================== */

.tab-bar {
  display: inline-flex;
  padding: 6px;
  gap: 4px;
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 999px;
  margin-bottom: 48px;
}

.tab-btn {
  border: none;
  background: transparent;
  color: var(--fg-secondary);
  font-family: var(--font-mono);
  font-size: 0.85rem;
  padding: 10px 22px;
  border-radius: 999px;
  transition: background 0.2s ease, color 0.2s ease;
}

.tab-btn:hover {
  color: var(--fg);
}

.tab-btn.active {
  background: var(--fg);
  color: var(--card-bg);
}

.tab-panels {
  position: relative;
}

.tab-panel {
  display: none;
}

.tab-panel.active {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 28px;
  align-items: stretch;
  animation: tabIn 0.35s ease;
}

@keyframes tabIn {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.editor-card,
.result-card {
  border-radius: var(--radius-lg);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

/* .editor-card (the fake terminal/claude window) is hardcoded dark on
   purpose — it stays dark even inside .light sections, unlike .result-card
   which re-themes via the semantic vars below. */
.editor-card {
  background: #0a0a0a;
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.result-card {
  background: var(--card-bg);
  border: 1px solid var(--border);
}

.editor-head {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 14px 18px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.dot {
  width: 11px;
  height: 11px;
  border-radius: 50%;
  display: inline-block;
}

.dot-red { background: #ff5f57; }
.dot-yellow { background: #febc2e; }
.dot-green { background: #28c840; }

.editor-title {
  margin-left: 8px;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: #6b7280;
}

.editor-body {
  padding: 22px;
  font-family: var(--font-mono);
  font-size: 0.85rem;
  line-height: 1.75;
  overflow-x: auto;
}

.editor-body .prompt-line {
  color: #fff;
  margin-bottom: 18px;
}

.editor-body .prompt-line::before {
  content: "> ";
  color: #6b7280;
}

.editor-body .call-line {
  color: var(--orange);
  margin-bottom: 6px;
}

.editor-body .call-line .call-label {
  color: #9ca3af;
}

.editor-body pre {
  margin: 0;
  white-space: pre-wrap;
  word-break: break-word;
  color: #93c5fd;
  font-family: var(--font-mono);
  font-size: 0.82rem;
}

.result-card {
  padding: 24px;
  gap: 18px;
  justify-content: flex-start;
}

.answer-bubble {
  background: var(--card-bg-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 18px 20px;
}

.answer-head {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--fg-secondary);
}

.answer-head .dot-glow {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--orange);
  box-shadow: 0 0 8px 1px rgba(249, 115, 22, 0.7);
}

.answer-text {
  font-size: 0.92rem;
  line-height: 1.65;
  color: var(--fg);
}

/* paired bar chart */
.bar-chart {
  display: flex;
  align-items: flex-end;
  gap: 14px;
  height: 160px;
  padding: 18px 4px 0;
}

.bar-group {
  flex: 1;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: 4px;
  height: 100%;
}

.bar {
  width: 40%;
  border-radius: 4px 4px 0 0;
  transition: transform 0.2s ease;
}

.bar-sleep { background: #38bdf8; }
.bar-commits { background: var(--orange); }

.bar-group:hover .bar {
  transform: scaleY(1.02);
}

.bar-labels {
  display: flex;
  gap: 14px;
  padding: 0 4px;
}

.bar-labels span {
  flex: 1;
  text-align: center;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--fg-tertiary);
}

.chart-legend {
  display: flex;
  gap: 20px;
  margin-top: 14px;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--fg-secondary);
}

.chart-legend span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.chart-legend .swatch {
  width: 9px;
  height: 9px;
  border-radius: 2px;
}

/* checklist (tab 2) */
.checklist {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.checklist li,
.checklist .check-item {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  font-size: 0.9rem;
  line-height: 1.6;
  padding: 4px 0;
}

.check-box {
  flex-shrink: 0;
  width: 16px;
  height: 16px;
  border-radius: 4px;
  border: 1px solid var(--border-strong);
  margin-top: 3px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
}

.check-box.done {
  background: var(--green);
  border-color: var(--green);
  color: #000;
}

.check-text strong {
  color: var(--fg);
  font-weight: 600;
}

.check-meta {
  color: var(--fg-tertiary);
  font-size: 0.8rem;
}

/* streak card (tab 3) — brutalist white, matches dashboard.png */
.streak-card {
  background: #fff;
  color: #000;
  border-radius: var(--radius-md);
  padding: 22px 24px;
  font-family: var(--font-mono);
  border: 1px solid var(--border);
}

/* On the light-themed payoff section var(--border) is a near-white hairline
   against a near-white page — bump to the stronger border so the brutalist
   white card still reads as a distinct card. */
.light .streak-card {
  border-color: var(--border-strong);
}

.streak-title {
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  border-bottom: 2px solid #000;
  padding-bottom: 10px;
  margin-bottom: 14px;
}

.streak-stats {
  display: flex;
  gap: 28px;
  flex-wrap: wrap;
  margin-bottom: 18px;
}

.streak-stat .num {
  font-size: 1.5rem;
  font-weight: 700;
  display: block;
}

.streak-stat .label {
  font-size: 0.7rem;
  color: #4b5563;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.heatmap {
  display: flex;
  gap: 4px;
}

.heatmap .cell {
  width: 18px;
  height: 18px;
  border-radius: 3px;
  background: #e5e7eb;
}

.heatmap .cell[data-level="1"] { background: #9ca3af; }
.heatmap .cell[data-level="2"] { background: #4b5563; }
.heatmap .cell[data-level="3"] { background: #000; }

/* ==========================================================================
   Feature grid
   ========================================================================== */

.feature-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  background: var(--border);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
}

.feature-tile {
  background: var(--bg);
  padding: 36px 32px;
  transition: background 0.2s ease;
}

.feature-tile:hover {
  background: var(--card-bg);
}

.feature-tile h3 {
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 1.05rem;
  margin-bottom: 10px;
}

.feature-tile p {
  color: var(--fg-secondary);
  font-size: 0.92rem;
  line-height: 1.6;
}

.feature-tile a {
  color: var(--fg);
  border-bottom: 1px solid var(--border-strong);
  transition: border-color 0.15s ease;
}

.feature-tile a:hover {
  border-color: var(--fg);
}

/* ==========================================================================
   How it works diagram
   ========================================================================== */

.flow-diagram {
  display: flex;
  align-items: stretch;
  gap: 0;
  overflow-x: auto;
  padding-bottom: 8px;
}

.flow-node {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 22px 20px;
  min-width: 200px;
  flex-shrink: 0;
}

.flow-node.highlight {
  background: #fff;
  color: #000;
  border-color: #fff;
}

.flow-node.highlight .flow-node-title,
.flow-node.highlight .flow-node-list li {
  color: #000;
}

/* Invert the pop card on the light-themed how-it-works section: white-on-dark
   reads fine against the black page, but on paper it needs to flip to
   near-black-on-white's opposite — a dark card — to keep the same "this is
   the important node" pop. */
.light .flow-node.highlight {
  background: #171a1f;
  color: #fff;
  border-color: #171a1f;
}

.light .flow-node.highlight .flow-node-title,
.light .flow-node.highlight .flow-node-list li {
  color: #fff;
}

.flow-node-title {
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 0.9rem;
  margin-bottom: 12px;
}

.flow-node-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.flow-node-list li {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--fg-secondary);
}

.flow-arrow {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 18px;
  color: var(--fg-tertiary);
  font-size: 1.4rem;
  flex-shrink: 0;
}

.flow-fanout {
  display: flex;
  flex-direction: column;
  gap: 6px;
  justify-content: center;
}

.flow-caption {
  margin-top: 32px;
  color: var(--fg-tertiary);
  font-size: 0.9rem;
  max-width: 680px;
  line-height: 1.6;
}

/* ==========================================================================
   Connector teaser (index)
   ========================================================================== */

.chip-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 16px;
  margin-bottom: 28px;
}

.tracker-chip {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 16px 18px;
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  transition: transform 0.18s ease, border-color 0.18s ease;
}

.tracker-chip:hover {
  transform: translateY(-2px);
  border-color: var(--border-strong);
}

.tracker-chip .glyph {
  font-size: 1.3rem;
}

.tracker-chip .chip-title {
  font-size: 0.88rem;
  font-weight: 500;
}

.tracker-chip .chip-slug {
  display: block;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--fg-tertiary);
  margin-top: 2px;
}

.ghost-wide {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 26px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-md);
  font-family: var(--font-mono);
  font-size: 0.95rem;
  color: var(--fg);
  transition: background 0.18s ease, border-color 0.18s ease;
}

.ghost-wide:hover {
  background: var(--card-bg);
  border-color: rgba(255, 255, 255, 0.3);
}

.light .ghost-wide:hover {
  border-color: rgba(23, 26, 31, 0.3);
}

/* ==========================================================================
   Dashboard showcase — fake macOS window chrome
   ========================================================================== */

.window-stack {
  position: relative;
  margin-top: 20px;
  padding: 40px 0 20px;
}

.window-frame {
  background: #0d0d0d;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  overflow: hidden;
  box-shadow: 0 40px 100px -30px rgba(0, 0, 0, 0.8), 0 0 0 1px rgba(255, 255, 255, 0.02);
}

.window-titlebar {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 12px 16px;
  background: #161616;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.window-frame img {
  width: 100%;
  display: block;
}

.window-frame.primary {
  max-width: 900px;
  margin: 0 auto;
  position: relative;
  z-index: 2;
  box-shadow: 0 60px 120px -20px rgba(37, 99, 235, 0.15), 0 30px 80px -20px rgba(0, 0, 0, 0.9);
}

.window-frame.secondary {
  position: absolute;
  top: 0;
  right: 6%;
  width: 46%;
  max-width: 420px;
  z-index: 1;
  opacity: 0.85;
  transform: rotate(2deg) translateY(20px);
}

.window-frame.small {
  max-width: 560px;
}

/* The window chrome itself (titlebar, screenshot) stays dark always — it's
   a fake macOS window, not page background. But on the light page the
   glowy dark-page shadow reads oddly against paper, so swap it for a soft
   ambient shadow and a visible (rather than near-invisible) border. */
.light .window-frame {
  border-color: var(--border-strong);
  box-shadow: 0 20px 60px rgba(23, 26, 31, 0.12);
}

.light .window-frame.primary {
  box-shadow: 0 20px 60px rgba(23, 26, 31, 0.12);
}

/* ==========================================================================
   Privacy section
   ========================================================================== */

.stat-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 32px;
  margin-bottom: 48px;
}

.stat-col .stat-num {
  font-family: var(--font-mono);
  font-size: clamp(1.8rem, 3vw, 2.6rem);
  font-weight: 700;
  color: var(--fg);
}

.stat-col .stat-label {
  color: var(--fg-secondary);
  font-size: 0.9rem;
  margin-top: 8px;
}

.privacy-copy {
  max-width: 680px;
  color: var(--fg-secondary);
  font-size: 1rem;
  line-height: 1.75;
}

/* ==========================================================================
   Manifesto
   ========================================================================== */

.manifesto {
  max-width: 760px;
  display: flex;
  flex-direction: column;
  gap: 30px;
}

.manifesto p {
  font-family: var(--font-head);
  font-weight: 300;
  font-size: clamp(1.3rem, 2.4vw, 1.75rem);
  line-height: 1.55;
  color: var(--fg-secondary);
}

.manifesto p:last-child {
  color: #fff;
}

/* ==========================================================================
   Install section
   ========================================================================== */

.install-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 56px;
  align-items: center;
}

.install-steps {
  display: flex;
  flex-direction: column;
  gap: 18px;
  margin: 36px 0 40px;
}

.install-step {
  display: flex;
  gap: 14px;
  align-items: baseline;
  font-family: var(--font-mono);
  font-size: 0.95rem;
  color: var(--fg-secondary);
}

.install-step .step-num {
  color: #fff;
  font-weight: 700;
}

.install-ctas {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  align-items: center;
  margin-top: 28px;
}

/* The command pill sits directly after the CTA row (download button) in the
   install section's layout — give it the same 16px rhythm as the cta-row's
   own internal gap so it doesn't look glued to the button above it. Scoped
   to "immediately follows a cta-row" so the hero's cta-row (where the
   command pill lives *inside* the row, side-by-side) is unaffected. */
.cta-row + .pill-command {
  margin-top: 16px;
}

/* ==========================================================================
   Footer
   ========================================================================== */

.site-footer {
  padding: clamp(48px, 6vw, 80px) 0;
  border-top: 1px solid var(--border);
}

.footer-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 20px;
}

.footer-left {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.footer-tag {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--fg-tertiary);
}

.footer-links {
  display: flex;
  gap: 28px;
}

.footer-links a {
  font-size: 0.88rem;
  color: var(--fg-secondary);
  transition: color 0.15s ease;
}

.footer-links a:hover {
  color: #fff;
}

.footer-copy {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--fg-tertiary);
}

/* ==========================================================================
   Connectors page
   ========================================================================== */

.connectors-hero {
  padding: 100px 0 64px;
  border-bottom: 1px solid var(--border);
}

.connectors-hero h1 {
  font-size: clamp(2.1rem, 4.6vw, 3.2rem);
  line-height: 1.1;
  max-width: 760px;
}

.connectors-hero .section-sub {
  max-width: 720px;
}

.controls-row {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  align-items: center;
  margin-bottom: 20px;
}

.search-input {
  flex: 1;
  min-width: 240px;
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 13px 18px;
  color: var(--fg);
  font-family: var(--font-mono);
  font-size: 0.88rem;
  transition: border-color 0.15s ease;
}

.search-input::placeholder {
  color: var(--fg-tertiary);
}

.search-input:focus {
  border-color: var(--border-strong);
  outline: none;
}

.chip-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 20px;
}

.filter-chip {
  border: 1px solid var(--border-strong);
  background: transparent;
  color: var(--fg-secondary);
  font-family: var(--font-mono);
  font-size: 0.8rem;
  padding: 9px 16px;
  border-radius: 999px;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.filter-chip:hover {
  border-color: rgba(255, 255, 255, 0.4);
  color: #fff;
}

.light .filter-chip:hover {
  border-color: rgba(23, 26, 31, 0.4);
  color: var(--fg);
}

.filter-chip.active {
  background: var(--fg);
  color: var(--card-bg);
  border-color: var(--fg);
}

.local-note {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: var(--fg-tertiary);
  margin-bottom: 36px;
  padding: 14px 18px;
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius-sm);
  display: inline-block;
}

.local-note strong {
  color: var(--green);
}

.connector-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}

.connector-card {
  display: flex;
  flex-direction: column;
  gap: 14px;
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 24px;
  transition: transform 0.18s ease, border-color 0.18s ease;
}

.connector-card:hover {
  transform: translateY(-3px);
  border-color: var(--border-strong);
}

.connector-card-head {
  display: flex;
  align-items: center;
  gap: 12px;
}

.connector-card .glyph {
  font-size: 1.6rem;
}

.connector-card .title {
  font-weight: 600;
  font-size: 1rem;
}

.connector-card .slug {
  display: block;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--fg-tertiary);
  margin-top: 2px;
}

.connector-card .desc {
  color: var(--fg-secondary);
  font-size: 0.87rem;
  line-height: 1.55;
  flex: 1;
}

.connector-card-foot {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: auto;
}

.badge {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  padding: 5px 10px;
  border-radius: 999px;
  border: 1px solid transparent;
  letter-spacing: 0.02em;
}

.badge-category {
  background: rgba(255, 255, 255, 0.06);
  color: var(--fg-secondary);
  border-color: var(--border);
}

.badge-auth-local { background: rgba(34, 197, 94, 0.12); color: #4ade80; border-color: rgba(34, 197, 94, 0.3); }
.badge-auth-oauth,
.badge-auth-apikey { background: rgba(59, 130, 246, 0.12); color: #60a5fa; border-color: rgba(59, 130, 246, 0.3); }
.badge-auth-browser { background: rgba(168, 85, 247, 0.12); color: #c084fc; border-color: rgba(168, 85, 247, 0.3); }
.badge-auth-manual { background: rgba(234, 179, 8, 0.12); color: #facc15; border-color: rgba(234, 179, 8, 0.3); }
.badge-auth-derived { background: rgba(156, 163, 175, 0.12); color: #9ca3af; border-color: rgba(156, 163, 175, 0.3); }

/* Same hues, darkened for legibility on a white/paper page — the pastel
   text colors above are tuned for the black page and wash out on light. */
.light .badge-category { background: rgba(23, 26, 31, 0.05); border-color: var(--border-strong); }
.light .badge-auth-local { background: rgba(34, 197, 94, 0.12); color: #15803d; border-color: rgba(34, 197, 94, 0.35); }
.light .badge-auth-oauth,
.light .badge-auth-apikey { background: rgba(37, 99, 235, 0.1); color: #1d4ed8; border-color: rgba(37, 99, 235, 0.3); }
.light .badge-auth-browser { background: rgba(147, 51, 234, 0.1); color: #7e22ce; border-color: rgba(147, 51, 234, 0.3); }
.light .badge-auth-manual { background: rgba(217, 119, 6, 0.12); color: #b45309; border-color: rgba(217, 119, 6, 0.3); }
.light .badge-auth-derived { background: rgba(107, 114, 128, 0.12); color: #4b5563; border-color: rgba(107, 114, 128, 0.3); }

.connector-card-build {
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius-md);
  padding: 24px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 8px;
  color: var(--fg-secondary);
  transition: border-color 0.18s ease, background 0.18s ease;
}

.connector-card-build:hover {
  border-color: rgba(255, 255, 255, 0.35);
  background: var(--card-bg);
}

.light .connector-card-build:hover {
  border-color: rgba(23, 26, 31, 0.35);
}

.connector-card-build .plus {
  font-size: 1.4rem;
  color: var(--fg);
}

.connector-card-build .files {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--fg-tertiary);
}

.empty-state {
  display: none;
  padding: 80px 0;
  text-align: center;
  font-family: var(--font-mono);
  color: var(--fg-tertiary);
  font-size: 0.95rem;
}

.empty-state.visible {
  display: block;
}

.connector-grid.hidden {
  display: none;
}

/* ==========================================================================
   Responsive
   ========================================================================== */

@media (max-width: 980px) {
  .tab-panel.active {
    grid-template-columns: 1fr;
  }

  .feature-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .chip-grid {
    grid-template-columns: repeat(3, 1fr);
  }

  .install-grid {
    grid-template-columns: 1fr;
    gap: 40px;
  }

  .connector-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .stat-row {
    grid-template-columns: 1fr;
    gap: 28px;
  }
}

@media (max-width: 720px) {
  .nav-links {
    display: none;
  }

  .hero {
    padding: 120px 0 80px;
  }

  .spectrum-field {
    inset: -5% -30% -20% 10%;
    opacity: 0.85;
  }

  .feature-grid {
    grid-template-columns: 1fr;
  }

  .chip-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .connector-grid {
    grid-template-columns: 1fr;
  }

  .flow-diagram {
    flex-direction: column;
  }

  .flow-arrow {
    transform: rotate(90deg);
    padding: 10px 0;
  }

  .window-frame.secondary {
    display: none;
  }

  .footer-inner {
    flex-direction: column;
    align-items: flex-start;
  }
}

@media (max-width: 480px) {
  .chip-grid {
    grid-template-columns: 1fr 1fr;
  }

  .cta-row {
    flex-direction: column;
    align-items: stretch;
  }

  .pill {
    justify-content: center;
  }

  .pill-command {
    font-size: 0.72rem;
    padding: 12px 16px;
  }
}

/* ==========================================================================
   Differentiation ("not another memory layer")
   ========================================================================== */

.head-soft {
  color: var(--fg-secondary);
}

.contrast-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
}

.contrast-card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 36px 32px;
}

.contrast-card h3 {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--fg-tertiary);
  margin-bottom: 14px;
  letter-spacing: 0.02em;
}

.contrast-card p {
  color: var(--fg-secondary);
  font-size: 0.95rem;
  line-height: 1.65;
}

/* Always dark on purpose — the highlighted card stays near-black regardless
   of section theme, so its text is hardcoded rather than themed via --fg. */
.contrast-card.is-db {
  border-color: rgba(255, 255, 255, 0.25);
  background: #101010;
}

.contrast-card.is-db h3 {
  color: #fff;
}

.contrast-card.is-db p {
  color: #fff;
}

.contrast-note {
  margin-top: 28px;
  color: var(--fg-tertiary);
  font-size: 0.95rem;
  max-width: 640px;
}

@media (max-width: 900px) {
  .contrast-grid {
    grid-template-columns: 1fr;
  }
}

/* ==========================================================================
   Download button (Apple logo) + collapsible CLI pill
   ========================================================================== */

.pill-download {
  display: inline-flex;
  align-items: center;
  gap: 9px;
}

.apple-logo {
  width: 1.05em;
  height: 1.05em;
  flex: none;
  margin-top: -0.12em;
}

.pill-command.collapsible .cmd-hint {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  opacity: 0.85;
}

.pill-command.collapsible .cmd-text {
  display: inline-block;
  max-width: 0;
  opacity: 0;
  overflow: hidden;
  white-space: nowrap;
  vertical-align: bottom;
  transition: max-width 0.4s ease, opacity 0.3s ease;
}

.pill-command.collapsible:hover .cmd-text,
.pill-command.collapsible:focus-visible .cmd-text,
.pill-command.collapsible.expanded .cmd-text {
  max-width: 560px;
  opacity: 1;
}

@media (max-width: 640px) {
  .pill-command.collapsible:hover .cmd-text,
  .pill-command.collapsible.expanded .cmd-text {
    max-width: 78vw;
    white-space: normal;
  }
}

/* Real connector logos (bundled with the app) — emoji glyphs remain the fallback */
.connector-logo {
  width: 28px;
  height: 28px;
  flex: none;
  border-radius: 6px;
  object-fit: contain;
}
.tracker-chip .connector-logo {
  width: 24px;
  height: 24px;
}

/* Hover-expanding the CLI pill must never reflow it out from under the
   cursor (expand → row wraps → pill moves → hover lost → collapse → loop).
   Keep the row on one line on hover-capable devices and cap the expansion
   to the viewport; touch devices keep wrapping (they expand via tap, no
   hover state to lose). */
@media (hover: hover) and (min-width: 700px) {
  .cta-row {
    flex-wrap: nowrap;
  }
  .pill-command.collapsible:hover .cmd-text,
  .pill-command.collapsible:focus-visible .cmd-text,
  .pill-command.collapsible.expanded .cmd-text {
    max-width: min(560px, calc(100vw - 560px));
  }
}

/* On desktop, the flow diagram fits the container instead of side-scrolling
   (a scroll strip reads as a clipped layout on a marketing page). */
@media (min-width: 900px) {
  .flow-diagram {
    overflow-x: visible;
  }
  .flow-node {
    flex: 1 1 0;
    min-width: 0;
    flex-shrink: 1;
  }
  .flow-node-title {
    word-break: break-word;
  }
}
