/* ==========================================================================
   Krynexis AI — home sections
   ========================================================================== */

/* ================================================================ HERO */
.hero {
  padding-top: calc(var(--nav-h) + clamp(64px, 9vw, 120px));
  padding-bottom: clamp(56px, 7vw, 96px);
}
.hero__grid {
  display: grid;
  grid-template-columns: minmax(0, 1.08fr) minmax(0, .92fr);
  gap: clamp(32px, 5vw, 72px);
  align-items: center;
}
.hero .display { margin: 24px 0 28px; }
.hero__ctas { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 36px; }
.hero__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 14px 40px;
  margin: 56px 0 0;
  padding-top: 18px;
  border-top: 1px dashed var(--line-2);
}
.hero__meta dt {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: .07em;
  text-transform: uppercase;
  color: var(--mute);
}
.hero__meta dd { margin: 4px 0 0; font-weight: 550; font-size: 15px; }

.hero__stage {
  position: relative;
  aspect-ratio: 600 / 640;
  container-type: inline-size;
}
.stage-sheet {
  --z: 5;
  position: absolute;
  left: 6%; right: 3%; top: 5%; bottom: 4%;
  border-radius: 3px;
}
.stage-sheet.marks::before { inset: -16px; }
.portal { position: absolute; inset: 0; }
.portal i {
  position: absolute;
  left: 50%; top: 50%;
  width: calc(86% - var(--i) * 11.4%);
  aspect-ratio: 1;
  border-radius: 50%;
  transform: translate(-50%, -50%);
  translate: calc(var(--px) * var(--i) * -1.4cqw) calc(var(--py) * var(--i) * -1.4cqw);
  background: var(--c);
  box-shadow:
    inset calc(var(--sx) * 1.3cqw) calc(var(--sy) * 1.4cqw) 2.4cqw rgba(21, 20, 15, .34),
    inset calc(var(--sx) * .2cqw) calc(var(--sy) * .25cqw) .1cqw rgba(21, 20, 15, .3);
}
.portal i:nth-child(1) { --c: var(--bone); }
.portal i:nth-child(2) { --c: var(--kraft); }
.portal i:nth-child(3) { --c: var(--signal); }
.portal i:nth-child(4) { --c: var(--signal-deep); }
.portal i:nth-child(5) { --c: var(--cobalt); }
.portal i:nth-child(6) { --c: var(--cobalt-deep); }
.portal i:nth-child(7) { --c: var(--ink); }
.stage-code {
  position: absolute;
  left: 4%; bottom: 3%;
  font-family: var(--mono);
  font-size: 1.6cqw;
  letter-spacing: .08em;
  color: var(--mute);
}

.hero__threads {
  position: absolute;
  inset: 0;
  width: 100%; height: 100%;
  overflow: visible;
  pointer-events: none;
}
.hero__threads .thread {
  fill: none;
  stroke: var(--ink);
  stroke-width: 1.5;
  vector-effect: non-scaling-stroke;
  filter: drop-shadow(calc(var(--sx) * 2px) calc(var(--sy) * 2.5px) 1.5px rgba(21, 20, 15, .3));
}
.hero__threads .pulse {
  fill: none;
  stroke: var(--signal);
  stroke-width: 3.5;
  stroke-linecap: round;
  stroke-dasharray: 16 600;
  vector-effect: non-scaling-stroke;
  animation: pulse 2.8s linear infinite;
}
.hero__threads .pulse--cobalt { stroke: var(--cobalt); }
@keyframes pulse { from { stroke-dashoffset: 616; } to { stroke-dashoffset: 0; } }

.hlabel {
  position: absolute;
  left: calc(var(--x) / 600 * 100%);
  top: calc(var(--y) / 640 * 100%);
  font-family: var(--mono);
  font-size: 1.65cqw;
  letter-spacing: .08em;
  color: var(--ink-2);
  display: flex;
  align-items: center;
  gap: 1cqw;
  white-space: nowrap;
}
.hlabel::before { content: ''; width: 4cqw; height: 1px; background: var(--ink-2); }

.hnode {
  --z: 6;
  position: absolute;
  left: calc(var(--x) / 600 * 100%);
  top: calc(var(--y) / 640 * 100%);
  width: calc(200 / 600 * 100%);
  height: calc(84 / 640 * 100%);
  padding: 0 2.6cqw;
  border-radius: .6cqw;
  rotate: var(--r);
  translate: calc(var(--px) * var(--dz) * 2.6cqw) calc(var(--py) * var(--dz) * 2.6cqw);
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: .45cqw;
}
.hnode__kind {
  display: flex;
  align-items: center;
  gap: .9cqw;
  font-family: var(--mono);
  font-size: 1.6cqw;
  letter-spacing: .07em;
  text-transform: uppercase;
  color: var(--mute);
}
.hnode__kind i { width: 1.3cqw; height: 1.3cqw; background: var(--ink); }
.hnode b { font-size: 3.1cqw; font-weight: 600; letter-spacing: -.03em; line-height: 1.1; }
.hnode__meta { font-family: var(--mono); font-size: 1.75cqw; color: var(--ink-2); }
.hnode--signal { background: var(--signal); color: var(--paper-hi); }
.hnode--signal .hnode__kind, .hnode--signal .hnode__meta { color: rgba(248, 245, 238, .82); }
.hnode--signal .hnode__kind i { background: var(--paper-hi); }

