:root {
  --void: #05080f;
  --ink: #d7e8f6;
  --mute: #8ea4bb;
  --faint: #61758c;
  --cyan: #4ce3d4;
  --ice: #7ecbff;
  --violet: #b48cff;
  --panel: rgba(9, 18, 32, 0.78);
  --panel-deep: rgba(6, 12, 22, 0.9);
  --line: rgba(94, 220, 255, 0.28);
  --line-hot: rgba(76, 227, 212, 0.55);
  --warn: #e8b15a;
  --halt: #ff6d7d;
  --ok: #3dcf9a;
  --focus: 0 0 0 3px rgba(76, 227, 212, 0.38);
  --width: 1160px;
  --mono: ui-monospace, "Cascadia Code", Consolas, "Courier New", monospace;
  --sans: "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: auto;
}

html.lab-live {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  font: 16px/1.7 var(--sans);
  background: var(--void);
}

body.dock-lock {
  overflow: hidden;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

a {
  color: var(--ice);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.18em;
}

a:hover {
  color: var(--cyan);
}

:focus {
  outline: none;
}

:focus-visible {
  outline: 2px solid var(--cyan);
  outline-offset: 3px;
  box-shadow: var(--focus);
}

.skip {
  position: absolute;
  left: 1rem;
  top: -3rem;
  z-index: 80;
  padding: 0.45rem 0.8rem;
  background: #0d1c2c;
  color: var(--cyan);
  border: 1px solid var(--line-hot);
}

.skip:focus {
  top: 0.7rem;
}

.cosmos {
  position: fixed;
  inset: 0;
  z-index: -2;
  overflow: hidden;
  pointer-events: none;
  background:
    radial-gradient(900px 520px at 8% -10%, rgba(46, 130, 180, 0.28), transparent 62%),
    radial-gradient(760px 480px at 96% 6%, rgba(92, 58, 160, 0.22), transparent 60%),
    radial-gradient(640px 420px at 70% 110%, rgba(20, 90, 110, 0.2), transparent 58%),
    linear-gradient(180deg, #071018 0%, #05080f 48%, #08131c 100%);
}

.cosmos canvas {
  display: block;
  width: 100%;
  height: 100%;
  opacity: 0.72;
}

.grid-skin {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(90, 180, 220, 0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(90, 180, 220, 0.05) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: radial-gradient(ellipse at 50% 30%, #000 20%, transparent 78%);
}

.routes {
  position: absolute;
  inset: 8% 6% auto auto;
  width: min(42vw, 520px);
  height: 280px;
  opacity: 0.55;
}

.routes circle {
  fill: var(--cyan);
}

.routes path {
  fill: none;
  stroke: rgba(110, 210, 255, 0.45);
  stroke-width: 1.1;
  stroke-dasharray: 5 7;
}

html.lab-live .routes path {
  animation: dash 18s linear infinite;
}

.wrap {
  width: min(var(--width), calc(100% - 2rem));
  margin: 0 auto;
}

.mast {
  position: sticky;
  top: 0;
  z-index: 40;
  border-bottom: 1px solid transparent;
}

.mast.raised {
  background: rgba(5, 10, 18, 0.86);
  border-bottom-color: var(--line);
  backdrop-filter: blur(12px);
}

.mast-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  min-height: 72px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  color: inherit;
  text-decoration: none;
}

.brand img {
  width: 40px;
  height: 40px;
  border-radius: 8px;
  border: 1px solid var(--line);
}

.brand strong {
  display: block;
  font-size: 1rem;
  letter-spacing: 0.02em;
}

.brand small {
  display: block;
  color: var(--cyan);
  font: 11px/1.3 var(--mono);
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.burger {
  display: none;
  border: 1px solid var(--line);
  background: var(--panel);
  color: var(--ink);
  padding: 0.45rem 0.75rem;
  font: 13px/1 var(--mono);
  letter-spacing: 0.08em;
  cursor: pointer;
}

.dock ul {
  display: flex;
  align-items: center;
  gap: 0.15rem 1.05rem;
  list-style: none;
  margin: 0;
  padding: 0;
}

.dock a {
  color: var(--mute);
  text-decoration: none;
  font-size: 0.95rem;
}

.dock a:hover,
.dock a[aria-current="page"] {
  color: var(--ink);
}

.dock a.act {
  display: inline-flex;
  align-items: center;
  padding: 0.38rem 0.85rem;
  border: 1px solid var(--line-hot);
  background: linear-gradient(180deg, rgba(76, 227, 212, 0.18), rgba(76, 227, 212, 0.05));
  color: var(--cyan);
}

.hero {
  padding: 2.4rem 0 1.2rem;
}

.chassis {
  position: relative;
  background: var(--panel);
  border: 1px solid var(--line);
  padding: clamp(1.1rem, 2.4vw, 2rem);
}

.chassis::before,
.chassis::after {
  content: "";
  position: absolute;
  width: 14px;
  height: 14px;
  border: 1.5px solid var(--cyan);
  pointer-events: none;
}

.chassis::before {
  top: -1px;
  left: -1px;
  border-right: 0;
  border-bottom: 0;
}

.chassis::after {
  right: -1px;
  bottom: -1px;
  border-left: 0;
  border-top: 0;
}

.split {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr);
  gap: 1.6rem;
  align-items: center;
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 0.85rem;
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.22rem 0.65rem;
  border: 1px solid var(--line);
  color: var(--mute);
  font: 12px/1.4 var(--mono);
  letter-spacing: 0.06em;
}

.chip.on {
  color: var(--cyan);
  border-color: var(--line-hot);
}

.chip .led {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--ok);
  box-shadow: 0 0 8px var(--ok);
}

html.lab-live .chip.on .led {
  animation: blink 2.4s ease-in-out infinite;
}

.kicker {
  margin: 0 0 0.35rem;
  color: var(--cyan);
  font: 12px/1.4 var(--mono);
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

h1,
h2,
h3 {
  margin: 0 0 0.65rem;
  font-weight: 650;
  line-height: 1.25;
  letter-spacing: 0.01em;
}

h1 {
  font-size: clamp(2rem, 4.2vw, 3.15rem);
}

h2 {
  font-size: clamp(1.35rem, 2.4vw, 1.85rem);
}

h3 {
  font-size: 1.05rem;
}

.lead,
.brief,
.foot p {
  color: var(--mute);
}

.lead {
  margin: 0 0 1.1rem;
}

.brief {
  margin: 0 0 1.15rem;
  max-width: 68ch;
}

.memo {
  margin: 0 0 1rem;
  padding: 0.75rem 0.9rem;
  border-left: 2px solid var(--cyan);
  background: rgba(76, 227, 212, 0.06);
}

.memo h3 {
  margin-bottom: 0.25rem;
  color: var(--cyan);
  font-size: 0.92rem;
  font-family: var(--mono);
}

.memo p {
  margin: 0;
  color: var(--mute);
  font-size: 0.95rem;
}

.memo.warn {
  border-left-color: var(--warn);
  background: rgba(232, 177, 90, 0.08);
}

.memo.warn h3 {
  color: var(--warn);
}

.memo.halt {
  border-left-color: var(--halt);
  background: rgba(255, 109, 125, 0.08);
}

.memo.halt h3 {
  color: var(--halt);
}

.acts {
  display: flex;
  flex-wrap: wrap;
  gap: 0.7rem;
  margin: 1.1rem 0 1.4rem;
}

.act,
.alt {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0.45rem 1.05rem;
  text-decoration: none;
  font-weight: 600;
}

.act {
  background: linear-gradient(180deg, #5af0dc, #2bb8b0);
  color: #062018;
  border: 1px solid #8ffff0;
}

.act:hover {
  color: #03140f;
  filter: brightness(1.06);
}

.alt {
  border: 1px solid var(--line);
  color: var(--ink);
  background: rgba(255, 255, 255, 0.02);
}

.alt:hover {
  color: var(--cyan);
  border-color: var(--line-hot);
}

.readouts {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.7rem;
}

.readout {
  padding: 0.75rem 0.8rem;
  border: 1px solid var(--line);
  background: var(--panel-deep);
}

.readout b {
  display: block;
  color: var(--cyan);
  font: 700 1.35rem/1.1 var(--mono);
}

.readout span {
  display: block;
  margin-top: 0.3rem;
  color: var(--ink);
  font-size: 0.92rem;
}

.readout em {
  display: block;
  margin-top: 0.25rem;
  color: var(--faint);
  font-style: normal;
  font-size: 0.78rem;
  font-family: var(--mono);
}

.viewport {
  margin: 0;
}

.viewport img {
  width: 100%;
  border: 1px solid var(--line);
  background: #081018;
}

.viewport figcaption {
  margin-top: 0.45rem;
  color: var(--faint);
  font: 12px/1.4 var(--mono);
}

.scan {
  position: relative;
}

html.lab-live .scan::after {
  content: "";
  position: absolute;
  inset: 0 auto auto 0;
  width: 100%;
  height: 28%;
  background: linear-gradient(180deg, transparent, rgba(110, 230, 255, 0.12), transparent);
  animation: scan 5.6s linear infinite;
  pointer-events: none;
}

.bay {
  padding: 1.15rem 0;
}

html.lab-live [data-bay] {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

html.lab-live [data-bay].lit {
  opacity: 1;
  transform: none;
}

.grid-4,
.grid-2 {
  display: grid;
  gap: 0.8rem;
}

.grid-4 {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.grid-2 {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.cell,
.os {
  display: block;
  padding: 0.95rem 0.95rem 1.05rem;
  border: 1px solid var(--line);
  background: rgba(7, 16, 28, 0.55);
  color: inherit;
  text-decoration: none;
}

a.cell:hover,
a.os:hover {
  border-color: var(--line-hot);
  color: inherit;
}

.tag {
  display: inline-block;
  margin-bottom: 0.45rem;
  color: var(--violet);
  font: 11px/1.3 var(--mono);
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.cell p,
.os p {
  margin: 0.35rem 0 0;
  color: var(--mute);
  font-size: 0.94rem;
}

.glyph {
  width: 36px;
  height: 36px;
  margin-bottom: 0.55rem;
  border: 1px solid var(--line-hot);
  background:
    linear-gradient(135deg, rgba(76, 227, 212, 0.18), transparent 55%),
    rgba(8, 20, 32, 0.8);
}

.g-core {
  clip-path: polygon(50% 0, 100% 38%, 82% 100%, 18% 100%, 0 38%);
}

.g-yaml {
  border-radius: 3px;
  box-shadow: inset 6px 0 0 rgba(126, 203, 255, 0.45);
}

.g-theme {
  border-radius: 50%;
}

.g-guard {
  clip-path: polygon(50% 0, 100% 22%, 100% 62%, 50% 100%, 0 62%, 0 22%);
}

.g-win { border-radius: 2px; }
.g-mac { border-radius: 40% 40% 28% 28%; }
.g-linux { clip-path: polygon(50% 0, 100% 100%, 0 100%); }
.g-and { border-radius: 10px 10px 4px 4px; }

.pair {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 1.3rem;
  align-items: center;
}

.ticks {
  margin: 0 0 1rem;
  padding-left: 1.1rem;
  color: var(--mute);
}

.ticks li + li {
  margin-top: 0.35rem;
}

.crumbs {
  margin: 0 0 0.7rem;
  color: var(--faint);
  font: 12px/1.4 var(--mono);
}

.crumbs a {
  color: var(--ice);
  text-decoration: none;
}

.ladder {
  display: grid;
  gap: 0.7rem;
}

.rung {
  display: grid;
  grid-template-columns: 42px 1fr;
  gap: 0.8rem;
  align-items: start;
  padding: 0.8rem;
  border: 1px solid var(--line);
  background: rgba(7, 16, 28, 0.5);
}

.rung b {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border: 1px solid var(--line-hot);
  color: var(--cyan);
  font: 700 1rem/1 var(--mono);
}

.rung p {
  margin: 0;
  color: var(--mute);
}

.sheet-hold {
  overflow-x: auto;
  border: 1px solid var(--line);
}

.sheet {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.94rem;
}

.sheet th,
.sheet td {
  padding: 0.65rem 0.75rem;
  text-align: left;
  border-bottom: 1px solid var(--line);
}

.sheet th {
  color: var(--cyan);
  font: 12px/1.3 var(--mono);
  letter-spacing: 0.08em;
  background: rgba(76, 227, 212, 0.06);
}

.sheet td {
  color: var(--mute);
}

.sheet code {
  color: var(--ice);
  font-family: var(--mono);
}

.ask details {
  border: 1px solid var(--line);
  background: rgba(7, 16, 28, 0.5);
  margin-bottom: 0.55rem;
}

.ask summary {
  cursor: pointer;
  padding: 0.75rem 0.9rem;
  color: var(--ink);
  font-weight: 600;
  list-style: none;
}

.ask summary::-webkit-details-marker {
  display: none;
}

.ask summary::after {
  content: "+";
  float: right;
  color: var(--cyan);
  font-family: var(--mono);
}

.ask details[open] summary::after {
  content: "–";
}

.ask details p {
  margin: 0;
  padding: 0 0.9rem 0.85rem;
  color: var(--mute);
}

.foot {
  padding: 2rem 0 1.4rem;
}

.foot-grid {
  display: grid;
  grid-template-columns: 1.4fr 0.8fr 0.8fr 1.1fr;
  gap: 1.2rem;
}

.foot h3 {
  color: var(--cyan);
  font: 12px/1.3 var(--mono);
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.foot ul {
  margin: 0;
  padding: 0;
  list-style: none;
}

.foot li + li {
  margin-top: 0.3rem;
}

.foot a {
  color: var(--mute);
  text-decoration: none;
}

.foot a:hover {
  color: var(--cyan);
}

.legal {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.5rem;
  margin-top: 1.2rem;
  padding-top: 0.9rem;
  border-top: 1px solid var(--line);
  color: var(--faint);
  font: 12px/1.5 var(--mono);
}

#github {
  margin-top: 0.75rem;
  color: var(--faint);
  font-size: 0.88rem;
}

@keyframes blink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.35; }
}

@keyframes dash {
  to { stroke-dashoffset: -180; }
}

@keyframes scan {
  0% { transform: translateY(-20%); }
  100% { transform: translateY(360%); }
}

@media (max-width: 980px) {
  .split,
  .pair,
  .grid-4,
  .foot-grid {
    grid-template-columns: 1fr 1fr;
  }

  .readouts {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 760px) {
  .burger {
    display: inline-flex;
  }

  .dock {
    display: none;
    position: absolute;
    left: 1rem;
    right: 1rem;
    top: calc(100% + 0.4rem);
    padding: 0.7rem;
    background: var(--panel-deep);
    border: 1px solid var(--line);
  }

  .dock.spread {
    display: block;
  }

  .dock ul {
    flex-direction: column;
    align-items: stretch;
  }

  .dock a {
    display: block;
    padding: 0.55rem 0.4rem;
  }

  .split,
  .pair,
  .grid-4,
  .grid-2,
  .foot-grid {
    grid-template-columns: 1fr;
  }

  .mast {
    position: relative;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
  }

  .cosmos canvas,
  .routes {
    display: none;
  }

  html.lab-live [data-bay] {
    opacity: 1;
    transform: none;
  }
}
