/* The Trivium section: three cards, one question. Tokens come from landing.css. */
.oracle-section {
  padding: 110px 0 90px;
  position: relative;
  background:
    radial-gradient(ellipse at 70% 30%, #3a2c1a2e, transparent 55%),
    linear-gradient(#080b1580, #0b0f1acc 60%, #080c1780);
  border-bottom: 1px solid #7d8daa22;
}
.oracle-heading {
  text-align: center;
  margin-bottom: 44px;
}
.oracle-heading h2 {
  font-size: clamp(44px, 5vw, 68px);
  margin-bottom: 16px;
}
.oracle-topics {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 18px;
}
.oracle-topics button {
  background: transparent;
  border: 1px solid #6e7c9633;
  padding: 8px 20px;
  border-radius: 30px;
  color: #929eaf;
  font-size: 15px;
  transition: color 0.2s, border-color 0.2s, background 0.2s;
}
.oracle-topics button[aria-checked="true"] {
  color: #e1e5ef;
  border-color: #c5b18373;
  background: #51638121;
}
.oracle-topics button:disabled {
  cursor: default;
  opacity: 0.55;
}
.oracle-cosmic {
  text-align: center;
  font-family: var(--display);
  font-size: 13px;
  letter-spacing: 0.08em;
  color: #c5b183;
  min-height: 1.6em;
  margin-bottom: 36px;
}
.oracle-cards {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 36px;
  align-items: start;
}
.oracle-slot {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}
.oracle-position {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-bottom: 18px;
  min-height: 3.6em;
}
.oracle-position span {
  font-family: var(--display);
  font-size: 13px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--gold-light);
}
.oracle-position small {
  font-size: 13px;
  color: #8f99ab;
  max-width: 24ch;
}

/* --- the card ------------------------------------------------------ */
.oracle-card {
  --card-w: clamp(120px, 22vw, 190px);
  width: var(--card-w);
  aspect-ratio: 600 / 1033;
  background: none;
  border: 0;
  padding: 0;
  perspective: 1200px;
  border-radius: 4%;
  transition: transform 0.35s;
}
.oracle-card:not(.flipped):hover {
  transform: translateY(-6px);
}
.oracle-card:focus-visible {
  outline-offset: 8px;
}
.card-inner {
  position: relative;
  display: block;
  width: 100%;
  height: 100%;
  transform-style: preserve-3d;
  transition: transform 0.7s cubic-bezier(0.4, 0.1, 0.2, 1);
}
.oracle-card.flipped .card-inner {
  transform: rotateY(180deg);
}
.card-back,
.card-face {
  position: absolute;
  inset: 0;
  display: block;
  border-radius: 4%;
  overflow: hidden;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  background: rgba(12, 12, 20, 0.96);
  box-shadow: 0 0 0 1px #d4a94466, 0 18px 40px #00000080;
}
.oracle-card:not(.flipped):hover .card-back {
  box-shadow: 0 0 0 1px #d4a944e6, 0 22px 44px #00000099;
}
.card-back svg {
  width: 100%;
  height: 100%;
  display: block;
}
.card-face {
  transform: rotateY(180deg);
}
.card-face img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  opacity: 0;
  transition: opacity 0.5s;
}
.oracle-card.loaded .card-face img {
  opacity: 1;
}
.oracle-card.reversed .card-face img {
  transform: rotate(180deg);
}
.card-facename {
  position: absolute;
  inset: auto 8% 10%;
  font-family: var(--serif);
  font-size: 15px;
  color: var(--gold-light);
  pointer-events: none;
  transition: opacity 0.5s;
}
.oracle-card.loaded .card-facename {
  opacity: 0;
}

/* --- meanings ------------------------------------------------------ */
.oracle-meaning {
  margin-top: 22px;
  max-width: 30ch;
  opacity: 0;
  transition: opacity 0.6s 0.4s;
}
.oracle-section.dealt .oracle-meaning {
  min-height: 11em;
}
.oracle-card.flipped + .oracle-meaning {
  opacity: 1;
}
.oracle-meaning h3 {
  font-family: var(--serif);
  font-size: 24px;
  color: var(--ivory);
  margin-bottom: 4px;
}
.oracle-corr {
  font-family: var(--display);
  font-size: 12px;
  letter-spacing: 0.12em;
  color: #c5b183;
  margin-bottom: 10px;
}
.oracle-text {
  font-size: 15px;
  line-height: 1.6;
}

/* --- the veiled reading ------------------------------------------- */
.oracle-reading {
  margin: 56px auto 0;
  max-width: 560px;
  text-align: center;
  padding-top: 34px;
  border-top: 1px solid var(--line);
  animation: oracle-rise 0.8s ease-out both;
}
.oracle-veil {
  display: flex;
  flex-direction: column;
  gap: 10px;
  align-items: center;
  margin-bottom: 26px;
}
.oracle-veil i {
  display: block;
  height: 9px;
  border-radius: 5px;
  background: linear-gradient(90deg, #f2ecdf40, #f2ecdf20);
  filter: blur(6px);
}
.oracle-veil i:nth-child(1) { width: 78%; }
.oracle-veil i:nth-child(2) { width: 92%; }
.oracle-veil i:nth-child(3) { width: 84%; }
.oracle-veil i:nth-child(4) { width: 46%; }
.oracle-reading .section-name {
  margin-bottom: 14px;
}
.oracle-reading-lede {
  font-family: var(--serif);
  font-size: 26px;
  line-height: 1.25;
  color: var(--ivory);
  margin-bottom: 12px;
}
.oracle-reading > p:not(.section-name):not(.oracle-reading-lede) {
  max-width: 46ch;
  margin: 0 auto 26px;
}
.oracle-reading form {
  max-width: 460px;
  margin: 0 auto;
}
.oracle-reading .signup-result {
  margin-bottom: 20px;
}
#oracle-return {
  margin-top: 26px;
}
.oracle-footnote {
  margin: 40px auto 0;
  text-align: center;
  max-width: 60ch;
}
@keyframes oracle-rise {
  from { opacity: 0; transform: translateY(14px); }
  to { opacity: 1; transform: none; }
}

/* --- responsive ---------------------------------------------------- */
@media (max-width: 899px) {
  .oracle-meaning {
    max-width: 34ch;
  }
}
@media (max-width: 599px) {
  .oracle-cards {
    grid-template-columns: 1fr;
    gap: 44px;
  }
  .oracle-card {
    --card-w: min(60vw, 210px);
  }
  .oracle-section.dealt .oracle-meaning {
    min-height: 0;
  }
  .oracle-reading-lede {
    font-size: 22px;
  }
}

/* --- motion -------------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  .card-inner,
  .oracle-card,
  .card-face img,
  .card-facename,
  .oracle-meaning,
  .oracle-topics button {
    transition: none;
  }
  .oracle-reading {
    animation: none;
  }
  .oracle-card:not(.flipped):hover {
    transform: none;
  }
}
body.motion-paused .card-inner,
body.motion-paused .oracle-card,
body.motion-paused .card-face img,
body.motion-paused .card-facename,
body.motion-paused .oracle-meaning,
body.motion-paused .oracle-topics button {
  transition: none;
}
body.motion-paused .oracle-reading {
  animation: none;
}
body.motion-paused .oracle-card:not(.flipped):hover {
  transform: none;
}
