@font-face {
  font-family: "Kreadon";
  src: url("./fonts/Kreadon-L.otf") format("opentype");
  font-weight: 300 700;
  font-style: normal;
  font-display: swap;
}

:root {
  color-scheme: dark;
  --bg: #080808;
  --panel: #111111;
  --panel-2: #151515;
  --plate: #1c1c1c;
  --line: #333333;
  --line-2: #4a4a4a;
  --text: #eeeeee;
  --muted: #a9a9a9;
  --dim: #777777;
  --paper: #d8d8d8;
  --ink: #f4f4f4;
  --soft: rgba(255, 255, 255, .08);
  --accent-neural: #c9d1d6;
  --accent-power: #c8c1ac;
  --accent-muscle: #c8b6b3;
  --accent-sensor: #c4c4c4;
}

* {
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
}

body {
  margin: 0;
  background:
    linear-gradient(90deg, rgba(255, 255, 255, .025) 1px, transparent 1px) 0 0 / 48px 48px,
    linear-gradient(0deg, rgba(255, 255, 255, .018) 1px, transparent 1px) 0 0 / 48px 48px,
    var(--bg);
  color: var(--text);
  font-family: "Kreadon", Arial, Helvetica, sans-serif;
  letter-spacing: 0;
  overflow-x: hidden;
}

button,
input {
  font: inherit;
}

a {
  color: var(--ink);
  text-decoration-color: rgba(255, 255, 255, .35);
  text-underline-offset: 3px;
}

a:hover {
  text-decoration-color: var(--ink);
}

.app-shell {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 292px minmax(0, 1fr);
  grid-template-rows: auto 1fr;
  min-height: 100vh;
  transition: opacity .32s ease, visibility .32s ease;
}

.app-shell.atlas-hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.intro-screen {
  position: fixed;
  inset: 0;
  z-index: 4;
  display: grid;
  place-items: center;
  background: rgba(8, 8, 8, .1);
  transition: opacity .45s ease, visibility .45s ease;
}

.intro-screen.hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 6;
  display: grid;
  place-items: center;
  padding: 56px;
  background: rgba(0, 0, 0, .82);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity .18s ease, visibility .18s ease;
}

