/* section9 site
   NEXUS cyberpunk interface: neon magenta over near-black, aggressive geometry,
   Orbitron display, Rajdhani body, JetBrains Mono HUD. Original interpretation
   inspired by Ghost in the Shell: Stand Alone Complex. */

:root {
  /* NEXUS palette */
  --pink: #ff007f;
  --pink-glow: #ff2a85;
  --pink-deep: #9e004d;
  --void: #0a0508;
  --surface: #160a12;
  --glass: rgba(22, 10, 18, 0.78);
  --white: #ffffff;
  --text-2: #e2b8ce;
  --text-3: #8f5674;
  --danger: #ff1e42;
  --hairline: rgba(255, 0, 127, 0.28);
  --hairline-soft: rgba(255, 0, 127, 0.14);
  --glow-primary: 0 0 15px rgba(255, 0, 127, 0.5);

  /* Type */
  --font-display: "Orbitron", "Arial Black", system-ui, sans-serif;
  --font-body: "Rajdhani", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, "SFMono-Regular", Menlo, monospace;

  --max: 1280px;
  --gutter: 24px;
  --blur-panel: blur(12px);
}

*,
*::before,
*::after { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  scroll-padding-top: 24px;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--void);
  color: var(--white);
  font-family: var(--font-body);
  font-size: 16px;
  font-weight: 500;
  line-height: 1.5;
  overflow-x: hidden;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

img,
video { max-width: 100%; }

img { height: auto; }

::selection {
  background: var(--pink);
  color: var(--white);
}

a {
  color: var(--pink-glow);
  text-decoration-color: rgba(255, 0, 127, 0.5);
  text-underline-offset: 3px;
}

a:hover { text-decoration-color: var(--pink-glow); }

p a,
.aside a,
.faq a,
.credits-page a {
  color: var(--pink-glow);
  text-decoration: underline;
  text-decoration-color: rgba(255, 0, 127, 0.5);
}

code {
  font-family: var(--font-mono);
  font-size: 0.82em;
  color: var(--pink-glow);
  background: rgba(255, 0, 127, 0.1);
  border: 1px solid var(--hairline-soft);
  padding: 1px 6px;
}

pre code {
  background: none;
  border: 0;
  padding: 0;
  font-size: inherit;
  color: inherit;
}

.wrap {
  width: 100%;
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 var(--gutter);
}

.skip {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 100;
  background: var(--pink);
  color: var(--white);
  font-family: var(--font-mono);
  font-size: 11px;
  padding: 10px 16px;
  text-decoration: none;
}

.skip:focus {
  left: 16px;
  top: 16px;
}

/* ---------- backdrop ---------- */

.bg {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
  background:
    radial-gradient(ellipse 72% 48% at 50% -10%, rgba(255, 0, 127, 0.16) 0%, transparent 62%),
    radial-gradient(ellipse 50% 40% at 100% 22%, rgba(158, 0, 77, 0.18) 0%, transparent 70%),
    linear-gradient(180deg, #140710 0%, var(--void) 46%, #060305 100%);
}

.bg::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(to right, rgba(255, 0, 127, 0.055) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(255, 0, 127, 0.055) 1px, transparent 1px);
  background-size: 44px 44px;
  -webkit-mask-image: radial-gradient(ellipse 76% 62% at 50% 0%, #000 0%, transparent 78%);
  mask-image: radial-gradient(ellipse 76% 62% at 50% 0%, #000 0%, transparent 78%);
}

.bg::after {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse 72% 62% at 50% 42%, transparent 42%, rgba(0, 0, 0, 0.6) 100%);
}

.scanlines {
  position: fixed;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  background: repeating-linear-gradient(
    to bottom,
    transparent 0px,
    transparent 2px,
    rgba(0, 0, 0, 0.18) 3px
  );
  opacity: 0.45;
  mix-blend-mode: multiply;
}

.scanlines::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255, 0, 127, 0.4), transparent);
  animation: scan 9s linear infinite;
}

@keyframes scan {
  0% { top: -2%; }
  100% { top: 102%; }
}

/* ---------- top bar ---------- */

.topbar {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  z-index: 40;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 0 clamp(16px, 4vw, 42px);
  min-height: 68px;
  background: linear-gradient(180deg, rgba(10, 5, 8, 0.78) 0%, rgba(10, 5, 8, 0.32) 58%, transparent 100%);
  border-bottom: 1px solid transparent;
}

.brand,
.topnav a {
  text-shadow: 0 2px 14px rgba(0, 0, 0, 0.95), 0 0 30px rgba(0, 0, 0, 0.55);
}

.brand {
  display: inline-flex;
  flex: none;
  align-items: center;
  gap: 11px;
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 900;
  font-style: italic;
  letter-spacing: 0.02em;
  color: var(--white);
  text-decoration: none;
  text-transform: uppercase;
  white-space: nowrap;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 900;
  font-style: italic;
  color: var(--white);
  background: var(--pink);
  clip-path: polygon(0 0, 100% 0, 100% calc(100% - 8px), calc(100% - 8px) 100%, 0 100%);
}

.brand-dim { color: var(--text-2); }

.topnav {
  display: flex;
  align-items: center;
  gap: 2px;
  overflow-x: auto;
  scrollbar-width: none;
}

.topnav::-webkit-scrollbar { display: none; }

.topnav a {
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 400;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-2);
  text-decoration: none;
  white-space: nowrap;
  padding: 9px 11px;
  border: 1px solid transparent;
}

.topnav a:hover,
.topnav a:focus-visible {
  color: var(--white);
  background: rgba(255, 0, 127, 0.12);
  border-color: var(--hairline);
}

.topnav a.active {
  color: var(--white);
  background: rgba(255, 0, 127, 0.18);
  border-color: var(--pink);
  box-shadow: inset 0 -2px 0 var(--pink);
}

.topnav-source {
  margin-left: 6px;
  color: var(--white) !important;
  background: var(--pink);
  border-color: var(--pink) !important;
  clip-path: polygon(12px 0, 100% 0, 100% calc(100% - 12px), calc(100% - 12px) 100%, 0 100%, 0 12px);
}

.topnav-source:hover {
  background: var(--pink-glow) !important;
  box-shadow: var(--glow-primary);
}

/* ---------- hero (NEXUS composition) ---------- */

.hero {
  position: relative;
  z-index: 1;
  overflow: hidden;
  border-bottom: 1px solid var(--hairline);
}

.hero-stage {
  position: relative;
  min-height: clamp(660px, 92vh, 880px);
  overflow: hidden;
  background: var(--void);
}

.hero-video {
  position: absolute;
  inset: 0;
  z-index: 1;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 50% 40%;
  display: block;
  filter: saturate(1.05) contrast(1.04);
  background: var(--void);
}

