/* Khaos Nexus — private MVP site. Brand colors from approved ad kit. */
@font-face {
  font-family: "Barlow";
  src: url("../fonts/Barlow-Regular.ttf") format("truetype");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Barlow";
  src: url("../fonts/Barlow-Medium.ttf") format("truetype");
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Barlow";
  src: url("../fonts/Barlow-SemiBold.ttf") format("truetype");
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Barlow";
  src: url("../fonts/Barlow-Bold.ttf") format("truetype");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Rajdhani";
  src: url("../fonts/Rajdhani-SemiBold.ttf") format("truetype");
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Rajdhani";
  src: url("../fonts/Rajdhani-Bold.ttf") format("truetype");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Cinzel";
  src: url("../fonts/Cinzel-Variable.ttf") format("truetype");
  font-weight: 400 900;
  font-style: normal;
  font-display: swap;
}

:root {
  --bg: #050506;
  --bg-2: #0b0b0e;
  --panel: #141418;
  --panel-2: #1a1a20;
  --line: #2c2c34;
  --text: #f5f5f7;
  --muted: #b3b5be;
  --red: #c40018;
  --red-d: #8f0012;
  --red-l: #ff1735;
  --silver: #969aa4;
  --white: #ffffff;
  --max: 1120px;
  --header-h: 72px;
  --banner-h: 36px;
}

*,
*::before,
*::after { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  min-height: 100vh;
  background:
    linear-gradient(180deg, rgba(196, 0, 24, 0.05), transparent 28%),
    repeating-linear-gradient(
      0deg,
      transparent 0,
      transparent 47px,
      rgba(196, 0, 24, 0.06) 47px,
      rgba(196, 0, 24, 0.06) 48px
    ),
    repeating-linear-gradient(
      90deg,
      transparent 0,
      transparent 47px,
      rgba(255, 255, 255, 0.025) 47px,
      rgba(255, 255, 255, 0.025) 48px
    ),
    var(--bg);
  color: var(--text);
  font-family: "Barlow", "Segoe UI", system-ui, sans-serif;
  font-size: 17px;
  line-height: 1.55;
}

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

a { color: var(--red-l); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: #ff6a7a; }
a:focus-visible,
button:focus-visible {
  outline: 2px solid var(--red-l);
  outline-offset: 3px;
}

.skip {
  position: absolute;
  left: -999px;
  top: 0;
  background: var(--red);
  color: var(--white);
  padding: 0.5rem 1rem;
  z-index: 100;
}
.skip:focus { left: 0.75rem; top: 0.75rem; }

/* Private review banner */
.preview-banner {
  position: sticky;
  top: 0;
  z-index: 50;
  height: var(--banner-h);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  background: var(--red-d);
  color: var(--white);
  font-family: "Rajdhani", "Barlow", sans-serif;
  font-weight: 700;
  font-size: 0.82rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  border-bottom: 1px solid var(--red-l);
}
.preview-banner span { letter-spacing: 0.08em; font-weight: 600; text-transform: none; opacity: 0.92; }

/* Header */
.site-header {
  position: sticky;
  top: var(--banner-h);
  z-index: 40;
  background: rgba(5, 5, 6, 0.94);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}
.site-header::after {
  content: "";
  display: block;
  height: 2px;
  background: linear-gradient(90deg, var(--red-l), var(--red) 40%, transparent);
}
.header-inner {
  max-width: var(--max);
  margin: 0 auto;
  min-height: var(--header-h);
  padding: 0 1.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}
.brand {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  color: var(--white);
  text-decoration: none;
  min-width: 0;
}
.brand img {
  width: 44px;
  height: 44px;
  flex-shrink: 0;
}
.brand-text {
  display: flex;
  flex-direction: column;
  line-height: 1.05;
}
.brand-name {
  font-family: "Cinzel", "Times New Roman", serif;
  font-weight: 700;
  font-size: 0.95rem;
  letter-spacing: 0.16em;
}
.brand-tag {
  font-family: "Rajdhani", sans-serif;
  font-weight: 600;
  font-size: 0.68rem;
  letter-spacing: 0.18em;
  color: var(--silver);
  text-transform: uppercase;
}

nav ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.15rem 0.15rem;
}
nav a {
  color: var(--muted);
  text-decoration: none;
  font-family: "Rajdhani", "Barlow", sans-serif;
  font-weight: 600;
  font-size: 0.92rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 0.45rem 0.55rem;
  display: inline-block;
  border-bottom: 2px solid transparent;
}
nav a:hover { color: var(--white); }
nav a[aria-current="page"] {
  color: var(--white);
  border-bottom-color: var(--red-l);
}

