.hero {
  position: relative;
  min-height: calc(100vh - var(--header-height));
  overflow-x: clip;
  isolation: isolate;
  background-color: var(--color-bg);
}

.hero::after {
  position: absolute;
  z-index: 8;
  right: var(--gutter);
  bottom: -38px;
  left: var(--gutter);
  height: 66px;
  border: var(--line-regular) solid var(--color-border);
  border-radius: var(--radius-xl) var(--radius-xl) 0 0;
  background: var(--color-panel);
  content: "";
}

.hero-texture {
  position: absolute;
  z-index: -3;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.texture-wave {
  fill: none;
  stroke: var(--color-grid);
  stroke-width: 2;
}

.texture-dash {
  fill: none;
  stroke: var(--color-grid-strong);
  stroke-width: 2;
  stroke-linecap: round;
  stroke-dasharray: 7 12;
}

.hero-inner {
  position: relative;
  width: min(100%, var(--page-width));
  min-height: calc(100vh - var(--header-height));
  margin-inline: auto;
  padding: 8px var(--gutter) 56px;
  display: grid;
  grid-template-columns: minmax(620px, 1.18fr) minmax(440px, 0.82fr);
  align-items: center;
}

.device-stage {
  position: relative;
  z-index: 1;
  min-height: 720px;
}

.device-stage::before {
  position: absolute;
  top: 40px;
  left: -110px;
  width: 700px;
  height: 626px;
  border: var(--line-thin) dashed var(--color-grid-strong);
  border-radius: var(--radius-xl);
  content: "";
  transform: rotate(-1.5deg);
}

.device-stage::after {
  position: absolute;
  top: 75px;
  left: -20px;
  width: 112px;
  height: 112px;
  border: var(--line-regular) solid var(--color-warn);
  border-radius: var(--radius-pill);
  content: "";
  opacity: 0.15;
}

.waterworks {
  position: absolute;
  top: -4px;
  right: -36px;
  width: 880px;
  height: 730px;
  max-width: none;
  overflow: visible;
}

.fill-panel {
  fill: var(--color-panel);
}

.fill-water {
  fill: var(--color-panel-strong);
}

.fill-paper {
  fill: var(--color-bg);
}

.fill-accent {
  fill: var(--color-accent);
}

.fill-dark {
  fill: var(--color-accent-dark);
}

.fill-warn {
  fill: var(--color-warn);
}

.tower-line {
  fill: none;
  stroke: var(--color-accent-dark);
  stroke-width: 4;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.tower-heavy {
  fill: none;
  stroke: var(--color-accent-dark);
  stroke-width: 7;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.detail-line {
  fill: none;
  stroke: var(--color-border);
  stroke-width: 2.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.measure-line {
  fill: none;
  stroke: var(--color-grid-strong);
  stroke-width: 2;
  stroke-linecap: round;
  stroke-dasharray: 7 9;
}

.pipe-under {
  fill: none;
  stroke: var(--color-accent-dark);
  stroke-width: 20;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.pipe-water {
  fill: none;
  stroke: var(--color-border);
  stroke-width: 11;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.pipe-highlight {
  fill: none;
  stroke: var(--color-panel-strong);
  stroke-width: 3;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.tap-line {
  fill: none;
  stroke: var(--color-accent-dark);
  stroke-width: 6;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.badge-box {
  fill: var(--color-panel);
  stroke: var(--color-accent-dark);
  stroke-width: 3;
}

.badge-cap {
  fill: var(--color-panel-strong);
  stroke: var(--color-border);
  stroke-width: 2;
}

.valve-ring {
  fill: var(--color-bg);
  stroke: var(--color-warn);
  stroke-width: 5;
}

.valve-spoke {
  fill: none;
  stroke: var(--color-warn);
  stroke-width: 4;
  stroke-linecap: round;
}

.water-drop {
  fill: var(--color-bg);
  stroke: var(--color-border);
  stroke-width: 2;
}

.svg-platform {
  fill: var(--color-text);
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 850;
  text-anchor: middle;
}

.svg-kicker {
  fill: var(--color-muted);
  font-family: var(--font-mono);
  font-size: 9px;
  font-weight: 750;
  letter-spacing: 0.09em;
  text-anchor: middle;
}

.svg-window {
  fill: var(--color-accent-dark);
  font-family: var(--font-mono);
  font-size: 25px;
  font-weight: 850;
  letter-spacing: 0.08em;
  text-anchor: middle;
}

.svg-small {
  fill: var(--color-muted);
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.045em;
}

.svg-number {
  fill: var(--color-warn);
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 850;
  text-anchor: middle;
}

.cat-vane {
  transform-box: fill-box;
  transform-origin: 50% 100%;
  animation: vane-sway var(--motion-vane) ease-in-out infinite;
}

.flow-horizontal-a,
.flow-horizontal-b,
.flow-horizontal-c {
  transform-box: fill-box;
  animation: flow-horizontal var(--motion-water) ease-in-out infinite;
}

.flow-horizontal-b {
  animation-delay: -2.1s;
}

.flow-horizontal-c {
  animation-delay: -4.2s;
}

.flow-vertical {
  transform-box: fill-box;
  animation: flow-vertical var(--motion-water) ease-in-out infinite;
  animation-delay: -1.3s;
}

.hero-copy {
  position: relative;
  z-index: 5;
  padding-bottom: 38px;
  transform: translateX(-58px);
}

.hero-copy::before {
  position: absolute;
  z-index: -1;
  top: -31px;
  right: -66px;
  bottom: -25px;
  left: -42px;
  border-radius: var(--radius-xl);
  background: var(--color-paper-soft);
  content: "";
}

.hero-copy h1 {
  max-width: 640px;
  margin-bottom: 0;
  font-size: clamp(62px, 4.9vw, 74px);
  line-height: 1.05;
}

.hero-description {
  max-width: 565px;
  margin: 23px 0 0;
  color: var(--color-muted);
  font-size: 17px;
  line-height: 1.75;
}

.hero-description strong {
  color: var(--color-accent-dark);
  font-weight: 850;
  text-decoration-line: underline;
  text-decoration-color: var(--color-warn);
  text-decoration-thickness: var(--line-regular);
  text-underline-offset: 5px;
}

.hero-actions {
  margin-top: 27px;
}

.hero-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
  margin: 23px 0 0;
  padding: 0;
  list-style: none;
}

.hero-chips li {
  min-height: 32px;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  max-width: 100%;
  padding: 0 12px;
  overflow: hidden;
  border: var(--line-thin) solid var(--color-border);
  border-radius: var(--radius-pill);
  color: var(--color-accent-dark);
  background: var(--color-panel-soft);
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 750;
  white-space: nowrap;
}

.diagram-caption {
  position: absolute;
  z-index: 3;
  bottom: 39px;
  left: 0;
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 8px 12px;
  border: var(--line-thin) solid var(--color-grid-strong);
  border-radius: var(--radius-sm);
  color: var(--color-muted);
  background: var(--color-paper);
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.04em;
}

.caption-line {
  width: 24px;
  flex-shrink: 0;
  border-top: var(--line-thin) dashed var(--color-warn);
}

.pipeline {
  position: relative;
  display: grid;
  gap: var(--space-6);
  padding-left: 88px;
}

.pipeline::before {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 34px;
  width: 18px;
  border: var(--line-regular) solid var(--color-accent-dark);
  border-radius: var(--radius-pill);
  background: var(--color-border);
  content: "";
}

.pipeline-item {
  position: relative;
  width: min(78%, 850px);
  padding: clamp(24px, 4vw, 42px);
  border: var(--line-regular) solid var(--color-border);
  border-radius: var(--radius-lg);
  background: var(--color-panel);
}

.pipeline-item:nth-child(even) {
  margin-left: auto;
  background: var(--color-panel-strong);
}

.pipeline-item::before {
  position: absolute;
  top: 44px;
  left: -57px;
  width: 57px;
  border-top: var(--line-heavy) solid var(--color-accent-dark);
  content: "";
}

.pipeline-item::after {
  position: absolute;
  top: 28px;
  left: -70px;
  width: 34px;
  height: 34px;
  border: var(--line-heavy) solid var(--color-warn);
  border-radius: var(--radius-pill);
  background: var(--color-bg);
  content: "";
}

.tab-shell {
  overflow: hidden;
  border: var(--line-regular) solid var(--color-border);
  border-radius: var(--radius-lg);
  background: var(--color-panel);
}

[role="tablist"] {
  display: flex;
  gap: 0;
  max-width: 100%;
  overflow-x: auto;
  border-bottom: var(--line-regular) solid var(--color-border);
  background: var(--color-panel-strong);
  scrollbar-width: thin;
}

[role="tab"] {
  min-height: 54px;
  flex: 1 0 auto;
  padding: 8px 18px;
  border: 0;
  border-right: var(--line-thin) solid var(--color-border);
  color: var(--color-muted);
  background: var(--color-clear);
  font-weight: 850;
  white-space: nowrap;
}

[role="tab"]:last-child {
  border-right: 0;
}

[role="tab"][aria-selected="true"] {
  color: var(--color-white);
  background: var(--color-accent-dark);
}

[role="tabpanel"] {
  padding: clamp(22px, 4vw, 42px);
}

[role="tabpanel"][hidden] {
  display: none;
}

.toc-tabs {
  position: sticky;
  z-index: 15;
  top: var(--space-2);
  display: flex;
  gap: 8px;
  max-width: 100%;
  padding: 10px;
  overflow-x: auto;
  border: var(--line-thin) solid var(--color-border);
  border-radius: var(--radius-md);
  background: var(--color-bg);
  scrollbar-width: thin;
}

.toc-tabs a {
  min-height: 40px;
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  padding: 0 14px;
  border-radius: var(--radius-pill);
  color: var(--color-accent-dark);
  background: var(--color-panel);
  font-size: 13px;
  font-weight: 800;
  text-decoration: none;
}

.toc-tabs a:hover {
  color: var(--color-white);
  background: var(--color-accent);
}

.faq-list {
  display: grid;
  gap: var(--space-2);
}

.faq-item {
  overflow: hidden;
  border: var(--line-regular) solid var(--color-border);
  border-radius: var(--radius-md);
  background: var(--color-panel);
}

.faq-item summary {
  min-height: 62px;
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: 15px 20px;
  cursor: pointer;
  color: var(--color-text);
  font-weight: 850;
  list-style: none;
}

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

.faq-item summary::before {
  width: 22px;
  height: 22px;
  flex: 0 0 auto;
  border: var(--line-thin) solid var(--color-warn);
  border-radius: var(--radius-pill);
  color: var(--color-warn);
  content: "+";
  font-family: var(--font-mono);
  line-height: 17px;
  text-align: center;
}

.faq-item[open] summary::before {
  color: var(--color-white);
  background: var(--color-warn);
  content: "−";
}

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

.glossary-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--space-3);
}

.glossary-card {
  position: relative;
  padding: 26px;
  border: var(--line-regular) solid var(--color-border);
  border-radius: var(--radius-md);
  background: var(--color-panel);
}

.glossary-card::before {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 18px;
  border-left: var(--line-thin) dashed var(--color-border);
  content: "";
}

.glossary-card > * {
  position: relative;
  padding-left: 18px;
}

.term-code {
  color: var(--color-warn);
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 850;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

.download-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--space-3);
}

.client-card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  padding: clamp(22px, 3vw, 32px);
  border: var(--line-regular) solid var(--color-border);
  border-radius: var(--radius-lg);
  background: var(--color-panel);
}

.client-card.is-recommended {
  border-color: var(--color-warn);
  background: var(--color-warn-soft);
}

.client-card.is-archived {
  border-color: var(--color-error);
  background: var(--color-error-soft);
}

.client-card-head {
  display: flex;
  align-items: flex-start;
  gap: var(--space-3);
}

.client-card-head img {
  width: 56px;
  height: 56px;
  flex: 0 0 auto;
}

.client-card-title {
  flex: 1 1 auto;
}

.client-card-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.client-card-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: auto;
}

[data-cdnver] {
  display: none;
}

[data-cdnver].has-version {
  display: inline-flex;
}

.post-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--space-3);
}

