.component-demo {
  display: grid;
  gap: 28px;
}

.badge-row,
.platform-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 12px;
}

.badge,
.platform-chip,
.status-pill {
  display: inline-flex;
  max-width: 100%;
  min-height: 34px;
  align-items: center;
  gap: 8px;
  padding: 7px 14px;
  overflow: hidden;
  border: 1px solid var(--color-line);
  border-radius: var(--radius-pill);
  background: var(--color-transparent);
  color: var(--color-text-muted);
  font-size: 13px;
  line-height: 1.25;
}

.badge svg,
.platform-chip svg,
.status-pill svg {
  width: 15px;
  height: 15px;
}

.platform-chip {
  cursor: pointer;
  transition: color var(--transition-fast), border-color var(--transition-fast);
}

.platform-chip:hover {
  border-color: var(--color-text-muted);
  color: var(--color-text);
}

.badge-accent {
  border-color: var(--color-accent-55);
  background: var(--color-accent-06);
  color: var(--color-accent);
}

.badge-success {
  border-color: var(--color-success);
  background: var(--color-panel);
  color: var(--color-success);
}

.badge-warning {
  border-color: var(--color-warning);
  background: var(--color-panel);
  color: var(--color-warning);
}

.badge-error {
  border-color: var(--color-error);
  background: var(--color-panel);
  color: var(--color-error);
}

.status-dot,
.kicker-dot,
.relay-head-dot {
  width: 6px;
  height: 6px;
  flex-shrink: 0;
  border-radius: 50%;
  background: var(--color-success);
}

.hero {
  position: relative;
  padding: 44px var(--gutter) 0;
  overflow-x: clip;
  text-align: center;
}

.hero-aura {
  position: absolute;
  top: 390px;
  right: 0;
  left: 0;
  height: 540px;
  background: radial-gradient(50% 50% at 50% 50%, var(--color-accent-10), var(--color-transparent) 70%);
  pointer-events: none;
}

.hero-inner {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: var(--wide-width);
  margin-inline: auto;
}

.hero-kicker {
  display: inline-flex;
  max-width: 100%;
  align-items: center;
  gap: 8px;
  margin-bottom: 0;
  padding: 6px 16px;
  border: 1px solid var(--color-line);
  border-radius: var(--radius-pill);
  color: var(--color-text-muted);
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.05em;
}

.hero h1 {
  max-width: 900px;
  margin: 22px auto 0;
}

.hero-desc {
  max-width: 680px;
  margin: 16px auto 0;
  color: var(--color-text-muted);
  font-size: 16px;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 14px;
  margin-top: 28px;
}

.hero .platform-row {
  margin-top: 26px;
}

.relay-card {
  position: relative;
  z-index: 1;
  max-width: var(--wide-width);
  margin: 44px auto 0;
  padding: 22px 28px 26px;
  overflow: hidden;
  border: 1px solid var(--color-line);
  border-radius: var(--radius-large);
  background:
    radial-gradient(60% 90% at 50% 118%, var(--color-accent-06), var(--color-transparent) 62%),
    var(--color-panel);
  color: var(--color-text);
  text-align: left;
}

.relay-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  color: var(--color-text-muted);
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.09em;
}

.relay-head-left {
  display: inline-flex;
  align-items: center;
  gap: 9px;
}

.relay-stage {
  position: relative;
  height: 224px;
}

.relay-track {
  position: absolute;
  top: 0;
  right: 84px;
  bottom: 0;
  left: 84px;
}

.track-line {
  position: absolute;
  top: 50%;
  right: 0;
  left: 0;
  height: 1.5px;
  transform: translateY(-50%);
  background: linear-gradient(90deg, var(--color-transparent), var(--color-accent-75) 6%, var(--color-accent-75) 94%, var(--color-transparent));
  box-shadow: 0 0 14px var(--color-accent-35);
}

.relay-runner {
  position: absolute;
  top: 50%;
  left: 0;
  width: 100%;
  height: 0;
  animation: relay-travel 9s linear infinite;
}

.relay-dot {
  position: absolute;
  top: 0;
  left: 0;
  width: 10px;
  height: 10px;
  margin: -5px 0 0 -5px;
  border-radius: 50%;
  background: var(--color-accent);
  box-shadow: 0 0 10px var(--color-accent-75), 0 0 28px var(--color-accent-55);
}

.relay-dot::before {
  position: absolute;
  top: 50%;
  right: 6px;
  width: 70px;
  height: 1.5px;
  transform: translateY(-50%);
  background: linear-gradient(90deg, var(--color-transparent), var(--color-accent-55));
  content: "";
}

.relay-node {
  position: absolute;
  top: 50%;
  transform: translate(-50%, -50%);
}