.lightbox.open {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.lightbox img {
  display: block;
  max-width: min(1120px, 88vw);
  max-height: 84vh;
  object-fit: contain;
  border: 1px solid rgba(255, 255, 255, .28);
  background: #080808;
  box-shadow: 0 24px 90px rgba(0, 0, 0, .65);
}

.lightbox-close {
  position: fixed;
  top: 22px;
  right: 26px;
  width: 42px;
  height: 42px;
  border: 1px solid rgba(255, 255, 255, .38);
  background: rgba(10, 10, 10, .7);
  color: #eeeeee;
  font-size: 28px;
  line-height: 1;
  cursor: pointer;
}

.lightbox-close:hover {
  border-color: #ffffff;
}

.intro-inner {
  display: grid;
  justify-items: center;
  gap: 14px;
  padding: 40px;
  text-align: center;
  background: rgba(8, 8, 8, .16);
}

.intro-kicker,
.intro-subtitle {
  margin: 0;
  color: var(--muted);
  text-transform: uppercase;
}

.intro-kicker {
  font-size: 13px;
}

.intro-subtitle {
  font-size: 18px;
  letter-spacing: .08em;
}

.intro-inner h1 {
  font-size: clamp(82px, 16vw, 190px);
  line-height: .84;
  font-weight: 600;
}

.enter-button {
  margin-top: 22px;
  min-width: 190px;
  height: 48px;
  border: 1px solid rgba(255, 255, 255, .62);
  background: rgba(16, 16, 16, .72);
  color: var(--text);
  cursor: pointer;
  text-transform: uppercase;
}

.enter-button:hover {
  background: rgba(255, 255, 255, .1);
  border-color: #ffffff;
}

.code-field {
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
  background: #080808;
}

.code-column {
  position: absolute;
  top: -120vh;
  width: 300px;
  color: rgba(235, 235, 235, .16);
  font-family: Consolas, "Courier New", monospace;
  font-size: 10px;
  line-height: 1.75;
  white-space: pre-wrap;
  will-change: transform;
  animation: codeDrift linear infinite;
  text-shadow: 0 0 12px rgba(255, 255, 255, .04);
}

.intro-active .code-column {
  color: rgba(235, 235, 235, .26);
}

.code-column.dim {
  color: rgba(235, 235, 235, .09);
}

.code-column.bright {
  color: rgba(245, 245, 245, .18);
}

.intro-active .code-column.dim {
  color: rgba(235, 235, 235, .18);
}

.intro-active .code-column.bright {
  color: rgba(245, 245, 245, .32);
}

@keyframes codeDrift {
  from {
    transform: translateY(0);
  }
  to {
    transform: translateY(170vh);
  }
}

.topbar {
  grid-column: 1 / -1;
  min-height: 88px;
  display: flex;
  justify-content: space-between;
  gap: 24px;
  align-items: center;
  padding: 18px 28px;
  border-bottom: 1px solid var(--line);
  background: rgba(10, 10, 10, .92);
  backdrop-filter: blur(16px);
}

.identity {
  display: flex;
  align-items: center;
  gap: 14px;
}

.mark {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border: 1px solid #d0d0d0;
  color: var(--ink);
  background: #121212;
  font-size: 18px;
}

.kicker {
  margin: 0 0 6px;
  color: var(--dim);
  font-size: 12px;
  line-height: 1;
  text-transform: uppercase;
}

h1,
h2,
h3 {
  margin: 0;
  font-weight: 600;
}

h1 {
  font-size: clamp(24px, 3vw, 34px);
  line-height: 1;
}

.status-strip {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.status-strip span {
  min-height: 30px;
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--line);
  color: var(--muted);
  background: #121212;
  padding: 0 10px;
  font-size: 12px;
  text-transform: uppercase;
}

.navigator {
  border-right: 1px solid var(--line);
  background: rgba(13, 13, 13, .96);
  padding: 22px 18px;
}

.search-label {
  display: block;
  margin-bottom: 8px;
  color: var(--dim);
  font-size: 12px;
  text-transform: uppercase;
}

.search {
  width: 100%;
  height: 42px;
  border: 1px solid var(--line);
  border-radius: 0;
  background: #0c0c0c;
  color: var(--text);
  outline: none;
  padding: 0 12px;
}

.search:focus {
  border-color: #cfcfcf;
}

.nav-list {
  display: grid;
  gap: 8px;
  margin-top: 18px;
}

.nav-button {
  width: 100%;
  display: grid;
  grid-template-columns: 30px 1fr;
  gap: 10px;
  align-items: center;
  min-height: 54px;
  border: 1px solid var(--line);
  background: #101010;
  color: var(--text);
  text-align: left;
  padding: 8px 10px;
  cursor: pointer;
}

.nav-button:hover,
.nav-button.active {
  border-color: #d6d6d6;
  background: #171717;
}

.nav-index {
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  border: 1px solid var(--line-2);
  color: var(--muted);
  font-size: 12px;
}

.nav-title {
  display: block;
  font-size: 14px;
}

.nav-meta {
  display: block;
  margin-top: 3px;
  color: var(--dim);
  font-size: 11px;
  text-transform: uppercase;
}

.workspace {
  padding: 24px;
  min-width: 0;
}

.sheet {
  min-height: calc(100vh - 136px);
  border: 1px solid var(--line);
  background: rgba(17, 17, 17, .86);
}

.sheet-header {
  display: grid;
  grid-template-columns: minmax(320px, 620px) minmax(260px, 1fr);
  gap: 24px;
  align-items: end;
  padding: 22px 24px;
  border-bottom: 1px solid var(--line);
}

.sheet-header h2 {
  font-size: clamp(26px, 4vw, 46px);
  line-height: .98;
  max-width: 680px;
}

.sheet-header p:last-child {
  margin: 0;
  color: var(--muted);
  line-height: 1.5;
}

.atlas-grid {
  display: grid;
  grid-template-columns: minmax(620px, 1fr) 360px;
  gap: 0;
  min-height: 690px;
}

.body-plate {
  position: relative;
  margin: 0;
  overflow: hidden;
  min-height: 690px;
  display: grid;
  place-items: center;
  padding: 36px;
  background:
    linear-gradient(90deg, rgba(255, 255, 255, .06) 1px, transparent 1px) 0 0 / 64px 64px,
    linear-gradient(0deg, rgba(255, 255, 255, .04) 1px, transparent 1px) 0 0 / 64px 64px,
    #202020;
}

.image-stage {
  position: relative;
  width: min(92%, 980px);
  aspect-ratio: 1536 / 1024;
}

.body-reference {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  filter: grayscale(1) contrast(1.03) brightness(.9);
  opacity: .88;
  user-select: none;
}

.marker-layer {
  position: absolute;
  inset: 0;
}

.map-marker {
  position: absolute;
  width: 18px;
  height: 18px;
  border: 1px solid rgba(255, 255, 255, .74);
  border-radius: 50%;
  background: rgba(8, 8, 8, .58);
  color: #f2f2f2;
  cursor: pointer;
  transform: translate(-50%, -50%);
  display: grid;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  box-shadow: none;
}

.map-marker:hover,
.map-marker.active {
  border-color: #d84b43;
  color: #ff6b61;
  background: rgba(120, 20, 18, .28);
  box-shadow: none;
}

.detail-panel {
  border-left: 1px solid var(--line);
  background: #101010;
  padding: 22px;
  min-height: 690px;
}

.detail-kicker {
  color: var(--dim);
  font-size: 12px;
  text-transform: uppercase;
  margin: 0 0 10px;
}

.detail-panel h3 {
  font-size: 30px;
  line-height: 1.05;
  margin-bottom: 16px;
}

.summary {
  margin: 0;
  color: var(--muted);
  line-height: 1.55;
}

.detail-gallery {
  margin: 0 0 18px;
}

.gallery-frame {
  position: relative;
  border: 1px solid var(--line);
  background: #0b0b0b;
  overflow: hidden;
  cursor: zoom-in;
}

.gallery-image {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 10;
  object-fit: cover;
  object-position: 50% 22%;
  filter: grayscale(1) contrast(1.04) brightness(.88);
}

.gallery-counter {
  position: absolute;
  right: 10px;
  bottom: 10px;
  min-width: 56px;
  height: 24px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, .26);
  background: rgba(0, 0, 0, .58);
  color: var(--muted);
  font-size: 11px;
}

