:root {
  color-scheme: dark;
  --bg: #050b06;
  --panel: #0a140b;
  --border: #1f3d24;
  --border-bright: #2f5c37;
  --text: #b9f5c1;
  --muted: #5f8f68;
  --accent: #46e07a;
  --accent-dim: #2c8a4f;
  --danger: #ff5f5f;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: "Share Tech Mono", "Courier New", monospace;
  background:
    repeating-linear-gradient(
      0deg,
      rgba(70, 224, 122, 0.035) 0px,
      rgba(70, 224, 122, 0.035) 1px,
      transparent 1px,
      transparent 3px
    ),
    radial-gradient(ellipse at top, #0b1a0e 0%, var(--bg) 70%);
  color: var(--text);
  min-height: 100vh;
}

.muted { color: var(--muted); }

/* -- Header banner -- */
.brand-banner {
  position: relative;
  text-align: center;
  padding: 22px 16px 18px;
  background: linear-gradient(180deg, #0c1a0e 0%, #060d07 100%);
  border-bottom: 1px solid var(--border-bright);
  overflow: hidden;
}

.brand-banner .scanline {
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--accent), transparent);
  opacity: 0.6;
  animation: scan 5s linear infinite;
}

@keyframes scan {
  0% { left: -100%; }
  100% { left: 100%; }
}

.brand-title {
  font-family: "Black Ops One", "Share Tech Mono", monospace;
  font-size: clamp(1.8rem, 5vw, 3rem);
  letter-spacing: 0.12em;
  color: var(--accent);
  text-shadow:
    0 0 6px rgba(70, 224, 122, 0.55),
    0 0 18px rgba(70, 224, 122, 0.35),
    0 0 40px rgba(70, 224, 122, 0.15);
  line-height: 1.1;
}

.brand-title a {
  color: inherit;
  text-shadow: inherit;
  text-decoration: none;
  transition: filter 0.15s ease;
}

.brand-title a:hover,
.brand-title a:focus-visible {
  filter: brightness(1.25);
}

.brand-subtitle {
  margin-top: 6px;
  font-family: "Share Tech Mono", monospace;
  font-size: clamp(0.65rem, 2vw, 0.9rem);
  letter-spacing: 0.35em;
  color: var(--muted);
  text-transform: uppercase;
}

.brand-subtitle a {
  color: var(--muted);
  text-decoration: none;
  transition: color 0.15s ease, text-shadow 0.15s ease;
}

.brand-subtitle a:hover,
.brand-subtitle a:focus-visible {
  color: var(--accent);
  text-shadow: 0 0 8px rgba(70, 224, 122, 0.6);
}

.gate[hidden], .app[hidden] {
  display: none !important;
}

/* Per-page colorway: only the nav/content area shifts (scoped to #app, not
   body), so the header banner keeps a constant brand green regardless of
   which page is open. Tactical intentionally has no override -- it uses the
   same green as the rest of the site. */
#app[data-page="survival"] {
  --accent: #d98a3f;
  --accent-dim: #a05f26;
}

#app[data-page="technical"] {
  --accent: #3fb6c4;
  --accent-dim: #256e79;
}

.nav li a.locked {
  color: var(--muted);
  opacity: 0.7;
}

.nav li a.locked::after {
  content: "LOCKED";
  display: block;
  margin-top: 2px;
  font-size: 0.65rem;
  letter-spacing: 0.1em;
  color: var(--danger);
  opacity: 0.8;
}

.home-links a.locked {
  color: var(--muted);
  border-left-color: var(--border);
}

.home-links a.locked::after {
  content: "LOCKED";
  float: right;
  font-size: 0.7rem;
  color: var(--danger);
  opacity: 0.8;
}

.access-denied-inline {
  margin-top: 24px;
  padding: 20px 24px;
  border: 1px solid var(--danger);
  border-radius: 3px;
  background: rgba(255, 95, 95, 0.06);
  max-width: 420px;
}

.access-denied-title {
  margin: 0 0 8px;
  color: var(--danger);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-weight: 700;
}

.access-denied-title::before {
  content: "! ";
}

.access-denied-inline p:last-child {
  margin: 0;
}

.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(2, 8, 3, 0.75);
  align-items: center;
  justify-content: center;
  z-index: 50;
}

.modal-overlay:not([hidden]) {
  display: flex;
}

.modal-box {
  background: var(--panel);
  border: 1px solid var(--danger);
  border-radius: 4px;
  padding: 28px 32px;
  max-width: 360px;
  text-align: center;
  box-shadow: 0 0 30px rgba(255, 95, 95, 0.15);
}

.modal-title {
  color: var(--danger);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin: 0 0 12px;
  font-size: 1.1rem;
  font-weight: 700;
}

.modal-title::before {
  content: "! ";
}

