/*
 * ALLOY REMASTER — Mission Control Brutalist + Discord-native editorial.
 * Selected because the product is a live operational surface: black/red command
 * architecture keeps Discord dominant, Field Manual density serves investors,
 * and Neon Ops energy is reserved for opening and transition beats.
 * All new presentation values route through the tokens below.
 */

:root {
  color-scheme: dark;
  --rm-void: #070708;
  --rm-ink: #0b0b0d;
  --rm-panel: #111114;
  --rm-panel-raised: #18181c;
  --rm-panel-soft: #202026;
  --rm-line: rgba(255, 255, 255, 0.10);
  --rm-line-strong: rgba(255, 255, 255, 0.18);
  --rm-white: #f8f8fa;
  --rm-text: #e4e4e8;
  --rm-muted: #9a9aa3;
  --rm-dim: #83838d;
  --rm-red: #e51b3e;
  --rm-red-hot: #ff3158;
  --rm-red-deep: #8f1028;
  --rm-green: #45d483;
  --rm-blurple: #5865f2;
  --rm-shadow: rgba(0, 0, 0, 0.62);
  --rm-red-wash: rgba(229, 27, 62, 0.14);
  --rm-red-faint: rgba(229, 27, 62, 0.07);
  --rm-focus: #ff6b87;
  --rm-font-display: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --rm-font-mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, monospace;
  --rm-radius-sm: 8px;
  --rm-radius-md: 14px;
  --rm-radius-lg: 24px;
  --rm-space-1: 4px;
  --rm-space-2: 8px;
  --rm-space-3: 12px;
  --rm-space-4: 16px;
  --rm-space-5: 20px;
  --rm-space-6: 24px;
  --rm-space-8: 32px;
  --rm-space-10: 40px;
  --rm-space-12: 48px;
  --rm-space-16: 64px;
  --rm-ease: cubic-bezier(0.16, 1, 0.3, 1);
}

html {
  background: var(--rm-void);
  scroll-behavior: smooth;
}

body.alloy-remaster {
  background:
    radial-gradient(circle at 82% 8%, var(--rm-red-wash), transparent 24rem),
    repeating-linear-gradient(90deg, var(--rm-line) 0 1px, transparent 1px 88px),
    var(--rm-void);
  color: var(--rm-text);
}

body.alloy-remaster::after {
  content: '';
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background: linear-gradient(115deg, transparent 46%, var(--rm-red-faint) 46% 47%, transparent 47%);
}

body.alloy-remaster :focus-visible {
  outline: 2px solid var(--rm-focus);
  outline-offset: 3px;
}

body.alloy-remaster .pipeline-progress__ticks {
  grid-template-columns: repeat(7, minmax(0, 1fr));
}

body.alloy-remaster .cine-header {
  --header-h: 64px;
  background: color-mix(in srgb, var(--rm-void) 86%, transparent);
  border-bottom-color: var(--rm-line);
}

body.alloy-remaster .cine-logo {
  display: inline-flex;
  align-items: center;
  min-width: 44px;
  min-height: 44px;
  font-family: var(--rm-font-display);
  font-size: 0.92rem;
  font-weight: 800;
  letter-spacing: 0.18em;
}

body.alloy-remaster .cine-nav__cta,
body.alloy-remaster .ig-toggle,
body.alloy-remaster .cine-nav__link {
  min-height: 44px;
}

body.alloy-remaster .cine-nav__cta {
  border: 1px solid color-mix(in srgb, var(--rm-red-hot) 44%, transparent);
  background: var(--rm-red-deep);
  box-shadow: 0 10px 30px var(--rm-red-wash);
}

body.alloy-remaster .act--hero,
body.alloy-remaster .act--board,
body.alloy-remaster .act--discord,
body.alloy-remaster .act--pipeline,
body.alloy-remaster .act--sop,
body.alloy-remaster .act--studio,
body.alloy-remaster .act--cta {
  background: var(--rm-void);
  color: var(--rm-text);
}