.nav-toggle {
  display: none;
  background: var(--panel);
  color: var(--white);
  border: 1px solid var(--line);
  padding: 0.4rem 0.7rem;
  font-family: "Rajdhani", sans-serif;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  cursor: pointer;
  clip-path: polygon(8px 0, 100% 0, 100% calc(100% - 8px), calc(100% - 8px) 100%, 0 100%, 0 8px);
}

main { display: block; }

.wrap {
  max-width: var(--max);
  margin: 0 auto;
  padding: 2rem 1.25rem 3.5rem;
}

/* Hero */
.hero {
  position: relative;
  min-height: 520px;
  display: flex;
  align-items: flex-end;
  background: #000 right center / cover no-repeat;
  border-bottom: 1px solid var(--line);
}
.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(90deg, rgba(5, 5, 6, 0.88) 0%, rgba(5, 5, 6, 0.62) 34%, rgba(5, 5, 6, 0.18) 62%, rgba(5, 5, 6, 0.28) 100%),
    linear-gradient(180deg, rgba(5, 5, 6, 0.12) 0%, rgba(5, 5, 6, 0.72) 100%);
}
.hero-inner {
  position: relative;
  max-width: var(--max);
  margin: 0 auto;
  padding: 3.5rem 1.25rem 2.6rem;
  width: 100%;
}
.kicker {
  font-family: "Rajdhani", sans-serif;
  font-weight: 700;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--red-l);
  font-size: 0.8rem;
  margin: 0 0 0.6rem;
}
.motto {
  font-family: "Cinzel", "Times New Roman", serif;
  font-weight: 700;
  font-size: clamp(1.35rem, 3.4vw, 2.15rem);
  letter-spacing: 0.06em;
  line-height: 1.25;
  margin: 0 0 1rem;
  color: var(--white);
  text-shadow: 0 0 24px rgba(196, 0, 24, 0.35);
}
.motto span { display: block; }
.lede {
  max-width: 38rem;
  color: #e4e4e8;
  margin: 0 0 1.4rem;
  font-size: 1.05rem;
}
.actions { display: flex; flex-wrap: wrap; gap: 0.7rem; }

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  padding: 0.7rem 1.15rem;
  font-family: "Rajdhani", "Barlow", sans-serif;
  font-weight: 700;
  font-size: 0.95rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  text-decoration: none;
  border: 1px solid transparent;
  cursor: pointer;
  clip-path: polygon(10px 0, 100% 0, 100% calc(100% - 10px), calc(100% - 10px) 100%, 0 100%, 0 10px);
  color: var(--white);
  background: var(--red);
}
.btn:hover { background: var(--red-l); color: var(--white); }
.btn-ghost {
  background: transparent;
  border-color: var(--silver);
  color: var(--white);
}
.btn-ghost:hover { border-color: var(--red-l); color: var(--white); background: rgba(196, 0, 24, 0.15); }
.btn-soon {
  background: var(--panel-2);
  border-color: var(--line);
  color: var(--muted);
  position: relative;
}
.btn-soon:hover { color: var(--white); background: var(--panel); }

/* Panels / cards */
.section-title {
  font-family: "Rajdhani", sans-serif;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  font-size: 1.15rem;
  margin: 0 0 1rem;
  padding-left: 0.7rem;
  border-left: 3px solid var(--red-l);
}
.page-title {
  font-family: "Cinzel", serif;
  font-weight: 700;
  letter-spacing: 0.08em;
  font-size: clamp(1.6rem, 3vw, 2.2rem);
  margin: 0 0 0.4rem;
}
.page-lead { color: var(--muted); margin: 0 0 2rem; max-width: 42rem; }

