.hero {
  position: relative;
  padding-top: 34px;
  overflow-x: clip;
  text-align: center;
}

.hero::before {
  position: absolute;
  top: -120px;
  left: 50%;
  z-index: -1;
  width: min(1020px, 100%);
  height: 520px;
  transform: translateX(-50%);
  background: radial-gradient(closest-side, var(--color-accent-glow), transparent 72%);
  content: "";
  pointer-events: none;
}

.hero-badge {
  display: inline-flex;
  max-width: 100%;
  align-items: center;
  gap: 9px;
  padding: 9px 20px;
  border-radius: var(--radius-pill);
  background: var(--color-panel);
  color: var(--color-text-muted);
  box-shadow: var(--shadow-soft);
  font-size: 13px;
  font-weight: 700;
}

.hero-badge i {
  width: 8px;
  height: 8px;
  flex-shrink: 0;
  border-radius: var(--radius-pill);
  background: var(--color-accent);
  box-shadow: var(--glow-dot);
}

.hero-title {
  max-width: 900px;
  margin: 20px auto 0;
}

.hero-title em {
  padding-inline: 2px;
  border-radius: var(--radius-xs);
  background: linear-gradient(transparent 70%, var(--color-accent-wash) 70%);
  color: var(--color-accent-dark);
  font-style: normal;
}

.hero-subtitle {
  max-width: 780px;
  margin: 16px auto 0;
  color: var(--color-text-muted);
  font-size: clamp(16px, 1.6vw, 18px);
  line-height: 1.7;
}

.hero-subtitle strong {
  color: var(--color-text);
}

.hero-chips,
.platform-band {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  margin-bottom: 0;
  padding-top: 0;
  padding-bottom: 0;
  list-style: none;
}

.hero-chips {
  margin-top: 16px;
  gap: 10px;
}

.hero-chips li {
  padding: 7px 15px;
  border-radius: var(--radius-pill);
  background: var(--color-panel-strong);
  color: var(--color-accent-dark);
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 700;
}

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

.platform-band {
  width: fit-content;
  max-width: 100%;
  margin: 26px auto 0;
  padding: 14px 40px;
  gap: 36px;
  border-radius: var(--radius-pill);
  background: var(--color-canvas);
  color: var(--color-text-muted);
  box-shadow: var(--shadow-soft);
}

.platform-band a,
.platform-band li {
  display: flex;
  align-items: center;
  gap: 9px;
  color: var(--color-text-muted);
  font-size: 14px;
  font-weight: 700;
  text-decoration: none;
}

.platform-band a:hover {
  color: var(--color-error);
}

.platform-band svg {
  width: 19px;
  height: 19px;
  flex-shrink: 0;
}

.topology-banner {
  position: relative;
  height: clamp(300px, 37vh, 368px);
  margin-top: 32px;
  overflow: hidden;
  border-radius: var(--radius-card);
  background: linear-gradient(135deg, var(--color-hero-a), var(--color-hero-b));
  box-shadow: var(--shadow-banner), inset 0 1px 0 var(--color-white-faint);
}

.topology-banner::before {
  position: absolute;
  top: -46%;
  left: -14%;
  z-index: 1;
  width: 64%;
  height: 120%;
  background: radial-gradient(closest-side, var(--color-white-faint), transparent 70%);
  content: "";
  pointer-events: none;
}

.topology-banner::after {
  position: absolute;
  right: -8%;
  bottom: -58%;
  z-index: 1;
  width: 58%;
  height: 118%;
  background: radial-gradient(closest-side, var(--color-dark-faint), transparent 70%);
  content: "";
  pointer-events: none;
}

.topology-banner > svg {
  position: absolute;
  inset: 0;
  z-index: 2;
  width: 100%;
  height: 100%;
}

