/* ── Container ────────────────────────────────────────────── */
.container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: var(--space-6) var(--space-6);
}
@media (max-width: 720px) {
  .container { padding: var(--space-4); padding-bottom: calc(var(--space-16) + env(safe-area-inset-bottom, 0px)); }
}

/* ── Top nav ──────────────────────────────────────────────── */
.nav {
  position: sticky;
  top: 0;
  z-index: var(--z-nav);
  display: flex;
  align-items: center;
  gap: var(--space-5);
  height: 60px;
  padding: 0 var(--space-6);
  background: color-mix(in srgb, var(--bg) 80%, transparent);
  backdrop-filter: saturate(140%) blur(14px);
  -webkit-backdrop-filter: saturate(140%) blur(14px);
  border-bottom: 1px solid var(--border);
}
.nav-brand {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  font-weight: 700;
  font-size: var(--text-md);
  letter-spacing: -0.02em;
}
.nav-brand img {
  width: 28px;
  height: 28px;
  border-radius: var(--radius-sm);
  object-fit: cover;
}
.nav-brand-name {
  background: linear-gradient(180deg, var(--text) 30%, color-mix(in srgb, var(--text) 70%, transparent));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 2px;
  margin-left: var(--space-4);
}
.nav-link {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-2) var(--space-3);
  border-radius: var(--radius-sm);
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--text-muted);
  cursor: pointer;
  transition: color var(--dur-fast), background var(--dur-fast);
}
.nav-link:hover { color: var(--text); background: var(--bg-hover); }
.nav-link.active { color: var(--text); background: var(--bg-hover); }
.nav-link svg { width: 14px; height: 14px; }

.nav-spacer { flex: 1; }
.nav-right { display: flex; align-items: center; gap: var(--space-2); }
.nav-status {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  font-size: var(--text-xs);
  color: var(--text-muted);
  padding: 0 var(--space-2);
}

@media (max-width: 720px) {
  .nav { height: 54px; padding: 0 var(--space-4); gap: var(--space-3); }
  .nav-links { display: none; }
  .nav-status { display: none; }
}

/* ── Mobile bottom tab bar ────────────────────────────────── */
.tab-bar {
  display: none;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: var(--z-nav);
  background: color-mix(in srgb, var(--bg-elevated) 95%, transparent);
  backdrop-filter: saturate(160%) blur(18px);
  -webkit-backdrop-filter: saturate(160%) blur(18px);
  border-top: 1px solid var(--border);
  padding: var(--space-2) var(--space-2) calc(var(--space-2) + env(safe-area-inset-bottom, 0px));
  justify-content: space-around;
}
.tab-link {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  flex: 1;
  padding: var(--space-2);
  border-radius: var(--radius-md);
  color: var(--text-subtle);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.02em;
  min-width: 0;
  min-height: 48px;
  cursor: pointer;
  transition: color var(--dur-fast);
}
.tab-link svg { width: 20px; height: 20px; }
.tab-link.active { color: var(--accent); }
.tab-link:active { transform: scale(0.96); }

@media (max-width: 720px) {
  .tab-bar { display: flex; }
}