body.alloy-remaster .act--hero,
body.alloy-remaster .act--discord {
  background:
    radial-gradient(circle at 50% 36%, var(--rm-red-faint), transparent 42rem),
    var(--rm-void);
}

body.alloy-remaster .act--board,
body.alloy-remaster .act--studio {
  background: var(--rm-ink);
}

body.alloy-remaster .act--cta {
  background:
    linear-gradient(145deg, var(--rm-red-wash), transparent 42%),
    var(--rm-void);
}

body.alloy-remaster .act-stage {
  isolation: isolate;
}

body.alloy-remaster .act-stage::before {
  content: attr(data-act-label);
  position: absolute;
  right: var(--act-pad);
  top: calc(var(--progress-h) + var(--header-h) + var(--rm-space-4));
  font-family: var(--rm-font-mono);
  font-size: 0.62rem;
  letter-spacing: 0.16em;
  color: var(--rm-dim);
}

.remaster-kicker {
  font-family: var(--rm-font-mono);
  font-size: clamp(0.65rem, 1.2vw, 0.78rem);
  font-weight: 700;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--rm-red-hot);
}

.remaster-hero-copy {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(18rem, 0.7fr);
  gap: var(--rm-space-4) var(--rm-space-8);
  align-items: end;
  width: min(100%, 1180px);
  margin: 0 auto var(--rm-space-6);
}

.remaster-hero-copy .remaster-kicker {
  grid-column: 1 / -1;
}

.remaster-hero-copy h1 {
  font-family: var(--rm-font-display);
  font-size: clamp(2.4rem, 5vw, 4.8rem);
  font-weight: 800;
  line-height: 0.92;
  letter-spacing: -0.07em;
  color: var(--rm-white);
  text-wrap: balance;
}

.remaster-hero-copy h1 span {
  color: var(--rm-red-hot);
}

.remaster-deck {
  max-width: 43ch;
  font-size: clamp(0.95rem, 1.35vw, 1.12rem);
  line-height: 1.55;
  color: var(--rm-muted);
}

.remaster-proof {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  border-top: 1px solid var(--rm-line-strong);
  border-bottom: 1px solid var(--rm-line);
}

.remaster-proof span {
  display: grid;
  gap: var(--rm-space-1);
  padding: var(--rm-space-3) var(--rm-space-4);
  border-left: 1px solid var(--rm-line);
  font-family: var(--rm-font-mono);
  font-size: 0.62rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--rm-dim);
}

.remaster-proof span:first-child {
  border-left: 0;
}

.remaster-proof strong {
  font-family: var(--rm-font-display);
  font-size: clamp(1rem, 1.8vw, 1.35rem);
  letter-spacing: -0.03em;
  text-transform: none;
  color: var(--rm-white);
}

body.alloy-remaster .alloy-discord-canvas {
  width: min(100%, 1180px);
  border-color: var(--rm-line-strong);
  box-shadow: 0 42px 120px var(--rm-shadow), 0 0 0 1px var(--rm-red-faint);
}

body.alloy-remaster .alloy-discord-canvas__stage {
  min-height: clamp(410px, 51vh, 610px);
}

body.alloy-remaster #act-1 .act-stage {
  padding-top: calc(var(--progress-h) + var(--header-h) + var(--rm-space-4));
  padding-bottom: var(--rm-space-4);
}

body.alloy-remaster #act-1 .alloy-discord-canvas__stage {
  min-height: clamp(280px, 36vh, 440px);
}

body.alloy-remaster #act-1 .discord-caption {
  display: none;
}

body.alloy-remaster .alloy-discord-canvas__dots span:first-child {
  background: var(--rm-red);
}

body.alloy-remaster .discord-caption {
  border-left-color: var(--rm-red);
  background: var(--rm-panel);
  color: var(--rm-muted);
}

