@font-face {
  font-family: "Silkscreen";
  src: url("../assets/fonts/silkscreen.woff2") format("woff2");
  font-display: swap;
}

@font-face {
  font-family: "Nunito";
  src: url("../assets/fonts/nunito.woff2") format("woff2");
  font-weight: 700;
  font-display: swap;
}

:root {
  --bg: #060d18;
  --bg-soft: rgba(8, 18, 34, 0.78);
  --panel: rgba(9, 20, 36, 0.88);
  --border: rgba(123, 181, 255, 0.18);
  --border-strong: rgba(123, 181, 255, 0.34);
  --text: #eaf3ff;
  --muted: #94acc8;
  --accent: #7fd3ff;
  --accent-strong: #b4ecff;
  --warm: #ffd166;
  --shadow: 0 20px 60px rgba(0, 0, 0, 0.32);
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  background:
    radial-gradient(circle at top left, rgba(57, 104, 172, 0.2), transparent 35%),
    radial-gradient(circle at top right, rgba(11, 63, 97, 0.16), transparent 25%),
    linear-gradient(180deg, #08111f 0%, #040a12 100%);
  color: var(--text);
  font-family: "Nunito", system-ui, sans-serif;
}

body {
  overflow: hidden;
}

a {
  color: inherit;
}

button,
input {
  font: inherit;
}

#app {
  position: relative;
  min-height: 100vh;
}

.stage {
  position: fixed;
  inset: 0;
}

.stage canvas {
  display: block;
}

.loading {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: grid;
  place-items: center;
  gap: 0.9rem;
  padding: 1.5rem;
  background:
    radial-gradient(circle at center, rgba(25, 56, 96, 0.24), transparent 30%),
    linear-gradient(135deg, rgba(0, 0, 0, 0.16), transparent 40%),
    rgba(4, 10, 18, 0.96);
  text-align: center;
  transition: opacity 220ms ease;
}

.loading.is-hidden {
  opacity: 0;
  pointer-events: none;
}

.loading__eyebrow,
.eyebrow,
.inspector__eyebrow {
  margin: 0;
  color: var(--warm);
  font-family: "Silkscreen", monospace;
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.loading__brand {
  display: grid;
  justify-items: center;
  gap: 0.7rem;
}

.loading__title {
  display: grid;
  gap: 0.8rem;
  margin: 0;
  line-height: 0.92;
}

.loading__title-main,
.loading__title-accent {
  display: block;
}

.loading__title-main {
  font-size: clamp(2.4rem, 6vw, 4.8rem);
  font-family: "Nunito", system-ui, sans-serif;
  letter-spacing: 0.03em;
  text-shadow: 0 0 18px rgba(127, 211, 255, 0.22);
}

.loading__title-accent {
  font-size: clamp(1.1rem, 3.1vw, 2rem);
  font-family: "Nunito", system-ui, sans-serif;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: #ffd166;
  transform: rotate(-2deg);
  text-shadow: -0.12em -0.08em 0 rgba(0, 0, 0, 0.78), 0.14em 0.08em 0 rgba(209, 31, 59, 0.82);
}

.loading__tagline {
  margin: 0.9rem 0 0;
  max-width: 28rem;
  color: #d9e7f8;
  font-size: 0.98rem;
}

.loading__status {
  margin: 0;
  color: var(--muted);
  font-size: 0.96rem;
}

.search-shell,
.inspector,
.tooltip {
  position: fixed;
  z-index: 20;
}

.search-shell,
.inspector {
  backdrop-filter: blur(20px);
}

.search-shell {
  top: 1.2rem;
  right: 1.2rem;
  width: min(18rem, calc(100vw - 2.4rem));
  padding: 0.7rem;
  border: 1px solid var(--border);
  border-radius: 1rem;
  background: var(--panel);
  box-shadow: var(--shadow);
  overflow: visible;
  transition: opacity 220ms ease, transform 220ms ease;
}

.search-shell.is-hidden {
  opacity: 0;
  pointer-events: none;
  transform: translateY(-10px);
}

.search-shell__close {
  position: absolute;
  top: -0.72rem;
  right: -0.72rem;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2.2rem;
  height: 2.2rem;
  border: 1px solid rgba(127, 211, 255, 0.26);
  border-radius: 999px;
  background: rgba(7, 16, 30, 0.96);
  color: var(--accent-strong);
  font-size: 1.2rem;
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.22);
  transition: background 140ms ease, border-color 140ms ease, transform 140ms ease, color 140ms ease;
}

