:root {
  color-scheme: dark;
  --bg: #020206;
  --fg: #f4f0e8;
  --muted: #9d97aa;
  --line: rgba(244, 240, 232, 0.16);
  --glass: rgba(8, 8, 16, 0.66);
  --cyan: #25f4ff;
  --pink: #ff2f87;
  --acid: #d9ff2e;
  --amber: #ff9d3d;
  --violet: #7a4dff;
  --shadow: 0 2rem 6rem rgba(0, 0, 0, 0.48);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  min-width: 320px;
  margin: 0;
  overflow-x: hidden;
  background: var(--bg);
  color: var(--fg);
  font-family:
    "Arial", "BIZ UDPGothic", "Yu Gothic", "Hiragino Kaku Gothic ProN",
    system-ui, sans-serif;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -2;
  background:
    radial-gradient(circle at 18% 10%, rgba(255, 47, 135, 0.18), transparent 28rem),
    radial-gradient(circle at 82% 12%, rgba(37, 244, 255, 0.13), transparent 26rem),
    radial-gradient(circle at 50% 88%, rgba(255, 157, 61, 0.11), transparent 24rem);
}

body.panic-mode {
  animation: bodyRupture 0.34s steps(2, end) 4;
}

body.inverted {
  filter: hue-rotate(145deg) saturate(1.7) contrast(1.12);
}

a {
  color: inherit;
  text-decoration: none;
}

button,
input {
  font: inherit;
}

button {
  color: inherit;
}

#abyss {
  position: fixed;
  inset: 0;
  z-index: -3;
  width: 100%;
  height: 100%;
  background: #020206;
}

.crt-vignette,
.scan-field {
  position: fixed;
  inset: 0;
  pointer-events: none;
}

.crt-vignette {
  z-index: 20;
  background:
    radial-gradient(ellipse at 50% 50%, transparent 48%, rgba(0, 0, 0, 0.78) 100%),
    linear-gradient(90deg, rgba(255, 47, 135, 0.04), transparent 18%, transparent 82%, rgba(37, 244, 255, 0.04));
}

.scan-field {
  z-index: 21;
  opacity: 0.45;
  background:
    repeating-linear-gradient(0deg, rgba(255,255,255,0.035) 0 1px, transparent 1px 5px),
    repeating-linear-gradient(90deg, rgba(255,255,255,0.015) 0 1px, transparent 1px 79px);
  mix-blend-mode: screen;
  animation: scanDrag 9s linear infinite;
}

.cursor-core,
.cursor-ring {
  position: fixed;
  z-index: 25;
  pointer-events: none;
  translate: -50% -50%;
  transform: translate3d(var(--mx, 50vw), var(--my, 50vh), 0);
}

.cursor-core {
  width: 0.55rem;
  height: 0.55rem;
  border-radius: 50%;
  background: #fff;
  mix-blend-mode: difference;
}

.cursor-ring {
  width: 3rem;
  height: 3rem;
  border: 1px solid rgba(217, 255, 46, 0.85);
  border-radius: 50%;
  box-shadow: 0 0 2rem rgba(217, 255, 46, 0.24), inset 0 0 1.2rem rgba(37, 244, 255, 0.14);
  transition: width 160ms ease, height 160ms ease, border-color 160ms ease;
}

.cursor-ring.is-hovering {
  width: 5rem;
  height: 5rem;
  border-color: rgba(255, 47, 135, 0.95);
}

.command-bar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 18;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: 1rem;
  align-items: center;
  padding: 1rem clamp(1rem, 4vw, 3rem);
  background: linear-gradient(180deg, rgba(2, 2, 6, 0.93), rgba(2, 2, 6, 0.08));
  backdrop-filter: blur(18px);
}

.brand {
  display: flex;
  min-width: 0;
  flex-direction: column;
  width: fit-content;
  color: var(--acid);
  text-transform: uppercase;
}

.brand span {
  font-size: clamp(1.25rem, 2.8vw, 2rem);
  font-weight: 950;
  line-height: 1;
  text-shadow: 0 0 1.4rem rgba(217, 255, 46, 0.42);
}

.brand i {
  color: var(--muted);
  font-size: 0.64rem;
  font-style: normal;
  letter-spacing: 0;
}

.command-bar nav {
  display: flex;
  gap: clamp(0.6rem, 2vw, 1.4rem);
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
}

.command-bar nav a {
  padding: 0.45rem 0;
}

