@import url('https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@400;500;600;700&family=Inter:wght@400;500;600&family=JetBrains+Mono:wght@400;500&display=swap');

:root {
  /* --- Palette --- */
  --void: #05060b;
  --void-2: #0b0d1a;
  --panel: #10132b;
  --panel-border: #262a52;
  --nebula-violet: #8b5cf6;
  --nebula-rose: #f2578a;
  --signal-cyan: #5eead4;
  --star-white: #f5f6fa;
  --dust: #8b90ac;
  --dust-dim: #565b7d;
  --danger: #ff6b6b;

  /* --- Type --- */
  --font-display: 'Space Grotesk', sans-serif;
  --font-body: 'Inter', sans-serif;
  --font-mono: 'JetBrains Mono', monospace;

  --radius: 10px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--void);
  color: var(--star-white);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}

#starfield {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
}

.nebula-glow {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background:
    radial-gradient(ellipse 60% 40% at 20% 15%, rgba(139, 92, 246, 0.20), transparent 60%),
    radial-gradient(ellipse 50% 35% at 85% 30%, rgba(242, 87, 138, 0.14), transparent 60%),
    radial-gradient(ellipse 45% 30% at 60% 85%, rgba(94, 234, 212, 0.08), transparent 60%);
  animation: drift 40s ease-in-out infinite alternate;
}

@keyframes drift {
  from { transform: translate(0, 0) scale(1); }
  to { transform: translate(-2%, 2%) scale(1.05); }
}

@media (prefers-reduced-motion: reduce) {
  .nebula-glow { animation: none; }
  html { scroll-behavior: auto; }
}

main, header, footer { position: relative; z-index: 1; }

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

h1, h2, h3 {
  font-family: var(--font-display);
  font-weight: 600;
  letter-spacing: 0.01em;
  margin: 0 0 0.5em;
}

.eyebrow {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--signal-cyan);
  margin-bottom: 0.6em;
  display: block;
}

p { color: var(--dust); margin: 0 0 1em; }

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

/* --- Nav --- */
.nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 32px;
  transition: background 0.3s ease, backdrop-filter 0.3s ease, border-color 0.3s ease;
  border-bottom: 1px solid transparent;
}
.nav.scrolled {
  background: rgba(5, 6, 11, 0.85);
  backdrop-filter: blur(10px);
  border-bottom-color: var(--panel-border);
}
.nav-logo {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.15rem;
  letter-spacing: 0.06em;
  color: var(--star-white);
}
.nav-logo span { color: var(--nebula-violet); }
.nav-links { display: flex; gap: 28px; align-items: center; }
.nav-links a {
  color: var(--dust);
  font-size: 0.92rem;
  font-weight: 500;
}
.nav-links a:hover { color: var(--star-white); text-decoration: none; }

