.cp-hero:has(.farm-hero) {
  padding: clamp(64px, 10vh, 112px) 0 104px;
  min-height: 0;
  background: #101e24;
  isolation: isolate;
  text-align: left;
}

.cp-hero:has(.farm-hero) .cp-hero__inner {
  max-width: 1320px;
  padding-inline: 56px;
  pointer-events: none;
}

.cp-hero:has(.farm-hero) .cp-hero__inner a {
  pointer-events: auto;
}

.cp-hero:has(.farm-hero) .cp-hero__title {
  max-width: 560px;
  margin: 0 0 24px;
  font-family: var(--cp-font-family-pixel);
  font-weight: 900;
  /* The pixel font has one weight; the theme disables synthetic bold by default. */
  font-synthesis: weight style;
  font-size: clamp(44px, 5vw, 70px);
  line-height: 1.08;
  text-wrap: balance;
  text-shadow: 0 4px 0 #070e0f;
}

.cp-hero:has(.farm-hero) .cp-hero__tagline {
  max-width: 460px;
  margin: 0 0 30px;
  color: #d1d6c9;
  text-wrap: pretty;
}

.cp-hero:has(.farm-hero) .cp-hero__cta {
  margin-bottom: 0;
  justify-content: flex-start;
}

.cp-hero:has(.farm-hero) .cp-hero__eyebrow {
  background: #d6a252;
  color: #181610;
  border: 1px solid #f7e5c5;
  font-weight: 700;
  letter-spacing: 0.08em;
}

.cp-hero:has(.farm-hero) .cp-hero__cta a[href='/packs'] {
  background: #101615;
  color: #f7eedc;
  border: 1px solid #8e9b8d;
}

.cp-hero:has(.farm-hero) .cp-hero__cta a[href='/packs']:hover {
  background: #1d261e;
  color: #f7e5c5;
  border-color: #d6a252;
}

.cp-hero:has(.farm-hero) .cp-hero__cta a[href='/packs']:focus-visible {
  outline: 2px solid #d6a252;
  outline-offset: 4px;
}

.farm-hero {
  overflow: hidden;
  text-align: left;
  font-family: var(--cp-font-family-mono);
}

.farm-world {
  position: absolute;
  inset: 0;
  z-index: 0;
}

.farm-world::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, #0b141bea 0%, #0b141bba 28%, #0b141b30 58%, transparent 80%);
  pointer-events: none;
}

.farm-landscape {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  image-rendering: pixelated;
}

.farm-grain__belt {
  stroke: #e5bd65;
  stroke-width: 5;
  stroke-dasharray: 2 5 1 7;
  opacity: 0.85;
  animation: farm-grain-flow 1.1s linear infinite;
}

.farm-grain__belt--narrow {
  stroke-width: 3;
  opacity: 0.7;
}

.farm-grain__lift {
  stroke: #b89a57;
  stroke-width: 10;
  stroke-dasharray: 2 12;
  opacity: 0.65;
  animation: farm-elevator 1s linear infinite;
}

.farm-combine {
  animation: farm-harvest 34s linear infinite;
}

.farm-cut-swath {
  animation: farm-cut 34s linear infinite;
}

.farm-chaff {
  animation: farm-chaff 0.8s steps(4) infinite;
}

.farm-pause {
  position: absolute;
  right: 16px;
  bottom: 16px;
  z-index: 4;
  display: grid;
  place-items: center;
  pointer-events: auto;
  width: 44px;
  height: 44px;
  border: 0;
  border-radius: 4px;
  padding: 0;
  background: transparent;
  color: #f7eedc;
  font: inherit;
  font-size: 18px;
  opacity: 0.5;
  text-shadow: 0 1px 3px #080c0c;
  cursor: pointer;
}

.farm-pause:hover,
.farm-pause:focus-visible {
  opacity: 1;
  background: #080c0c80;
}
.farm-pause:focus-visible {
  outline: 2px solid #d6a252;
  outline-offset: 3px;
}
.farm-pause:disabled {
  cursor: default;
  color: #8e9b8d;
}

