.factory-page {
  --factory-max: min(1200px, calc(100vw - 48px));
}

.factory-page__title {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.factory-body {
  width: var(--factory-max);
  margin: 0 auto;
  padding: clamp(48px, 7vw, 96px) 0 clamp(80px, 9vw, 128px);
}

.factory-overline {
  margin-bottom: 18px;
  color: var(--teal-700);
  font-family: "IBM Plex Mono", monospace;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.factory-overline span {
  display: none;
}

.factory-beat__copy h3 {
  max-width: 13em;
  margin-bottom: 20px;
  font-size: clamp(2rem, 3.2vw, 3.35rem);
  line-height: 1.04;
}

.factory-beat__copy > p:last-child {
  max-width: 39rem;
  margin-bottom: 0;
  color: var(--soft-ink);
  font-size: clamp(1.05rem, 1.5vw, 1.2rem);
}

.factory-beat__image {
  display: grid;
  min-height: 420px;
  margin: 0;
  overflow: hidden;
  border-radius: 12px;
  background: var(--porcelain);
  place-items: center;
}

.factory-beat__image img {
  display: block;
  width: 66.666%;
  height: auto;
  max-height: 414px;
  object-fit: contain;
}

.factory-sequence {
  position: relative;
}

.factory-sequence::before {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 50%;
  width: 1px;
  background: var(--line);
  content: "";
}

.factory-sequence__step {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  align-items: center;
  gap: clamp(72px, 10vw, 150px);
  min-height: 640px;
  padding: 72px 0;
}

.factory-sequence__step:nth-child(even) .factory-beat__copy {
  order: 2;
}

.factory-sequence__step:nth-child(even) .factory-beat__image {
  order: 1;
}

.factory-sequence__number {
  position: absolute;
  z-index: 2;
  top: 50%;
  left: 50%;
  display: grid;
  width: 52px;
  height: 52px;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: var(--canvas);
  color: var(--teal-700);
  font-family: "IBM Plex Mono", monospace;
  font-size: 0.78rem;
  font-weight: 600;
  place-items: center;
  transform: translate(-50%, -50%);
}

/* Copied from the Version 2 Factory function-map primitive. */
.factory-function-map {
  width: var(--rail-page);
}

.factory-function-map__heading {
  display: grid;
  max-width: 1040px;
  gap: 18px;
  margin-bottom: clamp(30px, 5vw, 56px);
}

.factory-function-map__heading :where(h2, p) {
  margin: 0;
}

.factory-function-map__heading p {
  max-width: var(--measure-copy-wide);
  color: var(--soft-ink);
  font-size: clamp(1.08rem, 1.5vw, 1.28rem);
  line-height: 1.56;
}

.factory-function-map__grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
}

.factory-function-card {
  display: grid;
  min-height: 168px;
  grid-template-columns: minmax(92px, 0.46fr) minmax(0, 1fr);
  align-items: center;
  gap: 18px;
  padding: 22px;
  border: 1px solid rgba(216, 208, 194, 0.78);
  border-radius: 8px;
  background: rgba(251, 250, 246, 0.78);
  color: var(--ink);
  text-decoration: none;
  transition:
    border-color 140ms ease,
    background-color 140ms ease,
    transform 140ms ease;
}

.factory-function-card[href]:hover,
.factory-function-card[href]:focus-visible {
  border-color: var(--line);
  background: var(--mist);
  outline: none;
  transform: translateY(-2px);
}

.factory-function-card__image {
  display: grid;
  width: 100%;
  min-height: 112px;
  place-items: center;
}

.factory-function-card__image img {
  display: block;
  width: 100%;
  max-width: 128px;
  height: 112px;
  object-fit: contain;
  object-position: center bottom;
}

.factory-function-card__copy {
  display: grid;
  gap: 8px;
}

.factory-function-card h3 {
  margin: 0;
  font-size: clamp(1.08rem, 1.25vw, 1.28rem);
  line-height: 1.08;
}

.factory-function-card p {
  margin: 0;
  color: var(--soft-ink);
  font-size: 0.94rem;
  line-height: 1.42;
}

@media (max-width: 1120px) {
  .factory-function-map__grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 900px) {
  .factory-sequence__step {
    grid-template-columns: 1fr;
    min-height: 0;
    padding: 72px 0 72px 80px;
  }

  .factory-sequence__step:nth-child(even) .factory-beat__copy {
    order: 1;
  }

  .factory-sequence__step:nth-child(even) .factory-beat__image {
    order: 2;
  }

  .factory-sequence::before {
    left: 25px;
  }

  .factory-sequence__number {
    top: 80px;
    left: 25px;
  }

  .factory-function-map__grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 600px) {
  .factory-page {
    --factory-max: calc(100vw - 32px);
  }

  .factory-body {
    padding-top: 24px;
  }

  .factory-sequence__step {
    gap: 32px;
    padding: 56px 0 56px 56px;
  }

  .factory-sequence::before,
  .factory-sequence__number {
    left: 18px;
  }

  .factory-sequence__number {
    top: 62px;
    width: 38px;
    height: 38px;
  }

  .factory-beat__image {
    min-height: 320px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .factory-function-card {
    transition: none;
  }
}
.platform-hero .hero-content { width: auto; }
.platform-hero .hero-content p { max-width: 720px; }
.platform-hero h1 { max-width: 13.4em; font-size: clamp(2.65rem, 3.65vw, 3.75rem); line-height: 1.04; }

@media (max-width: 1120px) {
  .platform-hero h1 { font-size: clamp(2.45rem, 3.8vw, 3.25rem); }
}

/* Factory hero */
.platform-hero {
  display: grid;
  min-height: clamp(800px, 92vh, 980px);
  place-items: center;
  overflow: hidden;
  background: #fdfbf4;
}

.platform-hero-inner {
  position: relative;
  display: grid;
  width: min(1440px, calc(100vw - var(--page-x)));
  min-height: inherit;
  grid-template-columns: 1fr;
  align-items: end;
  justify-items: center;
  padding: clamp(58px, 7vw, 96px) 0 clamp(32px, 3.8vw, 56px);
}

.platform-hero-visual {
  position: absolute;
  top: clamp(18px, 2.6vw, 36px);
  left: 50%;
  z-index: 1;
  width: min(1640px, 116vw);
  margin: 0;
  pointer-events: none;
  transform: translateX(-50%);
}

.platform-hero-visual::after {
  position: absolute;
  inset: auto 0 0;
  height: 42%;
  content: "";
  background: linear-gradient(180deg, rgba(253, 251, 244, 0), rgba(253, 251, 244, 0.94) 68%, #fdfbf4);
  pointer-events: none;
}

.platform-hero-visual img {
  display: block;
  width: 100%;
  max-height: min(700px, 68vh);
  object-fit: contain;
  object-position: center top;
}

.platform-hero-copy {
  position: relative;
  z-index: 2;
  display: grid;
  align-self: end;
  justify-items: center;
  max-width: 900px;
  padding: 0;
  text-align: center;
}

.platform-hero-copy::before {
  position: absolute;
  z-index: -1;
  inset: -68px -132px -58px;
  content: "";
  background: radial-gradient(ellipse at center, rgba(253, 251, 244, 0.98), rgba(253, 251, 244, 0.94) 58%, rgba(253, 251, 244, 0) 76%);
  pointer-events: none;
}

.platform-hero-copy h1 {
  max-width: 13em;
  margin-right: auto;
  margin-left: auto;
}

.platform-hero-copy p {
  max-width: 58ch;
  margin-right: auto;
  margin-left: auto;
}

@media (max-width: 860px) {
  .platform-hero { min-height: auto; flex-direction: column; gap: 24px; padding: 18px 16px 48px; }
  .platform-hero h1 { max-width: 13em; font-size: 2rem; line-height: 1.04; }
  .platform-hero-inner { width: var(--content); min-height: auto; padding: 38px 0 56px; }
  .platform-hero-visual { position: relative; top: auto; left: auto; order: -1; width: min(100%, 720px); transform: none; }
  .platform-hero-visual::after { height: 34%; }
  .platform-hero-visual img { max-height: 300px; }
  .platform-hero-copy::before { display: none; }
}

@media (max-width: 430px) {
  .platform-hero-inner { width: calc(100vw - 32px); }
  .platform-hero-visual img { max-height: 230px; }
}