.relay-node-local {
  left: 0;
}

.relay-node-inbound {
  left: 25%;
}

.relay-node-one {
  left: 50%;
}

.relay-node-two {
  left: 75%;
}

.relay-node-outbound {
  left: 100%;
}

.node-ring {
  position: relative;
  display: block;
  width: 16px;
  height: 16px;
  border: 1.5px solid var(--color-accent-55);
  border-radius: 50%;
  background: var(--color-panel);
  box-shadow: 0 0 12px var(--color-accent-18);
}

.node-ring::after {
  position: absolute;
  inset: -1.5px;
  border: 1.5px solid var(--color-accent);
  border-radius: 50%;
  box-shadow: 0 0 14px var(--color-accent-75), 0 0 34px var(--color-accent-35);
  content: "";
  opacity: 0.15;
  animation: node-flash 9s linear infinite;
}

.relay-node-inbound .node-ring::after {
  animation-delay: 1.935s;
}

.relay-node-one .node-ring::after {
  animation-delay: 3.87s;
}

.relay-node-two .node-ring::after {
  animation-delay: 5.805s;
}

.relay-node-outbound .node-ring::after {
  animation-delay: 7.74s;
}

.node-name,
.node-port {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  white-space: nowrap;
  font-family: var(--font-mono);
}

.node-name {
  bottom: calc(100% + 16px);
  color: var(--color-text);
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.08em;
}

.node-port {
  top: calc(100% + 16px);
  color: var(--color-text-muted);
  font-size: 12px;
  letter-spacing: 0.04em;
}

@keyframes relay-travel {
  0% {
    opacity: 0;
    transform: translateX(0);
  }

  2% {
    opacity: 1;
  }

  86% {
    opacity: 1;
    transform: translateX(100%);
  }

  89%,
  100% {
    opacity: 0;
    transform: translateX(100%);
  }
}

@keyframes node-flash {
  0% {
    opacity: 0.15;
  }

  2% {
    opacity: 1;
  }

  15%,
  100% {
    opacity: 0.15;
  }
}

.tab-shell {
  display: grid;
  grid-template-columns: minmax(210px, 0.72fr) minmax(0, 2fr);
  gap: clamp(24px, 5vw, 64px);
  align-items: stretch;
}

.tab-rail {
  position: relative;
  display: grid;
  align-content: center;
  gap: 8px;
  padding-left: 27px;
}

.tab-rail::before {
  position: absolute;
  top: 22px;
  bottom: 22px;
  left: 8px;
  width: 1px;
  background: var(--color-accent-55);
  content: "";
}

.tab-rail [role="tab"] {
  position: relative;
  display: flex;
  width: 100%;
  min-height: 52px;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  border: 0;
  border-radius: var(--radius-medium);
  background: var(--color-transparent);
  color: var(--color-text-muted);
  cursor: pointer;
  text-align: left;
}

.tab-rail [role="tab"]::before {
  position: absolute;
  left: -25px;
  width: 13px;
  height: 13px;
  flex-shrink: 0;
  border: 1px solid var(--color-line);
  border-radius: 50%;
  background: var(--color-panel);
  content: "";
}

.tab-rail [role="tab"]:hover {
  background: var(--color-panel);
  color: var(--color-text);
}

.tab-rail [role="tab"][aria-selected="true"] {
  background: var(--color-panel-raised);
  color: var(--color-text);
}

.tab-rail [role="tab"][aria-selected="true"]::before {
  border-color: var(--color-accent);
  background: var(--color-accent);
  box-shadow: 0 0 15px var(--color-accent-55);
}

.tab-index {
  flex-shrink: 0;
  color: var(--color-accent);
  font-family: var(--font-mono);
  font-size: 11px;
}

.tab-panels {
  min-width: 0;
}

.tab-panel {
  min-height: 100%;
  padding: clamp(26px, 4vw, 48px);
  border: 1px solid var(--color-line);
  border-radius: var(--radius-large);
  background: var(--color-panel);
  color: var(--color-text);
}

.tab-panel[hidden] {
  display: none;
}

.tab-panel p {
  color: var(--color-text-muted);
}

.tab-footnote {
  margin: 28px 0 0;
  padding-top: 16px;
  border-top: 1px solid var(--color-line);
  color: var(--color-text-muted);
  font-family: var(--font-mono);
  font-size: 12px;
  overflow-wrap: anywhere;
}

.toc {
  display: flex;
  max-width: 100%;
  margin-bottom: 40px;
  padding: 8px;
  overflow-x: auto;
  gap: 5px;
  border: 1px solid var(--color-line);
  border-radius: var(--radius-pill);
  background: var(--color-panel);
  color: var(--color-text);
  overscroll-behavior-inline: contain;
  scrollbar-width: thin;
}