.hero-veil {
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  background:
    linear-gradient(180deg, rgba(10, 5, 8, 0.62) 0%, transparent 22%, transparent 52%, rgba(10, 5, 8, 0.35) 76%, rgba(10, 5, 8, 0.96) 100%),
    linear-gradient(90deg, rgba(10, 5, 8, 0.35) 0%, transparent 26%, transparent 74%, rgba(10, 5, 8, 0.35) 100%);
}

.hero-body {
  position: relative;
  z-index: 4;
  display: flex;
  align-items: flex-end;
  min-height: clamp(660px, 92vh, 880px);
  padding-top: 120px;
  padding-bottom: 168px;
}

.hero-install-block {
  width: 100%;
  max-width: 900px;
}

.hero-title {
  margin: 0 0 14px;
  font-family: var(--font-display);
  font-style: italic;
  font-weight: 900;
  font-size: clamp(30px, 4.4vw, 56px);
  line-height: 0.95;
  letter-spacing: 0.01em;
  text-transform: uppercase;
  color: var(--white);
  text-shadow: 0 0 34px rgba(255, 0, 127, 0.45), 0 6px 24px rgba(0, 0, 0, 0.8);
}

.hero-install {
  width: 100%;
  max-width: 900px;
  margin: 0;
}

.hero-install code { font-size: 11px; }

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.28; }
}

.exec {
  display: flex;
  align-items: center;
  gap: 10px;
  max-width: 900px;
  padding: 10px 12px;
  background: var(--glass);
  border: 1px solid var(--hairline-soft);
  backdrop-filter: var(--blur-panel);
  -webkit-backdrop-filter: var(--blur-panel);
  clip-path: polygon(0 0, 100% 0, 100% calc(100% - 12px), calc(100% - 12px) 100%, 0 100%);
  font-family: var(--font-mono);
  font-size: 11px;
}

.exec-prompt { color: var(--pink); }

.exec code {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--text-2);
  background: none;
  border: 0;
  padding: 0;
}

.copy {
  flex: none;
  font-family: var(--font-mono);
  font-size: 9px;
  font-weight: 400;
  letter-spacing: 0.12em;
  line-height: 1;
  padding: 6px 9px;
  color: var(--white);
  background: transparent;
  border: 1px solid var(--hairline);
  cursor: pointer;
  clip-path: polygon(0 0, 100% 0, 100% calc(100% - 7px), calc(100% - 7px) 100%, 0 100%);
  transition: background 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
}

.copy:hover,
.copy:focus-visible {
  color: var(--white);
  background: var(--pink);
  border-color: var(--pink);
  box-shadow: var(--glow-primary);
}

.copy.done {
  color: var(--white);
  background: var(--pink-glow);
  border-color: var(--pink-glow);
}

/* Bottom stat cards, like the reference footer band */
.hero-cards {
  position: absolute;
  z-index: 4;
  left: 0;
  right: 0;
  bottom: 0;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  padding: 0 var(--gutter) 18px;
  max-width: var(--max);
  margin: 0 auto;
}

.stat-card {
  position: relative;
  padding: 14px 16px 16px;
  background: var(--glass);
  border: 1px solid var(--hairline-soft);
  border-top: 3px solid var(--pink);
  backdrop-filter: var(--blur-panel);
  -webkit-backdrop-filter: var(--blur-panel);
  clip-path: polygon(0 0, 100% 0, 100% calc(100% - 18px), calc(100% - 18px) 100%, 0 100%);
}

.stat-card::before {
  content: "";
  position: absolute;
  top: -3px;
  left: 0;
  width: 26px;
  height: 3px;
  background: var(--white);
}

.stat-card h3 {
  margin: 0 0 4px;
  font-family: var(--font-display);
  font-size: 13px;
  font-weight: 800;
  font-style: italic;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--white);
}

.stat-card .stat-value {
  display: block;
  font-family: var(--font-display);
  font-size: 30px;
  font-weight: 900;
  font-style: italic;
  line-height: 1;
  color: var(--pink-glow);
  text-shadow: 0 0 18px rgba(255, 0, 127, 0.5);
}

.stat-card p {
  margin: 6px 0 0;
  font-family: var(--font-mono);
  font-size: 8.5px;
  line-height: 1.5;
  letter-spacing: 0.06em;
  color: var(--text-2);
}

.stat-card.danger-card {
  background: rgba(255, 30, 66, 0.12);
  border-color: rgba(255, 30, 66, 0.45);
  border-top-color: var(--danger);
  overflow: hidden;
}

.stat-card.danger-card::before { background: var(--white); }

.danger-stripes {
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(
    -45deg,
    transparent 0 10px,
    rgba(255, 255, 255, 0.16) 10px 18px
  );
  pointer-events: none;
}

.danger-label {
  position: relative;
  display: inline-flex;
  padding: 4px 10px;
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.18em;
  color: var(--white);
  background: rgba(10, 5, 8, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.4);
}

.stat-card.danger-card p {
  position: relative;
  color: var(--white);
  opacity: 0.92;
}

.dot {
  display: inline-block;
  width: 5px;
  height: 5px;
  background: var(--pink);
  box-shadow: 0 0 8px var(--pink);
  animation: pulse 2.4s ease-in-out infinite;
}

.dot.ok-dot {
  background: var(--pink-glow);
  box-shadow: 0 0 8px var(--pink-glow);
}

/* ---------- stack bus ---------- */

.bus {
  position: relative;
  z-index: 1;
  background: rgba(10, 5, 8, 0.9);
  border-bottom: 1px solid var(--hairline-soft);
}

.bus-inner {
  display: flex;
  align-items: center;
  gap: 14px;
  min-height: 38px;
  overflow: hidden;
  font-family: var(--font-mono);
  font-size: 8px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-3);
  white-space: nowrap;
}

.bus-label { color: var(--pink); }

.bus ul {
  display: flex;
  flex-wrap: wrap;
  gap: 0 6px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.bus li {
  display: inline-flex;
  align-items: center;
  color: var(--text-2);
}

.bus li:not(:last-child)::after {
  content: "/";
  margin-left: 6px;
  color: var(--text-3);
}

.bus-status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-left: auto;
  color: var(--pink-glow);
}

/* ---------- mission brief ---------- */

.brief {
  position: relative;
  z-index: 1;
  overflow: hidden;
  border-bottom: 1px solid var(--hairline-soft);
  background: rgba(10, 5, 8, 0.62);
}

.brief-art {
  position: absolute;
  inset: 0 0 0 auto;
  width: 48%;
  background: url("../img/feed-neotokyo.webp") center 55% / cover no-repeat;
  opacity: 0.55;
  pointer-events: none;
}

.brief::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(90deg, var(--void) 0%, rgba(10, 5, 8, 0.94) 38%, rgba(10, 5, 8, 0.3) 100%);
}

.brief-inner {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 150px minmax(0, 1fr) auto;
  gap: 24px;
  align-items: start;
  padding: 26px 0;
}

.brief-label {
  font-family: var(--font-mono);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.18em;
  color: var(--pink);
}

.brief p {
  margin: 0;
  max-width: 900px;
  font-size: 15.5px;
  line-height: 1.6;
  color: var(--text-2);
}

