:root {
  --bg: #0A0A0A;
  --surface: #111111;
  --border: #1a1a1a;
  --text: #fafafa;
  --text-dim: #666;
  --text-mid: #999;
  --accent: #6C63FF;
  --green: #4ade80;
  --red: #f87171;
  --orange: #fb923c;
  --mono: 'JetBrains Mono', monospace;
  --sans: 'DM Sans', -apple-system, sans-serif;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

/* ── Nav ──────────────────────────────────────── */

nav {
  position: fixed;
  top: 0;
  width: 100%;
  padding: 1rem 2rem;
  display: flex;
  align-items: center;
  gap: 2rem;
  background: rgba(10, 10, 10, 0.9);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid #1a1a1a;
  z-index: 100;
}

nav .logo {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  text-decoration: none;
  color: #fafafa;
  font-weight: 600;
  font-size: 1.1rem;
}

nav .logo img {
  width: 24px;
  height: 24px;
  image-rendering: pixelated;
}

nav a {
  color: #999;
  text-decoration: none;
  font-size: 0.85rem;
  transition: color 0.2s;
}

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

html {
  scroll-behavior: smooth;
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  -webkit-font-smoothing: antialiased;
}

body {
  min-height: 100vh;
  overflow-x: hidden;
}

/* ── Scrollbar ───────────────────────────────── */

::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: #2a2a2a;
  border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
  background: #3a3a3a;
}

* {
  scrollbar-width: thin;
  scrollbar-color: #2a2a2a transparent;
}

/* ── Hero ─────────────────────────────────────── */

.hero {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 2rem;
  position: relative;
}

.hero::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 600px;
  height: 600px;
  background: radial-gradient(circle, rgba(108, 99, 255, 0.06) 0%, transparent 70%);
  pointer-events: none;
}

.tombstone {
  margin-bottom: 2rem;
  opacity: 0;
  animation: breathe 3s ease-in-out infinite, fadeIn 1s ease forwards;
}

.tombstone img {
  width: 120px;
  height: 120px;
  image-rendering: pixelated;
}

.hero h1 {
  font-size: clamp(2.5rem, 6vw, 4.5rem);
  font-weight: 600;
  letter-spacing: -0.03em;
  margin-bottom: 1rem;
  opacity: 0;
  animation: fadeIn 1s ease 0.3s forwards;
}

.hero p {
  font-size: clamp(1rem, 2vw, 1.25rem);
  color: var(--text-mid);
  max-width: 480px;
  text-align: center;
  line-height: 1.6;
  opacity: 0;
  animation: fadeIn 1s ease 0.6s forwards;
}

.scroll-cue {
  position: absolute;
  bottom: 3rem;
  font-size: 0.85rem;
  color: var(--text-dim);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  opacity: 0;
  animation: fadeIn 1s ease 1.2s forwards;
}

.scroll-cue span {
  display: block;
  margin-top: 0.5rem;
  animation: bobDown 2s ease-in-out infinite;
}

/* ── Live Feed ────────────────────────────────── */

.section {
  max-width: 800px;
  margin: 0 auto;
  padding: 8rem 2rem;
}

.section-label {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: var(--accent);
  margin-bottom: 1rem;
}

.section h2 {
  font-size: clamp(1.5rem, 3vw, 2.25rem);
  font-weight: 600;
  letter-spacing: -0.02em;
  margin-bottom: 0.75rem;
}

.section .subtitle {
  color: var(--text-mid);
  font-size: 1rem;
  margin-bottom: 3rem;
  line-height: 1.6;
}

/* ── Terminal ─────────────────────────────────── */

.proof-feed {
  font-family: var(--mono);
  font-size: 0.85rem;
  line-height: 2;
}

.proof-line {
  display: flex;
  align-items: center;
  gap: 1rem;

}

.proof-line .id {
  color: var(--text-dim);
  min-width: 110px;
}