/* --- Buttons --- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 0.95rem;
  padding: 13px 26px;
  border-radius: 8px;
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease, border-color 0.15s ease;
  text-decoration: none;
}
.btn:focus-visible {
  outline: 2px solid var(--signal-cyan);
  outline-offset: 2px;
}
.btn-primary {
  background: linear-gradient(135deg, var(--nebula-violet), var(--nebula-rose));
  color: #fff;
}
.btn-primary:hover { transform: translateY(-1px); box-shadow: 0 8px 24px rgba(139, 92, 246, 0.35); text-decoration: none; }
.btn-secondary {
  background: transparent;
  border-color: var(--panel-border);
  color: var(--star-white);
}
.btn-secondary:hover { border-color: var(--signal-cyan); color: var(--signal-cyan); text-decoration: none; }
.btn-block { width: 100%; }
.btn[disabled] { opacity: 0.55; cursor: not-allowed; transform: none !important; }

/* --- Hero --- */
.hero {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  padding: 140px 24px 80px;
}
.hero-inner { max-width: 1120px; margin: 0 auto; width: 100%; }
.hero h1 {
  font-size: clamp(2.6rem, 6vw, 4.6rem);
  line-height: 1.05;
  max-width: 14ch;
  background: linear-gradient(135deg, #fff 40%, var(--nebula-violet));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}
.hero p.lede {
  font-size: 1.15rem;
  max-width: 46ch;
  color: var(--dust);
}
.hero-ctas { display: flex; gap: 16px; margin-top: 32px; flex-wrap: wrap; }
.hero-meta {
  margin-top: 56px;
  display: flex;
  gap: 40px;
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: var(--dust-dim);
  flex-wrap: wrap;
}
.hero-meta strong { color: var(--star-white); display: block; font-size: 1.4rem; font-family: var(--font-display); }

/* --- Constellation divider (signature element) --- */
.constellation-divider {
  width: 100%;
  height: 32px;
  margin: 0 auto;
  display: block;
  opacity: 0.5;
}

/* --- Sections --- */
section { padding: 100px 0; }
.section-head { max-width: 640px; margin-bottom: 56px; }
.section-head h2 { font-size: clamp(1.8rem, 3.5vw, 2.4rem); }

/* --- Mission log / feature grid --- */
.log-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1px;
  background: var(--panel-border);
  border: 1px solid var(--panel-border);
  border-radius: var(--radius);
  overflow: hidden;
}
.log-entry {
  background: var(--panel);
  padding: 32px;
}
.log-entry h3 { font-size: 1.1rem; color: var(--star-white); }
.log-entry p { font-size: 0.95rem; margin-bottom: 0; }

/* --- Pricing / provisioning card --- */
.provisioning {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 0;
  border: 1px solid var(--panel-border);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--panel);
}
.provisioning-art {
  background:
    radial-gradient(circle at 30% 30%, rgba(139, 92, 246, 0.35), transparent 60%),
    radial-gradient(circle at 70% 70%, rgba(242, 87, 138, 0.25), transparent 60%),
    var(--void-2);
  min-height: 320px;
  position: relative;
}
.provisioning-body { padding: 48px; }
.price-row { display: flex; align-items: baseline; gap: 10px; margin: 24px 0; }
.price-row .amount { font-family: var(--font-display); font-size: 2.6rem; font-weight: 700; }
.price-row .currency { color: var(--dust); }
.platform-badges { display: flex; gap: 12px; margin: 20px 0 28px; }
.badge {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  padding: 6px 12px;
  border: 1px solid var(--panel-border);
  border-radius: 6px;
  color: var(--dust);
}
.feature-list { list-style: none; padding: 0; margin: 0 0 28px; }
.feature-list li { padding: 6px 0; color: var(--star-white); font-size: 0.95rem; }
.feature-list li::before { content: '›'; color: var(--signal-cyan); margin-right: 10px; }

/* --- Forms / auth cards --- */
.auth-wrap {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  /* Extra top padding clears the fixed .nav. Without it the card centres
     against the full viewport and slides under the header on short screens
     - the sign-in field ends up behind the nav bar. */
  padding: 104px 24px 32px;
}
.auth-card {
  width: 100%;
  max-width: 420px;
  background: var(--panel);
  border: 1px solid var(--panel-border);
  border-radius: var(--radius);
  padding: 40px;
}
.auth-card h1 { font-size: 1.6rem; }
.auth-card .sub { margin-bottom: 28px; font-size: 0.92rem; }
.field { margin-bottom: 18px; }
.field label {
  display: block;
  font-size: 0.85rem;
  color: var(--dust);
  margin-bottom: 6px;
}
.field input {
  width: 100%;
  background: var(--void-2);
  border: 1px solid var(--panel-border);
  color: var(--star-white);
  padding: 12px 14px;
  border-radius: 8px;
  font-family: var(--font-body);
  font-size: 0.95rem;
}
.field input:focus {
  outline: none;
  border-color: var(--signal-cyan);
  box-shadow: 0 0 0 3px rgba(94, 234, 212, 0.15);
}
.field .hint { font-size: 0.78rem; color: var(--dust-dim); margin-top: 6px; }
.form-msg {
  font-size: 0.88rem;
  padding: 10px 14px;
  border-radius: 8px;
  margin-bottom: 18px;
  display: none;
}
.form-msg.show { display: block; }
.form-msg.error { background: rgba(255, 107, 107, 0.12); color: var(--danger); border: 1px solid rgba(255, 107, 107, 0.3); }
.form-msg.success { background: rgba(94, 234, 212, 0.1); color: var(--signal-cyan); border: 1px solid rgba(94, 234, 212, 0.3); }
.auth-switch { text-align: center; margin-top: 22px; font-size: 0.9rem; color: var(--dust); }