.grid {
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  align-items: stretch;
}
.grid > .card { height: 100%; }
.card {
  background: var(--panel);
  border: 1px solid var(--line);
  padding: 1.2rem 1.2rem 1.3rem;
  position: relative;
  clip-path: polygon(14px 0, 100% 0, 100% calc(100% - 14px), calc(100% - 14px) 100%, 0 100%, 0 14px);
}
.card::before {
  content: "";
  position: absolute;
  top: 0; right: 0;
  width: 14px; height: 14px;
  border-top: 2px solid var(--red-l);
  border-right: 2px solid var(--red-l);
}
.card h2, .card h3 {
  font-family: "Rajdhani", sans-serif;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin: 0 0 0.5rem;
  font-size: 1.05rem;
}
.card p { margin: 0 0 0.8rem; color: var(--muted); }
.card p:last-child { margin-bottom: 0; }
.card img { margin: -1.2rem -1.2rem 1rem; width: calc(100% + 2.4rem); max-width: none; height: 150px; object-fit: cover; }
.hub-block > .card img { height: 220px; object-position: right center; }

/* Join plate */
.plate {
  background: linear-gradient(180deg, #1c1c22, #121216);
  border: 1px solid var(--line);
  padding: 1.2rem 1.3rem;
  display: grid;
  gap: 0.7rem;
}
.plate-row {
  display: grid;
  grid-template-columns: 8.5rem 1fr auto;
  gap: 0.6rem;
  align-items: center;
  border-bottom: 1px solid var(--line);
  padding-bottom: 0.7rem;
}
.plate-row:last-child { border-bottom: 0; padding-bottom: 0; }
.plate-label {
  font-family: "Rajdhani", sans-serif;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--red-l);
  font-size: 0.9rem;
}
.plate-value {
  font-family: "Barlow", monospace, sans-serif;
  font-weight: 600;
  color: var(--white);
  word-break: break-all;
}
.copy-btn {
  background: var(--bg);
  color: var(--white);
  border: 1px solid var(--silver);
  font-family: "Rajdhani", sans-serif;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-size: 0.75rem;
  padding: 0.35rem 0.6rem;
  cursor: pointer;
}
.copy-btn:hover { border-color: var(--red-l); }
.copy-btn.is-copied { border-color: #5dca7a; color: #5dca7a; }

.badge {
  display: inline-block;
  font-family: "Rajdhani", sans-serif;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  font-size: 0.72rem;
  padding: 0.15rem 0.45rem;
  border: 1px solid var(--red);
  color: var(--red-l);
  background: rgba(196, 0, 24, 0.12);
  margin-left: 0.4rem;
  vertical-align: middle;
}
.badge-todo {
  border-color: var(--silver);
  color: var(--silver);
  background: transparent;
}

.note {
  background: var(--panel);
  border-left: 3px solid var(--red);
  padding: 0.9rem 1rem;
  color: var(--muted);
  margin: 1.2rem 0;
}
.draft-banner {
  background: rgba(196, 0, 24, 0.12);
  border: 1px solid var(--red);
  color: var(--white);
  padding: 0.9rem 1rem;
  margin: 0 0 1.5rem;
  font-weight: 600;
}
.steps { margin: 0 0 1.5rem; padding-left: 1.2rem; }
.steps li { margin: 0.4rem 0; }

.vote-list, .pack-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.8rem; }
.vote-list li, .pack-list li {
  background: var(--panel);
  border: 1px solid var(--line);
  padding: 1rem 1.1rem;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: baseline;
  gap: 0.5rem 1rem;
}
.vote-list a, .pack-list a { font-weight: 600; }