.search-shell__close:hover,
.search-shell__close:focus-visible {
  border-color: var(--border-strong);
  background: rgba(13, 25, 43, 1);
  color: #ffffff;
  transform: translateY(-1px);
}

.search-input {
  width: 100%;
  padding: 0.75rem 2.6rem 0.75rem 0.9rem;
  border: 1px solid transparent;
  border-radius: 0.9rem;
  background: rgba(4, 10, 18, 0.9);
  color: var(--text);
  outline: none;
}

.search-input:focus {
  border-color: var(--border-strong);
}

.search-input::-webkit-search-decoration,
.search-input::-webkit-search-cancel-button,
.search-input::-webkit-search-results-button,
.search-input::-webkit-search-results-decoration {
  appearance: none;
  display: none;
}

.search-results {
  display: none;
  margin-top: 0.6rem;
  max-height: 22rem;
  overflow: auto;
}

.search-results.is-open {
  display: grid;
}

.search-result {
  padding: 0.8rem 0.85rem;
  border: 1px solid rgba(127, 211, 255, 0.1);
  border-radius: 0.95rem;
  background: rgba(12, 24, 43, 0.74);
  color: inherit;
  text-align: left;
  cursor: pointer;
}

.search-result + .search-result {
  margin-top: 0.45rem;
}

.search-result:hover,
.search-result:focus-visible {
  border-color: var(--border-strong);
  background: rgba(16, 30, 52, 0.96);
}

.search-result__title {
  display: block;
  font-size: 0.95rem;
  color: var(--text);
}

.search-result__meta {
  display: block;
  margin-top: 0.15rem;
  color: var(--muted);
  font-size: 0.78rem;
}

.article-link,
.neighbor-list button {
  border: 1px solid var(--border);
  border-radius: 999px;
  background: rgba(8, 18, 34, 0.82);
  color: var(--text);
  cursor: pointer;
  transition: border-color 140ms ease, transform 140ms ease, background 140ms ease;
}

.article-link:hover,
.neighbor-list button:hover {
  border-color: var(--border-strong);
  transform: translateY(-1px);
}

.tooltip {
  display: none;
  min-width: 12rem;
  max-width: 18rem;
  padding: 0.8rem 0.9rem;
  border: 1px solid var(--border);
  border-radius: 0.95rem;
  background: rgba(8, 18, 34, 0.94);
  color: var(--text);
  pointer-events: none;
  box-shadow: var(--shadow);
}

.tooltip.is-visible {
  display: block;
}

.tooltip__title {
  display: block;
  font-size: 0.9rem;
}

.tooltip__meta {
  display: block;
  margin-top: 0.2rem;
  color: var(--muted);
  font-size: 0.75rem;
}

.inspector {
  top: 1.2rem;
  bottom: 1.2rem;
  right: 1.2rem;
  width: min(24rem, calc(100vw - 2.4rem));
  padding: 1.15rem;
  border: 1px solid var(--border);
  border-radius: 1.35rem;
  background: linear-gradient(180deg, rgba(9, 20, 36, 0.96), rgba(9, 20, 36, 0.82));
  box-shadow: var(--shadow);
  transform: translateX(calc(100% + 1.2rem));
  transition: transform 180ms ease;
  overflow: auto;
}

.inspector.is-open {
  transform: translateX(0);
}

.inspector__close {
  position: absolute;
  top: 0.8rem;
  right: 0.85rem;
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: 1.5rem;
  cursor: pointer;
}

.inspector__title {
  margin: 0.4rem 2rem 0 0;
  font-size: clamp(1.5rem, 2vw, 2rem);
  line-height: 1;
}

.inspector__tagline {
  margin: 0.55rem 0 0;
  color: var(--muted);
  line-height: 1.4;
}

.article-preview {
  margin: 1rem 0 0;
  border: 1px solid rgba(127, 211, 255, 0.12);
  border-radius: 1rem;
  overflow: hidden;
  background: rgba(5, 12, 23, 0.72);
}

.article-preview__image {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  object-position: center 18%;
}

.article-summary {
  margin-top: 0.9rem;
  padding: 0.95rem;
  border: 1px solid rgba(127, 211, 255, 0.1);
  border-radius: 1rem;
  background: rgba(5, 12, 23, 0.72);
}

.article-summary__state,
.article-summary__description,
.article-summary__extract {
  margin: 0;
}

.article-summary__state {
  color: var(--muted);
  font-size: 0.88rem;
  line-height: 1.5;
}

