/*
 * Standalone landing page, embedded by the site's home route as an iframe
 * (System Settings → home page content = <origin>/landing/index.html).
 * One warm accent on black / white; the only moving thread is the request dot.
 */
:root {
  --bg: #fafaf9;
  --surface: #ffffff;
  --ink: #0c0c0d;
  --ink-2: #3f3f46;
  --muted: #71717a;
  --line: #e7e5e4;
  --line-soft: #f1efec;
  --accent: #b8862f;
  --accent-ink: #8a6219;
  --accent-soft: rgb(184 134 47 / 0.12);
  --ok: #2f7d4f;
  --ok-soft: rgb(47 125 79 / 0.1);
  --bad: #b4442f;
  --bad-soft: rgb(180 68 47 / 0.09);
  --radius: 16px;
  --shadow: 0 1px 0 var(--line), 0 18px 40px -28px rgb(12 12 13 / 0.28);
  --font:
    'Inter', 'PingFang SC', 'HarmonyOS Sans SC', 'Microsoft YaHei', system-ui,
    sans-serif;
  --mono:
    'JetBrains Mono', 'SFMono-Regular', ui-monospace, Consolas, 'PingFang SC',
    monospace;
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

a {
  color: inherit;
  text-decoration: none;
}

button {
  font: inherit;
  color: inherit;
  cursor: pointer;
}

.wrap {
  position: relative;
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 24px;
}

main {
  position: relative;
  z-index: 1;
}

/* ── Site nav backdrop ── */
.nav-plate {
  position: fixed;
  inset: 0 0 auto;
  height: 72px;
  z-index: 20;
  background: var(--bg);
  opacity: 0;
  border-bottom: 1px solid transparent;
  transition:
    opacity 0.3s,
    border-color 0.3s;
}

body.scrolled .nav-plate {
  opacity: 0.94;
  border-color: var(--line);
  backdrop-filter: blur(12px);
}

/* ── Request thread ── */
.thread {
  position: absolute;
  inset: 0 auto auto 0;
  z-index: 0;
  overflow: visible;
  pointer-events: none;
}

.thread path {
  fill: none;
  stroke-width: 1.5;
  stroke-linecap: round;
}

.thread .rail {
  stroke: var(--line);
  stroke-dasharray: 3 6;
}

.thread .trail {
  stroke: var(--accent);
  opacity: 0.7;
}

.dot {
  position: absolute;
  top: 0;
  left: 0;
  z-index: 0;
  width: 12px;
  height: 12px;
  margin: -6px 0 0 -6px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow:
    0 0 0 4px var(--accent-soft),
    0 0 22px 4px rgb(184 134 47 / 0.45);
  pointer-events: none;
  will-change: transform;
}

.dot::after {
  content: '';
  position: absolute;
  inset: -8px;
  border-radius: 50%;
  border: 1px solid var(--accent);
  opacity: 0;
}

.dot.docked::after {
  animation: dot-ping 1.8s var(--ease) infinite;
}

@keyframes dot-ping {
  from {
    transform: scale(0.6);
    opacity: 0.8;
  }
  to {
    transform: scale(1.8);
    opacity: 0;
  }
}

.contact-dot.lit,
.btn-dock.lit {
  border-color: var(--accent);
  background: var(--accent);
  animation: dock-glow 2.4s var(--ease) infinite;
}

.step-dot.lit {
  border-color: var(--accent);
}

@keyframes dock-glow {
  0% {
    box-shadow: 0 0 0 0 rgb(184 134 47 / 0.55);
  }
  70%,
  100% {
    box-shadow: 0 0 0 10px rgb(184 134 47 / 0);
  }
}

/* ── Shared type ── */
.kicker {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 14px;
  color: var(--accent-ink);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.08em;
}

.kicker::before {
  content: '';
  width: 18px;
  height: 1px;
  background: var(--accent);
}

h1,
h2 {
  margin: 0;
  font-weight: 700;
  letter-spacing: -0.03em;
}

h2 {
  font-size: clamp(28px, 3.4vw, 40px);
  line-height: 1.2;
}

.lead {
  margin: 16px 0 0;
  max-width: 34rem;
  color: var(--ink-2);
  font-size: 16px;
  line-height: 1.75;
}

.head {
  position: relative;
  margin-bottom: 40px;
  padding-bottom: 4px;
  background: var(--bg);
}

.tag {
  display: inline-flex;
  align-items: center;
  height: 22px;
  padding: 0 8px;
  border: 1px solid var(--accent-soft);
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent-ink);
  font-size: 12px;
  font-weight: 600;
}