.legal h2 {
  font-family: "Rajdhani", sans-serif;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-size: 1.15rem;
  margin: 2rem 0 0.6rem;
  padding-top: 1rem;
  border-top: 1px solid var(--line);
}
.legal h2:first-of-type { margin-top: 0; border-top: 0; padding-top: 0; }
.legal h3 { font-size: 1rem; margin: 1rem 0 0.4rem; }
.legal p, .legal li { color: #d5d6dc; }

/* Footer */
.site-footer {
  border-top: 1px solid var(--line);
  background: #08080a;
  padding: 1.8rem 1.25rem 2.2rem;
  color: var(--muted);
  font-size: 0.92rem;
}
.footer-inner {
  max-width: var(--max);
  margin: 0 auto;
  display: grid;
  gap: 0.8rem;
}
.footer-motto {
  font-family: "Cinzel", serif;
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  color: var(--silver);
}
.footer-nav { display: flex; flex-wrap: wrap; gap: 0.4rem 1rem; }
.footer-nav a { color: var(--muted); text-decoration: none; }
.footer-nav a:hover { color: var(--white); }
.fine { font-size: 0.82rem; color: #8c8e96; }

@media (max-width: 860px) {
  .nav-toggle { display: inline-flex; }
  nav {
    display: none;
    position: absolute;
    left: 0; right: 0;
    top: calc(var(--banner-h) + var(--header-h) + 2px);
    background: #0c0c0f;
    border-bottom: 1px solid var(--line);
    padding: 0.5rem 1rem 1rem;
  }
  nav.is-open { display: block; }
  nav ul { flex-direction: column; }
  nav a { display: block; padding: 0.65rem 0.4rem; }
  .plate-row { grid-template-columns: 1fr; }
  .hero { min-height: 440px; }
}
@media (max-width: 520px) {
  body { font-size: 16px; }
  .brand-tag { display: none; }
  .hero { min-height: 440px; background-position: 72% center; }
  .hero::before {
    background:
      linear-gradient(180deg, rgba(5, 5, 6, 0.55) 0%, rgba(5, 5, 6, 0.78) 48%, rgba(5, 5, 6, 0.94) 100%),
      linear-gradient(90deg, rgba(5, 5, 6, 0.7), rgba(5, 5, 6, 0.25) 100%);
  }
  .preview-banner { font-size: 0.72rem; letter-spacing: 0.1em; padding: 0 0.5rem; text-align: center; }
  .preview-banner span { display: none; }
}

/* Servers / BlueMap embeds */
.server-card .map-frame {
  margin: 0.9rem 0 0.7rem;
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  background:
    repeating-linear-gradient(90deg, transparent 0, transparent 23px, rgba(255,255,255,0.03) 23px, rgba(255,255,255,0.03) 24px),
    var(--panel-2);
  border: 1px solid var(--line);
  overflow: hidden;
}
.server-card .map-frame iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
  background: #0a0a0c;
}
.map-placeholder {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 1rem;
  color: var(--muted);
}
.map-placeholder strong {
  display: block;
  color: var(--white);
  font-family: "Rajdhani", sans-serif;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin-bottom: 0.35rem;
}
.map-open { font-size: 0.95rem; }
.hub-block { margin: 0 0 2.4rem; }
@media (max-width: 520px) {
  .server-card .map-frame { aspect-ratio: 4 / 3; }
}

/* Build-out: news, rules, FAQ, server pages, 404, tighter nav */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .copy-btn.is-copied { transition: none; }
}

nav a {
  padding: 0.45rem 0.45rem;
}

.page-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.7rem;
  margin: 0 0 1.8rem;
}

.rule-list {
  list-style: none;
  margin: 0 0 2rem;
  padding: 0;
  counter-reset: rule;
  display: grid;
  gap: 0.8rem;
}
.rule-list li {
  background: var(--panel);
  border: 1px solid var(--line);
  padding: 1rem 1.1rem 1rem 3.4rem;
  position: relative;
  color: #d5d6dc;
}
.rule-list li::before {
  counter-increment: rule;
  content: counter(rule);
  position: absolute;
  left: 0.9rem;
  top: 0.95rem;
  width: 1.7rem;
  height: 1.7rem;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: "Rajdhani", sans-serif;
  font-weight: 700;
  color: var(--white);
  background: var(--red);
  font-size: 0.9rem;
}
.rule-list strong { color: var(--white); }

