/* ═══ PIPELINE — how the work actually gets made ════════════════════════ */

#pipeline { position: relative; }

.pipe-flow {
  display: grid;
  gap: .7rem;
  grid-template-columns: minmax(0, 1fr);
  margin-bottom: clamp(2rem, 4vw, 3.2rem);
}
@media (min-width: 780px)  { .pipe-flow { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 1080px) { .pipe-flow { grid-template-columns: repeat(4, minmax(0, 1fr)); } }

.pipe-step {
  position: relative;
  padding: 1.25rem 1.15rem 1.15rem;
  border-radius: var(--r-md);
  border: 1px solid var(--hairline);
  background: var(--surface);
  overflow: hidden;
  transition: border-color var(--t-base), background var(--t-base), transform var(--t-base) var(--e-out);
}
.pipe-step:hover {
  border-color: color-mix(in srgb, var(--c) 50%, transparent);
  background: var(--surface-2);
  transform: translateY(-4px);
}
.pipe-step::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
  background: var(--c);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform var(--t-slow) var(--e-out);
}
.pipe-step:hover::before { transform: scaleX(1); }

/* connector arrow */
.pipe-step::after {
  content: '';
  position: absolute;
  top: 50%; right: -14px;
  width: 8px; height: 8px;
  border-top: 1px solid var(--hairline-2);
  border-right: 1px solid var(--hairline-2);
  transform: translateY(-50%) rotate(45deg);
  display: none;
}
@media (min-width: 1080px) {
  .pipe-step:not(:last-child)::after { display: block; }
}

.pipe-n {
  font-family: var(--ff-mono);
  font-size: .6rem;
  letter-spacing: .18em;
  color: var(--c);
  margin-bottom: .65rem;
  display: block;
}
.pipe-step h4 {
  font-size: 1.02rem;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: -0.025em;
  margin-bottom: .45rem;
}
.pipe-step p {
  font-size: var(--fs-sm);
  color: var(--bone-faint);
  line-height: 1.55;
  text-wrap: pretty;
}
.pipe-step code {
  font-family: var(--ff-mono);
  font-size: .8em;
  color: var(--c);
}

/* ── Trust boundary ────────────────────────────────────── */
.trust {
  display: grid;
  gap: clamp(1rem, 2vw, 1.6rem);
  grid-template-columns: minmax(0, 1fr);
  align-items: stretch;
}
@media (min-width: 940px) { .trust { grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); } }

.trust-viz {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: clamp(1.2rem, 2.6vw, 2rem);
  border-radius: var(--r-lg);
  border: 1px solid var(--hairline);
  background:
    radial-gradient(ellipse 70% 60% at 50% 0%, rgba(255,46,108,.05), transparent 60%),
    var(--ink-900);
  overflow: hidden;
}

.trust-lane {
  display: flex;
  align-items: center;
  gap: .8rem;
  padding: .85rem 1rem;
  border-radius: var(--r-md);
  border: 1px solid var(--hairline);
  background: var(--surface);
  position: relative;
}
.trust-lane b {
  font-family: var(--ff-display);
  font-weight: 900;
  font-size: .82rem;
  text-transform: uppercase;
  letter-spacing: .01em;
  color: var(--bone);
}
.trust-lane span {
  font-family: var(--ff-mono);
  font-size: .6rem;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--bone-ghost);
  margin-left: auto;
  text-align: right;
}
.trust-lane--client { border-color: color-mix(in srgb, var(--wire) 34%, transparent); }
.trust-lane--client b { color: var(--wire); }
.trust-lane--server { border-color: color-mix(in srgb, var(--signal) 34%, transparent); }
.trust-lane--server b { color: var(--signal); }
.trust-lane--store  { border-color: color-mix(in srgb, var(--ember) 34%, transparent); }
.trust-lane--store b { color: var(--ember); }

/* the guard in the middle */
.trust-guard {
  margin: .55rem 0;
  padding: .7rem 1rem;
  border-radius: var(--r-md);
  border: 1px dashed color-mix(in srgb, var(--pulse) 52%, transparent);
  background: color-mix(in srgb, var(--pulse) 7%, transparent);
  text-align: center;
  position: relative;
}
.trust-guard b {
  font-family: var(--ff-mono);
  font-size: .64rem;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--pulse);
}
.trust-guard p {
  font-size: .72rem;
  color: var(--bone-faint);
  margin-top: .3rem;
  line-height: 1.5;
}