/* --- Dashboard / Admin shell --- */
.app-shell { padding: 120px 0 80px; min-height: 100vh; }
.app-header { display: flex; justify-content: space-between; align-items: flex-end; margin-bottom: 40px; flex-wrap: wrap; gap: 16px; }
.card {
  background: var(--panel);
  border: 1px solid var(--panel-border);
  border-radius: var(--radius);
  padding: 28px;
  margin-bottom: 24px;
}
.card h2 { font-size: 1.1rem; }
.key-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 0;
  border-bottom: 1px solid var(--panel-border);
  gap: 16px;
  flex-wrap: wrap;
}
.key-row:last-child { border-bottom: none; }
.key-code { font-family: var(--font-mono); font-size: 0.95rem; }
.status-pill {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  padding: 4px 10px;
  border-radius: 100px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.status-unredeemed { background: rgba(94, 234, 212, 0.12); color: var(--signal-cyan); }
.status-redeemed { background: rgba(139, 92, 246, 0.15); color: var(--nebula-violet); }
.status-revoked, .status-banned, .status-suspended { background: rgba(255, 107, 107, 0.12); color: var(--danger); }
.status-active { background: rgba(94, 234, 212, 0.12); color: var(--signal-cyan); }

.data-table { width: 100%; border-collapse: collapse; font-size: 0.9rem; }
.data-table th {
  text-align: left;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--dust-dim);
  padding: 10px 12px;
  border-bottom: 1px solid var(--panel-border);
}
.data-table td { padding: 12px; border-bottom: 1px solid var(--panel-border); }
.data-table tr:hover td { background: rgba(255,255,255,0.02); }
.table-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.btn-small { padding: 7px 14px; font-size: 0.82rem; border-radius: 6px; }

select {
  background: var(--void-2);
  color: var(--star-white);
  border: 1px solid var(--panel-border);
  padding: 8px 12px;
  border-radius: 6px;
  font-family: var(--font-body);
}

footer {
  padding: 48px 24px;
  text-align: center;
  color: var(--dust-dim);
  font-size: 0.85rem;
}

@media (max-width: 760px) {
  .provisioning { grid-template-columns: 1fr; }
  .provisioning-art { min-height: 160px; }
  .nav-links { display: none; }
}

/* ============================================================
   News + Forum pages
   ============================================================ */

.page-head { padding: 130px 0 40px; }
.page-head h1 { font-size: clamp(2rem, 4vw, 2.8rem); margin-bottom: 8px; }
.page-head p { max-width: 60ch; }

.breadcrumb {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--dust-dim);
  margin-bottom: 16px;
}
.breadcrumb a { color: var(--dust); }
.breadcrumb .sep { margin: 0 8px; opacity: 0.5; }

/* --- News list --- */
.news-list { display: grid; gap: 16px; }
.news-item {
  background: var(--panel);
  border: 1px solid var(--panel-border);
  border-radius: var(--radius);
  padding: 26px 28px;
}
.news-item h2 { font-size: 1.25rem; margin-bottom: 8px; }
.news-item p { margin-bottom: 0; }
.news-meta {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.cat-pill {
  padding: 3px 10px;
  border-radius: 100px;
  font-size: 0.68rem;
}
.cat-news  { background: rgba(139, 92, 246, 0.16); color: var(--nebula-violet); }
.cat-patch { background: rgba(94, 234, 212, 0.12); color: var(--signal-cyan); }
.cat-event { background: rgba(242, 87, 138, 0.14); color: var(--nebula-rose); }
.news-date { color: var(--dust-dim); }

/* --- Forum category list --- */
.cat-list { display: grid; gap: 12px; }
.cat-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  background: var(--panel);
  border: 1px solid var(--panel-border);
  border-radius: var(--radius);
  padding: 22px 26px;
  cursor: pointer;
  transition: border-color 0.15s ease, transform 0.15s ease;
}
.cat-row:hover { border-color: var(--signal-cyan); transform: translateY(-1px); }
.cat-row h2 { font-size: 1.1rem; margin: 0 0 4px; }
.cat-row p { margin: 0; font-size: 0.9rem; }
.cat-stats {
  text-align: right;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--dust-dim);
  flex-shrink: 0;
}
.cat-stats strong { display: block; color: var(--star-white); font-size: 1.2rem; font-family: var(--font-display); }
.staff-tag {
  font-family: var(--font-mono);
  font-size: 0.62rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--nebula-rose);
  border: 1px solid rgba(242, 87, 138, 0.4);
  padding: 2px 7px;
  border-radius: 4px;
  margin-left: 10px;
  vertical-align: 2px;
}

