.language-switch {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(251, 250, 246, 0.45);
}

.language-switch a,
.language-switch span {
  display: inline-grid;
  min-width: 34px;
  min-height: 28px;
  place-items: center;
  padding: 4px 8px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 850;
  letter-spacing: 0.08em;
  line-height: 1;
}

.language-switch a {
  color: var(--muted);
  transition: color 0.2s ease, background 0.2s ease;
}

.language-switch a:hover {
  background: rgba(17, 19, 15, 0.06);
  color: var(--ink);
}

.language-switch .is-active {
  background: var(--accent);
  color: var(--ink);
}

/* Hero polish: intentional line breaks and a denser, clearer workflow. */
.hero h1 {
  max-width: 620px;
  font-size: clamp(52px, 5vw, 80px);
  letter-spacing: -0.066em;
}

.hero h1 .hero-line {
  display: block;
  color: inherit;
  white-space: nowrap;
}

.hero h1 .hero-line-accent {
  color: var(--green);
}

.flow-shell.is-upgraded {
  transition: transform 0.35s var(--ease), box-shadow 0.35s ease;
}

@media (hover: hover) and (pointer: fine) {
  .flow-shell.is-upgraded:hover {
    transform: translateY(-4px);
    box-shadow: 0 30px 90px rgba(24, 28, 18, 0.16);
  }
}

.flow-shell.is-upgraded .flow-node {
  width: 30%;
  max-width: 178px;
  min-height: 64px;
  gap: 9px;
  padding: 9px 11px;
}

.flow-shell.is-upgraded .flow-node:hover,
.flow-shell.is-upgraded .flow-node.is-active {
  transform: none;
}

.flow-shell.is-upgraded .flow-node strong {
  overflow: visible;
  font-size: 10px;
  line-height: 1.2;
  text-overflow: clip;
  white-space: normal;
}

.flow-shell.is-upgraded .flow-node > div > span {
  font-size: 7px;
}

.flow-shell.is-upgraded .node-icon {
  width: 34px;
  height: 34px;
  flex: 0 0 34px;
}

.flow-shell.is-upgraded .node-trigger { top: 10%; left: 3%; }
.flow-shell.is-upgraded .node-validate { top: 10%; left: 36%; }
.flow-shell.is-upgraded .node-ai { top: 39%; left: 36%; border-color: rgba(115, 151, 8, 0.44); }
.flow-shell.is-upgraded .node-crm { top: 9%; right: 3%; }
.flow-shell.is-upgraded .node-notify { top: 40%; right: 3%; }
.flow-shell.is-upgraded .node-reply { right: 3%; bottom: 9%; }

.flow-shell.is-upgraded .flow-node i {
  top: 50%;
  right: -4px;
  bottom: auto;
  left: auto;
  background: #c4c8bc;
  transform: translateY(-50%);
  transition: background 0.3s ease, box-shadow 0.3s ease;
}

.flow-shell.is-upgraded .node-validate i,
.flow-shell.is-upgraded .node-crm i,
.flow-shell.is-upgraded .node-notify i {
  top: auto;
  right: auto;
  bottom: -4px;
  left: 50%;
  transform: translateX(-50%);
}

.flow-shell.is-upgraded .node-reply i {
  display: none;
}

.flow-shell.is-upgraded .flow-node::after {
  position: absolute;
  z-index: 2;
  width: 7px;
  height: 7px;
  border: 2px solid var(--paper-strong);
  border-radius: 50%;
  background: #c4c8bc;
  content: "";
  transition: background 0.3s ease, box-shadow 0.3s ease;
}

.flow-shell.is-upgraded .node-trigger::after {
  display: none;
}

.flow-shell.is-upgraded .node-validate::after,
.flow-shell.is-upgraded .node-crm::after {
  top: 50%;
  left: -4px;
  transform: translateY(-50%);
}

.flow-shell.is-upgraded .node-ai::after,
.flow-shell.is-upgraded .node-notify::after,
.flow-shell.is-upgraded .node-reply::after {
  top: -4px;
  left: 50%;
  transform: translateX(-50%);
}

.flow-shell.is-upgraded .flow-node.is-active i,
.flow-shell.is-upgraded .flow-node.is-active::after {
  background: var(--accent-strong);
  box-shadow: 0 0 0 4px rgba(191, 232, 60, 0.14);
}