.hphone {
  position: absolute;
  left: calc(var(--x) / 600 * 100%);
  top: calc(var(--y) / 640 * 100%);
  width: calc(150 / 600 * 100%);
  height: calc(250 / 640 * 100%);
  padding: 1cqw;
  border-radius: 3.6cqw;
  background: var(--black);
  rotate: 7deg;
  translate: calc(var(--px) * 3.4cqw) calc(var(--py) * 3.4cqw);
  box-shadow:
    inset 0 0 0 .3cqw #2A2925,
    calc(var(--sx) * 1cqw) calc(var(--sy) * 1.2cqw) 1.4cqw rgba(21, 20, 15, .3),
    calc(var(--sx) * 3cqw) calc(var(--sy) * 3.5cqw) 5cqw rgba(21, 20, 15, .22);
}
.hphone__screen {
  position: relative;
  height: 100%;
  border-radius: 2.7cqw;
  background: var(--cobalt);
  padding: 7cqw 1.3cqw 1.3cqw;
  overflow: hidden;
}
.hphone__notch {
  position: absolute;
  top: 1.4cqw; left: 50%;
  width: 34%; height: 2.6cqw;
  translate: -50% 0;
  background: var(--black);
  border-radius: 2cqw;
}
.hphone__time {
  position: absolute;
  top: 4.4cqw; left: 0; right: 0;
  text-align: center;
  font-size: 1.9cqw;
  font-weight: 600;
  color: var(--paper-hi);
  opacity: .9;
}
.hphone__card {
  margin-top: 3.4cqw;
  padding: 1.6cqw;
  border-radius: 1.6cqw;
  background: var(--paper-hi);
  display: grid;
  gap: .5cqw;
  font-size: 1.6cqw;
  color: var(--ink-2);
  animation: card-buzz 6s var(--ease) infinite;
  box-shadow: .3cqw .5cqw 1cqw rgba(10, 16, 70, .4);
}
.hphone__app { display: flex; align-items: center; gap: .7cqw; font-family: var(--mono); font-size: 1.35cqw; text-transform: uppercase; letter-spacing: .06em; color: var(--mute); }
.hphone__app i { width: 1.2cqw; height: 1.2cqw; background: var(--signal); }
.hphone__card b { font-size: 2.1cqw; color: var(--ink); letter-spacing: -.02em; }
.hphone__btns { display: flex; gap: .7cqw; margin-top: .6cqw; }
.hphone__btns span {
  flex: 1;
  text-align: center;
  padding: .8cqw 0;
  border-radius: .7cqw;
  font-weight: 600;
  font-size: 1.5cqw;
  background: var(--bone);
  color: var(--ink);
}
.hphone__btns .yes { background: var(--signal); color: var(--paper-hi); }
@keyframes card-buzz {
  0%, 8% { transform: translateY(-140%); opacity: 0; }
  14% { transform: translateY(4%); opacity: 1; }
  17% { transform: translateX(-3%); }
  19% { transform: translateX(3%); }
  21%, 86% { transform: none; opacity: 1; }
  94%, 100% { transform: translateY(-140%); opacity: 0; }
}

.reg { position: absolute; width: 3.6cqw; height: 3.6cqw; }
.reg--a { left: 1%; top: 0; }
.reg--b { right: 0; bottom: 0; }

@media (max-width: 900px) {
  .hero__grid { grid-template-columns: 1fr; }
  .hero__stage { max-width: 560px; width: 100%; margin-inline: auto; }
}

/* ================================================================ TAPE */
.tape {
  position: relative;
  z-index: 3;
  margin: 12px -3vw 0;
  padding: 15px 0 13px;
  rotate: -1.4deg;
  background: rgba(200, 181, 150, .92);
  overflow: hidden;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, .35),
    calc(var(--sx) * 2px) calc(var(--sy) * 3px) 5px rgba(21, 20, 15, .18);
}
.tape__track {
  display: flex;
  align-items: center;
  gap: 30px;
  width: max-content;
  animation: marquee 42s linear infinite;
}
.tape span {
  font-size: clamp(20px, 2.2vw, 30px);
  font-weight: 600;
  letter-spacing: -.035em;
  white-space: nowrap;
}
.tape i {
  flex: none;
  width: 13px; height: 13px;
  border-radius: 50%;
  background: var(--paper);
  box-shadow: inset 1.5px 2px 2px rgba(21, 20, 15, .4);
}
@keyframes marquee { to { transform: translateX(-50%); } }

/* ================================================================ EXPLODE */
.explode { position: relative; height: 340vh; }
.explode__sticky {
  position: sticky;
  top: 0;
  height: 100vh;
  height: 100svh;
  display: flex;
  align-items: center;
  overflow: hidden;
}
.explode__grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr);
  gap: 48px;
  align-items: center;
}
.explode .h2 { margin-top: 18px; font-size: clamp(34px, 4.2vw, 64px); }
.explode__list { margin-top: 36px; }
.explode__list li {
  display: grid;
  grid-template-columns: 56px 1fr;
  gap: 8px;
  padding: 15px 0 14px;
  border-top: 1px dashed var(--line-2);
  opacity: .4;
  transition: opacity .45s var(--ease);
}
.explode__list li .mono { padding-top: 4px; transition: color .3s; }
.explode__list li b { font-size: 19px; font-weight: 600; letter-spacing: -.02em; }
.explode__list li p {
  font-size: 15px;
  color: var(--ink-2);
  max-width: 44ch;
  max-height: 0;
  opacity: 0;
  overflow: hidden;
  transition: max-height .55s var(--ease), opacity .45s var(--ease), margin .55s var(--ease);
}
.explode__list li.is-active { opacity: 1; }
.explode__list li.is-active .mono { color: var(--signal); }
.explode__list li.is-active p { max-height: 90px; opacity: 1; margin-top: 6px; }

