/* BibDex — public site. Mirrors the app's collector palette (src/theme/colors.js). */

:root {
  --bg: #0F0D0B;
  --surface: #1C1916;
  --surface-2: #242018;
  --text: #F2EAD8;
  --text-secondary: #8A7E6A;
  --text-muted: #5A4A3A;
  --gold: #C9A84C;
  --border: rgba(201, 168, 76, 0.12);
  --track: rgba(242, 234, 216, 0.07);
  --common: #9BA8B0;
  --rare: #5B8FD4;
  --epic: #9B6FD4;
  --legendary: #C9A84C;
  --serif: Georgia, 'Times New Roman', serif;
  --sans: 'Seravek', 'Gill Sans', 'Avenir Next', 'Helvetica Neue', system-ui, sans-serif;
}

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

html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  position: relative;
}

/* Warm atmosphere: faint gold aurora at the top, vignette at the edges */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background:
    radial-gradient(ellipse 80% 50% at 50% -10%, rgba(201, 168, 76, 0.10), transparent 60%),
    radial-gradient(ellipse 60% 40% at 85% 110%, rgba(91, 143, 212, 0.05), transparent 60%);
  pointer-events: none;
  z-index: 0;
}

/* Film grain */
body::after {
  content: '';
  position: fixed;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='200' height='200'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2'/%3E%3C/filter%3E%3Crect width='200' height='200' filter='url(%23n)' opacity='0.5'/%3E%3C/svg%3E");
  opacity: 0.035;
  pointer-events: none;
  z-index: 1;
}

.page {
  position: relative;
  z-index: 2;
  max-width: 960px;
  margin: 0 auto;
  padding: 0 24px;
}

/* ── Header ─────────────────────────────────────────── */

header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 28px 0;
}

.wordmark {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--text);
}

.wordmark .gem { filter: drop-shadow(0 0 6px rgba(201, 168, 76, 0.55)); }

.wordmark span {
  font-family: var(--serif);
  font-size: 19px;
  letter-spacing: 4px;
  color: var(--gold);
}

header nav a {
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 14px;
  letter-spacing: 0.5px;
  margin-left: 24px;
  transition: color 0.2s;
}

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

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

.hero {
  padding: 96px 0 72px;
  text-align: center;
}

.hero .eyebrow {
  font-size: 12px;
  letter-spacing: 3px;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 20px;
}

.hero h1 {
  font-family: var(--serif);
  font-size: clamp(2.4rem, 6vw, 4rem);
  font-weight: 400;
  line-height: 1.15;
  max-width: 17ch;
  margin: 0 auto 24px;
}

.hero h1 em {
  font-style: italic;
  color: var(--gold);
}

.hero p {
  color: var(--text-secondary);
  max-width: 52ch;
  margin: 0 auto 40px;
}

.cta {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--serif);
  font-size: 15px;
  letter-spacing: 2px;
  color: var(--bg);
  background: linear-gradient(180deg, #D9BC6A, var(--gold));
  border: none;
  border-radius: 999px;
  padding: 14px 32px;
  text-decoration: none;
  box-shadow: 0 0 32px rgba(201, 168, 76, 0.25);
  transition: transform 0.2s, box-shadow 0.2s;
}

.cta:hover {
  transform: translateY(-1px);
  box-shadow: 0 0 44px rgba(201, 168, 76, 0.4);
}

.cta-note {
  display: block;
  margin-top: 14px;
  font-size: 13px;
  color: var(--text-muted);
}

/* ── Rarity showcase ────────────────────────────────── */

.rarities {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
  padding: 24px 0 80px;
}

.rarity {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 24px 12px 20px;
  text-align: center;
  transition: transform 0.25s, border-color 0.25s;
}

.rarity:hover { transform: translateY(-3px); }

.rarity .gem-lg {
  display: block;
  margin: 0 auto 12px;
}