.brief p strong {
  color: var(--white);
  font-weight: 700;
}

.brief-link {
  font-family: var(--font-mono);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  text-decoration: none;
  color: var(--white);
  border-bottom: 1px solid var(--pink);
  padding-bottom: 3px;
  white-space: nowrap;
}

.brief-link:hover { color: var(--pink-glow); }

/* ---------- sections ---------- */

.section {
  position: relative;
  z-index: 1;
  padding: clamp(56px, 7vw, 88px) 0;
  border-bottom: 1px solid var(--hairline-soft);
}

.sec-head {
  max-width: 800px;
  margin: 0 0 38px;
}

.sec-index {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-mono);
  font-size: 9px;
  font-weight: 400;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--pink);
}

.sec-index::after {
  content: "";
  width: 52px;
  height: 1px;
  background: var(--hairline);
}

.sec-head h2 {
  margin: 14px 0 12px;
  font-family: var(--font-display);
  font-style: italic;
  font-weight: 800;
  font-size: clamp(28px, 3.6vw, 42px);
  line-height: 1.02;
  letter-spacing: 0.01em;
  text-transform: uppercase;
  color: var(--white);
}

.sec-head p {
  margin: 0;
  font-size: 16px;
  line-height: 1.55;
  color: var(--text-2);
}

.sec-head p + p { margin-top: 10px; }

.aside {
  margin: 20px 0 0;
  padding-left: 16px;
  font-size: 14px;
  line-height: 1.6;
  color: var(--text-2);
  border-left: 3px solid var(--pink);
}

.aside b {
  color: var(--white);
  font-weight: 700;
}

/* ---------- distributed media ---------- */

.section-top {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(0, 0.55fr);
  gap: 28px;
  align-items: start;
  margin-bottom: 38px;
}

.section-top .sec-head { margin: 0; }

.section-media {
  width: 100%;
  max-width: 420px;
  margin: 0;
  justify-self: end;
}

.section-media .feed-frame { aspect-ratio: 3 / 2; }

.gate-lower {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(0, 0.5fr);
  gap: 14px;
  align-items: start;
  margin-top: 14px;
}

.gate-lower .merge-rule { margin-top: 0; }

.gate-lower .section-media {
  max-width: 100%;
  justify-self: stretch;
}

/* ---------- pipeline ---------- */

.pipeline-groups {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.phase {
  position: relative;
  background: var(--glass);
  border: 1px solid var(--hairline-soft);
  backdrop-filter: var(--blur-panel);
  -webkit-backdrop-filter: var(--blur-panel);
  clip-path: polygon(0 0, 100% 0, 100% calc(100% - 20px), calc(100% - 20px) 100%, 0 100%);
}

.phase::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 3px;
  background: linear-gradient(90deg, var(--pink), rgba(255, 0, 127, 0.1));
}

.phase-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 13px 18px;
  background: rgba(255, 0, 127, 0.08);
  border-bottom: 1px solid var(--hairline-soft);
}

.phase-head h3 {
  margin: 0;
  font-family: var(--font-display);
  font-size: 13px;
  font-weight: 800;
  font-style: italic;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--white);
}

.phase-head span {
  font-family: var(--font-mono);
  font-size: 8px;
  letter-spacing: 0.12em;
  color: var(--text-3);
}

.phase ul {
  margin: 0;
  padding: 0;
  list-style: none;
}

.stage {
  display: grid;
  grid-template-columns: 40px minmax(0, 1fr) auto;
  gap: 10px;
  align-items: start;
  padding: 12px 18px;
  border-bottom: 1px solid var(--hairline-soft);
}

.stage:last-child { border-bottom: 0; }

.stage:hover { background: rgba(255, 0, 127, 0.07); }

.stage-code {
  padding-top: 2px;
  font-family: var(--font-mono);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.06em;
  color: var(--pink);
}

.stage strong {
  display: block;
  font-family: var(--font-display);
  font-size: 14px;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--white);
}

.stage p {
  margin: 3px 0 0;
  font-family: var(--font-mono);
  font-size: 11px;
  line-height: 1.55;
  letter-spacing: 0.01em;
  color: var(--text-2);
}

.pipe-tag {
  margin-top: 2px;
  padding: 3px 7px;
  font-family: var(--font-mono);
  font-size: 7px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  white-space: nowrap;
  color: var(--text-2);
  border: 1px solid var(--hairline-soft);
  background: rgba(255, 0, 127, 0.05);
}

.tag-read { color: var(--pink-glow); border-color: rgba(255, 42, 133, 0.4); }
.tag-shell { color: var(--text-2); }
.tag-agent { color: var(--white); border-color: var(--hairline); background: rgba(255, 0, 127, 0.14); }
.tag-gate { color: var(--text-2); }
.tag-block { color: var(--danger); border-color: rgba(255, 30, 66, 0.5); background: rgba(255, 30, 66, 0.12); }
.tag-bound { color: var(--pink-glow); }
.tag-evidence { color: var(--white); }
.tag-attack { color: var(--danger); border-color: rgba(255, 30, 66, 0.5); }
.tag-git { color: var(--pink-glow); }
.tag-ci { color: var(--text-2); }
.tag-merge { color: var(--white); border-color: var(--hairline); background: rgba(255, 0, 127, 0.14); }

.loop-note {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin: 14px 0 0;
  padding: 13px 16px;
  font-family: var(--font-mono);
  font-size: 11px;
  line-height: 1.6;
  letter-spacing: 0.01em;
  color: var(--text-2);
  background: rgba(255, 0, 127, 0.07);
  border: 1px solid var(--hairline-soft);
  clip-path: polygon(0 0, 100% 0, 100% calc(100% - 14px), calc(100% - 14px) 100%, 0 100%);
}

.loop-code {
  flex: none;
  padding: 3px 8px;
  font-family: var(--font-mono);
  font-size: 8px;
  font-weight: 700;
  letter-spacing: 0.16em;
  color: var(--white);
  background: var(--pink);
}

.loop-note b { color: var(--white); font-weight: 700; }

/* ---------- gates ---------- */

.gate-table-wrap {
  background: var(--glass);
  border: 1px solid var(--hairline-soft);
  overflow: hidden;
  backdrop-filter: var(--blur-panel);
  -webkit-backdrop-filter: var(--blur-panel);
  clip-path: polygon(0 0, 100% 0, 100% calc(100% - 20px), calc(100% - 20px) 100%, 0 100%);
}

.gate-table {
  width: 100%;
  border-collapse: collapse;
  font-family: var(--font-mono);
  font-size: 11px;
  line-height: 1.55;
}

.gate-table caption {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.gate-table th,
.gate-table td {
  padding: 12px 16px;
  text-align: left;
  vertical-align: top;
  border-bottom: 1px solid var(--hairline-soft);
}

.gate-table thead th {
  padding: 10px 16px;
  font-family: var(--font-mono);
  font-size: 8px;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--pink);
  background: rgba(255, 0, 127, 0.1);
}