.capability-board {
  display: grid;
  grid-template-columns: minmax(18rem, 0.72fr) minmax(0, 1.28fr);
  gap: clamp(var(--rm-space-8), 6vw, var(--rm-space-16));
  width: min(100%, 1180px);
  margin-inline: auto;
}

.capability-board__lead h2 {
  margin-top: var(--rm-space-4);
  font-family: var(--rm-font-display);
  font-size: clamp(2.2rem, 5vw, 4.8rem);
  font-weight: 800;
  letter-spacing: -0.065em;
  line-height: 0.95;
  color: var(--rm-white);
}

.capability-board__lead h2 span {
  color: var(--rm-red-hot);
}

.capability-board__lead > p:last-child {
  max-width: 46ch;
  margin-top: var(--rm-space-6);
  color: var(--rm-muted);
}

.capability-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  border-top: 1px solid var(--rm-line-strong);
}

.capability-grid article {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: var(--rm-space-2) var(--rm-space-4);
  min-height: 132px;
  padding: var(--rm-space-5);
  border-right: 1px solid var(--rm-line);
  border-bottom: 1px solid var(--rm-line);
  background: linear-gradient(145deg, var(--rm-panel-raised), var(--rm-panel));
  transition: transform 180ms var(--rm-ease), background 180ms ease;
}

.capability-grid article:hover {
  z-index: 1;
  transform: translateY(-3px);
  background: linear-gradient(145deg, var(--rm-red-wash), var(--rm-panel));
}

.capability-grid article > span {
  font-family: var(--rm-font-mono);
  font-size: 0.62rem;
  color: var(--rm-red-hot);
}

.capability-grid strong {
  font-size: 0.96rem;
  color: var(--rm-white);
}

.capability-grid small {
  grid-column: 2;
  font-size: 0.78rem;
  line-height: 1.45;
  color: var(--rm-muted);
}

body.alloy-remaster .act--pipeline .act-layer--mid {
  display: block;
  width: min(100%, 1180px);
  margin-inline: auto;
}

.runtime-topology {
  position: relative;
  min-height: 420px;
  margin-top: var(--rm-space-8);
  border: 1px solid var(--rm-line);
  border-radius: var(--rm-radius-lg);
  background:
    linear-gradient(var(--rm-line) 1px, transparent 1px),
    linear-gradient(90deg, var(--rm-line) 1px, transparent 1px),
    var(--rm-panel);
  background-size: 44px 44px;
  overflow: hidden;
}

.runtime-topology::before {
  content: 'LIVE PRODUCTION TOPOLOGY';
  position: absolute;
  top: var(--rm-space-4);
  left: var(--rm-space-5);
  z-index: 3;
  font-family: var(--rm-font-mono);
  font-size: 0.62rem;
  letter-spacing: 0.13em;
  color: var(--rm-red-hot);
}

.runtime-topology__paths {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.runtime-topology__paths path {
  fill: none;
  stroke: var(--rm-red);
  stroke-width: 2;
  stroke-linecap: round;
  opacity: 0.72;
}

.runtime-topology__pulse {
  fill: var(--rm-red-hot);
  filter: drop-shadow(0 0 8px var(--rm-red));
}

.runtime-node {
  position: absolute;
  z-index: 2;
  display: grid;
  gap: var(--rm-space-1);
  width: 18%;
  min-width: 150px;
  padding: var(--rm-space-4);
  border: 1px solid var(--rm-line-strong);
  border-left: 3px solid var(--rm-red);
  border-radius: var(--rm-radius-sm);
  background: color-mix(in srgb, var(--rm-panel-raised) 93%, transparent);
  box-shadow: 0 12px 30px var(--rm-shadow);
}

.runtime-node span,
.deployment-modes span,
.studio-status span {
  font-family: var(--rm-font-mono);
  font-size: 0.58rem;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--rm-red-hot);
}

.runtime-node strong,
.deployment-modes strong {
  font-size: 0.86rem;
  color: var(--rm-white);
}

.runtime-node small,
.deployment-modes small {
  font-size: 0.68rem;
  line-height: 1.35;
  color: var(--rm-muted);
}

