:root {
  --navy-950: #050b14;
  --navy-900: #07111f;
  --navy-850: #0b1728;
  --navy-800: #0f1e32;
  --navy-700: #1a2c43;
  --line: #263a52;
  --text: #f6f8fb;
  --muted: #95a5b9;
  --green: #36d17c;
  --green-strong: #19b968;
  --green-soft: rgba(54, 209, 124, 0.12);
  --amber: #f7b84b;
  --red: #f06b75;
  --shadow: 0 24px 70px rgba(0, 0, 0, 0.28);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  min-width: 320px;
  color: var(--text);
  background:
    radial-gradient(circle at 12% -5%, rgba(54, 209, 124, 0.1), transparent 25rem),
    radial-gradient(circle at 92% 25%, rgba(52, 117, 208, 0.1), transparent 28rem),
    var(--navy-950);
  font: 400 16px/1.6 Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
}

button, a { font: inherit; }
button { color: inherit; }
a { color: inherit; }

.skip-link {
  position: fixed;
  top: 0.75rem;
  left: 0.75rem;
  z-index: 100;
  padding: 0.55rem 0.8rem;
  color: var(--navy-950);
  background: var(--green);
  border-radius: 6px;
  transform: translateY(-180%);
}
.skip-link:focus { transform: none; }

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 64px;
  padding: 0 5vw;
  border-bottom: 1px solid rgba(149, 165, 185, 0.14);
  background: rgba(5, 11, 20, 0.86);
  backdrop-filter: blur(16px);
}

.back-link { color: var(--muted); text-decoration: none; font-size: 0.9rem; font-weight: 700; }
.back-link:hover { color: var(--text); }
.header-status { display: flex; align-items: center; gap: 0.5rem; color: var(--muted); font: 700 0.72rem/1 ui-monospace, monospace; text-transform: uppercase; letter-spacing: 0.08em; }
.status-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--green); box-shadow: 0 0 0 5px var(--green-soft), 0 0 18px var(--green); }

main { width: min(1280px, 92vw); margin: 0 auto; }

.hero { padding: clamp(4rem, 9vw, 8rem) 0 clamp(3rem, 6vw, 5rem); }
.eyebrow, .section-label, .project-label {
  margin: 0 0 0.75rem;
  color: var(--green);
  font: 700 0.73rem/1.2 ui-monospace, SFMono-Regular, Consolas, monospace;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}
h1 { max-width: 900px; margin: 0; font-size: clamp(2.4rem, 6vw, 5.6rem); line-height: 0.98; letter-spacing: -0.055em; }
.hero-copy { max-width: 720px; margin: 1.5rem 0 2rem; color: var(--muted); font-size: clamp(1rem, 2vw, 1.25rem); }
.architecture-summary { display: flex; align-items: center; flex-wrap: wrap; gap: 0.65rem; color: var(--muted); font: 700 0.75rem/1.2 ui-monospace, monospace; text-transform: uppercase; }
.architecture-summary span { padding: 0.5rem 0.7rem; border: 1px solid var(--line); border-radius: 5px; background: var(--navy-850); }
.architecture-summary b { color: var(--green); }

.workflow-shell, .content-section {
  margin-bottom: 2rem;
  padding: clamp(1.2rem, 3vw, 2rem);
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(11, 23, 40, 0.82);
  box-shadow: var(--shadow);
}

.section-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 2rem; margin-bottom: 1.4rem; }
.section-heading.compact { margin-bottom: 1rem; }
.section-heading h2, .subsystem-panel h2 { margin: 0; font-size: clamp(1.5rem, 3vw, 2.2rem); letter-spacing: -0.03em; }
.section-heading p:not(.section-label) { margin: 0.35rem 0 0; color: var(--muted); }
.pipeline-controls { display: flex; gap: 0.55rem; flex-shrink: 0; }
.control-button, .filter-button {
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--navy-900);
  cursor: pointer;
  transition: border-color 180ms ease, background 180ms ease, transform 180ms ease;
}
.control-button { padding: 0.62rem 0.85rem; font-size: 0.82rem; font-weight: 700; }
.control-button:hover, .filter-button:hover { border-color: var(--green); transform: translateY(-1px); }
.run-button { color: var(--navy-950); border-color: var(--green); background: var(--green); }
.run-button:disabled { cursor: wait; opacity: 0.65; transform: none; }
.play-icon { font-size: 0.68rem; margin-right: 0.3rem; }

