:root {
  --bg-0: #06090e;
  --bg-1: #0a1017;
  --panel: rgba(9, 16, 23, 0.72);
  --panel-strong: rgba(9, 16, 23, 0.9);
  --line: rgba(125, 157, 180, 0.32);
  --line-active: rgba(83, 198, 224, 0.86);
  --text: #e7eef7;
  --muted: #93a8bd;
  --accent: #53c6e0;
  --accent-strong: #8be2ff;
  --ok: #58d892;
  --danger: #f2a35e;
  --radius-lg: 22px;
  --radius-md: 14px;
  --shadow: 0 24px 80px rgba(0, 0, 0, 0.48);
  --bg-parallax-x: 0px;
  --bg-parallax-y: 0px;
}

* {
  box-sizing: border-box;
}

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

body {
  font-family: "Plus Jakarta Sans", "Segoe UI", sans-serif;
  background: var(--bg-0);
  color: var(--text);
  overflow: hidden;
}

.boot-sequence {
  position: absolute;
  inset: 0;
  z-index: 8;
  display: grid;
  place-items: center;
  background:
    radial-gradient(circle at 20% 20%, rgba(72, 131, 172, 0.14), transparent 38%),
    linear-gradient(145deg, #04070b 12%, #09131c 56%, #04070b 100%);
  overflow: hidden;
  border-radius: inherit;
  visibility: hidden;
  pointer-events: none;
  opacity: 0;
  transition: opacity 460ms ease;
}

body.booting .boot-sequence,
body.boot-unfold .boot-sequence {
  visibility: visible;
  pointer-events: auto;
  opacity: 1;
}

.boot-door {
  position: absolute;
  left: 0;
  right: 0;
  height: 52%;
  background: linear-gradient(180deg, rgba(7, 13, 18, 0.96), rgba(5, 9, 14, 0.94));
  border: 1px solid rgba(106, 139, 163, 0.24);
  transition: transform 760ms cubic-bezier(0.22, 1, 0.36, 1), opacity 420ms ease;
}

.boot-door--top {
  top: 0;
  border-bottom-color: rgba(132, 177, 206, 0.26);
}

.boot-door--bottom {
  bottom: 0;
  border-top-color: rgba(132, 177, 206, 0.26);
}

.boot-terminal {
  position: relative;
  z-index: 2;
  width: min(780px, calc(100% - 36px));
  border: 1px solid rgba(138, 170, 194, 0.28);
  border-radius: 18px;
  background: rgba(7, 13, 20, 0.78);
  box-shadow: 0 20px 70px rgba(0, 0, 0, 0.5);
  padding: 14px 16px 16px;
  transition: transform 760ms cubic-bezier(0.22, 1, 0.36, 1), opacity 760ms cubic-bezier(0.22, 1, 0.36, 1), filter 760ms cubic-bezier(0.22, 1, 0.36, 1);
  will-change: transform, opacity, filter;
}

.boot-terminal__eyebrow {
  margin: 0 0 10px;
  font-family: "Space Grotesk", sans-serif;
  font-size: 0.72rem;
  letter-spacing: 0.16em;
  color: #97bedb;
}

.boot-terminal__screen {
  border: 1px solid rgba(128, 164, 189, 0.22);
  border-radius: 12px;
  background: rgba(2, 7, 11, 0.82);
  padding: 12px;
}

.boot-log {
  margin: 0;
  padding: 0;
  list-style: none;
  min-height: 180px;
  max-height: 180px;
  overflow: hidden;
  font-family: "Consolas", "SFMono-Regular", "Menlo", monospace;
  font-size: 0.82rem;
  line-height: 1.45;
  color: #a8d4ec;
}

.boot-log li {
  opacity: 0;
  transform: translateY(6px);
  animation: bootLineIn 280ms ease forwards;
}

.boot-progress {
  margin-top: 12px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.boot-progress__bar {
  flex: 1;
  height: 8px;
  border-radius: 999px;
  background: rgba(78, 123, 150, 0.24);
  overflow: hidden;
}

.boot-progress__bar span {
  display: block;
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #3f95be, #8be2ff);
  box-shadow: 0 0 18px rgba(108, 205, 238, 0.5);
  transition: width 220ms ease;
}

.boot-progress__text {
  min-width: 44px;
  font-size: 0.75rem;
  color: #c3d9ea;
  text-align: right;
}

body.boot-unfold .boot-terminal {
  transform: translateY(-57vh) scale(0.94);
  opacity: 0;
  filter: blur(4px);
}

body.boot-unfold .boot-door--top {
  transform: translateY(-110%);
}

body.boot-unfold .boot-door--bottom {
  transform: translateY(110%);
}

body.boot-unfold .boot-sequence {
  opacity: 0;
}

@keyframes bootLineIn {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.backdrop {
  position: fixed;
  inset: 0;
  background:
    radial-gradient(circle at 15% 18%, rgba(73, 137, 182, 0.16), transparent 38%),
    radial-gradient(circle at 82% 70%, rgba(31, 86, 123, 0.22), transparent 34%),
    linear-gradient(160deg, #06090e 5%, #09131d 56%, #05070b 100%);
  z-index: -2;
  opacity: 0;
  transition: opacity 620ms ease;
}

.backdrop::before,
.backdrop::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.backdrop::before {
  background-image: linear-gradient(rgba(255, 255, 255, 0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.03) 1px, transparent 1px);
  background-size: 40px 40px;
  mask-image: radial-gradient(circle at center, black 35%, transparent 88%);
  opacity: 0.3;
}

.backdrop::after {
  background: radial-gradient(circle at center, rgba(109, 198, 255, 0.14), transparent 54%);
}

.bg-starfield {
  position: fixed;
  inset: -4%;
  pointer-events: none;
  z-index: -1;
  transition: transform 140ms ease-out;
}

.bg-starfield--far {
  opacity: 0.24;
  background-image:
    radial-gradient(1px 1px at 15% 22%, rgba(180, 220, 242, 0.7), transparent 60%),
    radial-gradient(1px 1px at 72% 28%, rgba(188, 232, 255, 0.6), transparent 60%),
    radial-gradient(1px 1px at 35% 68%, rgba(171, 221, 247, 0.52), transparent 60%),
    radial-gradient(1px 1px at 84% 74%, rgba(171, 221, 247, 0.46), transparent 60%),
    radial-gradient(1px 1px at 48% 44%, rgba(178, 228, 252, 0.54), transparent 60%);
  background-size: 280px 280px, 260px 260px, 310px 310px, 290px 290px, 340px 340px;
  transform: translate3d(calc(var(--bg-parallax-x) * -0.38), calc(var(--bg-parallax-y) * -0.38), 0);
}

.bg-starfield--near {
  opacity: 0.3;
  background-image:
    radial-gradient(1.6px 1.6px at 11% 16%, rgba(194, 237, 255, 0.76), transparent 62%),
    radial-gradient(1.2px 1.2px at 69% 33%, rgba(179, 229, 255, 0.68), transparent 62%),
    radial-gradient(1.4px 1.4px at 25% 57%, rgba(201, 240, 255, 0.72), transparent 62%),
    radial-gradient(1.5px 1.5px at 63% 82%, rgba(173, 223, 246, 0.64), transparent 62%),
    radial-gradient(1.3px 1.3px at 91% 46%, rgba(183, 231, 253, 0.64), transparent 62%);
  background-size: 210px 210px, 240px 240px, 230px 230px, 260px 260px, 220px 220px;
  transform: translate3d(calc(var(--bg-parallax-x) * -0.72), calc(var(--bg-parallax-y) * -0.72), 0);
}

.meteor-layer {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: -1;
  overflow: hidden;
  transition: opacity 220ms ease;
}

body.awaiting-start .bg-starfield,
body.core-offline .bg-starfield {
  opacity: 0 !important;
}

body.awaiting-start .meteor-layer,
body.core-offline .meteor-layer {
  opacity: 0;
}

.meteor {
  position: absolute;
  width: var(--meteor-len, 130px);
  height: 2px;
  border-radius: 999px;
  background: linear-gradient(
    90deg,
    rgba(225, 248, 255, 0.98) 0%,
    rgba(176, 232, 255, 0.7) 18%,
    rgba(176, 232, 255, 0.16) 62%,
    transparent 100%
  );
  box-shadow: 0 0 10px rgba(157, 226, 255, 0.62);
  opacity: 0;
  transform-origin: left center;
  animation: meteorFlight var(--meteor-dur, 2200ms) linear;
}

.meteor::after {
  content: "";
  position: absolute;
  left: -2px;
  top: 50%;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  transform: translateY(-50%);
  background: rgba(238, 252, 255, 0.98);
  box-shadow: 0 0 12px rgba(186, 239, 255, 0.92);
}

@keyframes meteorFlight {
  0% {
    opacity: 0;
    transform: translate3d(0, 0, 0) rotate(var(--meteor-angle, 0deg));
  }
  10% {
    opacity: 0.92;
  }
  74% {
    opacity: 0.88;
  }
  92% {
    opacity: 0.38;
  }
  100% {
    opacity: 0;
    transform: translate3d(var(--meteor-dx, -440px), var(--meteor-dy, 300px), 0) rotate(var(--meteor-angle, 0deg));
  }
}

.app {
  min-height: 100vh;
}

.system-shell {
  position: relative;
  min-height: 100vh;
  padding: 24px 24px 26px;
  transition: opacity 680ms ease, filter 680ms ease, transform 680ms ease;
}

.topbar {
  position: relative;
  z-index: 3;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  margin-bottom: 20px;
}

.topbar-controls {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.lang-switch {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px;
  border: 1px solid rgba(130, 171, 207, 0.28);
  border-radius: 999px;
  background: rgba(8, 16, 24, 0.66);
}

.lang-switch__btn {
  border: 0;
  border-radius: 999px;
  padding: 4px 10px;
  font-family: "Space Grotesk", sans-serif;
  font-size: 0.68rem;
  letter-spacing: 0.08em;
  color: #b5cada;
  background: transparent;
  cursor: pointer;
}

.lang-switch__btn.is-active {
  color: #e9f5ff;
  background: rgba(79, 154, 197, 0.35);
}

.lang-switch__btn:focus-visible {
  outline: 1px solid rgba(139, 226, 255, 0.74);
  outline-offset: 1px;
}

.identity {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.identity__name {
  font-family: "Space Grotesk", sans-serif;
  font-size: 0.9rem;
  letter-spacing: 0.22em;
  color: #dce8f4;
}

.identity__accent {
  font-weight: 700;
  color: #ffffff;
  text-shadow: 0 0 10px rgba(139, 226, 255, 0.12);
}

.identity__role {
  font-size: 0.8rem;
  color: var(--muted);
}

.status-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 1px solid rgba(88, 216, 146, 0.4);
  border-radius: 999px;
  padding: 7px 12px;
  font-size: 0.74rem;
  color: #cdeeda;
  background: rgba(6, 20, 14, 0.52);
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--ok);
  box-shadow: 0 0 16px rgba(88, 216, 146, 0.72);
}

body.booting .status-chip {
  border-color: rgba(223, 156, 97, 0.52);
  color: #ffe0c2;
  background: rgba(34, 17, 9, 0.62);
}

body.booting .status-dot {
  background: #f2a35e;
  box-shadow: 0 0 14px rgba(242, 163, 94, 0.72);
}

body.booting.boot-offline .status-chip {
  border-color: rgba(231, 101, 101, 0.54);
  color: #ffd0d0;
  background: rgba(36, 11, 11, 0.66);
}

body.booting.boot-offline .status-dot {
  background: #ea5f5f;
  box-shadow: 0 0 14px rgba(234, 95, 95, 0.72);
}

body.core-offline .status-chip {
  border-color: rgba(231, 101, 101, 0.54);
  color: #ffd0d0;
  background: rgba(36, 11, 11, 0.66);
}

body.core-offline .status-dot {
  background: #ea5f5f;
  box-shadow: 0 0 14px rgba(234, 95, 95, 0.72);
}

body.core-syncing .status-chip {
  border-color: rgba(223, 156, 97, 0.52);
  color: #ffe0c2;
  background: rgba(34, 17, 9, 0.62);
}

body.core-syncing .status-dot {
  background: #f2a35e;
  box-shadow: 0 0 14px rgba(242, 163, 94, 0.72);
}

.core-stage {
  position: relative;
  height: calc(100vh - 96px);
  border: 1px solid rgba(130, 171, 207, 0.2);
  border-radius: var(--radius-lg);
  background: linear-gradient(160deg, rgba(8, 13, 18, 0.62), rgba(8, 14, 20, 0.84));
  box-shadow: var(--shadow);
  overflow: hidden;
}

.startup-gate {
  position: absolute;
  inset: 0;
  z-index: 7;
  display: grid;
  place-items: center;
  background:
    radial-gradient(circle at 30% 26%, rgba(109, 145, 173, 0.14), transparent 36%),
    linear-gradient(170deg, rgba(6, 12, 19, 0.82), rgba(7, 14, 21, 0.86));
  opacity: 0;
  pointer-events: none;
  transition: opacity 320ms ease;
}

body.awaiting-start .startup-gate {
  opacity: 1;
  pointer-events: auto;
}

.startup-gate__panel {
  width: min(560px, calc(100% - 40px));
  border: 1px solid rgba(148, 112, 112, 0.34);
  border-radius: 16px;
  background: rgba(17, 10, 12, 0.76);
  box-shadow: 0 24px 68px rgba(0, 0, 0, 0.52);
  padding: 22px 22px 20px;
  text-align: center;
}

.startup-gate__panel h2 {
  margin: 10px 0 10px;
  font-family: "Space Grotesk", sans-serif;
}

.startup-gate__panel p {
  margin: 0;
  color: #d6c0c0;
}

.startup-gate__button {
  margin-top: 16px;
  border: 1px solid rgba(229, 124, 124, 0.52);
  border-radius: 999px;
  padding: 10px 18px;
  font-family: "Space Grotesk", sans-serif;
  font-size: 0.86rem;
  letter-spacing: 0.05em;
  color: #ffe3e3;
  background: linear-gradient(140deg, rgba(92, 30, 30, 0.9), rgba(54, 17, 17, 0.86));
  cursor: pointer;
}

.startup-gate__button:hover,
.startup-gate__button:focus-visible {
  border-color: rgba(246, 151, 151, 0.72);
  box-shadow: 0 0 0 1px rgba(246, 151, 151, 0.25), 0 10px 24px rgba(81, 26, 26, 0.48);
}

#core-canvas,
.node-links,
.node-layer,
.core-center {
  position: absolute;
  inset: 0;
}

#core-canvas {
  width: 100%;
  height: 100%;
}

.node-links {
  z-index: 2;
  pointer-events: none;
  opacity: 0;
  transition: opacity 420ms ease;
}

.link-line {
  stroke: var(--line);
  stroke-width: 1.3;
  stroke-linecap: round;
  filter: drop-shadow(0 0 10px rgba(81, 186, 212, 0.2));
  transition: stroke 240ms ease, stroke-width 240ms ease, opacity 240ms ease;
}

.link-line--primary {
  stroke-width: 2.8;
  opacity: 0.96;
}

.link-line.active {
  stroke: var(--line-active);
  stroke-width: 1.9;
  opacity: 1;
}

.link-line--primary.active {
  stroke-width: 3.4;
}

.link-particle {
  fill: rgba(152, 229, 255, 0.75);
  opacity: 0.42;
  filter: drop-shadow(0 0 8px rgba(107, 214, 248, 0.46));
  transition: opacity 240ms ease, fill 240ms ease;
}

.link-particle.active {
  opacity: 0.9;
  fill: rgba(184, 241, 255, 0.95);
}

.core-center {
  z-index: 1;
  width: 12px;
  height: 12px;
  margin: auto;
  border-radius: 50%;
  background: radial-gradient(circle, #9edfff 0%, #53c6e0 38%, rgba(83, 198, 224, 0.08) 78%);
  box-shadow: 0 0 14px rgba(87, 201, 227, 0.65), 0 0 52px rgba(87, 201, 227, 0.28);
  opacity: 0;
  transform: scale(0.08);
  transition: opacity 360ms ease, transform 680ms cubic-bezier(0.22, 1, 0.36, 1);
}

.node-layer {
  z-index: 4;
}

.module-node {
  position: absolute;
  min-width: 140px;
  border: 1px solid rgba(146, 180, 208, 0.3);
  border-radius: var(--radius-md);
  background: rgba(9, 18, 27, 0.58);
  color: var(--text);
  backdrop-filter: blur(6px);
  box-shadow: 0 14px 36px rgba(0, 0, 0, 0.35);
  padding: 10px 14px;
  text-align: left;
  cursor: pointer;
  opacity: 0;
  transform: translate3d(0, 10px, 0) scale(0.96);
  pointer-events: none;
  --reveal-delay: 0ms;
  transition: transform 260ms ease, border-color 260ms ease, box-shadow 260ms ease, background 260ms ease, opacity 380ms ease;
}

.module-node:nth-child(1) { --reveal-delay: 20ms; }
.module-node:nth-child(2) { --reveal-delay: 80ms; }
.module-node:nth-child(3) { --reveal-delay: 140ms; }
.module-node:nth-child(4) { --reveal-delay: 200ms; }
.module-node:nth-child(5) { --reveal-delay: 260ms; }
.module-node:nth-child(6) { --reveal-delay: 320ms; }

.module-node:hover,
.module-node:focus-visible {
  transform: scale(1.015);
  border-color: rgba(133, 231, 255, 0.62);
  background: rgba(12, 28, 38, 0.76);
}

.module-node.is-active {
  transform: scale(1.03);
  border-color: rgba(133, 231, 255, 0.86);
  background: rgba(12, 28, 38, 0.84);
  box-shadow: 0 16px 42px rgba(19, 64, 84, 0.42);
  transition-delay: 95ms;
}

.module-node--keyping {
  min-width: 176px;
  border-color: rgba(83, 198, 224, 0.84);
  background: linear-gradient(140deg, rgba(13, 32, 46, 0.92), rgba(10, 25, 34, 0.72));
  box-shadow: 0 0 0 1px rgba(139, 226, 255, 0.34), 0 18px 48px rgba(13, 53, 73, 0.56);
}

.module-node--keyping .node-title {
  color: #edf9ff;
}

.module-node--keyping .node-meta {
  color: #b9e7fb;
}

.module-node--keyping:hover,
.module-node--keyping:focus-visible,
.module-node--keyping.is-active {
  box-shadow: 0 0 0 1px rgba(139, 226, 255, 0.64), 0 20px 52px rgba(34, 132, 169, 0.54);
}

.module-node--locked {
  border-style: dashed;
}

.node-title {
  display: block;
  font-family: "Space Grotesk", sans-serif;
  letter-spacing: 0.02em;
  font-size: 1rem;
}

.node-meta {
  display: block;
  margin-top: 4px;
  font-size: 0.76rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.core-copy,
.info-dock {
  position: absolute;
  z-index: 2;
  width: min(420px, calc(100% - 40px));
  border: 1px solid rgba(130, 171, 207, 0.22);
  border-radius: 16px;
  background: var(--panel);
  backdrop-filter: blur(7px);
  opacity: 0;
  transform: translateY(12px);
  transition: opacity 420ms ease, transform 420ms ease;
}

.core-copy {
  left: 20px;
  bottom: 22px;
  padding: 18px 18px 16px;
}

.info-dock {
  right: 20px;
  bottom: 22px;
  padding: 14px 16px 16px;
}

.eyebrow {
  margin: 0;
  font-size: 0.7rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: #8eb5d1;
}

.core-copy h1,
.info-dock h2,
.keyping-header h2 {
  font-family: "Space Grotesk", sans-serif;
  margin: 10px 0 10px;
}

.core-copy h1 {
  font-size: clamp(1.2rem, 2vw, 1.72rem);
  line-height: 1.25;
}

.core-copy p,
.info-dock p {
  margin: 0;
  color: #bfd0df;
  line-height: 1.52;
  font-size: 0.92rem;
}

.info-dock__label {
  color: #8fb4ce;
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: 0.11em;
  font-size: 0.68rem;
}

.mobile-modules {
  display: none;
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 420ms ease, transform 420ms ease;
}

.keyping-view {
  position: fixed;
  inset: 0;
  z-index: 6;
  opacity: 0;
  pointer-events: none;
  transform: translateY(10px) scale(0.985);
  transition: opacity 420ms ease, transform 520ms cubic-bezier(0.22, 1, 0.36, 1);
  padding: 26px;
  background:
    radial-gradient(circle at 80% 18%, rgba(81, 183, 214, 0.14), transparent 38%),
    linear-gradient(170deg, rgba(7, 13, 19, 0.96), rgba(7, 16, 23, 0.94));
}

.keyping-page .system-shell {
  opacity: 1;
  transform: none;
  filter: none;
}

.keyping-stage {
  position: relative;
  padding: 24px;
  overflow: auto;
  background:
    radial-gradient(circle at 80% 20%, rgba(81, 183, 214, 0.16), transparent 42%),
    linear-gradient(170deg, rgba(7, 13, 19, 0.85), rgba(7, 16, 23, 0.9));
  transition: filter 420ms cubic-bezier(0.22, 1, 0.36, 1), opacity 420ms cubic-bezier(0.22, 1, 0.36, 1), transform 420ms cubic-bezier(0.22, 1, 0.36, 1);
}

.keyping-stage::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(90deg, rgba(132, 180, 211, 0.08) 1px, transparent 1px),
    linear-gradient(0deg, rgba(132, 180, 211, 0.08) 1px, transparent 1px);
  background-size: 28px 28px;
  opacity: 0.18;
}

.keyping-back {
  position: sticky;
  top: 0;
  z-index: 4;
  display: inline-flex;
  margin-bottom: 16px;
  text-decoration: none;
}

body.is-leaving-keyping .keyping-stage {
  filter: blur(4px) saturate(1.08);
  opacity: 0.72;
  transform: scale(0.985) translateY(-10px);
}

.back-button {
  border: 1px solid rgba(138, 170, 196, 0.3);
  border-radius: 999px;
  color: #d7e5f2;
  background: rgba(11, 20, 31, 0.82);
  padding: 10px 16px;
  cursor: pointer;
}

.back-button:hover,
.back-button:focus-visible {
  border-color: rgba(139, 226, 255, 0.7);
}

.keyping-header {
  display: flex;
  align-items: center;
  gap: 18px;
  margin: 0 0 20px;
  padding-bottom: 16px;
  border-bottom: 1px solid rgba(122, 165, 193, 0.22);
}

.keyping-mark {
  width: 74px;
  aspect-ratio: 1;
  border-radius: 20px;
  border: 1px solid rgba(152, 222, 242, 0.6);
  background: linear-gradient(150deg, rgba(23, 60, 82, 0.88), rgba(10, 24, 33, 0.72));
  box-shadow: 0 0 0 1px rgba(109, 194, 223, 0.32), 0 14px 34px rgba(14, 42, 56, 0.54);
  display: grid;
  place-items: center;
}

.keyping-mark span {
  font-family: "Space Grotesk", sans-serif;
  font-size: 2rem;
  color: #d9f6ff;
}

.keyping-tagline {
  margin: 0;
  color: #b8ccde;
}

.keyping-module-shell {
  position: relative;
  z-index: 1;
  border: 1px solid rgba(132, 172, 199, 0.24);
  border-radius: 16px;
  background:
    linear-gradient(165deg, rgba(9, 16, 24, 0.9), rgba(8, 13, 20, 0.84));
  box-shadow: 0 24px 58px rgba(3, 8, 13, 0.5);
  padding: 18px;
  transform: translateY(8px);
  opacity: 0;
  transition: transform 460ms cubic-bezier(0.22, 1, 0.36, 1), opacity 420ms ease;
}

.keyping-title {
  flex: 1;
}

.keyping-health {
  min-width: 220px;
  border: 1px solid rgba(111, 154, 182, 0.3);
  border-radius: 12px;
  background: rgba(8, 17, 25, 0.68);
  padding: 10px 12px;
  text-align: right;
}

.keyping-health__label {
  margin: 0 0 4px;
  font-size: 0.66rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: #8fb5cf;
}

.keyping-health__state {
  margin: 0;
  color: #beeaf7;
  font-family: "Space Grotesk", sans-serif;
  font-size: 0.9rem;
}

.keyping-page.is-keyping-ready .keyping-module-shell {
  transform: none;
  opacity: 1;
}

.keyping-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 0 16px;
}

.keyping-pill {
  border: 1px solid rgba(140, 188, 216, 0.34);
  border-radius: 999px;
  padding: 6px 10px;
  background: rgba(10, 24, 35, 0.6);
  font-size: 0.74rem;
  letter-spacing: 0.04em;
  color: #cbe4f4;
}

.keyping-section {
  border: 1px solid rgba(134, 175, 201, 0.2);
  border-radius: 14px;
  background:
    linear-gradient(156deg, rgba(10, 22, 33, 0.84), rgba(8, 18, 27, 0.74));
  padding: 14px;
}

.keyping-section h3 {
  margin: 0 0 10px;
  font-family: "Space Grotesk", sans-serif;
  font-size: 1rem;
}

.keyping-section p {
  margin: 0;
  color: #bed2e2;
  line-height: 1.5;
}

.keyping-section p + p {
  margin-top: 10px;
}

.keyping-actions {
  margin-top: 14px;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.keyping-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(129, 173, 201, 0.34);
  border-radius: 999px;
  padding: 9px 14px;
  color: #d8ebf8;
  text-decoration: none;
  font-size: 0.82rem;
  font-family: "Space Grotesk", sans-serif;
  letter-spacing: 0.04em;
  background: rgba(9, 21, 31, 0.68);
}

.keyping-action--primary {
  border-color: rgba(99, 201, 227, 0.54);
  background: linear-gradient(140deg, rgba(26, 78, 104, 0.86), rgba(16, 48, 67, 0.78));
}

.keyping-action:hover,
.keyping-action:focus-visible {
  border-color: rgba(142, 230, 255, 0.72);
  box-shadow: 0 0 0 1px rgba(139, 226, 255, 0.22), 0 12px 22px rgba(7, 30, 45, 0.45);
}

.keyping-grid {
  display: grid;
  gap: 14px;
  grid-template-columns: repeat(2, minmax(260px, 1fr));
  margin-top: 14px;
}

.keyping-card {
  position: relative;
  overflow: hidden;
}

.keyping-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(152, 221, 245, 0.55), transparent);
}

.keyping-card h3 {
  padding-right: 10px;
}

.keyping-list {
  margin: 0;
  padding-left: 18px;
  display: grid;
  gap: 7px;
}

.keyping-list li {
  color: #c5d8e7;
  line-height: 1.45;
}

.keyping-flow {
  margin: 12px 0 0;
  padding-left: 18px;
  display: grid;
  gap: 8px;
}

.keyping-flow li {
  color: #c5d8e7;
  line-height: 1.45;
}

.keyping-stack-line {
  display: grid;
  gap: 3px;
  margin-top: 10px !important;
}

.keyping-stack-line:first-of-type {
  margin-top: 0 !important;
}

.keyping-stack-line span {
  font-size: 0.74rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #8db5d2;
}

.keyping-stack-line strong {
  color: #d6e8f6;
  font-size: 0.9rem;
  font-weight: 600;
}

.keyping-fingerprint-label,
.keyping-cmd-label {
  margin-top: 12px !important;
  font-size: 0.76rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #8fb8d2;
}

.keyping-fingerprint {
  display: inline-block;
  margin-top: 6px;
  border: 1px solid rgba(140, 183, 210, 0.28);
  border-radius: 10px;
  background: rgba(6, 16, 24, 0.72);
  padding: 8px 10px;
  color: #d7ecf8;
  font-family: "Consolas", "SFMono-Regular", "Menlo", monospace;
  font-size: 0.82rem;
}

.keyping-code {
  margin: 7px 0 0;
  border: 1px solid rgba(130, 170, 194, 0.24);
  border-radius: 10px;
  background: rgba(4, 11, 17, 0.9);
  padding: 10px;
  color: #c3deee;
  font-family: "Consolas", "SFMono-Regular", "Menlo", monospace;
  font-size: 0.78rem;
  overflow-x: auto;
}

.keyping-section--roadmap {
  margin-top: 14px;
}

.keyping-section--roadmap .keyping-list {
  margin-top: 8px;
}

body.is-leaving-keyping .keyping-section,
body.is-leaving-keyping .keyping-pill {
  border-color: rgba(156, 190, 212, 0.24);
}

body.is-leaving-keyping .keyping-action {
  filter: saturate(0.86);
}

body.is-transitioning .core-stage {
  filter: saturate(1.15) blur(2px);
}

body.is-leaving-keyping .keyping-module-shell {
  transform: translateY(-6px) scale(0.992);
  opacity: 0.9;
}

body.is-keyping-view .system-shell {
  opacity: 0;
  pointer-events: none;
  transform: scale(0.99);
}

body.is-keyping-view .keyping-view {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: auto;
}

body.intro-step-1 .backdrop {
  opacity: 1;
}

body.intro-step-1 .core-center {
  opacity: 1;
  transform: scale(0.12);
}

body.intro-step-2 .core-center {
  opacity: 1;
  transform: scale(1);
}

body.intro-step-5 .node-links {
  opacity: 1;
}

body.intro-step-6 .module-node {
  opacity: 1;
  transform: translate3d(0, 0, 0) scale(1);
  pointer-events: auto;
  transition-delay: var(--reveal-delay);
}

body.intro-step-6 .module-node--locked {
  opacity: 0.86;
}

body.intro-step-6 .core-copy,
body.intro-step-6 .info-dock,
body.intro-step-6 .mobile-modules {
  opacity: 1;
  transform: none;
}

@media (max-width: 1024px) {
  .core-copy,
  .info-dock {
    width: min(360px, calc(100% - 34px));
  }

  .module-node {
    min-width: 126px;
  }
}

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

  .system-shell {
    min-height: auto;
    padding: 14px;
  }

  .topbar {
    margin-bottom: 10px;
    align-items: flex-start;
    flex-wrap: wrap;
  }

  .topbar-controls {
    width: 100%;
    justify-content: space-between;
  }

  .core-stage {
    height: auto;
    min-height: 0;
    border-radius: 18px;
    padding: 184px 14px 14px;
  }

  .node-layer,
  .node-links {
    display: none;
  }

  #core-canvas,
  .core-center {
    inset: 16px 14px auto;
    height: 142px;
  }

  .core-center {
    display: none;
  }

  .core-copy {
    position: relative;
    left: auto;
    right: auto;
    bottom: auto;
    width: 100%;
    margin: 0;
  }

  .info-dock {
    position: relative;
    right: auto;
    left: auto;
    bottom: auto;
    width: 100%;
    margin-top: 12px;
  }

  .core-copy h1 {
    font-size: 1.12rem;
  }

  .core-copy p,
  .info-dock p {
    font-size: 0.88rem;
  }

  .mobile-modules {
    margin-top: 12px;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
  }

  .mobile-modules__item {
    border: 1px solid rgba(129, 168, 194, 0.28);
    border-radius: 12px;
    background: rgba(10, 19, 29, 0.75);
    color: #d6e4f2;
    padding: 10px 8px;
    font-family: "Space Grotesk", sans-serif;
    font-size: 0.8rem;
  }

  .keyping-view {
    position: fixed;
    overflow-y: auto;
    padding: 16px;
  }

  .keyping-header {
    align-items: flex-start;
    flex-wrap: wrap;
  }

  .keyping-health {
    min-width: 100%;
    text-align: left;
  }

  .keyping-grid {
    grid-template-columns: 1fr;
    padding-bottom: 22px;
  }

  .keyping-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .keyping-action {
    width: 100%;
  }

  .startup-gate__panel {
    width: calc(100% - 22px);
    padding: 18px 16px 16px;
  }
}

@media (prefers-reduced-motion: reduce) {
  * {
    animation: none !important;
    transition: none !important;
  }

  .boot-sequence {
    display: none;
  }
}
