.resonance-meditation {
  --resonance-gold: #e8c982;
  --resonance-pale: #f7e9c2;
  --resonance-cyan: #65eee7;
  position: relative;
  isolation: isolate;
  min-height: 1120px;
  overflow: hidden;
  padding: clamp(86px, 9vw, 138px) clamp(22px, 4vw, 68px) clamp(96px, 10vw, 154px);
  color: var(--resonance-pale);
  background:
    radial-gradient(circle at 50% 48%, rgba(24, 103, 101, .17), transparent 26%),
    radial-gradient(circle at 50% 48%, rgba(219, 179, 103, .08), transparent 49%),
    linear-gradient(180deg, #020405 0%, #071011 42%, #020405 100%);
  border-top: 1px solid rgba(232, 201, 130, .16);
}

.resonance-meditation::before,
.resonance-meditation::after {
  content: "";
  position: absolute;
  z-index: -2;
  inset: 0;
  pointer-events: none;
}

.resonance-meditation::before {
  opacity: .44;
  background-image:
    radial-gradient(circle, rgba(218, 244, 241, .52) 0 1px, transparent 1.4px),
    radial-gradient(circle, rgba(232, 201, 130, .36) 0 1px, transparent 1.5px);
  background-position: 0 0, 37px 61px;
  background-size: 91px 91px, 137px 137px;
  mask-image: linear-gradient(180deg, transparent, #000 13%, #000 86%, transparent);
}

.resonance-meditation::after {
  z-index: -1;
  background:
    linear-gradient(90deg, transparent 49.92%, rgba(101, 238, 231, .14) 50%, transparent 50.08%),
    linear-gradient(180deg, transparent 49.92%, rgba(232, 201, 130, .08) 50%, transparent 50.08%);
  opacity: .5;
}

.resonance-heading {
  position: relative;
  z-index: 8;
  width: min(900px, 100%);
  margin: 0 auto clamp(58px, 7vw, 92px);
  text-align: center;
}

.resonance-heading::after {
  content: "";
  display: block;
  width: min(420px, 58vw);
  height: 1px;
  margin: 24px auto 0;
  background: linear-gradient(90deg, transparent, rgba(101, 238, 231, .68), var(--resonance-pale), rgba(101, 238, 231, .68), transparent);
  box-shadow: 0 0 16px rgba(101, 238, 231, .35);
}

.resonance-kicker,
.resonance-note-kicker,
.resonance-signal-state {
  color: var(--resonance-cyan);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .2em;
  text-transform: uppercase;
}

.resonance-heading h2 {
  margin: 14px auto 0;
  color: var(--resonance-pale);
  font: 400 clamp(44px, 5.8vw, 84px)/.96 Georgia, "Times New Roman", serif;
  letter-spacing: 0;
  text-shadow: 0 8px 34px rgba(0, 0, 0, .86);
}

.resonance-stage {
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-columns: minmax(210px, 1fr) minmax(440px, 650px) minmax(210px, 1fr);
  gap: clamp(24px, 4vw, 74px);
  width: min(1500px, 100%);
  min-height: 820px;
  margin: 0 auto;
  align-items: center;
}

.resonance-wavefield {
  position: absolute;
  z-index: 0;
  top: 50%;
  left: 50%;
  width: min(1600px, 112vw);
  height: clamp(270px, 34vw, 470px);
  pointer-events: none;
  transform: translate(-50%, -50%);
  opacity: .86;
  filter: drop-shadow(0 0 8px rgba(101, 238, 231, .4));
}

.resonance-note {
  position: relative;
  z-index: 5;
  width: min(100%, 370px);
  padding: 30px clamp(22px, 3vw, 38px) 34px;
  overflow: hidden;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, .055), transparent 31%),
    linear-gradient(180deg, rgba(8, 17, 18, .91), rgba(2, 5, 6, .8));
  border: 1px solid rgba(232, 201, 130, .34);
  box-shadow:
    inset 0 0 0 1px rgba(101, 238, 231, .07),
    inset 0 18px 44px rgba(255, 255, 255, .02),
    0 24px 60px rgba(0, 0, 0, .44);
  backdrop-filter: blur(14px);
}

.resonance-note::before,
.resonance-note::after {
  content: "";
  position: absolute;
  width: 46px;
  height: 46px;
  pointer-events: none;
}