.article-summary__description {
  color: var(--warm);
  font-family: "Silkscreen", monospace;
  font-size: 0.72rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.article-summary__extract {
  margin-top: 0.55rem;
  color: var(--text);
  font-size: 0.9rem;
  line-height: 1.55;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.75rem;
  margin: 1.2rem 0;
}

.stats-grid__item {
  padding: 0.85rem;
  border: 1px solid rgba(127, 211, 255, 0.1);
  border-radius: 1rem;
  background: rgba(5, 12, 23, 0.72);
}

.stats-grid__item dt {
  color: var(--muted);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.stats-grid__item dd {
  margin: 0.35rem 0 0;
  font-size: 1.1rem;
  color: var(--accent-strong);
}

.article-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  padding: 0.9rem 1rem;
  text-decoration: none;
}

.neighbors {
  margin-top: 1.1rem;
}

.neighbors__header h3,
.neighbors__header p {
  margin: 0;
}

.neighbors__header h3 {
  font-size: 1rem;
}

.neighbors__header p {
  margin-top: 0.2rem;
  color: var(--muted);
  font-size: 0.82rem;
}

.neighbor-list {
  display: grid;
  gap: 0.55rem;
  margin-top: 0.75rem;
}

.neighbor-list button {
  width: 100%;
  padding: 0.8rem 0.85rem;
  text-align: left;
}

.neighbor-list__title {
  display: block;
  color: var(--text);
}

.neighbor-list__meta {
  display: block;
  margin-top: 0.2rem;
  color: var(--muted);
  font-size: 0.76rem;
}

@media (max-width: 900px) {
}

@media (max-width: 720px) {
  .search-shell {
    top: auto;
    bottom: 1.2rem;
    width: calc(100vw - 2.4rem);
  }

  .inspector {
    top: auto;
    left: 1.2rem;
    right: 1.2rem;
    bottom: 4.8rem;
    width: auto;
    max-height: 62vh;
    transform: translateY(calc(100% + 1.2rem));
  }

  .inspector.is-open {
    transform: translateY(0);
  }
}

.music-btn {
  position: fixed;
  top: 18px;
  left: 18px;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(9, 20, 36, 0.88);
  border: 1px solid rgba(123, 181, 255, 0.18);
  border-radius: 8px;
  padding: 10px 16px;
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
  color: var(--text);
  opacity: 0;
  pointer-events: none;
  transition: opacity 2s ease, background 0.2s;
}

.music-btn:hover {
  background: var(--bg-soft);
  border-color: var(--border-strong);
}

.skyline-btn {
  position: fixed;
  top: 18px;
  left: 72px;
  z-index: 40;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px 16px;
  font-size: 28px;
  line-height: 1;
  cursor: pointer;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.4s ease, background 0.2s;
}

.skyline-btn.is-visible {
  pointer-events: auto;
  opacity: 1;
}

.skyline-btn:hover {
  background: var(--bg-soft);
  border-color: var(--border-strong);
}

.info-btn {
  position: fixed;
  bottom: 18px;
  right: 18px;
  z-index: 50;
  width: 36px;
  height: 36px;
  border: none;
  border-radius: 50%;
  background: #000;
  color: #fff;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 18px;
  font-style: italic;
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
  transition: background 140ms ease, transform 140ms ease;
}

.info-btn:hover {
  background: #222;
  transform: scale(1.08);
}

.info-popup {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(8px);
  transition: opacity 180ms ease;
}

.info-popup[hidden] {
  display: none;
}

.info-popup__content {
  position: relative;
  width: min(28rem, calc(100vw - 3rem));
  max-height: 80vh;
  overflow: auto;
  padding: 1.8rem;
  border: 1px solid var(--border);
  border-radius: 1.2rem;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.info-popup__close {
  position: absolute;
  top: 0.8rem;
  right: 0.85rem;
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: 1.5rem;
  cursor: pointer;
}

.info-popup__title {
  margin: 0 2rem 0.8rem 0;
  font-size: 1.3rem;
}

.info-popup__content h3 {
  margin: 1rem 0 0.3rem;
  font-size: 0.95rem;
  color: var(--accent);
}

.info-popup__content p {
  margin: 0;
  font-size: 0.9rem;
  line-height: 1.55;
  color: var(--text);
}

.info-popup__content ul {
  margin: 0.3rem 0 0;
  padding-left: 1.2rem;
  font-size: 0.9rem;
  line-height: 1.6;
}

.info-popup__content a {
  color: var(--accent);
}

.space-hint {
  position: fixed;
  bottom: 64px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 50;
  padding: 0.6rem 1.2rem;
  border-radius: 0.7rem;
  background: rgba(0, 0, 0, 0.72);
  color: var(--muted);
  font-size: 0.85rem;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.5s ease;
}

.space-hint.is-visible {
  opacity: 1;
}