.gallery-controls {
  display: grid;
  grid-template-columns: 34px 1fr 34px;
  gap: 10px;
  align-items: center;
  margin-top: 10px;
}

.gallery-controls button {
  height: 30px;
  border: 1px solid var(--line);
  background: #111111;
  color: var(--text);
  cursor: pointer;
}

.gallery-controls button:hover,
.gallery-dots button.active {
  border-color: #d6d6d6;
}

.gallery-dots {
  display: flex;
  justify-content: center;
  gap: 7px;
}

.gallery-dots button {
  width: 28px;
  height: 6px;
  padding: 0;
  border-color: var(--line-2);
  background: #1f1f1f;
}

.gallery-dots button.active {
  background: #d84b43;
}

.section-title {
  color: #f1f1f1;
  font-size: 12px;
  text-transform: uppercase;
  margin: 26px 0 10px;
  letter-spacing: 0;
}

.fact-list,
.source-list {
  display: grid;
  gap: 8px;
  padding: 0;
  margin: 0;
  list-style: none;
}

.fact-list li {
  border-left: 1px solid #8a8a8a;
  background: #151515;
  color: var(--muted);
  padding: 8px 0 8px 11px;
  line-height: 1.35;
}

.source-list li {
  color: var(--muted);
  line-height: 1.4;
}

.tag-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 20px;
}

.tag {
  border: 1px solid var(--line);
  color: var(--muted);
  padding: 5px 8px;
  font-size: 11px;
  text-transform: uppercase;
}

@media (max-width: 1180px) {
  .app-shell {
    grid-template-columns: 1fr;
  }

  .navigator {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .nav-list {
    grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  }

  .atlas-grid {
    grid-template-columns: 1fr;
  }

  .detail-panel {
    border-left: 0;
    border-top: 1px solid var(--line);
    min-height: auto;
  }
}

@media (max-width: 760px) {
  .topbar,
  .sheet-header {
    grid-template-columns: 1fr;
    display: grid;
  }

  .status-strip {
    justify-content: flex-start;
  }

  .workspace {
    padding: 12px;
  }

  .body-plate {
    min-height: 560px;
  }

  .image-stage {
    width: 100%;
  }
}
