/* mercenary public node — deck-console / dossier.
   IBM Plex Mono is a self-hosted SIL OFL 1.1 subset. No trackers. */

@font-face {
  font-family: "IBM Plex Mono";
  src: url("/fonts/ibm-plex-mono-regular.woff") format("woff");
  font-style: normal;
  font-weight: 400;
  font-display: swap;
}

@font-face {
  font-family: "IBM Plex Mono";
  src: url("/fonts/ibm-plex-mono-semibold.woff") format("woff");
  font-style: normal;
  font-weight: 600;
  font-display: swap;
}

:root {
  --bg: #05070a;
  --bg-2: #0a1014;
  --panel: rgba(8, 16, 20, 0.86);
  --line: #16333a;
  --line-bright: #2a5a64;
  --phos: #9aff6e;
  --phos-dim: #4d8a45;
  --cyan: #67f0ff;
  --cyan-dim: #2a7a86;
  --mag: #ff4ad8;
  --ice: #c8f6ff;
  --black-ice: #ff3355;
  --text: #cfe9d4;
  --text-dim: #7a9a82;
  --ink: #020406;
  --font: "IBM Plex Mono", ui-monospace, "Cascadia Code", "SF Mono", Consolas, "Liberation Mono", monospace;
  --max: 72rem;
}

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

html {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.65;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  background: var(--bg);
  overflow-x: hidden;
}

/* Cyberspace floor grid */
.grid-floor {
  pointer-events: none;
  position: fixed;
  inset: auto 0 0 0;
  height: 48vh;
  z-index: 0;
  background-image:
    linear-gradient(to right, rgba(103, 240, 255, 0.09) 1px, transparent 1px),
    linear-gradient(to top, rgba(103, 240, 255, 0.09) 1px, transparent 1px);
  background-size: 48px 48px;
  transform: perspective(500px) rotateX(60deg) scale(1.4);
  transform-origin: center bottom;
  mask-image: linear-gradient(to top, rgba(0,0,0,0.65), transparent 78%);
  -webkit-mask-image: linear-gradient(to top, rgba(0,0,0,0.65), transparent 78%);
}

/* Scanlines / CRT */
.scanlines {
  pointer-events: none;
  position: fixed;
  inset: 0;
  z-index: 40;
  background: repeating-linear-gradient(
    to bottom,
    rgba(0, 0, 0, 0.18) 0,
    rgba(0, 0, 0, 0.18) 1px,
    transparent 1px,
    transparent 3px
  );
  mix-blend-mode: multiply;
  opacity: 0.4;
}
.scanlines::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: rgba(103, 240, 255, 0.02);
}

img, svg { max-width: 100%; display: block; }
a { color: var(--cyan); text-decoration-thickness: 1px; text-underline-offset: 0.2em; }
a:hover { color: var(--phos); }
a:focus-visible, button:focus-visible, input:focus-visible {
  outline: 2px solid var(--phos);
  outline-offset: 3px;
}

h1, h2, h3 {
  font-family: var(--font);
  font-weight: 600;
  letter-spacing: 0.04em;
  line-height: 1.2;
  color: var(--ice);
  text-transform: none;
  margin: 0 0 0.75rem;
}
h1 { font-size: clamp(1.8rem, 4.5vw, 3rem); }
h2 { font-size: clamp(1.2rem, 2.4vw, 1.6rem); color: var(--phos); }
h3 { font-size: 1rem; color: var(--cyan); margin: 0 0 0.4rem; }

p { margin: 0 0 1rem; }
.lede { font-size: 1.02rem; max-width: 42rem; color: var(--text); }

.skip {
  position: absolute;
  left: 0.75rem;
  top: -3.2rem;
  background: var(--ink);
  color: var(--phos);
  padding: 0.4rem 0.8rem;
  z-index: 50;
}
.skip:focus { top: 0.75rem; }

/* Host flourish — cybermercenary.online only */
.node-banner {
  display: none;
  background: #061016;
  border-bottom: 1px solid var(--cyan);
  color: var(--cyan);
  font-size: 0.72rem;
  letter-spacing: 0.16em;
  text-transform: lowercase;
  text-align: center;
  padding: 0.3rem 1rem;
}
html[data-node="cyber"] .node-banner { display: block; }
html[data-node="cyber"] .wm-apex { display: none; }
html[data-node="cyber"] .wm-cyber { display: inline; }
.wm-cyber { display: none; }