.command-bar nav a:hover {
  color: var(--fg);
}

.bar-actions {
  display: flex;
  gap: 0.5rem;
}

.icon-button {
  display: grid;
  width: 2.75rem;
  height: 2.75rem;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: rgba(244, 240, 232, 0.06);
  cursor: pointer;
}

.icon-button:hover,
.icon-button:focus-visible {
  border-color: var(--acid);
  color: var(--acid);
  outline: none;
}

.panic {
  color: var(--pink);
  font-weight: 950;
}

main {
  position: relative;
}

.hero-stage {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: clamp(2rem, 4vw, 4rem);
  min-height: 100svh;
  padding: clamp(8rem, 16vh, 11rem) clamp(1rem, 5vw, 5rem) clamp(4rem, 8vh, 6rem);
}

.hero-words {
  align-self: center;
  max-width: 88rem;
}

.micro-label {
  margin: 0 0 1rem;
  color: var(--cyan);
  font-size: 0.75rem;
  font-weight: 900;
  letter-spacing: 0;
  text-transform: uppercase;
  text-shadow: 0 0 1rem rgba(37, 244, 255, 0.42);
}

.hero-stage h1 {
  display: flex;
  flex-wrap: wrap;
  gap: 0.02em;
  max-width: 12ch;
  margin: 0;
  font-size: clamp(4.2rem, 12vw, 13rem);
  line-height: 0.72;
  letter-spacing: 0;
  text-transform: uppercase;
  perspective: 900px;
}

.hero-stage h1 span {
  display: inline-block;
  color: var(--fg);
  text-shadow:
    0.035em 0 var(--pink),
    -0.03em 0 var(--cyan),
    0 0 2.2rem rgba(255, 47, 135, 0.28);
  transform: translateZ(calc(var(--i) * 0.22rem)) rotateY(calc(var(--nx, 0) * 16deg)) rotateX(calc(var(--ny, 0) * -10deg));
  animation: letterMutate 3.6s calc(var(--i) * -0.18s) infinite alternate;
}

.hero-copy {
  max-width: 48rem;
  margin: 2rem 0 0;
  color: #ddd7e4;
  font-size: clamp(1rem, 2vw, 1.38rem);
  line-height: 1.9;
}

.blackbox {
  position: relative;
  justify-self: end;
  width: min(100%, 34rem);
  min-height: 27rem;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(255, 47, 135, 0.15), rgba(37, 244, 255, 0.08)),
    rgba(7, 8, 14, 0.72);
  box-shadow: var(--shadow);
  transform: translateY(-3rem);
}

.blackbox::before {
  content: "";
  position: absolute;
  inset: -35%;
  background: conic-gradient(from var(--orbit, 0deg), transparent, rgba(217, 255, 46, 0.4), transparent 31%);
  animation: rotate 7s linear infinite;
  opacity: 0.45;
}

.blackbox-eye {
  position: relative;
  z-index: 1;
  display: grid;
  min-height: 16rem;
  place-items: center;
}

.blackbox-eye::before {
  content: "";
  width: min(76%, 19rem);
  aspect-ratio: 2 / 1;
  border: 2px solid rgba(244, 240, 232, 0.78);
  border-radius: 70% 30% 65% 35% / 62% 58% 42% 38%;
  box-shadow: inset 0 0 2rem rgba(37, 244, 255, 0.17), 0 0 3rem rgba(255, 47, 135, 0.22);
  transform: rotate(calc(var(--nx, 0) * 7deg));
}