.runtime-node--signal { left: 2.5%; top: 40%; }
.runtime-node--site { left: 24%; top: 10%; }
.runtime-node--gateway { left: 24%; bottom: 10%; }
.runtime-node--brain { left: 48%; top: 40%; width: 20%; }
.runtime-node--data { right: 2.5%; top: 10%; }
.runtime-node--ops { right: 2.5%; bottom: 10%; }

.deployment-modes {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin-top: var(--rm-space-4);
  border: 1px solid var(--rm-line);
  border-radius: var(--rm-radius-md);
  overflow: hidden;
}

.deployment-modes article {
  display: grid;
  gap: var(--rm-space-2);
  min-height: 126px;
  padding: var(--rm-space-4);
  border-left: 1px solid var(--rm-line);
  background: var(--rm-panel);
}

.deployment-modes article:first-child {
  border-left: 0;
}

.deployment-modes article.is-live {
  background: linear-gradient(135deg, var(--rm-red-wash), var(--rm-panel));
}

.deployment-modes article.is-live::after {
  content: '● LIVE';
  font-family: var(--rm-font-mono);
  font-size: 0.58rem;
  letter-spacing: 0.09em;
  color: var(--rm-green);
}

.slash-proof {
  display: grid;
  grid-template-columns: minmax(210px, 0.36fr) minmax(0, 1fr);
  gap: var(--rm-space-4);
  margin-top: var(--rm-space-6);
  padding: var(--rm-space-4);
  border: 1px solid var(--rm-line);
  border-radius: var(--rm-radius-md);
  background: var(--rm-panel);
}

.slash-proof__header {
  display: grid;
  align-content: start;
  gap: var(--rm-space-3);
}

.slash-proof__header span {
  font-family: var(--rm-font-mono);
  font-size: 0.6rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--rm-red-hot);
}

.slash-proof__header strong {
  font-size: 0.9rem;
  line-height: 1.45;
  color: var(--rm-white);
}

body.alloy-remaster .alloy-slash-mount {
  min-height: 360px;
  margin: 0;
  border-radius: var(--rm-radius-sm);
  overflow: hidden;
}

body.alloy-remaster #act4-mermaid-input-flow {
  margin-top: var(--rm-space-6);
}

body.alloy-remaster .act--sop .act3-track {
  max-width: 1180px;
}

body.alloy-remaster .sop-block {
  display: grid;
  grid-template-columns: minmax(0, 0.86fr) minmax(300px, 1.14fr);
  gap: var(--rm-space-6);
  align-items: start;
}

body.alloy-remaster .sop-block__label {
  grid-column: 1 / -1;
  color: var(--rm-red-hot);
}

body.alloy-remaster .sop-embed,
body.alloy-remaster .sop-embed__diagram {
  max-width: none;
  background: var(--rm-panel);
  border-color: var(--rm-line);
}

body.alloy-remaster .sop-embed__more {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
}

.studio-status {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  width: min(100%, 1080px);
  margin: 0 auto var(--rm-space-4);
  border: 1px solid var(--rm-line);
  border-radius: var(--rm-radius-sm);
  background: var(--rm-panel);
}

.studio-status span {
  min-height: 44px;
  padding: var(--rm-space-3);
  border-left: 1px solid var(--rm-line);
  color: var(--rm-muted);
}

.studio-status span:first-child {
  border-left: 0;
  color: var(--rm-green);
}

body.alloy-remaster .act--cta .act-headline {
  max-width: 14ch;
  font-family: var(--rm-font-display);
  font-size: clamp(2.6rem, 7vw, 7rem);
  font-weight: 800;
  line-height: 0.9;
  letter-spacing: -0.07em;
}

body.alloy-remaster .agent-action-bar a {
  min-height: 44px;
}

.remaster-mark {
  position: absolute;
  right: clamp(var(--rm-space-6), 8vw, 8rem);
  top: 16%;
  width: clamp(72px, 10vw, 150px);
  height: auto;
  opacity: 0.82;
}