.chip {
  display: inline-flex;
  align-items: center;
  height: 24px;
  padding: 0 8px;
  margin: 0 6px 6px 0;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--bg);
  font-family: var(--mono);
  font-size: 12px;
}

.btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  height: 48px;
  padding: 0 22px;
  border-radius: 12px;
  font-size: 15px;
  font-weight: 600;
  transition:
    transform 0.2s var(--ease),
    background 0.2s;
}

.btn:hover {
  transform: translateY(-1px);
}

.btn-primary {
  background: var(--ink);
  color: #fff;
}

.btn-ghost {
  border: 1px solid var(--line);
  background: var(--surface);
}

.btn-dock {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  border: 1.5px solid rgb(255 255 255 / 0.3);
}

/* ── 1 Hero ── */
.hero {
  padding: 150px 0 96px;
  text-align: center;
}

.hero::before {
  content: '';
  position: absolute;
  inset: 0 0 auto;
  height: 620px;
  z-index: -1;
  background: radial-gradient(
    60% 70% at 50% 0%,
    rgb(184 134 47 / 0.08),
    transparent 70%
  );
}

.hero-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  height: 32px;
  margin: 0 0 28px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  color: var(--ink-2);
  font-size: 13px;
}

.eyebrow .sep {
  width: 1px;
  height: 12px;
  background: var(--line);
}

.live {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--ok);
  box-shadow: 0 0 0 3px var(--ok-soft);
}

.hero-title {
  font-size: clamp(44px, 6.4vw, 84px);
  line-height: 1.06;
}

.hero-title .line {
  display: block;
}

/* Words stack in one grid cell so swapping them never changes layout mode. */
.rot {
  position: relative;
  display: inline-grid !important;
  grid-template-columns: minmax(0, 1fr);
  justify-items: center;
  align-items: center;
  height: 1.2em;
  margin-top: 4px;
  overflow: hidden;
  transition: width 0.5s var(--ease);
}

.rot-word {
  grid-area: 1 / 1;
  justify-self: unsafe center;
  display: inline-flex;
  align-items: center;
  gap: 0.18em;
  white-space: nowrap;
  color: var(--wc, var(--ink));
  transition:
    transform 0.55s var(--ease),
    opacity 0.4s;
}

.rot-word img {
  width: 0.78em;
  height: 0.78em;
}

.rot-word .period {
  margin-left: 0.04em;
  color: var(--ink);
}

.rot-word.enter {
  transform: translateY(70%);
  opacity: 0;
}

.rot-word.leave {
  transform: translateY(-70%);
  opacity: 0;
}

.hero-sub {
  margin: 26px 0 0;
  color: var(--ink-2);
  font-size: 18px;
  line-height: 1.75;
}

.hero-actions {
  display: flex;
  gap: 12px;
  margin-top: 36px;
}

.facts {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px 28px;
  margin: 40px 0 0;
  padding: 0;
  list-style: none;
  color: var(--muted);
  font-size: 14px;
}

.facts b {
  margin-right: 6px;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
  font-weight: 700;
}

.marquee {
  width: min(100vw, 1180px);
  margin-top: 56px;
  overflow: hidden;
  -webkit-mask-image: linear-gradient(
    90deg,
    transparent,
    #000 12%,
    #000 88%,
    transparent
  );
  mask-image: linear-gradient(
    90deg,
    transparent,
    #000 12%,
    #000 88%,
    transparent
  );
}

.vendors {
  display: flex;
  flex-wrap: nowrap;
  gap: 10px;
  width: max-content;
  margin: 0;
  padding: 6px 10px 6px 0;
  list-style: none;
  animation: marquee 48s linear infinite;
}

