/* IndieStats — indiestats.web.ap.it */
:root {
  --bg-deep: #070a0e;
  --bg-surface: #0f1419;
  --bg-elevated: #151c24;
  --border: rgba(255, 255, 255, 0.08);
  --text: #e8edf4;
  --text-muted: #8b98a8;
  --accent: #10b981;
  --accent-dim: rgba(16, 185, 129, 0.15);
  --accent-glow: rgba(16, 185, 129, 0.35);
  --violet: #a78bfa;
  --radius: 14px;
  --radius-sm: 10px;
  --font-sans: "DM Sans", system-ui, -apple-system, sans-serif;
  --font-mono: "JetBrains Mono", "SF Mono", ui-monospace, monospace;
  --max: 1120px;
  --nav-h: 64px;
}

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

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: var(--font-sans);
  font-size: 17px;
  line-height: 1.65;
  color: var(--text);
  background: var(--bg-deep);
  -webkit-font-smoothing: antialiased;
}

a {
  color: var(--accent);
  text-decoration: none;
  transition:
    opacity 0.15s ease,
    color 0.15s ease;
}

a:hover {
  color: #34d399;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

/* Background */
.bg-grid {
  position: fixed;
  inset: 0;
  z-index: -2;
  background:
    radial-gradient(
      ellipse 80% 50% at 50% -20%,
      rgba(16, 185, 129, 0.12),
      transparent
    ),
    radial-gradient(
      ellipse 60% 40% at 100% 0%,
      rgba(167, 139, 250, 0.08),
      transparent
    ),
    var(--bg-deep);
}

.bg-grid::after {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(var(--border) 1px, transparent 1px),
    linear-gradient(90deg, var(--border) 1px, transparent 1px);
  background-size: 64px 64px;
  mask-image: radial-gradient(
    ellipse 70% 60% at 50% 30%,
    black 20%,
    transparent 70%
  );
  opacity: 0.4;
  pointer-events: none;
}

/* Nav */
.site-nav {
  position: sticky;
  top: 0;
  z-index: 100;
  height: var(--nav-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 1.5rem;
  max-width: var(--max);
  margin: 0 auto;
  border-bottom: 1px solid var(--border);
  background: rgba(7, 10, 14, 0.75);
  backdrop-filter: blur(12px);
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-weight: 700;
  font-size: 1.05rem;
  letter-spacing: -0.02em;
  color: var(--text);
}

.brand-mark {
  width: 32px;
  height: 32px;
  border-radius: 9px;
  display: block;
  flex-shrink: 0;
  object-fit: contain;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 1.75rem;
  list-style: none;
  margin: 0;
  padding: 0;
}

.nav-links a {
  color: var(--text-muted);
  font-size: 0.92rem;
  font-weight: 500;
}

.nav-links a:hover {
  color: var(--text);
}

.nav-cta {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.45rem 1rem;
  border-radius: 999px;
  background: var(--accent-dim);
  border: 1px solid rgba(16, 185, 129, 0.35);
  color: var(--accent) !important;
  font-size: 0.88rem;
  font-weight: 600;
}

.nav-cta:hover {
  background: rgba(16, 185, 129, 0.25);
  color: #6ee7b7 !important;
}

.nav-toggle {
  display: none;
  background: none;
  border: 1px solid var(--border);
  color: var(--text);
  padding: 0.4rem 0.65rem;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 1rem;
}

@media (max-width: 768px) {
  .nav-toggle {
    display: block;
  }

  .nav-links-wrap {
    position: fixed;
    top: var(--nav-h);
    left: 0;
    right: 0;
    background: var(--bg-surface);
    border-bottom: 1px solid var(--border);
    padding: 1rem 1.5rem 1.25rem;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.75rem;
    display: none;
  }

  .nav-links-wrap.is-open {
    display: flex;
  }

  .site-nav {
    max-width: 100%;
  }
}

@media (min-width: 769px) {
  .nav-links-wrap {
    display: flex !important;
    align-items: center;
    gap: 1.75rem;
  }
}

/* Layout */
.wrap {
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 1.5rem;
}

section {
  padding: 4.5rem 0;
}

section:first-of-type {
  padding-top: 3rem;
}

/* Hero */
.hero {
  text-align: center;
  padding-bottom: 2rem;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.35rem 0.85rem;
  border-radius: 999px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  color: var(--text-muted);
  font-size: 0.82rem;
  font-weight: 500;
  margin-bottom: 1.5rem;
}

.badge-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 8px var(--accent);
}

.hero h1 {
  font-size: clamp(2.1rem, 5vw, 3.25rem);
  font-weight: 700;
  letter-spacing: -0.035em;
  line-height: 1.15;
  margin: 0 0 1rem;
  max-width: 18ch;
  margin-left: auto;
  margin-right: auto;
}

.hero-lead {
  font-size: 1.15rem;
  color: var(--text-muted);
  max-width: 42ch;
  margin: 0 auto 2rem;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  justify-content: center;
  margin-bottom: 3rem;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.75rem 1.35rem;
  border-radius: 999px;
  font-weight: 600;
  font-size: 0.95rem;
  border: none;
  cursor: pointer;
  font-family: inherit;
  transition:
    transform 0.12s ease,
    box-shadow 0.12s ease;
}

.btn:active {
  transform: scale(0.98);
}

.btn-primary {
  background: linear-gradient(135deg, #10b981, #059669);
  color: #fff;
  box-shadow: 0 4px 24px var(--accent-glow);
}

.btn-primary:hover {
  box-shadow: 0 6px 32px var(--accent-glow);
}

.btn-ghost {
  background: transparent;
  color: var(--text);
  border: 1px solid var(--border);
}

.btn-ghost:hover {
  border-color: rgba(255, 255, 255, 0.2);
  background: var(--bg-elevated);
}

.hero-visual {
  position: relative;
  max-width: 720px;
  margin: 0 auto;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--bg-surface);
  overflow: hidden;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.45);
}