.faq {
  display: grid;
  gap: 0.7rem;
  margin: 0 0 2rem;
}
.faq details {
  background: var(--panel);
  border: 1px solid var(--line);
  padding: 0.2rem 1rem 0.2rem;
}
.faq summary {
  font-family: "Rajdhani", sans-serif;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  cursor: pointer;
  padding: 0.85rem 0;
  color: var(--white);
  list-style-position: outside;
}
.faq summary:focus-visible {
  outline: 2px solid var(--red-l);
  outline-offset: 3px;
}
.faq details p {
  margin: 0 0 1rem;
  color: var(--muted);
}

.news-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 1.2rem;
}
.news-item {
  background: var(--panel);
  border: 1px solid var(--line);
  padding: 1.2rem 1.3rem 1.3rem;
}
.news-item h2 {
  font-family: "Rajdhani", sans-serif;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  font-size: 1.15rem;
  margin: 0.2rem 0 0.6rem;
}
.news-item .meta {
  font-family: "Rajdhani", sans-serif;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  font-size: 0.75rem;
  color: var(--silver);
  margin: 0;
}
.news-item p { color: var(--muted); }
.news-item ul { color: #d5d6dc; margin: 0 0 0.8rem; padding-left: 1.2rem; }

.server-split {
  display: grid;
  gap: 1rem;
  grid-template-columns: 1fr 1fr;
}
@media (max-width: 760px) {
  .server-split { grid-template-columns: 1fr; }
}

.empty-shelf {
  border: 1px dashed var(--line);
  background: var(--bg-2);
  padding: 1.4rem 1.2rem;
  color: var(--muted);
  text-align: center;
}
.empty-shelf strong {
  display: block;
  color: var(--white);
  font-family: "Rajdhani", sans-serif;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin-bottom: 0.4rem;
}

.policy-list {
  margin: 0 0 1rem;
  padding-left: 1.2rem;
  color: #d5d6dc;
}
.policy-list li { margin: 0.35rem 0; }

.page-404 {
  text-align: center;
  padding: 3rem 1rem 4rem;
}
.page-404 .page-title { margin-bottom: 0.8rem; }
.page-404 .page-lead { margin-left: auto; margin-right: auto; }

.toc {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.1rem;
  margin: 0 0 1.8rem;
}
.toc a { font-weight: 600; }

.map-note { margin-top: 0.6rem; }

@media (max-width: 980px) {
  .header-inner { flex-wrap: wrap; }
}

@media (max-width: 920px) {
  .nav-toggle { display: inline-flex; }
  nav {
    display: none;
    position: absolute;
    left: 0; right: 0;
    top: calc(var(--banner-h) + var(--header-h) + 2px);
    background: #0c0c0f;
    border-bottom: 1px solid var(--line);
    padding: 0.5rem 1rem 1rem;
  }
  nav.is-open { display: block; }
  nav ul { flex-direction: column; }
  nav a { display: block; padding: 0.65rem 0.4rem; }
}

/* Finish pass: map fallback, Havenbrook feature */
.map-placeholder .btn { margin-top: 0.9rem; }
.map-placeholder .map-msg { max-width: 30rem; }
.map-frame.is-fallback {
  background:
    radial-gradient(ellipse at center, rgba(196, 0, 24, 0.16), transparent 70%),
    var(--panel-2);
}
.feature {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr);
  gap: 1.4rem;
  align-items: start;
  margin-bottom: 1.6rem;
}
.feature-media { margin: 0; }
.feature-media img { border: 1px solid var(--line); width: 100%; }
.feature-media figcaption { margin-top: 0.45rem; }
.feature-copy p { color: var(--muted); }
@media (max-width: 860px) {
  .feature { grid-template-columns: 1fr; }
}

/* Locked store button (store not open yet) */
.btn-locked,
.btn-locked:hover {
  background: var(--panel-2);
  border-color: var(--line);
  color: var(--muted);
  cursor: not-allowed;
  opacity: 0.85;
  pointer-events: none;
  user-select: none;
}
.btn-locked .lock-icon { flex: none; }
