@import url('https://fonts.googleapis.com/css2?family=VT323&family=IBM+Plex+Mono:wght@400;700&display=swap');

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

:root {
  --bg:         #000800;
  --primary:    #33ff33;
  --accent:     #00ffff;
  --warning:    #ff3333;
  --dim:        #1a6b1a;
  --glow:       0 0 8px #33ff33;
  --glow-accent:0 0 8px #00ffff;
  --glow-warn:  0 0 8px #ff3333;
}

html, body {
  height: 100%;
  background: var(--bg);
  color: var(--primary);
  font-family: 'IBM Plex Mono', 'Courier New', monospace;
  font-size: 14px;
  line-height: 1.5;
  overflow-x: hidden;
}

/* ── CRT vignette ── */
body::after {
  content: '';
  position: fixed;
  inset: 0;
  background: radial-gradient(ellipse at center,
    transparent 60%,
    rgba(0, 0, 0, 0.65) 100%);
  pointer-events: none;
  z-index: 9998;
}

/* ── Scanline overlay (~10% opacity repeating horizontal lines) ── */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background: repeating-linear-gradient(
    to bottom,
    transparent 0px,
    transparent 3px,
    rgba(0, 0, 0, 0.10) 3px,
    rgba(0, 0, 0, 0.10) 4px
  );
  pointer-events: none;
  z-index: 9999;
}

/* ── Typography — NO letter-spacing anywhere ── */
h1, h2, h3, .vt323 {
  font-family: 'VT323', monospace;
  text-shadow: var(--glow);
}

a {
  color: var(--accent);
  text-decoration: none;
  text-shadow: var(--glow-accent);
}

a:hover {
  color: var(--primary);
  text-shadow: var(--glow);
}

.primary { color: var(--primary); text-shadow: var(--glow); }
.accent  { color: var(--accent);  text-shadow: var(--glow-accent); }
.warning { color: var(--warning); text-shadow: var(--glow-warn); }
.dim     { color: var(--dim);     text-shadow: none; }

/* ── Terminal content blocks: white-space:pre so box-drawing renders verbatim ── */
.terminal, pre {
  white-space: pre;
  font-family: 'IBM Plex Mono', 'Courier New', monospace;
  color: var(--primary);
  text-shadow: var(--glow);
}

/* ── Blinking cursor (1s, step-end = hard blink) ── */
@keyframes blink {
  0%, 49%  { opacity: 1; }
  50%, 100% { opacity: 0; }
}

.cursor {
  display: inline-block;
  animation: blink 1s step-end infinite;
}

/* ── Animated status bar ── */
.status-bar-track {
  display: inline-block;
  width: 16ch;
  background: var(--dim);
  height: 0.8em;
  vertical-align: -0.05em;
  overflow: hidden;
}

.status-bar-fill {
  display: block;
  height: 100%;
  background: var(--primary);
  box-shadow: var(--glow);
  width: 0;
  transition: width 1.4s ease-out;
}

/* ── Shared top status bar ── */
#topbar {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--bg);
  border-bottom: 1px solid var(--dim);
  padding: 3px 12px;
  font-family: 'VT323', monospace;
  font-size: 16px;
  color: var(--dim);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

#topbar span {
  color: var(--primary);
  text-shadow: var(--glow);
}

/* ── Page wrapper ── */
#page {
  max-width: 860px;
  margin: 0 auto;
  padding: 16px 20px 60px;
}

/* ── Shared back-to-menu footer ── */
.back-link {
  margin-top: 32px;
  font-family: 'VT323', monospace;
  font-size: 18px;
}

.back-link a {
  color: var(--accent);
  text-shadow: var(--glow-accent);
}

.back-link a:hover {
  color: var(--primary);
  text-shadow: var(--glow);
}

/* ── Boot screen ── */
#boot-screen {
  position: fixed;
  inset: 0;
  background: var(--bg);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 200;
  padding: 40px;
}

