/* Systems section: orchestration board, run log, capability rows, bridge marquee. */

.s-systems {
  padding-top: var(--section-gap);
}

/* ---------- header ---------- */

.systems-head {
  border-top: 1px solid var(--hairline);
  padding-top: 1rem;
}

.systems-headline {
  margin-top: clamp(2.5rem, 7vh, 4.5rem);
  max-width: 14ch;
}

.systems-intro {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  column-gap: var(--gutter);
  margin-top: clamp(2rem, 5vh, 3.5rem);
}

.systems-body {
  grid-column: 6 / 13;
}

/* ---------- orchestration board ---------- */

.systems-board {
  margin-top: clamp(4rem, 9vh, 6.5rem);
}

.board-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 0.85rem;
  color: var(--paper-dim);
}

.board-live {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.board-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--signal);
}

@media (prefers-reduced-motion: no-preference) {
  .board-dot {
    animation: board-dot-pulse 1.6s ease-in-out infinite;
  }
}

@keyframes board-dot-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.25; }
}

.board-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) clamp(260px, 26vw, 360px);
  border: 1px solid var(--hairline);
  background: var(--ink-2);
}

.board-canvas-wrap {
  min-width: 0;
}

.board-canvas {
  width: 100%;
  height: clamp(380px, 46vh, 560px);
}

.board-log {
  display: flex;
  flex-direction: column;
  min-width: 0;
  border-left: 1px solid var(--hairline);
  padding: 1.1rem 1.25rem 1.2rem;
}

.board-log-title {
  color: var(--paper-dim);
  padding-bottom: 0.8rem;
  border-bottom: 1px solid var(--hairline);
}

.board-log-lines {
  list-style: none;
  margin-top: auto;
  padding-top: 1rem;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.02em;
  line-height: 2.05;
  color: var(--paper-dim);
}

.board-log-lines li {
  white-space: nowrap;
  overflow: hidden;
  min-height: 2.05em;
  transition: opacity 0.5s var(--ease-out), transform 0.5s var(--ease-out);
}

.board-log-lines li.is-out {
  opacity: 0;
  transform: translateY(-4px);
}

/* ---------- this-page proof ---------- */

.systems-meta {
  margin-top: clamp(4.5rem, 10vh, 7.5rem);
}

.systems-meta-text {
  font-variation-settings: 'wdth' 105, 'wght' 600;
  font-stretch: 105%;
  font-weight: 600;
  font-size: clamp(1.5rem, 3.4vw, 2.85rem);
  line-height: 1.14;
  letter-spacing: -0.02em;
  max-width: 24ch;
  color: var(--paper);
}

.meta-mark {
  color: var(--signal);
}

/* ---------- capability rows ---------- */

.systems-caps {
  margin-top: clamp(5rem, 11vh, 8rem);
}

.cap-row {
  position: relative;
  display: grid;
  grid-template-columns: 4.5rem minmax(0, 1.15fr) minmax(0, 1fr);
  column-gap: var(--gutter);
  align-items: baseline;
  border-top: 1px solid var(--hairline);
  padding: clamp(1.5rem, 3.5vh, 2.4rem) 0;
}

/* Hover choreography: a red tick grows at the left edge, the index lights
   signal, the title leans in, the detail brightens. One directed gesture. */
.cap-row::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  width: 3px;
  height: 100%;
  background: var(--signal);
  transform: scaleY(0);
  transform-origin: 50% 0%;
  transition: transform 0.45s var(--ease-out);
}

.cap-row:hover::before {
  transform: scaleY(1);
}

.cap-index {
  color: var(--paper-dim);
  transition: color 0.3s var(--ease-out);
}

.cap-row:hover .cap-index {
  color: var(--signal);
}

.cap-name {
  transition: transform 0.45s var(--ease-out);
}

.cap-row:hover .cap-name {
  transform: translateX(12px);
}

.cap-detail {
  color: var(--paper-dim);
  font-size: clamp(0.95rem, 1.1vw, 1.05rem);
  line-height: 1.6;
  max-width: 46ch;
  transition: color 0.3s var(--ease-out);
}

.cap-row:hover .cap-detail {
  color: var(--paper);
}

/* ---------- bridge marquee ---------- */

.systems-marquee {
  margin-top: clamp(5rem, 11vh, 8rem);
  border-top: 1px solid var(--hairline);
  border-bottom: 1px solid var(--hairline);
  padding: clamp(1.25rem, 3.5vh, 2.25rem) 0;
  overflow: hidden;
}

.marquee-track {
  display: flex;
  width: max-content;
  will-change: transform;
}

.marquee-chunk {
  display: flex;
  align-items: baseline;
  flex: none;
  font-variation-settings: 'wdth' 110, 'wght' 800;
  font-stretch: 110%;
  font-weight: 800;
  font-size: clamp(2.4rem, 5.5vw, 4.75rem);
  line-height: 1;
  letter-spacing: -0.02em;
  white-space: nowrap;
  color: var(--paper);
}

.mq-item {
  padding: 0 0.42em;
}

.mq-outline {
  color: transparent;
  -webkit-text-stroke: 1px rgba(242, 240, 236, 0.6);
}

.mq-slash {
  color: rgba(242, 240, 236, 0.3);
}

/* ---------- mobile collapse ---------- */

@media (max-width: 767px) {
  .systems-headline {
    max-width: none;
  }

  .systems-intro {
    display: block;
  }

  .systems-body {
    margin-top: 1.5rem;
  }

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

  .board-canvas {
    height: min(60vw, 400px);
  }

  .board-log {
    border-left: 0;
    border-top: 1px solid var(--hairline);
  }

  .cap-row {
    grid-template-columns: minmax(0, 1fr);
    row-gap: 0.6rem;
  }

  .cap-detail {
    max-width: none;
  }
}