/* Deck status bar */
.hud {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 1.2rem;
  justify-content: space-between;
  align-items: center;
  padding: 0.35rem 1.25rem;
  background: var(--ink);
  border-bottom: 1px solid var(--line);
  font-size: 0.68rem;
  letter-spacing: 0.1em;
  color: var(--text-dim);
  text-transform: uppercase;
  position: relative;
  z-index: 20;
}
.hud b { color: var(--phos); font-weight: 600; }
.hud .ice-ok { color: var(--cyan); }
.hud .clk { color: var(--cyan); }

/* Mast / nav */
.mast {
  border-bottom: 1px solid var(--line);
  background: rgba(5, 7, 10, 0.92);
  position: sticky;
  top: 0;
  z-index: 20;
  backdrop-filter: blur(8px);
}
.mast-inner {
  max-width: var(--max);
  margin: 0 auto;
  padding: 0.65rem 1.25rem;
  display: flex;
  align-items: center;
  gap: 1rem;
}
.brand {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  color: inherit;
  text-decoration: none;
  min-width: 10rem;
}
.brand:hover { color: inherit; }
.brand-mark {
  width: 2.1rem;
  height: 2.1rem;
  flex: none;
  filter: drop-shadow(0 0 6px rgba(103, 240, 255, 0.45));
  cursor: pointer;
}
.wordmark {
  font-weight: 600;
  font-size: 1.05rem;
  letter-spacing: 0.14em;
  text-transform: lowercase;
  color: var(--phos);
  text-shadow: 0 0 12px rgba(154, 255, 110, 0.25);
}
.wordmark::before { content: "> "; color: var(--cyan); font-weight: 400; }

.glitch:hover .wordmark,
.glitch:focus-visible .wordmark {
  animation: glitch 0.45s steps(2, end) 1;
}
@keyframes glitch {
  0% { text-shadow: 2px 0 var(--mag), -2px 0 var(--cyan); transform: translate(0); }
  25% { text-shadow: -2px 0 var(--mag), 2px 0 var(--cyan); transform: translate(-1px, 0); }
  50% { text-shadow: 2px 0 var(--cyan), -2px 0 var(--phos); transform: translate(1px, 0); }
  100% { text-shadow: 0 0 12px rgba(154, 255, 110, 0.25); transform: none; }
}

nav.primary { margin-left: auto; }
nav.primary ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.1rem;
}
nav.primary a {
  display: block;
  padding: 0.4rem 0.7rem;
  color: var(--text-dim);
  text-decoration: none;
  font-size: 0.75rem;
  letter-spacing: 0.12em;
  text-transform: lowercase;
  border: 1px solid transparent;
}
nav.primary a:hover,
nav.primary a[aria-current="page"] {
  color: var(--phos);
  border-color: var(--line);
  background: rgba(154, 255, 110, 0.05);
}

.nav-toggle {
  display: none;
  margin-left: auto;
  background: transparent;
  color: var(--cyan);
  border: 1px solid var(--line);
  font-family: inherit;
  font-size: 0.72rem;
  letter-spacing: 0.12em;
  text-transform: lowercase;
  padding: 0.4rem 0.7rem;
  cursor: pointer;
}

main {
  max-width: var(--max);
  margin: 0 auto;
  padding: 2rem 1.25rem 4.5rem;
  position: relative;
  z-index: 1;
}

/* Dossier / ICE frame */
.panel {
  --c: var(--cyan);
  background:
    linear-gradient(var(--c), var(--c)) top left / 10px 1px no-repeat,
    linear-gradient(var(--c), var(--c)) top left / 1px 10px no-repeat,
    linear-gradient(var(--c), var(--c)) top right / 10px 1px no-repeat,
    linear-gradient(var(--c), var(--c)) top right / 1px 10px no-repeat,
    linear-gradient(var(--c), var(--c)) bottom left / 10px 1px no-repeat,
    linear-gradient(var(--c), var(--c)) bottom left / 1px 10px no-repeat,
    linear-gradient(var(--c), var(--c)) bottom right / 10px 1px no-repeat,
    linear-gradient(var(--c), var(--c)) bottom right / 1px 10px no-repeat,
    var(--panel);
  border: 1px solid var(--line);
  padding: 1.4rem 1.4rem 1.2rem;
  position: relative;
  box-shadow:
    0 0 0 1px rgba(103, 240, 255, 0.04),
    0 16px 50px rgba(0, 0, 0, 0.45);
}

.kicker {
  font-size: 0.7rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--cyan-dim);
  margin: 0 0 0.55rem;
}

