/* For agents — the capability helix, install paths, house rules and live work. */

/* ── hero: copy on the left, the helix on the right ─────────────────── */

.fa-hero.tank {
  display: grid;
  min-height: max(700px, min(94svh, 1000px));
  --fa-top: #f4f7f6;
  --fa-bottom: #e6eeec;
  --fa-glow: rgb(221 213 242 / 0.55);
  background:
    radial-gradient(42% 62% at 72% 50%, var(--fa-glow), transparent 100%),
    linear-gradient(180deg, var(--fa-top), var(--fa-bottom));
}

[data-theme="dark"] .fa-hero.tank {
  --fa-top: #0b2230;
  --fa-bottom: #06141c;
  --fa-glow: rgb(42 36 80 / 0.6);
}

.fa-hero .tank__canvas {
  opacity: 0;
  transition: opacity 900ms var(--ease-out);
}

.fa-hero.is-live .tank__canvas {
  opacity: 1;
}

.fa-hero__inner {
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
  gap: 32px;
  align-items: stretch;
  padding-top: calc(var(--header-h) + 40px);
  padding-bottom: 36px;
  pointer-events: none;
}

.fa-hero__copy {
  display: grid;
  gap: 20px;
  align-content: center;
  max-width: 600px;
  pointer-events: auto;
}

.fa-hero__label {
  font-size: 0.9375rem;
  font-weight: 640;
  color: var(--current);
}

[data-theme="dark"] .fa-hero__label {
  color: var(--link);
}

.fa-hero__title {
  max-width: 9ch;
}

:lang(zh) .fa-hero__title,
:lang(zh) .fa-closer__title,
:lang(zh) .fa-head__title {
  max-width: none;
  word-break: keep-all;
}

.fa-hero__lede {
  max-width: 40ch;
  font-size: var(--fs-body-l);
  line-height: 1.55;
  color: var(--ink-2);
  text-wrap: pretty;
}

.fa-install {
  display: grid;
  gap: 10px;
  margin-top: 6px;
}

.fa-install .cmd code {
  white-space: normal;
  overflow-wrap: break-word;
}

.fa-install__note code {
  white-space: nowrap;
}

.fa-install__label {
  font-size: 0.875rem;
  font-weight: 620;
}

.fa-install__note {
  max-width: 60ch;
  font-size: 0.8125rem;
  line-height: 1.5;
  color: var(--ink-2);
}

.fa-hero__links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 22px;
  font-size: 0.9375rem;
  font-weight: 560;
}

/* the helix figure */
.fa-helix {
  position: relative;
  min-height: 600px;
  pointer-events: auto;
}

/* the framing box for the data rungs: clear of the legend above and the source below */
.fa-helix__stage {
  position: absolute;
  inset: 84px 0 64px;
  pointer-events: none;
}

.fa-helix__svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  overflow: visible;
  transition: opacity 900ms var(--ease-out);
}

.fa-hero.is-live .fa-helix__svg {
  opacity: 0;
}

.fa-helix__cap {
  position: absolute;
  z-index: 3;
  top: 4px;
  right: 0;
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  align-items: center;
  gap: 6px 16px;
  font-size: 0.8125rem;
  color: var(--ink-2);
}

.fa-helix__title {
  width: 100%;
  text-align: right;
  font-size: 0.9375rem;
  font-weight: 640;
  color: var(--ink);
}

.fa-key {
  display: inline-flex;
  align-items: center;
  gap: 7px;
}

.fa-key__dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
}