.remaster-mark path {
  fill: none;
  stroke: var(--rm-red-hot);
  stroke-width: 5;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.mobile-discord-tabbar {
  display: none;
}

body.alloy-remaster .cine-footer__links a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
}

@media (max-width: 900px) {
  .remaster-hero-copy,
  .capability-board {
    grid-template-columns: 1fr;
  }

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

  .remaster-proof span:nth-child(3) {
    border-left: 0;
  }

  body.alloy-remaster .sop-block {
    grid-template-columns: 1fr;
  }

  .runtime-topology {
    display: grid;
    gap: var(--rm-space-3);
    min-height: auto;
    padding: var(--rm-space-16) var(--rm-space-4) var(--rm-space-4);
  }

  .runtime-topology__paths {
    display: none;
  }

  .runtime-node {
    position: relative;
    inset: auto;
    width: 100%;
    min-width: 0;
  }
}

@media (max-width: 768px) {
  html {
    scroll-snap-type: y proximity;
    scroll-padding-top: 60px;
  }

  body.alloy-remaster .act:not(.act--sop) {
    scroll-snap-align: start;
  }

  body.alloy-remaster .act:not(.act--sop) .act-stage {
    min-height: 100svh;
  }

  body.alloy-remaster .cine-header {
    min-height: 58px;
    padding: var(--rm-space-2) var(--rm-space-3);
  }

  body.alloy-remaster .cine-nav {
    gap: var(--rm-space-2);
  }

  body.alloy-remaster .ig-toggle,
  body.alloy-remaster .cine-nav__link {
    display: none;
  }

  body.alloy-remaster .cine-nav__cta {
    max-width: 176px;
    min-height: 44px;
    padding-inline: var(--rm-space-3);
    font-size: 0.61rem;
    line-height: 1.25;
    text-align: center;
  }

  body.alloy-remaster .act-stage {
    padding: calc(var(--progress-h) + 58px + var(--rm-space-5)) var(--rm-space-3) var(--rm-space-10);
  }

  body.alloy-remaster .pipeline-progress__tick::after {
    display: none;
  }

  .remaster-hero-copy {
    gap: var(--rm-space-4);
    margin-bottom: var(--rm-space-4);
  }

  .remaster-hero-copy h1 {
    font-size: clamp(2.25rem, 12vw, 3.9rem);
    line-height: 0.94;
  }

  .remaster-deck {
    font-size: 0.92rem;
  }

  .remaster-proof span {
    min-height: 68px;
    padding: var(--rm-space-2) var(--rm-space-3);
  }

  body.alloy-remaster .alloy-discord-canvas {
    border-radius: 18px;
  }

  body.alloy-remaster .alloy-discord-canvas__stage {
    min-height: 560px;
  }

  body.alloy-remaster .alloy-discord-canvas__chrome {
    min-height: 44px;
  }

  body.alloy-remaster .discord-sim .ds-guild-rail,
  body.alloy-remaster .discord-sim .ds-sidebar,
  body.alloy-remaster .discord-sim .ds-members,
  body.alloy-remaster .discord-sim .ds-ch-actions,
  body.alloy-remaster .discord-sim .ds-ch-topic,
  body.alloy-remaster .discord-sim .ds-ch-sep {
    display: none;
  }

  body.alloy-remaster .discord-sim .ds-channel-header {
    min-height: 52px;
    padding: 0 var(--rm-space-3);
  }

  body.alloy-remaster .discord-sim .ds-main {
    padding-bottom: 56px;
  }

  body.alloy-remaster .discord-sim .ds-msg {
    padding-right: var(--rm-space-3);
    padding-left: 56px;
  }

  body.alloy-remaster .discord-sim .ds-msg > .ds-avatar {
    left: var(--rm-space-3);
    width: 32px;
    height: 32px;
  }

  body.alloy-remaster .discord-sim .ds-msg-body,
  body.alloy-remaster .discord-sim .ds-msg-author {
    font-size: 0.88rem;
  }

  body.alloy-remaster .discord-sim .ds-embed {
    width: 100%;
    max-width: none;
  }

  body.alloy-remaster .discord-sim button,
  body.alloy-remaster .discord-sim [role='button'] {
    min-width: 44px;
    min-height: 44px;
  }

  .mobile-discord-tabbar {
    position: absolute;
    right: 0;
    bottom: 0;
    left: 0;
    z-index: 20;
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    min-height: 56px;
    border-top: 1px solid var(--rm-line);
    background: color-mix(in srgb, var(--rm-panel) 96%, transparent);
    backdrop-filter: blur(16px);
  }

  .mobile-discord-tabbar span {
    display: grid;
    place-items: center;
    font-family: var(--rm-font-mono);
    font-size: 0.55rem;
    letter-spacing: 0.04em;
    color: var(--rm-dim);
  }

  .mobile-discord-tabbar span.is-active {
    color: var(--rm-red-hot);
  }

  .capability-board {
    gap: var(--rm-space-8);
  }

  .capability-board__lead h2 {
    font-size: clamp(2.1rem, 12vw, 3.5rem);
  }

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

  .capability-grid article {
    min-height: 112px;
    border-right: 0;
  }

  .deployment-modes,
  .studio-status {
    grid-template-columns: 1fr;
  }

  .slash-proof {
    grid-template-columns: 1fr;
  }

  body.alloy-remaster .alloy-slash-mount {
    min-height: 520px;
  }

  .deployment-modes article,
  .studio-status span {
    border-left: 0;
    border-top: 1px solid var(--rm-line);
  }

  .deployment-modes article:first-child,
  .studio-status span:first-child {
    border-top: 0;
  }

  body.alloy-remaster .act--cta .act-headline {
    font-size: clamp(2.8rem, 16vw, 5rem);
  }

  body.alloy-remaster .agent-action-bar {
    display: grid;
  }

  body.alloy-remaster .agent-action-bar a {
    width: 100%;
  }

  .remaster-mark {
    top: 10%;
    right: var(--rm-space-4);
    width: 68px;
    opacity: 0.35;
  }
}

