/* BKS-SAGE-TAROT-EXPERIENCE-V1
 * An additive visual layer. Existing art, deck, reading engine, positions remain.
 */
.sage-tarot-sr-only {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  overflow: hidden !important;
  clip-path: inset(50%) !important;
  white-space: nowrap !important;
}

.sage-tarot-guide-system {
  position: fixed;
  top: 13px;
  left: clamp(160px, 18vw, 270px);
  right: clamp(14px, 4vw, 64px);
  z-index: 90;
  pointer-events: none;
}

.sage-tarot-guide-controls {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  align-items: stretch;
  justify-content: center;
  gap: 9px;
  width: min(850px, 100%);
  margin: 0 auto;
  pointer-events: auto;
}

.sage-tarot-guide-button {
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 0;
  min-height: 36px;
  padding: 7px 9px;
  border: 1px solid rgba(229, 183, 85, .53);
  border-radius: 999px;
  background: linear-gradient(120deg, rgba(26, 10, 32, .89), rgba(9, 4, 18, .94));
  color: #f4dcab;
  font: 700 clamp(9px, .75vw, 11px)/1.15 Arial, sans-serif;
  letter-spacing: .045em;
  text-align: center;
  text-transform: uppercase;
  cursor: pointer;
  box-shadow: 0 5px 16px rgba(0, 0, 0, .37), inset 0 1px rgba(255,255,255,.06);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  transition: border-color .22s ease, background .22s ease, box-shadow .22s ease;
}

.sage-tarot-guide-button:hover,
.sage-tarot-guide-button:focus-visible,
.sage-tarot-guide-button[aria-expanded='true'] {
  border-color: #ffdf97;
  background: linear-gradient(130deg, rgba(73, 30, 89, .96), rgba(28, 11, 43, .96));
  box-shadow: 0 0 18px rgba(221, 155, 64, .15), 0 5px 19px rgba(0,0,0,.47);
}

.sage-tarot-guide-button:focus-visible {
  outline: 2px solid #f6ca82;
  outline-offset: 2px;
}

.sage-tarot-guide-veil {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: block;
  width: 100%;
  height: 100%;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: rgba(2, 1, 6, .53);
  cursor: default;
}

.sage-tarot-guide-veil[hidden],
.sage-tarot-guide-panel[hidden],
.sage-tarot-reveal-cue[hidden] { display: none !important; }

.sage-tarot-guide-panels { position: relative; z-index: 0; }
.sage-tarot-guide-panel {
  position: fixed;
  top: 63px;
  right: clamp(18px, 5vw, 74px);
  z-index: 95;
  width: min(800px, calc(100vw - 36px));
  max-height: min(67dvh, 620px);
  overflow-y: auto;
  padding: clamp(19px, 2vw, 28px);
  border: 1px solid rgba(237, 192, 103, .57);
  border-radius: 18px;
  background: linear-gradient(145deg, rgba(33, 15, 43, .98), rgba(8, 5, 16, .985));
  color: #f4e7ea;
  box-shadow: 0 23px 70px rgba(0, 0, 0, .75), 0 0 25px rgba(140, 52, 166, .13);
  scrollbar-width: thin;
  scrollbar-color: #96749e #191020;
}

.sage-tarot-guide-panel:focus { outline: none; }
.sage-tarot-guide-heading {
  margin: 0 0 14px;
  color: #f1c875;
  font: 600 clamp(22px, 2.4vw, 32px)/1.12 Georgia, serif;
  letter-spacing: .03em;
}