/* --- Thread list --- */
.thread-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 16px 20px;
  border-bottom: 1px solid var(--panel-border);
  cursor: pointer;
}
.thread-row:last-child { border-bottom: none; }
.thread-row:hover { background: rgba(255,255,255,0.02); }
.thread-title { font-family: var(--font-display); font-size: 1rem; font-weight: 500; margin: 0 0 4px; }
.thread-sub { font-size: 0.8rem; color: var(--dust-dim); margin: 0; }
.thread-count {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--dust);
  flex-shrink: 0;
  text-align: right;
}
.tag {
  font-family: var(--font-mono);
  font-size: 0.62rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 2px 8px;
  border-radius: 4px;
  margin-right: 8px;
}
.tag-pinned { background: rgba(94, 234, 212, 0.14); color: var(--signal-cyan); }
.tag-locked { background: rgba(139, 146, 176, 0.16); color: var(--dust); }

/* --- Thread view / posts --- */
.post {
  display: grid;
  grid-template-columns: 150px 1fr;
  gap: 24px;
  padding: 24px 0;
  border-bottom: 1px solid var(--panel-border);
}
.post:last-child { border-bottom: none; }
.post-author { font-size: 0.85rem; }
.post-author .name { font-family: var(--font-display); font-weight: 600; color: var(--star-white); }
.post-author .role {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--dust-dim);
  margin-top: 3px;
}
.post-author .role.admin { color: var(--nebula-rose); }
.post-body {
  white-space: pre-wrap;
  word-break: break-word;
  line-height: 1.65;
  color: var(--star-white);
  font-size: 0.95rem;
  margin: 0;
}
.post-meta {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--dust-dim);
  margin-top: 12px;
  display: flex;
  gap: 14px;
  align-items: center;
  flex-wrap: wrap;
}
.post-meta button {
  background: none;
  border: none;
  color: var(--dust-dim);
  font-family: var(--font-mono);
  font-size: 0.7rem;
  cursor: pointer;
  padding: 0;
}
.post-meta button:hover { color: var(--signal-cyan); }
.post.removed .post-body { color: var(--dust-dim); font-style: italic; }

/* --- Composer --- */
textarea {
  width: 100%;
  background: var(--void-2);
  border: 1px solid var(--panel-border);
  color: var(--star-white);
  padding: 14px;
  border-radius: 8px;
  font-family: var(--font-body);
  font-size: 0.95rem;
  line-height: 1.6;
  resize: vertical;
  min-height: 120px;
}
textarea:focus {
  outline: none;
  border-color: var(--signal-cyan);
  box-shadow: 0 0 0 3px rgba(94, 234, 212, 0.15);
}
.composer-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 14px;
  gap: 12px;
  flex-wrap: wrap;
}
.char-count { font-family: var(--font-mono); font-size: 0.72rem; color: var(--dust-dim); }

.pager { display: flex; gap: 8px; justify-content: center; margin-top: 28px; }
.empty-state { text-align: center; padding: 48px 24px; color: var(--dust-dim); }

/* ============================================================
   Profiles, achievements, purchase history
   ============================================================ */
.owner-tag {
  font-family: var(--font-mono);
  font-size: 0.62rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--signal-cyan);
  border: 1px solid rgba(94, 234, 212, 0.4);
  padding: 2px 7px;
  border-radius: 4px;
  margin-left: 10px;
  vertical-align: 3px;
}

.profile-stats {
  display: flex;
  gap: 34px;
  margin-top: 24px;
  flex-wrap: wrap;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--dust-dim);
}
.profile-stats strong {
  display: block;
  color: var(--star-white);
  font-family: var(--font-display);
  font-size: 1.4rem;
  margin-bottom: 2px;
}