.gate-table tbody tr:hover { background: rgba(255, 0, 127, 0.07); }

.gate-table tbody tr:last-child td,
.gate-table tbody tr:last-child th { border-bottom: 0; }

.gate-table .gate-id {
  width: 7%;
  font-family: var(--font-mono);
  font-size: 9px;
  font-weight: 700;
  color: var(--pink);
}

.gate-table tbody th {
  width: 20%;
  font-family: var(--font-display);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--white);
}

.gate-table td { color: var(--text-2); }

.gate-table td:nth-child(3) { width: 32%; }

.gate-table code { font-size: 10px; }

.merge-rule {
  position: relative;
  margin-top: 14px;
  padding: 22px 24px;
  background:
    linear-gradient(180deg, rgba(255, 0, 127, 0.1), rgba(255, 0, 127, 0.02)),
    var(--glass);
  border: 1px solid var(--hairline);
  backdrop-filter: var(--blur-panel);
  -webkit-backdrop-filter: var(--blur-panel);
  clip-path: polygon(0 0, 100% 0, 100% calc(100% - 22px), calc(100% - 22px) 100%, 0 100%);
}

.merge-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 6px;
}

.merge-head h3 {
  margin: 0;
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 900;
  font-style: italic;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--white);
}

.merge-head span {
  font-family: var(--font-mono);
  font-size: 8px;
  font-weight: 700;
  letter-spacing: 0.18em;
  color: var(--pink);
}

.merge-rule > p {
  margin: 0 0 14px;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.02em;
  color: var(--text-2);
}

.checklist {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px 24px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.checklist li {
  position: relative;
  padding-left: 20px;
  font-family: var(--font-mono);
  font-size: 11px;
  line-height: 1.6;
  color: var(--text-2);
}

.checklist li::before {
  content: "+";
  position: absolute;
  left: 0;
  top: -1px;
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 700;
  color: var(--pink);
}

.checklist b { color: var(--white); font-weight: 700; }

/* ---------- architecture ---------- */

.diagram { margin: 0; }

.diagram-frame {
  position: relative;
  padding: 10px;
  background: var(--glass);
  border: 1px solid var(--hairline-soft);
  backdrop-filter: var(--blur-panel);
  -webkit-backdrop-filter: var(--blur-panel);
  clip-path: polygon(0 0, 100% 0, 100% calc(100% - 22px), calc(100% - 22px) 100%, 0 100%);
}

.diagram-scroll {
  overflow-x: auto;
  background:
    radial-gradient(circle at 1px 1px, rgba(255, 0, 127, 0.14) 1px, transparent 1.4px) 0 0 / 20px 20px,
    var(--void);
}

.diagram-svg {
  display: block;
  width: 100%;
  min-width: 840px;
  height: auto;
  --text: #ffffff;
  --text-muted: #e2b8ce;
  --text-dim: #8f5674;
  --mask: #120610;
  --grid: #2a0f1e;
  --lane-fill: rgba(40, 12, 28, 0.4);
  --lane-stroke: #4a1c34;
  --arrow: #b06088;
  --arrow-emphasis: #ff2a85;
  --frontend-fill: rgba(255, 0, 127, 0.16);
  --frontend-stroke: #ff007f;
  --backend-fill: rgba(255, 42, 133, 0.15);
  --backend-stroke: #ff2a85;
  --database-fill: rgba(226, 184, 206, 0.12);
  --database-stroke: #e2b8ce;
  --cloud-fill: rgba(255, 255, 255, 0.1);
  --cloud-stroke: #ffffff;
  --security-fill: rgba(255, 30, 66, 0.14);
  --security-stroke: #ff1e42;
  --messagebus-fill: rgba(255, 120, 180, 0.14);
  --messagebus-stroke: #ff7ab4;
  --external-fill: rgba(143, 86, 116, 0.18);
  --external-stroke: #8f5674;
}

.diagram-svg text { font-family: var(--font-mono); }

.diagram-svg .c-grid { stroke: var(--grid); fill: none; }
.diagram-svg .c-mask { fill: var(--mask); stroke: none; }
.diagram-svg .c-region { fill: rgba(255, 0, 127, 0.05); stroke: rgba(255, 0, 127, 0.35); stroke-dasharray: none; }
.diagram-svg .c-lane { fill: var(--lane-fill); stroke: var(--lane-stroke); stroke-dasharray: none; }
.diagram-svg .c-frontend { fill: var(--frontend-fill); stroke: var(--frontend-stroke); }
.diagram-svg .c-backend { fill: var(--backend-fill); stroke: var(--backend-stroke); }
.diagram-svg .c-database { fill: var(--database-fill); stroke: var(--database-stroke); }
.diagram-svg .c-cloud { fill: var(--cloud-fill); stroke: var(--cloud-stroke); }
.diagram-svg .c-security { fill: var(--security-fill); stroke: var(--security-stroke); }
.diagram-svg .c-messagebus { fill: var(--messagebus-fill); stroke: var(--messagebus-stroke); }
.diagram-svg .c-external { fill: var(--external-fill); stroke: var(--external-stroke); }
.diagram-svg .t-primary { fill: var(--text); }
.diagram-svg .t-muted { fill: var(--text-muted); }
.diagram-svg .t-dim { fill: var(--text-dim); }
.diagram-svg .t-frontend { fill: var(--frontend-stroke); }
.diagram-svg .t-backend { fill: var(--backend-stroke); }
.diagram-svg .t-database { fill: var(--database-stroke); }
.diagram-svg .t-cloud { fill: var(--cloud-stroke); }
.diagram-svg .t-security { fill: var(--security-stroke); }
.diagram-svg .t-messagebus { fill: var(--messagebus-stroke); }
.diagram-svg .t-external { fill: var(--external-stroke); }
.diagram-svg .t-edge-default { fill: var(--arrow); }
.diagram-svg .t-edge-emphasis { fill: var(--arrow-emphasis); }
.diagram-svg .t-edge-dashed { fill: var(--database-stroke); }
.diagram-svg .a-default { stroke: var(--arrow); fill: none; }
.diagram-svg .a-emphasis { stroke: var(--arrow-emphasis); fill: none; }
.diagram-svg .a-security { stroke: var(--security-stroke); fill: none; stroke-dasharray: 5, 5; }
.diagram-svg .a-dashed { stroke: var(--database-stroke); fill: none; stroke-dasharray: 4, 4; }
.diagram-svg .m-default { fill: var(--arrow); }
.diagram-svg .m-emphasis { fill: var(--arrow-emphasis); }
.diagram-svg .m-security { fill: var(--security-stroke); }
.diagram-svg .m-dashed { fill: var(--database-stroke); }
.diagram-svg .semantic-sigil {
  fill: none;
  stroke: currentColor;
  stroke-width: 1.35;
  stroke-linecap: round;
  stroke-linejoin: round;
  opacity: 0.8;
}

.diagram-svg .semantic-sigil > * { vector-effect: non-scaling-stroke; }
.diagram-svg .semantic-sigil .sigil-fill { fill: currentColor; stroke: none; }
.diagram-svg .s-frontend { color: var(--frontend-stroke); }
.diagram-svg .s-backend { color: var(--backend-stroke); }
.diagram-svg .s-database { color: var(--database-stroke); }
.diagram-svg .s-cloud { color: var(--cloud-stroke); }
.diagram-svg .s-security { color: var(--security-stroke); }
.diagram-svg .s-messagebus { color: var(--messagebus-stroke); }
.diagram-svg .s-external { color: var(--external-stroke); }

.diagram-svg [data-node-id] > rect:not(.c-mask) { stroke-width: 1.25px; }
.diagram-svg [data-node-id] { cursor: default; }
.diagram-svg [data-node-id]:hover > rect:not(.c-mask) { filter: brightness(1.2); }

.diagram-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 18px;
  margin: 12px 0 0;
  padding: 0;
  list-style: none;
  font-family: var(--font-mono);
  font-size: 8px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-3);
}

