/**
 * Design-system components - shared across index.html, result.html, admin.html
 * (tokens live in variables.css; this file maps type roles and styles the
 * signature components: epoch ring, seal states, ledger tables, reveals)
 */

body {
  font-family: var(--font-family);
}

/* ---------- Display type: identity + section voice ---------- */
.header h1,
.pool-header-ticker,
.pool-header-name,
.info-section-title,
.featured-pools-title,
.pool-ticker,
.login-container h1,
.form-section h2,
.section-header h2,
.promotions-section h2 {
  font-family: var(--font-family-display);
  letter-spacing: -0.01em;
}

.header h1 {
  font-weight: 600;
}

.pool-header-ticker {
  font-size: clamp(2.25rem, 7vw, 3.25rem);
  font-weight: 600;
  line-height: 1;
}

.pool-header-name {
  font-weight: 500;
  color: var(--color-text-light);
}

.info-section-title {
  font-weight: 600;
  font-size: 1.35rem;
}

/* ---------- Mono type: every number is an instrument reading ---------- */
.summary-card-value,
.info-value,
.pool-header-id,
.pool-id,
.pool-stat-value,
.epoch-ring-epoch,
.epoch-ring-percent,
.epoch-ring-remaining,
.epoch-bar-label,
.data-table td,
.relay-table td,
.data-table th,
.relay-table th,
.search-input,
.stat-value {
  font-family: var(--font-family-mono);
}

/* ---------- Entrance reveals (orchestrated, one direction: fade-up) ---------- */
@keyframes reveal-up {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.pool-header,
.summary-cards,
.info-section,
.featured-pools-section,
.search-container,
.stats-section,
.form-section,
.promotions-section {
  animation: reveal-up 0.45s ease-out backwards;
}

.summary-cards { animation-delay: 0.06s; }
.info-section:nth-of-type(1) { animation-delay: 0.12s; }
.info-section:nth-of-type(2) { animation-delay: 0.18s; }
.info-section:nth-of-type(3) { animation-delay: 0.24s; }
.info-section:nth-of-type(4) { animation-delay: 0.3s; }
.info-section:nth-of-type(5) { animation-delay: 0.36s; }
.search-container { animation-delay: 0.06s; }

/* Pool cards stagger in as the grid renders (home.js sets --card-i) */
.pool-card,
.featured-pool-card {
  animation: reveal-up 0.4s ease-out backwards;
  animation-delay: calc(min(var(--card-i, 0), 11) * 0.04s);
}

@media (prefers-reduced-motion: reduce) {
  .pool-header,
  .summary-cards,
  .info-section,
  .featured-pools-section,
  .search-container,
  .stats-section,
  .form-section,
  .promotions-section,
  .pool-card,
  .featured-pool-card {
    animation: none;
  }
}

/* ---------- Hero: identity + epoch ring side by side (result.html) ---------- */
.pool-header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--spacing-xl);
}

@media (max-width: 640px) {
  .pool-header-inner {
    flex-direction: column;
    align-items: flex-start;
  }

  .epoch-ring-wrap {
    align-self: center;
  }
}

.epoch-ring-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  flex-shrink: 0;
  gap: var(--spacing-xs);
}

.epoch-ring {
  position: relative;
  width: 140px;
  height: 140px;
}

.epoch-ring-track {
  stroke: rgba(232, 230, 223, 0.08);
  fill: none;
}

.epoch-ring-fill {
  stroke: var(--color-primary-light);
  fill: none;
  stroke-linecap: round;
  transition: stroke-dashoffset 1s linear;
}

.epoch-ring-center {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.epoch-ring-epoch {
  font-size: 1.75rem;
  font-weight: 500;
  color: var(--color-text);
  line-height: 1.1;
}

.epoch-ring-percent {
  font-size: 0.8rem;
  color: var(--color-text-light);
}

.epoch-ring-remaining {
  font-size: 0.75rem;
  color: var(--color-text-light);
}

/* ---------- The seal: gold reserved for verified/certified states only ---------- */
.summary-card.card-verified {
  background: linear-gradient(135deg, var(--color-seal-dim), var(--color-panel));
  border-color: var(--color-seal-border);
}

.summary-card.card-verified .summary-card-value {
  color: var(--color-seal);
}

.badge-verified {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 999px;
  font-size: var(--font-size-xs);
  font-weight: var(--font-weight-medium);
  background-color: var(--color-seal-dim);
  color: var(--color-seal);
  border: 1px solid var(--color-seal-border);
}

.hash-match.verified {
  background-color: var(--color-seal-dim);
  color: var(--color-seal);
  border: 1px solid var(--color-seal-border);
}

/* ---------- Ledger rows: data tables read like a registry ---------- */
.data-table th,
.relay-table th {
  font-size: 0.7rem;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--color-text-light);
  background: transparent;
  border-bottom: 1px solid var(--color-border);
}

.data-table td,
.relay-table td {
  border-bottom: 1px solid var(--color-border);
}

.data-table tbody tr:hover,
.relay-table tbody tr:hover {
  background-color: rgba(47, 95, 224, 0.07);
}