.post-card {
  position: relative;
  min-height: 260px;
  display: flex;
  flex-direction: column;
  padding: clamp(24px, 3vw, 34px);
  overflow: hidden;
  border: var(--line-regular) solid var(--color-border);
  border-radius: var(--radius-lg);
  background: var(--color-bg);
}

.post-card::after {
  position: absolute;
  right: -30px;
  bottom: -48px;
  width: 126px;
  height: 126px;
  border: var(--line-heavy) solid var(--color-panel-strong);
  border-radius: var(--radius-pill);
  content: "";
}

.post-card-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 9px;
  margin-bottom: var(--space-3);
  color: var(--color-muted);
  font-family: var(--font-mono);
  font-size: 11px;
}

.post-card h3 {
  position: relative;
  z-index: 1;
}

.post-card p {
  position: relative;
  z-index: 1;
  color: var(--color-muted);
}

.post-card-link {
  position: relative;
  z-index: 1;
  margin-top: auto;
  font-weight: 850;
}

.callout {
  position: relative;
  margin: var(--space-4) 0;
  padding: 22px 24px 22px 62px;
  border: var(--line-regular) solid var(--color-border);
  border-radius: var(--radius-md);
  background: var(--color-panel-strong);
}

.callout::before {
  position: absolute;
  top: 22px;
  left: 22px;
  width: 24px;
  height: 24px;
  border: var(--line-heavy) solid var(--color-warn);
  border-radius: var(--radius-pill);
  content: "";
}

