:root, html[data-theme="dark"] {
  --purple: #5F259F;
  --purple-deep: #3b1468;
  --ink: #07040d;
  --panel: rgba(22, 10, 40, 0.86);
  --line: rgba(255, 255, 255, 0.12);
  --text: #f6f1ff;
  --muted: #c7b6e4;
  --white: #ffffff;
  --button-text: #ffffff;
  --on-purple: #ffffff;
  --input-bg: #11081d;
  --menu-bg: #160b28;
  --table-bg: rgba(16, 8, 29, 0.9);
  --stat-bg: rgba(95, 37, 159, 0.2);
  --accent-soft: #d7b8ff;
  --eyebrow: #e8d7ff;
  --flash-error: #3d1020;
  --flash-ok: #1c1233;
  --page-bg:
    radial-gradient(circle at 12% 8%, rgba(95, 37, 159, 0.55), transparent 28%),
    radial-gradient(circle at 88% 0%, rgba(255, 255, 255, 0.08), transparent 24%),
    linear-gradient(180deg, #140821 0%, var(--ink) 42%, #0d0618 100%);
}

html[data-theme="light"] {
  --ink: #f6f2fb;
  --panel: #ffffff;
  --line: rgba(95, 37, 159, 0.16);
  --text: #1b1228;
  --muted: #5c4d73;
  --white: #1b1228;
  --button-text: #ffffff;
  --on-purple: #ffffff;
  --input-bg: #ffffff;
  --menu-bg: #ffffff;
  --table-bg: #ffffff;
  --stat-bg: rgba(95, 37, 159, 0.08);
  --accent-soft: #5F259F;
  --eyebrow: #5F259F;
  --flash-error: #fde8ee;
  --flash-ok: #efe6ff;
  --page-bg:
    radial-gradient(circle at 12% 8%, rgba(95, 37, 159, 0.16), transparent 32%),
    radial-gradient(circle at 88% 0%, rgba(95, 37, 159, 0.08), transparent 26%),
    linear-gradient(180deg, #ffffff 0%, #f7f3fb 42%, #fff 100%);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  min-height: 100%;
  background: var(--page-bg);
  color: var(--text);
  font-family: "Outfit", system-ui, sans-serif;
}

a { color: inherit; }

img { max-width: 100%; height: auto; }

.site-shell {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
}

.site-header {
  display: flex;
  gap: 18px 28px;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  padding: 18px 0 12px;
}

.header-nav {
  display: flex;
  gap: 18px 28px;
  align-items: center;
  flex: 1;
  justify-content: space-between;
}

.theme-toggle, .nav-toggle {
  border: 1px solid var(--line);
  background: transparent;
  color: var(--text);
  border-radius: 999px;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}

.theme-toggle {
  width: 40px;
  height: 40px;
  padding: 0;
  display: inline-grid;
  place-items: center;
}
.theme-bulb {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.theme-bulb-rays { opacity: 0.28; }
html[data-theme="light"] .theme-bulb-glass {
  fill: #f4e36a;
  stroke: #5F259F;
}
html[data-theme="light"] .theme-bulb-rays {
  opacity: 1;
  stroke: #5F259F;
}

.nav-toggle, .mobile-theme { display: none; }
.nav-toggle { width: 44px; height: 44px; place-items: center; }
.nav-toggle-bars, .nav-toggle-bars:before, .nav-toggle-bars:after {
  display: block;
  width: 18px;
  height: 2px;
  background: var(--text);
  position: relative;
  content: "";
}
.nav-toggle-bars:before { position: absolute; top: -6px; }
.nav-toggle-bars:after { position: absolute; top: 6px; }
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
}

.brand img { width: min(220px, 42vw); display: block; }

.nav, .header-actions {
  display: flex;
  gap: 16px;
  align-items: center;
  flex-wrap: wrap;
}

.nav a, .ghost-link, .who, .account-menu summary {
  color: var(--muted);
  text-decoration: none;
  font-weight: 600;
}

.account-menu { position: relative; }
.account-menu summary {
  list-style: none;
  cursor: pointer;
  padding: 8px 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--white);
}
.account-menu summary::-webkit-details-marker { display: none; }
.account-menu-panel {
  position: absolute;
  right: 0;
  top: calc(100% + 8px);
  min-width: 180px;
  display: grid;
  background: var(--menu-bg);
  border: 1px solid var(--line);
  border-radius: 14px;
  overflow: hidden;
  z-index: 20;
}
.account-menu-panel a {
  padding: 12px 14px;
  color: var(--text);
  text-decoration: none;
}
.account-menu-panel a:hover { background: rgba(95, 37, 159, 0.35); }

.nav a:hover, .ghost-link:hover { color: var(--white); }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 999px;
  padding: 12px 18px;
  font: inherit;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
}