.ach-grid { display: grid; gap: 10px; }
.ach {
  display: grid;
  grid-template-columns: 40px 1fr auto;
  gap: 14px;
  align-items: center;
  padding: 14px 16px;
  border: 1px solid var(--panel-border);
  border-radius: 8px;
  background: var(--void-2);
}
.ach.unlocked { border-color: rgba(94, 234, 212, 0.35); background: rgba(94, 234, 212, 0.05); }
.ach.locked { opacity: 0.55; }
.ach-icon {
  width: 40px; height: 40px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: var(--panel);
  color: var(--dust-dim);
  font-size: 1.1rem;
}
.ach.unlocked .ach-icon { background: rgba(94, 234, 212, 0.15); color: var(--signal-cyan); }
.ach-name { font-family: var(--font-display); font-weight: 600; font-size: 0.98rem; }
.ach-desc { font-size: 0.84rem; color: var(--dust); margin-top: 2px; }
.ach-date { font-family: var(--font-mono); font-size: 0.68rem; color: var(--dust-dim); margin-top: 4px; }
.ach-points {
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--dust-dim);
}
.ach.unlocked .ach-points { color: var(--signal-cyan); }

.post-link {
  display: block;
  padding: 12px 0;
  border-bottom: 1px solid var(--panel-border);
  text-decoration: none;
}
.post-link:last-child { border-bottom: none; }
.post-link:hover .post-link-title { color: var(--signal-cyan); }
.post-link-title { display: block; font-family: var(--font-display); font-weight: 500; color: var(--star-white); }
.post-link-meta { display: block; font-family: var(--font-mono); font-size: 0.7rem; color: var(--dust-dim); margin-top: 3px; }

/* --- Purchase history --- */
.order-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 16px 0;
  border-bottom: 1px solid var(--panel-border);
  flex-wrap: wrap;
}
.order-row:last-child { border-bottom: none; }
.order-title { font-family: var(--font-display); font-weight: 500; }
.order-meta { font-family: var(--font-mono); font-size: 0.72rem; color: var(--dust-dim); margin-top: 4px; }
.order-amount { font-family: var(--font-display); font-size: 1.05rem; }

/* --- Markdown rendering inside posts --- */
.post-body p { margin: 0 0 12px; color: var(--star-white); }
.post-body p:last-child { margin-bottom: 0; }
.post-body h3, .post-body h4, .post-body h5 { font-size: 1.02rem; margin: 18px 0 8px; }
.post-body ul, .post-body ol { margin: 0 0 12px; padding-left: 22px; color: var(--star-white); }
.post-body li { margin-bottom: 4px; }
.post-body code {
  background: var(--void-2);
  border: 1px solid var(--panel-border);
  border-radius: 4px;
  padding: 1px 5px;
  font-family: var(--font-mono);
  font-size: 0.88em;
  color: var(--signal-cyan);
}
.post-body pre {
  background: var(--void-2);
  border: 1px solid var(--panel-border);
  border-radius: 8px;
  padding: 14px;
  overflow-x: auto;
  margin: 0 0 12px;
}
.post-body pre code { border: none; background: none; padding: 0; color: var(--star-white); }
.post-body blockquote {
  border-left: 3px solid var(--nebula-violet);
  background: rgba(139, 92, 246, 0.06);
  margin: 0 0 12px;
  padding: 10px 16px;
  color: var(--dust);
}
.post-body blockquote strong { color: var(--star-white); }
.post-body hr { border: none; border-top: 1px solid var(--panel-border); margin: 18px 0; }
.post-body a { color: var(--signal-cyan); }
.post-body del { color: var(--dust-dim); }

.composer-hint {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--dust-dim);
  margin-top: 8px;
}
.composer-hint code { color: var(--dust); }

.preview-box {
  border: 1px solid var(--panel-border);
  border-radius: 8px;
  padding: 16px;
  margin-top: 12px;
  background: var(--void-2);
  display: none;
}
.preview-box.show { display: block; }
.preview-label {
  font-family: var(--font-mono);
  font-size: 0.66rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--dust-dim);
  margin-bottom: 10px;
}
