.source-worlds {
  position: relative;
  min-height: 118vh;
  overflow: hidden;
  padding: clamp(86px, 10vw, 150px) 0 clamp(66px, 8vw, 118px);
  color: #f8ebca;
  background:
    linear-gradient(90deg, rgba(24, 68, 64, .16), transparent 30%, transparent 70%, rgba(90, 33, 38, .12)),
    #020405;
  border-top: 1px solid rgba(230, 191, 115, .22);
  isolation: isolate;
}

.source-worlds::before {
  content: "";
  position: absolute;
  z-index: 0;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(90deg, transparent 9.9%, rgba(103, 238, 232, .08) 10%, transparent 10.1%, transparent 89.9%, rgba(230, 191, 115, .08) 90%, transparent 90.1%),
    repeating-linear-gradient(90deg, transparent 0 8.2%, rgba(248, 235, 202, .025) 8.3%, transparent 8.4%);
  opacity: .9;
}

.source-worlds-head {
  position: relative;
  z-index: 5;
  width: min(1040px, calc(100% - 44px));
  margin: 0 auto clamp(48px, 7vw, 96px);
  text-align: center;
}

.source-worlds-kicker {
  color: #67eee8;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .22em;
  text-transform: uppercase;
}

.source-worlds-head h2 {
  max-width: 960px;
  margin: 14px auto 0;
  padding: .04em .06em .16em;
  overflow: visible;
  color: #f8ebca;
  font: 400 clamp(44px, 6vw, 92px)/1.04 Georgia, "Times New Roman", serif;
  letter-spacing: 0;
  text-shadow: 0 8px 36px rgba(0, 0, 0, .72);
}

.source-worlds-stage {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(8px, 1.4vw, 24px);
  width: min(1760px, 96vw);
  min-height: clamp(640px, 82vh, 1040px);
  margin-inline: auto;
  align-items: stretch;
  padding: clamp(18px, 2.4vw, 38px);
  overflow: hidden;
  background:
    radial-gradient(circle at 50% 50%, rgba(19, 66, 75, .34), transparent 46%),
    linear-gradient(180deg, rgba(7, 15, 16, .94), rgba(1, 2, 3, .86)),
    #010203;
  border: 1px solid rgba(230, 191, 115, .28);
  box-shadow:
    0 42px 110px rgba(0, 0, 0, .72),
    inset 0 0 0 1px rgba(103, 238, 232, .08),
    inset 0 0 90px rgba(0, 0, 0, .82);
  perspective: 1700px;
}

.source-worlds-starfield {
  position: absolute;
  z-index: 0;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  pointer-events: none;
  opacity: .92;
}

.source-worlds-stage::after {
  content: "";
  position: absolute;
  z-index: -1;
  left: 10%;
  right: 10%;
  bottom: -8%;
  height: 17%;
  border: 1px solid rgba(230, 191, 115, .36);
  border-radius: 50%;
  transform: rotateX(70deg);
  box-shadow:
    0 0 0 18px rgba(103, 238, 232, .04),
    0 0 0 36px rgba(230, 191, 115, .035),
    0 0 52px rgba(103, 238, 232, .16);
}

.source-book {
  position: relative;
  min-width: 0;
  overflow: hidden;
  background: #010203;
  border: 1px solid rgba(230, 191, 115, .5);
  box-shadow:
    0 18px 38px rgba(0, 0, 0, .58),
    inset 0 0 0 1px rgba(103, 238, 232, .18),
    inset 0 0 46px rgba(0, 0, 0, .62),
    0 0 22px rgba(103, 238, 232, .08);
  transform-style: preserve-3d;
}

.source-book::before {
  content: "";
  position: absolute;
  z-index: 6;
  inset: clamp(8px, .9vw, 14px);
  pointer-events: none;
  border: 1px solid rgba(248, 235, 202, .32);
  box-shadow:
    inset 0 0 0 1px rgba(103, 238, 232, .12),
    inset 0 0 22px rgba(103, 238, 232, .12),
    0 0 12px rgba(230, 191, 115, .12);
}