.rarity h3 {
  font-family: var(--serif);
  font-size: 15px;
  font-weight: 400;
  letter-spacing: 1.5px;
  text-transform: uppercase;
}

.rarity p {
  font-size: 12.5px;
  color: var(--text-muted);
  margin-top: 4px;
}

.rarity[data-r='common']    { --rc: var(--common); }
.rarity[data-r='rare']      { --rc: var(--rare); }
.rarity[data-r='epic']      { --rc: var(--epic); }
.rarity[data-r='legendary'] { --rc: var(--legendary); }

.rarity h3 { color: var(--rc); }
.rarity:hover { border-color: color-mix(in srgb, var(--rc) 35%, transparent); }
.rarity .gem-lg { filter: drop-shadow(0 0 10px var(--rc)); }

/* ── Steps ──────────────────────────────────────────── */

.steps {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  padding-bottom: 96px;
}

.step {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 28px 24px;
}

.step .num {
  font-family: var(--serif);
  font-size: 32px;
  color: var(--gold);
  display: block;
  margin-bottom: 10px;
}

.step h3 {
  font-family: var(--serif);
  font-weight: 400;
  font-size: 19px;
  margin-bottom: 8px;
}

.step p {
  font-size: 14.5px;
  color: var(--text-secondary);
}

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

footer {
  border-top: 1px solid var(--border);
  padding: 32px 0 48px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
  font-size: 13.5px;
  color: var(--text-muted);
}

footer nav a {
  color: var(--text-secondary);
  text-decoration: none;
  margin-left: 20px;
  transition: color 0.2s;
}

footer nav a:first-child { margin-left: 0; }
footer nav a:hover { color: var(--gold); }

/* ── Legal pages ────────────────────────────────────── */

.legal main {
  max-width: 720px;
  margin: 0 auto;
  padding: 40px 0 96px;
}

.legal h1 {
  font-family: var(--serif);
  font-size: clamp(1.9rem, 4.5vw, 2.6rem);
  font-weight: 400;
  margin-bottom: 8px;
}

.legal .stand {
  font-size: 13.5px;
  color: var(--text-muted);
  margin-bottom: 48px;
}

.legal section { margin-bottom: 40px; }

.legal h2 {
  font-family: var(--serif);
  font-weight: 400;
  font-size: 21px;
  margin-bottom: 12px;
}

.legal h2::before {
  content: attr(data-num);
  color: var(--gold);
  margin-right: 12px;
  font-style: italic;
}

.legal p, .legal li {
  color: var(--text-secondary);
  font-size: 15.5px;
  margin-bottom: 10px;
}

.legal ul { padding-left: 22px; }
.legal li { margin-bottom: 6px; }
.legal li::marker { color: var(--gold); }

.legal strong { color: var(--text); font-weight: 600; }

.legal a { color: var(--gold); text-decoration: none; }
.legal a:hover { text-decoration: underline; }

.legal address {
  font-style: normal;
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 2px solid var(--gold);
  border-radius: 12px;
  padding: 20px 24px;
  color: var(--text-secondary);
  font-size: 15.5px;
  line-height: 1.8;
}

/* ── Reveal animation ───────────────────────────────── */

@keyframes rise {
  from { opacity: 0; transform: translateY(14px); }
  to   { opacity: 1; transform: translateY(0); }
}

.rise { animation: rise 0.7s cubic-bezier(0.2, 0.7, 0.3, 1) both; }
.d1 { animation-delay: 0.05s; }
.d2 { animation-delay: 0.15s; }
.d3 { animation-delay: 0.25s; }
.d4 { animation-delay: 0.35s; }
.d5 { animation-delay: 0.45s; }

@media (prefers-reduced-motion: reduce) {
  .rise { animation: none; }
}

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

@media (max-width: 720px) {
  .rarities { grid-template-columns: repeat(2, 1fr); }
  .steps { grid-template-columns: 1fr; }
  .hero { padding: 64px 0 48px; }
  header nav a { margin-left: 16px; }
}