.toc a {
  display: inline-flex;
  min-height: 40px;
  flex: none;
  align-items: center;
  padding: 8px 15px;
  border-radius: var(--radius-pill);
  color: var(--color-text-muted);
  font-size: 14px;
  white-space: nowrap;
}

.toc a:hover,
.toc a[aria-current="true"] {
  background: var(--color-panel-raised);
  color: var(--color-text);
}

.faq-list {
  display: grid;
  gap: 12px;
}

.faq-item {
  border: 1px solid var(--color-line);
  border-radius: var(--radius-medium);
  background: var(--color-panel);
  color: var(--color-text);
}

.faq-item summary {
  position: relative;
  display: flex;
  min-height: 60px;
  align-items: center;
  padding: 16px 54px 16px 20px;
  cursor: pointer;
  font-weight: 600;
  list-style: none;
}

.faq-item summary::-webkit-details-marker {
  display: none;
}

.faq-item summary::after {
  position: absolute;
  right: 20px;
  color: var(--color-accent);
  content: "+";
  font-family: var(--font-mono);
  font-size: 20px;
  font-weight: 400;
}

.faq-item[open] summary::after {
  content: "−";
}

.faq-answer {
  padding: 0 20px 20px;
  color: var(--color-text-muted);
}

.faq-answer > :last-child {
  margin-bottom: 0;
}

.term-card {
  position: relative;
  min-height: 190px;
  overflow: hidden;
  border: 1px solid var(--color-line);
  border-radius: var(--radius-large);
  background: var(--color-panel);
  color: var(--color-text);
  padding: 28px;
}

.term-card::after {
  position: absolute;
  right: -36px;
  bottom: -36px;
  width: 110px;
  height: 110px;
  border: 1px solid var(--color-accent-35);
  border-radius: 50%;
  content: "";
}

.term-name {
  margin-bottom: 12px;
  color: var(--color-text);
  font-family: var(--font-mono);
  font-size: 17px;
}

.term-card p {
  position: relative;
  z-index: 1;
  margin-bottom: 0;
  color: var(--color-text-muted);
}

.client-card {
  display: grid;
  gap: 24px;
  padding: clamp(24px, 4vw, 38px);
  border: 1px solid var(--color-line);
  border-radius: var(--radius-large);
  background: var(--color-panel);
  color: var(--color-text);
}

.client-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
}

.client-card-title {
  margin-bottom: 4px;
}

.client-card-meta {
  margin: 0;
  color: var(--color-text-muted);
  font-family: var(--font-mono);
  font-size: 12px;
}

.client-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.client-note {
  margin: 0;
  padding-top: 18px;
  border-top: 1px solid var(--color-line);
  color: var(--color-text-muted);
  font-size: 14px;
}

.blog-card {
  display: flex;
  min-height: 260px;
  flex-direction: column;
  padding: clamp(24px, 3vw, 32px);
  border: 1px solid var(--color-line);
  border-radius: var(--radius-large);
  background: var(--color-panel);
  color: var(--color-text);
  transition: border-color var(--transition-fast), background-color var(--transition-fast);
}

.blog-card:hover {
  border-color: var(--color-accent-55);
  background: var(--color-panel-raised);
}

.blog-card-meta {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 24px;
  color: var(--color-text-muted);
  font-family: var(--font-mono);
  font-size: 11px;
}

.blog-card h3 {
  font-size: 21px;
}

.blog-card p {
  color: var(--color-text-muted);
}

.blog-card-link {
  margin-top: auto;
  padding-top: 18px;
  color: var(--color-accent);
  font-size: 14px;
}

.callout {
  position: relative;
  margin: 28px 0;
  padding: 22px 24px 22px 30px;
  overflow: hidden;
  border: 1px solid var(--color-accent-55);
  border-radius: var(--radius-medium);
  background: var(--color-panel-raised);
  color: var(--color-text);
}

.callout::before {
  position: absolute;
  top: 18px;
  bottom: 18px;
  left: 0;
  width: 2px;
  background: var(--color-accent);
  content: "";
  box-shadow: 0 0 12px var(--color-accent-55);
}

.callout-title {
  margin-bottom: 7px;
  color: var(--color-text);
  font-weight: 600;
}

.callout p {
  margin-bottom: 0;
  color: var(--color-text-muted);
}

.end-download-card {
  display: flex;
  margin-top: 56px;
  padding: clamp(24px, 4vw, 38px);
  align-items: center;
  justify-content: space-between;
  gap: 28px;
  border: 1px solid var(--color-line);
  border-radius: var(--radius-large);
  background: var(--color-panel);
  color: var(--color-text);
}

