/* Visual effects layer — see fx.js. Decorative only; the global reduced-motion rule in styles.css stills it. */

/* ------------------------------------------------------------------ Hero sky */
.hero {
  position: relative; overflow: hidden; isolation: isolate;
  min-height: 210px; margin: 0 0 16px; padding: 22px 20px; border-radius: 26px;
  display: flex; align-items: center;
  background: #0a0718; color: #fdf6e3;
  border: 1.2px solid rgba(252, 211, 77, 0.35);
  box-shadow: 0 14px 40px rgba(46, 16, 101, 0.28), inset 0 0 0 1px rgba(255, 255, 255, 0.03);
  transform: perspective(900px) rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg));
  transition: transform 300ms ease;
}
.hero-sky { position: absolute; inset: 0; z-index: -2; }
.hero-sky svg { width: 100%; height: 100%; display: block; }
.hero::before {
  content: ''; position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background: linear-gradient(90deg, rgba(10, 7, 24, 0.85) 0%, rgba(10, 7, 24, 0.55) 45%, rgba(10, 7, 24, 0) 75%);
}
.hero-copy { max-width: 60%; }
.hero-tag { font-size: 10px; font-weight: 700; letter-spacing: 2px; color: #fcd34d; }
.hero h2 {
  margin: 6px 0 8px; font-family: var(--font-serif); font-weight: 600; font-size: 27px; line-height: 1.12;
  color: #fff;
}
.hero h2 em {
  font-style: italic;
  background: linear-gradient(90deg, #fde68a, #f59e0b, #f472b6, #fde68a); background-size: 300% 100%;
  -webkit-background-clip: text; background-clip: text; color: transparent;
  animation: fxShimmer 6s linear infinite;
}
.hero-rotator { margin: 0 0 14px; font-size: 13.5px; color: #e9e3f5; min-height: 1.4em; }
#heroTopic {
  display: inline-block; font-weight: 600; color: #fcd34d;
  transition: opacity 300ms ease, transform 300ms ease;
}
#heroTopic.out { opacity: 0; transform: translateY(-8px); }
.hero-cta { height: 42px; padding: 0 20px; font-size: 13.5px; }
[data-theme="dark"] .hero-cta { color: #1c1917; }
@media (max-width: 420px) {
  .hero { min-height: 196px; padding: 18px 16px; }
  .hero h2 { font-size: 23px; }
  .hero-copy { max-width: 66%; }
}

/* Wide screens: banner and astrologer list side by side; the banner stays in view while the list scrolls */
/* ------------------------------------------------------------------ Horizontal astrologer row */
.home-list { min-width: 0; }
.home-list .list-head { align-items: center; }
.online-note { margin: 4px 0 0; color: var(--upright); font-weight: 600; display: flex; align-items: center; gap: 6px; }
.online-note:empty { display: none; }
.online-note::before {
  content: ''; width: 7px; height: 7px; border-radius: 50%; background: var(--upright);
  animation: radarPulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}
.astro-nav { display: flex; gap: 6px; flex: none; align-self: flex-end; }
.astro-nav button {
  width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; font-size: 20px; line-height: 1;
  color: var(--gold-light); background: var(--surface-dark); border: 1px solid var(--gold-border); cursor: pointer;
  box-shadow: var(--card-shadow); transition: transform 150ms ease, opacity 150ms ease;
}
.astro-nav button:hover:not(:disabled) { transform: scale(1.08); border-color: var(--gold); }
.astro-nav button:disabled { opacity: 0.35; cursor: default; }
.astro-list {
  flex-direction: row; overflow-x: auto; overscroll-behavior-x: contain; scroll-snap-type: x mandatory;
  gap: 12px; padding: 4px 4px 14px; margin: 0 -4px; scrollbar-width: thin; scrollbar-color: var(--gold-border) transparent;
}
.astro-list > p { flex: 1; }
.astro-list .astro-card {
  flex: 0 0 212px; flex-direction: column; align-items: center; text-align: center; gap: 8px;
  padding: 18px 14px 14px; scroll-snap-align: start; flex-wrap: nowrap;
}
.astro-list .astro-avatar { width: 66px; height: 66px; }
.astro-list .astro-info { flex: 1 1 auto; width: 100%; display: flex; flex-direction: column; align-items: center; }
.astro-list .astro-name { flex-direction: column; gap: 5px; font-size: 15px; }
.astro-list .astro-meta {
  font-size: 11.5px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.astro-list .astro-tags { justify-content: center; }
.astro-list .astro-bio { -webkit-line-clamp: 3; }
.astro-list .astro-cta {
  width: 100%; flex-direction: row; justify-content: space-between; align-items: center; margin-top: auto; padding-top: 4px;
}
.astro-list .astro-cta .btn { padding: 0 16px; }

@media (min-width: 760px) {
  .home-top { display: grid; grid-template-columns: minmax(260px, 0.7fr) minmax(0, 1.3fr); gap: 18px; align-items: stretch; }
  .home-top .hero {
    margin: 0; min-height: 0;
    flex-direction: column; align-items: stretch; justify-content: flex-start; padding: 26px 22px;
    background:
      radial-gradient(1.2px 1.2px at 18% 22%, #fffc, transparent), radial-gradient(1px 1px at 72% 12%, #fff9, transparent),
      radial-gradient(1.4px 1.4px at 46% 36%, #fffb, transparent), radial-gradient(1px 1px at 86% 40%, #fff8, transparent),
      radial-gradient(1px 1px at 30% 48%, #fff7, transparent), radial-gradient(1.2px 1.2px at 8% 8%, #fff9, transparent),
      radial-gradient(90% 60% at 70% 10%, rgba(124, 58, 237, 0.35), transparent 70%), #0a0718;
  }
  .home-top .hero-sky {
    inset: auto 0 0 -45%; height: 64%;
    -webkit-mask-image: linear-gradient(to bottom, transparent, #000 28%); mask-image: linear-gradient(to bottom, transparent, #000 28%);
  }
  .home-top .hero::before { background: linear-gradient(180deg, rgba(10, 7, 24, 0.55) 0%, rgba(10, 7, 24, 0) 45%); }
  .home-top .hero-copy { max-width: none; }
  .home-top .hero h2 { font-size: 30px; }
  .home-top .list-head { margin-top: 0; }
  .home-top .home-list .astro-list { padding-bottom: 6px; }
}
@media (max-width: 759px) {
  .astro-nav { display: none; }
}
.astro-list.fx-flash .astro-card { animation: fxFlash 1.1s ease; }
@keyframes fxFlash { 30% { border-color: var(--gold); box-shadow: 0 0 0 4px rgba(245, 158, 11, 0.22), var(--card-shadow); } }

.hero-sky .tw { animation: fxTwinkle 3s ease-in-out infinite; }
.hero-sky .wheel { animation: fxSpin 90s linear infinite; }
.hero-sky .glyphs text { animation: fxSpin 90s linear infinite reverse; transform-box: fill-box; transform-origin: center; }
.hero-sky .rays { animation: fxSpin 24s linear infinite; }
.hero-sky .halo { animation: fxBreathe 4s ease-in-out infinite; }
.hero-sky .o1 { animation: fxSpin 9s linear infinite; }
.hero-sky .o2 { animation: fxSpin 16s linear infinite reverse; }
.hero-sky .o3 { animation: fxSpin 26s linear infinite; }
.hero-sky .neb-a { animation: fxDrift 14s ease-in-out infinite alternate; }
.hero-sky .neb-b { animation: fxDrift 18s ease-in-out infinite alternate-reverse; }
.hero-sky .moon { animation: fxBob 6s ease-in-out infinite; }
.hero-sky .shoot { opacity: 0; animation: fxShoot 7s ease-in 2s infinite; }

/* ------------------------------------------------------------------ Avatars */
.astro-avatar:has(.fx-avatar) { background: none; padding: 0; }
.fx-avatar { width: 100%; height: 100%; border-radius: 50%; display: block; }
.fx-av-ring { animation: fxSpin 40s linear infinite; }
.astro-card:hover .fx-av-ring { animation-duration: 8s; }
.astro-avatar .dot { z-index: 1; }

/* ------------------------------------------------------------------ Lotus */
.fx-lotus-wrap { width: 70px; height: 70px; overflow: visible; position: relative; }
.fx-lotus-wrap::after {
  content: ''; position: absolute; inset: -6px; border-radius: 50%; pointer-events: none;
  border: 1px dashed var(--gold-border); animation: fxSpin 30s linear infinite;
}
.fx-lotus { width: 54px; height: 44px; overflow: visible; }
.fx-lotus .petal { transform-origin: 0 0; animation: fxBloom 900ms cubic-bezier(0.2, 0.9, 0.3, 1.25) var(--d, 0s) backwards; }
.fx-lotus .sway { animation: fxSway 5s ease-in-out 1.4s infinite; }
.fx-lotus .glow { animation: fxBreathe 3.5s ease-in-out infinite; transform-box: fill-box; transform-origin: center; }
.overlay:not([hidden]) .fx-lotus .petal { animation-name: fxBloom; }

/* ------------------------------------------------------------------ Chat room */
.chat-room { isolation: isolate; }
.room-mandala {
  position: absolute; inset: 0; z-index: -1; pointer-events: none; overflow: hidden;
  display: grid; place-items: center; color: var(--gold); opacity: 0.07;
}
[data-theme="dark"] .room-mandala { opacity: 0.09; }
.room-mandala svg { width: min(120vw, 760px); height: auto; }
.room-mandala .m-out { animation: fxSpin 160s linear infinite; }
.room-mandala .m-mid { animation: fxSpin 110s linear infinite reverse; }
.room-mandala .m-in { animation: fxSpin 70s linear infinite; }
.room-head { position: relative; }
.msg.fx-pop .bubble { animation: fxPop 420ms cubic-bezier(0.2, 0.9, 0.3, 1.3) backwards; }
.msg.user.fx-pop .bubble { transform-origin: bottom right; }
.msg.pandit.fx-pop .bubble { transform-origin: top left; }

/* ------------------------------------------------------------------ Reveal, tilt, panels */
.fx-pending { opacity: 0; }
.fx-in { animation: fxReveal 640ms cubic-bezier(0.2, 0.8, 0.2, 1) var(--fx-delay, 0ms) backwards; }

.tab-panel.active { animation: fxPanel 360ms cubic-bezier(0.2, 0.8, 0.2, 1) backwards; }

.astro-card.fx-tilting {
  transform: perspective(900px) rotateX(var(--rx)) rotateY(var(--ry)) translateY(-3px);
  transition: transform 80ms linear, box-shadow 220ms ease, border-color 220ms ease;
}
.rashi-tile.fx-tilting {
  transform: perspective(500px) rotateX(var(--rx)) rotateY(var(--ry)) translateY(-3px);
  transition: transform 80ms linear;
}
.astro-card::after, .rashi-tile::after {
  content: ''; position: absolute; inset: 0; border-radius: inherit; pointer-events: none; opacity: 0;
  background: radial-gradient(240px circle at var(--mx, 50%) var(--my, 50%), rgba(252, 211, 77, 0.16), transparent 60%);
  transition: opacity 200ms ease;
}
.astro-card.fx-tilting::after, .rashi-tile.fx-tilting::after { opacity: 1; }
.rashi-tile { position: relative; overflow: hidden; }

/* Codex glyphs float and glow, each a little out of step */
.rashi-tile .g { display: inline-block; animation: fxFloat 4.2s ease-in-out infinite; }
.rashi-tile:nth-child(3n + 1) .g { animation-delay: -1.4s; }
.rashi-tile:nth-child(3n + 2) .g { animation-delay: -2.8s; }
.rashi-tile:hover .g { animation-duration: 1.4s; text-shadow: 0 0 14px rgba(245, 158, 11, 0.6); }
.rf-glyph { animation: fxFloat 4s ease-in-out infinite, fxGlow 3s ease-in-out infinite; }

/* Panchang moon and header logo */
.moon-disc { animation: fxGlow 3.6s ease-in-out infinite; }
.logo { position: relative; overflow: visible; }
.logo img { border-radius: 50%; }
.logo::after {
  content: ''; position: absolute; inset: -5px; border-radius: 50%; pointer-events: none;
  background: conic-gradient(from 0deg, transparent 0 70%, var(--gold) 85%, transparent 100%);
  -webkit-mask: radial-gradient(circle, transparent 58%, #000 60%); mask: radial-gradient(circle, transparent 58%, #000 60%);
  animation: fxSpin 5s linear infinite;
}

/* ------------------------------------------------------------------ Ripple and sparkle burst */
.fx-ripple-host { position: relative; overflow: hidden; }
.fx-ripple {
  position: absolute; border-radius: 50%; pointer-events: none;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.45), rgba(255, 255, 255, 0) 60%);
  transform: scale(0); animation: fxRipple 620ms ease-out forwards;
}
.tab .fx-ripple, .rashi-tile .fx-ripple, .lunar-banner .fx-ripple, .chart-strip .fx-ripple {
  background: radial-gradient(circle, rgba(217, 119, 6, 0.22), rgba(217, 119, 6, 0) 60%);
}
.fx-burst { position: fixed; z-index: 100; width: 0; height: 0; pointer-events: none; }
.fx-burst span {
  position: absolute; left: -6px; top: -9px; font-size: 14px; color: #f59e0b;
  text-shadow: 0 0 8px rgba(245, 158, 11, 0.8);
  animation: fxBurst 820ms cubic-bezier(0.15, 0.7, 0.3, 1) forwards;
}
.fx-burst span:nth-child(3n) { color: #a855f7; text-shadow: 0 0 8px rgba(168, 85, 247, 0.8); }
.fx-burst span:nth-child(4n) { color: #f472b6; }

/* ------------------------------------------------------------------ Keyframes */
@keyframes fxSpin { to { transform: rotate(360deg); } }
@keyframes fxTwinkle { 0%, 100% { opacity: 0.25; } 50% { opacity: 1; } }
@keyframes fxBreathe { 0%, 100% { opacity: 0.65; transform: scale(1); } 50% { opacity: 1; transform: scale(1.12); } }
@keyframes fxDrift { from { transform: translate(-12px, -6px); } to { transform: translate(14px, 8px); } }
@keyframes fxBob { 0%, 100% { transform: translate(46px, 34px); } 50% { transform: translate(46px, 29px); } }
@keyframes fxShoot {
  0% { opacity: 0; transform: translate(60px, 10px) rotate(18deg); }
  4% { opacity: 1; }
  14% { opacity: 0; transform: translate(230px, 66px) rotate(18deg); }
  100% { opacity: 0; transform: translate(230px, 66px) rotate(18deg); }
}
@keyframes fxShimmer { to { background-position: 300% 0; } }
@keyframes fxBloom { from { transform: scale(0.15, 0.05); opacity: 0; } }
@keyframes fxSway { 0%, 100% { transform: rotate(-2.5deg); } 50% { transform: rotate(2.5deg); } }
@keyframes fxPop { from { opacity: 0; transform: scale(0.82) translateY(6px); } }
@keyframes fxReveal { from { opacity: 0; transform: translateY(18px) scale(0.98); } }
@keyframes fxPanel { from { opacity: 0; transform: translateY(8px); } }
@keyframes fxFloat { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-4px); } }
@keyframes fxGlow { 0%, 100% { filter: drop-shadow(0 0 0 rgba(245, 158, 11, 0)); } 50% { filter: drop-shadow(0 0 8px rgba(245, 158, 11, 0.55)); } }
@keyframes fxRipple { to { transform: scale(1); opacity: 0; } }
@keyframes fxBurst {
  0% { transform: translate(0, 0) scale(0.3); opacity: 1; }
  100% { transform: translate(var(--dx), var(--dy)) scale(var(--s, 1)) rotate(120deg); opacity: 0; }
}

@media (prefers-reduced-motion: reduce) {
  .fx-pending { opacity: 1; }
  .hero-sky .shoot { display: none; }
}