.diagram-legend li {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.sw {
  width: 10px;
  height: 8px;
  border: 1px solid transparent;
}

.sw-frontend { background: rgba(255, 0, 127, 0.25); border-color: #ff007f; }
.sw-backend { background: rgba(255, 42, 133, 0.25); border-color: #ff2a85; }
.sw-database { background: rgba(226, 184, 206, 0.25); border-color: #e2b8ce; }
.sw-cloud { background: rgba(255, 255, 255, 0.25); border-color: #ffffff; }
.sw-external { background: rgba(143, 86, 116, 0.25); border-color: #8f5674; }

.diagram-hint { display: none; }

.module-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-top: 18px;
}

.module {
  position: relative;
  padding: 18px;
  background: var(--glass);
  border: 1px solid var(--hairline-soft);
  border-top: 3px solid var(--pink);
  backdrop-filter: var(--blur-panel);
  -webkit-backdrop-filter: var(--blur-panel);
  clip-path: polygon(0 0, 100% 0, 100% calc(100% - 18px), calc(100% - 18px) 100%, 0 100%);
}

.module-code {
  display: block;
  margin-bottom: 8px;
  font-family: var(--font-mono);
  font-size: 8px;
  font-weight: 700;
  letter-spacing: 0.16em;
  color: var(--pink);
}

.module h3 {
  margin: 0 0 6px;
  font-family: var(--font-display);
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--white);
}

.module p {
  margin: 0;
  font-family: var(--font-mono);
  font-size: 10.5px;
  line-height: 1.65;
  letter-spacing: 0.01em;
  color: var(--text-2);
}

.module code { font-size: 10px; }

/* ---------- visual feed ---------- */

.feed-item {
  position: relative;
  margin: 0;
  background: var(--glass);
  border: 1px solid var(--hairline-soft);
  backdrop-filter: var(--blur-panel);
  -webkit-backdrop-filter: var(--blur-panel);
  clip-path: polygon(0 0, 100% 0, 100% calc(100% - 16px), calc(100% - 16px) 100%, 0 100%);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.feed-item:hover {
  border-color: var(--pink);
  box-shadow: var(--glow-primary);
}

.feed-open {
  display: block;
  color: inherit;
  text-decoration: none;
  cursor: pointer;
}

.feed-open:focus-visible {
  outline: 2px solid var(--white);
  outline-offset: 2px;
}

.feed-frame {
  position: relative;
  display: block;
  aspect-ratio: 3 / 2;
  overflow: hidden;
  background: var(--void);
}

.feed-frame::before {
  content: "";
  position: absolute;
  inset: auto 0 0;
  z-index: 1;
  height: 52%;
  background: linear-gradient(180deg, transparent, rgba(10, 5, 8, 0.9));
  pointer-events: none;
}

.feed-frame img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: contrast(1.06);
  transition: transform 0.5s ease;
}

.feed-item:hover .feed-frame img {
  transform: scale(1.05);
}

.feed-code,
.feed-badge {
  position: absolute;
  z-index: 2;
  font-family: var(--font-mono);
  font-size: 8px;
  font-weight: 700;
  letter-spacing: 0.12em;
  padding: 3px 6px;
  background: rgba(10, 5, 8, 0.82);
  border: 1px solid var(--hairline);
}

.feed-code {
  top: 8px;
  left: 8px;
  color: var(--pink-glow);
}

.feed-badge {
  top: 8px;
  right: 8px;
  color: var(--text-2);
}

.feed-badge.live {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: var(--white);
  background: var(--danger);
  border-color: var(--danger);
}

.feed-badge.live::before {
  content: "";
  width: 4px;
  height: 4px;
  background: var(--white);
  animation: pulse 1.8s ease-in-out infinite;
}

.feed-cross {
  position: absolute;
  right: 8px;
  bottom: 8px;
  z-index: 2;
  width: 12px;
  height: 12px;
  opacity: 0;
  transition: opacity 0.2s ease;
}

.feed-cross::before,
.feed-cross::after {
  content: "";
  position: absolute;
  background: var(--pink);
}

.feed-cross::before {
  left: 0;
  right: 0;
  top: 5px;
  height: 1px;
}

.feed-cross::after {
  top: 0;
  bottom: 0;
  left: 5px;
  width: 1px;
}

.feed-item:hover .feed-cross { opacity: 1; }

.feed-item figcaption {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 9px 11px;
  border-top: 1px solid var(--hairline-soft);
}

.feed-name {
  font-family: var(--font-display);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--white);
}

.feed-meta {
  font-family: var(--font-mono);
  font-size: 7px;
  letter-spacing: 0.08em;
  color: var(--text-3);
  white-space: nowrap;
}

/* ---------- feed dialog ---------- */

.feed-dialog {
  width: calc(100% - 32px);
  max-width: 1080px;
  max-height: calc(100vh - 40px);
  padding: 0;
  color: var(--white);
  background: transparent;
  border: 0;
}

.feed-dialog::backdrop {
  background: rgba(6, 3, 5, 0.9);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}

.dialog-panel {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--hairline);
  overflow: auto;
  max-height: calc(100vh - 40px);
  clip-path: polygon(0 0, 100% 0, 100% calc(100% - 22px), calc(100% - 22px) 100%, 0 100%);
}

.dialog-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 14px;
  background: rgba(255, 0, 127, 0.12);
  border-bottom: 1px solid var(--hairline-soft);
  font-family: var(--font-mono);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--pink-glow);
}

.dialog-close {
  font-family: var(--font-mono);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.12em;
  padding: 6px 10px;
  color: var(--white);
  background: transparent;
  border: 1px solid var(--hairline);
  cursor: pointer;
  clip-path: polygon(0 0, 100% 0, 100% calc(100% - 8px), calc(100% - 8px) 100%, 0 100%);
}

.dialog-close:hover {
  background: var(--pink);
  border-color: var(--pink);
  box-shadow: var(--glow-primary);
}