.end-download-card p {
  max-width: 650px;
  margin: 7px 0 0;
  color: var(--color-text-muted);
}

.dl-fab {
  position: fixed;
  right: 28px;
  bottom: 28px;
  z-index: 60;
  display: inline-flex;
  min-height: 48px;
  align-items: center;
  gap: 9px;
  padding: 10px 24px;
  border: 1px solid var(--color-accent);
  border-radius: var(--radius-pill);
  background: var(--color-accent);
  color: var(--color-button-ink);
  box-shadow: 0 0 24px var(--color-accent-35);
  font-size: 14px;
  font-weight: 600;
  transition: background-color var(--transition-fast), border-color var(--transition-fast), color var(--transition-fast);
}

.dl-fab:hover {
  border-color: var(--color-accent-deep);
  background: var(--color-accent-deep);
  color: var(--color-text);
}

.dl-fab svg {
  width: 15px;
  height: 15px;
}

.palette-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}

.swatch {
  overflow: hidden;
  border: 1px solid var(--color-line);
  border-radius: var(--radius-medium);
  background: var(--color-panel);
  color: var(--color-text);
}

.swatch-color {
  height: 92px;
  border-bottom: 1px solid var(--color-line);
}

.swatch-bg {
  background: var(--color-page);
}

.swatch-panel {
  background: var(--color-panel);
}

.swatch-panel-raised {
  background: var(--color-panel-raised);
}

.swatch-line {
  background: var(--color-line);
}

.swatch-accent {
  background: var(--color-accent);
}

.swatch-accent-deep {
  background: var(--color-accent-deep);
}

.swatch-text {
  background: var(--color-text);
}

.swatch-muted {
  background: var(--color-text-muted);
}

.swatch-success {
  background: var(--color-success);
}

.swatch-warning {
  background: var(--color-warning);
}

.swatch-error {
  background: var(--color-error);
}

.swatch-label {
  padding: 12px 14px;
  color: var(--color-text-muted);
  font-family: var(--font-mono);
  font-size: 11px;
  overflow-wrap: anywhere;
}

.type-display {
  font-family: var(--font-display);
  font-size: clamp(34px, 5vw, 48px);
  font-weight: 500;
  line-height: 1.2;
}

.type-body {
  max-width: 660px;
  color: var(--color-text-muted);
}

.type-mono {
  color: var(--color-accent);
  font-family: var(--font-mono);
  font-size: 13px;
}

.preview-section {
  padding-top: 110px;
  padding-bottom: 110px;
}

.preview-section + .preview-section {
  border-top: 1px solid var(--color-line);
}

.preview-footer {
  margin-top: 110px;
}

@media (max-width: 820px) {
  .tab-shell {
    grid-template-columns: minmax(0, 1fr);
  }

  .tab-rail {
    display: flex;
    max-width: 100%;
    padding: 0 0 8px;
    overflow-x: auto;
    gap: 8px;
    overscroll-behavior-inline: contain;
  }

  .tab-rail::before {
    display: none;
  }

  .tab-rail [role="tab"] {
    width: auto;
    min-width: max-content;
    flex: none;
    border: 1px solid var(--color-line);
    border-radius: var(--radius-pill);
  }

  .tab-rail [role="tab"]::before {
    display: none;
  }

  .end-download-card {
    align-items: flex-start;
    flex-direction: column;
  }

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

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

  .hero-kicker {
    padding-inline: 12px;
    font-size: 10px;
    line-height: 1.45;
  }

  .hero-actions {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
  }

  .hero .platform-row {
    gap: 8px;
  }

  .platform-chip {
    padding-inline: 11px;
    font-size: 12px;
  }

  .relay-card {
    margin-top: 34px;
    padding: 18px 16px 22px;
  }

  .relay-head {
    align-items: flex-start;
    font-size: 10px;
  }

  .relay-track {
    right: 25px;
    left: 25px;
  }

  .relay-stage {
    height: 190px;
  }

  .node-name {
    bottom: calc(100% + 13px);
    font-size: 9px;
    letter-spacing: 0.02em;
  }

  .node-port {
    top: calc(100% + 13px);
    font-size: 8px;
    letter-spacing: 0;
  }

  .node-ring {
    width: 13px;
    height: 13px;
  }

  .tab-panel {
    padding: 22px 20px;
  }

  .toc {
    border-radius: var(--radius-medium);
  }

  .client-card-head {
    flex-direction: column;
  }

  .dl-fab {
    right: 16px;
    bottom: 16px;
    min-height: 46px;
    padding-inline: 18px;
  }

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

  .preview-section {
    padding-top: 72px;
    padding-bottom: 72px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .relay-runner {
    display: none;
  }

  .node-ring::after {
    animation: none;
    opacity: 0.85;
  }
}