.marquee:hover .vendors {
  animation-play-state: paused;
}

@keyframes marquee {
  to {
    transform: translateX(-50%);
  }
}

.vendors li {
  flex: none;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 38px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  color: var(--ink-2);
  font-size: 14px;
  font-weight: 500;
  opacity: 0.55;
  transition:
    opacity 0.4s,
    transform 0.5s var(--ease),
    border-color 0.4s,
    box-shadow 0.4s;
}

.vendors li img {
  width: 18px;
  height: 18px;
}

.vendors li.on {
  opacity: 1;
  border-color: var(--accent);
  box-shadow: 0 8px 22px -14px rgb(184 134 47 / 0.8);
  transform: translateY(-3px);
  color: var(--ink);
}

.thread-start {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-top: 44px;
  color: var(--muted);
  font-size: 13px;
}

.start-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--accent);
  animation: dock-glow 2.4s var(--ease) infinite;
}

/* ── Sections ── */
.section {
  padding: 120px 0;
}

.section.alt {
  border-top: 1px solid var(--line-soft);
}

.tabs {
  display: flex;
  gap: 4px;
}

.tabs button {
  height: 32px;
  padding: 0 12px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
}

.tabs button[aria-selected='true'] {
  background: var(--bg);
  color: var(--ink);
  box-shadow: inset 0 0 0 1px var(--line);
}

.code {
  margin: 0;
  font-family: var(--mono);
  font-size: 13px;
  line-height: 1.75;
  white-space: pre-wrap;
  word-break: break-word;
  color: var(--ink-2);
}

.code .k {
  color: #9a3412;
}

.code .s {
  color: #166534;
}

.code .n {
  color: #6d28d9;
}

.code .c {
  color: var(--muted);
}

.code .u {
  color: var(--accent-ink);
  font-weight: 600;
}

/* ── 2 Flow console ── */
.console {
  border: 1px solid var(--line);
  border-radius: 20px;
  background: var(--surface);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.console-top {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--line-soft);
}

.strategy {
  display: inline-flex;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--bg);
}

.strategy button {
  height: 28px;
  padding: 0 10px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
}

.strategy button[aria-checked='true'] {
  background: var(--surface);
  color: var(--ink);
  box-shadow:
    0 1px 2px rgb(12 12 13 / 0.08),
    inset 0 0 0 1px var(--line);
}

.status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-left: auto;
  height: 28px;
  padding: 0 10px;
  border-radius: 999px;
  background: var(--bg);
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
}

.status::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
}

.status.busy {
  color: var(--accent-ink);
  background: var(--accent-soft);
}

.status.ok {
  color: var(--ok);
  background: var(--ok-soft);
}

.status.bad {
  color: var(--bad);
  background: var(--bad-soft);
}

.replay {
  height: 32px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  font-size: 13px;
  font-weight: 600;
}

.replay:hover {
  border-color: var(--ink);
}

.steps {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  margin: 0;
  padding: 18px 24px;
  border-bottom: 1px solid var(--line-soft);
  list-style: none;
  counter-reset: step;
}

.steps li {
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 600;
  transition: color 0.3s;
}

.steps li:not(:last-child)::after {
  content: '';
  flex: 1;
  height: 1px;
  margin: 0 14px;
  background: linear-gradient(
      90deg,
      var(--accent) var(--fill, 0%),
      var(--line) var(--fill, 0%)
    )
    no-repeat;
  transition: --fill 0.4s;
}

.step-dot {
  display: inline-flex;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 1.5px solid var(--line);
  background: var(--surface);
  transition:
    border-color 0.3s,
    background 0.3s;
}

.steps li.active {
  color: var(--ink);
}

.steps li.active .step-dot {
  border-color: var(--accent);
  box-shadow: 0 0 0 4px var(--accent-soft);
}

.steps li.done {
  color: var(--ink);
}

.steps li.done .step-dot {
  border-color: var(--accent);
  background: var(--accent)
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12l5 5 9-10'/%3E%3C/svg%3E")
    center / 12px no-repeat;
}

