:root {
  color-scheme: dark;
  --bg: #02070d;
  --bg-2: #05121d;
  --panel: rgba(4, 19, 30, 0.78);
  --panel-strong: rgba(7, 29, 45, 0.92);
  --text: #eefbff;
  --muted: #9cb9c7;
  --cyan: #2ce8ff;
  --cyan-soft: #8defff;
  --blue: #2a8dff;
  --tile-size: clamp(96px, 29vw, 178px);
  --tile-height: calc(var(--tile-size) * 0.875);
  --tile-gap: 10px;
  --fade-out-duration: 220ms;
  --stage-padding: 24px;
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
}

* {
  box-sizing: border-box;
}

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

body {
  min-width: 320px;
  overflow: hidden;
  background:
    radial-gradient(circle at 50% 50%, rgba(44, 232, 255, 0.16), transparent 28rem),
    radial-gradient(circle at 50% 115%, rgba(42, 141, 255, 0.13), transparent 34rem),
    linear-gradient(135deg, var(--bg), var(--bg-2) 46%, #010409);
  color: var(--text);
}

body.has-overlay {
  overflow: hidden;
}

button {
  font: inherit;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.site-shell {
  min-height: 100svh;
}

.map-stage {
  position: relative;
  width: 100vw;
  height: 100svh;
  min-height: 560px;
  overflow: hidden;
  isolation: isolate;
}

.ambient-grid,
.ambient-grid::before,
.ambient-grid::after {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.ambient-grid {
  opacity: 0.72;
  background-image:
    linear-gradient(rgba(44, 232, 255, 0.048) 1px, transparent 1px),
    linear-gradient(90deg, rgba(44, 232, 255, 0.048) 1px, transparent 1px);
  background-size: 42px 42px;
  mask-image: radial-gradient(circle at center, black 0, black 42%, transparent 76%);
}

.ambient-grid::before {
  content: "";
  background:
    linear-gradient(90deg, transparent 7%, rgba(44, 232, 255, 0.18) 7.2%, transparent 7.4%) 0 12% / 100% 1px no-repeat,
    linear-gradient(90deg, transparent 0 20%, rgba(44, 232, 255, 0.14) 20.2%, transparent 20.4% 100%) 0 78% / 100% 1px no-repeat,
    linear-gradient(0deg, transparent 0 18%, rgba(44, 232, 255, 0.13) 18.2%, transparent 18.4% 100%) 86% 0 / 1px 100% no-repeat,
    linear-gradient(0deg, transparent 0 38%, rgba(44, 232, 255, 0.14) 38.2%, transparent 38.4% 100%) 14% 0 / 1px 100% no-repeat;
}

.ambient-grid::after {
  content: "";
  inset: var(--stage-padding);
  border: 1px solid rgba(44, 232, 255, 0.12);
  box-shadow: inset 0 0 36px rgba(44, 232, 255, 0.05);
}

.hex,
.logo-tile {
  position: absolute;
  left: 50%;
  top: 50%;
  width: var(--tile-size);
  height: var(--tile-height);
  display: grid;
  place-items: center;
  color: var(--text);
  transform: translate(calc(-50% + var(--x, 0px)), calc(-50% + var(--y, 0px))) scale(1);
  opacity: 0;
  z-index: 3;
  transition:
    opacity 180ms ease,
    filter 180ms ease,
    transform 180ms ease;
}

.hex {
  padding: 0;
  background: transparent;
  border: 0;
  cursor: pointer;
  text-decoration: none;
  clip-path: polygon(25% 0, 75% 0, 100% 50%, 75% 100%, 25% 100%, 0 50%);
  pointer-events: auto;
}

.subhex[data-action="none"] {
  cursor: default;
}

.hex::before,
.hex::after {
  content: "";
  position: absolute;
  inset: 0;
  clip-path: inherit;
  transition:
    background 180ms ease,
    box-shadow 180ms ease,
    inset 180ms ease,
    opacity 180ms ease;
}

.hex::before {
  background:
    linear-gradient(120deg, transparent 0 10%, var(--cyan-soft) 11% 15%, transparent 16% 72%, var(--cyan) 73% 77%, transparent 78%),
    linear-gradient(180deg, rgba(44, 232, 255, 0.92), rgba(42, 141, 255, 0.46));
  box-shadow:
    0 0 16px rgba(44, 232, 255, 0.42),
    inset 0 0 18px rgba(44, 232, 255, 0.25);
}

.hex::after {
  inset: 2px;
  background:
    radial-gradient(circle at 50% 44%, rgba(44, 232, 255, 0.12), transparent 58%),
    linear-gradient(135deg, rgba(3, 19, 30, 0.96), rgba(1, 9, 15, 0.94));
}

.hex-content {
  position: relative;
  z-index: 1;
  display: grid;
  place-items: center;
  width: 72%;
  gap: 8px;
  text-align: center;
}

.logo-tile .hex-content {
  width: 100%;
  height: 100%;
  gap: 0;
  opacity: 0;
  animation: fluorescent-logo-on 780ms linear forwards;
}

.hex-icon {
  width: clamp(30px, 6.5vw, 54px);
  height: clamp(30px, 6.5vw, 54px);
  color: #d9fbff;
  filter: drop-shadow(0 0 7px rgba(141, 239, 255, 0.44));
  transition:
    color 160ms ease,
    filter 160ms ease,
    transform 160ms ease;
}

.hex-icon * {
  fill: none;
  stroke: currentColor;
  stroke-width: 3;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.text-icon text {
  fill: currentColor;
  stroke: none;
  font-size: 31px;
  font-weight: 760;
  dominant-baseline: middle;
}

.hex-title {
  max-width: 100%;
  color: var(--text);
  font-size: clamp(0.62rem, 1.08vw, 0.9rem);
  font-weight: 650;
  letter-spacing: 0;
  line-height: 1.28;
  text-transform: uppercase;
  text-wrap: balance;
}

.hex-title::after {
  content: "";
  display: block;
  width: 34px;
  height: 2px;
  margin: 7px auto 0;
  background: var(--cyan);
  box-shadow: 0 0 9px rgba(44, 232, 255, 0.9);
  transform: scaleX(0.72);
  transition: transform 180ms ease, box-shadow 180ms ease;
}

.hex:hover,
.hex:focus-visible {
  transform: translate(calc(-50% + var(--x, 0px)), calc(-50% + var(--y, 0px))) scale(1.055);
  filter: drop-shadow(0 0 14px rgba(44, 232, 255, 0.38));
}

.hex.is-selected {
  filter: drop-shadow(0 0 14px rgba(44, 232, 255, 0.38));
}

.hex:hover::before,
.hex:focus-visible::before,
.hex.is-selected::before {
  background:
    linear-gradient(120deg, transparent 0 8%, #ffffff 9% 13%, transparent 14% 70%, var(--cyan-soft) 71% 78%, transparent 79%),
    linear-gradient(180deg, rgba(141, 239, 255, 1), rgba(44, 232, 255, 0.75));
  box-shadow:
    0 0 22px rgba(44, 232, 255, 0.72),
    inset 0 0 28px rgba(44, 232, 255, 0.42);
  animation: hover-charge 680ms linear infinite;
}

.hex:hover::after,
.hex:focus-visible::after,
.hex.is-selected::after {
  background:
    radial-gradient(circle at 50% 44%, rgba(44, 232, 255, 0.22), transparent 58%),
    linear-gradient(135deg, rgba(5, 31, 48, 0.98), rgba(1, 10, 17, 0.95));
}

.hex:hover .hex-icon,
.hex:focus-visible .hex-icon,
.hex.is-selected .hex-icon {
  color: var(--cyan-soft);
  animation: icon-hover 520ms ease-in-out infinite alternate;
  filter: drop-shadow(0 0 12px rgba(141, 239, 255, 0.78));
}

.hex:hover .hex-title::after,
.hex:focus-visible .hex-title::after,
.hex.is-selected .hex-title::after {
  transform: scaleX(1);
  box-shadow: 0 0 14px rgba(141, 239, 255, 0.95);
}

.hex:focus-visible {
  outline: 2px solid var(--cyan-soft);
  outline-offset: 8px;
}

.logo-tile {
  z-index: 4;
  clip-path: none;
  opacity: 1;
  transform: translate(calc(-50% + var(--x, 0px)), calc(-50% + var(--y, 0px))) scale(1);
  animation: center-pulse 3.4s ease-in-out 620ms infinite;
}

.logo-mark {
  width: 100%;
  height: 100%;
  object-fit: contain;
  filter:
    drop-shadow(0 0 20px rgba(44, 232, 255, 0.52))
    saturate(1.16);
}

.logo-mark.is-missing {
  display: none;
}

.logo-fallback {
  display: none;
  font-size: clamp(1rem, 2vw, 1.55rem);
  font-weight: 780;
  letter-spacing: 0;
  padding: 0 12px;
  text-align: center;
}

.logo-mark.is-missing + .logo-fallback {
  display: inline-block;
}

.node-layer {
  position: absolute;
  inset: 0;
  z-index: 3;
  pointer-events: none;
}

.subnode-layer {
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
}

.mainhex {
  animation: fluorescent-tile-on 760ms linear forwards;
}

.subhex {
  z-index: 2;
  animation: fluorescent-subtile-on 620ms linear forwards;
}

.backhex::before {
  background:
    linear-gradient(120deg, transparent 0 10%, var(--cyan-soft) 11% 15%, transparent 16% 72%, var(--cyan) 73% 77%, transparent 78%),
    linear-gradient(180deg, rgba(141, 239, 255, 0.88), rgba(42, 141, 255, 0.62));
}

.hex.is-exiting {
  pointer-events: none;
  animation: node-fade-out var(--fade-out-duration) ease forwards !important;
}

.map-stage.is-mobile-subview .logo-tile,
.map-stage.is-mobile-subview .mainhex {
  opacity: 0 !important;
  pointer-events: none;
  animation: none !important;
  filter: brightness(0.35);
}

.content-overlay {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: grid;
  place-items: center;
  padding: clamp(18px, 4vw, 44px);
  background:
    radial-gradient(circle at 50% 42%, rgba(44, 232, 255, 0.12), transparent 32rem),
    rgba(1, 5, 9, 0.82);
  backdrop-filter: blur(10px);
}

.content-overlay[hidden] {
  display: none;
}

.content-panel {
  position: relative;
  width: min(1040px, 94vw);
  min-height: min(620px, 82vh);
  padding: clamp(26px, 4vw, 56px);
  color: var(--text);
  background:
    linear-gradient(135deg, rgba(4, 19, 30, 0.97), rgba(1, 8, 14, 0.95)),
    repeating-linear-gradient(90deg, rgba(44, 232, 255, 0.06) 0 1px, transparent 1px 28px);
  border: 1px solid rgba(44, 232, 255, 0.48);
  box-shadow:
    0 0 34px rgba(44, 232, 255, 0.22),
    inset 0 0 38px rgba(44, 232, 255, 0.08);
  clip-path: polygon(3% 0, 97% 0, 100% 5%, 100% 95%, 97% 100%, 3% 100%, 0 95%, 0 5%);
}

.content-panel h2 {
  margin: 0 0 24px;
  font-size: clamp(2.1rem, 5vw, 4.8rem);
  line-height: 0.98;
  text-transform: uppercase;
}

.content-panel p {
  max-width: 74ch;
  margin: 0;
  color: var(--muted);
  font-size: clamp(1rem, 1.5vw, 1.28rem);
  line-height: 1.7;
}

.content-link {
  display: inline-grid;
  place-items: center;
  min-height: 40px;
  margin: 0 0 22px;
  padding: 0 16px;
  color: var(--cyan-soft);
  border: 1px solid rgba(44, 232, 255, 0.58);
  background: rgba(2, 15, 25, 0.82);
  text-decoration: none;
  text-transform: uppercase;
  font-size: 0.74rem;
  font-weight: 760;
  letter-spacing: 0;
  box-shadow:
    0 0 16px rgba(44, 232, 255, 0.18),
    inset 0 0 20px rgba(44, 232, 255, 0.06);
  cursor: pointer;
  clip-path: polygon(8px 0, 100% 0, 100% calc(100% - 8px), calc(100% - 8px) 100%, 0 100%, 0 8px);
  transition:
    border-color 160ms ease,
    box-shadow 160ms ease,
    transform 160ms ease;
}

.content-link:hover,
.content-link:focus-visible {
  border-color: rgba(141, 239, 255, 0.92);
  box-shadow:
    0 0 22px rgba(44, 232, 255, 0.34),
    inset 0 0 24px rgba(44, 232, 255, 0.1);
  transform: translateY(-1px);
}

.content-link[hidden] {
  display: none;
}

.content-close {
  position: absolute;
  top: 18px;
  right: 18px;
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  padding: 0;
  color: var(--cyan-soft);
  background: rgba(2, 13, 22, 0.9);
  border: 1px solid rgba(44, 232, 255, 0.56);
  cursor: pointer;
  text-transform: uppercase;
  box-shadow: 0 0 14px rgba(44, 232, 255, 0.18);
}

.panel-kicker {
  display: block;
  margin-bottom: 4px;
  color: var(--muted);
  font-size: 0.66rem;
  letter-spacing: 0;
  text-transform: uppercase;
}

@keyframes fluorescent-tile-on {
  0% {
    opacity: 0;
    filter: brightness(0.12) saturate(0.5);
  }

  7% {
    opacity: 1;
    filter: brightness(1.55) saturate(1.25);
  }

  10% {
    opacity: 0.06;
    filter: brightness(0.24) saturate(0.7);
  }

  15% {
    opacity: 1;
    filter: brightness(1.35) saturate(1.16);
  }

  19% {
    opacity: 0;
    filter: brightness(0.14) saturate(0.55);
  }

  26% {
    opacity: 0.72;
    filter: brightness(0.92) saturate(1);
  }

  31% {
    opacity: 0.14;
    filter: brightness(0.32) saturate(0.8);
  }

  39% {
    opacity: 1;
    filter: brightness(1.46) saturate(1.25);
  }

  45% {
    opacity: 0.38;
    filter: brightness(0.52) saturate(0.86);
  }

  53% {
    opacity: 1;
    filter: brightness(1.16) saturate(1.08);
  }

  62% {
    opacity: 0.8;
    filter: brightness(0.88) saturate(1);
  }

  100% {
    opacity: 1;
    filter: brightness(1) saturate(1);
  }
}

@keyframes fluorescent-subtile-on {
  0% {
    opacity: 0;
    filter: brightness(0.1) saturate(0.55);
  }

  9% {
    opacity: 1;
    filter: brightness(1.7) saturate(1.3);
  }

  13% {
    opacity: 0.08;
    filter: brightness(0.22) saturate(0.7);
  }

  21% {
    opacity: 1;
    filter: brightness(1.28) saturate(1.15);
  }

  27% {
    opacity: 0;
    filter: brightness(0.12) saturate(0.55);
  }

  37% {
    opacity: 0.84;
    filter: brightness(1) saturate(1);
  }

  44% {
    opacity: 0.2;
    filter: brightness(0.35) saturate(0.78);
  }

  56% {
    opacity: 1;
    filter: brightness(1.22) saturate(1.1);
  }

  70% {
    opacity: 0.88;
    filter: brightness(0.9) saturate(1);
  }

  100% {
    opacity: 1;
    filter: brightness(1) saturate(1);
  }
}

@keyframes fluorescent-logo-on {
  0% {
    opacity: 0;
    filter: brightness(0.18) saturate(0.55);
  }

  8% {
    opacity: 1;
    filter: brightness(1.5) saturate(1.25);
  }

  12% {
    opacity: 0.12;
    filter: brightness(0.28) saturate(0.75);
  }

  18% {
    opacity: 1;
    filter: brightness(1.24) saturate(1.12);
  }

  23% {
    opacity: 0;
    filter: brightness(0.12) saturate(0.55);
  }

  34% {
    opacity: 0.9;
    filter: brightness(1.08) saturate(1);
  }

  41% {
    opacity: 0.26;
    filter: brightness(0.42) saturate(0.8);
  }

  52% {
    opacity: 1;
    filter: brightness(1.18) saturate(1.08);
  }

  64% {
    opacity: 0.78;
    filter: brightness(0.86) saturate(1);
  }

  100% {
    opacity: 1;
    filter: brightness(1) saturate(1);
  }
}

@keyframes node-fade-out {
  from {
    opacity: 1;
    filter: brightness(1) saturate(1);
  }

  to {
    opacity: 0;
    filter: brightness(0.35) saturate(0.75);
  }
}

@keyframes hover-charge {
  0%,
  100% {
    opacity: 1;
  }

  45% {
    opacity: 0.94;
  }

  50% {
    opacity: 1;
  }
}

@keyframes icon-hover {
  from {
    transform: translateY(-2px) scale(1);
  }

  to {
    transform: translateY(-4px) scale(1.07);
  }
}

@keyframes center-pulse {
  0%,
  100% {
    filter: drop-shadow(0 0 13px rgba(44, 232, 255, 0.28));
  }

  50% {
    filter: drop-shadow(0 0 23px rgba(44, 232, 255, 0.48));
  }
}

@media (max-width: 920px), (max-height: 650px) {
  .map-stage {
    min-height: 520px;
  }

  .ambient-grid::after {
    inset: 14px;
  }

  .hex,
  .logo-tile,
  .hex:hover,
  .hex:focus-visible,
  .hex.is-selected {
    position: absolute;
  }

  .hex:hover,
  .hex:focus-visible {
    transform: translate(calc(-50% + var(--x, 0px)), calc(-50% + var(--y, 0px))) scale(1.045);
  }

}

@media (max-width: 440px) {
  :root {
    --tile-size: clamp(88px, 29vw, 112px);
  }
}

@media (max-width: 640px) {
  body {
    overflow: auto;
  }

  .map-stage {
    overflow: hidden;
  }

  .map-stage.is-mobile-subview .subnode-layer {
    z-index: 5;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }

  .logo-tile {
    animation: none !important;
  }
}