.callout-warning {
  border-color: var(--color-warn);
  background: var(--color-warn-soft);
}

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

.callout-success {
  border-color: var(--color-success);
  background: var(--color-success-soft);
}

.dl-fab {
  position: fixed;
  z-index: 35;
  right: max(18px, var(--gutter));
  bottom: 18px;
  min-height: 58px;
  display: inline-flex;
  align-items: center;
  gap: 12px;
  max-width: calc(100vw - 36px);
  padding: 9px 18px 9px 11px;
  border: var(--line-regular) solid var(--color-accent-dark);
  border-radius: var(--radius-pill);
  color: var(--color-white);
  background: var(--color-accent-dark);
  font-weight: 850;
  text-decoration: none;
}

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

.dl-fab-icon {
  width: 38px;
  height: 38px;
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-pill);
  color: var(--color-accent-dark);
  background: var(--color-warn);
}

.dl-fab-icon svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.4;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.article-download {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: var(--space-4);
  margin-top: var(--space-6);
  padding: clamp(24px, 4vw, 40px);
  border: var(--line-heavy) solid var(--color-accent-dark);
  border-radius: var(--radius-lg);
  background: var(--color-panel-strong);
}

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

.prose > .data-table {
  display: block;
  max-width: 100%;
  min-width: 0;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

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

.swatch {
  overflow: hidden;
  border: var(--line-regular) solid var(--color-border);
  border-radius: var(--radius-md);
  background: var(--color-panel);
}

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

.swatch-copy {
  padding: 13px;
  font-family: var(--font-mono);
  font-size: 11px;
}

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

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

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

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

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

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

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

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

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

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

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

.preview-stack {
  display: grid;
  gap: var(--space-3);
}

@keyframes vane-sway {
  0%,
  100% {
    transform: rotate(-3deg);
  }

  50% {
    transform: rotate(4deg);
  }
}

@keyframes flow-horizontal {
  0% {
    transform: translateX(-12px);
    opacity: 0;
  }

  18%,
  82% {
    opacity: 1;
  }

  100% {
    transform: translateX(18px);
    opacity: 0;
  }
}

@keyframes flow-vertical {
  0% {
    transform: translateY(-12px);
    opacity: 0;
  }

  18%,
  82% {
    opacity: 1;
  }

  100% {
    transform: translateY(18px);
    opacity: 0;
  }
}

@media (max-width: 1120px) {
  .hero-inner {
    grid-template-columns: minmax(500px, 1fr) minmax(380px, 0.85fr);
  }

  .waterworks {
    right: -110px;
    transform: scale(0.88);
    transform-origin: center;
  }

  .hero-copy {
    transform: translateX(-30px);
  }

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

@media (max-width: 860px) {
  .hero {
    min-height: auto;
  }

  .hero-inner {
    min-height: auto;
    padding-top: var(--space-5);
    padding-bottom: var(--space-7);
    grid-template-columns: minmax(0, 1fr);
  }

  .device-stage {
    min-height: 570px;
    order: 2;
    margin-top: var(--space-4);
  }

  .device-stage::before {
    top: 20px;
    right: 0;
    left: -80px;
    width: auto;
    height: 500px;
  }

  .waterworks {
    top: -70px;
    left: 50%;
    right: auto;
    transform: translateX(-52%) scale(0.75);
    transform-origin: center top;
  }

  .hero-copy {
    order: 1;
    max-width: 700px;
    padding-bottom: 0;
    transform: none;
  }

  .hero-copy::before {
    right: -20px;
    left: -20px;
  }

  .hero-copy h1 {
    font-size: clamp(52px, 9vw, 70px);
  }

  .diagram-caption {
    bottom: 10px;
  }

  .pipeline-item {
    width: 100%;
  }

  .glossary-grid,
  .download-grid,
  .post-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .article-download {
    grid-template-columns: minmax(0, 1fr);
  }

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

@media (max-width: 640px) {
  .hero::after {
    right: var(--gutter);
    left: var(--gutter);
  }

  .hero-inner {
    padding-top: 30px;
  }

  .hero-copy::before {
    right: -8px;
    left: -8px;
  }

  .hero-copy h1 {
    font-size: clamp(43px, 13vw, 57px);
  }

  .hero-description {
    margin-top: 18px;
    font-size: 16px;
  }

  .hero-actions {
    margin-top: 20px;
  }

  .hero-chips {
    margin-top: 18px;
  }

  .device-stage {
    min-height: 430px;
    overflow: hidden;
    margin-inline: calc(var(--gutter) * -1);
  }

  .device-stage::before {
    left: -30px;
    height: 395px;
  }

  .device-stage::after {
    left: 4px;
  }

  .waterworks {
    top: -130px;
    left: 50%;
    transform: translateX(-53%) scale(0.58);
  }

  .diagram-caption {
    right: var(--gutter);
    bottom: 8px;
    left: var(--gutter);
    justify-content: center;
  }

  .pipeline {
    gap: var(--space-4);
    padding-left: 48px;
  }

  .pipeline::before {
    left: 12px;
    width: 14px;
  }

  .pipeline-item::before {
    top: 35px;
    left: -31px;
    width: 31px;
  }

  .pipeline-item::after {
    top: 22px;
    left: -47px;
    width: 28px;
    height: 28px;
  }

  [role="tabpanel"] {
    padding: 20px;
  }

  .faq-answer {
    padding-right: 18px;
    padding-left: 20px;
  }

  .callout {
    padding: 58px 20px 20px;
  }

  .callout::before {
    top: 20px;
    left: 20px;
  }

  .client-card-actions .button,
  .article-download-actions .button {
    flex: 1 1 100%;
  }

  .dl-fab {
    right: 14px;
    bottom: 14px;
    left: 14px;
    justify-content: center;
    max-width: none;
  }

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

@media (prefers-reduced-motion: reduce) {
  .cat-vane,
  .flow-horizontal-a,
  .flow-horizontal-b,
  .flow-horizontal-c,
  .flow-vertical {
    animation: none;
  }
}