.blackbox-eye span {
  position: absolute;
  width: 4.5rem;
  height: 4.5rem;
  border-radius: 50%;
  background:
    radial-gradient(circle at 58% 42%, #fff 0 6%, transparent 7%),
    radial-gradient(circle, #020206 0 22%, var(--acid) 23% 55%, transparent 56%);
  box-shadow: 0 0 2rem rgba(217, 255, 46, 0.8);
  transform: translate(calc(var(--nx, 0) * 2.6rem), calc(var(--ny, 0) * 1.2rem));
}

.blackbox dl {
  position: relative;
  z-index: 1;
  display: grid;
  gap: 0.75rem;
  margin: 0;
  padding: 0 1.4rem 1.4rem;
}

.blackbox dl div {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  border-top: 1px solid rgba(244, 240, 232, 0.15);
  padding-top: 0.75rem;
}

.blackbox dt {
  color: var(--muted);
  font-size: 0.8rem;
  text-transform: uppercase;
}

.blackbox dd {
  margin: 0;
  text-align: right;
  font-weight: 800;
}

.ticker {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  overflow: hidden;
  border-block: 1px solid var(--line);
  background: rgba(2, 2, 6, 0.65);
}

.ticker p {
  width: max-content;
  margin: 0;
  padding: 0.8rem 0;
  color: transparent;
  font-size: clamp(2rem, 6vw, 6rem);
  font-weight: 950;
  text-transform: uppercase;
  -webkit-text-stroke: 1px rgba(244, 240, 232, 0.48);
  animation: tickerMove 28s linear infinite;
}

section:not(.hero-stage) {
  padding: clamp(4rem, 9vw, 8rem) clamp(1rem, 5vw, 5rem);
}

.reveal {
  opacity: 0;
  transform: translateY(3rem) scale(0.98);
  transition: opacity 700ms ease, transform 700ms cubic-bezier(0.2, 0.8, 0.2, 1);
}

.reveal.is-visible {
  opacity: 1;
  transform: translateY(0) scale(1);
}

.about-deck,
.chaos-console {
  display: grid;
  grid-template-columns: minmax(16rem, 0.7fr) minmax(0, 1.3fr);
  gap: clamp(2rem, 5vw, 5rem);
  align-items: start;
}

.about-deck h2,
.portal-lab h2,
.topology-lab h2,
.chaos-console h2,
.friend-array h2 {
  max-width: 13ch;
  margin: 0;
  font-size: clamp(2.5rem, 7vw, 6.8rem);
  line-height: 0.92;
  letter-spacing: 0;
}

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

.identity-card,
.control,
.friend-card,
.portal-node {
  border: 1px solid var(--line);
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(255, 47, 135, 0.1), rgba(37, 244, 255, 0.04)),
    var(--glass);
  box-shadow: var(--shadow);
  backdrop-filter: blur(16px);
}

.identity-card {
  position: relative;
  min-height: 16rem;
  overflow: hidden;
  padding: 1.15rem;
}

.identity-card.wide {
  grid-column: 1 / -1;
}

.identity-card::after,
.control::after,
.friend-card::after {
  content: "";
  position: absolute;
  inset: auto -3rem -4rem auto;
  width: 10rem;
  height: 10rem;
  border: 1px solid rgba(217, 255, 46, 0.34);
  transform: rotate(34deg);
}

.identity-card span,
.control span {
  color: var(--pink);
  font-size: 0.8rem;
  font-weight: 950;
}

.identity-card h3 {
  margin: 4rem 0 0.7rem;
  color: var(--muted);
  font-size: 0.9rem;
  text-transform: uppercase;
}

.identity-card p {
  margin: 0;
  font-size: clamp(1.45rem, 3vw, 2.6rem);
  font-weight: 950;
  line-height: 1.25;
}

.identity-card.wide p {
  max-width: 52rem;
  font-size: clamp(1rem, 2vw, 1.45rem);
  font-weight: 650;
  line-height: 1.85;
}

.section-head {
  display: flex;
  justify-content: space-between;
  gap: 2rem;
  align-items: end;
  margin-bottom: clamp(2rem, 5vw, 4rem);
}

.portal-orbit {
  position: relative;
  display: grid;
  min-height: clamp(44rem, 70vw, 58rem);
  place-items: center;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background:
    radial-gradient(circle, rgba(217, 255, 46, 0.12), transparent 10rem),
    linear-gradient(135deg, rgba(122, 77, 255, 0.12), transparent);
}

.portal-orbit::before,
.portal-orbit::after {
  content: "";
  position: absolute;
  width: min(78vw, 52rem);
  aspect-ratio: 1;
  border: 1px solid rgba(244, 240, 232, 0.18);
  border-radius: 50%;
  transform: rotateX(68deg) rotateZ(12deg);
}

.portal-orbit::after {
  width: min(60vw, 38rem);
  border-color: rgba(255, 47, 135, 0.2);
  animation: rotateFlat 12s linear infinite;
}

.portal-core {
  position: relative;
  z-index: 1;
  display: grid;
  width: clamp(12rem, 22vw, 19rem);
  aspect-ratio: 1;
  place-items: center;
  border: 1px solid rgba(217, 255, 46, 0.65);
  border-radius: 50%;
  background:
    radial-gradient(circle, rgba(217, 255, 46, 0.2), transparent 55%),
    rgba(2, 2, 6, 0.66);
  box-shadow: 0 0 4rem rgba(217, 255, 46, 0.18);
}

.portal-core span {
  font-size: clamp(2.4rem, 6vw, 5rem);
  font-weight: 950;
  text-transform: uppercase;
}

.portal-node {
  position: absolute;
  z-index: 2;
  display: flex;
  width: min(21rem, 42vw);
  min-height: 10rem;
  flex-direction: column;
  justify-content: space-between;
  overflow: hidden;
  padding: 1rem;
  transition: transform 180ms ease, border-color 180ms ease;
}

.portal-node:hover {
  border-color: var(--acid);
}

.portal-node small {
  color: var(--cyan);
  font-weight: 950;
}

.portal-node strong {
  font-size: clamp(1.6rem, 3vw, 2.5rem);
  line-height: 1;
  text-transform: uppercase;
}

.portal-node em {
  color: var(--muted);
  font-style: normal;
  word-break: break-word;
}

.n1 { top: 9%; left: 7%; }
.n2 { top: 18%; right: 6%; }
.n3 { bottom: 14%; left: 11%; }
.n4 { right: 13%; bottom: 9%; }

.topology-lab {
  position: relative;
}

.topology-head {
  align-items: start;
}

.topology-copy {
  max-width: 35rem;
  margin: 0;
  color: #d8d2df;
  font-size: clamp(1rem, 1.6vw, 1.18rem);
  line-height: 1.9;
}

.topology-machine {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(18rem, 0.55fr);
  gap: 1rem;
  min-height: clamp(38rem, 72vw, 56rem);
}

.topology-stage {
  position: relative;
  overflow: hidden;
  border: 1px solid rgba(37, 244, 255, 0.28);
  border-radius: 8px;
  background:
    radial-gradient(circle at 50% 42%, rgba(37, 244, 255, 0.13), transparent 22rem),
    radial-gradient(circle at 30% 74%, rgba(255, 47, 135, 0.12), transparent 22rem),
    rgba(2, 2, 6, 0.68);
  box-shadow: var(--shadow), inset 0 0 5rem rgba(37, 244, 255, 0.06);
  isolation: isolate;
}

.topology-stage::before,
.topology-stage::after {
  content: "";
  position: absolute;
  inset: 8%;
  border: 1px solid rgba(244, 240, 232, 0.1);
  border-radius: 50%;
  transform: rotateX(72deg) rotateZ(18deg);
  pointer-events: none;
}

.topology-stage::after {
  inset: 20%;
  border-color: rgba(217, 255, 46, 0.2);
  animation: rotateFlat 18s linear infinite reverse;
}

#topology-canvas {
  position: absolute;
  inset: 0;
  z-index: 1;
  width: 100%;
  height: 100%;
  display: block;
}