.explode__scene {
  display: grid;
  place-items: center;
  height: min(78vh, 660px);
}
.iso {
  --e: min(1, calc(var(--p, 0) * 1.9));
  position: relative;
  width: min(380px, 60vw);
  aspect-ratio: 1;
  transform-style: preserve-3d;
  transform: rotateX(56deg) rotateZ(-42deg) translateZ(calc(var(--e) * -150px));
}
.layer {
  position: absolute;
  inset: 0;
  border-radius: 6px;
  overflow: hidden;
  transform: translateZ(calc(var(--i) * (10px + var(--e) * 104px)));
  transition: translate .6s var(--ease-paper), outline-color .3s;
  outline: 2px solid transparent;
  outline-offset: 6px;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, .5),
    0 0 0 .5px rgba(21, 20, 15, .2),
    14px 16px 34px rgba(21, 20, 15, .22);
}
.layer.is-active { translate: 0 0 30px; }
.layer__tag {
  position: absolute;
  left: 7%; top: 6%;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: .08em;
  text-transform: uppercase;
}
.layer--canvas {
  background-color: var(--paper-hi);
  background-image: radial-gradient(circle at 1px 1px, rgba(21, 20, 15, .3) 1px, transparent 1.4px);
  background-size: 16px 16px;
}
.l-canvas { position: absolute; inset: 10%; width: 80%; height: 80%; }
.layer--agents { background: var(--signal); color: var(--paper-hi); }
.l-orbit { position: absolute; inset: 20%; }
.l-orbit i {
  position: absolute;
  inset: calc(var(--k, 0) * 18%);
  border: 1.5px solid rgba(248, 245, 238, .7);
  border-radius: 50%;
}
.l-orbit i:nth-child(2) { --k: 1; border-style: dashed; }
.l-orbit i:nth-child(3) { --k: 2; }
.l-orbit b {
  position: absolute;
  left: 50%; top: 50%;
  width: 16%; aspect-ratio: 1;
  translate: -50% -50%;
  background: var(--paper-hi);
  border-radius: 50%;
}
.l-orbit::before, .l-orbit::after {
  content: '';
  position: absolute;
  width: 11%; aspect-ratio: 1;
  background: var(--ink);
  border-radius: 2px;
}
.l-orbit::before { left: 8%; top: 20%; }
.l-orbit::after { right: 2%; bottom: 30%; background: var(--paper-hi); }
.layer--runtime { background: var(--cobalt); color: var(--paper-hi); }
.l-rows { position: absolute; inset: 22% 12% 12%; display: grid; gap: 9%; align-content: start; }
.l-rows i { height: 10px; width: calc(var(--w) * 100%); background: rgba(248, 245, 238, .85); border-radius: 1px; position: relative; }
.l-rows i::before { content: ''; position: absolute; left: -16px; top: 1px; width: 8px; height: 8px; border-radius: 50%; background: var(--signal); }
.layer--ledger { background: var(--black-2); color: var(--paper); }
.l-bars { position: absolute; inset: 26% 12% 12%; display: flex; align-items: flex-end; gap: 6%; }
.l-bars i { flex: 1; height: calc(var(--h) * 100%); background: var(--paper); border-radius: 1px; }
.l-bars i:nth-child(4), .l-bars i:nth-child(6) { background: var(--signal); }

@media (max-width: 900px) {
  .explode { height: 300vh; }
  .explode__grid { grid-template-columns: 1fr; gap: 8px; }
  .explode__scene { order: -1; height: 44vh; overflow: visible; }
  .iso { width: min(190px, 48vw); transform: rotateX(56deg) rotateZ(-42deg) translateZ(calc(var(--e) * -80px)); }
  .layer { transform: translateZ(calc(var(--i) * (6px + var(--e) * 52px))); }
  .layer.is-active { translate: 0 0 14px; }
  .layer__tag { font-size: 8px; }
  .explode .h2 { font-size: 30px; }
  .explode__list { margin-top: 16px; }
  .explode__list li { display: none; }
  .explode__list li.is-active { display: grid; }
  .explode__copy .eyebrow { display: none; }
}

/* ================================================================ HOW / FOLD */
.how { position: relative; height: 290vh; }
.how__sticky {
  position: sticky;
  top: 0;
  height: 100vh;
  height: 100svh;
  display: flex;
  align-items: center;
  overflow: hidden;
}
.how__sticky > .wrap { width: 100%; }
.how__head { text-align: center; margin-bottom: clamp(36px, 5vh, 64px); }
.how__head .h2 { margin: 16px auto 0; max-width: 16ch; font-size: clamp(34px, 4.4vw, 68px); }