.dialog-media {
  display: grid;
  place-items: center;
  padding: 12px;
  background: var(--void);
}

.dialog-media img {
  display: block;
  max-width: 100%;
  max-height: 68vh;
  width: auto;
  height: auto;
}

.dialog-foot {
  padding: 16px 18px 20px;
  border-top: 1px solid var(--hairline-soft);
}

.dialog-foot h3 {
  margin: 0 0 4px;
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 900;
  font-style: italic;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--white);
}

.dialog-foot p {
  margin: 0;
  font-family: var(--font-mono);
  font-size: 11px;
  line-height: 1.6;
  color: var(--text-2);
}

.dialog-credit {
  margin-top: 8px !important;
  font-family: var(--font-mono);
  font-size: 8px !important;
  letter-spacing: 0.05em;
  color: var(--text-3) !important;
}

/* ---------- run ---------- */

.run-grid {
  display: grid;
  grid-template-columns: minmax(0, 0.95fr) minmax(0, 1.05fr);
  gap: 22px;
  align-items: start;
}

.run-grid > *,
.steps,
.step > *,
.split-cta > * { min-width: 0; }

.steps {
  margin: 0;
  padding: 0;
  list-style: none;
}

.step {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);
  gap: 14px;
  padding: 16px 0;
  border-bottom: 1px solid var(--hairline-soft);
}

.step:first-child { padding-top: 0; }

.step-code {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  font-family: var(--font-display);
  font-size: 12px;
  font-weight: 900;
  font-style: italic;
  color: var(--white);
  background: var(--pink);
  clip-path: polygon(0 0, 100% 0, 100% calc(100% - 8px), calc(100% - 8px) 100%, 0 100%);
}

.step h3 {
  margin: 2px 0 4px;
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--white);
}

.step p {
  margin: 0;
  font-family: var(--font-mono);
  font-size: 11px;
  line-height: 1.7;
  letter-spacing: 0.01em;
  color: var(--text-2);
}

.step p + p { margin-top: 5px; }

.rune {
  margin: 0;
  background: rgba(10, 5, 8, 0.86);
  border: 1px solid var(--hairline-soft);
  overflow: hidden;
  clip-path: polygon(0 0, 100% 0, 100% calc(100% - 18px), calc(100% - 18px) 100%, 0 100%);
}

.rune + .rune { margin-top: 12px; }

.rune figcaption {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 9px 14px;
  font-family: var(--font-mono);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--pink-glow);
  background: rgba(255, 0, 127, 0.08);
  border-bottom: 1px solid var(--hairline-soft);
}

.rune pre {
  margin: 0;
  padding: 14px 16px 16px;
  overflow-x: auto;
  font-family: var(--font-mono);
  font-size: 11.5px;
  line-height: 1.75;
  color: var(--white);
  tab-size: 2;
}

.rune pre .c { color: var(--text-3); }

.config-block { margin-top: 26px; }

.config-note {
  margin: 0 0 10px;
  font-family: var(--font-mono);
  font-size: 11px;
  line-height: 1.7;
  color: var(--text-2);
}

.config-note code { font-size: 10px; }

/* ---------- mission control ---------- */

.mc {
  position: relative;
  background: var(--glass);
  border: 1px solid var(--hairline-soft);
  backdrop-filter: var(--blur-panel);
  -webkit-backdrop-filter: var(--blur-panel);
  clip-path: polygon(0 0, 100% 0, 100% calc(100% - 22px), calc(100% - 22px) 100%, 0 100%);
}

.mc-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 14px;
  background: rgba(255, 0, 127, 0.1);
  border-bottom: 1px solid var(--hairline-soft);
  font-family: var(--font-mono);
  font-size: 8px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-2);
}

.mc-dots {
  display: inline-flex;
  gap: 5px;
}

.mc-dots i {
  width: 8px;
  height: 8px;
  background: var(--pink);
  clip-path: polygon(0 0, 100% 0, 100% calc(100% - 3px), calc(100% - 3px) 100%, 0 100%);
}

.mc-dots i:nth-child(2) { background: var(--pink-deep); }
.mc-dots i:nth-child(3) { background: var(--text-3); }

.mc-title { color: var(--white); }

.mc-wave {
  display: inline-flex;
  align-items: flex-end;
  gap: 2px;
  height: 12px;
  margin-left: 4px;
}

.mc-wave i {
  width: 2px;
  height: 100%;
  background: var(--pink);
  opacity: 0.75;
  transform-origin: bottom;
  animation: wave 1.2s ease-in-out infinite alternate;
}

.mc-wave i:nth-child(2n) { animation-duration: 0.9s; }
.mc-wave i:nth-child(3n) { animation-duration: 1.5s; }
.mc-wave i:nth-child(4n) { animation-duration: 1.05s; }

@keyframes wave {
  from { transform: scaleY(0.25); opacity: 0.3; }
  to { transform: scaleY(1); opacity: 0.95; }
}

.mc-live {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-left: auto;
  color: var(--pink-glow);
}

.mc-live::before {
  content: "";
  width: 5px;
  height: 5px;
  background: var(--pink);
  box-shadow: 0 0 8px var(--pink);
  animation: pulse 2s ease-in-out infinite;
}

.mc-body { padding: 14px; }

.mc-body .gate-table-wrap { margin-top: 10px; }

.mc-body .gate-table td:first-child {
  color: var(--pink);
  font-weight: 700;
}

.mc-body .gate-table .num {
  text-align: right;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.mc-table td:nth-child(3) { width: auto; }

.mc-stats {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 12px;
}

.mc-stat {
  padding: 10px 12px;
  background: rgba(10, 5, 8, 0.7);
  border: 1px solid var(--hairline-soft);
  border-top: 2px solid var(--pink);
  clip-path: polygon(0 0, 100% 0, 100% calc(100% - 12px), calc(100% - 12px) 100%, 0 100%);
}

.mc-stat b {
  display: block;
  font-family: var(--font-display);
  font-size: 19px;
  font-weight: 900;
  font-style: italic;
  line-height: 1.1;
  color: var(--white);
  font-variant-numeric: tabular-nums;
}

.mc-stat span {
  font-family: var(--font-mono);
  font-size: 7px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--text-3);
}

.mc-trends {
  margin-bottom: 12px;
  padding: 10px 12px;
  background: rgba(10, 5, 8, 0.7);
  border: 1px solid var(--hairline-soft);
  clip-path: polygon(0 0, 100% 0, 100% calc(100% - 12px), calc(100% - 12px) 100%, 0 100%);
}

.mc-trends-label {
  display: block;
  margin-bottom: 8px;
  font-family: var(--font-mono);
  font-size: 7px;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--text-2);
}

.trend-bars {
  display: flex;
  align-items: flex-end;
  gap: 3px;
  height: 56px;
}

.trend-bars i {
  flex: 1;
  min-height: 4px;
  background: var(--pink);
}

.trend-bars i.bad { background: var(--danger); }