.console-body {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr);
  min-height: 400px;
}

.pane {
  padding: 22px 24px;
}

.pane + .pane {
  border-left: 1px solid var(--line-soft);
  background: #fcfcfb;
}

.pane-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 0 0 12px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.06em;
}

.hint {
  color: var(--accent-ink);
  font-weight: 500;
  letter-spacing: 0;
}

.channels {
  display: grid;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.channels li {
  display: grid;
  grid-template-columns: 96px minmax(0, 1fr) 120px;
  align-items: center;
  gap: 12px;
  min-height: 52px;
  padding: 8px 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
  transition:
    border-color 0.3s,
    background 0.3s;
}

.ch-name {
  display: flex;
  flex-direction: column;
  line-height: 1.3;
}

.ch-name b {
  font-size: 13px;
}

.ch-name small {
  color: var(--muted);
  font-size: 11px;
}

.ch-metrics {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 12px;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 12px;
}

.channels li.probed .ch-metrics {
  color: var(--ink-2);
}

.ch-score {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 26px;
  align-items: center;
  gap: 8px;
}

.ch-track {
  height: 6px;
  border-radius: 999px;
  background: var(--line);
  overflow: hidden;
}

.ch-track i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--ink-2);
  animation: grow 0.6s var(--ease) both;
}

.ch-score b {
  font-family: var(--mono);
  font-size: 12px;
  text-align: right;
}

@keyframes grow {
  from {
    width: 0;
  }
}

.channels li.chosen {
  border-color: var(--accent);
  background: var(--accent-soft);
}

.channels li.chosen .ch-track i {
  background: var(--accent);
}

.channels li.chosen .ch-name b::after {
  content: ' 已选';
  color: var(--accent-ink);
  font-size: 11px;
}

.reason {
  display: block;
  margin-bottom: 4px;
  color: var(--ink-2);
}

.convert {
  min-height: 20px;
  margin: 14px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.convert b {
  color: var(--ink);
  font-weight: 600;
}

.answer {
  margin-top: 12px;
  padding: 16px 18px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
  min-height: 132px;
}

.answer-model {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 8px;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 12px;
}

.answer-model img {
  width: 14px;
  height: 14px;
}

.answer-text {
  margin: 0;
  color: var(--ink);
  font-size: 15px;
  line-height: 1.8;
}

.answer-text.typing::after {
  content: '';
  display: inline-block;
  width: 7px;
  height: 16px;
  margin-left: 2px;
  vertical-align: -3px;
  background: var(--accent);
  animation: blink 1s steps(1) infinite;
}

.answer-text.failed {
  color: var(--bad);
}

@keyframes blink {
  50% {
    opacity: 0;
  }
}

.console-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 28px;
  padding: 14px 24px;
  border-top: 1px solid var(--line-soft);
  color: var(--muted);
  font-family: var(--mono);
  font-size: 12px;
}

.console-meta b {
  margin-left: 6px;
  color: var(--ink);
  font-weight: 600;
}

/* Protocol tabs show the protocol owner's logo only. */
.tabs .logo-tab {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  padding: 0;
}

.logo-tab img {
  width: 18px;
  height: 18px;
  opacity: 0.45;
  filter: grayscale(1);
  transition:
    opacity 0.2s,
    filter 0.2s;
}

.logo-tab:hover img,
.logo-tab[aria-selected='true'] img {
  opacity: 1;
  filter: none;
}

/* Custom model dropdown */
.picker {
  position: relative;
  margin-left: 8px;
}

.picker-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 34px;
  padding: 0 10px 0 12px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--bg);
  font-family: var(--mono);
  font-size: 13px;
  transition: border-color 0.2s;
}

.picker-btn:hover,
.picker.open .picker-btn {
  border-color: var(--ink-2);
}

.picker-btn img {
  width: 16px;
  height: 16px;
}

.chev {
  width: 8px;
  height: 8px;
  margin: -3px 0 0 4px;
  border-right: 1.5px solid var(--muted);
  border-bottom: 1.5px solid var(--muted);
  transform: rotate(45deg);
  transition: transform 0.2s;
}

