@font-face {
  font-family: "Cascadia Mono";
  src: url("../fonts/cascadia-mono.8b9612873c7c.woff2") format("woff2");
  font-style: normal;
  font-weight: 200 700;
  font-display: swap;
}

:root {
  --nd-cyan: #20e3ff;
  --nd-magenta: #ff2d9f;
  --nd-green: #39ff88;
  --nd-amber: #ffd166;
  --nd-ink: #d8ffea;
  --nd-black: #010504;
  --nd-glow-low: 0 0 8px;
  --nd-glow-mid: 0 0 18px;
  --nd-glow-high: 0 0 36px;
  --nd-fast: 180ms;
  --nd-medium: 520ms;
  --nd-slow: 7s;
  --nd-safe-bottom: env(safe-area-inset-bottom, 0px);
}

html {
  background: var(--nd-black);
}

body {
  background-color: var(--nd-black);
  background-image:
    linear-gradient(rgba(0, 10, 8, .36), rgba(0, 4, 3, .84)),
    url("../img/neon-dominion-texture.246e55b6c3f1.webp");
  background-attachment: fixed;
  background-size: auto, 768px 768px;
}

h1, h2, h3, h4, h5, h6,
.brand, .button, button, input, select, textarea,
.eyebrow, .map-status, .battle-type, .patrol-readout,
.mobile-tabbar, code, pre, kbd, .nd-mono {
  font-family: "Cascadia Mono", "Cascadia Code", ui-monospace, Consolas, monospace;
}

.site-header, main, .messages, .site-footer {
  position: relative;
  z-index: 4;
}

.mobile-tabbar { z-index: 500; }

.site-header {
  z-index: 600;
  isolation: isolate;
  overflow: visible;
}

.site-header::before {
  content: "";
  position: absolute;
  z-index: -1;
  inset: 0;
  opacity: .68;
  background:
    radial-gradient(circle at 14% 120%, rgba(32, 227, 255, .26), transparent 34%),
    radial-gradient(circle at 74% 130%, rgba(255, 45, 159, .2), transparent 38%),
    linear-gradient(110deg, transparent 22%, rgba(57, 255, 136, .07) 48%, transparent 72%);
  animation: nd-header-scan 8s ease-in-out infinite alternate;
}

.site-header::after {
  content: "";
  position: absolute;
  right: 0;
  bottom: -1px;
  left: 0;
  height: 2px;
  opacity: .88;
  background: linear-gradient(90deg, transparent 0 4%, var(--nd-cyan) 19%, transparent 38%, var(--nd-magenta) 56%, transparent 72%, var(--nd-green) 88%, transparent);
  background-size: 180% 100%;
  animation: nd-line-run 4.8s linear infinite;
}

.brand img {
  filter: drop-shadow(0 0 7px rgba(32, 227, 255, .7));
  animation: nd-mark-breathe 3.6s ease-in-out infinite;
}

.brand b {
  text-shadow: var(--nd-glow-low) rgba(32, 227, 255, .72);
}

.site-header nav a, .mobile-tabbar a, .button, button {
  transition:
    color var(--nd-fast) ease,
    border-color var(--nd-fast) ease,
    background-color var(--nd-fast) ease,
    box-shadow var(--nd-fast) ease,
    transform var(--nd-fast) ease;
}

.site-header nav a:hover,
.site-header nav a:focus-visible,
.mobile-tabbar a:hover,
.mobile-tabbar a:focus-visible {
  text-shadow: var(--nd-glow-mid) currentColor;
}

.button:hover, button:hover {
  transform: translateY(-1px);
}

.button:active, button:active {
  transform: translateY(1px);
}

.panel, .formula-card, .gear-card, .rank-card, .battle-card {
  isolation: isolate;
  background-image:
    radial-gradient(circle at var(--nd-spot-x, 50%) var(--nd-spot-y, 50%), rgba(32, 227, 255, .095), transparent 34%),
    linear-gradient(145deg, rgba(0, 30, 25, .3), transparent 44%);
  transition: border-color var(--nd-medium) ease, box-shadow var(--nd-medium) ease;
}

.panel:hover, .formula-card:hover, .gear-card:hover,
.rank-card:hover, .battle-card:hover {
  border-color: rgba(32, 227, 255, .7);
  box-shadow: 0 0 0 1px rgba(32, 227, 255, .08), 0 0 28px rgba(32, 227, 255, .08);
}

.nd-spectacle {
  position: fixed;
  z-index: 2;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
  contain: strict;
}

.nd-field {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: .64;
  mix-blend-mode: screen;
}