.modal-box p:not(.modal-title) {
  margin: 0 0 20px;
  font-size: 0.9rem;
}

.modal-box button {
  background: transparent;
  border: 1px solid var(--danger);
  color: var(--danger);
}

.modal-box button:hover {
  background: var(--danger);
  color: #1a0505;
  box-shadow: 0 0 12px rgba(255, 95, 95, 0.4);
}

.gate {
  min-height: calc(100vh - 110px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.gate-card {
  width: 100%;
  max-width: 380px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 28px;
  box-shadow: 0 0 0 1px rgba(70, 224, 122, 0.05), 0 0 30px rgba(70, 224, 122, 0.06);
}

.gate-card h1 {
  margin: 0 0 8px;
  font-size: 1.2rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text);
}

.gate-card h1::before {
  content: "> ";
  color: var(--accent);
}

.gate-card p {
  margin: 0 0 20px;
  font-size: 0.85rem;
  line-height: 1.5;
}

#gate-form {
  display: flex;
  gap: 8px;
}

input[type="password"] {
  flex: 1;
  padding: 10px 12px;
  border-radius: 3px;
  border: 1px solid var(--border);
  background: #030805;
  color: var(--accent);
  font-family: "Share Tech Mono", monospace;
  font-size: 1rem;
  letter-spacing: 0.05em;
}

input[type="password"]:focus {
  outline: none;
  border-color: var(--accent-dim);
  box-shadow: 0 0 0 1px var(--accent-dim), 0 0 10px rgba(70, 224, 122, 0.25);
}

button {
  padding: 10px 16px;
  border-radius: 3px;
  border: 1px solid var(--accent-dim);
  background: var(--accent-dim);
  color: #04140a;
  font-family: "Share Tech Mono", monospace;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  cursor: pointer;
}

button:hover {
  background: var(--accent);
  box-shadow: 0 0 12px rgba(70, 224, 122, 0.4);
}

.error {
  color: var(--danger);
  margin-top: 14px;
  font-size: 0.85rem;
}

.error::before {
  content: "! ";
}

.app {
  display: flex;
  min-height: calc(100vh - 110px);
}

.nav {
  width: 220px;
  flex-shrink: 0;
  background: var(--panel);
  border-right: 1px solid var(--border);
  padding: 20px 14px;
  display: flex;
  flex-direction: column;
}

.nav-title {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: var(--muted);
  margin-bottom: 12px;
}

.nav-title::before {
  content: "// ";
}

.nav ul {
  list-style: none;
  margin: 0;
  padding: 0;
  flex: 1;
}

.nav li a {
  display: block;
  padding: 9px 10px;
  border-radius: 3px;
  color: var(--text);
  text-decoration: none;
  font-size: 0.9rem;
  margin-bottom: 2px;
  border-left: 2px solid transparent;
}

.nav li a:hover, .nav li a.active {
  background: #0e1f12;
  border-left-color: var(--accent);
  color: var(--accent);
}

.lock-btn {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--muted);
  font-family: "Share Tech Mono", monospace;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  font-size: 0.8rem;
}

.lock-btn:hover {
  border-color: var(--danger);
  color: var(--danger);
  background: transparent;
  box-shadow: none;
}

.content {
  flex: 1;
  padding: 40px 48px;
  max-width: 780px;
  line-height: 1.65;
}

.subtabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 0 24px;
}

.subtab {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--muted);
  font-family: "Share Tech Mono", monospace;
  font-size: 0.8rem;
  font-weight: 400;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 8px 14px;
  border-radius: 3px;
}

.subtab:hover {
  border-color: var(--accent-dim);
  color: var(--text);
  background: transparent;
  box-shadow: none;
}

.subtab.active {
  background: var(--accent-dim);
  border-color: var(--accent-dim);
  color: #04140a;
  font-weight: 700;
}

.subtab.active:hover {
  background: var(--accent);
  border-color: var(--accent);
}

.content h2 {
  margin-top: 0;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  border-bottom: 1px solid var(--border);
  padding-bottom: 10px;
}

.content h3 {
  color: var(--text);
  letter-spacing: 0.04em;
}

.empty-state {
  color: var(--muted);
}

.home-links {
  list-style: none;
  margin: 24px 0 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-width: 320px;
}

.home-links a {
  display: block;
  padding: 14px 18px;
  border: 1px solid var(--border);
  border-left: 2px solid var(--accent-dim);
  border-radius: 3px;
  background: var(--panel);
  color: var(--text);
  text-decoration: none;
  font-size: 1rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  transition: border-color 0.15s ease, color 0.15s ease, box-shadow 0.15s ease;
}

.home-links a:hover,
.home-links a:focus-visible {
  border-left-color: var(--accent);
  color: var(--accent);
  box-shadow: 0 0 12px rgba(70, 224, 122, 0.2);
}
