:root {
  --bg: #05070f;
  --bg-panel: #0b0f1e;
  --bg-panel-2: #10162a;
  --border: rgba(120, 160, 255, 0.16);
  --text: #e9edf7;
  --text-dim: #9aa4c0;
  --blue: #4aa8ff;
  --purple: #8b5cf6;
  --gold: #d4af37;
  --gold-dim: #8a6f2a;
  --radius: 14px;
  --font-head: "Orbitron", "Segoe UI", sans-serif;
  --font-body: "Inter", "Segoe UI", system-ui, sans-serif;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: radial-gradient(ellipse at 50% -10%, #131c3a 0%, var(--bg) 55%);
  color: var(--text);
  font-family: var(--font-body);
  line-height: 1.55;
  min-height: 100vh;
}

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

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

.container {
  max-width: 1180px;
  margin: 0 auto;
  padding: 0 24px;
}

/* ---------- Nav ---------- */
.site-nav {
  position: sticky;
  top: 0;
  z-index: 50;
  backdrop-filter: blur(10px);
  background: rgba(5, 7, 15, 0.75);
  border-bottom: 1px solid var(--border);
}
.site-nav .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 68px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-head);
  font-size: 1.1rem;
  letter-spacing: 0.04em;
  color: var(--text);
}
.brand img { height: 36px; width: auto; }
.nav-links {
  display: flex;
  gap: 28px;
  font-size: 0.92rem;
}
.nav-links a { color: var(--text-dim); }
.nav-links a:hover { color: var(--text); text-decoration: none; }

/* ---------- Hero ---------- */
.hero {
  padding: 96px 0 72px;
  text-align: center;
  position: relative;
  overflow: hidden;
}
.hero::before {
  content: "";
  position: absolute;
  inset: -20% -10% auto -10%;
  height: 480px;
  background: radial-gradient(closest-side, rgba(74,168,255,0.18), transparent 70%);
  pointer-events: none;
}
.hero-logo {
  width: min(320px, 60vw);
  margin: 0 auto 12px;
  filter: drop-shadow(0 0 40px rgba(74,168,255,0.35));
}
.hero h1 {
  font-family: var(--font-head);
  font-size: clamp(1.8rem, 4vw, 3rem);
  margin: 0 0 12px;
  background: linear-gradient(120deg, #cfe4ff, #9fd0ff 40%, #c9a6ff 75%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.hero p.tagline {
  color: var(--text-dim);
  font-size: 1.1rem;
  max-width: 620px;
  margin: 0 auto 32px;
}
.hero-ctas { display: flex; gap: 16px; justify-content: center; flex-wrap: wrap; }

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 13px 26px;
  border-radius: 999px;
  font-weight: 600;
  font-size: 0.95rem;
  cursor: pointer;
  border: 1px solid transparent;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.btn:hover { transform: translateY(-1px); text-decoration: none; }
.btn-primary {
  background: linear-gradient(120deg, var(--blue), var(--purple));
  color: #05070f;
  box-shadow: 0 8px 30px rgba(74,168,255,0.25);
}
.btn-ghost {
  background: transparent;
  border-color: var(--border);
  color: var(--text);
}

/* ---------- Sections ---------- */
section { padding: 64px 0; }
.section-title {
  font-family: var(--font-head);
  font-size: clamp(1.3rem, 2.4vw, 1.8rem);
  margin-bottom: 8px;
}
.section-sub { color: var(--text-dim); margin-bottom: 36px; max-width: 640px; }

/* ---------- Ecosystem tiles ---------- */
.tile-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 18px;
}
.tile {
  background: linear-gradient(160deg, var(--bg-panel), var(--bg-panel-2));
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px;
  position: relative;
  overflow: hidden;
}
.tile h3 { margin: 0 0 6px; font-size: 1.05rem; }
.tile p { color: var(--text-dim); font-size: 0.88rem; margin: 0 0 14px; }
.status-badge {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 4px 10px;
  border-radius: 999px;
}
.status-live { background: rgba(90, 230, 150, 0.14); color: #6fe6a0; }
.status-build { background: rgba(255, 190, 80, 0.14); color: #ffcf7a; }
.status-plan { background: rgba(160, 170, 200, 0.14); color: var(--text-dim); }

/* ---------- Book grid ---------- */
.book-toolbar {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 28px;
  align-items: center;
}
.book-toolbar input {
  flex: 1;
  min-width: 220px;
  background: var(--bg-panel);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 11px 16px;
  border-radius: 999px;
  font-size: 0.95rem;
}
.book-toolbar input:focus { outline: 2px solid var(--blue); }
.book-count { color: var(--text-dim); font-size: 0.88rem; white-space: nowrap; }

.book-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 22px;
}
.book-card {
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
  transition: transform 0.15s ease, border-color 0.15s ease;
}
.book-card:hover { transform: translateY(-4px); border-color: rgba(120,160,255,0.4); }
.book-cover {
  aspect-ratio: 2/3;
  width: 100%;
  object-fit: cover;
  background: linear-gradient(160deg, #1a2140, #0c1024);
}
.book-cover.placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-dim);
  font-family: var(--font-head);
  font-size: 0.8rem;
  padding: 10px;
  text-align: center;
}
.book-info { padding: 12px 14px 16px; }
.book-title {
  font-size: 0.88rem;
  font-weight: 600;
  margin: 0 0 4px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.book-lang {
  font-size: 0.72rem;
  color: var(--gold);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* ---------- Seal badge (Sigillum heritage) ---------- */
.seal-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.75rem;
  color: var(--gold);
  border: 1px solid var(--gold-dim);
  padding: 6px 12px;
  border-radius: 999px;
  background: rgba(212,175,55,0.06);
}
.seal-badge img { height: 18px; width: 18px; border-radius: 50%; object-fit: cover; }

/* ---------- Footer ---------- */
footer {
  border-top: 1px solid var(--border);
  padding: 40px 0;
  color: var(--text-dim);
  font-size: 0.85rem;
  text-align: center;
}

/* ---------- Resident widget host ---------- */
#virti-resident-mount {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 999;
}

@media (max-width: 640px) {
  .site-nav .nav-links { display: none; }
  .hero { padding: 64px 0 48px; }
}