.fold {
  --pw: min(340px, 27vw);
  --a: clamp(0, calc(var(--p, 0) * 2.5 - .2), 1);
  --b: clamp(0, calc(var(--p, 0) * 2.5 - 1.25), 1);
  position: relative;
  width: calc(var(--pw) * 3);
  height: calc(var(--pw) * 1.16);
  margin-inline: auto;
  perspective: 2400px;
  transform-style: preserve-3d;
  translate: calc((1 - (var(--a) + var(--b)) / 2) * var(--pw)) 0;
}
.fold::before {
  content: '';
  position: absolute;
  left: 4%;
  bottom: -26px;
  height: 30px;
  width: calc(33% + (var(--a) + var(--b)) * 30%);
  background: radial-gradient(closest-side, rgba(21, 20, 15, .28), transparent);
  filter: blur(6px);
  transform: translateZ(-40px);
}
.fpanel {
  position: absolute;
  top: 0;
  width: var(--pw);
  height: 100%;
  transform-style: preserve-3d;
}
.fpanel--1 {
  left: 0;
  transform: translateZ(calc(var(--pw) * -.1 * (1 - var(--a))));
}
.fpanel--2 {
  left: var(--pw);
  transform-origin: 0 50%;
  transform: rotateY(calc((1 - var(--a)) * -176deg));
}
.fpanel--3 {
  left: 100%;
  transform-origin: 0 50%;
  transform: rotateY(calc((1 - var(--b)) * -176deg));
}
.fpanel__face, .fpanel__back {
  position: absolute;
  inset: 0;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
}
.fpanel__face {
  display: flex;
  flex-direction: column;
  padding: clamp(18px, 2.2vw, 30px);
  background: var(--paper-hi);
  box-shadow: inset 0 0 0 .5px rgba(21, 20, 15, .14);
}
.fpanel--1 > .fpanel__face {
  box-shadow: inset 0 0 0 .5px rgba(21, 20, 15, .14), 10px 14px 30px rgba(21, 20, 15, .16);
  background: linear-gradient(90deg, var(--paper-hi) 85%, #EFEBE2);
}
.fpanel--2 > .fpanel__face {
  background: linear-gradient(90deg, #ECE7DD, var(--paper-hi) 14%, var(--paper-hi) 86%, #EFEBE2);
}
.fpanel--3 > .fpanel__face {
  background: linear-gradient(90deg, #ECE7DD, var(--paper-hi) 14%);
}
.fpanel__face::after {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(90deg, rgba(21, 20, 15, .4), rgba(21, 20, 15, .1));
  opacity: 0;
}
.fpanel--2 > .fpanel__face::after { opacity: calc((1 - var(--a)) * .9); }
.fpanel--3 > .fpanel__face::after { opacity: calc((1 - var(--b)) * .9); }
.fpanel__back {
  transform: rotateY(180deg);
  background: var(--kraft);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: clamp(18px, 2.2vw, 30px);
  box-shadow: inset 0 0 0 .5px rgba(21, 20, 15, .2);
}
.fpanel--2 > .fpanel__back {
  background:
    radial-gradient(circle at 70% 64%, var(--signal) 0 18%, transparent 18.2%),
    radial-gradient(circle at 70% 64%, var(--cobalt) 0 28%, transparent 28.2%),
    var(--kraft);
}
.fpanel__back .brand { color: var(--ink); }
.fpanel__back .mono { color: var(--ink-2); }
.fpanel__hint { align-self: flex-start; padding: 6px 8px; background: var(--paper-hi); border-radius: 2px; }
.fpanel__no {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--signal);
  margin-bottom: auto;
}
.fpanel .h3 { margin: 18px 0 10px; font-size: clamp(24px, 2.6vw, 38px); }
.fpanel .body { font-size: clamp(13.5px, 1.05vw, 15.5px); }
.fpanel__art { margin-top: 18px; width: 100%; height: auto; }

@media (max-width: 820px) {
  .how { height: auto; padding-block: 96px; }
  .how__sticky { position: static; height: auto; display: block; overflow: visible; }
  .fold { --pw: auto; width: auto; height: auto; translate: none; display: grid; gap: 16px; perspective: none; }
  .fold::before { display: none; }
  .fpanel, .fpanel--2, .fpanel--3 { position: static; width: auto; height: auto; transform: none; }
  .fpanel--2 { display: grid; gap: 16px; }
  .fpanel__face { position: relative; min-height: 300px; box-shadow: inset 0 0 0 .5px rgba(21, 20, 15, .14), 6px 10px 24px rgba(21, 20, 15, .12) !important; background: var(--paper-hi) !important; }
  .fpanel__face::after, .fpanel__back { display: none; }
}

/* ================================================================ LIVE FLOW */
.flow__bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 14px;
  margin-bottom: 18px;
}
.flow__intents { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.flow__intents .mono { color: var(--mute); margin-right: 4px; }
.flow__actions { display: flex; gap: 10px; }
.flow__actions .btn--signal { gap: 10px; padding-right: 18px; }
.flow__body {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 330px;
  gap: 18px;
  align-items: stretch;
}
.flow__stage {
  --z: 3;
  border-radius: 4px;
  overflow: hidden;
  background-color: var(--paper-hi);
  background-image: radial-gradient(circle at 1px 1px, rgba(21, 20, 15, .22) 1px, transparent 1.3px);
  background-size: 22px 22px;
}
.flow__stage.is-scroll { overflow-x: auto; overscroll-behavior-x: contain; }
.flow__sizer { pointer-events: none; }
.flow__world {
  position: absolute;
  left: 0; top: 0;
  width: 920px; height: 420px;
  transform-origin: 0 0;
}
.flow__threads { position: absolute; inset: 0; overflow: visible; }
.flow__threads .fsh {
  fill: none;
  stroke: rgba(21, 20, 15, .16);
  stroke-width: 3;
  transform: translate(calc(var(--sx) * 2px), calc(var(--sy) * 2.5px));
}
.flow__threads .fth {
  fill: none;
  stroke: var(--ink);
  stroke-width: 1.6;
  transition: stroke .3s, stroke-width .3s, opacity .3s;
}
.flow__threads .fth.is-hot { stroke: var(--signal); stroke-width: 2.6; }
.flow__threads .fth.is-dim { opacity: .22; }
.flow__threads .flabel {
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: .06em;
  text-transform: uppercase;
  fill: var(--ink-2);
  paint-order: stroke;
  stroke: var(--paper-hi);
  stroke-width: 6px;
  stroke-linejoin: round;
}
.flow__threads .token { fill: var(--signal); stroke: var(--paper-hi); stroke-width: 2.5; }
.flow__hint {
  position: absolute;
  right: 14px; bottom: 12px;
  color: var(--mute);
  font-size: 10.5px;
}

.fnode {
  --z: 3;
  position: absolute;
  width: 170px; height: 78px;
  padding: 0 14px;
  border-radius: 3px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 3px;
  cursor: grab;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
  transition: --lift .35s var(--ease), background .35s, color .35s, opacity .35s, rotate .35s var(--ease);
}
.fnode:hover { --lift: 3; }
.fnode.is-drag { cursor: grabbing; --lift: 12; rotate: -1.4deg; z-index: 5; transition: --lift .2s var(--ease), rotate .2s; }
.fnode__kind {
  display: flex;
  align-items: center;
  gap: 7px;
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: .07em;
  text-transform: uppercase;
  color: var(--mute);
  transition: color .35s;
}
.fnode__kind i { width: 8px; height: 8px; background: var(--k, var(--ink)); transition: background .35s; }
.fnode b { font-size: 16px; font-weight: 600; letter-spacing: -.02em; line-height: 1.15; }
.fnode__meta { font-family: var(--mono); font-size: 11px; color: var(--ink-2); transition: color .35s; }
.fnode::before, .fnode::after {
  content: '';
  position: absolute;
  top: 50%;
  width: 10px; height: 10px;
  border-radius: 50%;
  translate: 0 -50%;
  background: var(--paper);
  box-shadow: inset 1px 1.5px 2px rgba(21, 20, 15, .45), 0 0 0 .5px rgba(21, 20, 15, .2);
}
.fnode::before { left: -5px; }
.fnode::after { right: -5px; }
.fnode[data-kind="Trigger"]::before { display: none; }
.fnode[data-end]::after { display: none; }
.fnode[data-kind="Model"] { --k: var(--signal); }
.fnode[data-kind="Relay"] { --k: var(--cobalt); }
.fnode[data-kind="Branch"] { --k: var(--kraft-2); }
.fnode.is-run { background: var(--signal); color: var(--paper-hi); --lift: 6; }
.fnode.is-wait { background: var(--cobalt); color: var(--paper-hi); --lift: 6; }
.fnode.is-run .fnode__kind, .fnode.is-run .fnode__meta,
.fnode.is-wait .fnode__kind, .fnode.is-wait .fnode__meta { color: rgba(248, 245, 238, .85); }
.fnode.is-run .fnode__kind i, .fnode.is-wait .fnode__kind i { background: var(--paper-hi); }
.fnode.is-skip { opacity: .38; }
.fnode__stamp {
  position: absolute;
  top: -12px; right: -10px;
  padding: 3px 6px 2px;
  font-size: 10px;
  display: none;
  background: var(--paper-hi);
}
.fnode.is-done .fnode__stamp { display: inline-flex; animation: stamp .5s var(--ease-paper) both; }

.flow__console {
  --z: 3;
  border-radius: 4px;
  padding: 16px 16px 14px;
  display: flex;
  flex-direction: column;
}
.flow__console-head {
  display: flex;
  justify-content: space-between;
  color: #A7A190;
  padding-bottom: 12px;
  border-bottom: 1px dashed rgba(241, 237, 228, .18);
}
.flow__log {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 9px;
  padding: 14px 0;
  min-height: 220px;
  max-height: 320px;
  overflow-y: auto;
  font-family: var(--mono);
  font-size: 12px;
  line-height: 1.45;
  color: #C9C3B1;
}
.flow__log li { display: grid; grid-template-columns: 58px 1fr; gap: 8px; animation: log-in .4s var(--ease) both; }
.flow__log li.is-empty { display: block; color: #8E8878; font-family: var(--font); font-size: 14px; }
.flow__log li.is-empty b { color: var(--paper); }
.flow__log time { color: #77715F; }
.flow__log b { color: var(--paper-hi); font-weight: 500; }
.flow__log em { font-style: normal; color: #FF8A66; }
.flow__log .c { color: #9AA7FF; }
@keyframes log-in { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.flow__totals {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  padding-top: 12px;
  border-top: 1px dashed rgba(241, 237, 228, .18);
}
.flow__totals .mono { color: #8E8878; font-size: 10px; }
.flow__totals b { display: block; margin-top: 2px; font-size: 15px; font-weight: 550; color: var(--paper-hi); }

@media (max-width: 1000px) {
  .flow__body { grid-template-columns: 1fr; }
  .flow__log { min-height: 140px; max-height: 220px; }
}

/* ================================================================ FEATURES */
.fgrid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 22px;
}
.fgrid > :nth-child(3n + 2) { margin-top: 44px; }
.fgrid > :nth-child(3n + 2) + * { margin-top: 18px; }
.fcard {
  --z: 2;
  display: flex;
  flex-direction: column;
  padding: 26px 28px 24px;
  border-radius: 3px;
  min-height: 400px;
  transition: --lift .5s var(--ease), rotate .6s var(--ease-paper);
}
.fcard:hover { --lift: 9; rotate: -.7deg; }
.fcard::before {
  content: '';
  position: absolute;
  top: 20px; right: 20px;
  width: 14px; height: 14px;
  border-radius: 50%;
  background: var(--paper);
  box-shadow: inset calc(var(--sx) * 1.5px) calc(var(--sy) * 2px) 2px rgba(21, 20, 15, .45);
}
.fcard__no { color: var(--mute); }
.ficon {
  width: 78px; height: 78px;
  margin: 34px 0 26px;
  filter: drop-shadow(calc(var(--sx) * 1.5px) calc(var(--sy) * 2px) 1.4px rgba(21, 20, 15, .25));
  transition: translate .6s var(--ease-paper);
}
.fcard:hover .ficon { translate: 0 -4px; }
.fcard .h3 { margin-bottom: 10px; }
.fcard .body { font-size: 15.5px; }
.fcard__more {
  margin-top: auto;
  padding-top: 22px;
  font-size: 14px;
  font-weight: 550;
  color: var(--ink);
  position: relative;
}
.fcard__more::before {
  content: '';
  position: absolute;
  left: 0; right: 0; top: 8px;
  height: 1px;
  background-image: linear-gradient(90deg, var(--line-2) 0 5px, transparent 5px 9px);
  background-size: 9px 1px;
}
.fcard:hover .fcard__more { color: var(--signal); }

@media (max-width: 1000px) {
  .fgrid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .fgrid > * { margin-top: 0 !important; }
  .fgrid > :nth-child(even) { margin-top: 36px !important; }
}
@media (max-width: 640px) {
  .fgrid { grid-template-columns: 1fr; }
  .fgrid > :nth-child(even) { margin-top: 0 !important; }
  .fcard { min-height: 0; }
}

/* ================================================================ RELAY TEASER */
.relay-teaser { margin-block: 22px; }
.relay-teaser__grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr);
  gap: clamp(40px, 6vw, 80px);
  align-items: center;
}
.relay-teaser .h2 { margin: 18px 0 22px; }
.relay-teaser__list { margin: 32px 0 36px; }
.relay-teaser__list li {
  display: flex;
  gap: 16px;
  align-items: baseline;
  padding: 14px 0;
  border-top: 1px dashed rgba(241, 237, 228, .18);
  font-size: 16.5px;
}
.relay-teaser__list .mono { color: #9AA7FF; }
.relay-teaser__art { position: relative; aspect-ratio: 1.1; container-type: inline-size; }
.rt-desk {
  --z: 7;
  position: absolute;
  left: 0; top: 8%;
  width: 70%;
  border-radius: 4px;
  color: var(--ink);
  rotate: -2.5deg;
  translate: calc(var(--px) * -2cqw) calc(var(--py) * -2cqw);
}
.rt-desk__bar {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 3cqw 3cqw 2.4cqw;
  border-bottom: 1px dashed var(--line-2);
}
.rt-desk__bar i { width: 1.4cqw; height: 1.4cqw; background: var(--bone-2); border-radius: 1px; }
.rt-desk__bar .mono { margin-left: 1.6cqw; font-size: 1.8cqw; color: var(--mute); text-transform: none; }
.rt-steps { padding: 3cqw; display: grid; gap: 1.6cqw; }
.rt-steps li {
  display: flex;
  align-items: center;
  gap: 2cqw;
  padding: 2cqw 2.4cqw;
  font-size: 2.6cqw;
  font-weight: 500;
  background: var(--paper);
  border-radius: 2px;
}
.rt-steps li::before {
  content: '';
  flex: none;
  width: 1.9cqw; height: 1.9cqw;
  border-radius: 50%;
  border: 1.5px solid var(--ink-2);
}
.rt-steps li.done::before { background: var(--ink); border-color: var(--ink); }
.rt-steps li.wait { background: var(--cobalt); color: var(--paper-hi); }
.rt-steps li.wait::before { border-color: var(--paper-hi); animation: blink 1.2s steps(2) infinite; }
@keyframes blink { 50% { background: var(--paper-hi); } }
.rt-thread {
  position: absolute;
  left: 38%; top: 46%;
  width: 34%; height: 26%;
  overflow: visible;
}
.rt-thread path {
  fill: none;
  stroke: #9AA7FF;
  stroke-width: 2;
  stroke-dasharray: 5 6;
  vector-effect: non-scaling-stroke;
  animation: dash 1.2s linear infinite;
}
@keyframes dash { to { stroke-dashoffset: -22; } }
.rt-phone {
  position: absolute;
  right: 3%; bottom: 0;
  width: 35%;
  aspect-ratio: 9 / 18.6;
  padding: 1.6cqw;
  border-radius: 6cqw;
  background: #050505;
  rotate: 6deg;
  translate: calc(var(--px) * 3cqw) calc(var(--py) * 3cqw);
  box-shadow: inset 0 0 0 .4cqw #2A2925, calc(var(--sx) * 1.4cqw) calc(var(--sy) * 2cqw) 4cqw rgba(0, 0, 0, .55);
}
.rt-phone__screen {
  position: relative;
  height: 100%;
  border-radius: 4.6cqw;
  background: var(--signal);
  padding: 9cqw 2.2cqw 2cqw;
  overflow: hidden;
}
.rt-time {
  display: block;
  text-align: center;
  font-size: 9cqw;
  font-weight: 300;
  letter-spacing: -.04em;
  color: var(--paper-hi);
  line-height: 1;
}
.rt-date {
  display: block;
  text-align: center;
  font-family: var(--mono);
  font-size: 1.8cqw;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: rgba(248, 245, 238, .8);
  margin: 1.4cqw 0 4cqw;
}
.rt-phone .hphone__notch { width: 32%; height: 4cqw; top: 2cqw; border-radius: 3cqw; }
.rt-card {
  display: grid;
  gap: 1cqw;
  padding: 2.8cqw;
  border-radius: 3cqw;
  background: var(--paper-hi);
  color: var(--ink-2);
  font-size: 2.6cqw;
  box-shadow: .6cqw 1cqw 2cqw rgba(80, 20, 5, .35);
  animation: card-buzz 6s var(--ease) infinite;
}
.rt-card .mono { font-size: 1.9cqw; color: var(--mute); }
.rt-card b { font-size: 3.4cqw; color: var(--ink); letter-spacing: -.02em; }
.rt-card .hphone__btns span { font-size: 2.3cqw; padding: 1.4cqw 0; border-radius: 1.4cqw; }
@media (max-width: 900px) {
  .relay-teaser__grid { grid-template-columns: 1fr; }
}

/* ================================================================ USE CASES */
.cards-rail {
  display: flex;
  gap: 22px;
  overflow-x: auto;
  padding: 40px max(var(--gutter), calc((100vw - var(--maxw)) / 2 + var(--gutter))) 48px;
  scroll-snap-type: x mandatory;
  scroll-padding-inline: max(var(--gutter), calc((100vw - var(--maxw)) / 2 + var(--gutter)));
  scrollbar-width: none;
  cursor: grab;
  margin-top: -40px;
}
.cards-rail::-webkit-scrollbar { display: none; }
.cards-rail.is-drag { cursor: grabbing; scroll-snap-type: none; }
.cards-rail.is-drag * { pointer-events: none; }
.icard {
  --z: 2;
  flex: 0 0 clamp(280px, 30vw, 380px);
  scroll-snap-align: start;
  display: flex;
  flex-direction: column;
  min-height: 360px;
  margin-top: 24px;
  padding: 30px 28px 26px;
  border-radius: 0 3px 3px 3px;
  background:
    linear-gradient(var(--signal), var(--signal)) 0 84px / 100% 1px no-repeat,
    repeating-linear-gradient(to bottom, transparent 0 29px, rgba(43, 69, 255, .13) 29px 30px) 0 84px / 100% calc(100% - 84px) no-repeat,
    var(--paper-hi);
  transition: --lift .5s var(--ease), rotate .6s var(--ease-paper);
}
.icard:nth-child(odd) { rotate: -.7deg; }
.icard:nth-child(even) { rotate: .6deg; }
.icard:hover { rotate: 0deg; --lift: 8; }
.icard__tab {
  position: absolute;
  top: -24px;
  left: var(--tab);
  height: 25px;
  padding: 6px 14px 0;
  font-size: 10.5px;
  border-radius: 4px 4px 0 0;
  background: var(--paper-hi);
  box-shadow: calc(var(--sx) * 1px) -1px 2px rgba(21, 20, 15, .08), 0 0 0 .5px rgba(21, 20, 15, .08);
  clip-path: inset(-6px -6px 0 -6px);
}
.icard__meta { color: var(--mute); height: 30px; }
.icard .h3 { margin: 22px 0 12px; }
.icard .body { font-size: 15px; line-height: 30px; }
.icard__nodes { margin-top: auto; padding-top: 24px; display: flex; gap: 6px; }
.icard__nodes i { flex: 1; height: 10px; border-radius: 1px; background: var(--bone-2); }
.icard__nodes i.s { background: var(--signal); }
.icard__nodes i.c { background: var(--cobalt); }

/* ================================================================ PEGBOARD */
.peg__grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr);
  gap: clamp(40px, 6vw, 80px);
  align-items: center;
}
.peg .h2 { margin: 18px 0 22px; }
.pegboard {
  --z: 3;
  border-radius: 4px;
  padding: 44px 30px 40px;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 30px 16px;
  background-color: var(--kraft);
  background-image: radial-gradient(circle, rgba(21, 20, 15, .55) 2.2px, rgba(21, 20, 15, .12) 3.2px, transparent 3.8px);
  background-size: 30px 30px;
  background-position: 15px 15px;
}
.ptag {
  --z: 2;
  position: relative;
  padding: 20px 16px 10px;
  font-size: 15px;
  font-weight: 550;
  letter-spacing: -.01em;
  border-radius: 2px;
  background: var(--paper-hi);
  rotate: var(--r);
  transform-origin: 50% -14px;
  transition: rotate .8s var(--ease-paper), --lift .4s var(--ease);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, .7),
    calc(var(--sx) * (var(--z) + var(--lift)) * .8px) calc(var(--sy) * (var(--z) + var(--lift)) * 1px) calc((var(--z) + var(--lift)) * 1.2px) rgba(21, 20, 15, .25);
}
.ptag::before {
  content: '';
  position: absolute;
  top: 6px; left: 50%;
  width: 8px; height: 8px;
  translate: -50% 0;
  border-radius: 50%;
  background: var(--kraft);
  box-shadow: inset 1px 1.5px 1.5px rgba(21, 20, 15, .5);
}
.ptag::after {
  content: '';
  position: absolute;
  left: 50%; top: -14px;
  width: 1px; height: 24px;
  background: var(--ink);
}
.ptag:hover { rotate: calc(var(--r) * -2.2); --lift: 4; }
.ptag--s { background: var(--signal); color: var(--paper-hi); }
.ptag--c { background: var(--cobalt); color: var(--paper-hi); }
.ptag--k { background: var(--ink); color: var(--paper-hi); }
@media (max-width: 900px) { .peg__grid { grid-template-columns: 1fr; } }

/* ================================================================ ENTERPRISE */
.enterprise { margin-top: 22px; }
.egrid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
}
.ecard {
  --z: 3;
  padding: 26px 26px 28px;
  border-radius: 3px;
  min-height: 200px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  transition: --lift .4s var(--ease);
}
.ecard:hover { --lift: 6; }
.ecard .mono { color: var(--signal); margin-bottom: auto; }
.ecard .h4 { margin-top: 26px; }
@media (max-width: 900px) { .egrid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 560px) { .egrid { grid-template-columns: 1fr; } }

/* ================================================================ TEAR-OFF */
.tearoff { padding-top: clamp(100px, 11vw, 160px); }
.poster {
  --z: 5;
  border-radius: 3px 3px 0 0;
  padding: clamp(28px, 5vw, 64px) clamp(22px, 5vw, 64px) 0;
}
.poster__top {
  display: grid;
  grid-template-columns: 1.6fr 1fr;
  gap: 40px;
  align-items: end;
  padding-bottom: clamp(40px, 5vw, 64px);
}
.poster .h1 { margin-top: 20px; max-width: 15ch; }
.poster__side .stamp { margin-top: 24px; font-size: 14px; padding: 8px 14px 7px; }
.tabs {
  display: grid;
  grid-template-columns: repeat(8, 1fr);
  margin-inline: calc(clamp(22px, 5vw, 64px) * -1);
  background-image: linear-gradient(90deg, var(--line-2) 0 5px, transparent 5px 9px);
  background-size: 9px 1px;
  background-repeat: repeat-x;
}
.tab {
  position: relative;
  height: 200px;
  cursor: grab;
  touch-action: none;
}
.tab + .tab .tab__paper { border-left: 1px dashed var(--line-2); }
.tab__paper {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  background: var(--paper-hi);
  writing-mode: vertical-rl;
  transform-origin: 50% 0;
  transition: transform .5s var(--ease-paper), background .3s;
  will-change: transform;
}
.tab__paper span {
  rotate: 180deg;
  font-size: 18px;
  font-weight: 600;
  letter-spacing: -.02em;
}
.tab__paper small {
  rotate: 180deg;
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: .07em;
  text-transform: uppercase;
  color: var(--mute);
}
.tab:hover .tab__paper { background: #FBF9F4; transform: rotate(1.2deg); }
.tab:focus-visible { outline-offset: -4px; }
.tab::before {
  content: '';
  position: absolute;
  left: 0; right: 0; top: 0;
  height: 14px;
  background: var(--paper-hi);
  clip-path: polygon(0 0, 100% 0, 100% 40%, 88% 85%, 76% 45%, 64% 100%, 52% 50%, 40% 90%, 28% 40%, 16% 80%, 0 50%);
  opacity: 0;
}
.tab.is-torn::before { opacity: 1; }
.tab.is-torn .tab__paper {
  animation: tab-fall 1s var(--ease-in) forwards;
  pointer-events: none;
}
.tab.is-dragging { cursor: grabbing; }
.tab.is-dragging .tab__paper { transition: none; }
@keyframes tab-fall {
  0% { transform: translateY(var(--dy, 0px)) rotate(var(--rz, 0deg)); }
  25% { transform: translateY(calc(var(--dy, 0px) + 24px)) rotate(calc(var(--rot) * .3)); }
  100% { transform: translateY(110vh) rotate(var(--rot)); opacity: .9; }
}
.tearoff__hint { margin-top: 18px; text-align: center; color: var(--mute); }
@media (max-width: 820px) {
  .poster__top { grid-template-columns: 1fr; }
  .tabs { grid-template-columns: repeat(4, 1fr); }
  .tab:nth-child(n + 5) { display: none; }
}

.cases__all { margin-top: 18px; }
.shead > div:has(.cases__all) { justify-self: end; }
.peg__all { margin-top: 26px; }