/* animated packet */
.trust-wire {
  position: relative;
  height: 26px;
  margin: 0 auto;
  width: 2px;
  background: linear-gradient(180deg, var(--hairline-2), transparent);
}
.trust-wire i {
  position: absolute;
  left: 50%;
  top: 0;
  width: 6px; height: 6px;
  margin-left: -3px;
  border-radius: 50%;
  background: var(--wire);
  box-shadow: 0 0 10px var(--wire);
  animation: packetDown 2.4s var(--e-inout) infinite;
}
.trust-wire--up i {
  background: var(--signal);
  box-shadow: 0 0 10px var(--signal);
  animation: packetUp 2.4s var(--e-inout) infinite .4s;
}
@keyframes packetDown { from { top: -4px; opacity: 0; } 20%,80% { opacity: 1; } to { top: 24px; opacity: 0; } }
@keyframes packetUp   { from { top: 24px; opacity: 0; } 20%,80% { opacity: 1; } to { top: -4px; opacity: 0; } }

/* ── Rules list ────────────────────────────────────────── */
.rules { display: flex; flex-direction: column; gap: .5rem; }
.rule {
  display: flex;
  gap: .85rem;
  padding: .85rem 1rem;
  border-radius: var(--r-md);
  border: 1px solid var(--hairline);
  background: var(--surface);
  transition: border-color var(--t-base), background var(--t-base), transform var(--t-base) var(--e-out);
}
.rule:hover {
  border-color: var(--hairline-2);
  background: var(--surface-2);
  transform: translateX(5px);
}
.rule i {
  font-family: var(--ff-mono);
  font-size: .6rem;
  letter-spacing: .1em;
  color: var(--signal);
  flex: none;
  padding-top: .18rem;
  font-style: normal;
}
.rule p { font-size: var(--fs-sm); color: var(--bone-dim); line-height: 1.56; text-wrap: pretty; }
.rule p b { color: var(--bone); font-weight: 600; }
.rule p code {
  font-family: var(--ff-mono);
  font-size: .84em;
  color: var(--wire);
  background: color-mix(in srgb, var(--wire) 10%, transparent);
  padding: .08em .34em;
  border-radius: var(--r-xs);
}
.rule p em { font-style: normal; color: var(--pulse); }

/* ═══ CODE SPECIMEN ═════════════════════════════════════ */
.spec {
  border-radius: var(--r-lg);
  border: 1px solid var(--hairline-2);
  background: var(--ink-900);
  overflow: hidden;
  box-shadow: var(--sh-lg);
}
.spec-tabs {
  display: flex;
  gap: 0;
  border-bottom: 1px solid var(--hairline);
  background: var(--void);
  overflow-x: auto;
  scrollbar-width: none;
}
.spec-tabs::-webkit-scrollbar { display: none; }
.spec-tab {
  flex: none;
  padding: .72rem 1.05rem;
  font-family: var(--ff-mono);
  font-size: .66rem;
  letter-spacing: .06em;
  color: var(--bone-ghost);
  border-right: 1px solid var(--hairline);
  border-bottom: 2px solid transparent;
  transition: color var(--t-base), background var(--t-base), border-color var(--t-base);
  white-space: nowrap;
}
.spec-tab:hover { color: var(--bone-dim); background: var(--surface); }
.spec-tab.is-active {
  color: var(--signal);
  background: var(--ink-900);
  border-bottom-color: var(--signal);
}
.spec-body {
  padding: 1.15rem 1.3rem 1.4rem;
  overflow-x: auto;
  font-family: var(--ff-mono);
  font-size: .74rem;
  line-height: 1.85;
  min-height: 340px;
}
.spec-body pre { display: none; }
.spec-body pre.is-live { display: block; }
.spec-body .k { color: var(--pulse); }
.spec-body .f { color: var(--wire); }
.spec-body .s { color: var(--signal); }
.spec-body .c { color: var(--bone-ghost); font-style: italic; }
.spec-body .n { color: var(--ember); }
.spec-body .t { color: #C792EA; }
.spec-body .p { color: var(--bone-dim); }

.spec-foot {
  display: flex;
  align-items: center;
  gap: .7rem;
  flex-wrap: wrap;
  padding: .75rem 1.3rem;
  border-top: 1px solid var(--hairline);
  background: var(--void);
  font-family: var(--ff-mono);
  font-size: .6rem;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--bone-ghost);
}
.spec-foot b { color: var(--signal); font-weight: 600; }
