.automation-showcase {
  scroll-margin-top: 100px;
}

.automation-showcase .section-head {
  margin-bottom: 24px;
}

.automation-book {
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 28px;
  background: #d8ded0;
  box-shadow: 0 5px 0 #c7cbb8, 0 19px 35px #0f1f1714;
}

.automation-book [hidden] {
  display: none;
}

.automation-showcase[data-ready] .automation-book {
  display: grid;
  grid-template-columns: minmax(210px, 0.36fr) minmax(0, 1fr);
  gap: 5px;
}

.automation-index {
  padding: 16px;
  border-radius: 17px 5px 5px 17px;
  background: #f0f0e6;
}

.automation-tab {
  display: flex;
  width: 100%;
  min-height: 48px;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 10px 12px;
  border: 1px solid transparent;
  border-radius: 9px;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-size: 13px;
  font-weight: 800;
  line-height: 1.3;
  text-align: left;
  cursor: pointer;
}

.automation-tab:hover {
  background: #e1e6d8;
}

.automation-tab[aria-selected="true"] {
  background: var(--ink);
  color: var(--white);
}

.automation-tab:focus-visible,
.automation-page:focus-visible,
.automation-actions a:focus-visible {
  outline: 2px solid var(--blue);
  outline-offset: 3px;
}

.automation-page {
  margin: 0 0 12px;
  padding: clamp(16px, 3vw, 32px);
  border-radius: 5px 17px 17px 5px;
  background: var(--white);
  box-shadow: inset 8px 0 16px -12px #0f1f1773;
}

.automation-page:last-child,
.automation-showcase[data-ready] .automation-page {
  margin-bottom: 0;
}

.automation-fallback-picture {
  display: block;
  width: 100%;
  max-height: 345px;
  border-radius: 9px;
  background: #191919;
  object-fit: contain;
}

.automation-showcase[data-ready] .automation-fallback-picture {
  display: none;
}