.farm-hero[data-running='false'] *,
.farm-hero[data-running='false'] *::before,
.farm-hero[data-running='false'] *::after {
  animation-play-state: paused;
}

@keyframes farm-grain-flow {
  to {
    stroke-dashoffset: -15;
  }
}

@keyframes farm-elevator {
  to {
    stroke-dashoffset: -14;
  }
}

@keyframes farm-harvest {
  0% {
    transform: translateX(250px);
    opacity: 0;
  }
  3% {
    opacity: 1;
  }
  94% {
    opacity: 1;
  }
  98%,
  100% {
    transform: translateX(-120px);
    opacity: 0;
  }
}

@keyframes farm-cut {
  0% {
    clip-path: inset(0 0 0 84%);
    opacity: 1;
  }
  98% {
    clip-path: inset(0 0 0 5%);
    opacity: 1;
  }
  100% {
    clip-path: inset(0 0 0 5%);
    opacity: 0;
  }
}

@keyframes farm-chaff {
  from {
    transform: translate(0, 0);
    opacity: 0.7;
  }
  to {
    transform: translate(12px, -3px);
    opacity: 0;
  }
}
@media (max-width: 900px) {
  .cp-hero:has(.farm-hero) {
    padding: 72px 0 172px;
  }
  .cp-hero:has(.farm-hero) .cp-hero__title {
    max-width: 620px;
  }
  .cp-hero:has(.farm-hero) .cp-hero__tagline {
    max-width: 540px;
  }
}