.resonance-note::before {
  top: 7px;
  left: 7px;
  border-top: 1px solid var(--resonance-gold);
  border-left: 1px solid var(--resonance-gold);
}

.resonance-note::after {
  right: 7px;
  bottom: 7px;
  border-right: 1px solid var(--resonance-gold);
  border-bottom: 1px solid var(--resonance-gold);
}

.resonance-note-left {
  justify-self: end;
  text-align: right;
}

.resonance-note-right {
  justify-self: start;
}

.resonance-note h3 {
  margin: 12px 0 14px;
  color: var(--resonance-pale);
  font: 400 clamp(27px, 2.3vw, 38px)/1 Georgia, "Times New Roman", serif;
  letter-spacing: 0;
}

.resonance-note p {
  margin: 0;
  color: rgba(237, 233, 219, .7);
  font-size: clamp(12px, 1vw, 14px);
  line-height: 1.7;
}

.resonance-note-index {
  display: block;
  margin-top: 22px;
  color: rgba(232, 201, 130, .46);
  font: 400 10px/1 Georgia, "Times New Roman", serif;
  letter-spacing: .18em;
}

.resonance-chamber-wrap {
  position: relative;
  z-index: 6;
  width: min(100%, 620px);
  aspect-ratio: 941 / 1672;
  margin: 0 auto;
}

.resonance-orbit {
  position: absolute;
  z-index: -1;
  top: 50%;
  left: 50%;
  width: 184%;
  aspect-ratio: 1;
  object-fit: contain;
  pointer-events: none;
  transform: translate(-50%, -50%);
  filter:
    saturate(.72)
    brightness(.74)
    drop-shadow(0 0 16px rgba(232, 201, 130, .17));
  opacity: .68;
  animation: resonanceOrbitTurn 68s linear infinite;
}

@keyframes resonanceOrbitTurn {
  to { transform: translate(-50%, -50%) rotate(360deg); }
}

.resonance-video-window {
  position: absolute;
  z-index: 2;
  top: 20.5%;
  right: 25.7%;
  bottom: 17%;
  left: 25.7%;
  overflow: hidden;
  background: #000;
  border-radius: 6% / 2.7%;
  box-shadow:
    inset 0 0 34px rgba(0, 0, 0, .82),
    0 0 30px rgba(101, 238, 231, .1);
}

.resonance-video-window::before,
.resonance-video-window::after {
  content: "";
  position: absolute;
  z-index: 3;
  inset: 0;
  pointer-events: none;
}

.resonance-video-window::before {
  background:
    linear-gradient(112deg, rgba(255, 255, 255, .14), transparent 15% 70%, rgba(101, 238, 231, .06)),
    radial-gradient(circle at 30% 12%, rgba(255, 255, 255, .14), transparent 14%);
  mix-blend-mode: screen;
}

.resonance-video-window::after {
  box-shadow: inset 0 0 42px rgba(0, 0, 0, .76);
}

.resonance-video-window video {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  object-position: center;
  filter: saturate(1.08) contrast(1.06) brightness(.98);
}

.resonance-frame {
  position: absolute;
  z-index: 5;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  pointer-events: none;
  filter:
    saturate(.92)
    contrast(1.06)
    drop-shadow(0 24px 46px rgba(0, 0, 0, .84))
    drop-shadow(0 0 12px rgba(232, 201, 130, .24));
  animation: resonanceFrameBreathe 5.8s ease-in-out infinite alternate;
}

@keyframes resonanceFrameBreathe {
  from {
    filter:
      saturate(.87)
      contrast(1.04)
      brightness(.92)
      drop-shadow(0 24px 46px rgba(0, 0, 0, .84))
      drop-shadow(0 0 7px rgba(232, 201, 130, .15));
  }
  to {
    filter:
      saturate(1)
      contrast(1.08)
      brightness(1.08)
      drop-shadow(0 24px 46px rgba(0, 0, 0, .84))
      drop-shadow(0 0 18px rgba(232, 201, 130, .34));
  }
}