.picker.open .chev {
  margin-top: 3px;
  transform: rotate(-135deg);
}

.picker-menu {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  z-index: 30;
  width: 260px;
  max-height: 340px;
  padding: 6px;
  overflow-y: auto;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
  box-shadow: 0 18px 40px -16px rgb(12 12 13 / 0.28);
}

.picker-menu[hidden] {
  display: none;
}

.picker-group + .picker-group {
  margin-top: 4px;
  padding-top: 4px;
  border-top: 1px solid var(--line-soft);
}

.picker-vendor {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  padding: 6px 8px 4px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
}

.picker-vendor img {
  width: 14px;
  height: 14px;
}

.picker-menu [role='option'] {
  display: block;
  width: 100%;
  padding: 7px 8px 7px 30px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  font-family: var(--mono);
  font-size: 13px;
  text-align: left;
}

.picker-menu [role='option']:hover,
.picker-menu [role='option']:focus-visible {
  background: var(--bg);
  outline: none;
}

.picker-menu [role='option'][aria-selected='true'] {
  background: var(--accent-soft);
  color: var(--accent-ink);
  font-weight: 600;
}

/* Video task result */
.task {
  display: block;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 12px;
}

.video-card {
  position: relative;
  display: flex;
  align-items: flex-end;
  justify-content: flex-end;
  width: 100%;
  max-width: 320px;
  aspect-ratio: 16 / 9;
  margin-bottom: 10px;
  padding: 8px 10px;
  border-radius: 10px;
  background:
    radial-gradient(
      60% 50% at 70% 72%,
      rgb(255 196 120 / 0.95),
      transparent 70%
    ),
    linear-gradient(180deg, #f6c58f 0%, #e98b5d 45%, #4b5d86 70%, #22304f 100%);
  overflow: hidden;
  animation: row-in 0.6s var(--ease) both;
}

.play {
  position: absolute;
  inset: 0;
  margin: auto;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: rgb(255 255 255 / 0.9)
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M9 7l9 5-9 5z' fill='%230c0c0d'/%3E%3C/svg%3E")
    center / 22px no-repeat;
  box-shadow: 0 6px 18px rgb(0 0 0 / 0.25);
}

.video-meta {
  padding: 2px 6px;
  border-radius: 6px;
  background: rgb(0 0 0 / 0.45);
  color: #fff;
  font-family: var(--mono);
  font-size: 11px;
}

/* ── Ledger (inside the console) ── */
.console-ledger {
  border-top: 1px solid var(--line-soft);
  background: #fcfcfb;
}

.ledger-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 24px 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.06em;
}

.ledger-head a {
  color: var(--accent-ink);
  letter-spacing: 0;
}

.ledger-rows {
  margin: 0;
  padding: 4px 24px;
  list-style: none;
}

.ledger-rows li {
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr) auto auto auto;
  align-items: center;
  gap: 14px;
  padding: 12px 0;
  border-bottom: 1px dashed var(--line);
  font-family: var(--mono);
  font-size: 13px;
  animation: row-in 0.6s var(--ease) both;
}

.ledger-rows li:last-child {
  border-bottom: 0;
}

.ledger-rows img {
  width: 16px;
  height: 16px;
}