.fa-key__dot--demand {
  background: radial-gradient(circle at 35% 30%, #fff, #f3a597 60%, #e0766a);
}

.fa-key__dot--supply {
  background: radial-gradient(circle at 35% 30%, #fff, #8fd0c6 60%, #4ea89f);
}

.fa-helix__leader {
  position: absolute;
  inset: 0;
  z-index: 2;
  width: 100%;
  height: 100%;
  overflow: visible;
  pointer-events: none;
}

.fa-helix__leader.is-off {
  display: none;
}

/* the SVG helix (poster, reduced motion, no WebGL) */
.hx-bead--a {
  fill: color-mix(in oklab, #f3a597 26%, #fbfafc);
}

.hx-bead--b {
  fill: color-mix(in oklab, #8fd0c6 26%, #fbfafc);
}

.hx-rung {
  stroke-width: 1.2;
  opacity: 0.7;
}

.hx-rung--a {
  stroke: var(--accent);
}

.hx-rung--b {
  stroke: var(--held);
}

.hx-rung.is-lit {
  stroke-width: 2.4;
  opacity: 1;
}

.hx-data {
  stroke: rgb(255 255 255 / 0.85);
  stroke-width: 1.2;
}

.hx-data--a {
  fill: #f3a597;
}

.hx-data--b {
  fill: #8fd0c6;
}

.hx-data.is-zero {
  fill: var(--line-strong);
}

.hx-data.is-lit {
  stroke: var(--ink);
  stroke-width: 1.6;
}

[data-theme="dark"] .hx-bead--a {
  fill: color-mix(in oklab, #7db8ff 30%, #22394a);
}

[data-theme="dark"] .hx-bead--b {
  fill: color-mix(in oklab, #5cc7c2 30%, #22394a);
}

[data-theme="dark"] .hx-data {
  stroke: rgb(7 22 31 / 0.8);
}

[data-theme="dark"] .hx-data--a {
  fill: #7db8ff;
}

[data-theme="dark"] .hx-data--b {
  fill: #5cc7c2;
}

.fa-helix__leader line {
  stroke: var(--accent);
  stroke-width: 1;
}

.fa-helix__leader circle {
  fill: var(--accent);
}

/* the category index: one label per rung */
.fa-index {
  position: absolute;
  inset: 0;
  z-index: 3;
  pointer-events: none;
}

.fa-index > li {
  position: absolute;
  left: 0;
  top: 0;
  transform: translate3d(var(--x, 66%), var(--y, 0), 0) translateY(-50%);
}

.fa-index__skel {
  left: 66% !important;
}

.fa-index__skel:nth-child(1) { top: 30%; }
.fa-index__skel:nth-child(2) { top: 37%; }
.fa-index__skel:nth-child(3) { top: 44%; }
.fa-index__skel:nth-child(4) { top: 51%; }
.fa-index__skel:nth-child(5) { top: 58%; }
.fa-index__skel:nth-child(6) { top: 65%; }

.fa-index__item {
  pointer-events: auto;
  display: grid;
  grid-template-columns: auto auto;
  justify-content: start;
  align-items: baseline;
  gap: 2px 10px;
  max-width: 260px;
  padding: 6px 12px 6px 10px;
  border-radius: 12px;
  text-align: left;
  color: var(--ink-2);
  transition: background-color var(--t-med), box-shadow var(--t-med), color var(--t-med), opacity var(--t-med);
}

.fa-index__name {
  font-size: 0.875rem;
  font-weight: 600;
  white-space: nowrap;
}

.fa-index__n {
  font-size: 0.8125rem;
  font-weight: 620;
  color: var(--accent-ink);
}

.fa-index__n.is-zero {
  color: var(--ink-3);
}

.fa-index__more {
  display: none;
  grid-column: 1 / -1;
  font-size: 0.8125rem;
  line-height: 1.45;
  color: var(--ink-2);
}

.fa-index__more span {
  display: flex;
  align-items: center;
  gap: 7px;
}

.fa-index__more span::before {
  content: "";
  flex: none;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--dot, var(--accent));
}

.fa-index__more span + span {
  --dot: var(--held);
}

.fa-index__item:hover {
  color: var(--ink);
  background: color-mix(in oklab, var(--surface) 60%, transparent);
}

.fa-index__item.is-active {
  position: relative;
  z-index: 2;
  max-width: 320px;
  color: var(--ink);
  background: var(--surface);
  box-shadow: var(--shadow-float);
}

.fa-index__item.is-active .fa-index__more {
  display: grid;
  gap: 2px;
  margin-top: 4px;
}

.fa-index__item.is-active .fa-index__name {
  font-weight: 660;
}

.fa-readout {
  display: none;
}

.fa-helix__src {
  position: absolute;
  z-index: 3;
  right: 0;
  bottom: 0;
  max-width: 330px;
  text-align: right;
  font-size: 0.75rem;
  line-height: 1.45;
  color: var(--ink-3);
}

@media (max-width: 1180px) {
  .fa-hero__inner {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  }
}

/* phones and tablets: the helix lies down under the copy, the index becomes a row */
@media (max-width: 900px) {
  .fa-hero.tank {
    min-height: 0;
  }

  .fa-hero__inner {
    grid-template-columns: 1fr;
    gap: 28px;
    padding-top: calc(var(--header-h) + 36px);
  }

  .fa-helix {
    min-height: 0;
    display: grid;
    gap: 12px;
  }

  .fa-helix__cap {
    position: static;
    justify-content: flex-start;
    order: 0;
  }

  .fa-helix__title {
    text-align: left;
  }

  .fa-helix__stage {
    position: relative;
    inset: auto;
    height: 230px;
    order: 1;
  }

  .fa-install .cmd {
    grid-template-columns: 1fr;
    gap: 8px;
    padding: 12px 12px 10px 16px;
  }

  .fa-install .cmd .copy-btn {
    justify-self: start;
  }

  .fa-helix__leader {
    display: none;
  }

  .fa-index {
    position: static;
    order: 2;
    display: flex;
    gap: 8px;
    overflow-x: auto;
    margin-inline: calc(var(--margin) * -1);
    padding: 4px var(--margin) 8px;
    scrollbar-width: none;
  }

  .fa-index::-webkit-scrollbar {
    display: none;
  }

  .fa-index > li {
    position: static;
    flex: none;
    transform: none;
  }

  .fa-index__skel {
    display: none;
  }

  .fa-index__item {
    height: 36px;
    padding: 0 12px;
    align-items: center;
    border-radius: var(--r-pill);
    background: var(--surface-glass);
    box-shadow: 0 0 0 1px var(--line) inset;
  }

  .fa-index__item.is-active {
    background: var(--ink);
    color: var(--ink-inverse);
    box-shadow: none;
  }

  .fa-index__item.is-active .fa-index__n {
    color: var(--ink-inverse);
  }

  .fa-index__item.is-active .fa-index__more {
    display: none;
  }

  .fa-readout {
    display: grid;
    gap: 2px;
    order: 3;
    min-height: 3em;
    font-size: 0.875rem;
    color: var(--ink-2);
  }

  .fa-readout b {
    font-weight: 640;
    color: var(--ink);
  }

  .fa-helix__src {
    position: static;
    order: 4;
    text-align: left;
    max-width: none;
  }
}

/* ── facts ───────────────────────────────────────────────────────────── */

.fa-facts {
  padding-bottom: var(--section-tight);
}

.fa-facts__grid {
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 3.5fr) minmax(0, 3.5fr);
  border-top: 1px solid var(--line);
}

.fa-fact {
  padding: 28px 32px 8px 0;
}

.fa-fact + .fa-fact {
  padding-left: 32px;
  border-left: 1px solid var(--line);
}

.fa-fact__value {
  font-size: clamp(4.2rem, 9vw, 8.6rem);
  font-weight: 320;
  font-stretch: 80%;
  letter-spacing: -0.05em;
  line-height: 0.86;
}

.fa-fact__title {
  margin-top: 14px;
  font-size: 1.1875rem;
  font-weight: 640;
  line-height: 1.3;
}

.fa-fact--net .fa-fact__title {
  margin-top: 16px;
}

.fa-fact__body {
  margin-top: 8px;
  max-width: 44ch;
  color: var(--ink-2);
  text-wrap: pretty;
}

.fa-fact__promo {
  position: relative;
  margin-top: 12px;
  padding-left: 16px;
  font-size: 0.8125rem;
  color: var(--ink-2);
}

.fa-fact__promo::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.5em;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent);
}

.fa-runtimes {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 14px 24px;
  margin-top: clamp(32px, 4vw, 56px);
  padding: 20px 24px;
  border-radius: var(--r-panel);
  background: var(--surface);
}

.fa-runtimes__lead {
  font-weight: 620;
}

.fa-runtimes__list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.fa-runtimes__list li {
  display: inline-flex;
  align-items: center;
  height: 34px;
  padding-inline: 14px;
  border-radius: var(--r-pill);
  box-shadow: 0 0 0 1px var(--line) inset;
  font-size: 0.875rem;
  font-weight: 600;
}

.fa-runtimes__note {
  margin-left: auto;
  font-size: 0.875rem;
  color: var(--ink-2);
}

@media (max-width: 960px) {
  .fa-facts__grid {
    grid-template-columns: 1fr;
  }

  .fa-fact,
  .fa-fact + .fa-fact {
    padding: 24px 0;
    border-left: 0;
  }

  .fa-fact + .fa-fact {
    border-top: 1px solid var(--line);
  }

  .fa-runtimes__note {
    margin-left: 0;
  }
}

/* ── install and API rows ────────────────────────────────────────────── */

.fa-sec {
  padding-block: var(--section-tight);
}

.fa-sec--api {
  padding-bottom: var(--section);
}

.fa-row {
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
  gap: clamp(32px, 5vw, 80px);
  align-items: center;
}

.fa-row--flip {
  grid-template-columns: minmax(0, 6.4fr) minmax(0, 5.6fr);
}

.fa-row--flip .fa-row__copy {
  order: 2;
}

.fa-kicker {
  margin-bottom: 14px;
  font-size: 0.9375rem;
  font-weight: 620;
  color: var(--current);
}

[data-theme="dark"] .fa-kicker {
  color: var(--link);
}

.fa-row__copy .t-h1 {
  max-width: 16ch;
}

.fa-row__lede {
  margin: 18px 0 22px;
  max-width: 52ch;
}

.fa-list li {
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr);
  gap: 12px;
  padding: 12px 0;
  border-top: 1px solid var(--line);
  font-size: 0.9375rem;
  line-height: 1.5;
  color: var(--ink-2);
}

.fa-list li:last-child {
  border-bottom: 1px solid var(--line);
}

.fa-mark {
  position: relative;
  width: 18px;
  height: 18px;
  margin-top: 0.1em;
  border-radius: 50%;
  background: var(--held);
}

.fa-mark::after {
  content: "";
  position: absolute;
  left: 5.2px;
  top: 4.8px;
  width: 7.2px;
  height: 4.2px;
  border-left: 1.7px solid #fff;
  border-bottom: 1.7px solid #fff;
  transform: rotate(-45deg);
}

.fa-mark--no {
  background: var(--accent-ink);
}

.fa-mark--no::before,
.fa-mark--no::after {
  content: "";
  position: absolute;
  left: 4.5px;
  top: 8.2px;
  width: 9px;
  height: 1.7px;
  border: 0;
  border-radius: 2px;
  background: #fff;
  transform: rotate(45deg);
}

.fa-mark--no::before {
  transform: rotate(-45deg);
}

.fa-claim {
  display: grid;
  gap: 8px;
  margin-top: 28px;
  padding: 22px 24px;
  border-radius: var(--r-card);
  background: var(--surface);
}

.fa-claim__title {
  font-weight: 640;
}

.fa-claim__body {
  font-size: 0.9375rem;
  color: var(--ink-2);
}

.fa-claim__actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px 20px;
  margin-top: 8px;
}

