/* ============================================================
   Capitrack — landing page styles
   ============================================================ */

/* ---------- Ambient backdrop ---------- */
.bg-grid {
  position: fixed; inset: 0; z-index: -2; pointer-events: none;
  background-image:
    linear-gradient(var(--grid-line) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid-line) 1px, transparent 1px);
  background-size: 64px 64px;
  -webkit-mask-image: radial-gradient(ellipse 90% 60% at 50% 0%, #000 0%, transparent 70%);
          mask-image: radial-gradient(ellipse 90% 60% at 50% 0%, #000 0%, transparent 70%);
}
.bg-glow {
  position: fixed; top: -340px; left: 50%; transform: translateX(-50%);
  width: 1100px; height: 720px; z-index: -1; pointer-events: none;
  background: radial-gradient(ellipse at center, rgba(var(--primary-rgb),0.22), transparent 62%);
  filter: blur(20px);
  transition: opacity var(--transition);
}
[data-glow="off"] .bg-glow { opacity: 0; }

/* ---------- Hero ---------- */
.hero { padding: 5.5rem 0 1rem; text-align: center; }
.hero-badge {
  display: inline-flex; align-items: center; gap: 0.6rem;
  padding: 0.4rem 0.9rem 0.4rem 0.5rem; border-radius: 99px;
  border: 1px solid var(--border); background: var(--bg-card);
  font-size: 0.83rem; color: var(--text-muted); margin-bottom: 1.8rem;
}
.hero-badge .tag {
  font-family: var(--mono); font-size: 0.72rem; font-weight: 600;
  background: var(--primary-bg); color: var(--primary);
  padding: 0.15rem 0.55rem; border-radius: 99px;
}
.hero-badge .dot { width: 6px; height: 6px; border-radius: 50%; background: var(--success); box-shadow: 0 0 0 3px var(--success-bg); }

.hero h1 {
  font-size: clamp(2.5rem, 6vw, 4.4rem); font-weight: 800;
  letter-spacing: -0.035em; line-height: 1.04; color: var(--text-strong);
  max-width: 16ch; margin: 0 auto;
  text-wrap: balance;
}
.hero h1 .grad {
  background: linear-gradient(110deg, var(--primary), var(--primary-2) 80%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.hero-sub {
  font-size: clamp(1.05rem, 2vw, 1.3rem); color: var(--text-muted);
  max-width: 56ch; margin: 1.6rem auto 0; line-height: 1.6; text-wrap: pretty;
}
.hero-cta { display: flex; flex-wrap: wrap; gap: 0.8rem; justify-content: center; margin-top: 2.4rem; }
.hero-install {
  display: inline-flex; align-items: center; gap: 0.75rem; margin-top: 1.7rem;
  font-family: var(--mono); font-size: 0.9rem; color: var(--text);
  background: var(--code-bg); border: 1px solid var(--border);
  padding: 0.6rem 0.75rem 0.6rem 1rem; border-radius: var(--radius-sm);
}
.hero-install .prompt { color: var(--text-dim); }
.hero-install .cmd { color: #c7d2fe; }
[data-theme="light"] .hero-install { color: #e4e5f0; }
.copy-btn {
  display: inline-flex; align-items: center; gap: 0.35rem; cursor: pointer;
  background: rgba(255,255,255,0.06); border: 1px solid rgba(255,255,255,0.08);
  color: #c7c9e0; border-radius: 6px; padding: 0.3rem 0.55rem; font-size: 0.75rem;
  font-family: var(--font); font-weight: 600; transition: all var(--transition);
}
.copy-btn:hover { background: rgba(var(--primary-rgb),0.25); color: #fff; }
.copy-btn svg { width: 13px; height: 13px; }

/* ---------- Browser frame ---------- */
.hero-shot { max-width: 1080px; margin: 4rem auto 0; padding: 0 1.5rem; }
.browser {
  border-radius: var(--radius-lg); overflow: hidden;
  border: 1px solid var(--border); background: var(--bg-card);
  box-shadow: var(--shadow-lg);
  position: relative;
}
.browser::after {
  content: ""; position: absolute; inset: 0; border-radius: var(--radius-lg);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.05); pointer-events: none;
}
.browser-bar {
  display: flex; align-items: center; gap: 0.85rem;
  padding: 0.7rem 1rem; background: var(--bg-soft);
  border-bottom: 1px solid var(--border);
}
.browser-dots { display: flex; gap: 0.45rem; }
.browser-dots span { width: 11px; height: 11px; border-radius: 50%; background: var(--border); }
.browser-dots span:nth-child(1) { background: #ff5f57; }
.browser-dots span:nth-child(2) { background: #febc2e; }
.browser-dots span:nth-child(3) { background: #28c840; }
.browser-url {
  flex: 1; max-width: 360px; margin: 0 auto;
  background: var(--bg-input); border-radius: 7px;
  padding: 0.32rem 0.85rem; font-family: var(--mono); font-size: 0.78rem;
  color: var(--text-muted); display: flex; align-items: center; gap: 0.5rem;
}
.browser-url svg { width: 12px; height: 12px; flex-shrink: 0; color: var(--success); }
.browser-shot { display: block; width: 100%; }
.browser-tabs { display: flex; gap: 0.4rem; margin-left: auto; }
.browser-tabs button {
  border: none; background: transparent; cursor: pointer; padding: 0.3rem 0.7rem;
  border-radius: 6px; font-family: var(--font); font-size: 0.78rem; font-weight: 600;
  color: var(--text-dim); transition: all var(--transition);
}
.browser-tabs button:hover { color: var(--text); }
.browser-tabs button.active { color: var(--primary); background: var(--primary-bg); }
.shot-stack { position: relative; }
.shot-stack img { transition: opacity 0.35s ease; }
.shot-stack img:not(.active) { position: absolute; inset: 0; opacity: 0; pointer-events: none; }

/* ---------- Logo strip ---------- */
.logos { padding: 3.5rem 0 1rem; }
.logos p { text-align: center; color: var(--text-dim); font-size: 0.82rem; font-family: var(--mono); letter-spacing: 0.08em; text-transform: uppercase; margin-bottom: 1.6rem; }
.logos-row { display: flex; flex-wrap: wrap; justify-content: center; gap: 2.5rem 3rem; align-items: center; }
.logo-item { display: inline-flex; align-items: center; gap: 0.6rem; color: var(--text-muted); font-weight: 600; font-size: 1.02rem; opacity: 0.78; transition: opacity var(--transition); }
.logo-item:hover { opacity: 1; }
.logo-item svg { width: 20px; height: 20px; }

/* ---------- Section scaffolding ---------- */
section.block { padding: 6rem 0; }
.section-head { max-width: 640px; margin: 0 auto 3.2rem; text-align: center; }
.section-head.left { text-align: left; margin-left: 0; }
.section-head h2 {
  font-size: clamp(1.9rem, 3.5vw, 2.7rem); font-weight: 800; letter-spacing: -0.03em;
  color: var(--text-strong); margin-top: 0.9rem; line-height: 1.1; text-wrap: balance;
}
.section-head p { color: var(--text-muted); font-size: 1.08rem; margin-top: 1rem; text-wrap: pretty; }

/* ---------- Feature grid ---------- */
.features { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.1rem; }
.feature {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 1.6rem;
  transition: all var(--transition); position: relative; overflow: hidden;
}
.feature:hover { border-color: color-mix(in srgb, var(--primary) 50%, var(--border)); transform: translateY(-3px); box-shadow: var(--shadow-card); }
.feature-icon {
  width: 42px; height: 42px; border-radius: 11px; display: grid; place-items: center;
  background: var(--primary-bg); color: var(--primary); margin-bottom: 1.1rem;
}
.feature-icon svg { width: 21px; height: 21px; }
.feature h3 { font-size: 1.1rem; font-weight: 700; color: var(--text-strong); margin-bottom: 0.45rem; }
.feature p { color: var(--text-muted); font-size: 0.94rem; line-height: 1.6; }
.feature.wide { grid-column: span 1; }
@media (max-width: 900px) { .features { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 560px) { .features { grid-template-columns: 1fr; } }

/* ---------- Showcase (alternating rows) ---------- */
.showcase-row {
  display: grid; grid-template-columns: 1fr 1fr; gap: 4rem; align-items: center;
  padding: 3rem 0;
}
.showcase-row:nth-child(even) .showcase-text { order: 2; }
.showcase-text .kicker { margin-bottom: 1rem; }
.showcase-text h3 { font-size: clamp(1.5rem, 3vw, 2rem); font-weight: 800; letter-spacing: -0.025em; color: var(--text-strong); line-height: 1.12; }
.showcase-text p { color: var(--text-muted); font-size: 1.02rem; margin-top: 1rem; line-height: 1.65; }
.showcase-list { list-style: none; margin-top: 1.4rem; display: flex; flex-direction: column; gap: 0.75rem; }
.showcase-list li { display: flex; gap: 0.7rem; align-items: flex-start; font-size: 0.96rem; color: var(--text); }
.showcase-list li svg { width: 18px; height: 18px; color: var(--success); flex-shrink: 0; margin-top: 2px; }
.showcase-media {
  border-radius: var(--radius-lg); overflow: hidden; border: 1px solid var(--border);
  box-shadow: var(--shadow-lg); background: var(--bg-card);
}
.showcase-media img { width: 100%; display: block; }
@media (max-width: 820px) {
  .showcase-row { grid-template-columns: 1fr; gap: 2rem; }
  .showcase-row:nth-child(even) .showcase-text { order: 0; }
}

/* ---------- Stats band ---------- */
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1px; background: var(--border); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.stat { background: var(--bg-card); padding: 2rem 1.5rem; text-align: center; }
.stat .num { font-size: clamp(1.8rem, 3vw, 2.6rem); font-weight: 800; letter-spacing: -0.03em; color: var(--text-strong); }
.stat .num .accent { color: var(--primary); }
.stat .lbl { color: var(--text-muted); font-size: 0.88rem; margin-top: 0.35rem; }
@media (max-width: 680px) { .stats { grid-template-columns: 1fr 1fr; } }

/* ---------- Quick start ---------- */
.quickstart { background: var(--bg-soft); border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }
.qs-wrap { display: grid; grid-template-columns: 0.9fr 1.1fr; gap: 3.5rem; align-items: center; }
.qs-tabs { display: flex; gap: 0.3rem; margin-bottom: 1rem; }
.qs-tab {
  display: inline-flex; align-items: center; gap: 0.5rem; cursor: pointer;
  padding: 0.5rem 0.95rem; border-radius: var(--radius-sm); border: 1px solid transparent;
  background: transparent; font-family: var(--font); font-size: 0.9rem; font-weight: 600;
  color: var(--text-muted); transition: all var(--transition);
}
.qs-tab svg { width: 16px; height: 16px; }
.qs-tab:hover { color: var(--text); }
.qs-tab.active { color: var(--text); background: var(--bg-card); border-color: var(--border); }
.terminal {
  background: var(--code-bg); border: 1px solid var(--border); border-radius: var(--radius);
  overflow: hidden; box-shadow: var(--shadow-lg);
}
.terminal-bar { display: flex; align-items: center; gap: 0.5rem; padding: 0.7rem 1rem; border-bottom: 1px solid rgba(255,255,255,0.06); }
.terminal-bar .browser-dots span { width: 10px; height: 10px; }
.terminal-bar .t-title { font-family: var(--mono); font-size: 0.76rem; color: #565978; margin-left: 0.5rem; }
.terminal-body { padding: 1.3rem 1.4rem; font-family: var(--mono); font-size: 0.86rem; line-height: 1.9; overflow-x: auto; }
.terminal-body .line { white-space: pre; }
.terminal-body .c { color: #565978; }     /* comment */
.terminal-body .p { color: #5eead4; }      /* prompt $ */
.terminal-body .k { color: #c7d2fe; }      /* command keyword */
.terminal-body .s { color: #e4e5f0; }      /* string / rest */
.terminal-body .o { color: #fcd34d; }      /* output */
.terminal-pane { display: none; }
.terminal-pane.active { display: block; }
.qs-note { margin-top: 1.3rem; font-size: 0.9rem; color: var(--text-muted); display: flex; gap: 0.6rem; align-items: flex-start; }
.qs-note svg { width: 17px; height: 17px; color: var(--warning); flex-shrink: 0; margin-top: 2px; }
.qs-note code { font-family: var(--mono); background: var(--bg-card); padding: 0.1rem 0.4rem; border-radius: 4px; font-size: 0.84rem; color: var(--text); }
@media (max-width: 820px) { .qs-wrap { grid-template-columns: 1fr; gap: 2rem; } }

/* ---------- Privacy / self-hosted band ---------- */
.privacy-card {
  position: relative; overflow: hidden;
  background:
    radial-gradient(120% 140% at 100% 0%, rgba(var(--primary-rgb),0.16), transparent 55%),
    var(--bg-card);
  border: 1px solid var(--border); border-radius: var(--radius-lg);
  padding: 3.5rem; display: grid; grid-template-columns: 1.4fr 1fr; gap: 3rem; align-items: center;
}
.privacy-card h2 { font-size: clamp(1.8rem, 3.2vw, 2.5rem); font-weight: 800; letter-spacing: -0.03em; color: var(--text-strong); line-height: 1.1; margin-top: 0.9rem; }
.privacy-card p { color: var(--text-muted); font-size: 1.05rem; margin-top: 1rem; max-width: 50ch; }
.privacy-points { display: grid; gap: 0.9rem; }
.privacy-point { display: flex; gap: 0.85rem; align-items: flex-start; background: var(--bg-soft); border: 1px solid var(--border); border-radius: var(--radius); padding: 1rem 1.1rem; }
.privacy-point svg { width: 20px; height: 20px; color: var(--primary); flex-shrink: 0; margin-top: 2px; }
.privacy-point h4 { font-size: 0.96rem; font-weight: 700; color: var(--text-strong); }
.privacy-point p { font-size: 0.86rem; margin-top: 0.2rem; color: var(--text-muted); }
@media (max-width: 820px) { .privacy-card { grid-template-columns: 1fr; gap: 2rem; padding: 2.2rem; } }

/* ---------- Final CTA ---------- */
.final-cta { text-align: center; padding: 7rem 0; }
.final-cta h2 { font-size: clamp(2.1rem, 4.5vw, 3.4rem); font-weight: 800; letter-spacing: -0.035em; color: var(--text-strong); line-height: 1.08; max-width: 18ch; margin: 0 auto; text-wrap: balance; }
.final-cta p { color: var(--text-muted); font-size: 1.15rem; margin: 1.2rem auto 0; max-width: 48ch; }
.final-cta .hero-cta { margin-top: 2.4rem; }