.automation-scene {
  position: relative;
  overflow: hidden;
  height: clamp(340px, 43vw, 470px);
  border-radius: 5px 17px 0 0;
  background:
    radial-gradient(ellipse at 24% 0%, #ffd1a256, transparent 68%),
    repeating-linear-gradient(-13deg, #442a1729 0 1px, transparent 1px 5px, #f6c89512 6px 7px, transparent 7px 16px),
    linear-gradient(144deg, #996741, #6f492f 54%, #40291f);
  perspective: 1100px;
  perspective-origin: 49% 44%;
}

.automation-volume {
  position: absolute;
  top: 54%;
  left: 49%;
  width: min(78%, 670px);
  aspect-ratio: 1.85;
  transform: translate(-50%, -50%) rotateX(48deg) rotateZ(-11deg);
  transform-style: preserve-3d;
}

.automation-cover {
  position: absolute;
  inset: -2% -1.8% -3%;
  border: 2px solid #242b23;
  border-radius: 16px;
  background: #354437;
  box-shadow: 0 19px 29px #20140991, 0 4px 4px #28170eab;
  transform: translateZ(-7px);
}

.automation-left-sheet,
.automation-right-sheet,
.automation-leaf {
  position: absolute;
  inset: 0 auto 0 50%;
  width: 50%;
  transform-style: preserve-3d;
}

.automation-left-sheet {
  left: 0;
  border-radius: 13px 1px 1px 9px;
  background: linear-gradient(90deg, #e9d9b9, #fbefd8 9% 79%, #e5d0ad 97%, #ad9673);
  box-shadow: -2px 2px #deccaa, -3px 4px #a99474, -4px 6px #e1cbab;
}

.automation-right-sheet,
.automation-leaf-front {
  border-radius: 1px 13px 9px 1px;
  background: linear-gradient(90deg, #bda583, #f4e5c8 7%, #faf0da 22% 89%, #e9d8b7);
}

.automation-right-sheet {
  box-shadow: 2px 2px #dcceaf, 3px 4px #a99474, 4px 6px #e1cbab;
}

.automation-book-caption {
  position: absolute;
  inset: 17% 12% 18%;
  padding: 8% 4%;
  border-block: 1px solid #806d5085;
  color: #5d503f;
}

.automation-book-caption span {
  display: block;
  margin-bottom: 8%;
  font: 800 clamp(10px, 1.4vw, 17px)/1 Manrope, Arial, sans-serif;
}

.automation-book-caption strong {
  display: block;
  font: 700 clamp(13px, 2.6vw, 32px)/1.05 Georgia, serif;
  text-wrap: balance;
}

.automation-print,
.automation-pop {
  position: absolute;
  inset: auto 7% 16% 9%;
  width: 84%;
  aspect-ratio: 1.68;
  padding: 2px;
  border-radius: 4px;
  object-fit: contain;
}

.automation-print {
  background: #2b2925;
  opacity: .7;
}

.automation-pop {
  --book-popup-open: translateZ(5px) rotateX(-57deg) scale(1.14);
  --book-popup-folded: translateZ(2px) rotateX(0deg) scale(1);
  border: 1px solid #302e29;
  background: #191919;
  box-shadow: 0 5px 12px #38261975;
  transform: var(--book-popup-open);
  transform-origin: center bottom;
}

.automation-leaf {
  transform-origin: left center;
}

.automation-leaf-front,
.automation-leaf-back {
  position: absolute;
  inset: 0;
  backface-visibility: hidden;
}

.automation-leaf-back {
  border-radius: 13px 1px 1px 9px;
  background: linear-gradient(90deg, #e9d8ba, #fff4df 17% 82%, #dfcda9);
  transform: rotateY(180deg);
}

.automation-book-controls {
  position: absolute;
  right: 12px;
  bottom: 12px;
  display: flex;
  gap: 6px;
}

.automation-book-controls button {
  min-width: 44px;
  min-height: 44px;
  border: 1px solid #e5d1b3;
  border-radius: 50%;
  background: #322418;
  color: #fff3df;
  font: 700 20px/1 Manrope, Arial, sans-serif;
  cursor: pointer;
}

.automation-book-controls button:hover {
  background: #624631;
}

.automation-book-controls button:focus-visible {
  outline: 2px solid #fff3df;
  outline-offset: 3px;
}

.automation-showcase[data-ready] .automation-page {
  border-radius: 0 0 17px 5px;
}

.automation-showcase[data-ready] .automation-description {
  margin-top: 0;
}

.automation-description {
  margin-top: 22px;
}

.automation-description h3 {
  margin: 0 0 7px;
  font: 700 clamp(23px, 3vw, 34px)/1.06 "Space Grotesk", Manrope, sans-serif;
  letter-spacing: -.04em;
}

.automation-description p {
  max-width: 65ch;
  margin: 0;
  color: var(--muted);
}

.automation-actions {
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}

.automation-actions a {
  font-size: 13px;
  font-weight: 800;
}

@media (max-width: 720px) {
  .automation-showcase[data-ready] .automation-book {
    grid-template-columns: minmax(0, 1fr);
  }

  .automation-book {
    padding: 7px;
    border-radius: 21px;
  }

  .automation-index {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 4px;
    padding: 7px;
    border-radius: 14px 14px 4px 4px;
  }

  .automation-page {
    border-radius: 4px 4px 14px 14px;
  }

  .automation-scene {
    height: clamp(255px, 71vw, 405px);
    border-radius: 4px 4px 0 0;
    perspective: 700px;
  }

  .automation-volume {
    top: 53%;
    left: 48%;
    width: 88%;
    aspect-ratio: 1.65;
  }

  .automation-book-controls {
    right: 9px;
    bottom: 9px;
  }

  .automation-showcase[data-ready] .automation-page {
    border-radius: 0 0 14px 14px;
  }

  .automation-description {
    margin-top: 16px;
  }
}