.fa-row__more {
  margin-top: 20px;
  font-weight: 560;
}

/* the verified install path, as a terminal manifest */
.fa-term {
  padding: 6px;
  border-radius: var(--r-panel);
  background: #0b2230;
  color: #d8e6e8;
  box-shadow: var(--shadow-pop);
}

[data-theme="dark"] .fa-term {
  background: #041018;
  box-shadow: 0 0 0 1px var(--line) inset;
}

.fa-term__head {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 14px 10px;
}

.fa-term__dots {
  display: inline-flex;
  gap: 6px;
}

.fa-term__dots span {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: rgb(255 255 255 / 0.16);
}

.fa-term__title {
  font-size: 0.8125rem;
  font-weight: 600;
  color: #9db0b8;
}

.fa-term__steps {
  display: grid;
}

.fa-term__step {
  display: grid;
  grid-template-columns: 26px minmax(0, 1fr) auto;
  grid-template-areas:
    "n k copy"
    "n cmd copy";
  gap: 4px 14px;
  align-items: center;
  padding: 14px 12px 14px 14px;
  border-top: 1px solid rgb(255 255 255 / 0.07);
}

.fa-term__n {
  grid-area: n;
  align-self: start;
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: rgb(108 198 200 / 0.14);
  color: #6cc6c8;
  font-size: 0.75rem;
  font-weight: 700;
}