.filter-bar { display: flex; flex-wrap: wrap; gap: 0.45rem; margin-bottom: 1rem; }
.filter-button { padding: 0.36rem 0.7rem; color: var(--muted); font-size: 0.75rem; font-weight: 800; text-transform: uppercase; letter-spacing: 0.05em; }
.filter-button.active { color: var(--navy-950); border-color: var(--green); background: var(--green); }

.progress-track { height: 3px; overflow: hidden; border-radius: 99px; background: var(--navy-700); }
.progress-fill { width: 0; height: 100%; background: var(--green); box-shadow: 0 0 14px var(--green); transition: width 400ms ease; }
.progress-label { margin: 0.55rem 0 1rem; color: var(--muted); font: 600 0.72rem/1.2 ui-monospace, monospace; text-align: right; }

.pipeline-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1.5rem 2.3rem; overflow: hidden; padding: 0.2rem; }
.workflow-step {
  position: relative;
  display: grid;
  grid-template-columns: auto auto 1fr;
  align-items: center;
  gap: 0.75rem;
  min-height: 94px;
  padding: 0.9rem;
  border: 1px solid var(--line);
  border-radius: 10px;
  text-align: left;
  background: linear-gradient(145deg, rgba(15, 30, 50, 0.98), rgba(7, 17, 31, 0.98));
  cursor: pointer;
  opacity: 0;
  transform: translateY(12px);
  animation: stepIn 500ms forwards;
  animation-delay: calc(var(--order, 0) * 45ms);
  transition: opacity 220ms ease, transform 220ms ease, border-color 220ms ease, box-shadow 220ms ease;
}
.workflow-step::after {
  content: "→";
  position: absolute;
  left: calc(100% + 0.58rem);
  top: 50%;
  color: #4b6077;
  font: 700 1.1rem/1 ui-monospace, monospace;
  transform: translateY(-50%);
}
.workflow-step:nth-child(1), .workflow-step:nth-child(6), .workflow-step:nth-child(7),
.workflow-step:nth-child(12), .workflow-step:nth-child(13), .workflow-step:nth-child(18) { grid-column: 1; }
.workflow-step:nth-child(2), .workflow-step:nth-child(5), .workflow-step:nth-child(8),
.workflow-step:nth-child(11), .workflow-step:nth-child(14), .workflow-step:nth-child(17) { grid-column: 2; }
.workflow-step:nth-child(3), .workflow-step:nth-child(4), .workflow-step:nth-child(9),
.workflow-step:nth-child(10), .workflow-step:nth-child(15), .workflow-step:nth-child(16) { grid-column: 3; }
.workflow-step:nth-child(-n+3) { grid-row: 1; }
.workflow-step:nth-child(n+4):nth-child(-n+6) { grid-row: 2; }
.workflow-step:nth-child(n+7):nth-child(-n+9) { grid-row: 3; }
.workflow-step:nth-child(n+10):nth-child(-n+12) { grid-row: 4; }
.workflow-step:nth-child(n+13):nth-child(-n+15) { grid-row: 5; }
.workflow-step:nth-child(n+16):nth-child(-n+18) { grid-row: 6; }
.workflow-step:nth-child(4)::after, .workflow-step:nth-child(5)::after,
.workflow-step:nth-child(10)::after, .workflow-step:nth-child(11)::after,
.workflow-step:nth-child(16)::after, .workflow-step:nth-child(17)::after {
  content: "←";
  right: calc(100% + 0.58rem);
  left: auto;
}
.workflow-step:nth-child(3)::after, .workflow-step:nth-child(6)::after,
.workflow-step:nth-child(9)::after, .workflow-step:nth-child(12)::after,
.workflow-step:nth-child(15)::after {
  content: "↓";
  left: 50%;
  top: calc(100% + 0.78rem);
  transform: translateX(-50%);
}
.workflow-step:last-child::after { display: none; }
.workflow-step:hover, .workflow-step:focus-visible { border-color: var(--green); transform: translateY(-3px); box-shadow: 0 12px 28px rgba(0,0,0,.25); outline: none; }
.workflow-step.selected { border-color: var(--green); box-shadow: 0 0 0 3px var(--green-soft); }
.workflow-step.filtered { opacity: 0.15 !important; filter: grayscale(1); }
.workflow-step.current { border-color: var(--green); box-shadow: 0 0 0 3px var(--green-soft), 0 0 28px rgba(54, 209, 124, 0.16); transform: translateY(-3px); }
.workflow-step.complete { border-color: rgba(54, 209, 124, 0.4); background: linear-gradient(145deg, rgba(18, 55, 48, 0.8), rgba(7, 27, 28, 0.98)); }
.workflow-step.complete .step-number { color: var(--navy-950); background: var(--green); }
.approval-step { border-style: dashed; }
.strategy-step { background: linear-gradient(145deg, rgba(22, 42, 68, 0.98), rgba(8, 22, 39, 0.98)); }
.step-number { align-self: start; padding: 0.2rem 0.32rem; color: var(--green); border-radius: 4px; background: var(--green-soft); font: 800 0.65rem/1 ui-monospace, monospace; }
.step-icon { display: grid; place-items: center; width: 34px; height: 34px; color: var(--green); border: 1px solid rgba(54,209,124,.24); border-radius: 7px; background: var(--green-soft); font: 800 0.9rem/1 ui-monospace, monospace; }
.step-content { display: flex; flex-direction: column; min-width: 0; }
.step-content strong { font-size: 0.88rem; line-height: 1.25; }
.step-content small { margin-top: 0.28rem; overflow: hidden; color: var(--muted); font-size: 0.7rem; text-overflow: ellipsis; white-space: nowrap; }