.mc-trends-foot {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 8px;
  font-family: var(--font-mono);
  font-size: 7px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-3);
}

.mc-tasks {
  border: 1px solid var(--hairline-soft);
  overflow: hidden;
}

.mc-task {
  display: grid;
  grid-template-columns: 68px 46px minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  padding: 9px 11px;
  border-bottom: 1px solid var(--hairline-soft);
  font-family: var(--font-mono);
  font-size: 10.5px;
}

.mc-task:last-child { border-bottom: 0; }

.mc-task .title {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--white);
}

.mc-task .repo {
  display: block;
  font-family: var(--font-mono);
  font-size: 8px;
  color: var(--text-3);
}

.mc-task .meta {
  font-family: var(--font-mono);
  font-size: 8px;
  color: var(--text-3);
  white-space: nowrap;
}

.mc-id {
  font-family: var(--font-mono);
  font-size: 9px;
  color: var(--pink-glow);
}

.mc-verdicts {
  grid-column: 1 / -1;
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  padding-top: 2px;
}

.pill {
  display: inline-block;
  padding: 3px 7px;
  font-family: var(--font-mono);
  font-size: 7px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  text-align: center;
  border: 1px solid transparent;
  clip-path: polygon(0 0, 100% 0, 100% calc(100% - 6px), calc(100% - 6px) 100%, 0 100%);
}

.pill.ok { color: var(--white); background: rgba(255, 0, 127, 0.18); border-color: var(--hairline); }
.pill.run { color: var(--white); background: var(--pink); border-color: var(--pink); }
.pill.bad { color: var(--white); background: var(--danger); border-color: var(--danger); }
.pill.idle { color: var(--text-2); background: rgba(255, 0, 127, 0.07); border-color: var(--hairline-soft); }

.mc-blocked {
  margin-top: 10px;
  padding: 11px 13px;
  font-family: var(--font-mono);
  font-size: 10.5px;
  line-height: 1.6;
  color: var(--text-2);
  background: rgba(255, 30, 66, 0.1);
  border: 1px solid rgba(255, 30, 66, 0.4);
}

.mc-blocked b { color: var(--danger); font-weight: 700; }

.mc-foot {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
  padding: 8px 14px;
  border-top: 1px solid var(--hairline-soft);
  font-family: var(--font-mono);
  font-size: 8px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-3);
}

.split-cta {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-top: 14px;
}

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

.card {
  position: relative;
  padding: 18px;
  background: var(--glass);
  border: 1px solid var(--hairline-soft);
  border-top: 3px solid var(--pink);
  backdrop-filter: var(--blur-panel);
  -webkit-backdrop-filter: var(--blur-panel);
  clip-path: polygon(0 0, 100% 0, 100% calc(100% - 18px), calc(100% - 18px) 100%, 0 100%);
}

.card-code {
  display: block;
  margin-bottom: 8px;
  font-family: var(--font-mono);
  font-size: 8px;
  font-weight: 700;
  letter-spacing: 0.16em;
  color: var(--pink);
}

.card h3 {
  margin: 0 0 6px;
  font-family: var(--font-display);
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--white);
}

.card p {
  margin: 0;
  font-family: var(--font-mono);
  font-size: 10.5px;
  line-height: 1.65;
  color: var(--text-2);
}

.card code { font-size: 10px; }

/* ---------- faq ---------- */

.faq {
  border-top: 1px solid var(--hairline-soft);
}

.faq details {
  border-bottom: 1px solid var(--hairline-soft);
}

.faq summary {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 0;
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--white);
  cursor: pointer;
  list-style: none;
}

.faq summary::-webkit-details-marker { display: none; }

.faq summary::after {
  content: "+";
  margin-left: auto;
  font-family: var(--font-mono);
  font-size: 17px;
  font-weight: 400;
  color: var(--pink);
  transition: color 0.2s ease;
}

.faq details[open] summary::after {
  content: "\2212";
  color: var(--pink-glow);
}

.q-code {
  flex: none;
  font-family: var(--font-mono);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.12em;
  color: var(--pink);
}

.faq details p {
  margin: 0 0 16px;
  max-width: 820px;
  font-family: var(--font-mono);
  font-size: 11px;
  line-height: 1.75;
  color: var(--text-2);
}

.faq details p:last-child { margin-bottom: 20px; }

.faq details code { font-size: 10px; }

/* ---------- footer ---------- */

.footer {
  position: relative;
  z-index: 1;
  background: rgba(10, 5, 8, 0.94);
  border-top: 1px solid var(--hairline);
}

.footer-inner {
  max-width: var(--max);
  margin: 0 auto;
  padding: 46px var(--gutter) 28px;
}

.footer-cols {
  display: grid;
  grid-template-columns: 1.6fr repeat(2, minmax(0, 1fr));
  gap: 26px;
  margin-bottom: 32px;
}

.footer-brand p {
  margin: 14px 0 0;
  max-width: 300px;
  font-family: var(--font-mono);
  font-size: 10px;
  line-height: 1.75;
  letter-spacing: 0.03em;
  color: var(--text-3);
}

.footer-status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 12px !important;
  font-family: var(--font-mono);
  font-size: 8px !important;
  letter-spacing: 0.16em;
  color: var(--pink-glow) !important;
}

.footer-col h3 {
  margin: 0 0 12px;
  font-family: var(--font-mono);
  font-size: 8px;
  font-weight: 700;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--pink);
}

.footer-col a {
  display: block;
  width: fit-content;
  padding: 4px 0;
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.04em;
  text-decoration: none;
  color: var(--text-2);
}

.footer-col a:hover { color: var(--white); }

.footer-bottom {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-top: 20px;
  border-top: 1px solid var(--hairline-soft);
  font-family: var(--font-mono);
  font-size: 8px;
  letter-spacing: 0.08em;
  color: var(--text-3);
}

.footer-bottom p { margin: 0; }

.footer-bottom strong { color: var(--text-2); font-weight: 700; }

.footer-meta {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
  max-width: 780px;
}

.footer-meta a { color: var(--pink-glow); }

/* Floating back-to-top: fixed to the viewport, hidden until scrolled. */
.to-top {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 50;
  font-family: var(--font-mono);
  font-size: 16px;
  line-height: 1;
  color: var(--pink-glow);
  text-decoration: none;
  background: var(--surface);
  border: 1px solid var(--hairline-soft);
  padding: 10px 13px;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.25s ease, visibility 0.25s ease;
}

.to-top.visible { opacity: 1; visibility: visible; }

.to-top:hover { color: var(--white); }

/* ---------- credits page ---------- */

.credits-page {
  position: relative;
  z-index: 1;
  max-width: 920px;
  margin: 0 auto;
  padding: clamp(96px, 9vw, 120px) var(--gutter) 96px;
}

.credits-page h1 {
  margin: 14px 0 14px;
  font-family: var(--font-display);
  font-style: italic;
  font-weight: 900;
  font-size: clamp(38px, 5vw, 60px);
  line-height: 0.95;
  letter-spacing: -0.01em;
}