.fa-term__k {
  grid-area: k;
  font-size: 0.8125rem;
  font-weight: 600;
  color: #9db0b8;
}

.fa-term__cmd.fa-term__cmd {
  grid-area: cmd;
  padding: 0;
  background: none;
  color: #e7eef0;
  font-size: 0.8125rem;
  line-height: 1.55;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.fa-term__copy {
  grid-area: copy;
}

/* core endpoints */
.fa-endpoints {
  padding: clamp(20px, 2.4vw, 32px);
  border-radius: var(--r-panel);
  background: var(--surface);
}

.fa-endpoints__title {
  margin-bottom: 8px;
  font-weight: 640;
}

.fa-endpoints__list li {
  display: grid;
  grid-template-columns: 62px minmax(0, 1fr) auto;
  gap: 14px;
  align-items: center;
  padding: 16px 0;
  border-top: 1px solid var(--line-soft);
}

.fa-method {
  padding: 5px 0;
  border-radius: 8px;
  text-align: center;
  font-family: var(--font-code);
  font-size: 0.71875rem;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.fa-method--post {
  background: var(--accent-soft);
  color: var(--accent-ink);
}

.fa-method--get {
  background: var(--held-soft);
  color: color-mix(in oklab, var(--held) 82%, var(--ink));
}

.fa-endpoints__list code {
  padding: 0;
  background: none;
  font-size: 0.9375rem;
  color: var(--ink);
  overflow-wrap: anywhere;
}

.fa-endpoints__what {
  font-size: 0.8125rem;
  color: var(--ink-3);
}

@media (max-width: 960px) {
  .fa-row,
  .fa-row--flip {
    grid-template-columns: 1fr;
  }

  .fa-row--flip .fa-row__copy {
    order: 0;
  }
}

@media (max-width: 560px) {
  .fa-term__step {
    grid-template-columns: 24px minmax(0, 1fr);
    grid-template-areas:
      "n k"
      "n cmd"
      "n copy";
  }

  .fa-term__copy {
    justify-self: start;
    margin-top: 6px;
  }

  .fa-endpoints__list li {
    grid-template-columns: 56px minmax(0, 1fr);
  }

  .fa-endpoints__what {
    grid-column: 2;
  }
}

/* ── house rules ─────────────────────────────────────────────────────── */

.fa-head__title {
  max-width: 20ch;
}

.fa-head__lede {
  margin-top: 18px;
  max-width: 56ch;
}

.fa-rules__grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--gutter);
  margin-top: clamp(36px, 4vw, 56px);
}