.topology-hud {
  position: absolute;
  z-index: 3;
  top: 1rem;
  left: 1rem;
  right: 1rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  color: var(--cyan);
  font-family: Consolas, monospace;
  font-size: 0.75rem;
  text-shadow: 0 0 1rem rgba(37, 244, 255, 0.6);
}

.topology-hud span {
  border: 1px solid rgba(37, 244, 255, 0.25);
  border-radius: 999px;
  background: rgba(2, 2, 6, 0.62);
  padding: 0.35rem 0.65rem;
}

.avatar-agent {
  position: absolute;
  z-index: 4;
  right: clamp(1rem, 4vw, 3rem);
  bottom: clamp(1rem, 4vw, 3rem);
  display: grid;
  width: clamp(6rem, 13vw, 10rem);
  aspect-ratio: 1;
  place-items: center;
  border: 1px solid rgba(217, 255, 46, 0.45);
  border-radius: 50%;
  background: radial-gradient(circle, rgba(217, 255, 46, 0.17), transparent 62%);
  box-shadow: 0 0 3rem rgba(217, 255, 46, 0.15);
  mix-blend-mode: screen;
}

.avatar-agent::before,
.avatar-agent::after {
  content: "";
  position: absolute;
  inset: 10%;
  border: 1px solid rgba(255, 47, 135, 0.45);
  border-radius: 50%;
  animation: rotate 4s linear infinite;
}

.avatar-agent::after {
  inset: 25%;
  border-color: rgba(37, 244, 255, 0.5);
  animation-duration: 2.2s;
  animation-direction: reverse;
}