.hero-visual-bar {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.65rem 1rem;
  background: var(--bg-elevated);
  border-bottom: 1px solid var(--border);
  font-size: 0.75rem;
  font-family: var(--font-mono);
  color: var(--text-muted);
}

.hero-window-title {
  margin-left: 0.5rem;
  color: var(--text-muted);
  letter-spacing: 0.01em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
  flex: 1;
}

.hero-visual-bar .d1,
.hero-visual-bar .d2,
.hero-visual-bar .d3 {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}

.hero-visual-bar .d1 {
  background: #ff5f57;
}

.hero-visual-bar .d2 {
  background: #febc2e;
}

.hero-visual-bar .d3 {
  background: #28c840;
}

.hero-chart {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 0.35rem;
  padding: 1.25rem 1.25rem 1.5rem;
  align-items: end;
  min-height: 140px;
}

.hero-chart .bar {
  border-radius: 4px 4px 0 0;
  background: linear-gradient(180deg, var(--accent), rgba(16, 185, 129, 0.25));
  opacity: 0.85;
  animation: bar-pulse 3s ease-in-out infinite;
}

.hero-chart .bar:nth-child(odd) {
  animation-delay: 0.2s;
}

@keyframes bar-pulse {
  0%,
  100% {
    opacity: 0.65;
  }
  50% {
    opacity: 1;
  }
}

.hero-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  background: var(--border);
  border-top: 1px solid var(--border);
}

.hero-stat {
  background: var(--bg-surface);
  padding: 1rem 1.25rem;
  text-align: left;
}

.hero-stat strong {
  display: block;
  font-size: 1.35rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text);
}

.hero-stat span {
  font-size: 0.8rem;
  color: var(--text-muted);
}

@media (max-width: 520px) {
  .hero-stats {
    grid-template-columns: 1fr;
  }
}

/* Section titles */
.section-head {
  text-align: center;
  max-width: 52ch;
  margin: 0 auto 3rem;
}

.section-eyebrow {
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
  margin: 0 0 0.5rem;
  padding-top: 1.5rem;
}

.section-head h2 {
  font-size: clamp(1.65rem, 3vw, 2.1rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  margin: 0 0 0.75rem;
}

.section-head p {
  margin: 0;
  color: var(--text-muted);
  font-size: 1.05rem;
}

/* Features grid */
.features {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1rem;
}

.feature-card {
  padding: 1.35rem 1.4rem;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--bg-surface);
  transition:
    border-color 0.2s ease,
    transform 0.2s ease;
}

.feature-card:hover {
  border-color: rgba(16, 185, 129, 0.25);
  transform: translateY(-2px);
}