#boot-lines {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 14px;
  color: var(--primary);
  text-shadow: var(--glow);
  max-width: 640px;
  width: 100%;
}

#boot-lines .line {
  display: block;
  min-height: 1.5em;
}

/* ── Main content (hidden until boot completes or session skips it) ── */
#main-content {
  opacity: 0;
  transition: opacity 0.8s ease-in;
}

#main-content.visible {
  opacity: 1;
}

/* ── Menu items (links inside pre blocks) ── */
.menu-item {
  color: var(--primary);
  text-shadow: var(--glow);
}

.menu-item:hover {
  color: var(--accent);
  text-shadow: var(--glow-accent);
}

.menu-item.warning {
  color: var(--warning);
  text-shadow: var(--glow-warn);
}

.menu-item.warning:hover {
  color: var(--warning);
  text-shadow: var(--glow-warn);
}

/* ── Bulletin block ── */
#bulletin-display {
  height: 4.5em;
  overflow: hidden;
  white-space: pre;
  font-family: 'IBM Plex Mono', monospace;
  color: var(--primary);
  text-shadow: var(--glow);
  line-height: 1.5;
}

.bulletin-nav {
  cursor: pointer;
  color: var(--accent);
  text-shadow: var(--glow-accent);
}

.bulletin-nav:hover {
  color: var(--primary);
  text-shadow: var(--glow);
}

/* ── Tagline ── */
.tagline {
  font-family: 'VT323', monospace;
  font-size: 22px;
  text-align: center;
  color: var(--dim);
  margin-top: 16px;
}

/* ── Division accordion (services.html) ── */
.division-header {
  cursor: pointer;
}

.division-header:hover {
  color: var(--accent);
  text-shadow: var(--glow-accent);
}

.division-open {
  color: var(--accent);
  text-shadow: var(--glow-accent);
}

/* ── News release accordion (news.html) ── */
.release-header {
  cursor: pointer;
}

/* On hover, shift the entire pre block to accent — spans inside keep their own color */
.release-header:hover pre {
  color: var(--accent);
  text-shadow: var(--glow-accent);
}

/* ── Contact form (contact.html) ── */
.terminal-input {
  background: #000800;
  color: #33ff33;
  border: 1px solid #33ff33;
  border-radius: 0;
  font-family: 'IBM Plex Mono', 'Courier New', monospace;
  font-size: 14px;
  text-shadow: 0 0 8px #33ff33;
  outline: none;
  padding: 0 3px;
  -webkit-appearance: none;
  appearance: none;
  vertical-align: baseline;
}

.terminal-input:focus {
  box-shadow: 0 0 6px #33ff33;
}

/* Textarea overlay: transparent background so the ASCII box characters show through */
.terminal-textarea {
  position: absolute;
  background: transparent;
  border: none;
  color: #33ff33;
  font-family: 'IBM Plex Mono', 'Courier New', monospace;
  font-size: 14px;
  line-height: 1.5;
  text-shadow: 0 0 8px #33ff33;
  resize: none;
  outline: none;
  padding: 0;
  overflow: auto;
}

.terminal-btn {
  background: #000800;
  color: #33ff33;
  border: 1px solid #33ff33;
  border-radius: 0;
  font-family: 'IBM Plex Mono', 'Courier New', monospace;
  font-size: 14px;
  text-shadow: 0 0 8px #33ff33;
  cursor: pointer;
  padding: 1px 6px;
}

.terminal-btn:hover {
  background: #33ff33;
  color: #000800;
  text-shadow: none;
}

.terminal-btn:disabled {
  opacity: 0.6;
  cursor: wait;
}

/* ── Emergency protocols (emergency.html) ── */
#unlocked-screen {
  opacity: 0;
  transition: opacity 0.8s ease-in;
}

#unlocked-screen.visible {
  opacity: 1;
}

/* Warning-colored status bar fill (Ring D overhaul, etc.) */
.status-bar-fill.warn {
  background: var(--warning);
  box-shadow: var(--glow-warn);
}