.credits-page > p {
  max-width: 720px;
  font-family: var(--font-mono);
  font-size: 11px;
  line-height: 1.85;
  color: var(--text-2);
}

.credit-list {
  margin: 28px 0;
  padding: 0;
  list-style: none;
  border-top: 1px solid var(--hairline-soft);
}

.credit-list li {
  margin: 0;
  padding: 14px 0;
  border-bottom: 1px solid var(--hairline-soft);
}

.credit-list a {
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  text-decoration: none;
}

.credit-meta {
  display: block;
  margin-top: 4px;
  font-family: var(--font-mono);
  font-size: 8px;
  letter-spacing: 0.12em;
  color: var(--text-3);
}

.credits-back {
  display: inline-block;
  margin-top: 22px;
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

/* ---------- reveal ---------- */

.js .reveal {
  opacity: 0;
  transform: translateY(12px);
  transition: opacity 0.55s ease, transform 0.55s ease;
}

.js .reveal.in {
  opacity: 1;
  transform: none;
}

/* ---------- responsive ---------- */

@media (max-width: 1100px) {
  .hero-stage {
    display: flex;
    flex-direction: column;
    min-height: 0;
  }

  .hero-video {
    position: relative;
    height: clamp(340px, 46vw, 480px);
    object-position: 50% 36%;
  }

  .hero-veil {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: auto;
    height: clamp(340px, 46vw, 480px);
    background: linear-gradient(180deg, rgba(10, 5, 8, 0.18) 0%, transparent 42%, var(--void) 100%);
  }

  .hero-body {
    display: block;
    min-height: 0;
    padding-top: 24px;
    padding-bottom: 0;
  }

  .hero-cards {
    position: static;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    max-width: none;
    margin: 0;
    padding: 22px var(--gutter) 24px;
  }

  .mc-stats { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (max-width: 920px) {
  .pipeline-groups { grid-template-columns: 1fr; }

  .section-top {
    grid-template-columns: 1fr;
    gap: 18px;
  }

  .section-media {
    max-width: 420px;
    justify-self: start;
  }

  .gate-lower { grid-template-columns: 1fr; }

  .gate-lower .section-media { max-width: 420px; }

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

  .run-grid { grid-template-columns: minmax(0, 1fr); }

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

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

  .diagram-hint {
    display: block;
    margin: 0 0 10px;
    font-family: var(--font-mono);
    font-size: 10px;
    letter-spacing: 0.04em;
    line-height: 1.6;
    color: var(--text-3);
  }

  .diagram-hint a { color: var(--text-2); }

  .gate-table thead { display: none; }

  .gate-table,
  .gate-table tbody,
  .gate-table tr,
  .gate-table th,
  .gate-table td {
    display: block;
    width: auto;
  }

  .gate-table tr {
    padding: 13px 16px;
    border-bottom: 1px solid var(--hairline-soft);
  }

  .gate-table tr:last-child { border-bottom: 0; }

  .gate-table th,
  .gate-table td {
    padding: 0;
    border: 0;
  }

  .gate-table .gate-id {
    display: inline-block;
    margin-bottom: 3px;
    width: auto;
  }

  .gate-table tbody th {
    width: auto;
    margin-bottom: 2px;
    white-space: normal;
  }

  .gate-table td:nth-child(3) {
    width: auto;
    color: var(--text-2);
  }

  .gate-table td:nth-child(4) {
    margin-top: 5px;
    font-size: 10px;
    color: var(--text-3);
  }

  .mc-table td:nth-child(3) {
    width: auto;
    color: var(--text-2);
  }

  .mc-table td:nth-child(4) {
    margin-top: 0;
    font-size: inherit;
    color: var(--text-2);
  }

  .gate-table tbody tr:hover { background: transparent; }

  .merge-head { flex-wrap: wrap; }

  .checklist { grid-template-columns: 1fr; }
}

@media (max-width: 760px) {
  :root { --gutter: 18px; }

  html { scroll-padding-top: 16px; }

  .brief-inner {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .brief-art { display: none; }

  .brief-link { margin-top: 4px; }

  .topbar {
    min-height: 62px;
    gap: 8px;
    background: transparent;
  }

  .topnav a { padding: 8px 9px; font-size: 9px; }

  .topnav a:not(.topnav-source):nth-child(2),
  .topnav a:not(.topnav-source):nth-child(3),
  .topnav a:not(.topnav-source):nth-child(4),
  .topnav a:not(.topnav-source):nth-child(5) { display: none; }

  .topnav-source span { display: none; }

  .topnav-source { padding: 8px 10px !important; }

  .hero-stage {
    display: flex;
    flex-direction: column;
    min-height: 0;
  }

  .hero-video {
    position: relative;
    height: 340px;
    object-position: 50% 36%;
  }

  .hero-veil {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: auto;
    height: 340px;
    background: linear-gradient(180deg, rgba(10, 5, 8, 0.18) 0%, transparent 42%, var(--void) 100%);
  }

  .hero-body {
    display: block;
    min-height: 0;
    padding: 22px 18px 0;
  }

  .exec { align-items: flex-start; }

  .exec-prompt { padding-top: 2px; }

  .hero-install code {
    white-space: normal;
    overflow-wrap: break-word;
    line-height: 1.5;
  }

  .hero-title {
    margin-bottom: 12px;
    font-size: clamp(26px, 8vw, 40px);
  }

  .hero-cards {
    position: static;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    max-width: none;
    padding: 22px 18px 24px;
  }

  .stat-card { padding: 11px 12px 12px; }

  .stat-card .stat-value { font-size: 22px; }

  .stat-card h3 { font-size: 11px; }

  .stat-card p { display: none; }

  .stat-card.danger-card p { display: none; }

  .bus-status { display: none; }

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

  .mc-task { grid-template-columns: 62px 42px minmax(0, 1fr); }

  .mc-task .meta { display: none; }

  .split-cta { grid-template-columns: minmax(0, 1fr); }

  .card-grid { grid-template-columns: 1fr; }

  .footer-cols { grid-template-columns: 1fr; gap: 22px; }

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

  .dialog-media { padding: 6px; }

  .dialog-foot h3 { font-size: 18px; }
}

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

  .brand-mark { width: 26px; height: 26px; font-size: 13px; }

  .exec { font-size: 10px; }

  .exec code { max-width: 200px; }

  .pipe-tag { display: none; }

  .stage { grid-template-columns: 32px minmax(0, 1fr); }

  .module-grid { grid-template-columns: 1fr; }

  .mc-task { grid-template-columns: 56px minmax(0, 1fr); }

  .mc-task .mc-id { display: none; }

  .mc-body { padding: 10px; }

  .feed-meta { display: none; }

  .bus li:nth-child(n+5) { display: none; }

  .hero-cards { grid-template-columns: 1fr 1fr; }

}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }

  .js .reveal { opacity: 1; transform: none; }

  .scanlines::after { display: none; }

}