.topology-line {
  fill: none;
  stroke: var(--color-white-soft);
  stroke-width: 9;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.topology-flow {
  fill: none;
  stroke: var(--color-white);
  stroke-width: 9;
  stroke-linecap: round;
  stroke-dasharray: 72 1560;
  animation: topology-flow 8s linear infinite;
}

.topology-node {
  fill: var(--color-white);
}

.topology-halo {
  fill: none;
  stroke: var(--color-white);
  stroke-width: 2.5;
}

.topology-halo-soft {
  opacity: 0.55;
}

.topology-halo-faint {
  opacity: 0.24;
}

.topology-core {
  fill: var(--color-error);
}

.topology-label {
  position: absolute;
  z-index: 4;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  background: var(--color-canvas);
  color: var(--color-text);
  box-shadow: var(--shadow-chip);
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 750;
}

.topology-label-start {
  bottom: 24px;
  left: 4%;
}

.topology-label-end {
  right: 4%;
  bottom: 42px;
}

@keyframes topology-flow {
  to {
    stroke-dashoffset: -1632;
  }
}

.tab-shell {
  display: grid;
  grid-template-columns: minmax(220px, 0.65fr) minmax(0, 1.6fr);
  gap: clamp(28px, 6vw, 72px);
  align-items: stretch;
}

.tab-list {
  position: relative;
  display: grid;
  align-content: center;
  gap: 10px;
  padding-block: 24px;
}

.tab-list::before {
  position: absolute;
  top: 40px;
  bottom: 40px;
  left: 19px;
  width: 8px;
  border-radius: var(--radius-pill);
  background: var(--color-accent);
  content: "";
}

.tab-button {
  position: relative;
  z-index: 1;
  display: flex;
  width: 100%;
  min-height: 58px;
  align-items: center;
  gap: 17px;
  padding: 8px 10px 8px 0;
  background: transparent;
  color: var(--color-text-muted);
  font-weight: 750;
  text-align: left;
}

.tab-button::before {
  width: 46px;
  height: 46px;
  flex: 0 0 46px;
  border: 13px solid var(--color-canvas);
  border-radius: var(--radius-pill);
  background: var(--color-accent);
  box-shadow: var(--shadow-soft);
  content: "";
  transition: transform var(--transition-fast), box-shadow var(--transition-fast);
}

.tab-button:hover {
  color: var(--color-error);
}

.tab-button[aria-selected="true"] {
  color: var(--color-text);
}

.tab-button[aria-selected="true"]::before {
  transform: scale(1.18);
  box-shadow: var(--glow-dot), var(--shadow-soft);
}

.tab-panels {
  min-height: 330px;
}

.tab-panel {
  height: 100%;
  padding: clamp(28px, 5vw, 54px);
  border-radius: var(--radius-card);
  background: var(--color-panel);
  color: var(--color-text-muted);
  box-shadow: var(--shadow-soft);
}

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

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

.tab-panel .inline-config {
  display: block;
  margin-top: 22px;
  overflow-x: auto;
  padding: 15px 17px;
  border-radius: var(--radius-sm);
  background: var(--color-code-bg);
  color: var(--color-code-text);
  font-family: var(--font-mono);
  font-size: 12px;
  white-space: nowrap;
}

.toc {
  position: sticky;
  top: calc(var(--header-height) + 14px);
  z-index: 10;
  max-width: 100%;
  overflow-x: auto;
  padding: 9px;
  border-radius: var(--radius-pill);
  background: var(--color-panel);
  color: var(--color-text);
  box-shadow: var(--shadow-soft);
  -webkit-overflow-scrolling: touch;
}

.toc-list {
  display: flex;
  width: max-content;
  min-width: 100%;
  margin: 0;
  padding: 0;
  gap: 4px;
  list-style: none;
}

.toc a {
  display: flex;
  min-height: 42px;
  align-items: center;
  padding: 8px 16px;
  border-radius: var(--radius-pill);
  color: var(--color-text-muted);
  font-size: 13px;
  font-weight: 750;
  text-decoration: none;
  white-space: nowrap;
}

.toc a:hover,
.toc a[aria-current="true"] {
  background: var(--color-canvas);
  color: var(--color-accent-dark);
}

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

.faq-item {
  border-radius: var(--radius-md);
  background: var(--color-panel);
  color: var(--color-text);
  box-shadow: var(--shadow-soft);
}

.faq-item summary {
  position: relative;
  display: flex;
  min-height: 62px;
  align-items: center;
  padding: 18px 58px 18px 22px;
  cursor: pointer;
  color: var(--color-text);
  font-weight: 800;
  list-style: none;
}

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

.faq-item summary::after {
  position: absolute;
  right: 22px;
  width: 28px;
  height: 28px;
  border-radius: var(--radius-pill);
  background: var(--color-canvas);
  color: var(--color-accent-dark);
  content: "+";
  font-family: var(--font-mono);
  font-size: 20px;
  line-height: 28px;
  text-align: center;
}

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

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

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

.glossary-card {
  position: relative;
  padding: 28px;
  border-radius: var(--radius-lg);
  background: var(--color-panel);
  color: var(--color-text-muted);
  box-shadow: var(--shadow-soft);
}

.glossary-card::before {
  display: block;
  width: 38px;
  height: 8px;
  margin-bottom: 24px;
  border-radius: var(--radius-pill);
  background: var(--color-accent);
  content: "";
}

.glossary-card dt {
  margin-bottom: 7px;
  color: var(--color-text);
  font-family: var(--font-display);
  font-size: 21px;
  font-weight: 850;
}

.glossary-card dd {
  margin: 0;
}

.client-card {
  position: relative;
  display: grid;
  gap: 22px;
  padding: clamp(24px, 4vw, 38px);
  border-radius: var(--radius-card);
  background: var(--color-panel);
  color: var(--color-text);
  box-shadow: var(--shadow-card);
}

.client-card-header {
  display: flex;
  align-items: center;
  gap: 16px;
}

.client-card-header img {
  width: 56px;
  height: 56px;
  flex-shrink: 0;
}

.client-card-title {
  margin: 0;
  font-size: 25px;
}

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

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

.status-badge {
  display: inline-flex;
  max-width: 100%;
  min-height: 28px;
  align-items: center;
  padding: 5px 11px;
  border-radius: var(--radius-pill);
  background: var(--color-panel-strong);
  color: var(--color-accent-dark);
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}

.status-featured {
  background: var(--color-accent);
  color: var(--color-white);
}

.status-recommended {
  background: var(--color-accent-wash);
  color: var(--color-text);
}

.status-retired {
  background: var(--color-error-wash);
  color: var(--color-text);
}

.article-card {
  display: flex;
  height: 100%;
  flex-direction: column;
  padding: clamp(24px, 3vw, 34px);
  border-radius: var(--radius-lg);
  background: var(--color-panel);
  color: var(--color-text);
  box-shadow: var(--shadow-soft);
  text-decoration: none;
  transition: transform var(--transition-fast), box-shadow var(--transition-fast);
}

.article-card:hover {
  transform: translateY(-5px);
  color: var(--color-text);
  box-shadow: var(--shadow-card);
}

.article-card-meta {
  display: flex;
  flex-wrap: wrap;
  margin-bottom: 18px;
  align-items: center;
  gap: 10px;
  color: var(--color-text-muted);
  font-family: var(--font-mono);
  font-size: 12px;
}

.article-card h3 {
  margin-bottom: 12px;
  font-size: 22px;
}

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

.article-card-more {
  margin-top: auto;
  padding-top: 22px;
  color: var(--color-accent-dark);
  font-weight: 800;
}

.callout {
  position: relative;
  margin-block: 28px;
  padding: 24px 26px 24px 32px;
  border-radius: var(--radius-md);
  background: var(--color-panel-strong);
  color: var(--color-text);
  box-shadow: var(--shadow-soft);
}

.callout::before {
  position: absolute;
  top: 20px;
  bottom: 20px;
  left: 14px;
  width: 6px;
  border-radius: var(--radius-pill);
  background: var(--color-accent);
  content: "";
}

.callout-warning {
  background: var(--color-panel);
  color: var(--color-text);
}

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

.callout-error {
  background: var(--color-error-wash);
  color: var(--color-text);
}

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

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

.end-download-card {
  display: flex;
  margin-top: 54px;
  padding: clamp(26px, 5vw, 48px);
  align-items: center;
  justify-content: space-between;
  gap: 28px;
  border-radius: var(--radius-card);
  background: linear-gradient(135deg, var(--color-hero-a), var(--color-hero-b));
  color: var(--color-text);
  box-shadow: var(--shadow-banner);
}

.end-download-card h2,
.end-download-card h3,
.end-download-card p {
  color: var(--color-text);
}

.end-download-card p {
  margin-bottom: 0;
}

.dl-fab {
  position: fixed;
  right: max(18px, var(--gutter));
  bottom: max(18px, var(--gutter));
  z-index: 80;
  display: flex;
  max-width: min(310px, calc(100vw - var(--gutter) * 2));
  min-height: 64px;
  align-items: center;
  gap: 13px;
  padding: 12px 18px 12px 12px;
  border-radius: var(--radius-pill);
  background: var(--color-accent);
  color: var(--color-white);
  box-shadow: var(--shadow-lift);
  font-weight: 800;
  text-decoration: none;
}

.dl-fab:hover {
  background: var(--color-accent-dark);
  color: var(--color-white);
}

.dl-fab-icon {
  display: grid;
  width: 42px;
  height: 42px;
  flex: 0 0 42px;
  place-items: center;
  border-radius: var(--radius-pill);
  background: var(--color-canvas);
  color: var(--color-accent-dark);
}

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

.dl-fab-text {
  display: grid;
  line-height: 1.3;
}

.dl-fab-text small {
  color: var(--color-white);
  font-size: 11px;
  font-weight: 650;
}

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

.preview-swatch {
  overflow: hidden;
  border-radius: var(--radius-md);
  background: var(--color-panel);
  color: var(--color-text);
  box-shadow: var(--shadow-soft);
}

.preview-swatch-color {
  height: 92px;
  background: var(--swatch-color, var(--color-panel));
}

.swatch-canvas { --swatch-color: var(--color-canvas); }
.swatch-panel { --swatch-color: var(--color-panel); }
.swatch-panel-strong { --swatch-color: var(--color-panel-strong); }
.swatch-line { --swatch-color: var(--color-line); }
.swatch-accent { --swatch-color: var(--color-accent); }
.swatch-accent-dark { --swatch-color: var(--color-accent-dark); }
.swatch-text { --swatch-color: var(--color-text); }
.swatch-muted { --swatch-color: var(--color-text-muted); }
.swatch-success { --swatch-color: var(--color-success); }
.swatch-warning { --swatch-color: var(--color-warning); }
.swatch-error { --swatch-color: var(--color-error); }
.swatch-hero { --swatch-color: var(--color-hero-a); }

.preview-swatch-label {
  padding: 13px 15px;
  font-family: var(--font-mono);
  font-size: 12px;
}

.preview-component-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 14px;
}