.flow-shell.is-upgraded .flow-node.is-complete i,
.flow-shell.is-upgraded .flow-node.is-complete::after {
  background: #76952b;
}

.icon-validate {
  background: #e8efe5;
  color: #31543b;
}

.icon-notify {
  background: #fff3c9;
  color: #7e6500;
}

.flow-shell.is-upgraded .flow-edge path {
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
  vector-effect: non-scaling-stroke;
}

.flow-shell.is-upgraded .flow-edge-track {
  stroke: rgba(17, 19, 15, 0.16);
  stroke-width: 2;
  transition: stroke 0.35s ease, opacity 0.35s ease;
}

.flow-shell.is-upgraded .flow-edge.is-complete .flow-edge-track {
  stroke: rgba(115, 151, 8, 0.48);
}

.flow-shell.is-upgraded .flow-edge.is-active .flow-edge-track {
  stroke: rgba(115, 151, 8, 0.34);
}

.flow-shell.is-upgraded .flow-edge-pulse {
  stroke: var(--accent-strong);
  stroke-width: 3.5;
  stroke-dasharray: 0.085 0.915;
  stroke-dashoffset: 1;
  opacity: 0;
  filter: drop-shadow(0 0 4px rgba(191, 232, 60, 0.75));
}

.flow-shell.is-upgraded .flow-edge.is-active .flow-edge-pulse {
  animation: edge-signal 1.48s cubic-bezier(0.42, 0, 0.2, 1) both;
}

@keyframes edge-signal {
  0% {
    stroke-dashoffset: 1;
    opacity: 0;
  }
  12%, 86% {
    opacity: 1;
  }
  100% {
    stroke-dashoffset: 0;
    opacity: 0;
  }
}

.flow-shell.is-upgraded .flow-node.is-active {
  border-color: var(--accent-strong);
  background: #fcfff3;
  box-shadow: 0 16px 38px rgba(120, 154, 14, 0.2), 0 0 0 4px rgba(215, 255, 95, 0.18);
}

.flow-shell.is-upgraded .flow-node.is-complete {
  opacity: 0.94;
}

.flow-progress i[data-progress="validate"] { transform: scaleX(0.28); }
.flow-progress i[data-progress="analyze"] { transform: scaleX(0.43); }
.flow-progress i[data-progress="store"] { transform: scaleX(0.59); }
.flow-progress i[data-progress="notify"] { transform: scaleX(0.74); }
.flow-progress i[data-progress="reply"] { transform: scaleX(0.88); }
.flow-progress i[data-progress="done"] { transform: scaleX(1); }

@media (max-width: 1100px) {
  .hero h1 {
    max-width: 760px;
  }
}

@media (max-width: 820px) {
  .language-switch {
    align-self: flex-start;
    margin-top: 22px;
  }

  .language-switch a,
  .language-switch span {
    min-width: 46px;
    min-height: 38px;
    font-size: 12px;
  }

  .hero h1 {
    max-width: 100%;
    font-size: clamp(46px, 11.8vw, 66px);
  }

  .hero h1 .hero-line {
    white-space: normal;
  }

  .flow-shell.is-upgraded .flow-node {
    width: 100%;
    max-width: none;
    min-height: 58px;
    padding: 8px 9px;
  }

  .flow-shell.is-upgraded .flow-node i,
  .flow-shell.is-upgraded .node-validate i,
  .flow-shell.is-upgraded .node-crm i,
  .flow-shell.is-upgraded .node-notify i,
  .flow-shell.is-upgraded .node-reply i {
    display: block;
    top: 50%;
    right: auto;
    bottom: auto;
    left: -31px;
    transform: translateY(-50%);
  }

  .flow-shell.is-upgraded .flow-node::after {
    display: none;
  }

  .flow-shell.is-upgraded .node-icon {
    width: 30px;
    height: 30px;
    flex-basis: 30px;
  }
}

@media (max-width: 380px) {
  .flow-shell.is-upgraded .flow-node i,
  .flow-shell.is-upgraded .node-validate i,
  .flow-shell.is-upgraded .node-crm i,
  .flow-shell.is-upgraded .node-notify i,
  .flow-shell.is-upgraded .node-reply i {
    left: -27px;
  }
}
