/* ==========================================================================
   Qwen38 Panchang Orbit — the living Panchang Yantra (DOM chrome only)
   Antique gold instrument on conch paper. Canvas paints the sky;
   plaque, tooltip and ayanamsa stay DOM so they are sharp at any DPI.
   ========================================================================== */

.gpo-orbit {
  --po-conch: #fbf8f0;
  --po-paper: #fffdf8;
  --po-stone: #70665c;
  --po-ink: #232019;
  --po-vermilion: #b94a2f;
  --po-copper: #8a5a30;
  --po-brass: #a07030;
  --po-gold: #c4922a;
  --po-peacock: #3f6c8f;
  --po-display: "Iowan Old Style", "Palatino Linotype", "Book Antiqua", Constantia,
    Georgia, "Noto Sans Devanagari", Mangal, serif;
  --po-ui: "Trebuchet MS", Candara, "Segoe UI", "Noto Sans Devanagari", Mangal, sans-serif;
  --po-mono: Consolas, "Courier New", "Noto Sans Devanagari", Mangal, monospace;

  position: relative;
  width: 100%;
  aspect-ratio: 1 / 0.82;
  isolation: isolate;
  user-select: none;
  -webkit-user-select: none;
  cursor: pointer;
}

.gpo-orbit__canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  background: transparent;
  outline: none;
  touch-action: pan-y;
  opacity: 0;
  transition: opacity 900ms cubic-bezier(.22, 1, .36, 1);   /* live curve */
}
.gpo-orbit.is-ready .gpo-orbit__canvas { opacity: 1; }

/* ---------- ayanamsa inscription (top) ---------- */

.gpo-ayanamsa {
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  margin: 0;
  pointer-events: none;
  color: var(--po-copper);
  font-family: var(--po-mono);
  font-size: clamp(9px, 1vw, 11px);
  letter-spacing: 0.14em;
  opacity: 0.75;
  white-space: nowrap;
  max-width: 96%;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ---------- plaque (bottom caption band — sits below the yantra, never on it) ---------- */

.gpo-plaque {
  position: absolute;
  left: 50%;
  right: auto;
  bottom: 1%;
  transform: translateX(-50%);
  width: 100%;
  max-width: 100%;
  padding: 0 2%;
  pointer-events: none;
  text-align: center;
  background: none;
  border-radius: 0;
  box-shadow: none;
  backdrop-filter: none;
}
.gpo-plaque__mark,
.gpo-plaque__kicker { display: none; }        /* brand already in the page header */
.gpo-plaque__line {
  margin: 0 auto;
  max-width: 96%;                             /* one line where it fits, wraps to two only on the narrowest screens */
  color: var(--po-ink);
  font-family: var(--po-display);
  font-size: clamp(10px, 1.2vw, 13px);
  font-weight: 500;
  line-height: 1.3;
  min-height: 1.3em;                          /* no layout jump while typing */
  /* paper halo keeps the line readable over the plate's contact shadow */
  text-shadow:
    0 0 7px var(--po-paper),
    0 0 7px var(--po-paper),
    0 1px 0 var(--po-paper);
}
.gpo-orbit.is-held .gpo-plaque__kicker::after {
  content: " ·";
  color: var(--po-brass);
}

/* ---------- graha tooltip ---------- */

.gpo-tip {
  position: absolute;
  z-index: 3;
  max-width: 210px;
  padding: 9px 12px 8px;
  pointer-events: none;
  display: flex;
  flex-direction: column;
  gap: 3px;
  background: rgba(35, 32, 25, 0.92);
  color: var(--po-conch);
  border-radius: 7px;
  border: 1px solid rgba(196, 146, 42, 0.4);
  box-shadow: 0 14px 30px -12px rgba(20, 12, 4, 0.5);
  font-family: var(--po-ui);
  animation: gpo-tip-in 160ms cubic-bezier(.22, 1, .36, 1);
}
/* CRITICAL: author display:flex overrides the UA [hidden] rule, so the
   tooltip never disappeared on pointer-leave. Force hidden to win. */
.gpo-tip[hidden] {
  display: none !important;
}
.gpo-tip__name {
  font-family: var(--po-display);
  font-size: 14px;
  font-weight: 600;
  color: #f0d078;
}

/* bare variant — rashi name only, no box, dark antique gold */
.gpo-tip--bare {
  background: none;
  border: none;
  box-shadow: none;
  padding: 0;
  animation: none;
}
.gpo-tip--bare .gpo-tip__name {
  color: #8a5a1c;
  font-size: 15px;
  letter-spacing: 0.01em;
  text-shadow:
    0 0 6px var(--po-paper),
    0 0 6px var(--po-paper),
    0 1px 0 var(--po-paper);
}
.gpo-tip span {
  font-size: 11.5px;
  line-height: 1.35;
  opacity: 0.92;
}
.gpo-tip__badge {
  margin-top: 2px;
  font-style: normal;
  font-family: var(--po-mono);
  font-size: 10px;
  letter-spacing: 0.08em;
  color: rgba(240, 208, 130, 0.85);
}
@keyframes gpo-tip-in {
  from { opacity: 0; transform: translateY(4px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ---------- fallback ring when canvas is unavailable ---------- */

.gpo-orbit.is-unavailable::before {
  content: "";
  position: absolute;
  inset: 18%;
  border: 1px solid rgba(169, 94, 28, 0.2);
  border-radius: 50%;
}

/* ---------- responsive ---------- */

@media (max-width: 680px) {
  .gpo-plaque__line { font-size: 12px; }
  .gpo-ayanamsa { display: none; }             /* unclutter small screens */
  .gpo-tip { max-width: 170px; }
}

/* ---------- motion preferences ---------- */

@media (prefers-reduced-motion: reduce) {
  .gpo-orbit__canvas { transition-duration: 0ms; }
  .gpo-tip { animation: none; }
}