.feature-icon {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-sm);
  background: var(--accent-dim);
  display: grid;
  place-items: center;
  font-size: 1.15rem;
  margin-bottom: 1rem;
}

.feature-card h3 {
  font-size: 1.05rem;
  font-weight: 600;
  margin: 0 0 0.4rem;
  letter-spacing: -0.02em;
}

.feature-card p {
  margin: 0;
  font-size: 0.92rem;
  color: var(--text-muted);
  line-height: 1.55;
}

/* Terminal */
.terminal-block {
  max-width: 640px;
  margin: 0 auto;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: #0a0d11;
  overflow: hidden;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4);
}

.terminal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.65rem 1rem;
  background: var(--bg-elevated);
  border-bottom: 1px solid var(--border);
  font-size: 0.75rem;
  font-family: var(--font-mono);
  color: var(--text-muted);
}

.terminal-body {
  padding: 1rem 1.15rem 1.15rem;
  font-family: var(--font-mono);
  font-size: 0.82rem;
  line-height: 1.7;
  color: #c4d4e4;
  overflow-x: auto;
}

.terminal-body .prompt {
  color: var(--accent);
  user-select: none;
}

.terminal-body .cmd {
  word-break: break-all;
}

.copy-row {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.copy-btn {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.35rem 0.75rem;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--bg-surface);
  color: var(--text-muted);
  font-size: 0.75rem;
  font-family: var(--font-sans);
  cursor: pointer;
  transition:
    color 0.15s,
    border-color 0.15s,
    background 0.15s;
}

.copy-btn:hover {
  color: var(--accent);
  border-color: rgba(16, 185, 129, 0.4);
  background: var(--accent-dim);
}

.copy-btn.copied {
  color: var(--accent);
  border-color: rgba(16, 185, 129, 0.5);
}

.terminal-note {
  margin: 0.75rem 0 0;
  color: var(--text-muted);
  font-size: 0.8rem;
  font-family: var(--font-sans);
  line-height: 1.55;
}

.terminal-note code {
  font-size: 0.95em;
}

/* Steps */
.steps {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.25rem;
  counter-reset: step;
}

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

.step-card {
  position: relative;
  padding: 1.5rem 1.35rem;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: linear-gradient(
    165deg,
    var(--bg-surface) 0%,
    var(--bg-deep) 100%
  );
}

.step-card::before {
  counter-increment: step;
  content: counter(step, decimal-leading-zero);
  display: block;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--violet);
  margin-bottom: 0.75rem;
}

.step-card h3 {
  font-size: 1.1rem;
  font-weight: 600;
  margin: 0 0 0.5rem;
}

.step-card p {
  margin: 0;
  font-size: 0.95rem;
  color: var(--text-muted);
}

/* CTA band */
.cta-band {
  margin: 2rem 0;
  padding: 2.5rem 2rem;
  border-radius: var(--radius);
  border: 1px solid rgba(16, 185, 129, 0.2);
  background: linear-gradient(
    135deg,
    rgba(16, 185, 129, 0.08),
    rgba(167, 139, 250, 0.06)
  );
  text-align: center;
}

.cta-band h2 {
  font-size: 1.45rem;
  font-weight: 700;
  margin: 0 0 0.5rem;
  letter-spacing: -0.02em;
}

.cta-band p {
  margin: 0 0 1.25rem;
  color: var(--text-muted);
  max-width: 48ch;
  margin-left: auto;
  margin-right: auto;
}

.tool-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  justify-content: center;
  margin-top: 1.5rem;
}

.tool-pill {
  padding: 0.35rem 0.85rem;
  border-radius: 999px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  font-size: 0.8rem;
  color: var(--text-muted);
}

/* Footer (final strip only) */
.site-footer {
  padding: 2rem 1.5rem 2.5rem;
  border-top: 1px solid var(--border);
  max-width: var(--max);
  margin: 0 auto;
}

.footer-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1.5rem;
  justify-content: space-between;
  align-items: center;
  font-size: 0.82rem;
  color: var(--text-muted);
}

.footer-meta a {
  color: var(--text-muted);
}

.footer-meta a:hover {
  color: var(--accent);
}

/* Inline code in prose */
p code,
li code,
.step-card code {
  font-family: var(--font-mono);
  font-size: 0.88em;
  padding: 0.12em 0.4em;
  border-radius: 6px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  color: #c8d8e8;
}