.avatar-agent span {
  width: 32%;
  aspect-ratio: 1;
  border-radius: 50%;
  background: var(--acid);
  box-shadow: 0 0 2rem var(--acid);
}

.topology-panel {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  background:
    linear-gradient(145deg, rgba(255, 47, 135, 0.12), rgba(37, 244, 255, 0.05)),
    var(--glass);
  padding: 1rem;
  box-shadow: var(--shadow);
  backdrop-filter: blur(16px);
}

.topology-panel label {
  display: grid;
  gap: 0.55rem;
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 900;
  text-transform: uppercase;
}

.topology-panel textarea {
  width: 100%;
  min-height: 9rem;
  resize: vertical;
  border: 1px solid rgba(244, 240, 232, 0.16);
  border-radius: 8px;
  background: rgba(2, 2, 6, 0.72);
  color: var(--fg);
  padding: 0.9rem;
  font: 0.95rem/1.6 Consolas, monospace;
  outline: none;
}

.topology-panel textarea:focus {
  border-color: rgba(217, 255, 46, 0.65);
  box-shadow: 0 0 1.4rem rgba(217, 255, 46, 0.12);
}

.topology-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.6rem;
}

.topology-actions button,
.topology-submit {
  min-height: 3rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(244, 240, 232, 0.055);
  cursor: pointer;
  font-weight: 950;
  text-transform: uppercase;
}

.topology-actions button:hover,
.topology-submit:hover {
  border-color: var(--acid);
  color: var(--acid);
}

.topology-submit {
  min-height: 5rem;
  background:
    linear-gradient(90deg, rgba(255, 47, 135, 0.22), rgba(37, 244, 255, 0.18)),
    rgba(2, 2, 6, 0.76);
}

.thought-log {
  flex: 1;
  min-height: 11rem;
  overflow: auto;
  border: 1px solid rgba(37, 244, 255, 0.18);
  border-radius: 8px;
  background: rgba(2, 2, 6, 0.62);
  padding: 0.85rem;
  color: #d8faff;
  font: 0.82rem/1.65 Consolas, monospace;
}

.thought-log p {
  margin: 0 0 0.45rem;
}

.control-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1rem;
}

.control {
  position: relative;
  display: flex;
  min-height: 18rem;
  flex-direction: column;
  justify-content: space-between;
  overflow: hidden;
  padding: 1rem;
  cursor: pointer;
}

.control strong {
  font-size: clamp(1.7rem, 3vw, 2.8rem);
  text-transform: uppercase;
}

.control em {
  color: var(--muted);
  font-style: normal;
}

.control:hover {
  border-color: var(--pink);
  color: var(--acid);
}

.friend-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1rem;
}

.friend-card {
  position: relative;
  display: flex;
  min-height: 13rem;
  flex-direction: column;
  justify-content: space-between;
  overflow: hidden;
  padding: 1rem;
}

.friend-card span {
  font-size: clamp(1.4rem, 2.6vw, 2.4rem);
  font-weight: 950;
  line-height: 1.1;
}

.friend-card em {
  color: var(--muted);
  font-style: normal;
  word-break: break-word;
}

.friend-card:hover {
  background: var(--acid);
  color: #020206;
}

.friend-card:hover em {
  color: rgba(2, 2, 6, 0.66);
}

.terminal {
  position: fixed;
  right: clamp(1rem, 4vw, 3rem);
  bottom: clamp(1rem, 4vw, 3rem);
  z-index: 30;
  display: none;
  width: min(42rem, calc(100vw - 2rem));
  overflow: hidden;
  border: 1px solid rgba(37, 244, 255, 0.5);
  border-radius: 8px;
  background: rgba(2, 2, 6, 0.92);
  box-shadow: 0 0 5rem rgba(37, 244, 255, 0.16);
}

.terminal.is-open {
  display: block;
}

.terminal-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.7rem 0.9rem;
  background: rgba(37, 244, 255, 0.12);
  color: var(--cyan);
  font-family: Consolas, monospace;
}

.terminal-bar button {
  border: 0;
  background: transparent;
  color: var(--fg);
  cursor: pointer;
  font-size: 1.2rem;
}

.terminal-body {
  max-height: 18rem;
  overflow: auto;
  padding: 1rem;
  color: #d8faff;
  font-family: Consolas, monospace;
  font-size: 0.9rem;
  line-height: 1.7;
}

.terminal-body p {
  margin: 0 0 0.35rem;
}

