:root {
  --p31-bg: #f8f7f4;
  --p31-surface: #ffffff;
  --p31-border: #e8e5df;
  --p31-text: #1a1815;
  --p31-text-secondary: #6b6558;
  --p31-accent: #6d28d9;
  --p31-accent-alt: #2563eb;
  --p31-success: #059669;
  --p31-gold: #d97706;
  --p31-radius: 6px;
  --p31-font: 'Inter', system-ui, -apple-system, sans-serif;
}

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

html {
  font-family: var(--p31-font);
  font-size: 17px;
  background: var(--p31-bg);
  color: var(--p31-text);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  scroll-behavior: smooth;
}

body {
  line-height: 1.7;
}

::selection {
  background: var(--p31-accent);
  color: #fff;
}

:focus-visible {
  outline: 2px solid var(--p31-accent);
  outline-offset: 2px;
}

img, svg {
  max-width: 100%;
  display: block;
}

a {
  color: var(--p31-accent);
  text-decoration: none;
}
a:hover {
  text-decoration: underline;
}

/* ── Header ── */

.site-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 24px;
  border-bottom: 1px solid var(--p31-border);
  background: var(--p31-surface);
  position: sticky;
  top: 0;
  z-index: 10;
  backdrop-filter: blur(8px);
}

.logo {
  font-size: 20px;
  font-weight: 800;
  color: var(--p31-accent);
  text-decoration: none;
  letter-spacing: -0.02em;
}
.logo:hover {
  text-decoration: none;
  opacity: 0.85;
}

.site-nav {
  display: flex;
  gap: 20px;
  align-items: center;
}
.site-nav a {
  color: var(--p31-text-secondary);
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  transition: color 0.15s;
}
.site-nav a:hover {
  color: var(--p31-text);
  text-decoration: none;
}

/* ── Hero ── */

.hero {
  padding: 80px 24px 60px;
  text-align: center;
  max-width: 800px;
  margin: 0 auto;
}
.hero h1 {
  font-size: 40px;
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.15;
  margin-bottom: 16px;
  color: var(--p31-text);
}
.hero p {
  font-size: 18px;
  color: var(--p31-text-secondary);
  margin-bottom: 24px;
  line-height: 1.65;
}
.hero-actions {
  display: flex;
  gap: 12px;
  justify-content: center;
  flex-wrap: wrap;
}

/* ── Buttons ── */

.btn {
  display: inline-block;
  padding: 10px 24px;
  border-radius: var(--p31-radius);
  font-weight: 600;
  font-size: 14px;
  text-decoration: none;
  transition: all 0.15s;
  cursor: pointer;
  border: none;
  line-height: 1.5;
}
.btn:hover {
  text-decoration: none;
}

.btn-primary {
  background: var(--p31-accent);
  color: #fff;
}
.btn-primary:hover {
  background: #5b21b6;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(109,40,217,0.3);
}

.btn-outline {
  border: 2px solid var(--p31-border);
  color: var(--p31-text);
  background: transparent;
}
.btn-outline:hover {
  border-color: var(--p31-accent);
  color: var(--p31-accent);
}

/* ── Sections ── */

section {
  padding: 56px 24px;
  max-width: 960px;
  margin: 0 auto;
}
section h2 {
  font-size: 24px;
  font-weight: 800;
  margin-bottom: 16px;
  letter-spacing: -0.01em;
  color: var(--p31-text);
}
section h3 {
  font-size: 18px;
  font-weight: 700;
  margin-bottom: 8px;
  color: var(--p31-text);
}

.section-alt {
  background: var(--p31-surface);
  border-top: 1px solid var(--p31-border);
  border-bottom: 1px solid var(--p31-border);
  max-width: none;
}
.section-alt-inner {
  max-width: 960px;
  margin: 0 auto;
  padding: 56px 24px;
}

/* ── Grid & Cards ── */

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
}

.card {
  background: var(--p31-surface);
  border: 1px solid var(--p31-border);
  border-radius: var(--p31-radius);
  padding: 20px;
  transition: box-shadow 0.15s, transform 0.15s;
}
.card:hover {
  box-shadow: 0 2px 12px rgba(0,0,0,0.06);
  transform: translateY(-1px);
}
.card h3 {
  font-size: 16px;
  color: var(--p31-accent);
  margin-bottom: 6px;
}
.card p {
  font-size: 14px;
  color: var(--p31-text-secondary);
  margin-top: 6px;
  line-height: 1.6;
}

/* ── Stats ── */

.stats {
  display: flex;
  justify-content: center;
  gap: 40px;
  flex-wrap: wrap;
  margin: 32px 0;
}
.stat {
  text-align: center;
}
.stat-num {
  font-size: 36px;
  font-weight: 800;
  color: var(--p31-accent);
  line-height: 1.2;
}
.stat-label {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--p31-text-secondary);
  display: block;
  margin-top: 4px;
}

/* ── Badges ── */

.badge {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 12px;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.badge-live {
  background: #d1fae5;
  color: var(--p31-success);
}
.badge-alpha {
  background: #fef3c7;
  color: var(--p31-gold);
}

/* ── Paper List ── */

.paper-list {
  list-style: none;
}
.paper-list li {
  padding: 10px 0;
  border-bottom: 1px solid var(--p31-border);
  font-size: 14px;
  color: var(--p31-text-secondary);
}
.paper-list a {
  color: var(--p31-accent);
  text-decoration: none;
  font-weight: 600;
}
.paper-list a:hover {
  text-decoration: underline;
}

/* ── Footer ── */

.site-footer {
  border-top: 1px solid var(--p31-border);
  padding: 32px 24px;
  text-align: center;
  font-size: 13px;
  color: var(--p31-text-secondary);
  line-height: 1.8;
}
.site-footer a {
  color: var(--p31-accent);
  font-weight: 500;
}

/* ── Responsive ── */

@media (max-width: 640px) {
  html {
    font-size: 16px;
  }

  .site-header {
    padding: 12px 16px;
  }

  .site-nav {
    gap: 10px;
  }
  .site-nav a {
    font-size: 12px;
  }

  .hero {
    padding: 48px 16px 40px;
  }
  .hero h1 {
    font-size: 28px;
  }
  .hero p {
    font-size: 16px;
  }

  section {
    padding: 40px 16px;
  }

  .grid {
    grid-template-columns: 1fr;
  }

  .stats {
    gap: 20px;
  }

  .stat-num {
    font-size: 28px;
  }
}
