/* Caminho dourado — missivas e revelações */

body.realm-medio {
  overflow-x: hidden;
  overflow-y: auto;
}

body[data-page="medio-gate"] {
  --observer: clamp(128px, 30vw, 196px);
}

body.realm-medio .stage {
  flex-direction: column;
  justify-content: center;
  gap: 0;
  min-height: 100svh;
  min-height: 100dvh;
  padding: clamp(2.4rem, 8vh, 4.5rem) 1.4rem 3.5rem;
}

body[data-page="medio-gate"] .observer--gold {
  opacity: 0;
  transition: opacity 2.6s var(--ease-out);
}

body[data-page="medio-gate"] .observer--gold.is-visible {
  opacity: 1;
}

.gate-copy {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  width: min(40rem, 92vw);
  margin-top: clamp(1.8rem, 5vh, 2.8rem);
  text-align: center;
}

.missive,
.whisper-line,
.revelation__line {
  font-family: "Cormorant Garamond", "Iowan Old Style", Palatino, Georgia, serif;
  font-weight: 300;
  color: var(--paper);
}

.missive {
  font-style: italic;
  font-size: clamp(1.2rem, 3.6vw, 1.85rem);
  line-height: 1.85;
  letter-spacing: 0.12em;
  max-width: 22em;
  opacity: 0;
  transform: translateY(12px);
  transition: opacity 2.2s var(--ease-out), transform 2.2s var(--ease-out);
}

.whisper-line {
  margin-top: 2.1rem;
  font-size: clamp(0.95rem, 2.4vw, 1.15rem);
  line-height: 1.75;
  letter-spacing: 0.08em;
  color: #c4b48a;
  max-width: 26em;
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 2s var(--ease-out), transform 2s var(--ease-out);
}

.whisper-line--soft {
  margin-top: 1.15rem;
  font-size: clamp(0.88rem, 2.1vw, 1.02rem);
  letter-spacing: 0.1em;
  color: #8f7e52;
}

.whisper-line.is-visible {
  opacity: 1;
  transform: none;
}

.late-hint {
  margin-top: 2.4rem;
  font-family: "Cormorant Garamond", "Iowan Old Style", Palatino, Georgia, serif;
  font-weight: 300;
  font-style: italic;
  font-size: clamp(0.88rem, 2.1vw, 1.02rem);
  line-height: 1.75;
  letter-spacing: 0.1em;
  color: #8f7e52;
  max-width: 24em;
  text-align: center;
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 2.4s var(--ease-out), transform 2.4s var(--ease-out);
}

.late-hint.is-visible {
  opacity: 0.78;
  transform: none;
}

.late-hint--spoil {
  margin-top: 1.15rem;
  color: #c9a227;
}

.late-hint--spoil.is-visible {
  opacity: 0.92;
}

.ghost-mark {
  position: fixed;
  left: 12%;
  bottom: 18%;
  width: 18px;
  height: 18px;
  z-index: 6;
  opacity: 0;
  pointer-events: none;
  color: #c9a227;
}

.ghost-mark.is-flash {
  animation: mark-flash 280ms ease-out;
}

/* ——— /caminhos ——— */

.octet {
  position: relative;
  z-index: 2;
  width: min(68vw, 380px);
  height: min(68vw, 380px);
  flex: 0 0 auto;
}

.sigil {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 48px;
  height: 48px;
  margin: -24px 0 0 -24px;
  color: #c9a227;
  opacity: 0;
  transform: rotate(calc(var(--i) * 45deg)) translateY(calc(-1 * var(--orbit, 154px))) rotate(calc(var(--i) * -45deg)) scale(0.84);
  transition: opacity 1.5s var(--ease-out), transform 1.6s var(--ease-out);
}

.sigil.is-visible {
  opacity: 0.86;
  transform: rotate(calc(var(--i) * 45deg)) translateY(calc(-1 * var(--orbit, 154px))) rotate(calc(var(--i) * -45deg)) scale(1);
}

.sigil svg {
  width: 100%;
  height: 100%;
  overflow: visible;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: miter;
  filter: drop-shadow(0 0 7px rgba(201, 162, 39, 0.28));
}

.revelation {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  width: min(36rem, 90vw);
  margin-top: clamp(1.6rem, 5vh, 2.6rem);
  min-height: 13.5rem;
  text-align: center;
}

.revelation__line {
  font-style: italic;
  font-size: clamp(1.05rem, 2.8vw, 1.4rem);
  line-height: 1.7;
  letter-spacing: 0.1em;
  color: #d8d3c6;
  max-width: 24em;
  margin-top: 1.15rem;
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 1.8s var(--ease-out), transform 1.8s var(--ease-out);
}

.revelation__line:first-child {
  margin-top: 0;
}

.revelation__line.is-visible {
  opacity: 0.88;
  transform: none;
}

.revelation__line--coda {
  margin-top: 2rem;
  font-style: italic;
  font-size: clamp(0.95rem, 2.4vw, 1.15rem);
  letter-spacing: 0.12em;
  color: #c9a227;
}

.revelation__line--coda.is-visible {
  opacity: 0.9;
}

.inscription {
  margin-top: 1.35rem;
  font-family: "Cormorant Garamond", "Iowan Old Style", Palatino, Georgia, serif;
  font-weight: 300;
  font-style: italic;
  font-size: clamp(0.95rem, 2.4vw, 1.15rem);
  line-height: 1.7;
  letter-spacing: 0.14em;
  color: #c9a227;
  text-decoration: underline;
  text-underline-offset: 0.28em;
  text-decoration-thickness: 1px;
  opacity: 0;
  transform: translateY(8px);
  pointer-events: none;
  transition: opacity 2s var(--ease-out), transform 2s var(--ease-out), color 0.4s ease;
}

.inscription.is-visible {
  opacity: 0.92;
  transform: none;
  pointer-events: auto;
}

.inscription:hover,
.inscription:focus-visible {
  color: #e8c547;
}

.index-mark {
  position: fixed;
  right: clamp(1rem, 4vw, 2.2rem);
  bottom: clamp(1rem, 4vh, 2rem);
  z-index: 6;
  font-family: "IBM Plex Mono", Consolas, monospace;
  font-size: 10px;
  letter-spacing: 0.32em;
  color: #5c4a22;
  opacity: 0;
  transition: opacity 2.2s var(--ease-out);
  user-select: none;
  pointer-events: none;
}

.index-mark.is-visible {
  opacity: 0.7;
}

@keyframes mark-flash {
  0% {
    opacity: 0;
  }
  30% {
    opacity: 0.45;
  }
  100% {
    opacity: 0;
  }
}

@media (max-width: 720px) {
  .sigil {
    --orbit: 118px;
    width: 36px;
    height: 36px;
    margin: -18px 0 0 -18px;
  }

  .octet {
    width: min(78vw, 300px);
    height: min(78vw, 300px);
  }

  .revelation {
    min-height: 12.5rem;
  }

  .missive {
    letter-spacing: 0.07em;
  }
}

@media (max-height: 700px) {
  body[data-page="medio-gate"] {
    --observer: clamp(110px, 22vh, 160px);
  }

  .gate-copy {
    margin-top: 1.2rem;
  }

  .whisper-line {
    margin-top: 1.3rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  .missive,
  .whisper-line,
  .revelation__line,
  .sigil,
  .index-mark,
  body[data-page="medio-gate"] .observer--gold {
    opacity: 1;
    transform: none;
    transition: none;
  }

  .sigil {
    transform: rotate(calc(var(--i) * 45deg)) translateY(calc(-1 * var(--orbit, 154px))) rotate(calc(var(--i) * -45deg));
  }
}