.btn-primary {
  background: var(--purple);
  color: var(--button-text);
  box-shadow: 0 10px 30px rgba(95, 37, 159, 0.35);
}

.btn-ghost {
  background: transparent;
  color: var(--white);
  border: 1px solid var(--line);
}

.ticker {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(95, 37, 159, 0.18);
  margin-bottom: 20px;
}

.ticker-track {
  display: flex;
  gap: 28px;
  width: max-content;
  animation: ticker 40s linear infinite;
  padding: 7px 0;
  align-items: center;
}

.ticker-item {
  font-family: "Oswald", sans-serif;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  font-size: 13px;
  text-decoration: none;
  color: var(--text);
  white-space: nowrap;
  max-width: 42vw;
  overflow: hidden;
  text-overflow: ellipsis;
}
.ticker-item:hover { color: var(--accent-soft); }
.ticker-brand {
  color: var(--eyebrow);
  letter-spacing: 0.14em;
}
.ticker-news::before { content: "News · "; color: var(--muted); font-weight: 500; }
.ticker-forum::before { content: "Forum · "; color: var(--muted); font-weight: 500; }

@keyframes ticker {
  from { transform: translateX(0); }
  to { transform: translateX(-50%); }
}

.hero, .page-hero, .form-card, .article-page, .forum-board, .post-card, .story-card, .forum-tile, .hot-item, .thread-row, .forum-row {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 24px;
}

.hero, .home-lead, .home-feed, .split, .forum-preview, .page-hero, .article-page, .form-card, .forum-board, .thread-list, .post-stack {
  margin-bottom: 24px;
}

.hero, .home-lead {
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  gap: 28px;
  align-items: center;
  padding: 10px 0 6px;
}

.home-intro .eyebrow { margin-bottom: 10px; }
.home-intro h1 {
  margin: 0 0 12px;
  font-size: clamp(34px, 5.4vw, 56px);
  line-height: 0.94;
  text-transform: uppercase;
  letter-spacing: -0.03em;
  max-width: 13ch;
}
.home-intro .lead {
  margin: 0 0 18px;
  max-width: 46ch;
  font-size: 17px;
  line-height: 1.5;
}
.hero-actions { display: flex; flex-wrap: wrap; gap: 10px; }

