/* HomeArchitecture — three-stage flow with labeled edges between them.
 * Mono labels, hairline borders, no decorative chrome. Reads like a
 * datasheet block diagram. */

.section {
  padding: 5rem 1.5rem;
  border-top: 1px solid var(--ifm-color-emphasis-200);
  border-bottom: 1px solid var(--ifm-color-emphasis-200);
  background:
    linear-gradient(180deg, transparent 0, var(--ifm-color-emphasis-100) 100%);
}

.inner {
  max-width: 1120px;
  margin: 0 auto;
}

.header {
  max-width: 740px;
  margin: 0 auto 3rem;
}

.eyebrow {
  display: block;
  font-family: var(--ifm-font-family-monospace);
  font-size: 0.72rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ifm-color-primary);
  font-weight: 600;
  margin-bottom: 0.5rem;
}

.title {
  font-size: 1.75rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin: 0 0 1rem;
  color: var(--ifm-heading-color);
}

.lede {
  font-size: 1rem;
  line-height: 1.6;
  color: var(--ifm-color-emphasis-700);
  margin: 0;
}

/* Diagram: 5 columns (stage, edge, stage, edge, stage). Each row is one
 * grid row. Edges visually link the stages with a hairline + an inline
 * mono label. */
.diagram {
  display: grid;
  grid-template-columns: 1fr auto 1fr auto 1fr;
  align-items: stretch;
  gap: 0;
}

.stage {
  display: flex;
  flex-direction: column;
  padding: 1.5rem 1.4rem;
  background: var(--ifm-background-color);
  border: 1px solid var(--ifm-color-emphasis-300);
  position: relative;
}

/* Filled = "your machine" — a calmer surface that still reads as the
 * runtime side, but doesn't punch out against the section background.
 * Subtle emphasis-200 fill with a slightly darker border. Heading-color
 * text keeps things crisp without going pure-inverse. */
.stageFilled {
  background: var(--ifm-color-emphasis-200);
  border-color: var(--ifm-color-emphasis-300);
  color: var(--ifm-color-emphasis-1000);
}
.stageFilled .stageTitle { color: var(--ifm-color-emphasis-1000); }
.stageFilled .stageKicker { color: var(--ifm-color-emphasis-600); }
.stageFilled .stageSub { color: var(--ifm-color-emphasis-700); }
.stageFilled .stageBody { color: var(--ifm-color-emphasis-800); }

.stageOutlined {
  background: var(--ifm-background-color);
  border: 1px dashed var(--ifm-color-emphasis-400);
  color: var(--ifm-heading-color);
}

.stageKicker {
  font-family: var(--ifm-font-family-monospace);
  font-size: 0.7rem;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--ifm-color-emphasis-500);
  margin-bottom: 0.85rem;
}

.stageTitle {
  font-size: 1.1rem;
  font-weight: 700;
  letter-spacing: -0.012em;
  margin: 0 0 0.4rem;
  color: var(--ifm-heading-color);
}

.stageSub {
  font-family: var(--ifm-font-family-monospace);
  font-size: 0.78rem;
  letter-spacing: 0.005em;
  color: var(--ifm-color-emphasis-600);
  margin: 0 0 1rem;
}

.stageBody {
  font-size: 0.88rem;
  line-height: 1.5;
  color: var(--ifm-color-emphasis-700);
  margin: 0;
}

/* Edge between stages — hairline + label. */
.edge {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-width: 100px;
  padding: 0 0.5rem;
}

.edgeLineHorizontal {
  position: absolute;
  top: 50%;
  left: 0;
  right: 0;
  height: 1px;
  background: var(--ifm-color-emphasis-400);
}

.edgeLineVertical {
  display: none;
}

.edgeLabel {
  position: relative;
  z-index: 1;
  padding: 0.25rem 0.55rem;
  font-family: var(--ifm-font-family-monospace);
  font-size: 0.68rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--ifm-color-emphasis-700);
  background: var(--ifm-background-color);
  border: 1px solid var(--ifm-color-emphasis-300);
  white-space: nowrap;
}

.legend {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 2rem;
  margin-top: 2rem;
  font-family: var(--ifm-font-family-monospace);
  font-size: 0.72rem;
  letter-spacing: 0.04em;
  color: var(--ifm-color-emphasis-600);
}

.legendItem {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

.legendSwatch {
  width: 12px;
  height: 12px;
  display: inline-block;
}

.swatchFilled {
  background: var(--ifm-color-emphasis-200);
  border: 1px solid var(--ifm-color-emphasis-300);
}

.swatchOutlined {
  background: transparent;
  border: 1px dashed var(--ifm-color-emphasis-400);
}

/* Stack vertically on narrow viewports */
@media (max-width: 900px) {
  .diagram {
    grid-template-columns: 1fr;
  }
  .edge {
    min-width: 0;
    padding: 0.6rem 0;
    height: 60px;
  }
  .edgeLineHorizontal {
    display: none;
  }
  .edgeLineVertical {
    display: block;
    position: absolute;
    top: 0;
    bottom: 0;
    left: 50%;
    width: 1px;
    background: var(--ifm-color-emphasis-400);
    transform: translateX(-50%);
  }
}