.strategy-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1rem; }
.strategy-card { padding: 1.2rem; border: 1px solid var(--line); border-radius: 11px; background: var(--navy-900); }
.strategy-card h3 { margin: 1.2rem 0 0.3rem; font-size: 1rem; }
.strategy-card > p { min-height: 3.4em; margin: 0; color: var(--muted); font-size: 0.84rem; }
.strategy-card dl { margin: 1rem 0 0; border-top: 1px solid var(--line); }
.strategy-card dl div { display: flex; justify-content: space-between; gap: 1rem; padding-top: 0.55rem; font-size: 0.74rem; }
.strategy-card dt { color: var(--muted); }
.strategy-card dd { margin: 0; font-weight: 700; }
.strategy-visual { display: flex; align-items: center; justify-content: center; gap: 0.45rem; height: 58px; border-radius: 7px; background: var(--navy-850); }
.strategy-visual i { display: block; width: 28px; height: 28px; border: 2px solid var(--green); border-radius: 5px; background: var(--green-soft); }
.rolling i:nth-child(-n+2) { border-color: #496178; background: #19283a; }
.blue-green i:nth-child(-n+2) { border-color: #4b89da; background: rgba(75,137,218,.12); }
.blue-green span { color: var(--muted); }
.canary i { width: 20px; height: 20px; }
.canary i:first-child { border-color: var(--amber); background: rgba(247,184,75,.12); }

.split-section { display: grid; grid-template-columns: 1fr 1fr; gap: 2rem; background: transparent; box-shadow: none; }
.subsystem-panel { min-width: 0; }
.subsystem-panel > h2 { margin-bottom: 1.2rem; }
.security-panel { padding-right: 2rem; border-right: 1px solid var(--line); }
.gate-list { display: grid; gap: 0.65rem; }
.gate-list article { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 0.75rem; padding: 0.8rem; border: 1px solid var(--line); border-radius: 9px; background: var(--navy-900); }
.gate-icon { display: grid; place-items: center; width: 38px; height: 38px; color: var(--green); border-radius: 7px; background: var(--green-soft); font: 800 0.72rem/1 ui-monospace, monospace; }
.gate-list h3 { margin: 0; font-size: 0.86rem; }
.gate-list p { margin: 0.15rem 0 0; color: var(--muted); font-size: 0.72rem; line-height: 1.4; }
.gate-list b { color: var(--green); font: 700 0.6rem/1 ui-monospace, monospace; }
.signal-visual { display: flex; align-items: end; gap: 6px; height: 72px; padding: 0.8rem; border: 1px solid var(--line); border-radius: 9px; background: var(--navy-900); }
.signal-visual span { flex: 1; min-width: 8px; height: 30%; border-radius: 2px 2px 0 0; background: var(--green); animation: signal 1.6s ease-in-out infinite alternate; }
.signal-visual span:nth-child(2n) { height: 72%; animation-delay: -0.4s; }
.signal-visual span:nth-child(3n) { height: 45%; animation-delay: -0.8s; }
.signal-visual span:nth-child(5n) { height: 88%; animation-delay: -1.1s; }
.operations-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0.65rem; margin-top: 0.65rem; }
.operations-grid article { display: flex; flex-direction: column; padding: 0.75rem; border: 1px solid var(--line); border-radius: 8px; background: var(--navy-900); }
.operations-grid strong { font-size: 0.82rem; }
.operations-grid small { margin-top: 0.18rem; color: var(--muted); font-size: 0.68rem; }

.detail-panel {
  position: fixed;
  top: 0;
  right: 0;
  z-index: 50;
  width: min(440px, 100%);
  height: 100dvh;
  overflow-y: auto;
  padding: clamp(1.4rem, 4vw, 2.2rem);
  border-left: 1px solid var(--line);
  background: #091421;
  box-shadow: -30px 0 80px rgba(0,0,0,.45);
  transform: translateX(105%);
  visibility: hidden;
  transition: transform 280ms ease, visibility 280ms;
}
.detail-panel.open { transform: none; visibility: visible; }
.detail-panel-head { display: flex; align-items: center; justify-content: space-between; }
.detail-step, .detail-category, .detail-flow span, .detail-tools span { color: var(--green); font: 800 0.68rem/1 ui-monospace, monospace; letter-spacing: .09em; }
.close-panel { width: 38px; height: 38px; color: var(--muted); border: 1px solid var(--line); border-radius: 7px; background: transparent; cursor: pointer; font-size: 1.5rem; line-height: 1; }
.close-panel:hover { color: var(--text); border-color: var(--green); }
.detail-icon { display: grid; place-items: center; width: 64px; height: 64px; margin-top: 3.2rem; color: var(--green); border: 1px solid rgba(54,209,124,.3); border-radius: 12px; background: var(--green-soft); font: 800 1.2rem/1 ui-monospace, monospace; }
.detail-category { margin: 1.5rem 0 .5rem; }
.detail-panel h2 { margin: 0; font-size: 2rem; letter-spacing: -.04em; }
.detail-panel > p:not(.detail-category) { color: var(--muted); }
.detail-flow { display: grid; grid-template-columns: 1fr 1fr; gap: .7rem; margin: 1.8rem 0 .7rem; }
.detail-flow div, .detail-tools { padding: 1rem; border: 1px solid var(--line); border-radius: 9px; background: var(--navy-900); }
.detail-flow p, .detail-tools p { margin: .45rem 0 0; font-size: .82rem; }
.panel-backdrop { position: fixed; inset: 0; z-index: 40; background: rgba(0,0,0,.65); backdrop-filter: blur(2px); }

footer { margin-top: 5rem; padding: 2.5rem 5vw 3rem; border-top: 1px solid var(--line); background: var(--navy-900); }
footer > p { width: min(1280px, 100%); margin: 0 auto 1rem; color: var(--muted); font: 700 .72rem/1 ui-monospace, monospace; text-transform: uppercase; letter-spacing: .1em; }
.footer-badges { display: flex; flex-wrap: wrap; gap: .45rem; width: min(1280px, 100%); margin: auto; }
.footer-badges span { padding: .35rem .58rem; color: #bdc8d5; border: 1px solid var(--line); border-radius: 5px; background: var(--navy-850); font-size: .72rem; }

@keyframes stepIn { to { opacity: 1; transform: none; } }
@keyframes signal { to { height: 92%; opacity: .65; } }

@media (max-width: 980px) {
  .pipeline-grid { grid-template-columns: 1fr; }
  .workflow-step:nth-child(n) { grid-column: auto; grid-row: auto; }
  .workflow-step:nth-child(n)::after {
    content: "↓";
    right: auto;
    left: 50%;
    top: calc(100% + .75rem);
    transform: translateX(-50%);
  }
  .workflow-step:last-child::after { display: none; }
  .strategy-grid { grid-template-columns: 1fr; }
  .strategy-card > p { min-height: auto; }
  .split-section { grid-template-columns: 1fr; }
  .security-panel { padding: 0 0 2rem; border-right: 0; border-bottom: 1px solid var(--line); }
}

@media (max-width: 640px) {
  .site-header { padding: 0 4vw; }
  main { width: min(94vw, 1280px); }
  .hero { padding-top: 3.5rem; }
  .architecture-summary b { transform: rotate(90deg); }
  .section-heading { flex-direction: column; gap: 1rem; }
  .pipeline-controls { width: 100%; }
  .control-button { flex: 1; }
  .pipeline-grid { gap: 1.4rem; }
  .gate-list article { grid-template-columns: auto 1fr; }
  .gate-list b { display: none; }
  .operations-grid, .detail-flow { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
  .workflow-step { opacity: 1; transform: none; }
}