.resonance-sound-toggle {
  position: absolute;
  z-index: 10;
  left: 50%;
  bottom: 6.6%;
  display: inline-flex;
  min-height: 38px;
  align-items: center;
  gap: 10px;
  padding: 9px 15px;
  color: var(--resonance-pale);
  background: rgba(2, 7, 8, .88);
  border: 1px solid rgba(232, 201, 130, .45);
  border-radius: 2px;
  box-shadow: 0 0 18px rgba(0, 0, 0, .72);
  transform: translateX(-50%);
  cursor: pointer;
  font-size: 9px;
  font-weight: 800;
  letter-spacing: .13em;
  text-transform: uppercase;
  white-space: nowrap;
}

.resonance-sound-toggle:hover,
.resonance-sound-toggle:focus-visible {
  color: #fff8df;
  border-color: rgba(232, 201, 130, .88);
  box-shadow: 0 0 22px rgba(232, 201, 130, .16);
  outline: none;
}

.resonance-sound-icon {
  position: relative;
  display: inline-block;
  width: 22px;
  height: 14px;
}

.resonance-sound-icon::before {
  content: "";
  position: absolute;
  top: 6px;
  left: 0;
  width: 22px;
  height: 2px;
  background: var(--resonance-cyan);
  box-shadow: 0 0 8px rgba(101, 238, 231, .7);
  clip-path: polygon(0 50%, 14% 50%, 22% 0, 32% 100%, 42% 24%, 52% 80%, 62% 9%, 74% 88%, 84% 50%, 100% 50%, 100% 100%, 0 100%);
  transform: scaleY(3.5);
}

.resonance-sound-toggle[aria-pressed="true"] .resonance-sound-icon {
  animation: resonanceSoundPulse .72s ease-in-out infinite alternate;
}

@keyframes resonanceSoundPulse {
  to { transform: scaleY(1.35); filter: brightness(1.4); }
}

.resonance-signal-state {
  position: absolute;
  z-index: 8;
  top: calc(50% + clamp(510px, 42vw, 555px));
  left: 50%;
  width: max-content;
  max-width: 90vw;
  padding: 8px 13px;
  background: rgba(1, 5, 6, .74);
  border: 1px solid rgba(101, 238, 231, .18);
  transform: translateX(-50%);
  color: rgba(101, 238, 231, .72);
  text-align: center;
}

@media (max-width: 1120px) {
  .resonance-meditation {
    min-height: 1060px;
  }

  .resonance-stage {
    grid-template-columns: minmax(180px, 1fr) minmax(360px, 500px) minmax(180px, 1fr);
    gap: 20px;
  }

  .resonance-note {
    padding-inline: 22px;
  }
}

@media (max-width: 840px) {
  .resonance-meditation {
    min-height: 0;
    padding-inline: 18px;
  }

  .resonance-stage {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 34px 14px;
    min-height: 0;
  }

  .resonance-chamber-wrap {
    grid-column: 1 / -1;
    grid-row: 1;
    width: min(82vw, 490px);
  }

  .resonance-note {
    grid-row: 2;
    width: 100%;
    align-self: stretch;
    text-align: left;
  }

  .resonance-note-left,
  .resonance-note-right {
    justify-self: stretch;
  }

  .resonance-wavefield {
    top: 34%;
  }

  .resonance-signal-state {
    top: calc(50% + min(70vw, 510px));
    transform: translateX(-50%);
  }
}

@media (max-width: 560px) {
  .resonance-meditation {
    padding: 78px 14px 92px;
  }

  .resonance-heading {
    margin-bottom: 44px;
  }

  .resonance-heading h2 {
    font-size: clamp(38px, 12vw, 56px);
  }

  .resonance-stage {
    display: flex;
    flex-direction: column;
    gap: 22px;
  }

  .resonance-chamber-wrap {
    order: 1;
    width: min(96vw, 470px);
  }

  .resonance-note {
    order: 2;
  }

  .resonance-note-right {
    order: 3;
  }

  .resonance-signal-state {
    position: relative;
    top: auto;
    left: auto;
    order: 4;
    width: 100%;
    transform: none;
  }

  .resonance-wavefield {
    top: min(116vw, 590px);
    width: 160vw;
  }

  .resonance-orbit {
    width: 146%;
  }
}

@media (prefers-reduced-motion: reduce) {
  .resonance-orbit,
  .resonance-frame,
  .resonance-sound-toggle[aria-pressed="true"] .resonance-sound-icon {
    animation: none;
  }
}