@media (max-width: 960px) {
  .platform-band {
    padding: 12px 22px;
    gap: 18px;
  }

  .tab-shell {
    grid-template-columns: 1fr;
  }

  .tab-list {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    padding: 24px 0 0;
  }

  .tab-list::before {
    top: 19px;
    right: 9%;
    bottom: auto;
    left: 9%;
    width: auto;
    height: 8px;
  }

  .tab-button {
    min-height: 90px;
    padding: 0 4px;
    flex-direction: column;
    gap: 8px;
    text-align: center;
  }

  .tab-button::before {
    width: 42px;
    height: 42px;
    flex-basis: 42px;
  }

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

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

  .hero-badge {
    padding-inline: 14px;
    line-height: 1.45;
  }

  .hero-actions {
    gap: 10px;
  }

  .hero-actions .button,
  .hero-actions .btn {
    width: 100%;
  }

  .platform-band {
    width: 100%;
    padding: 13px 12px;
    gap: 12px 18px;
    border-radius: var(--radius-lg);
  }

  .platform-band a,
  .platform-band li {
    flex: 1 1 42%;
    justify-content: center;
  }

  .topology-banner {
    height: 300px;
    border-radius: var(--radius-lg);
  }

  .topology-label {
    padding: 8px 10px;
    font-size: 11px;
  }

  .topology-label-start {
    bottom: 16px;
    left: 16px;
  }

  .topology-label-end {
    right: 16px;
    bottom: 16px;
  }

  .tab-list {
    grid-template-columns: 1fr;
    gap: 0;
    padding-left: 0;
  }

  .tab-list::before {
    top: 20px;
    bottom: 20px;
    left: 17px;
    width: 8px;
    height: auto;
  }

  .tab-button {
    min-height: 62px;
    padding: 6px 4px 6px 0;
    flex-direction: row;
    gap: 13px;
    text-align: left;
  }

  .tab-button::before {
    width: 42px;
    height: 42px;
    flex-basis: 42px;
  }

  .tab-panel {
    padding: 24px 20px;
    border-radius: var(--radius-lg);
  }

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

  .dl-fab {
    right: var(--gutter);
    bottom: var(--gutter);
    max-width: calc(100vw - var(--gutter) * 2);
  }

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

@media (prefers-reduced-motion: reduce) {
  .topology-flow {
    animation: none;
    opacity: 0;
  }
}