.lead-story {
  display: flex;
  flex-direction: column;
  text-decoration: none;
  overflow: hidden;
  padding: 0;
  border-radius: 18px;
  border: 1px solid var(--line);
  background: var(--panel);
  box-shadow: 0 16px 40px rgba(95, 37, 159, 0.12);
  transition: transform 160ms ease, border-color 160ms ease;
}
.lead-story:hover {
  transform: translateY(-3px);
  border-color: #8a4ad4;
}
.lead-story img {
  width: 100%;
  height: 190px;
  object-fit: cover;
  border-radius: 0;
  margin: 0;
}
.lead-story-copy { padding: 16px 18px 18px; }
.lead-story h2 {
  font-size: clamp(22px, 2.2vw, 28px);
  margin: 0;
  text-transform: none;
  line-height: 1.2;
}
.lead-story .pill { margin-bottom: 8px; }
.lead-excerpt {
  color: var(--muted);
  margin: 8px 0 0;
  line-height: 1.45;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.home-feed {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 28px;
}

.compact-list { list-style: none; margin: 0; padding: 0; display: grid; }
.compact-list li + li { border-top: 1px solid var(--line); }
.compact-list a {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 10px 14px;
  align-items: center;
  padding: 10px 2px;
  text-decoration: none;
}
.compact-list .pill { margin: 0; }
.compact-list strong { font-weight: 650; }
.compact-list time { color: var(--muted); font-size: 13px; white-space: nowrap; }
.compact-list a:hover strong { color: var(--accent-soft); }

.page-hero, .form-card, .article-page, .thread-hero { padding: 32px; }

h1, h2, h3 {
  font-family: "Oswald", sans-serif;
  letter-spacing: -0.02em;
  margin: 0 0 12px;
}

h1 { font-size: clamp(28px, 5vw, 44px); line-height: 1.05; text-transform: uppercase; }
h2 { font-size: clamp(20px, 3vw, 26px); text-transform: uppercase; }
.lead, .article-body p, .post-body p { color: var(--muted); line-height: 1.6; }

.eyebrow, .pill {
  display: inline-block;
  color: var(--eyebrow);
  letter-spacing: 0.16em;
  text-transform: uppercase;
  font-size: 12px;
  font-weight: 700;
}

.pill, .pill-mute {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 4px 10px;
  margin-bottom: 10px;
}

.hero-feature, .story-card, .forum-tile, .hot-item, .forum-row, .thread-row {
  display: block;
  text-decoration: none;
  padding: 22px;
  transition: transform 160ms ease, border-color 160ms ease;
}

.hero-feature:hover, .story-card:hover, .forum-tile:hover, .hot-item:hover, .forum-row:hover, .thread-row:hover {
  transform: translateY(-3px);
  border-color: #8a4ad4;
}

.stat-row, .split, .story-grid, .forum-grid, .two-col {
  display: grid;
  gap: 16px;
}

.stat-row { grid-template-columns: repeat(4, 1fr); }
.split { grid-template-columns: 1.3fr 0.7fr; }
.story-grid, .forum-grid { grid-template-columns: repeat(2, 1fr); }
.story-grid-wide { grid-template-columns: repeat(3, 1fr); }

.stat-row div, .section-head {
  display: flex;
  justify-content: space-between;
  align-items: end;
  gap: 12px;
}

.stat-row div {
  flex-direction: column;
  align-items: flex-start;
  padding: 18px;
  border-radius: 18px;
  background: var(--stat-bg);
  border: 1px solid var(--line);
}

.stat-row strong { font-size: 34px; font-family: "Oswald", sans-serif; }

.section-head { margin-bottom: 14px; }
.section-head a, .text-link, .form-foot a { color: var(--accent-soft); }

.hot-list, .thread-list, .post-stack { display: grid; gap: 12px; }
.forum-row, .thread-row {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
}
.forum-meta { color: var(--muted); text-align: right; font-size: 14px; }

.article-meta, .edited, .deleted, .empty, .form-foot, .muted { color: var(--muted); }

label, input, textarea, select {
  display: block;
  width: 100%;
}

label { margin: 14px 0 8px; font-weight: 600; }

input, textarea, select {
  background: var(--input-bg);
  color: var(--text);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 12px 14px;
  font: inherit;
}

.mod-bar, .post-tools { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 12px; }
.post-card { padding: 20px 22px; }
.post-card header { display: flex; gap: 10px; flex-wrap: wrap; color: var(--muted); margin-bottom: 8px; }
.post-card header strong { color: var(--text); }

.flash-wrap { display: grid; gap: 8px; margin-bottom: 16px; }
.flash { padding: 12px 14px; border-radius: 14px; }
.flash-error { background: var(--flash-error); }
.flash-success, .flash-info { background: var(--flash-ok); }

.site-footer {
  margin: 48px 0 28px;
  padding-top: 28px;
  border-top: 1px solid var(--line);
}

.footer-brand img { width: 220px; }
.footer-links { display: flex; gap: 16px; margin: 16px 0; }
.footer-disclaimer, .footer-copy { color: var(--muted); font-size: 14px; line-height: 1.55; }

.signup-field-status { min-height: 1.2em; margin: 6px 0 0; font-size: 14px; color: var(--muted); }
.signup-status-ok { color: #9be7b5; }
.signup-status-error { color: #ff8ea1; }
.signup-status-checking { color: #d7b8ff; }
.signup-password-requirements { padding-left: 18px; color: var(--muted); }
.signup-req-met { color: #9be7b5; }

.forum-crumb {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  color: var(--muted);
  margin: 8px 0 18px;
  font-size: 14px;
}
.forum-crumb a { color: var(--accent-soft); text-decoration: none; }
.forum-page-head {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: flex-end;
  margin-bottom: 18px;
}
.forum-page-head h1 { font-size: clamp(26px, 4vw, 36px); }

.forum-board-table {
  margin-bottom: 22px;
  border: 1px solid var(--line);
  border-radius: 18px;
  overflow: hidden;
  background: var(--table-bg);
}
.forum-cat-bar {
  background: var(--purple);
  color: var(--on-purple);
  padding: 12px 16px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.forum-board-table table { width: 100%; border-collapse: collapse; }
.forum-board-table th,
.forum-board-table td {
  padding: 10px 14px;
  border-top: 1px solid var(--line);
  text-align: left;
  vertical-align: middle;
}
.forum-board-table thead th {
  color: var(--muted);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  background: rgba(95, 37, 159, 0.18);
}
.forum-name { color: var(--text); font-weight: 700; text-decoration: none; font-size: 16px; }
.forum-name:hover { color: var(--accent-soft); }
.col-forum p { margin: 4px 0 0; color: var(--muted); font-size: 13px; line-height: 1.35; }
.col-num { width: 72px; text-align: center !important; color: var(--muted); }
.col-last, .col-author { width: 200px; max-width: 220px; color: var(--muted); font-size: 13px; }
.last-title {
  display: block;
  color: var(--accent-soft);
  text-decoration: none;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 220px;
  margin-bottom: 2px;
  font-weight: 600;
}
.last-title:hover { text-decoration: underline; }
.last-meta { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--muted); font-size: 12px; }
.empty-cell { color: var(--muted); text-align: center !important; }

.forum-post {
  display: grid;
  grid-template-columns: 200px 1fr;
  border: 1px solid var(--line);
  border-radius: 18px;
  overflow: hidden;
  background: var(--table-bg);
}
.post-author {
  padding: 20px 16px;
  background: rgba(95, 37, 159, 0.16);
  display: grid;
  justify-items: center;
  gap: 8px;
  text-align: center;
}
.avatar {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--purple);
  color: var(--on-purple);
  font-weight: 800;
  letter-spacing: 0.04em;
}
.post-author strong { color: var(--text); }
.role-pill {
  font-size: 12px;
  padding: 3px 8px;
  border-radius: 999px;
  background: var(--purple);
  color: var(--on-purple);
}
.post-main { padding: 18px 20px; }
.post-meta {
  display: flex;
  justify-content: space-between;
  color: var(--muted);
  font-size: 13px;
  margin-bottom: 12px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--line);
}

.article-hero-img, .story-card img, .hero-feature img {
  width: 100%;
  border-radius: 16px;
  object-fit: cover;
  margin-bottom: 12px;
  max-height: 420px;
}
.article-body img, .article-body figure { max-width: 100%; border-radius: 12px; }
.article-body figure { margin: 18px 0; }
.article-body .video-embed {
  position: relative;
  padding-bottom: 56.25%;
  height: 0;
  margin: 18px 0;
}
.article-body .video-embed iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
  border-radius: 12px;
}
.article-tags { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 20px; }
.btn-ghost { color: var(--text); }

@media (max-width: 860px) {
  .site-header {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
  }
  .nav-toggle { margin-left: auto; }
  .hero, .home-lead, .home-feed, .lead-story, .split, .stat-row, .story-grid, .story-grid-wide, .forum-grid, .forum-row, .thread-row {
    grid-template-columns: 1fr;
    display: grid;
  }
  .header-nav {
    display: none;
    flex-basis: 100%;
    flex-direction: column;
    align-items: stretch;
    padding: 12px 0 8px;
  }
  .nav, .header-actions {
    flex-direction: column;
    align-items: stretch;
  }
  .nav a, .header-actions .btn, .header-actions .ghost-link, .account-menu summary {
    display: block;
    padding: 12px 4px;
  }
  .nav-toggle { display: grid; }
  .mobile-theme { display: inline-flex; margin-left: auto; }
  .header-actions .theme-toggle { display: none; }
  body.nav-open .header-nav { display: flex; }
  .forum-row, .thread-row { display: grid; }
  .forum-meta { text-align: left; }
  .forum-post, .forum-page-head { grid-template-columns: 1fr; display: grid; }
  .col-num, .col-author { display: none; }
  .col-last, .last-title { max-width: 42vw; }
  .compact-list a { grid-template-columns: auto 1fr; }
  .compact-list time { grid-column: 2; }
}