.nd-aurora {
  position: absolute;
  inset: -24% -16% 24%;
  opacity: .17;
  filter: blur(42px) saturate(135%);
  background:
    radial-gradient(ellipse at 18% 40%, rgba(32, 227, 255, .65), transparent 42%),
    radial-gradient(ellipse at 58% 20%, rgba(255, 45, 159, .55), transparent 40%),
    radial-gradient(ellipse at 86% 46%, rgba(57, 255, 136, .55), transparent 38%);
  transform-origin: 50% 0;
  animation: nd-aurora-drift var(--nd-slow) ease-in-out infinite alternate;
}

.nd-scanline {
  position: absolute;
  right: 0;
  left: 0;
  height: 16vh;
  opacity: .08;
  background: linear-gradient(180deg, transparent, rgba(32, 227, 255, .6), transparent);
  animation: nd-scan-travel 9s linear infinite;
}

.nd-spectrum-ticker {
  position: absolute;
  z-index: 1;
  right: .75rem;
  bottom: 1px;
  left: .75rem;
  height: 12px;
  overflow: hidden;
  color: rgba(32, 227, 255, .48);
  font: 600 8px/12px "Cascadia Mono", monospace;
  letter-spacing: .18em;
  text-transform: uppercase;
  white-space: nowrap;
  pointer-events: none;
  mask-image: linear-gradient(90deg, transparent, #000 10%, #000 90%, transparent);
}

.nd-spectrum-ticker span {
  display: inline-block;
  min-width: 200%;
  animation: nd-ticker 24s linear infinite;
}

.nd-sound-toggle {
  min-width: 44px;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .3rem;
  padding: .35rem .55rem;
  border: 1px solid rgba(32, 227, 255, .45);
  color: var(--nd-cyan);
  background: rgba(0, 8, 6, .92);
  font-size: .64rem;
  letter-spacing: .04em;
  white-space: nowrap;
}

.nd-sound-toggle[data-enabled="true"] {
  border-color: var(--nd-green);
  color: var(--nd-green);
  box-shadow: 0 0 13px rgba(57, 255, 136, .18);
}

.nd-sound-toggle .nd-sound-state {
  color: inherit;
}

.nd-entrance {
  position: fixed;
  z-index: 2000;
  inset: 0;
  display: grid;
  place-items: center;
  overflow: hidden;
  color: var(--nd-ink);
  background:
    linear-gradient(rgba(0, 5, 4, .1), rgba(0, 5, 4, .66)),
    url("../img/neon-dominion-launch-portrait.e1684d169f3f.webp") center 45% / cover no-repeat,
    #000;
  opacity: 1;
  transition: opacity 320ms ease, visibility 320ms step-end;
}

.nd-entrance::before {
  content: "";
  position: absolute;
  inset: 0;
  opacity: .18;
  background: repeating-linear-gradient(0deg, rgba(255, 255, 255, .1) 0 1px, transparent 1px 4px);
  animation: nd-intro-degauss 2.4s ease-out both;
}

.nd-entrance[data-closing="true"] {
  visibility: hidden;
  opacity: 0;
}

.nd-entrance-console {
  position: relative;
  width: min(580px, calc(100% - 2rem));
  padding: clamp(1rem, 4vw, 2rem);
  border: 1px solid var(--nd-cyan);
  background: rgba(0, 5, 4, .82);
  box-shadow: 8px 8px 0 rgba(0, 47, 39, .78), 0 0 46px rgba(32, 227, 255, .15);
}

.nd-entrance-brand {
  display: flex;
  align-items: center;
  gap: .85rem;
}

.nd-entrance-brand img {
  width: 58px;
  height: 58px;
  filter: drop-shadow(0 0 12px var(--nd-cyan));
}

.nd-entrance-brand b {
  display: block;
  color: var(--nd-cyan);
  font: 700 clamp(1.2rem, 5vw, 2rem)/1 "Cascadia Mono", monospace;
  letter-spacing: .08em;
}

.nd-entrance-brand span {
  display: block;
  margin-top: .3rem;
  color: var(--nd-magenta);
  font: 650 .72rem/1.2 "Cascadia Mono", monospace;
  letter-spacing: .16em;
}

.nd-handshake-log {
  min-height: 5.2rem;
  margin: 1.2rem 0;
  padding: .75rem;
  border-left: 2px solid var(--nd-green);
  color: var(--nd-green);
  background: rgba(0, 0, 0, .7);
  font: 600 .76rem/1.55 "Cascadia Mono", monospace;
}

.nd-handshake-log p {
  margin: 0;
  opacity: 0;
  animation: nd-log-in 260ms ease forwards;
}

.nd-entrance-actions {
  display: flex;
  flex-wrap: wrap;
  gap: .5rem;
}

.nd-entrance-actions button {
  min-height: 44px;
  padding: .55rem .8rem;
  border: 1px solid var(--nd-cyan);
  color: var(--nd-cyan);
  background: #000806;
}

.nd-cinematic {
  position: fixed;
  z-index: 1400;
  inset: 0;
  display: grid;
  place-items: center;
  opacity: 0;
  pointer-events: none;
}

.nd-cinematic[data-active="true"] {
  opacity: 1;
}

.nd-cinematic::before,
.nd-cinematic::after {
  content: "";
  position: absolute;
  inset: 50% auto auto 50%;
  width: 12vmin;
  height: 12vmin;
  border: 2px solid var(--nd-cinematic-color, var(--nd-cyan));
  border-radius: 50%;
  opacity: 0;
  transform: translate(-50%, -50%) scale(.25);
}

.nd-cinematic[data-active="true"]::before {
  animation: nd-shockwave 1.45s ease-out;
}

.nd-cinematic[data-active="true"]::after {
  animation: nd-shockwave 1.45s .18s ease-out;
}

.nd-cinematic-banner {
  max-width: min(720px, calc(100% - 1.5rem));
  padding: .8rem 1.2rem;
  border: 1px solid var(--nd-cinematic-color, var(--nd-cyan));
  color: var(--nd-ink);
  background: rgba(0, 5, 4, .9);
  box-shadow: 7px 7px 0 rgba(0, 31, 26, .88), var(--nd-glow-high) rgba(32, 227, 255, .12);
  font: 700 clamp(.72rem, 2.5vw, 1rem)/1.4 "Cascadia Mono", monospace;
  letter-spacing: .08em;
  text-align: center;
  text-transform: uppercase;
  transform: translateY(18px) scale(.97);
}

.nd-cinematic[data-active="true"] .nd-cinematic-banner {
  animation: nd-banner-in 1.55s ease both;
}

.nd-connection {
  position: fixed;
  z-index: 1300;
  top: calc(52px + max(.4rem, env(safe-area-inset-top)));
  left: 50%;
  max-width: calc(100% - 1rem);
  padding: .5rem .72rem;
  border: 1px solid var(--nd-cyan);
  color: var(--nd-cyan);
  background: rgba(0, 5, 4, .94);
  box-shadow: 4px 4px 0 #00342d;
  font: 650 .68rem/1.2 "Cascadia Mono", monospace;
  letter-spacing: .06em;
  opacity: 0;
  transform: translate(-50%, -18px);
  transition: opacity var(--nd-medium) ease, transform var(--nd-medium) ease;
  pointer-events: none;
}

.nd-connection[data-active="true"] {
  opacity: 1;
  transform: translate(-50%, 0);
}

.nd-route-leaving main,
.nd-route-leaving .site-header,
.nd-route-leaving .mobile-tabbar {
  filter: saturate(.2) brightness(.62) contrast(1.22);
  transform: scale(.998);
  transition: filter 180ms ease, transform 180ms ease;
}

.nd-route-leaving .nd-spectacle {
  opacity: .22;
  transition: opacity 180ms ease;
}

.nd-paused .nd-spectacle *,
.nd-paused .site-header::before,
.nd-paused .site-header::after,
.nd-paused .brand img {
  animation-play-state: paused !important;
}

.web-patrol-page {
  background-image:
    linear-gradient(rgba(0, 5, 4, .72), rgba(0, 5, 4, .9)),
    url("../img/neon-dominion-launch-portrait.e1684d169f3f.webp");
  background-position: center;
  background-size: cover;
}

.home-map-fold {
  isolation: isolate;
  background: #010504;
}

.home-neon-backdrop {
  position: absolute;
  z-index: 0;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: .68;
  filter: saturate(1.08) contrast(1.06);
  pointer-events: none;
}

.home-page .home-live-map {
  z-index: 1;
  background: transparent;
  mix-blend-mode: screen;
}

.home-page .home-live-map .leaflet-tile-pane {
  opacity: .6;
}

.home-page .home-live-map .leaflet-overlay-pane,
.home-page .home-live-map .leaflet-zone-pane,
.home-page .home-live-map .leaflet-pending-pane,
.home-page .home-live-map .leaflet-cell-pane,
.home-page .home-live-map .leaflet-front-pane,
.home-page .home-live-map .leaflet-marker-pane,
.home-page .home-live-map .leaflet-tooltip-pane,
.home-page .home-live-map .leaflet-popup-pane {
  filter: saturate(1.2) brightness(1.1);
}

.home-page .hero-shade,
.home-page .hero-copy,
.home-page .hero-readout {
  z-index: 3;
}

.neon-dominion-banner img {
  filter: saturate(1.08) contrast(1.04);
}

.web-patrol-page .patrol-map-wrap,
.web-patrol-page .patrol-readout,
.web-patrol-page .patrol-cockpit-bar {
  box-shadow: 0 0 24px rgba(32, 227, 255, .06);
}

.patrol-running .patrol-map-wrap {
  border-color: rgba(57, 255, 136, .7);
  box-shadow: 0 0 28px rgba(57, 255, 136, .1);
}

.patrol-running .patrol-readout b {
  animation: nd-counter-charge 2.6s ease-in-out infinite;
}

.territory-map .leaflet-interactive {
  transition: stroke .42s ease, fill .42s ease, fill-opacity .42s ease;
}

.territory-map.nd-siege-charge {
  box-shadow: inset 0 0 42px rgba(255, 45, 159, .18);
}

.nd-static-state {
  border-color: var(--nd-green) !important;
  box-shadow: inset 3px 0 var(--nd-green);
}

@keyframes nd-header-scan {
  from { background-position: 0 0, 0 0, -18vw 0; }
  to { background-position: 6vw 0, -8vw 0, 18vw 0; }
}

@keyframes nd-line-run {
  to { background-position: -180% 0; }
}

@keyframes nd-mark-breathe {
  0%, 100% { transform: translateZ(0) scale(1); filter: drop-shadow(0 0 5px rgba(32, 227, 255, .55)); }
  50% { transform: translateZ(0) scale(1.035); filter: drop-shadow(0 0 12px rgba(57, 255, 136, .72)); }
}

@keyframes nd-aurora-drift {
  from { transform: translate3d(-3%, -2%, 0) skewX(-4deg) scale(1.03); }
  to { transform: translate3d(4%, 3%, 0) skewX(5deg) scale(1.09); }
}

@keyframes nd-scan-travel {
  from { transform: translateY(-18vh); }
  to { transform: translateY(118vh); }
}

@keyframes nd-ticker {
  to { transform: translateX(-50%); }
}

@keyframes nd-intro-degauss {
  0% { opacity: .65; transform: scaleY(.03); filter: brightness(2.2); }
  22% { opacity: .26; transform: scaleY(1.06); filter: brightness(1.4); }
  100% { opacity: .12; transform: scaleY(1); filter: brightness(1); }
}

@keyframes nd-log-in {
  from { opacity: 0; transform: translateX(-8px); }
  to { opacity: 1; transform: none; }
}

@keyframes nd-shockwave {
  0% { opacity: .92; transform: translate(-50%, -50%) scale(.25); }
  100% { opacity: 0; transform: translate(-50%, -50%) scale(8); }
}

@keyframes nd-banner-in {
  0% { opacity: 0; transform: translateY(18px) scale(.97); }
  18%, 70% { opacity: 1; transform: translateY(0) scale(1); }
  100% { opacity: 0; transform: translateY(-9px) scale(1.01); }
}

@keyframes nd-counter-charge {
  0%, 100% { text-shadow: 0 0 5px rgba(32, 227, 255, .35); }
  50% { text-shadow: 0 0 14px rgba(57, 255, 136, .7); }
}

@media (max-width: 900px) {
  .nd-sound-toggle .nd-sound-label { display: none; }
  .nd-spectrum-ticker { right: 4.6rem; left: 4.8rem; }
}

@media (max-width: 700px) {
  .nd-field { opacity: .48; }
  .nd-aurora { opacity: .12; }
  .nd-sound-toggle {
    position: absolute;
    z-index: 4;
    top: max(.25rem, env(safe-area-inset-top));
    right: 3.4rem;
    width: 44px;
    padding: 0;
  }
  .nd-spectrum-ticker { right: 6.4rem; bottom: 0; left: 4.2rem; }
  .nd-cinematic-banner { margin-bottom: calc(62px + var(--nd-safe-bottom)); }
  .web-patrol-page .nd-sound-toggle { right: 3.6rem; }
}

@media (max-width: 390px) {
  .nd-spectrum-ticker { display: none; }
  .nd-entrance-console { width: calc(100% - 1rem); padding: .85rem; }
  .nd-entrance-brand img { width: 46px; height: 46px; }
  .nd-handshake-log { min-height: 4.6rem; font-size: .67rem; }
}

@media (prefers-reduced-motion: reduce) {
  .nd-field, .nd-scanline { display: none; }
  .nd-aurora {
    opacity: .08;
    transform: none;
  }
  .nd-entrance { display: none !important; }
  .nd-cinematic::before, .nd-cinematic::after { display: none; }
  .nd-cinematic[data-active="true"] .nd-cinematic-banner {
    opacity: 1;
    animation: none;
    transform: none;
  }
  .nd-route-leaving main,
  .nd-route-leaving .site-header,
  .nd-route-leaving .mobile-tabbar,
  .panel, .formula-card, .gear-card, .rank-card, .battle-card,
  .site-header::before, .site-header::after, .brand img,
  .patrol-running .patrol-readout b, .nd-spectrum-ticker span {
    animation: none !important;
    transition: none !important;
    transform: none !important;
  }
}