.terminal-input {
  display: flex;
  gap: 0.6rem;
  align-items: center;
  padding: 0.75rem 1rem 1rem;
  border-top: 1px solid rgba(244, 240, 232, 0.12);
  color: var(--acid);
  font-family: Consolas, monospace;
}

.terminal-input input {
  width: 100%;
  border: 0;
  outline: none;
  background: transparent;
  color: var(--fg);
}

#fault-layer {
  position: fixed;
  inset: 0;
  z-index: 19;
  pointer-events: none;
}

.fault-window {
  position: fixed;
  z-index: 19;
  width: min(21rem, calc(100vw - 2rem));
  border: 2px outset #fff;
  background: #c9c9c9;
  color: #050505;
  font-family: Consolas, monospace;
  font-size: 0.78rem;
  box-shadow: 0.45rem 0.45rem 0 rgba(0, 0, 0, 0.52);
  pointer-events: auto;
  animation: faultArrive 260ms steps(2, end);
}

.fault-title {
  display: flex;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.25rem 0.45rem;
  background: linear-gradient(90deg, #001a8f, #00a5d8);
  color: #fff;
  font-weight: 800;
}

.fault-title button {
  border: 2px outset #fff;
  background: #c9c9c9;
  color: #050505;
  cursor: pointer;
}

.fault-window p {
  margin: 0;
  padding: 0.85rem;
  line-height: 1.7;
}

.site-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  padding: 2rem clamp(1rem, 5vw, 5rem);
  border-top: 1px solid var(--line);
  color: var(--muted);
}

.footer-button {
  min-height: 2.75rem;
  padding: 0 1rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(244, 240, 232, 0.06);
  cursor: pointer;
}

.footer-button:hover {
  border-color: var(--acid);
  color: var(--acid);
}

@keyframes scanDrag {
  to { background-position: 0 100vh, 80px 0; }
}

@keyframes letterMutate {
  0%, 86% { filter: blur(0); }
  88% { transform: translateX(0.03em) skew(-10deg); filter: blur(1px); }
  91% { transform: translateX(-0.04em) skew(8deg); }
  94% { filter: hue-rotate(90deg); }
  100% { filter: blur(0); }
}

@keyframes rotate {
  to { transform: rotate(1turn); }
}

@keyframes rotateFlat {
  to { transform: rotateX(68deg) rotateZ(372deg); }
}

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

@keyframes bodyRupture {
  0% { transform: translate(0, 0); }
  25% { transform: translate(0.55rem, -0.25rem) skewX(1deg); }
  50% { transform: translate(-0.4rem, 0.3rem) skewX(-1deg); }
  75% { transform: translate(0.25rem, 0.4rem); }
  100% { transform: translate(0, 0); }
}

@keyframes faultArrive {
  from { transform: scale(0.7) rotate(-6deg); opacity: 0; }
  to { transform: scale(1) rotate(0deg); opacity: 1; }
}

@media (max-width: 1100px) {
  .about-deck,
  .chaos-console {
    grid-template-columns: 1fr;
  }

  .control-grid,
  .friend-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .topology-machine {
    grid-template-columns: 1fr;
  }

  .topology-stage {
    min-height: 34rem;
  }

  .portal-node {
    width: min(24rem, 46vw);
  }

  .topology-stage {
    min-height: 27rem;
  }

  .topology-actions {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 720px) {
  .command-bar {
    grid-template-columns: 1fr auto;
  }

  .command-bar nav {
    grid-column: 1 / -1;
    grid-row: 2;
    justify-content: space-between;
  }

  .hero-stage {
    min-height: auto;
    padding-top: 9.5rem;
  }

  .hero-stage h1 {
    font-size: clamp(3.4rem, 18vw, 6.8rem);
  }

  .blackbox {
    justify-self: stretch;
    transform: none;
  }

  .identity-grid,
  .control-grid,
  .friend-grid {
    grid-template-columns: 1fr;
  }

  .section-head {
    display: block;
  }

  .portal-orbit {
    display: flex;
    min-height: auto;
    flex-direction: column;
    gap: 1rem;
    padding: 1rem;
  }

  .portal-orbit::before,
  .portal-orbit::after {
    display: none;
  }

  .portal-core {
    width: 13rem;
  }

  .portal-node {
    position: relative;
    inset: auto;
    width: 100%;
  }

  .cursor-core,
  .cursor-ring {
    display: none;
  }

  .site-footer {
    align-items: flex-start;
    flex-direction: column;
  }
}

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