:root {
  color-scheme: dark;
  --bg: #02070d;
  --ink: #eff8ff;
  --muted: rgba(220, 238, 255, 0.68);
  --quiet: rgba(189, 216, 238, 0.42);
  --cyan: #18e6ff;
  --blue: #1e7dff;
  --mint: #21ffc0;
  --signal: #ffd36e;
  --line: rgba(38, 218, 255, 0.22);
  --panel: rgba(7, 22, 34, 0.58);
  --panel-strong: rgba(7, 25, 40, 0.78);
  --border: rgba(77, 226, 255, 0.28);
  --shadow: 0 24px 90px rgba(0, 223, 255, 0.16);
  --mono: "SFMono-Regular", "Cascadia Code", "Roboto Mono", Menlo, Consolas,
    monospace;
  --sans: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont,
    "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  background: var(--bg);
}

body {
  min-height: 100vh;
  margin: 0;
  overflow-x: hidden;
  color: var(--ink);
  font-family: var(--sans);
  letter-spacing: 0;
  background:
    radial-gradient(circle at 50% 44%, rgba(15, 95, 130, 0.32), transparent 34vw),
    radial-gradient(circle at 15% 78%, rgba(12, 225, 255, 0.12), transparent 24vw),
    radial-gradient(circle at 88% 78%, rgba(255, 211, 110, 0.08), transparent 24vw),
    linear-gradient(180deg, #02060c 0%, #03101b 58%, #010307 100%);
}

body::before,
body::after {
  position: fixed;
  inset: 0;
  pointer-events: none;
  content: "";
}

body::before {
  z-index: 0;
  opacity: 0.46;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.025) 1px, transparent 1px);
  background-size: 72px 72px;
  mask-image: linear-gradient(to bottom, transparent, black 18%, black 82%, transparent);
}

body::after {
  z-index: 1;
  background:
    linear-gradient(90deg, rgba(2, 7, 13, 0.9), transparent 20%, transparent 80%, rgba(2, 7, 13, 0.9)),
    linear-gradient(180deg, rgba(2, 7, 13, 0.1), transparent 52%, #02070d 95%);
}

#terrainCanvas {
  position: fixed;
  inset: 0;
  z-index: 0;
  width: 100%;
  height: 100%;
}

.page-shell {
  position: relative;
  z-index: 2;
  display: grid;
  min-height: 100vh;
  grid-template-rows: auto 1fr auto;
}

.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  width: min(100% - 48px, 1480px);
  margin: 0 auto;
  padding: 24px 0 12px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 14px;
  color: var(--ink);
  font-weight: 760;
  font-size: clamp(24px, 2.1vw, 34px);
  line-height: 1;
  text-decoration: none;
}

.brand span span {
  color: var(--cyan);
}

.brand-mark {
  display: grid;
  width: 50px;
  height: 42px;
  place-items: center;
}

.brand-mark svg {
  width: 100%;
  height: 100%;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 6;
  filter: drop-shadow(0 0 16px rgba(24, 230, 255, 0.5));
}

.signal-nav {
  display: flex;
  gap: 8px;
  padding: 6px;
  border: 1px solid rgba(150, 231, 255, 0.16);
  border-radius: 999px;
  background: rgba(5, 17, 28, 0.5);
  box-shadow: inset 0 0 24px rgba(24, 230, 255, 0.04);
  backdrop-filter: blur(18px);
}

.signal-nav span {
  display: inline-flex;
  min-width: 64px;
  justify-content: center;
  padding: 10px 14px;
  border-radius: 999px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 650;
  text-transform: uppercase;
}

.signal-nav span:nth-child(2) {
  color: var(--ink);
  background: rgba(36, 211, 255, 0.12);
}

.hero {
  position: relative;
  display: flex;
  width: min(100% - 48px, 1480px);
  min-height: calc(100vh - 150px);
  margin: 0 auto;
  align-items: center;
  justify-content: center;
  padding: 54px 0 92px;
}