/* Hero */
.hero {
  display: grid;
  grid-template-columns: minmax(10rem, 16rem) 1fr;
  gap: 2.25rem;
  align-items: center;
  margin-bottom: 2.75rem;
  min-height: 22rem;
}
.hero-mark {
  position: relative;
  display: grid;
  place-items: center;
  min-height: 16rem;
}
.ice-ring {
  position: absolute;
  width: min(16rem, 70vw);
  height: min(16rem, 70vw);
  border-radius: 50%;
  border: 1px dashed rgba(103, 240, 255, 0.28);
  box-shadow:
    0 0 0 18px rgba(103, 240, 255, 0.04),
    0 0 40px rgba(154, 255, 110, 0.08);
  animation: spin 36s linear infinite;
}
.ice-ring::before,
.ice-ring::after {
  content: "";
  position: absolute;
  inset: 18%;
  border-radius: 50%;
  border: 1px solid rgba(154, 255, 110, 0.2);
}
.ice-ring::after { inset: 32%; border-style: dotted; border-color: rgba(255, 74, 216, 0.25); }
@keyframes spin { to { transform: rotate(360deg); } }

.hero-mark svg {
  width: min(11rem, 46vw);
  height: auto;
  position: relative;
  z-index: 1;
  filter: drop-shadow(0 0 16px rgba(103, 240, 255, 0.4));
  cursor: pointer;
}

.wordmark-lg {
  font-size: clamp(2.2rem, 6vw, 3.6rem);
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: lowercase;
  color: var(--phos);
  margin: 0 0 0.35rem;
  line-height: 1;
  text-shadow: 0 0 18px rgba(154, 255, 110, 0.28);
}
.wordmark-lg .wm-cyber { font-size: 0.85em; }

.motto {
  margin: 0 0 1.1rem;
  cursor: help;
}
.motto-la {
  display: block;
  font-size: clamp(1.05rem, 2.4vw, 1.45rem);
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--cyan);
  text-shadow: 0 0 14px rgba(103, 240, 255, 0.25);
}
.motto-en {
  display: block;
  margin-top: 0.25rem;
  font-size: 0.78rem;
  letter-spacing: 0.1em;
  color: var(--text-dim);
  opacity: 0.72;
  transition: opacity 0.2s, color 0.2s;
}
.motto:hover .motto-en,
.motto:focus-within .motto-en {
  opacity: 1;
  color: var(--ice);
}

.hero-actions { display: flex; flex-wrap: wrap; gap: 0.7rem; margin-top: 1.35rem; }

.btn {
  display: inline-block;
  font-family: inherit;
  font-size: 0.78rem;
  letter-spacing: 0.12em;
  text-transform: lowercase;
  text-decoration: none;
  padding: 0.7rem 1rem;
  border: 1px solid var(--phos);
  color: var(--ink);
  background: var(--phos);
  cursor: pointer;
  box-shadow: 0 0 16px rgba(154, 255, 110, 0.15);
}
.btn:hover { background: var(--ice); border-color: var(--ice); color: var(--ink); }
.btn-ghost {
  background: transparent;
  color: var(--cyan);
  border-color: var(--cyan);
  box-shadow: none;
}
.btn-ghost:hover { background: rgba(103, 240, 255, 0.08); color: var(--ice); }

.section { margin: 0 0 2.25rem; }
.grid-2 {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.15rem;
}
.grid-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.15rem;
}

.card {
  background:
    linear-gradient(var(--cyan), var(--cyan)) top left / 8px 1px no-repeat,
    linear-gradient(var(--cyan), var(--cyan)) top left / 1px 8px no-repeat,
    linear-gradient(var(--cyan), var(--cyan)) bottom right / 8px 1px no-repeat,
    linear-gradient(var(--cyan), var(--cyan)) bottom right / 1px 8px no-repeat,
    var(--panel);
  border: 1px solid var(--line);
  padding: 1.1rem 1.15rem 1rem;
  position: relative;
}
.card .id {
  font-size: 0.68rem;
  letter-spacing: 0.16em;
  color: var(--mag);
  text-transform: uppercase;
  margin: 0 0 0.35rem;
}
.card h3 { margin-top: 0; }

/* Contract rules */
.rules { list-style: none; margin: 0; padding: 0; }
.rules li {
  display: grid;
  grid-template-columns: 3rem 1fr;
  gap: 0.8rem;
  padding: 0.85rem 0;
  border-bottom: 1px solid var(--line);
}
.rules li:last-child { border-bottom: 0; }
.rules .num {
  color: var(--cyan);
  font-weight: 600;
  letter-spacing: 0.08em;
  font-size: 0.9rem;
}