.ledger-rows .model {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ledger-rows .route {
  color: var(--muted);
  font-size: 12px;
}

.ledger-rows .route s {
  color: var(--bad);
}

.ledger-rows .tok {
  color: var(--muted);
  text-align: right;
}

.ledger-rows .cost {
  min-width: 72px;
  color: var(--accent-ink);
  font-weight: 600;
  text-align: right;
}

.ledger-rows .cost.free {
  color: var(--muted);
  font-family: var(--font);
  font-weight: 500;
}

.ledger-rows .ledger-empty {
  display: block;
  padding: 64px 0;
  border: 0;
  color: var(--muted);
  font-family: var(--font);
  text-align: center;
  animation: none;
}

@keyframes row-in {
  from {
    opacity: 0;
    transform: translateY(-8px);
  }
}

.ledger-total {
  display: flex;
  justify-content: space-between;
  padding: 12px 24px;
  border-top: 1px solid var(--line-soft);
  color: var(--muted);
  font-size: 13px;
}

.ledger-total b {
  color: var(--ink);
  font-family: var(--mono);
}

/* ── 3 Integrate ── */
.integrate {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
  gap: 56px;
  align-items: center;
}

.tools {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 32px 0 0;
  padding: 0;
  list-style: none;
}

.tools li {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 36px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
  font-size: 14px;
  font-weight: 500;
}

.tools img {
  width: 18px;
  height: 18px;
}

.snippet {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.snippet-top {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px 10px 18px;
  border-bottom: 1px solid var(--line-soft);
}

.copy {
  margin-left: auto;
  height: 30px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  font-size: 13px;
  font-weight: 600;
}

.snippet .code {
  min-height: 300px;
  padding: 22px 26px;
}

.code .hl {
  display: inline-block;
  margin: 0 -8px;
  padding: 0 8px;
  border-radius: 6px;
  background: var(--accent-soft);
  box-shadow: inset 2px 0 0 var(--accent);
}

/* Language logos: simple-icons are monochrome, so each is a tinted mask. */
.lang-ic {
  display: inline-block;
  width: 14px;
  height: 14px;
  margin-right: 7px;
  vertical-align: -2px;
  background: var(--c);
  -webkit-mask: var(--ic) center / contain no-repeat;
  mask: var(--ic) center / contain no-repeat;
}

/* Thread docks that are not part of a component. */
.pin {
  display: inline-block;
  width: 8px;
  height: 8px;
  margin-right: 10px;
  border-radius: 50%;
  border: 1.5px solid var(--line);
  vertical-align: 1px;
  transition: border-color 0.4s;
}

.pin.lit {
  border-color: var(--accent);
  background: var(--accent);
  animation: dock-glow 2.4s var(--ease) infinite;
}

.snippet-top .pin {
  margin-right: 2px;
}

.pin-center {
  display: block;
  margin: -12px auto 28px;
}

/* ── 4 Start ── */
.tl-wrap {
  position: relative;
  padding-top: 26px;
}

.tl-rail {
  position: absolute;
  top: 0;
  left: 12.5%;
  right: 12.5%;
  height: 2px;
  border-radius: 2px;
  background: var(--line);
}

.tl-rail i {
  position: absolute;
  inset: 0 auto 0 0;
  width: calc(var(--p, 0) * 100%);
  border-radius: inherit;
  background: var(--accent);
  transition: width 0.9s var(--ease);
}

.tl-rail i::after {
  content: '';
  position: absolute;
  top: -5px;
  right: -6px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 4px var(--accent-soft);
}

.timeline {
  position: relative;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.timeline li {
  position: relative;
  display: flex;
  flex-direction: column;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  cursor: default;
  transition:
    border-color 0.4s,
    transform 0.5s var(--ease),
    box-shadow 0.5s;
}

.timeline li.active {
  border-color: var(--accent);
  transform: translateY(-4px);
  box-shadow: 0 22px 40px -28px rgb(184 134 47 / 0.6);
}

.timeline li.done .tl-num::after {
  content: ' ✓';
}

.tl-visual {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 8px;
  height: 112px;
  margin: -8px -8px 18px;
  padding: 12px 14px;
  border: 1px solid var(--line-soft);
  border-radius: 12px;
  background: var(--bg);
  font-size: 13px;
  overflow: hidden;
}

.v-input {
  display: flex;
  align-items: center;
  gap: 8px;
  height: 32px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--ink);
  white-space: nowrap;
  overflow: hidden;
}

.v-input::before {
  content: '✉';
  color: var(--muted);
}

.v-caret {
  width: 1.5px;
  height: 15px;
  background: var(--accent);
  animation: blink 1s steps(1) infinite;
}

.v-code {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 5px;
}

.v-code b {
  display: grid;
  place-items: center;
  height: 28px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface);
  font-family: var(--mono);
  font-weight: 600;
  transition: border-color 0.2s;
}

.v-code b.f {
  border-color: var(--accent);
}

.v-ok,
.v-chip {
  opacity: 0;
  transition: opacity 0.3s;
}

.v-ok {
  color: var(--ok);
  font-size: 12px;
  font-weight: 600;
}

.ok .v-ok,
.ok .v-chip {
  opacity: 1;
}

.v-label {
  color: var(--muted);
  font-size: 12px;
}

.v-amount {
  font-size: 30px;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
}

.v-chip {
  align-self: flex-start;
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--ok-soft);
  color: var(--ok);
  font-size: 12px;
  font-weight: 600;
}

