:root {
  --bg:             #07080a;
  --surface:        #0f1014;
  --surface-raised: #15171d;
  --border:         #222530;
  --rule:           rgba(255, 255, 255, 0.06);
  --ink:            #e8e2d5;
  --ink-muted:      #8a8578;
  --ink-dim:        #3a3830;
  --red:            #c0392b;
  --red-hover:      #d44030;
  --gold:           #9d7a2a;
  --gold-bright:    #c8a240;
  --gold-border:    rgba(157, 122, 42, 0.22);
  --maxw:           640px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: 'IBM Plex Sans', ui-sans-serif, system-ui, sans-serif;
  background: var(--bg);
  color: var(--ink);
  line-height: 1.65;
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}

/* grain texture (matches web/src/index.css) */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 999;
  opacity: 0.032;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='300' height='300'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.75' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='300' height='300' filter='url(%23n)' opacity='1'/%3E%3C/svg%3E");
  background-repeat: repeat;
}

.gilt { color: var(--gold-bright); }

/* ── top bar ─────────────────────────────────────────────── */
.topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.85rem 1.5rem;
  background: rgba(7, 8, 10, 0.82);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--rule);
}
.wordmark {
  font-family: 'Playfair Display', serif;
  font-weight: 700;
  font-size: 1.05rem;
  letter-spacing: 0.3px;
  color: var(--ink);
  text-decoration: none;
}

.btn-app {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.78rem;
  letter-spacing: 0.4px;
  background: var(--red);
  color: #fff;
  text-decoration: none;
  padding: 0.5rem 0.9rem;
  border-radius: 4px;
  white-space: nowrap;
  transition: background 0.18s ease, transform 0.18s ease;
}
.btn-app:hover { background: var(--red-hover); transform: translateY(-1px); }

/* ── hero gate ───────────────────────────────────────────── */
.hero {
  min-height: min(82vh, 720px);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 3rem 1.5rem 3.5rem;
  background: radial-gradient(120% 75% at 50% 0%, var(--surface-raised), var(--bg) 70%);
  border-bottom: 1px solid var(--gold-border);
}
.hero-title {
  font-family: 'Playfair Display', serif;
  font-weight: 700;
  font-size: clamp(3rem, 9vw, 5.5rem);
  line-height: 1;
  letter-spacing: -0.5px;
}
.hero-tagline {
  font-family: 'Playfair Display', serif;
  font-style: italic;
  color: var(--ink-muted);
  font-size: clamp(0.95rem, 2.4vw, 1.15rem);
  margin: 1.1rem 0 2rem;
  max-width: 34ch;
}
.btn-app-lg { font-size: 0.95rem; padding: 0.8rem 1.6rem; border-radius: 6px; }
.scroll-hint {
  margin-top: 2.5rem;
  color: var(--ink-dim);
  font-size: 0.78rem;
  text-decoration: none;
  font-family: 'IBM Plex Mono', monospace;
  transition: color 0.18s ease;
}
.scroll-hint:hover { color: var(--ink-muted); }

/* ── letter ──────────────────────────────────────────────── */
.letter {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 4rem 1.5rem 2rem;
  animation: fadeUp 0.7s cubic-bezier(0.22, 1, 0.36, 1) both;
}
.letter h1,
.letter h2 {
  font-family: 'Playfair Display', serif;
  font-weight: 700;
  line-height: 1.2;
  margin: 2.6rem 0 1rem;
  padding-top: 1.6rem;
  border-top: 1px solid var(--gold-border);
}
.letter h1 { font-size: 1.9rem; color: var(--ink); }
.letter h2 { font-size: 1.4rem; color: var(--gold-bright); border-top-color: var(--rule); }
.letter > h1:first-child,
.letter > h2:first-child { border-top: none; padding-top: 0; margin-top: 0; }
.letter p { margin: 0 0 1.25rem; }
.letter em { color: var(--ink); font-style: italic; }
.letter strong { color: var(--ink); font-weight: 600; }
.letter a {
  color: var(--gold-bright);
  text-decoration: underline;
  text-underline-offset: 2px;
}
.letter a:hover { color: var(--gold); }

/* ── footer ──────────────────────────────────────────────── */
.footer {
  max-width: var(--maxw);
  margin: 2rem auto 0;
  padding: 2.5rem 1.5rem 4rem;
  border-top: 1px solid var(--rule);
  color: var(--ink-muted);
  font-size: 0.82rem;
  font-family: 'IBM Plex Mono', monospace;
  display: flex;
  align-items: center;
  gap: 0.6rem;
  justify-content: center;
}
.footer a { color: var(--ink-muted); text-decoration: none; }
.footer a:hover { color: var(--gold-bright); }
.footer .dot { color: var(--ink-dim); }

.badge-discord {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  transition: color 0.18s ease;
}
.badge-discord-mark { flex: none; }
.badge-discord:hover { color: #5865f2; }

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

@media (max-width: 700px) {
  .topbar { padding: 0.7rem 1rem; }
  .letter { padding: 2.5rem 1.25rem 1.5rem; }
  .hero { min-height: 70vh; }
}
