/* =========================================================
   THE UNKNOWN ARCHIVE — EARLY-2000s HYBRID PORTAL THEME
   Deep Navy + Dark Grunge Texture + Beveled Steel Frames
   ========================================================= */
:root {
  --bg-void: #05070b;
  --bg-outer: #090d14;
  --panel-dark: #0c121c;
  --panel-mid: #111927;
  --panel-header-top: #1d2f47;
  --panel-header-bot: #0d1624;
  --steel-border-light: #355070;
  --steel-border-dark: #030508;
  --accent-ice: #6bb6ff;
  --accent-cyan: #8be9fd;
  --accent-amber: #d4a359;
  --text-main: #d4deea;
  --text-muted: #8899ae;
  --text-dim: #5b6c82;
}

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

html,
body {
  max-width: 100%;
  overflow-x: hidden;
}

body {
  background-color: var(--bg-void);
  background-image:
    radial-gradient(circle at 50% 0%, #101b2d 0%, #05070b 75%),
    repeating-linear-gradient(
      0deg,
      rgba(255, 255, 255, 0.015) 0px,
      rgba(255, 255, 255, 0.015) 1px,
      transparent 1px,
      transparent 3px
    );
  color: var(--text-main);
  font-family: Verdana, Tahoma, "Segoe UI", Arial, sans-serif;
  font-size: 12px;
  line-height: 1.55;
  padding: 12px 8px 28px;
}

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

a:hover {
  color: var(--accent-cyan);
  text-decoration: underline;
}

code {
  font-family: "Courier New", Courier, monospace;
  color: var(--accent-cyan);
  font-size: 11px;
}

/* MAIN PORTAL CONTAINER */
.portal-shell {
  max-width: 980px;
  width: 100%;
  margin: 0 auto;
  background: var(--bg-outer);
  border: 1px solid var(--steel-border-light);
  box-shadow: 0 0 28px rgba(0, 0, 0, 0.95), inset 0 0 0 1px #020407;
}

/* TOP UTILITY BAR */
.top-utility {
  background: #06090f;
  border-bottom: 1px solid #1c2a3d;
  padding: 5px 10px;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 6px;
  font-size: 10px;
  color: var(--text-muted);
  letter-spacing: 0.5px;
}

.status-dot {
  display: inline-block;
  width: 7px;
  height: 7px;
  background: #38bdf8;
  border: 1px solid #bae6fd;
  margin-right: 5px;
  vertical-align: middle;
}

/* METALLIC HEADER BANNER */
.archive-banner {
  position: relative;
  padding: 18px 16px;
  background: linear-gradient(180deg, #162336 0%, #0b121d 55%, #070b12 100%);
  border-bottom: 1px solid var(--steel-border-light);
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  overflow: hidden;
}

.archive-banner::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(90deg, rgba(107, 182, 255, 0.05) 1px, transparent 1px),
    linear-gradient(0deg, rgba(107, 182, 255, 0.05) 1px, transparent 1px);
  background-size: 18px 18px;
  pointer-events: none;
}

.brand-block {
  position: relative;
  z-index: 1;
  min-width: 0;
}

.brand-kicker {
  font-family: "Courier New", Courier, monospace;
  font-size: 10px;
  color: var(--accent-amber);
  letter-spacing: 2px;
  text-transform: uppercase;
  margin-bottom: 3px;
}

.brand-title {
  font-family: "Trebuchet MS", Tahoma, sans-serif;
  font-size: 24px;
  font-weight: bold;
  letter-spacing: 2px;
  color: #e6f0fa;
  text-shadow: 0 2px 6px rgba(0, 0, 0, 0.9), 0 0 12px rgba(107, 182, 255, 0.25);
  overflow-wrap: break-word;
}

.brand-title span {
  color: var(--accent-ice);
}

.brand-sub {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 2px;
}

/* HEADER SEARCH TERMINAL */
.search-terminal {
  position: relative;
  z-index: 1;
  background: #06090f;
  border: 1px solid var(--steel-border-light);
  padding: 7px 8px;
  min-width: 255px;
}

.search-terminal label {
  display: block;
  font-family: "Courier New", Courier, monospace;
  font-size: 10px;
  color: var(--accent-ice);
  margin-bottom: 5px;
  letter-spacing: 0.8px;
}

.search-row {
  display: flex;
  gap: 5px;
}

.search-row input {
  flex: 1;
  min-width: 0;
  background: #0d1522;
  border: 1px solid #293e59;
  color: #e6f0fa;
  padding: 6px 8px;
  min-height: 34px;
  font-family: Verdana, sans-serif;
  font-size: 12px;
  outline: none;
}

.search-row input:focus {
  border-color: var(--accent-ice);
}

.action-btn {
  background: linear-gradient(180deg, #253d5c 0%, #122033 100%);
  border: 1px solid #486b94;
  color: #e6f0fa;
  font-family: Verdana, sans-serif;
  font-size: 10px;
  font-weight: bold;
  padding: 6px 10px;
  min-height: 34px;
  cursor: pointer;
  letter-spacing: 0.5px;
  white-space: nowrap;
}

.action-btn:hover {
  background: linear-gradient(180deg, #2f4d73 0%, #182b45 100%);
  color: #ffffff;
}

/* BEVELED NAVIGATION BAR */
.nav-strip {
  display: flex;
  flex-wrap: wrap;
  background: linear-gradient(180deg, #1b2a3e 0%, #0f1826 50%, #0a1019 100%);
  border-bottom: 1px solid var(--steel-border-light);
}

.nav-btn {
  background: transparent;
  border: none;
  border-right: 1px solid #243750;
  border-bottom: 2px solid transparent;
  padding: 9px 13px;
  min-height: 38px;
  font-family: Verdana, sans-serif;
  font-size: 11px;
  font-weight: bold;
  color: #d6e2f0;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  cursor: pointer;
}

.nav-btn:hover {
  background: linear-gradient(180deg, #223752 0%, #111d2e 100%);
  color: var(--accent-cyan);
}

.nav-btn.active {
  background: linear-gradient(180deg, #2b486b 0%, #15253b 100%);
  color: #ffffff;
  border-bottom-color: var(--accent-cyan);
}

/* TICKER / ARCHIVE NOTICE BAR */
.notice-bar {
  background: #070b11;
  border-bottom: 1px solid #1b293b;
  padding: 6px 10px;
  font-family: "Courier New", Courier, monospace;
  font-size: 11px;
  color: #9ab0c9;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 6px;
}

.notice-tag {
  color: var(--accent-amber);
  font-weight: bold;
}

/* 3-COLUMN PORTAL WORKSPACE */
.portal-grid {
  display: grid;
  grid-template-columns: 215px minmax(0, 1fr) 220px;
  gap: 10px;
  padding: 10px;
}

.portal-grid > aside,
.portal-grid > section {
  min-width: 0;
}

/* BEVELED BOX MODULE */
.module-box {
  background: var(--panel-dark);
  border: 1px solid #263952;
  box-shadow: inset 0 0 0 1px #06090e;
  margin-bottom: 10px;
}

.module-box:last-child {
  margin-bottom: 0;
}

.module-header {
  background: linear-gradient(180deg, var(--panel-header-top) 0%, var(--panel-header-bot) 100%);
  border-bottom: 1px solid var(--steel-border-light);
  padding: 6px 8px;
  font-size: 11px;
  font-weight: bold;
  color: #e8f1fa;
  letter-spacing: 0.8px;
  text-transform: uppercase;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 6px;
}

.module-header .code-id {
  font-family: "Courier New", Courier, monospace;
  font-size: 10px;
  color: var(--accent-ice);
  font-weight: normal;
}

.module-body {
  padding: 9px;
}

/* LEFT SIDEBAR: DIRECTORY */
.dir-list {
  list-style: none;
}

.dir-list li {
  border-bottom: 1px dotted #1e2d42;
}

.dir-list li:last-child {
  border-bottom: none;
}

.cat-btn {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 6px;
  width: 100%;
  min-height: 36px;
  background: none;
  border: none;
  border-left: 2px solid transparent;
  color: var(--text-main);
  font-family: Verdana, sans-serif;
  font-size: 11px;
  text-align: left;
  padding: 6px 6px;
  cursor: pointer;
}

.cat-btn:hover {
  background: #131f31;
  color: var(--accent-cyan);
}

.cat-btn.active-filter {
  background: #17273d;
  color: #ffffff;
  font-weight: bold;
  border-left-color: var(--accent-cyan);
}

.count-badge {
  font-family: "Courier New", Courier, monospace;
  font-size: 10px;
  background: #080d14;
  border: 1px solid #263a54;
  color: var(--accent-ice);
  padding: 2px 5px;
}

/* ICEBERG DEPTH SELECTOR */
.iceberg-tier {
  display: block;
  width: 100%;
  text-align: left;
  border: 1px solid #1f3047;
  border-left: 3px solid #355070;
  background: #090e17;
  padding: 7px 8px;
  margin-bottom: 6px;
  cursor: pointer;
  font-family: Verdana, sans-serif;
}

.iceberg-tier:hover {
  border-color: var(--accent-ice);
  background: #0f1928;
}

.iceberg-tier.active-tier {
  border-color: var(--accent-cyan);
  border-left-color: var(--accent-cyan);
  background: #142338;
  box-shadow: inset 0 0 0 1px rgba(139, 233, 253, 0.25);
}

.tier-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 4px;
  font-size: 10px;
  font-weight: bold;
  color: var(--accent-ice);
  margin-bottom: 3px;
}

.iceberg-tier.active-tier .tier-top {
  color: var(--accent-cyan);
}

.tier-desc {
  display: block;
  font-size: 10px;
  color: var(--text-muted);
  line-height: 1.4;
}

.show-all-tiers-btn {
  width: 100%;
  min-height: 34px;
  margin-top: 2px;
  background: #0c1522;
  border: 1px solid #2d4563;
  color: var(--accent-ice);
  font-family: "Courier New", Courier, monospace;
  font-size: 10px;
  font-weight: bold;
  padding: 6px;
  cursor: pointer;
  letter-spacing: 0.5px;
}

.show-all-tiers-btn:hover {
  background: #142338;
  color: #ffffff;
}

/* CENTER COLUMN: WELCOME BRIEFING & CASE FILES */
.intro-dossier {
  background: linear-gradient(180deg, #101826 0%, #0a1019 100%);
  border: 1px solid #2b4261;
  padding: 10px;
  margin-bottom: 10px;
}

.intro-dossier p {
  margin-bottom: 8px;
  color: #c9d5e4;
}

.epistemic-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding-top: 8px;
  border-top: 1px dashed #22344d;
}

/* CLASSIFICATION BADGES */
.tag-status {
  font-family: "Courier New", Courier, monospace;
  font-size: 10px;
  font-weight: bold;
  padding: 2px 6px;
  border: 1px solid;
  text-transform: uppercase;
  display: inline-block;
  white-space: nowrap;
}

.status-documented {
  color: #7ee787;
  border-color: #2ea043;
  background: rgba(46, 160, 67, 0.14);
}

.status-unexplained {
  color: #79c0ff;
  border-color: #388bfd;
  background: rgba(56, 139, 253, 0.14);
}

.status-theory {
  color: #e3b341;
  border-color: #bb8009;
  background: rgba(187, 128, 9, 0.14);
}

.status-folklore {
  color: #d2a8ff;
  border-color: #8957e5;
  background: rgba(137, 87, 229, 0.14);
}

/* CASE FILE ENTRY CARD */
.case-entry {
  border: 1px solid #203147;
  background: #0a0f18;
  padding: 10px;
  margin-bottom: 9px;
}

.case-entry:hover {
  border-color: #3b5b82;
  background: #0d1420;
}

.case-meta {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 6px;
  font-family: "Courier New", Courier, monospace;
  font-size: 10px;
  color: var(--text-muted);
  margin-bottom: 5px;
  padding-bottom: 5px;
  border-bottom: 1px solid #162233;
}

.case-title {
  font-family: "Trebuchet MS", Tahoma, sans-serif;
  font-size: 14px;
  font-weight: bold;
  color: #e6f0fa;
  margin-bottom: 5px;
  overflow-wrap: break-word;
}

.case-summary {
  color: #bcc9d9;
  margin-bottom: 8px;
}

.case-footer {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  font-size: 10px;
  color: var(--text-muted);
}

.case-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.dossier-btn {
  background: #132033;
  border: 1px solid #355278;
  color: var(--accent-ice);
  padding: 6px 10px;
  min-height: 32px;
  font-family: Verdana, sans-serif;
  font-size: 10px;
  font-weight: bold;
  cursor: pointer;
}

.dossier-btn:hover {
  background: #1d324f;
  color: #ffffff;
}

/* EXPANDABLE BRIEFING DRAWER */
.case-briefing {
  display: none;
  margin-top: 8px;
  padding: 9px;
  background: #06090f;
  border-left: 2px solid var(--accent-ice);
  border-top: 1px solid #152030;
  font-size: 11px;
  line-height: 1.6;
  color: #c8d4e3;
}

.case-briefing.open {
  display: block;
}

.case-briefing strong {
  color: var(--accent-amber);
}

.article-slot {
  display: block;
  margin-top: 6px;
  padding-top: 6px;
  border-top: 1px dotted #1f2e42;
  font-size: 10px;
  color: var(--text-muted);
}

/* EMPTY SEARCH STATE */
.empty-results-box {
  border: 1px dashed #355070;
  background: #070b12;
  padding: 16px 12px;
  text-align: center;
  margin-top: 6px;
}

.empty-title {
  font-family: "Courier New", Courier, monospace;
  font-size: 12px;
  font-weight: bold;
  color: var(--accent-amber);
  margin-bottom: 6px;
}

.empty-text {
  color: var(--text-muted);
  font-size: 11px;
  margin-bottom: 10px;
}

/* RIGHT SIDEBAR: SPOTLIGHT & LOGS */
.spotlight-frame {
  border: 1px solid #2b4261;
  background: #070b12;
  padding: 7px;
}

.spotlight-screen {
  height: 82px;
  background:
    repeating-linear-gradient(0deg, rgba(107, 182, 255, 0.08) 0px, rgba(107, 182, 255, 0.08) 1px, transparent 1px, transparent 4px),
    radial-gradient(circle at center, #182c47 0%, #060a10 100%);
  border: 1px solid #253b57;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  padding: 6px;
  margin-bottom: 7px;
  font-family: "Courier New", Courier, monospace;
}

.spot-code {
  color: var(--accent-ice);
  font-size: 11px;
  font-weight: bold;
}

.spot-sub {
  color: var(--accent-amber);
  font-size: 10px;
  margin-top: 3px;
}

.spot-caption {
  font-size: 11px;
  color: var(--text-main);
}

.mini-log {
  font-size: 11px;
  border-bottom: 1px dotted #1e2d42;
  padding: 6px 0;
}

.mini-log:first-child {
  padding-top: 0;
}

.mini-log:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.mini-date {
  font-family: "Courier New", Courier, monospace;
  font-size: 10px;
  color: var(--accent-amber);
  display: block;
  margin-bottom: 2px;
}

/* FOOTER */
.portal-footer {
  background: linear-gradient(180deg, #0d1522 0%, #06090f 100%);
  border-top: 1px solid var(--steel-border-light);
  padding: 9px 12px;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  font-size: 10px;
  color: var(--text-muted);
}

/* MOBILE & TABLET RESPONSIVENESS */
@media (max-width: 840px) {
  body {
    padding: 6px 4px 20px;
    font-size: 13px;
  }

  .portal-grid {
    grid-template-columns: 1fr;
    gap: 8px;
    padding: 8px;
  }

  .archive-banner {
    padding: 14px 12px;
  }

  .brand-title {
    font-size: 20px;
  }

  .search-terminal {
    width: 100%;
    min-width: 0;
  }

  .nav-btn {
    flex: 1 1 45%;
    text-align: center;
    padding: 10px 8px;
    min-height: 42px;
  }

  .dossier-btn,
  .action-btn,
  .show-all-tiers-btn {
    min-height: 38px;
  }
}
