.ai-hero {
  position: relative;
  overflow: clip;
  border-bottom: 1px solid var(--color-border);
  background: var(--color-bg);
}

.ai-hero::before {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(var(--color-border) 1px, transparent 1px),
    linear-gradient(90deg, var(--color-border) 1px, transparent 1px);
  background-size: 44px 44px;
  content: "";
  opacity: .24;
  pointer-events: none;
}

.ai-hero-grid {
  position: relative;
  display: grid;
  min-height: calc(100svh - var(--header-height));
  grid-template-columns: minmax(0, 1.05fr) minmax(420px, .95fr);
  gap: 64px;
  align-items: center;
  padding-top: 72px;
  padding-bottom: 72px;
}

.ai-hero-copy {
  position: relative;
  z-index: 1;
}

.ai-hero-copy h1 {
  margin-top: 22px;
  margin-bottom: 24px;
}

.ai-hero-copy .lead {
  max-width: 650px;
}

.ai-hero-copy .cta-row {
  margin-top: 30px;
}

.ai-hero-copy .trust-list {
  margin-top: 28px;
}

.ai-hero-copy .trust-item svg {
  color: var(--color-accent);
}

.ai-flow-board {
  position: relative;
  z-index: 1;
  overflow: hidden;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  background: var(--color-bg);
  box-shadow: var(--shadow-card);
}

.ai-flow-head {
  display: flex;
  min-height: 46px;
  align-items: center;
  gap: 7px;
  padding-inline: 17px;
  border-bottom: 1px solid var(--color-border);
  background: var(--color-panel);
}

.ai-flow-head > span {
  width: 9px;
  height: 9px;
  flex: 0 0 auto;
  border-radius: var(--radius-pill);
  background: var(--color-border);
}

.ai-flow-head > span:first-child {
  background: var(--color-error);
}

.ai-flow-head > span:nth-child(2) {
  background: var(--color-warning);
}

.ai-flow-head > span:nth-child(3) {
  background: var(--color-success);
}

.ai-flow-head strong {
  margin-left: auto;
  color: var(--color-muted);
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: .06em;
}

.ai-flow-canvas {
  display: grid;
  min-height: 410px;
  grid-template-columns: minmax(0, 1fr) 48px minmax(0, 1fr) 48px minmax(0, 1fr);
  align-items: center;
  padding: 42px 24px;
  background: var(--color-bg);
}

.ai-flow-stage {
  position: relative;
  display: flex;
  min-height: 180px;
  flex-direction: column;
  justify-content: center;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: 20px 16px;
  background: var(--color-panel);
  text-align: center;
}

.ai-flow-stage::before {
  width: 16px;
  height: 16px;
  margin: 0 auto 18px;
  border: 4px solid var(--color-bg);
  border-radius: var(--radius-pill);
  background: var(--color-accent);
  box-shadow: 0 0 0 1px var(--color-accent);
  content: "";
}

.ai-flow-target {
  border-color: var(--color-warning);
  background: var(--color-bg);
}

.ai-flow-target::before {
  background: var(--color-warning);
  box-shadow: 0 0 0 1px var(--color-warning);
}

.ai-flow-stage strong {
  margin-bottom: 7px;
  color: var(--color-text);
  font-family: var(--font-display);
  font-size: 17px;
}

.ai-flow-stage small {
  color: var(--color-muted);
  font-size: 11px;
}

.ai-stage-mark {
  position: absolute;
  top: 10px;
  left: 10px;
  color: var(--color-muted);
  font-family: var(--font-mono);
  font-size: 8px;
  letter-spacing: .05em;
}

.ai-flow-link {
  position: relative;
  height: 2px;
  background: var(--color-accent);
}

.ai-flow-link::after {
  position: absolute;
  top: 50%;
  right: 0;
  width: 8px;
  height: 8px;
  border-top: 2px solid var(--color-accent);
  border-right: 2px solid var(--color-accent);
  content: "";
  transform: translateY(-50%) rotate(45deg);
}

.ai-flow-link span {
  position: absolute;
  top: 50%;
  left: 0;
  width: 8px;
  height: 8px;
  border: 2px solid var(--color-bg);
  border-radius: var(--radius-pill);
  background: var(--color-accent-dark);
  transform: translateY(-50%);
}

.ai-flow-note {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 16px 18px;
  border-top: 1px solid var(--color-border);
  background: var(--color-panel);
}

.ai-flow-note .status-dot {
  margin-top: .55em;
}

.ai-flow-note p {
  margin: 0;
  color: var(--color-muted);
  font-size: 12px;
}

.ai-article {
  position: relative;
  padding-top: 40px;
  padding-bottom: var(--section-space);
}

.ai-section {
  border-bottom: 1px solid var(--color-border);
}

.ai-section:last-child {
  border-bottom: 0;
}

.ai-section-heading {
  max-width: 850px;
  margin-bottom: 38px;
}

.ai-section-heading h2 {
  margin-top: 18px;
}

.ai-section-heading > p {
  max-width: 760px;
  color: var(--color-muted);
  font-size: 17px;
}

.ai-prose {
  max-width: 900px;
}

.ai-prose > p {
  font-size: 17px;
  line-height: 1.85;
}

.ai-prose strong {
  color: var(--color-text);
}