.source-book::after {
  content: "";
  position: absolute;
  z-index: 7;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, .16), transparent 13% 84%, rgba(103, 238, 232, .1)),
    linear-gradient(90deg, #e6bf73 0 36px, transparent 36px calc(100% - 36px), #e6bf73 calc(100% - 36px)) top / 100% 1px no-repeat,
    linear-gradient(90deg, #67eee8 0 36px, transparent 36px calc(100% - 36px), #67eee8 calc(100% - 36px)) bottom / 100% 1px no-repeat,
    linear-gradient(180deg, #e6bf73 0 36px, transparent 36px calc(100% - 36px), #67eee8 calc(100% - 36px)) left / 1px 100% no-repeat,
    linear-gradient(180deg, #67eee8 0 36px, transparent 36px calc(100% - 36px), #e6bf73 calc(100% - 36px)) right / 1px 100% no-repeat;
  opacity: .78;
}

.source-worlds-frequency {
  z-index: 1;
  position: absolute;
  top: clamp(10px, 1.5vw, 24px);
  right: 33.333%;
  bottom: clamp(10px, 1.5vw, 24px);
  left: 33.333%;
  min-width: 0;
  overflow: visible;
  pointer-events: none;
  background: transparent;
  transform: translateZ(-40px) scale(.985);
}

.source-worlds-frequency video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  object-fit: contain;
  object-position: center;
  filter: saturate(1.1) contrast(1.1) brightness(.82);
}

.source-worlds-transmission {
  z-index: 1;
  opacity: 0;
  visibility: hidden;
  transform: scale(1.025);
  transition: opacity 1s ease, visibility 1s, transform 8s ease-out;
}

.source-worlds-transmission.is-active {
  opacity: 1;
  visibility: visible;
  transform: scale(1);
}

/* The original landscape transmission keeps its wide center presence;
   the later vertical transmissions stay contained in the middle slot. */
.source-worlds-transmission[data-source-transmission="0"] {
  top: 50%;
  left: 50%;
  width: 320%;
  height: auto;
  aspect-ratio: 16 / 9;
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 5%, #000 95%, transparent);
  mask-image: linear-gradient(90deg, transparent, #000 5%, #000 95%, transparent);
  transform: translate(-50%, -50%) scale(1.025);
}

.source-worlds-transmission[data-source-transmission="0"].is-active {
  transform: translate(-50%, -50%) scale(1);
}

.source-worlds-frequency-veil {
  display: none;
  position: absolute;
  z-index: 3;
  inset: 0;
  background:
    radial-gradient(circle at 50% 48%, transparent 22%, rgba(1, 2, 3, .26) 76%),
    linear-gradient(90deg, rgba(1, 2, 3, .7), transparent 25%, transparent 75%, rgba(1, 2, 3, .7)),
    linear-gradient(180deg, rgba(1, 2, 3, .2), transparent 34%, rgba(1, 2, 3, .5));
}

.source-worlds-transmission-count {
  position: absolute;
  z-index: 8;
  right: 50%;
  bottom: clamp(18px, 2vw, 30px);
  padding: 8px 10px;
  color: #f8ebca;
  background: rgba(1, 3, 4, .72);
  border: 0;
  font: 700 9px/1 Arial, sans-serif;
  letter-spacing: .12em;
  transform: translateX(50%);
}

.source-book {
  z-index: 3;
  grid-row: 1;
  margin: 0;
  display: grid;
  place-items: center;
  padding: clamp(16px, 2vw, 34px);
  transition:
    transform 900ms cubic-bezier(.18, .74, .2, 1),
    box-shadow 650ms ease;
}

.source-book-utai {
  grid-column: 1;
  transform: rotateY(3deg);
  transform-origin: right center;
}

.source-book-aberrations {
  grid-column: 3;
  transform: rotateY(-3deg);
  transform-origin: left center;
}

.source-book img {
  position: relative;
  z-index: 2;
  width: 100%;
  height: 100%;
  display: block;
  object-fit: contain;
  filter: saturate(.94) brightness(.86) contrast(1.08);
  transform: scale(.965);
  transition:
    transform 900ms cubic-bezier(.18, .74, .2, 1),
    filter 650ms ease;
  will-change: transform, filter;
}

.source-book:hover,
.source-book:focus-within {
  z-index: 8;
  transform: translateZ(24px) rotateY(0deg);
  box-shadow:
    0 28px 64px rgba(0, 0, 0, .68),
    inset 0 0 0 1px rgba(103, 238, 232, .26),
    inset 0 0 54px rgba(0, 0, 0, .54),
    0 0 34px rgba(230, 191, 115, .2);
}

.source-book:hover img,
.source-book:focus-within img {
  transform: scale(1.025);
  filter: saturate(1.1) brightness(1.12) contrast(1.04);
}

.source-book:hover::after {
  opacity: 1;
}

.source-book-open {
  position: absolute;
  z-index: 10;
  left: 50%;
  bottom: clamp(22px, 3vw, 46px);
  width: max-content;
  max-width: calc(100% - 44px);
  padding: 11px 18px 10px;
  transform: translateX(-50%);
  border: 1px solid rgba(230, 191, 115, .62);
  color: #fff2cf;
  background: rgba(1, 6, 7, .78);
  box-shadow:
    0 12px 28px rgba(0, 0, 0, .5),
    inset 0 0 18px rgba(103, 238, 232, .08),
    0 0 18px rgba(230, 191, 115, .08);
  backdrop-filter: blur(12px);
  font: 700 9px/1 Arial, sans-serif;
  letter-spacing: .16em;
  text-transform: uppercase;
  cursor: pointer;
  transition: color 220ms ease, border-color 220ms ease, background 220ms ease, transform 220ms ease;
}

.source-book-open:hover,
.source-book-open:focus-visible {
  color: #061314;
  border-color: #67eee8;
  background: #e8c679;
  transform: translateX(-50%) translateY(-2px);
  outline: 0;
}

.source-book-dialog {
  width: min(720px, calc(100vw - 34px));
  max-width: none;
  margin: auto;
  padding: 0;
  overflow: visible;
  border: 0;
  color: #f8ebca;
  background: transparent;
  cursor: auto !important;
}

.source-book-dialog::backdrop {
  background:
    radial-gradient(circle at 50% 48%, rgba(28, 90, 91, .09), transparent 50%),
    rgba(0, 0, 0, .16);
  backdrop-filter: none;
}

.source-book-dialog,
.source-book-dialog * {
  cursor: auto !important;
}

.source-book-dialog-glass {
  position: relative;
  padding: clamp(42px, 6vw, 72px);
  overflow: hidden;
  border: 1px solid rgba(230, 191, 115, .66);
  background:
    linear-gradient(135deg, rgba(255, 255, 255, .08), transparent 22% 75%, rgba(103, 238, 232, .08)),
    radial-gradient(circle at 85% 12%, rgba(103, 238, 232, .14), transparent 31%),
    rgba(3, 9, 10, .94);
  box-shadow:
    0 32px 90px rgba(0, 0, 0, .58),
    inset 0 0 0 8px rgba(2, 6, 7, .74),
    inset 0 0 0 9px rgba(103, 238, 232, .14),
    inset 0 0 80px rgba(0, 0, 0, .62),
    0 0 50px rgba(103, 238, 232, .12);
}

.source-book-dialog-glass::before,
.source-book-dialog-glass::after {
  content: "";
  position: absolute;
  pointer-events: none;
}

.source-book-dialog-glass::before {
  inset: 18px;
  border: 1px solid rgba(248, 235, 202, .2);
}

.source-book-dialog-glass::after {
  width: 190px;
  height: 1px;
  right: 28px;
  bottom: 32px;
  background: linear-gradient(90deg, transparent, #67eee8, #e6bf73);
  box-shadow: 0 0 20px rgba(103, 238, 232, .5);
}

.source-book-dialog-code {
  display: block;
  color: #67eee8;
  font: 700 10px/1.3 Arial, sans-serif;
  letter-spacing: .2em;
  text-transform: uppercase;
}

.source-book-dialog h3 {
  max-width: 600px;
  margin: 14px 0 20px;
  color: #fff0c8;
  font: 400 clamp(38px, 6vw, 68px)/.98 Georgia, "Times New Roman", serif;
  letter-spacing: 0;
}

.source-book-dialog p {
  max-width: 58ch;
  margin: 0;
  color: rgba(242, 239, 225, .76);
  font: 400 clamp(14px, 1.25vw, 17px)/1.75 Arial, sans-serif;
}

.source-book-enter {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  margin-top: 30px;
  padding: 0 22px;
  border: 1px solid rgba(230, 191, 115, .72);
  color: #081011;
  background: linear-gradient(135deg, #f7dc9a, #d3a552);
  box-shadow: 0 10px 28px rgba(0, 0, 0, .42), 0 0 20px rgba(230, 191, 115, .12);
  font: 800 10px/1 Arial, sans-serif;
  letter-spacing: .16em;
  text-decoration: none;
  text-transform: uppercase;
  cursor: pointer !important;
}

.source-book-dialog-close {
  position: absolute;
  z-index: 12;
  top: 16px;
  right: 16px;
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  padding: 0;
  border: 1px solid rgba(230, 191, 115, .5);
  border-radius: 50%;
  color: #fff3d2;
  background: rgba(0, 0, 0, .6);
  font: 300 28px/1 Arial, sans-serif;
  cursor: pointer !important;
}

@media (max-width: 780px) {
  .source-worlds {
    min-height: auto;
    padding: 88px 0 72px;
  }

  .source-worlds-head {
    width: calc(100% - 36px);
    margin-bottom: 46px;
  }

  .source-worlds-head h2 {
    font-size: clamp(40px, 12vw, 58px);
    line-height: 1.08;
  }

  .source-worlds-stage {
    grid-template-columns: minmax(0, 1fr) minmax(96px, .82fr) minmax(0, 1fr);
    gap: 5px;
    width: calc(100% - 16px);
    min-height: clamp(390px, 105vw, 580px);
    padding: 8px;
  }

  .source-worlds-frequency {
    top: 8px;
    right: 33.333%;
    bottom: 8px;
    left: 33.333%;
  }

  .source-book {
    padding: 8px;
  }

  .source-book-open {
    bottom: 12px;
    max-width: calc(100% - 18px);
    padding: 9px 8px 8px;
    font-size: 7px;
    letter-spacing: .08em;
  }

  .source-book::before {
    inset: 4px;
  }

  .source-book-utai,
  .source-book-aberrations {
    transform: none;
  }

  .source-book img {
    transform: scale(.96);
  }

  .source-book:hover img,
  .source-book:focus-within img {
    transform: scale(1.015);
  }

  .source-book-dialog-glass {
    padding: 52px 30px 38px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .source-book,
  .source-book img {
    transition-duration: .001ms;
  }
}