.hero::before {
  position: absolute;
  right: 1%;
  bottom: 8%;
  left: 1%;
  z-index: -1;
  height: 42%;
  content: "";
  background:
    linear-gradient(140deg, transparent 0 8%, rgba(13, 39, 56, 0.35) 8.5% 10%, transparent 10.5%),
    linear-gradient(160deg, transparent 0 16%, rgba(20, 227, 255, 0.22) 16.4% 17.2%, transparent 17.6%),
    linear-gradient(24deg, transparent 0 24%, rgba(255, 255, 255, 0.16) 24.4% 24.9%, transparent 25.3%),
    linear-gradient(150deg, transparent 0 32%, rgba(16, 52, 72, 0.54) 32.4% 36%, transparent 36.5%),
    linear-gradient(20deg, transparent 0 47%, rgba(15, 211, 255, 0.18) 47.5% 48.2%, transparent 48.7%);
  clip-path: polygon(
    0 100%,
    0 61%,
    8% 48%,
    14% 56%,
    23% 24%,
    31% 53%,
    39% 33%,
    48% 61%,
    57% 18%,
    66% 52%,
    74% 32%,
    84% 62%,
    93% 38%,
    100% 54%,
    100% 100%
  );
  opacity: 0.9;
  filter: drop-shadow(0 0 34px rgba(12, 214, 255, 0.16));
}

.hero-copy {
  position: relative;
  z-index: 3;
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
  max-width: 1160px;
  text-align: center;
}

.code-ribbon {
  order: 2;
  display: inline-flex;
  align-items: center;
  justify-content: flex-start;
  max-width: min(100%, 760px);
  min-height: 62px;
  margin: 0 auto;
  padding: 0 20px;
  border: 1px solid var(--border);
  border-radius: 14px;
  color: rgba(235, 250, 255, 0.9);
  font-family: var(--mono);
  font-size: clamp(15px, 1.45vw, 22px);
  line-height: 1.35;
  background: linear-gradient(90deg, rgba(5, 21, 34, 0.82), rgba(5, 20, 31, 0.42));
  box-shadow: var(--shadow), inset 0 0 38px rgba(24, 230, 255, 0.06);
  backdrop-filter: blur(20px);
}

.prompt {
  margin-right: 18px;
  color: var(--cyan);
  text-shadow: 0 0 16px currentColor;
}

.caret {
  width: 11px;
  height: 1.45em;
  margin-left: 4px;
  background: var(--cyan);
  box-shadow: 0 0 18px var(--cyan);
  animation: blink 0.88s steps(1) infinite;
}

h1 {
  order: 1;
  max-width: 100%;
  margin: 0 0 34px;
  color: #f3fbff;
  font-size: clamp(78px, 13vw, 188px);
  font-weight: 840;
  line-height: 0.88;
  letter-spacing: 0;
  white-space: nowrap;
  text-wrap: balance;
  text-shadow:
    0 0 18px rgba(166, 237, 255, 0.28),
    0 22px 90px rgba(0, 151, 255, 0.3);
}

.input-line {
  order: 3;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  min-height: 36px;
  margin-top: 22px;
  color: var(--muted);
  font-family: var(--mono);
  font-size: clamp(13px, 1.2vw, 16px);
}

.terminal-dot {
  width: 10px;
  height: 10px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: var(--mint);
  box-shadow: 0 0 18px var(--mint), 0 0 42px rgba(33, 255, 192, 0.55);
  animation: breathe 2.2s ease-in-out infinite;
}

.input-text::after {
  content: "";
  display: inline-block;
  width: 8px;
  height: 1.2em;
  margin-left: 6px;
  background: rgba(255, 211, 110, 0.92);
  box-shadow: 0 0 14px rgba(255, 211, 110, 0.7);
  vertical-align: -0.18em;
  animation: blink 0.88s steps(1) infinite;
}

.code-panel {
  display: none;
  overflow: hidden;
  border: 1px solid rgba(83, 218, 255, 0.22);
  border-radius: 18px;
  background:
    linear-gradient(180deg, rgba(8, 26, 40, 0.72), rgba(3, 11, 20, 0.58)),
    radial-gradient(circle at 70% 22%, rgba(24, 230, 255, 0.12), transparent 38%);
  box-shadow: 0 24px 90px rgba(0, 0, 0, 0.28), inset 0 0 56px rgba(24, 230, 255, 0.05);
  backdrop-filter: blur(22px);
}

.panel-top {
  display: flex;
  align-items: center;
  gap: 9px;
  height: 48px;
  padding: 0 16px;
  border-bottom: 1px solid rgba(109, 229, 255, 0.14);
  color: var(--quiet);
  font-family: var(--mono);
  font-size: 12px;
}

.panel-top span {
  width: 10px;
  height: 10px;
  border-radius: 50%;
}

.panel-top span:nth-child(1) {
  background: #ff6b76;
}

.panel-top span:nth-child(2) {
  background: #ffd36e;
}

.panel-top span:nth-child(3) {
  background: #22ffc2;
}

.panel-top strong {
  margin-left: auto;
  font-weight: 560;
}