.ai-tool-table td {
  color: var(--color-muted);
  font-size: 14px;
  line-height: 1.65;
}

.ai-tool-notes {
  margin-top: 28px;
}

.ai-tool-notes h3 {
  font-size: 22px;
}

.ai-tool-notes p {
  margin-bottom: 0;
  color: var(--color-muted);
}

.ai-checklist {
  display: grid;
  gap: 16px;
}

.ai-check-item {
  display: grid;
  grid-template-columns: 52px minmax(0, 1fr);
  gap: 22px;
  align-items: start;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: 25px;
  background: var(--color-bg);
}

.ai-check-mark {
  display: inline-flex;
  width: 52px;
  height: 52px;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
  background: var(--color-panel-strong);
  color: var(--color-accent-dark);
  font-family: var(--font-mono);
  font-size: 14px;
  font-weight: 800;
}

.ai-check-item h3 {
  margin-bottom: 8px;
  font-size: 22px;
}

.ai-check-item p {
  margin-bottom: 0;
  color: var(--color-muted);
}

.ai-code-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 22px;
  margin-top: 32px;
}

.ai-code-grid h3 {
  margin-top: 18px;
  font-size: 22px;
}

.ai-code-grid ul {
  display: grid;
  gap: 10px;
  margin-bottom: 0;
  padding-left: 20px;
}

.ai-code-grid li {
  color: var(--color-muted);
}

.ai-dev-grid .card {
  display: flex;
  flex-direction: column;
}

.ai-dev-label {
  margin-bottom: 18px;
  color: var(--color-accent-dark);
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .06em;
}

.ai-dev-grid h3 {
  font-size: 23px;
}

.ai-dev-grid p {
  color: var(--color-muted);
  font-size: 14px;
}

.ai-failure-list {
  max-width: 980px;
}

.ai-route-grid {
  position: relative;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 22px;
}

.ai-route-card {
  position: relative;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: 28px;
  background: var(--color-bg);
}

.ai-route-card::before {
  position: absolute;
  top: 39px;
  right: 0;
  left: 0;
  border-top: 1px dashed var(--color-border);
  content: "";
}

.ai-route-flag {
  position: relative;
  z-index: 1;
  display: block;
  width: 34px;
  height: 26px;
  margin-bottom: 28px;
  border-left: 3px solid var(--color-accent-dark);
}

.ai-route-flag::after {
  position: absolute;
  top: 0;
  left: 3px;
  width: 25px;
  height: 17px;
  background: var(--color-accent);
  clip-path: polygon(0 0, 100% 50%, 0 100%);
  content: "";
}

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

.ai-route-card p {
  margin-bottom: 0;
  color: var(--color-muted);
  font-size: 14px;
}

.ai-plan-note {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 34px;
  align-items: center;
  margin-top: 30px;
}

.ai-plan-note h3 {
  margin-top: 18px;
  font-size: 27px;
}

.ai-plan-note p {
  max-width: 850px;
  color: var(--color-muted);
}

.ai-plan-note p:last-child {
  margin-bottom: 0;
}

.ai-plan-note .cta-row {
  min-width: 190px;
  flex-direction: column;
  align-items: stretch;
}

.ai-closing {
  margin-top: 52px;
}

.ai-closing h3 {
  font-size: 27px;
}

@media (max-width: 1080px) {
  .ai-hero-grid {
    grid-template-columns: 1fr;
    gap: 46px;
  }

  .ai-hero-copy {
    max-width: 760px;
  }

  .ai-flow-board {
    max-width: 760px;
  }

  .ai-route-grid {
    grid-template-columns: 1fr;
  }

  .ai-plan-note {
    grid-template-columns: 1fr;
  }

  .ai-plan-note .cta-row {
    min-width: 0;
    flex-direction: row;
  }
}

@media (max-width: 900px) {
  .ai-hero-grid {
    min-height: auto;
    grid-template-columns: 1fr;
    padding-top: 58px;
    padding-bottom: 58px;
  }

  .ai-dev-grid {
    grid-template-columns: 1fr;
  }

  .ai-code-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 700px) {
  .ai-flow-canvas {
    min-height: 0;
    grid-template-columns: 1fr;
    gap: 18px;
    padding: 24px;
  }

  .ai-flow-stage {
    min-height: 126px;
  }

  .ai-flow-link {
    width: 2px;
    height: 28px;
    margin-inline: auto;
  }

  .ai-flow-link::after {
    top: auto;
    right: auto;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%) rotate(135deg);
  }

  .ai-flow-link span {
    top: 0;
    left: 50%;
    transform: translateX(-50%);
  }

  .ai-check-item {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  .ai-plan-note .cta-row {
    flex-direction: column;
  }
}

@media (max-width: 480px) {
  .ai-hero::before {
    background-size: 32px 32px;
  }

  .ai-hero-grid {
    padding-top: 44px;
    padding-bottom: 44px;
  }

  .ai-flow-board {
    border-radius: var(--radius-md);
  }

  .ai-flow-head strong {
    display: none;
  }

  .ai-article {
    padding-top: 24px;
  }

  .ai-section-heading {
    margin-bottom: 28px;
  }

  .ai-prose > p {
    font-size: 16px;
  }

  .ai-check-item,
  .ai-route-card {
    padding: 20px;
  }
}