.proof-line .stmt {
  flex: 1;
  color: var(--text-mid);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.proof-line .status {
  font-weight: 500;
}

.proof-line .status.proved { color: var(--green); }
.proof-line .status.working { color: var(--orange); animation: pulse 1.5s ease infinite; }
.proof-line .status.failed { color: var(--red); }
.proof-line .status.queued { color: var(--text-dim); }

.proof-line .time {
  color: var(--text-dim);
  min-width: 50px;
  text-align: right;
}

/* ── Stats ────────────────────────────────────── */

.stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  background: var(--border);
  border-radius: 12px;
  overflow: hidden;
  margin-top: 3rem;
}

.stat {
  background: var(--surface);
  padding: 2rem;
  text-align: center;
}

.stat .number {
  font-size: 2rem;
  font-weight: 600;
  font-family: var(--mono);
  margin-bottom: 0.25rem;
}

.stat .number.accent { color: var(--accent); }
.stat .number.green { color: var(--green); }

.stat .label {
  font-size: 0.8rem;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

/* ── Proofs Grid ──────────────────────────────── */

.proofs-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1px;
  background: var(--border);
  border-radius: 12px;
  overflow: hidden;
}

.proof-card {
  background: var(--surface);
  padding: 1.75rem;
  transition: background 0.2s;
}

.proof-card:hover {
  background: #161616;
}

.proof-card .theorem-name {
  font-weight: 500;
  margin-bottom: 0.5rem;
}

.proof-card .theorem-stmt {
  color: var(--text-mid);
  font-size: 0.9rem;
  line-height: 1.5;
  margin-bottom: 1rem;
}

.proof-card .meta {
  display: flex;
  align-items: center;
  gap: 1rem;
  font-size: 0.75rem;
  font-family: var(--mono);
}

.proof-card .hash {
  color: var(--text-dim);
  cursor: pointer;
  transition: color 0.2s;
}

.proof-card .hash:hover { color: var(--accent); }

.proof-card .difficulty {
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.proof-card .difficulty.trivial { background: #1a2e1a; color: var(--green); }
.proof-card .difficulty.easy { background: #1a2e1a; color: var(--green); }
.proof-card .difficulty.medium { background: #2e2a1a; color: var(--orange); }
.proof-card .difficulty.hard { background: #2e1a1a; color: var(--red); }

.proof-card .date {
  color: var(--text-dim);
  margin-left: auto;
}

/* ── Pagination ──────────────────────────────── */

.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  margin-top: 2rem;
  font-family: var(--mono);
  font-size: 0.8rem;
}

.pagination button {
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text-mid);
  padding: 0.4rem 0.8rem;
  border-radius: 6px;
  cursor: pointer;
  font-family: var(--mono);
  font-size: 0.8rem;
  transition: background 0.2s, color 0.2s;
}

.pagination button:hover:not(:disabled) {
  background: #1a1a1a;
  color: var(--text);
}

.pagination button:disabled {
  opacity: 0.3;
  cursor: default;
}

.pagination .page-info {
  color: var(--text-dim);
}

/* ── Chain ────────────────────────────────────── */

.chain-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 0.8rem;
  font-family: var(--mono);
  color: var(--text-mid);
  margin-top: 2rem;
}

.chain-badge .dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--green);
  animation: pulse 2s ease infinite;
}

/* ── How It Works ─────────────────────────────── */

.steps {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2rem;
  counter-reset: step;
}

.step {
  display: flex;
  gap: 1.5rem;
  counter-increment: step;
}

.step::before {
  content: counter(step);
  font-family: var(--mono);
  font-size: 0.8rem;
  color: var(--accent);
  background: rgba(108, 99, 255, 0.1);
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  flex-shrink: 0;
  margin-top: 2px;
}

.step-content h3 {
  font-size: 1rem;
  font-weight: 500;
  margin-bottom: 0.35rem;
}

.step-content p {
  font-size: 0.9rem;
  color: var(--text-mid);
  line-height: 1.5;
}

/* ── Footer ───────────────────────────────────── */