@media (max-width: 360px) {
  body.alloy-remaster .cine-logo {
    font-size: 0.78rem;
  }

  body.alloy-remaster .cine-nav__cta {
    max-width: 158px;
  }

  .remaster-proof {
    grid-template-columns: 1fr;
  }

  .remaster-proof span,
  .remaster-proof span:nth-child(3) {
    min-height: 58px;
    border-left: 0;
    border-top: 1px solid var(--rm-line);
  }
}

@media (max-width: 900px) and (orientation: landscape) {
  body.alloy-remaster .alloy-discord-canvas__stage {
    min-height: 78svh;
  }

  .remaster-hero-copy h1 {
    font-size: clamp(2rem, 7vw, 3.3rem);
  }
}

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

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

  body.alloy-remaster [data-flow-path] {
    stroke-dasharray: none !important;
    stroke-dashoffset: 0 !important;
  }
}

.discord-dm-hint {
  margin-top: 1rem;
  max-width: 42rem;
  font-size: 0.92rem;
  line-height: 1.55;
  color: var(--rm-muted, #a1a1aa);
}

.discord-dm-setup {
  margin-top: 1rem;
  padding: 0.85rem 1rem;
  border: 1px solid rgba(244, 63, 94, 0.35);
  border-radius: 10px;
  background: rgba(244, 63, 94, 0.08);
  font-size: 0.88rem;
  line-height: 1.5;
  color: var(--rm-text, #e4e4e8);
}

.discord-dm-setup code {
  font-family: var(--font-mono, "JetBrains Mono", monospace);
  font-size: 0.82em;
}

a[data-cta="grunt-dm"][data-discord-cta-pending="true"] {
  opacity: 0.72;
  cursor: help;
}