.v-key {
  font-family: var(--mono);
  font-size: 14px;
}

.v-key-chips {
  display: flex;
  gap: 6px;
}

.v-key-chips .chip {
  margin: 0;
  white-space: nowrap;
  opacity: 0;
  transform: translateY(4px);
  transition:
    opacity 0.3s,
    transform 0.3s var(--ease);
}

.ok .v-key-chips .chip {
  opacity: 1;
  transform: none;
}

.v-term {
  justify-content: flex-start;
  border-color: #16161a;
  background: #16161a;
  color: #e7e5e4;
  font-family: var(--mono);
  font-size: 12px;
}

.v-term code {
  display: block;
  white-space: pre-wrap;
  word-break: break-all;
  line-height: 1.5;
}

.v-term .p {
  color: #d6a85a;
}

.v-term .g {
  color: #7fd19b;
}

.tl-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 18px;
}

.tl-num {
  color: var(--accent-ink);
  font-family: var(--mono);
  font-size: 13px;
  font-weight: 600;
}

.tl-time {
  color: var(--muted);
  font-size: 12px;
}

.timeline h3 {
  margin: 0 0 6px;
  font-size: 18px;
}

.timeline p {
  flex: 1;
  margin: 0 0 18px;
  color: var(--ink-2);
  font-size: 14px;
  line-height: 1.7;
}

.timeline a {
  color: var(--accent-ink);
  font-size: 14px;
  font-weight: 600;
}

.tl-wrap + .contact {
  margin-top: 64px;
}

/* ── 5 Contact ── */
.contact {
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 22px 26px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}

.contact-dot {
  flex: none;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 1.5px solid var(--line);
}

.contact-copy {
  display: flex;
  flex-direction: column;
}

.contact-copy span {
  color: var(--ink-2);
  font-size: 14px;
}

.contact-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-left: auto;
}

.contact-links a,
.contact-links button {
  display: inline-flex;
  align-items: center;
  height: 38px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  font-size: 14px;
  font-weight: 500;
}

.contact-links a:hover,
.contact-links button:hover {
  border-color: var(--ink);
}

/* ── Footer ── */
.foot {
  position: relative;
  z-index: 1;
  padding: 36px 0 48px;
  border-top: 1px solid var(--line-soft);
  color: var(--muted);
  font-size: 13px;
}

.foot .wrap {
  display: flex;
  justify-content: space-between;
}

.foot a {
  color: var(--ink-2);
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* ── Reveal ── */
.reveal {
  opacity: 0;
  transform: translateY(18px);
  transition:
    opacity 0.8s var(--ease),
    transform 0.8s var(--ease);
}

.reveal.in {
  opacity: 1;
  transform: none;
}

/* ── Responsive ── */
@media (max-width: 900px) {
  .console-body,
  .integrate {
    grid-template-columns: 1fr;
  }

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

  .pane + .pane {
    border-left: 0;
    border-top: 1px solid var(--line-soft);
  }

  .contact {
    flex-wrap: wrap;
  }

  .contact-links {
    margin-left: 0;
  }
}

@media (max-width: 600px) {
  .hero {
    padding-top: 120px;
  }

  .console-top {
    flex-wrap: wrap;
  }

  .steps {
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
  }

  .steps li::after {
    display: none;
  }

  .timeline {
    grid-template-columns: 1fr;
  }

  .ledger-rows li {
    grid-template-columns: 18px minmax(0, 1fr) auto;
  }

  .ledger-rows .route,
  .ledger-rows .tok {
    display: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
  }

  .reveal {
    opacity: 1;
    transform: none;
  }
}