.sage-tarot-guide-panel h3 {
  margin: 0 0 8px;
  color: #f1d394;
  font: 600 clamp(17px, 1.4vw, 21px)/1.2 Georgia, serif;
}
.sage-tarot-guide-panel p {
  margin: 0 0 11px;
  color: #decfdd;
  font: 400 clamp(13px, 1.1vw, 15px)/1.65 system-ui, sans-serif;
}
.sage-tarot-guide-panel .sage-tarot-heritage {
  padding: 12px 15px;
  border-left: 3px solid #d8a95c;
  background: rgba(109, 48, 107, .15);
  color: #f8dba8;
}
.sage-tarot-guide-panel .tarot-editorial-intro h2 {
  margin: 8px 0 12px;
  font: 600 22px/1.2 Georgia, serif;
  color: #efc883;
}
.sage-tarot-guide-panel .tarot-editorial-kicker,
.sage-tarot-guide-panel .tarot-guide-number {
  display: inline-block;
  margin-bottom: 8px;
  color: #e8afda;
  font: 700 11px/1.2 Arial,sans-serif;
  letter-spacing: .13em;
}
.sage-tarot-guide-panel .tarot-position-guide {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 13px;
}
.sage-tarot-guide-panel .tarot-position-guide article,
.sage-tarot-guide-panel .tarot-info-card {
  min-width: 0;
  padding: 16px;
  margin: 0 0 12px;
  border: 1px solid rgba(226, 177, 92, .21);
  border-radius: 12px;
  background: rgba(95, 49, 105, .14);
}
.sage-tarot-guide-panel .tarot-position-guide article:nth-child(1) {border-top:2px solid #f48abd;}
.sage-tarot-guide-panel .tarot-position-guide article:nth-child(2) {border-top:2px solid #f2c36e;}
.sage-tarot-guide-panel .tarot-position-guide article:nth-child(3) {border-top:2px solid #cb9ef2;}

.sage-tarot-welcome {
  position: fixed;
  z-index: 10;
  top: clamp(76px, 12vh, 115px);
  left: 50%;
  width: min(690px, 76vw);
  pointer-events: none;
  transform: translateX(-50%);
  text-align: center;
  color: #ffdc94;
  text-shadow: 0 0 13px rgba(246, 171, 59, .38), 0 2px 8px #000;
  font: 400 clamp(12px, 1.15vw, 16px)/1.45 Georgia, serif;
  letter-spacing: .035em;
  animation: sage-welcome-vanish 8.5s ease-out both;
}
.sage-tarot-welcome-line { display: block; overflow: hidden; white-space: nowrap; }
.sage-tarot-welcome-line-one {
  animation: sage-ink-arrival 2.4s .3s ease both;
}
.sage-tarot-welcome-line-two {
  margin-top: 4px;
  color: #e5c7ee;
  animation: sage-ink-arrival 2.6s 1.7s ease both;
}

.sage-tarot-ambient-light {
  position: fixed;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  opacity: .18;
  background:
    radial-gradient(ellipse at 49% 20%, rgba(229, 180, 90, .16), transparent 29%),
    radial-gradient(ellipse at 35% 58%, rgba(151, 66, 174, .14), transparent 39%),
    radial-gradient(ellipse at 78% 49%, rgba(197, 104, 166, .11), transparent 34%);
  animation: sage-room-breathe 11s ease-in-out infinite alternate;
}

.sage-tarot-experience-v1 .card-stage {
  animation: sage-card-hover-drift 8.5s ease-in-out infinite;
  will-change: transform;
}
.sage-tarot-experience-v1 .reading-position:nth-child(2) .card-stage {animation-delay: -2.7s;}
.sage-tarot-experience-v1 .reading-position:nth-child(3) .card-stage {animation-delay: -5.2s;}
.sage-tarot-experience-v1 .tarot-card:hover { filter: brightness(1.075); }
.sage-tarot-experience-v1 .card-inner { transition-duration: 900ms; }
.sage-tarot-experience-v1 .question-panel:focus-within {
  box-shadow: 0 0 24px rgba(217, 157, 67, .18), 0 0 16px rgba(152, 75, 184, .15) !important;
}
.sage-tarot-experience-v1 .reading-controls button:not(:disabled):hover { filter: brightness(1.08); }

.sage-tarot-reveal-cue {
  position: fixed;
  z-index: 12;
  left: 50%;
  top: clamp(75px, 12vh, 116px);
  width: min(680px, 76vw);
  transform: translateX(-50%);
  padding: 5px 15px;
  margin: 0;
  pointer-events: none;
  border-radius: 99px;
  background: rgba(8, 4, 17, .40);
  color: #f5d890;
  text-align: center;
  text-shadow: 0 0 14px rgba(213, 173, 83, .25), 0 2px 8px #000;
  font: 600 clamp(12px, 1.1vw, 15px)/1.35 Georgia, serif;
  animation: sage-soft-ink-reveal .6s ease both;
}
.sage-tarot-experience-v1:has(.tarot-card) .sage-tarot-welcome {display: none !important;}

.sage-tarot-experience-v1 .free-reading-stage:not([hidden]) .free-reading-direct,
.sage-tarot-experience-v1 .free-reading-stage:not([hidden]) .free-reading-message,
.sage-tarot-experience-v1 .free-reading-stage:not([hidden]) .free-reading-insight,
.sage-tarot-experience-v1 .free-reading-stage:not([hidden]) .free-reading-card {
  animation: sage-soft-ink-reveal .85s ease-out both;
}
.sage-tarot-experience-v1 .free-reading-stage:not([hidden]) .free-reading-message { animation-delay: .1s; }
.sage-tarot-experience-v1 .free-reading-stage:not([hidden]) .free-reading-insight { animation-delay: .15s; }

@keyframes sage-ink-arrival {
  0% { opacity: 0; clip-path: inset(0 100% 0 0); filter: blur(2px); }
  60% { opacity: .92; filter: blur(0); }
  100% { opacity: 1; clip-path: inset(0 0 0 0); filter: blur(0); }
}
@keyframes sage-welcome-vanish {
  0%, 72% { opacity: 1; }
  98%, 100% { opacity: 0; }
}
@keyframes sage-room-breathe {
  from { opacity: .09; transform: scale(1); }
  to { opacity: .23; transform: scale(1.025); }
}
@keyframes sage-card-hover-drift {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-4px); }
}
@keyframes sage-soft-ink-reveal {
  from {opacity: 0; filter: blur(2px);}
  to {opacity: 1; filter: blur(0);}
}

@media (max-width: 1100px) and (min-width: 900px) {
  .sage-tarot-guide-system { left: 152px; right: 12px; }
  .sage-tarot-guide-controls { gap: 5px; }
  .sage-tarot-guide-button { font-size: 9px; padding: 6px 5px; }
}

@media (max-width: 899px) {
  .sage-tarot-guide-system {
    position: relative;
    top: auto;
    left: auto;
    right: auto;
    width: 100%;
    margin: 52px auto 16px;
    z-index: 90;
  }
  .sage-tarot-guide-controls {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 7px;
  }
  .sage-tarot-guide-button {min-height: 35px; padding: 6px 7px; font-size: 10px;}
  .sage-tarot-guide-panel {
    top: clamp(135px, 21vh, 185px);
    right: 50%;
    transform: translateX(50%);
    max-height: min(67dvh, 590px);
  }
  .sage-tarot-welcome {
    position: fixed;
    top: clamp(143px, 22vh, 196px);
    left: 50%;
    transform: translateX(-50%);
    width: min(700px, 93vw);
    margin: 0;
  }
  .sage-tarot-reveal-cue {
    position: relative;
    top: auto;
    left: auto;
    transform: none;
    width: min(700px, 95%);
    margin: 12px auto;
  }
  .sage-tarot-welcome-line {white-space: normal;}
  .sage-tarot-guide-panel .tarot-position-guide {grid-template-columns:1fr;}
}

@media (prefers-reduced-motion: reduce) {
  .sage-tarot-ambient-light,
  .sage-tarot-welcome,
  .sage-tarot-welcome-line,
  .sage-tarot-reveal-cue,
  .sage-tarot-experience-v1 .card-stage,
  .sage-tarot-experience-v1 .free-reading-stage:not([hidden]) .free-reading-direct,
  .sage-tarot-experience-v1 .free-reading-stage:not([hidden]) .free-reading-message,
  .sage-tarot-experience-v1 .free-reading-stage:not([hidden]) .free-reading-insight,
  .sage-tarot-experience-v1 .free-reading-stage:not([hidden]) .free-reading-card {
    animation: none !important;
    transform: none !important;
    filter: none !important;
  }
  .sage-tarot-welcome {opacity: 1 !important;}
  .sage-tarot-welcome-line {opacity: 1 !important; clip-path:none !important;}
  .sage-tarot-guide-button {transition: none !important;}
}