@media (max-width: 640px) {
  .cp-hero:has(.farm-hero) {
    padding: 40px 0 192px;
  }
  .cp-hero:has(.farm-hero) .cp-hero__inner {
    padding-inline: 24px;
  }
  .cp-hero:has(.farm-hero) .cp-hero__title {
    font-size: 44px;
  }
  .cp-hero:has(.farm-hero) .cp-hero__tagline {
    font-size: 16px;
  }
  .farm-world::after {
    background: linear-gradient(#0b141be6 0%, #0b141bb3 45%, #0b141b30 75%, transparent);
  }
}

body:has(.farm-hero) .cp-split__visual:has(img) {
  overflow: hidden;
  border: 1px solid #8e71364d;
  box-shadow: 6px 6px 0 #081419;
}

body:has(.farm-hero) .cp-split__visual img {
  display: block;
  width: 100%;
  height: auto;
}

body:has(.farm-hero) .cp-split__inner:has(img[src$='/context-workspace.svg']) {
  row-gap: 24px;
}

body:has(.farm-hero) .cp-split:has(img[src$='/context-workspace.svg']) .cp-split__copy {
  display: block;
}

body:has(.farm-hero) .cp-split:has(img[src$='/context-workspace.svg']) .cp-split__title {
  font-weight: 700;
}

body:has(.farm-hero) .cp-split:has(img[src$='/context-workspace.svg']) .cp-split__btn {
  justify-self: start;
}

@media (min-width: 881px) {
  body:has(.farm-hero) .cp-split__inner:has(img[src$='/context-workspace.svg']) {
    grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
  }
}

@media (max-width: 880px) {
  body:has(.farm-hero) .cp-split:has(img[src$='/context-workspace.svg']) {
    padding-block: 40px;
  }

  body:has(.farm-hero) .cp-split__inner:has(img[src$='/context-workspace.svg']) {
    row-gap: 16px;
  }
}

@media (max-width: 600px) {
  body:has(.farm-hero) img[src$='/context-workspace.svg'] {
    content: url('./context-workspace-mobile.svg');
    aspect-ratio: 340 / 490;
  }
}

body:has(.farm-hero) .cp-split__visual:has(img[src$='/context-sources.svg']),
body:has(.farm-hero) .cp-split__visual:has(img[src$='/context-workspace.svg']),
body:has(.farm-hero) .cp-split__visual:has(img[src$='/context-review.svg']) {
  position: relative;
  border: 0;
  border-radius: 0;
  box-shadow: none;
  background: transparent;
}

/* Image-embedded SVGs cannot load external SVGs; register the canonical icon to the diagram. */
body:has(.farm-hero) .cp-split__visual:has(img[src$='/context-sources.svg'])::after {
  content: '';
  position: absolute;
  left: 49.7368%;
  top: 30.9677%;
  width: 8.4211%;
  aspect-ratio: 1;
  background: url('./icon.svg') center / contain no-repeat;
  pointer-events: none;
}

body:has(.farm-hero) .cp-cta {
  position: relative;
  overflow: hidden;
  isolation: isolate;
  background: #0c1010;
  border-block: 1px solid #8e71364d;
  text-align: center;
  padding-block: clamp(64px, 8vw, 104px);
}

body:has(.farm-hero) .cp-cta::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background:
    linear-gradient(#0c1010bf, #0c1010db),
    url('./cta-wheat-field.webp') center / cover no-repeat;
  image-rendering: auto;
  opacity: 1;
  mask-image: linear-gradient(transparent, #000 14%, #000 86%, transparent);
}

body:has(.farm-hero) .cp-cta__inner {
  position: relative;
  max-width: 900px;
  margin-inline: auto;
}

body:has(.farm-hero) .cp-cta__title {
  max-width: 800px;
  margin-inline: auto;
  text-wrap: balance;
}

body:has(.farm-hero) .cp-cta__sub {
  margin-inline: auto;
  max-width: 580px;
  text-wrap: pretty;
}

body:has(.farm-hero) .cp-cta__row {
  justify-content: center;
  flex-wrap: wrap;
}

body:has(.farm-hero)
  .cp-feature-section:has(a[href='/packs/recommended/typescript'])
  .cp-feature-grid {
  gap: 32px;
  border: 0;
  border-radius: 0;
  background: transparent;
  overflow: visible;
}

body:has(.farm-hero)
  .cp-feature-section:has(a[href='/packs/recommended/typescript'])
  .cp-feature-grid__item {
  min-width: 0;
  overflow: hidden;
  border: 1px solid #3a4838;
  border-radius: 8px;
  background: #101918;
}

body:has(.farm-hero)
  .cp-feature-section:has(a[href='/packs/recommended/typescript'])
  .cp-feature-card {
  display: flex;
  flex-direction: column;
  gap: 10px;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  transform: none;
}

body:has(.farm-hero)
  .cp-feature-section:has(a[href='/packs/recommended/typescript'])
  .cp-card__icon {
  background: transparent;
  border: 0;
  border-radius: 0;
}

body:has(.farm-hero)
  .cp-feature-section:has(a[href='/packs/recommended/typescript'])
  .cp-feature-grid__item:hover,
body:has(.farm-hero)
  .cp-feature-section:has(a[href='/packs/recommended/typescript'])
  .cp-feature-grid__item:focus-within {
  background: #161d1a;
  border-color: #d6a252;
}

body:has(.farm-hero)
  .cp-feature-section:has(a[href='/packs/recommended/typescript'])
  .cp-feature-card:hover {
  text-decoration: none;
}

body:has(.farm-hero)
  .cp-feature-section:has(a[href='/packs/recommended/typescript'])
  .cp-feature-grid__item:focus-within {
  outline: 2px solid #d6a252;
  outline-offset: 4px;
}

@media (max-width: 880px) {
  body:has(.farm-hero)
    .cp-feature-section:has(a[href='/packs/recommended/typescript'])
    .cp-feature-grid {
    gap: 24px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .farm-hero *,
  .farm-hero *::before,
  .farm-hero *::after {
    animation: none !important;
    transition: none !important;
  }
  .farm-chaff,
  .farm-cut-swath {
    display: none;
  }
}
