:root {
  --bg: #04070d;
  --panel: #09101c;
  --line: #15233a;
  --blue: #2f8bff;
  --ice: #8fd0ff;
  --red: #e0262d;
  --text: #cddbf0;
  --muted: #7389a8;
  --head: "Chakra Petch", "Segoe UI", Arial, sans-serif;
  --mono: "IBM Plex Mono", Consolas, "Courier New", monospace;
  --body: "Inter", "Segoe UI", system-ui, -apple-system, Roboto, Arial, sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 24px; }

body {
  margin: 0; color: var(--text); font-family: var(--body); line-height: 1.65;
  background-color: var(--bg);
  background-image:
    radial-gradient(900px 400px at 50% 0%, rgba(47, 139, 255, .16), transparent 70%),
    linear-gradient(rgba(47, 139, 255, .045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(47, 139, 255, .045) 1px, transparent 1px);
  background-size: 100% 100%, 44px 44px, 44px 44px;
}

/* Banner + status strip */
.banner { background: #000; box-shadow: 0 0 60px rgba(47, 139, 255, .25); position: relative; }
.banner img { display: block; width: 100%; max-width: 1600px; height: auto; margin: 0 auto; }
.strip {
  display: flex; justify-content: space-between; gap: 16px; padding: 8px 24px;
  font: 500 .72rem var(--mono); letter-spacing: 2px; color: var(--muted);
  background: #060b14; border-top: 1px solid var(--blue); border-bottom: 1px solid var(--line);
}
.live { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: #2cff8f; margin-right: 8px; box-shadow: 0 0 8px #2cff8f; }

/* Hero */
.hero { max-width: 1240px; margin: 0 auto; padding: 56px 24px 20px; }
.kicker { margin: 0 0 12px; font: 500 .8rem var(--mono); letter-spacing: 3px; color: var(--red); }
.hero h1 {
  margin: 0; font-family: var(--head); font-weight: 700; line-height: .95;
  font-size: clamp(3rem, 9vw, 6.4rem); letter-spacing: 2px; color: #fff; text-transform: uppercase;
}
.hero h1 span { color: transparent; -webkit-text-stroke: 2px var(--blue); text-shadow: 0 0 30px rgba(47, 139, 255, .45); }
.sub { max-width: 560px; margin: 20px 0 34px; color: var(--muted); font-size: 1.05rem; }

.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
.stat {
  padding: 16px 18px; background: var(--panel); border: 1px solid var(--line); border-left: 3px solid var(--blue);
}
.stat b { display: block; font: 700 1.5rem var(--head); color: #fff; letter-spacing: 1px; }
.stat span { font: 400 .72rem var(--mono); color: var(--muted); letter-spacing: .5px; }

/* Layout */
.layout {
  max-width: 1240px; margin: 0 auto; padding: 30px 24px 70px;
  display: grid; grid-template-columns: 290px 1fr; gap: 28px; align-items: start;
}

/* Rail */
.rail { position: sticky; top: 20px; display: grid; gap: 16px; }
.rail-box { background: var(--panel); border: 1px solid var(--line); padding: 18px; }
.rail-box h4 { margin: 0 0 12px; font: 500 .75rem var(--mono); letter-spacing: 2px; color: var(--blue); }
.index { list-style: none; margin: 0; padding: 0; }
.index a {
  display: flex; gap: 12px; align-items: baseline; padding: 8px 10px; color: var(--text);
  font: 500 .95rem var(--head); border-left: 2px solid transparent; transition: .15s;
}
.index a i { font: 400 .75rem var(--mono); color: var(--blue); font-style: normal; }
.index a:hover { background: rgba(47, 139, 255, .1); border-left-color: var(--blue); color: #fff; text-decoration: none; }

.ref { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.ref li { display: flex; flex-direction: column; gap: 2px; align-items: flex-start; }
.ref span { font-size: .8rem; color: var(--muted); }

/* Grid of files */
.grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.group {
  grid-column: 1 / -1; margin: 18px 0 0; display: flex; align-items: center; gap: 14px;
  font: 500 .85rem var(--mono); letter-spacing: 3px; color: var(--ice);
}
.group:first-child { margin-top: 0; }
.group::after { content: ""; flex: 1; height: 1px; background: linear-gradient(90deg, var(--line), transparent); }

.file {
  position: relative; background: var(--panel); border: 1px solid var(--line); padding: 22px 24px 18px;
}
.file.wide { grid-column: 1 / -1; }
.file::before, .file::after { content: ""; position: absolute; width: 14px; height: 14px; border: 2px solid var(--blue); }
.file::before { top: -1px; left: -1px; border-right: 0; border-bottom: 0; }
.file::after { bottom: -1px; right: -1px; border-left: 0; border-top: 0; }

.file header { display: flex; align-items: center; gap: 14px; margin-bottom: 14px; }
.tag {
  font: 500 .7rem var(--mono); letter-spacing: 2px; color: #fff; background: var(--red);
  padding: 3px 9px; clip-path: polygon(0 0, 100% 0, calc(100% - 7px) 100%, 0 100%); padding-right: 14px;
}
.file h3 { margin: 0; font: 700 1.35rem var(--head); letter-spacing: 1px; color: #fff; text-transform: uppercase; }

/* Numbered log entries */
.log { list-style: none; counter-reset: n; margin: 0; padding: 0; }
.log li {
  counter-increment: n; position: relative; display: block; padding: 11px 0 11px 38px;
  border-top: 1px solid var(--line); font-size: .95rem;
}
.log li::before {
  content: counter(n, decimal-leading-zero); position: absolute; left: 0; top: 14px;
  font: 500 .8rem var(--mono); color: var(--blue);
}
.log strong { color: #fff; }

/* Hazard warning */
.hazard { display: flex; margin-bottom: 14px; background: #12080b; border: 1px solid rgba(224, 38, 45, .5); }
.hazard .bar {
  width: 16px; flex: none;
  background: repeating-linear-gradient(-45deg, var(--red) 0 8px, #1a0b0e 8px 16px);
}
.hazard p { margin: 0; padding: 12px 16px; font-size: .9rem; }
.hazard b { display: block; margin-bottom: 2px; font: 500 .72rem var(--mono); letter-spacing: 2px; color: var(--red); }
.hazard strong { color: #fff; }

/* Inline bits */
code {
  font: 500 .85em var(--mono); color: var(--ice); background: #060b14;
  border: 1px solid var(--line); padding: 1px 7px;
}
kbd {
  display: inline-block; min-width: 26px; text-align: center; font: 500 .85em var(--mono); color: #fff;
  background: #101c30; border: 1px solid #2a3f63; border-bottom-width: 3px; padding: 0 7px;
}
.mention { color: var(--ice); background: rgba(47, 139, 255, .15); padding: 1px 6px; font-weight: 600; }

.footer {
  max-width: 1240px; margin: 0 auto; padding: 22px 24px; display: flex; justify-content: space-between;
  border-top: 1px solid var(--line); font: 400 .72rem var(--mono); letter-spacing: 2px; color: var(--muted);
}

/* Responsive */
@media (max-width: 980px) {
  .layout { grid-template-columns: 1fr; }
  .rail { position: static; grid-template-columns: 1fr 1fr; }
  .stats { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 640px) {
  .grid, .rail { grid-template-columns: 1fr; }
  .hide-sm { display: none; }
  .strip { padding: 8px 16px; }
}

/* Strip navigation */
.strip-nav { display: flex; gap: 22px; }
.strip-nav a { color: var(--muted); padding-bottom: 2px; border-bottom: 2px solid transparent; }
.strip-nav a:hover { color: #fff; }
.strip-nav a.active { color: #fff; border-bottom-color: var(--red); }

/* Alliances page */
.stats-3 { grid-template-columns: repeat(3, 1fr); max-width: 760px; }
.alliances {
  max-width: 1240px; margin: 0 auto; padding: 30px 24px 70px;
  display: grid; grid-template-columns: repeat(2, 1fr); gap: 22px;
}
.ally { position: relative; background: var(--panel); border: 1px solid var(--line); display: flex; flex-direction: column; }
.ally::before, .ally::after { content: ""; position: absolute; width: 14px; height: 14px; border: 2px solid var(--blue); z-index: 2; }
.ally::before { top: -1px; left: -1px; border-right: 0; border-bottom: 0; }
.ally::after { bottom: -1px; right: -1px; border-left: 0; border-top: 0; }

.ally-img {
  position: relative; aspect-ratio: 16 / 9; overflow: hidden; border-bottom: 1px solid var(--line);
  background:
    repeating-linear-gradient(-45deg, rgba(47,139,255,.06) 0 12px, transparent 12px 24px), #060b14;
}
.ally-img img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.ph {
  position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px;
  font: 500 .8rem var(--mono); letter-spacing: 3px; color: var(--muted);
}
.ph small { font-size: .68rem; letter-spacing: 1px; opacity: .7; }

.ally-body { padding: 20px 24px 24px; display: grid; gap: 14px; }
.ally-body header { display: flex; align-items: center; gap: 14px; }
.ally-body h3 { margin: 0; font: 700 1.5rem var(--head); letter-spacing: 1px; color: #fff; text-transform: uppercase; }
.type { margin: 0; font: 600 1rem var(--head); color: #fff; letter-spacing: 1px; text-transform: uppercase; }
.type span { font: 400 .7rem var(--mono); color: var(--blue); letter-spacing: 2px; margin-right: 10px; }

.disc { display: flex; gap: 12px; }
.tier {
  flex: 1; padding: 12px 16px; background: #060b14; border: 1px solid var(--line); border-left: 3px solid var(--blue);
}
.tier b { display: block; font: 700 2rem var(--head); color: var(--ice); line-height: 1.1; }
.tier span { font: 400 .72rem var(--mono); letter-spacing: 2px; color: var(--muted); text-transform: uppercase; }
.tier.hot { border-left-color: var(--red); }
.tier.hot b { color: #fff; }

@media (max-width: 800px) {
  .alliances { grid-template-columns: 1fr; }
  .stats-3 { grid-template-columns: 1fr; }
}