.fa-rule {
  padding: clamp(24px, 3vw, 40px);
  border-radius: var(--r-panel);
  background: var(--surface);
}

.fa-rule__title {
  margin-bottom: 12px;
  font-size: 1.375rem;
  font-weight: 640;
  letter-spacing: -0.012em;
}

.fa-rule__list li {
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr);
  gap: 12px;
  padding: 14px 0;
  border-top: 1px solid var(--line-soft);
  line-height: 1.5;
}

.fa-rule--rejected {
  background: #0b2230;
  color: #e7eef0;
}

.fa-rule--rejected .fa-rule__list li {
  border-top-color: rgb(255 255 255 / 0.1);
  color: #c4d3d8;
}

.fa-rule--rejected .fa-mark--no {
  background: #4c9cf5;
}

[data-theme="dark"] .fa-rule--rejected {
  background: #041018;
  box-shadow: 0 0 0 1px var(--line) inset;
}

@media (max-width: 860px) {
  .fa-rules__grid {
    grid-template-columns: 1fr;
  }
}

/* ── closer with live work ───────────────────────────────────────────── */

.fa-closer {
  margin: 0 var(--tank-inset);
  border-radius: var(--r-tank);
  overflow: hidden;
  background:
    radial-gradient(ellipse 50% 70% at 90% 0%, color-mix(in oklab, var(--lilac) 24%, transparent), transparent 62%),
    radial-gradient(ellipse 40% 60% at 0% 100%, color-mix(in oklab, var(--current) 16%, transparent), transparent 70%),
    var(--surface);
}

.fa-closer__inner {
  display: grid;
  gap: clamp(32px, 4vw, 56px);
  padding-block: clamp(64px, 9vw, 128px);
}

.fa-closer__head {
  display: grid;
  gap: 18px;
  justify-items: start;
  max-width: 760px;
}

.fa-closer__title {
  max-width: 13ch;
}

.fa-closer__lede {
  max-width: 50ch;
  font-size: var(--fs-body-l);
  line-height: 1.55;
  color: var(--ink-2);
}

.fa-open {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--gutter);
}

.fa-open .empty {
  grid-column: 1 / -1;
}

.fa-open .tag__link {
  background: var(--bg);
}

@media (max-width: 1000px) {
  .fa-open {
    grid-template-columns: 1fr;
  }
}

/* 中文 headings: keep phrases together; break at punctuation or a zero-width hint */
:lang(zh) .fa-row__copy .t-h1,
:lang(zh) .fa-fact__title,
:lang(zh) .fa-rule__title {
  max-width: none;
  word-break: keep-all;
  overflow-wrap: anywhere;
}

:lang(zh) .fa-hero__title,
:lang(zh) .fa-closer__title,
:lang(zh) .fa-head__title {
  overflow-wrap: anywhere;
}


/* ── operator FAQ (AI agent jobs) ──────────── */

.fa-faq__list {
  margin-top: 20px;
  max-width: 820px;
}

.fa-faq__more {
  margin-top: 22px;
  font-weight: 600;
  color: var(--ink-3);
}