pre {
  margin: 0;
  padding: 24px;
  white-space: pre-wrap;
}

code {
  color: rgba(230, 248, 255, 0.78);
  font-family: var(--mono);
  font-size: 13px;
  line-height: 1.8;
}

.token-key {
  color: #48e9ff;
}

.token-string {
  color: #87ffc8;
}

.token-number {
  color: #9cb8ff;
}

.activity-map {
  position: absolute;
  right: 7%;
  bottom: 18%;
  left: 7%;
  z-index: -1;
  height: 36%;
  opacity: 0.78;
}

.route {
  position: absolute;
  height: 2px;
  border-radius: 999px;
  background: linear-gradient(90deg, transparent, var(--cyan), var(--blue), transparent);
  box-shadow: 0 0 22px rgba(24, 230, 255, 0.8);
  transform-origin: center;
  animation: scanRoute 4.6s ease-in-out infinite;
}

.route-a {
  right: 12%;
  bottom: 42%;
  width: 58%;
  transform: rotate(-8deg);
}

.route-b {
  right: 24%;
  bottom: 26%;
  width: 44%;
  transform: rotate(11deg);
  animation-delay: -1.5s;
}

.node {
  position: absolute;
  display: grid;
  width: 52px;
  height: 52px;
  place-items: center;
  border: 1px solid rgba(101, 231, 255, 0.44);
  border-radius: 14px;
  color: var(--cyan);
  background: rgba(5, 22, 36, 0.7);
  box-shadow: 0 0 30px rgba(24, 230, 255, 0.28), inset 0 0 20px rgba(24, 230, 255, 0.08);
  animation: floatNode 4.8s ease-in-out infinite;
}

.node::after {
  position: absolute;
  top: 100%;
  left: 50%;
  width: 1px;
  height: 84px;
  content: "";
  background: linear-gradient(var(--cyan), transparent);
  box-shadow: 0 0 18px var(--cyan);
}

.node svg {
  width: 28px;
  height: 28px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

.node-ski {
  left: 9%;
  bottom: 40%;
}

.node-bike {
  left: 39%;
  bottom: 34%;
  animation-delay: -1.2s;
}

.node-hike {
  right: 14%;
  bottom: 45%;
  animation-delay: -2.4s;
}

.site-footer {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  min-height: 70px;
  padding: 0 24px 20px;
  color: rgba(216, 240, 255, 0.64);
  font-family: var(--mono);
  font-size: 12px;
  text-transform: uppercase;
}

.pulse-line {
  width: min(220px, 28vw);
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--cyan), transparent);
  box-shadow: 0 0 16px var(--cyan);
  animation: pulseLine 2.8s ease-in-out infinite;
}

@keyframes blink {
  50% {
    opacity: 0;
  }
}

@keyframes breathe {
  50% {
    transform: scale(1.45);
    opacity: 0.58;
  }
}

@keyframes scanRoute {
  50% {
    opacity: 0.38;
    filter: hue-rotate(30deg);
  }
}

@keyframes floatNode {
  50% {
    transform: translateY(-12px);
  }
}

@keyframes pulseLine {
  50% {
    opacity: 0.38;
    transform: scaleX(0.62);
  }
}

@media (max-width: 980px) {
  .site-header {
    width: min(100% - 32px, 720px);
  }

  .signal-nav {
    display: none;
  }

  .hero {
    width: min(100% - 32px, 720px);
    min-height: calc(100vh - 120px);
    flex-direction: column;
    align-content: center;
    gap: 30px;
    padding: 42px 0 70px;
  }

  .code-panel {
    width: 100%;
    min-height: 245px;
  }

  .activity-map {
    right: 2%;
    bottom: 27%;
    left: 2%;
    height: 28%;
  }
}

@media (max-width: 620px) {
  .brand {
    font-size: 24px;
  }

  .brand-mark {
    width: 42px;
    height: 36px;
  }

  .code-ribbon {
    width: 100%;
    min-height: 54px;
    padding: 0 14px;
    font-size: 13px;
    overflow: hidden;
  }

  h1 {
    margin-top: 0;
    font-size: clamp(58px, 20vw, 86px);
    line-height: 0.94;
    white-space: normal;
  }

  .code-panel {
    border-radius: 14px;
  }

  pre {
    padding: 18px;
  }

  code {
    font-size: 12px;
  }

  .node {
    width: 42px;
    height: 42px;
    border-radius: 12px;
  }

  .node svg {
    width: 23px;
    height: 23px;
  }

  .site-footer {
    flex-direction: column;
    gap: 10px;
    text-align: center;
  }
}

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