.footer {
  text-align: center;
  padding: 4rem 2rem;
  border-top: 1px solid var(--border);
  margin-top: 4rem;
}

.footer p {
  color: var(--text-dim);
  font-size: 0.8rem;
}

.footer a {
  color: var(--text-mid);
  text-decoration: none;
  transition: color 0.2s;
}

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

/* ── Animations ───────────────────────────────── */

@keyframes fadeIn {
  to { opacity: 1; }
}

@keyframes breathe {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.05); }
}

@keyframes bobDown {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(6px); }
}

@keyframes slideIn {
  from { opacity: 0; transform: translateX(-10px); }
  to { opacity: 1; transform: translateX(0); }
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* ── Responsive ───────────────────────────────── */

@media (max-width: 640px) {
  /* Nav */
  nav {
    padding: 0.75rem 1rem;
    gap: 1rem;
  }

  nav .logo {
    font-size: 0.95rem;
  }

  nav a {
    font-size: 0.8rem;
  }

  /* Hero */
  .hero {
    min-height: 60vh;
    padding: 1.5rem;
    padding-top: 4rem;
  }

  .tombstone img {
    width: 80px;
    height: 80px;
  }

  .hero h1 {
    font-size: 2rem;
  }

  .hero p {
    font-size: 0.9rem;
    max-width: 320px;
  }

  /* Sections */
  .section {
    padding: 2rem 1.25rem;
  }

  .section h2 {
    font-size: 1.3rem;
  }

  .section .subtitle {
    font-size: 0.9rem;
    margin-bottom: 2rem;
  }

  /* Stats — keep 3 columns but smaller */
  .stats {
    grid-template-columns: repeat(3, 1fr);
  }

  .stat {
    padding: 1.25rem 0.5rem;
  }

  .stat .number {
    font-size: 1.5rem;
  }

  .stat .label {
    font-size: 0.65rem;
  }

  /* Feed lines — show statement but truncate */
  .proof-line {
    flex-wrap: wrap;
    gap: 0.25rem;
    padding: 0.4rem 0;
    border-bottom: 1px solid var(--border);
  }

  .proof-line .id {
    min-width: auto;
    font-size: 0.75rem;
  }

  .proof-line .stmt {
    display: block;
    width: 100%;
    font-size: 0.8rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    order: 3;
  }

  .proof-line .status {
    font-size: 0.75rem;
    margin-left: auto;
  }

  .proof-line .time {
    font-size: 0.75rem;
    min-width: auto;
  }

  /* Chain badge */
  .chain-badge {
    font-size: 0.7rem;
    padding: 0.4rem 0.75rem;
    margin-top: 1.5rem;
  }

  /* Steps */
  .step {
    gap: 1rem;
  }

  .step::before {
    width: 28px;
    height: 28px;
    font-size: 0.7rem;
  }

  .step-content h3 {
    font-size: 0.9rem;
  }

  .step-content p {
    font-size: 0.8rem;
  }

  /* Proof cards */
  .proof-card {
    padding: 1.25rem;
  }

  .proof-card .theorem-name {
    font-size: 0.9rem;
  }

  .proof-card .theorem-stmt {
    font-size: 0.8rem;
  }

  .proof-card .meta {
    flex-wrap: wrap;
    gap: 0.5rem;
    font-size: 0.65rem;
  }

  .proof-card .hash {
    max-width: 140px;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  /* Pagination */
  .pagination {
    font-size: 0.7rem;
  }

  .pagination button {
    padding: 0.3rem 0.6rem;
    font-size: 0.7rem;
  }

  /* Stats spacing */
  .stats {
    margin-top: 1.5rem;
  }

  /* Footer */
  .footer {
    padding: 2rem 1rem;
    margin-top: 1rem;
  }

  .footer p {
    font-size: 0.7rem;
  }

  /* Live activity box */
  .live-activity {
    font-size: 0.75rem;
  }

  /* Proof subtitle with contract link */
  .section .subtitle a {
    display: block;
    margin-top: 0.25rem;
  }
}