/* ── Page ─────────────────────────────────────────────────── */
.page { display: none; animation: page-in var(--dur) var(--ease-out); }
.page.active { display: block; }
@keyframes page-in {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ── Hero (home) ──────────────────────────────────────────── */
.hero {
  padding: var(--space-12) 0 var(--space-10);
  text-align: center;
  position: relative;
}

/* Growth chart sits behind the hero stack */
.hero-chart {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 0;
  overflow: visible;
}
.hero-chart-line {
  fill: none;
  stroke: var(--accent);
  stroke-width: 2.5;
  stroke-linecap: round;
  stroke-linejoin: round;
  filter: drop-shadow(0 0 10px var(--accent-ring));
  stroke-dasharray: 1500;
  stroke-dashoffset: 1500;
  animation: chart-draw 2.2s var(--ease-out) 0.15s forwards;
}
.hero-chart-area {
  fill: url(#hero-area-grad);
  opacity: 0;
  animation: chart-fade 1.4s var(--ease-out) 1.4s forwards;
}
.hero-chart-stop-1 { stop-color: var(--accent); stop-opacity: 0.35; }
.hero-chart-stop-2 { stop-color: var(--accent); stop-opacity: 0; }
.hero-chart-tick {
  fill: var(--accent);
  opacity: 0;
  filter: drop-shadow(0 0 6px var(--accent-ring));
  transform-origin: center;
  animation: tick-in 0.45s var(--ease-out) 2.1s forwards;
}
.hero-chart-pulse {
  fill: none;
  stroke: var(--accent);
  stroke-width: 1.5;
  opacity: 0;
  transform-origin: center;
  animation: tick-pulse 2.6s var(--ease-in-out) 2.4s infinite;
}
@keyframes chart-draw {
  to { stroke-dashoffset: 0; }
}
@keyframes chart-fade {
  to { opacity: 0.55; }
}
@keyframes tick-in {
  from { opacity: 0; transform: scale(0.3); }
  to   { opacity: 1; transform: scale(1); }
}
@keyframes tick-pulse {
  0%   { opacity: 0.7; r: 6; }
  60%  { opacity: 0; r: 22; }
  100% { opacity: 0; r: 22; }
}

/* ensure stack sits above chart */
.hero > *:not(.hero-chart) { position: relative; z-index: 1; }
.hero-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  font-size: var(--text-xs);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--text-muted);
  margin-bottom: var(--space-5);
}
.hero-number {
  font-family: var(--font-mono);
  font-size: clamp(40px, 8vw, var(--text-hero));
  font-weight: 800;
  letter-spacing: -0.04em;
  line-height: 1;
  color: var(--accent);
  margin-bottom: var(--space-4);
  font-variant-numeric: tabular-nums;
}
.hero-sub {
  font-size: var(--text-lg);
  color: var(--text-muted);
  max-width: 540px;
  margin: 0 auto var(--space-6);
  line-height: 1.5;
}
.hero-cta { display: inline-flex; gap: var(--space-3); }

/* ── Signal cards ─────────────────────────────────────────── */
.signal-card { display: block; text-decoration: none; color: inherit; }
.signal-head {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  font-size: var(--text-xs);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-muted);
}
.signal-head svg { color: var(--accent); }
.signal-body { margin-top: var(--space-4); }
.signal-row { display: flex; align-items: center; gap: var(--space-3); }
.signal-icon {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-sm);
  background: var(--bg-sunken);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  overflow: hidden;
}
.signal-icon img {
  width: 28px;
  height: 28px;
  image-rendering: pixelated;
  object-fit: contain;
}
.signal-text { flex: 1; min-width: 0; }
.signal-name {
  font-weight: 700;
  font-size: var(--text-md);
  letter-spacing: -0.01em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.signal-meta {
  font-size: var(--text-xs);
  color: var(--text-subtle);
  margin-top: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.signal-value {
  text-align: right;
  font-size: var(--text-md);
  font-weight: 700;
  color: var(--accent);
}
.signal-value .pill {
  display: inline-block;
  margin-top: 4px;
  font-size: 10px;
  font-family: var(--font-mono);
}
.signal-empty { font-size: var(--text-sm); margin-top: var(--space-3); }

/* Hero target line below big number */
.hero-target { min-height: 1.4em; }

/* ── Section ──────────────────────────────────────────────── */
.section { margin: var(--space-10) 0; }
.section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--space-4);
  margin-bottom: var(--space-5);
}
.section-title {
  font-size: var(--text-lg);
  font-weight: 700;
  letter-spacing: -0.02em;
}
.section-sub {
  font-size: var(--text-sm);
  color: var(--text-muted);
}

/* ── Grid utilities ───────────────────────────────────────── */
.grid { display: grid; gap: var(--space-4); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
@media (max-width: 900px) {
  .grid-3 { grid-template-columns: 1fr; }
  .grid-2 { grid-template-columns: 1fr; }
}