/* Redacted dossier text */
.redact {
  background: #000;
  color: transparent;
  padding: 0 0.15em;
  border-radius: 1px;
  box-shadow: inset 0 0 0 1px #111;
  cursor: help;
  text-decoration: none;
}
.redact:hover,
.redact:focus {
  background: rgba(154, 255, 110, 0.12);
  color: var(--phos);
  outline: 1px dashed var(--phos);
  outline-offset: 2px;
}

/* Footer */
footer.site {
  border-top: 1px solid var(--line);
  background: var(--ink);
  padding: 1.4rem 1.25rem 2.4rem;
  font-size: 0.72rem;
  color: var(--text-dim);
  letter-spacing: 0.04em;
  position: relative;
  z-index: 1;
}
.foot-inner { max-width: var(--max); margin: 0 auto; display: grid; gap: 0.65rem; }
.foot-links { display: flex; flex-wrap: wrap; gap: 0.55rem 1.1rem; }
.foot-links a { color: var(--cyan-dim); text-decoration: none; }
.foot-links a:hover { color: var(--phos); }
.whisper { opacity: 0.28; font-size: 0.65rem; }
.whisper a { color: inherit; text-decoration: none; }
.whisper a:hover, .whisper a:focus { opacity: 1; color: var(--mag); }

/* Terminal overlay */
.terminal {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 60;
  background: rgba(0, 0, 0, 0.78);
  align-items: center;
  justify-content: center;
  padding: 1rem;
}
.terminal.open { display: flex; }
.terminal-panel {
  width: min(42rem, 100%);
  background: #020806;
  border: 1px solid var(--phos);
  box-shadow: 0 0 40px rgba(154, 255, 110, 0.14);
  padding: 1rem 1.1rem 1.1rem;
  color: var(--phos);
  font-size: 0.88rem;
}
.terminal-panel .bar {
  display: flex;
  justify-content: space-between;
  color: var(--cyan);
  font-size: 0.68rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  margin-bottom: 0.8rem;
  border-bottom: 1px solid var(--line);
  padding-bottom: 0.4rem;
}
.terminal-panel button.close {
  background: none;
  border: 0;
  color: var(--mag);
  font-family: inherit;
  font-size: 0.7rem;
  letter-spacing: 0.1em;
  text-transform: lowercase;
  cursor: pointer;
}
.term-log { min-height: 8rem; white-space: pre-wrap; margin: 0 0 0.75rem; color: var(--phos); }
.term-row { display: flex; gap: 0.5rem; align-items: center; }
.term-row label { color: var(--cyan); }
.term-row input {
  flex: 1;
  background: transparent;
  border: 0;
  border-bottom: 1px solid var(--line);
  color: var(--phos);
  font-family: inherit;
  font-size: 0.9rem;
  padding: 0.3rem 0;
  caret-color: var(--phos);
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 1.5rem;
  transform: translateX(-50%) translateY(2rem);
  background: var(--ink);
  color: var(--phos);
  border: 1px solid var(--phos);
  font-size: 0.8rem;
  letter-spacing: 0.05em;
  padding: 0.7rem 1rem;
  z-index: 55;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s, transform 0.3s;
  max-width: min(36rem, calc(100% - 2rem));
  text-align: center;
  box-shadow: 0 0 20px rgba(154, 255, 110, 0.15);
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

.lost { text-align: center; padding: 4rem 1rem; }
.lost .code {
  font-size: 3.4rem;
  color: var(--black-ice);
  letter-spacing: 0.16em;
  margin: 0;
  text-shadow: 0 0 16px rgba(255, 51, 85, 0.45);
}

.prompt-hint {
  font-size: 0.75rem;
  color: var(--text-dim);
  margin-top: 1.75rem;
}
.prompt-hint kbd {
  font-family: inherit;
  border: 1px solid var(--line);
  padding: 0.05rem 0.35rem;
  color: var(--cyan);
}

@media (max-width: 860px) {
  .hero { grid-template-columns: 1fr; min-height: 0; }
  .hero-mark { min-height: 14rem; }
  .grid-3, .grid-2 { grid-template-columns: 1fr; }
  .nav-toggle { display: inline-block; }
  nav.primary {
    display: none;
    position: absolute;
    left: 0;
    right: 0;
    top: 100%;
    background: var(--bg);
    border-bottom: 1px solid var(--line);
    padding: 0.5rem 1rem 1rem;
  }
  .mast { position: relative; }
  .mast.open nav.primary { display: block; }
  nav.primary ul { flex-direction: column; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .ice-ring, .glitch:hover .wordmark, .toast { animation: none; transition: none; }
}
